From 8cf2d952f2330ed27cb9baa9e03f1d1b5b41b0ba Mon Sep 17 00:00:00 2001 From: JP Cen Date: Tue, 31 Oct 2023 03:46:27 -0400 Subject: [PATCH] 0.8.5 --- main.js | 78380 ++++++++++++++++++++++++------------------------ manifest.json | 2 +- styles.css | 1489 +- 3 files changed, 40019 insertions(+), 39852 deletions(-) diff --git a/main.js b/main.js index e352439..dca8075 100644 --- a/main.js +++ b/main.js @@ -46,1215 +46,631 @@ var __toBinary = /* @__PURE__ */ (() => { }; })(); -// node_modules/fuzzysort/fuzzysort.js -var require_fuzzysort = __commonJS({ - "node_modules/fuzzysort/fuzzysort.js"(exports, module2) { - ((root, UMD) => { - if (typeof define === "function" && define.amd) - define([], UMD); - else if (typeof module2 === "object" && module2.exports) - module2.exports = UMD(); - else - root["fuzzysort"] = UMD(); - })(exports, (_12) => { - "use strict"; - var single = (search, target) => { - if (search == "farzher") - return { target: "farzher was here (^-^*)/", score: 0, _indexes: [0] }; - if (!search || !target) - return NULL; - var preparedSearch = getPreparedSearch(search); - if (!isObj(target)) - target = getPrepared(target); - var searchBitflags = preparedSearch.bitflags; - if ((searchBitflags & target._bitflags) !== searchBitflags) - return NULL; - return algorithm(preparedSearch, target); +// node_modules/lodash/lodash.js +var require_lodash = __commonJS({ + "node_modules/lodash/lodash.js"(exports, module2) { + (function() { + var undefined2; + var VERSION = "4.17.21"; + var LARGE_ARRAY_SIZE = 200; + var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var MAX_MEMOIZE_SIZE = 500; + var PLACEHOLDER = "__lodash_placeholder__"; + var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; + var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; + var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; + var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; + var HOT_COUNT = 800, HOT_SPAN = 16; + var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; + var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; + var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + var wrapFlags = [ + ["ary", WRAP_ARY_FLAG], + ["bind", WRAP_BIND_FLAG], + ["bindKey", WRAP_BIND_KEY_FLAG], + ["curry", WRAP_CURRY_FLAG], + ["curryRight", WRAP_CURRY_RIGHT_FLAG], + ["flip", WRAP_FLIP_FLAG], + ["partial", WRAP_PARTIAL_FLAG], + ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], + ["rearg", WRAP_REARG_FLAG] + ]; + var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; + var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; + var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); + var reTrimStart = /^\s+/; + var reWhitespace = /\s/; + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + var reEscapeChar = /\\(\\)?/g; + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + var reFlags = /\w*$/; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsOctal = /^0o[0-7]+$/i; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var reNoMatch = /($^)/; + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\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", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; + var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; + var reApos = RegExp(rsApos, "g"); + var reComboMark = RegExp(rsCombo, "g"); + var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); + var reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", + rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", + rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, + rsUpper + "+" + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join("|"), "g"); + var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var contextProps = [ + "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" + ]; + var templateCounter = -1; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; + var deburredLetters = { + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\xC7": "C", + "\xE7": "c", + "\xD0": "D", + "\xF0": "d", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\xD1": "N", + "\xF1": "n", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\xDD": "Y", + "\xFD": "y", + "\xFF": "y", + "\xC6": "Ae", + "\xE6": "ae", + "\xDE": "Th", + "\xFE": "th", + "\xDF": "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" }; - var go = (search, targets, options) => { - if (search == "farzher") - return [{ target: "farzher was here (^-^*)/", score: 0, _indexes: [0], obj: targets ? targets[0] : NULL }]; - if (!search) - return options && options.all ? all(search, targets, options) : noResults; - var preparedSearch = getPreparedSearch(search); - var searchBitflags = preparedSearch.bitflags; - var containsSpace = preparedSearch.containsSpace; - var threshold = options && options.threshold || INT_MIN; - var limit = options && options["limit"] || INT_MAX; - var resultsLen = 0; - var limitedCount = 0; - var targetsLen = targets.length; - if (options && options.key) { - var key2 = options.key; - for (var i4 = 0; i4 < targetsLen; ++i4) { - var obj = targets[i4]; - var target = getValue(obj, key2); - if (!target) - continue; - if (!isObj(target)) - target = getPrepared(target); - if ((searchBitflags & target._bitflags) !== searchBitflags) - continue; - var result = algorithm(preparedSearch, target); - if (result === NULL) - continue; - if (result.score < threshold) - continue; - result = { target: result.target, _targetLower: "", _targetLowerCodes: NULL, _nextBeginningIndexes: NULL, _bitflags: 0, score: result.score, _indexes: result._indexes, obj }; - if (resultsLen < limit) { - q5.add(result); - ++resultsLen; - } else { - ++limitedCount; - if (result.score > q5.peek().score) - q5.replaceTop(result); - } + var htmlEscapes = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }; + var htmlUnescapes = { + "&": "&", + "<": "<", + ">": ">", + """: '"', + "'": "'" + }; + var stringEscapes = { + "\\": "\\", + "'": "'", + "\n": "n", + "\r": "r", + "\u2028": "u2028", + "\u2029": "u2029" + }; + var freeParseFloat = parseFloat, freeParseInt = parseInt; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + var nodeUtil = function() { + try { + var types2 = freeModule && freeModule.require && freeModule.require("util").types; + if (types2) { + return types2; } - } else if (options && options.keys) { - var scoreFn = options["scoreFn"] || defaultScoreFn; - var keys = options.keys; - var keysLen = keys.length; - for (var i4 = 0; i4 < targetsLen; ++i4) { - var obj = targets[i4]; - var objResults = new Array(keysLen); - for (var keyI = 0; keyI < keysLen; ++keyI) { - var key2 = keys[keyI]; - var target = getValue(obj, key2); - if (!target) { - objResults[keyI] = NULL; - continue; - } - if (!isObj(target)) - target = getPrepared(target); - if ((searchBitflags & target._bitflags) !== searchBitflags) - objResults[keyI] = NULL; - else - objResults[keyI] = algorithm(preparedSearch, target); - } - objResults.obj = obj; - var score = scoreFn(objResults); - if (score === NULL) - continue; - if (score < threshold) - continue; - objResults.score = score; - if (resultsLen < limit) { - q5.add(objResults); - ++resultsLen; - } else { - ++limitedCount; - if (score > q5.peek().score) - q5.replaceTop(objResults); - } + return freeProcess && freeProcess.binding && freeProcess.binding("util"); + } catch (e4) { + } + }(); + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args[0]); + case 2: + return func.call(thisArg, args[0], args[1]); + case 3: + return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, length = array == null ? 0 : array.length; + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + function arrayEach(array, iteratee) { + var index = -1, length = array == null ? 0 : array.length; + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; } - } else { - for (var i4 = 0; i4 < targetsLen; ++i4) { - var target = targets[i4]; - if (!target) - continue; - if (!isObj(target)) - target = getPrepared(target); - if ((searchBitflags & target._bitflags) !== searchBitflags) - continue; - var result = algorithm(preparedSearch, target); - if (result === NULL) - continue; - if (result.score < threshold) - continue; - if (resultsLen < limit) { - q5.add(result); - ++resultsLen; - } else { - ++limitedCount; - if (result.score > q5.peek().score) - q5.replaceTop(result); - } + } + return array; + } + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; } } - if (resultsLen === 0) - return noResults; - var results = new Array(resultsLen); - for (var i4 = resultsLen - 1; i4 >= 0; --i4) - results[i4] = q5.poll(); - results.total = resultsLen + limitedCount; - return results; - }; - var highlight = (result, hOpen, hClose) => { - if (typeof hOpen === "function") - return highlightCallback(result, hOpen); - if (result === NULL) - return NULL; - if (hOpen === void 0) - hOpen = ""; - if (hClose === void 0) - hClose = ""; - var highlighted = ""; - var matchesIndex = 0; - var opened = false; - var target = result.target; - var targetLen = target.length; - var indexes2 = result._indexes; - indexes2 = indexes2.slice(0, indexes2.len).sort((a5, b4) => a5 - b4); - for (var i4 = 0; i4 < targetLen; ++i4) { - var char = target[i4]; - if (indexes2[matchesIndex] === i4) { - ++matchesIndex; - if (!opened) { - opened = true; - highlighted += hOpen; - } - if (matchesIndex === indexes2.length) { - highlighted += char + hClose + target.substr(i4 + 1); - break; - } - } else { - if (opened) { - opened = false; - highlighted += hClose; - } + return array; + } + function arrayEvery(array, predicate) { + var index = -1, length = array == null ? 0 : array.length; + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; } - highlighted += char; } - return highlighted; - }; - var highlightCallback = (result, cb) => { - if (result === NULL) - return NULL; - var target = result.target; - var targetLen = target.length; - var indexes2 = result._indexes; - indexes2 = indexes2.slice(0, indexes2.len).sort((a5, b4) => a5 - b4); - var highlighted = ""; - var matchI = 0; - var indexesI = 0; - var opened = false; - var result = []; - for (var i4 = 0; i4 < targetLen; ++i4) { - var char = target[i4]; - if (indexes2[indexesI] === i4) { - ++indexesI; - if (!opened) { - opened = true; - result.push(highlighted); - highlighted = ""; - } - if (indexesI === indexes2.length) { - highlighted += char; - result.push(cb(highlighted, matchI++)); - highlighted = ""; - result.push(target.substr(i4 + 1)); - break; - } - } else { - if (opened) { - opened = false; - result.push(cb(highlighted, matchI++)); - highlighted = ""; - } + return true; + } + function arrayFilter(array, predicate) { + var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; } - highlighted += char; } return result; - }; - var indexes = (result) => result._indexes.slice(0, result._indexes.len).sort((a5, b4) => a5 - b4); - var prepare = (target) => { - if (typeof target !== "string") - target = ""; - var info = prepareLowerInfo(target); - return { "target": target, _targetLower: info._lower, _targetLowerCodes: info.lowerCodes, _nextBeginningIndexes: NULL, _bitflags: info.bitflags, "score": NULL, _indexes: [0], "obj": NULL }; - }; - var prepareSearch = (search) => { - if (typeof search !== "string") - search = ""; - search = search.trim(); - var info = prepareLowerInfo(search); - var spaceSearches = []; - if (info.containsSpace) { - var searches = search.split(/\s+/); - searches = [...new Set(searches)]; - for (var i4 = 0; i4 < searches.length; i4++) { - if (searches[i4] === "") - continue; - var _info = prepareLowerInfo(searches[i4]); - spaceSearches.push({ lowerCodes: _info.lowerCodes, _lower: searches[i4].toLowerCase(), containsSpace: false }); + } + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + function arrayIncludesWith(array, value, comparator) { + var index = -1, length = array == null ? 0 : array.length; + while (++index < length) { + if (comparator(value, array[index])) { + return true; } } - return { lowerCodes: info.lowerCodes, bitflags: info.bitflags, containsSpace: info.containsSpace, _lower: info._lower, spaceSearches }; - }; - var getPrepared = (target) => { - if (target.length > 999) - return prepare(target); - var targetPrepared = preparedCache.get(target); - if (targetPrepared !== void 0) - return targetPrepared; - targetPrepared = prepare(target); - preparedCache.set(target, targetPrepared); - return targetPrepared; - }; - var getPreparedSearch = (search) => { - if (search.length > 999) - return prepareSearch(search); - var searchPrepared = preparedSearchCache.get(search); - if (searchPrepared !== void 0) - return searchPrepared; - searchPrepared = prepareSearch(search); - preparedSearchCache.set(search, searchPrepared); - return searchPrepared; - }; - var all = (search, targets, options) => { - var results = []; - results.total = targets.length; - var limit = options && options.limit || INT_MAX; - if (options && options.key) { - for (var i4 = 0; i4 < targets.length; i4++) { - var obj = targets[i4]; - var target = getValue(obj, options.key); - if (!target) - continue; - if (!isObj(target)) - target = getPrepared(target); - target.score = INT_MIN; - target._indexes.len = 0; - var result = target; - result = { target: result.target, _targetLower: "", _targetLowerCodes: NULL, _nextBeginningIndexes: NULL, _bitflags: 0, score: target.score, _indexes: NULL, obj }; - results.push(result); - if (results.length >= limit) - return results; - } - } else if (options && options.keys) { - for (var i4 = 0; i4 < targets.length; i4++) { - var obj = targets[i4]; - var objResults = new Array(options.keys.length); - for (var keyI = options.keys.length - 1; keyI >= 0; --keyI) { - var target = getValue(obj, options.keys[keyI]); - if (!target) { - objResults[keyI] = NULL; - continue; - } - if (!isObj(target)) - target = getPrepared(target); - target.score = INT_MIN; - target._indexes.len = 0; - objResults[keyI] = target; - } - objResults.obj = obj; - objResults.score = INT_MIN; - results.push(objResults); - if (results.length >= limit) - return results; - } - } else { - for (var i4 = 0; i4 < targets.length; i4++) { - var target = targets[i4]; - if (!target) - continue; - if (!isObj(target)) - target = getPrepared(target); - target.score = INT_MIN; - target._indexes.len = 0; - results.push(target); - if (results.length >= limit) - return results; - } + return false; + } + function arrayMap(array, iteratee) { + var index = -1, length = array == null ? 0 : array.length, result = Array(length); + while (++index < length) { + result[index] = iteratee(array[index], index, array); } - return results; - }; - var algorithm = (preparedSearch, prepared, allowSpaces = false) => { - if (allowSpaces === false && preparedSearch.containsSpace) - return algorithmSpaces(preparedSearch, prepared); - var searchLower = preparedSearch._lower; - var searchLowerCodes = preparedSearch.lowerCodes; - var searchLowerCode = searchLowerCodes[0]; - var targetLowerCodes = prepared._targetLowerCodes; - var searchLen = searchLowerCodes.length; - var targetLen = targetLowerCodes.length; - var searchI = 0; - var targetI = 0; - var matchesSimpleLen = 0; - for (; ; ) { - var isMatch2 = searchLowerCode === targetLowerCodes[targetI]; - if (isMatch2) { - matchesSimple[matchesSimpleLen++] = targetI; - ++searchI; - if (searchI === searchLen) - break; - searchLowerCode = searchLowerCodes[searchI]; - } - ++targetI; - if (targetI >= targetLen) - return NULL; + return result; + } + function arrayPush(array, values) { + var index = -1, length = values.length, offset2 = array.length; + while (++index < length) { + array[offset2 + index] = values[index]; } - var searchI = 0; - var successStrict = false; - var matchesStrictLen = 0; - var nextBeginningIndexes = prepared._nextBeginningIndexes; - if (nextBeginningIndexes === NULL) - nextBeginningIndexes = prepared._nextBeginningIndexes = prepareNextBeginningIndexes(prepared.target); - var firstPossibleI = targetI = matchesSimple[0] === 0 ? 0 : nextBeginningIndexes[matchesSimple[0] - 1]; - var backtrackCount = 0; - if (targetI !== targetLen) - for (; ; ) { - if (targetI >= targetLen) { - if (searchI <= 0) - break; - ++backtrackCount; - if (backtrackCount > 200) - break; - --searchI; - var lastMatch = matchesStrict[--matchesStrictLen]; - targetI = nextBeginningIndexes[lastMatch]; - } else { - var isMatch2 = searchLowerCodes[searchI] === targetLowerCodes[targetI]; - if (isMatch2) { - matchesStrict[matchesStrictLen++] = targetI; - ++searchI; - if (searchI === searchLen) { - successStrict = true; - break; - } - ++targetI; - } else { - targetI = nextBeginningIndexes[targetI]; - } - } - } - var substringIndex = prepared._targetLower.indexOf(searchLower, matchesSimple[0]); - var isSubstring = ~substringIndex; - if (isSubstring && !successStrict) { - for (var i4 = 0; i4 < matchesSimpleLen; ++i4) - matchesSimple[i4] = substringIndex + i4; + return array; + } + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[++index]; } - var isSubstringBeginning = false; - if (isSubstring) { - isSubstringBeginning = prepared._nextBeginningIndexes[substringIndex - 1] === substringIndex; + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); } - { - if (successStrict) { - var matchesBest = matchesStrict; - var matchesBestLen = matchesStrictLen; - } else { - var matchesBest = matchesSimple; - var matchesBestLen = matchesSimpleLen; + return accumulator; + } + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + function arraySome(array, predicate) { + var index = -1, length = array == null ? 0 : array.length; + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; } - var score = 0; - var extraMatchGroupCount = 0; - for (var i4 = 1; i4 < searchLen; ++i4) { - if (matchesBest[i4] - matchesBest[i4 - 1] !== 1) { - score -= matchesBest[i4]; - ++extraMatchGroupCount; - } + } + return false; + } + var asciiSize = baseProperty("length"); + function asciiToArray(string) { + return string.split(""); + } + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key2, collection2) { + if (predicate(value, key2, collection2)) { + result = key2; + return false; } - var unmatchedDistance = matchesBest[searchLen - 1] - matchesBest[0] - (searchLen - 1); - score -= (12 + unmatchedDistance) * extraMatchGroupCount; - if (matchesBest[0] !== 0) - score -= matchesBest[0] * matchesBest[0] * 0.2; - if (!successStrict) { - score *= 1e3; - } else { - var uniqueBeginningIndexes = 1; - for (var i4 = nextBeginningIndexes[0]; i4 < targetLen; i4 = nextBeginningIndexes[i4]) - ++uniqueBeginningIndexes; - if (uniqueBeginningIndexes > 24) - score *= (uniqueBeginningIndexes - 24) * 10; + }); + return result; + } + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, index = fromIndex + (fromRight ? 1 : -1); + while (fromRight ? index-- : ++index < length) { + if (predicate(array[index], index, array)) { + return index; } - if (isSubstring) - score /= 1 + searchLen * searchLen * 1; - if (isSubstringBeginning) - score /= 1 + searchLen * searchLen * 1; - score -= targetLen - searchLen; - prepared.score = score; - for (var i4 = 0; i4 < matchesBestLen; ++i4) - prepared._indexes[i4] = matchesBest[i4]; - prepared._indexes.len = matchesBestLen; - return prepared; } - }; - var algorithmSpaces = (preparedSearch, target) => { - var seen_indexes = /* @__PURE__ */ new Set(); - var score = 0; - var result = NULL; - var first_seen_index_last_search = 0; - var searches = preparedSearch.spaceSearches; - for (var i4 = 0; i4 < searches.length; ++i4) { - var search = searches[i4]; - result = algorithm(search, target); - if (result === NULL) - return NULL; - score += result.score; - if (result._indexes[0] < first_seen_index_last_search) { - score -= first_seen_index_last_search - result._indexes[0]; + return -1; + } + function baseIndexOf(array, value, fromIndex) { + return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); + } + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, length = array.length; + while (++index < length) { + if (comparator(array[index], value)) { + return index; } - first_seen_index_last_search = result._indexes[0]; - for (var j4 = 0; j4 < result._indexes.len; ++j4) - seen_indexes.add(result._indexes[j4]); } - var allowSpacesResult = algorithm(preparedSearch, target, true); - if (allowSpacesResult !== NULL && allowSpacesResult.score > score) { - return allowSpacesResult; + return -1; + } + function baseIsNaN(value) { + return value !== value; + } + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? baseSum(array, iteratee) / length : NAN; + } + function baseProperty(key2) { + return function(object) { + return object == null ? undefined2 : object[key2]; + }; + } + function basePropertyOf(object) { + return function(key2) { + return object == null ? undefined2 : object[key2]; + }; + } + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection2) { + accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2); + }); + return accumulator; + } + function baseSortBy(array, comparer) { + var length = array.length; + array.sort(comparer); + while (length--) { + array[length] = array[length].value; } - result.score = score; - var i4 = 0; - for (let index of seen_indexes) - result._indexes[i4++] = index; - result._indexes.len = i4; - return result; - }; - var prepareLowerInfo = (str) => { - var strLen = str.length; - var lower = str.toLowerCase(); - var lowerCodes = []; - var bitflags = 0; - var containsSpace = false; - for (var i4 = 0; i4 < strLen; ++i4) { - var lowerCode = lowerCodes[i4] = lower.charCodeAt(i4); - if (lowerCode === 32) { - containsSpace = true; - continue; + return array; + } + function baseSum(array, iteratee) { + var result, index = -1, length = array.length; + while (++index < length) { + var current2 = iteratee(array[index]); + if (current2 !== undefined2) { + result = result === undefined2 ? current2 : result + current2; } - var bit = lowerCode >= 97 && lowerCode <= 122 ? lowerCode - 97 : lowerCode >= 48 && lowerCode <= 57 ? 26 : lowerCode <= 127 ? 30 : 31; - bitflags |= 1 << bit; } - return { lowerCodes, bitflags, containsSpace, _lower: lower }; - }; - var prepareBeginningIndexes = (target) => { - var targetLen = target.length; - var beginningIndexes = []; - var beginningIndexesLen = 0; - var wasUpper = false; - var wasAlphanum = false; - for (var i4 = 0; i4 < targetLen; ++i4) { - var targetCode = target.charCodeAt(i4); - var isUpper = targetCode >= 65 && targetCode <= 90; - var isAlphanum = isUpper || targetCode >= 97 && targetCode <= 122 || targetCode >= 48 && targetCode <= 57; - var isBeginning = isUpper && !wasUpper || !wasAlphanum || !isAlphanum; - wasUpper = isUpper; - wasAlphanum = isAlphanum; - if (isBeginning) - beginningIndexes[beginningIndexesLen++] = i4; + return result; + } + function baseTimes(n2, iteratee) { + var index = -1, result = Array(n2); + while (++index < n2) { + result[index] = iteratee(index); } - return beginningIndexes; - }; - var prepareNextBeginningIndexes = (target) => { - var targetLen = target.length; - var beginningIndexes = prepareBeginningIndexes(target); - var nextBeginningIndexes = []; - var lastIsBeginning = beginningIndexes[0]; - var lastIsBeginningI = 0; - for (var i4 = 0; i4 < targetLen; ++i4) { - if (lastIsBeginning > i4) { - nextBeginningIndexes[i4] = lastIsBeginning; - } else { - lastIsBeginning = beginningIndexes[++lastIsBeginningI]; - nextBeginningIndexes[i4] = lastIsBeginning === void 0 ? targetLen : lastIsBeginning; - } + return result; + } + function baseToPairs(object, props2) { + return arrayMap(props2, function(key2) { + return [key2, object[key2]]; + }); + } + function baseTrim(string) { + return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; + } + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + function baseValues(object, props2) { + return arrayMap(props2, function(key2) { + return object[key2]; + }); + } + function cacheHas(cache, key2) { + return cache.has(key2); + } + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, length = strSymbols.length; + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } - return nextBeginningIndexes; - }; - var cleanup = () => { - preparedCache.clear(); - preparedSearchCache.clear(); - matchesSimple = []; - matchesStrict = []; - }; - var preparedCache = /* @__PURE__ */ new Map(); - var preparedSearchCache = /* @__PURE__ */ new Map(); - var matchesSimple = []; - var matchesStrict = []; - var defaultScoreFn = (a5) => { - var max3 = INT_MIN; - var len = a5.length; - for (var i4 = 0; i4 < len; ++i4) { - var result = a5[i4]; - if (result === NULL) - continue; - var score = result.score; - if (score > max3) - max3 = score; - } - if (max3 === INT_MIN) - return NULL; - return max3; - }; - var getValue = (obj, prop) => { - var tmp = obj[prop]; - if (tmp !== void 0) - return tmp; - var segs = prop; - if (!Array.isArray(prop)) - segs = prop.split("."); - var len = segs.length; - var i4 = -1; - while (obj && ++i4 < len) - obj = obj[segs[i4]]; - return obj; - }; - var isObj = (x5) => { - return typeof x5 === "object"; - }; - var INT_MAX = Infinity; - var INT_MIN = -INT_MAX; - var noResults = []; - noResults.total = 0; - var NULL = null; - var fastpriorityqueue = (r3) => { - var e4 = [], o3 = 0, a5 = {}, v3 = (r4) => { - for (var a6 = 0, v4 = e4[a6], c4 = 1; c4 < o3; ) { - var s5 = c4 + 1; - a6 = c4, s5 < o3 && e4[s5].score < e4[c4].score && (a6 = s5), e4[a6 - 1 >> 1] = e4[a6], c4 = 1 + (a6 << 1); - } - for (var f4 = a6 - 1 >> 1; a6 > 0 && v4.score < e4[f4].score; f4 = (a6 = f4) - 1 >> 1) - e4[a6] = e4[f4]; - e4[a6] = v4; - }; - return a5.add = (r4) => { - var a6 = o3; - e4[o3++] = r4; - for (var v4 = a6 - 1 >> 1; a6 > 0 && r4.score < e4[v4].score; v4 = (a6 = v4) - 1 >> 1) - e4[a6] = e4[v4]; - e4[a6] = r4; - }, a5.poll = (r4) => { - if (0 !== o3) { - var a6 = e4[0]; - return e4[0] = e4[--o3], v3(), a6; - } - }, a5.peek = (r4) => { - if (0 !== o3) - return e4[0]; - }, a5.replaceTop = (r4) => { - e4[0] = r4, v3(); - }, a5; - }; - var q5 = fastpriorityqueue(); - return { "single": single, "go": go, "highlight": highlight, "prepare": prepare, "indexes": indexes, "cleanup": cleanup }; - }); - } -}); - -// node_modules/lodash/lodash.js -var require_lodash = __commonJS({ - "node_modules/lodash/lodash.js"(exports, module2) { - (function() { - var undefined2; - var VERSION = "4.17.21"; - var LARGE_ARRAY_SIZE = 200; - var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; - var HASH_UNDEFINED = "__lodash_hash_undefined__"; - var MAX_MEMOIZE_SIZE = 500; - var PLACEHOLDER = "__lodash_placeholder__"; - var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; - var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; - var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; - var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; - var HOT_COUNT = 800, HOT_SPAN = 16; - var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; - var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; - var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - var wrapFlags = [ - ["ary", WRAP_ARY_FLAG], - ["bind", WRAP_BIND_FLAG], - ["bindKey", WRAP_BIND_KEY_FLAG], - ["curry", WRAP_CURRY_FLAG], - ["curryRight", WRAP_CURRY_RIGHT_FLAG], - ["flip", WRAP_FLIP_FLAG], - ["partial", WRAP_PARTIAL_FLAG], - ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], - ["rearg", WRAP_REARG_FLAG] - ]; - var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; - var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; - var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); - var reTrimStart = /^\s+/; - var reWhitespace = /\s/; - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; - var reEscapeChar = /\\(\\)?/g; - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - var reFlags = /\w*$/; - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - var reIsBinary = /^0b[01]+$/i; - var reIsHostCtor = /^\[object .+?Constructor\]$/; - var reIsOctal = /^0o[0-7]+$/i; - var reIsUint = /^(?:0|[1-9]\d*)$/; - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - var reNoMatch = /($^)/; - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\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", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; - var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; - var reApos = RegExp(rsApos, "g"); - var reComboMark = RegExp(rsCombo, "g"); - var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); - var reUnicodeWord = RegExp([ - rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", - rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", - rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, - rsUpper + "+" + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join("|"), "g"); - var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - var contextProps = [ - "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" - ]; - var templateCounter = -1; - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; - var deburredLetters = { - "\xC0": "A", - "\xC1": "A", - "\xC2": "A", - "\xC3": "A", - "\xC4": "A", - "\xC5": "A", - "\xE0": "a", - "\xE1": "a", - "\xE2": "a", - "\xE3": "a", - "\xE4": "a", - "\xE5": "a", - "\xC7": "C", - "\xE7": "c", - "\xD0": "D", - "\xF0": "d", - "\xC8": "E", - "\xC9": "E", - "\xCA": "E", - "\xCB": "E", - "\xE8": "e", - "\xE9": "e", - "\xEA": "e", - "\xEB": "e", - "\xCC": "I", - "\xCD": "I", - "\xCE": "I", - "\xCF": "I", - "\xEC": "i", - "\xED": "i", - "\xEE": "i", - "\xEF": "i", - "\xD1": "N", - "\xF1": "n", - "\xD2": "O", - "\xD3": "O", - "\xD4": "O", - "\xD5": "O", - "\xD6": "O", - "\xD8": "O", - "\xF2": "o", - "\xF3": "o", - "\xF4": "o", - "\xF5": "o", - "\xF6": "o", - "\xF8": "o", - "\xD9": "U", - "\xDA": "U", - "\xDB": "U", - "\xDC": "U", - "\xF9": "u", - "\xFA": "u", - "\xFB": "u", - "\xFC": "u", - "\xDD": "Y", - "\xFD": "y", - "\xFF": "y", - "\xC6": "Ae", - "\xE6": "ae", - "\xDE": "Th", - "\xFE": "th", - "\xDF": "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" - }; - var htmlEscapes = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'" - }; - var htmlUnescapes = { - "&": "&", - "<": "<", - ">": ">", - """: '"', - "'": "'" - }; - var stringEscapes = { - "\\": "\\", - "'": "'", - "\n": "n", - "\r": "r", - "\u2028": "u2028", - "\u2029": "u2029" - }; - var freeParseFloat = parseFloat, freeParseInt = parseInt; - var freeGlobal = typeof global == "object" && global && global.Object === Object && global; - var freeSelf = typeof self == "object" && self && self.Object === Object && self; - var root = freeGlobal || freeSelf || Function("return this")(); - var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; - var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2; - var moduleExports = freeModule && freeModule.exports === freeExports; - var freeProcess = moduleExports && freeGlobal.process; - var nodeUtil = function() { - try { - var types2 = freeModule && freeModule.require && freeModule.require("util").types; - if (types2) { - return types2; - } - return freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (e4) { - } - }(); - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - function apply(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; + return index; } - function arrayEach(array, iteratee) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } - return array; + return index; } - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; + function countHolders(array, placeholder) { + var length = array.length, result = 0; while (length--) { - if (iteratee(array[length], length, array) === false) { - break; + if (array[length] === placeholder) { + ++result; } } - return array; + return result; } - function arrayEvery(array, predicate) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } + var deburrLetter = basePropertyOf(deburredLetters); + var escapeHtmlChar = basePropertyOf(htmlEscapes); + function escapeStringChar(chr) { + return "\\" + stringEscapes[chr]; + } + function getValue(object, key2) { + return object == null ? undefined2 : object[key2]; + } + function hasUnicode(string) { + return reHasUnicode.test(string); + } + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + function iteratorToArray(iterator) { + var data2, result = []; + while (!(data2 = iterator.next()).done) { + result.push(data2.value); } - return true; + return result; } - function arrayFilter(array, predicate) { - var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; + function mapToArray(map) { + var index = -1, result = Array(map.size); + map.forEach(function(value, key2) { + result[++index] = [key2, value]; + }); + return result; + } + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + function replaceHolders(array, placeholder) { + var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } - function arrayIncludesWith(array, value, comparator) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } - function arrayMap(array, iteratee) { - var index = -1, length = array == null ? 0 : array.length, result = Array(length); - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - function arrayPush(array, values) { - var index = -1, length = values.length, offset2 = array.length; - while (++index < length) { - array[offset2 + index] = values[index]; - } - return array; - } - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - function arraySome(array, predicate) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - var asciiSize = baseProperty("length"); - function asciiToArray(string) { - return string.split(""); - } - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key2, collection2) { - if (predicate(value, key2, collection2)) { - result = key2; - return false; - } - }); - return result; - } - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, index = fromIndex + (fromRight ? 1 : -1); - while (fromRight ? index-- : ++index < length) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - function baseIndexOf(array, value, fromIndex) { - return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); - } - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, length = array.length; - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; - } - function baseIsNaN(value) { - return value !== value; - } - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? baseSum(array, iteratee) / length : NAN; - } - function baseProperty(key2) { - return function(object) { - return object == null ? undefined2 : object[key2]; - }; - } - function basePropertyOf(object) { - return function(key2) { - return object == null ? undefined2 : object[key2]; - }; - } - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection2) { - accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2); - }); - return accumulator; - } - function baseSortBy(array, comparer) { - var length = array.length; - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - function baseSum(array, iteratee) { - var result, index = -1, length = array.length; - while (++index < length) { - var current2 = iteratee(array[index]); - if (current2 !== undefined2) { - result = result === undefined2 ? current2 : result + current2; - } - } - return result; - } - function baseTimes(n2, iteratee) { - var index = -1, result = Array(n2); - while (++index < n2) { - result[index] = iteratee(index); - } - return result; - } - function baseToPairs(object, props2) { - return arrayMap(props2, function(key2) { - return [key2, object[key2]]; - }); - } - function baseTrim(string) { - return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; - } - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - function baseValues(object, props2) { - return arrayMap(props2, function(key2) { - return object[key2]; - }); - } - function cacheHas(cache, key2) { - return cache.has(key2); - } - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, length = strSymbols.length; - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { - } - return index; - } - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { - } - return index; - } - function countHolders(array, placeholder) { - var length = array.length, result = 0; - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } - var deburrLetter = basePropertyOf(deburredLetters); - var escapeHtmlChar = basePropertyOf(htmlEscapes); - function escapeStringChar(chr) { - return "\\" + stringEscapes[chr]; - } - function getValue(object, key2) { - return object == null ? undefined2 : object[key2]; - } - function hasUnicode(string) { - return reHasUnicode.test(string); - } - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - function iteratorToArray(iterator) { - var data2, result = []; - while (!(data2 = iterator.next()).done) { - result.push(data2.value); - } - return result; - } - function mapToArray(map) { - var index = -1, result = Array(map.size); - map.forEach(function(value, key2) { - result[++index] = [key2, value]; - }); - return result; - } - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - function replaceHolders(array, placeholder) { - var index = -1, length = array.length, resIndex = 0, result = []; - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; } } return result; @@ -6068,655 +5484,97 @@ var require_lodash = __commonJS({ } }); -// node_modules/classnames/index.js -var require_classnames = __commonJS({ - "node_modules/classnames/index.js"(exports, module2) { - (function() { - "use strict"; - var hasOwn2 = {}.hasOwnProperty; - var nativeCodeString = "[native code]"; - function classNames9() { - var classes = []; - for (var i4 = 0; i4 < arguments.length; i4++) { - var arg = arguments[i4]; - if (!arg) - continue; - var argType = typeof arg; - if (argType === "string" || argType === "number") { - classes.push(arg); - } else if (Array.isArray(arg)) { - if (arg.length) { - var inner = classNames9.apply(null, arg); - if (inner) { - classes.push(inner); - } - } - } else if (argType === "object") { - if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) { - classes.push(arg.toString()); - continue; - } - for (var key2 in arg) { - if (hasOwn2.call(arg, key2) && arg[key2]) { - classes.push(key2); - } - } - } - } - return classes.join(" "); - } - if (typeof module2 !== "undefined" && module2.exports) { - classNames9.default = classNames9; - module2.exports = classNames9; - } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) { - define("classnames", [], function() { - return classNames9; - }); - } else { - window.classNames = classNames9; - } - })(); - } -}); - -// node_modules/tslib/tslib.js -var require_tslib = __commonJS({ - "node_modules/tslib/tslib.js"(exports, module2) { - var __extends4; - var __assign5; - var __rest3; - var __decorate2; - var __param2; - var __esDecorate2; - var __runInitializers2; - var __propKey2; - var __setFunctionName2; - var __metadata2; - var __awaiter2; - var __generator2; - var __exportStar2; - var __values2; - var __read2; - var __spread2; - var __spreadArrays2; - var __spreadArray3; - var __await2; - var __asyncGenerator2; - var __asyncDelegator2; - var __asyncValues2; - var __makeTemplateObject2; - var __importStar2; - var __importDefault2; - var __classPrivateFieldGet2; - var __classPrivateFieldSet2; - var __classPrivateFieldIn2; - var __createBinding2; - (function(factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function(exports2) { - factory(createExporter(root, createExporter(exports2))); - }); - } else if (typeof module2 === "object" && typeof module2.exports === "object") { - factory(createExporter(root, createExporter(module2.exports))); - } else { - factory(createExporter(root)); +// node_modules/he/he.js +var require_he = __commonJS({ + "node_modules/he/he.js"(exports, module2) { + (function(root) { + var freeExports = typeof exports == "object" && exports; + var freeModule = typeof module2 == "object" && module2 && module2.exports == freeExports && module2; + var freeGlobal = typeof global == "object" && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; } - function createExporter(exports2, previous) { - if (exports2 !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports2, "__esModule", { value: true }); - } else { - exports2.__esModule = true; + var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + var regexAsciiWhitelist = /[\x01-\x7F]/g; + var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; + var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g; + var encodeMap = { "\xAD": "shy", "\u200C": "zwnj", "\u200D": "zwj", "\u200E": "lrm", "\u2063": "ic", "\u2062": "it", "\u2061": "af", "\u200F": "rlm", "\u200B": "ZeroWidthSpace", "\u2060": "NoBreak", "\u0311": "DownBreve", "\u20DB": "tdot", "\u20DC": "DotDot", " ": "Tab", "\n": "NewLine", "\u2008": "puncsp", "\u205F": "MediumSpace", "\u2009": "thinsp", "\u200A": "hairsp", "\u2004": "emsp13", "\u2002": "ensp", "\u2005": "emsp14", "\u2003": "emsp", "\u2007": "numsp", "\xA0": "nbsp", "\u205F\u200A": "ThickSpace", "\u203E": "oline", "_": "lowbar", "\u2010": "dash", "\u2013": "ndash", "\u2014": "mdash", "\u2015": "horbar", ",": "comma", ";": "semi", "\u204F": "bsemi", ":": "colon", "\u2A74": "Colone", "!": "excl", "\xA1": "iexcl", "?": "quest", "\xBF": "iquest", ".": "period", "\u2025": "nldr", "\u2026": "mldr", "\xB7": "middot", "'": "apos", "\u2018": "lsquo", "\u2019": "rsquo", "\u201A": "sbquo", "\u2039": "lsaquo", "\u203A": "rsaquo", '"': "quot", "\u201C": "ldquo", "\u201D": "rdquo", "\u201E": "bdquo", "\xAB": "laquo", "\xBB": "raquo", "(": "lpar", ")": "rpar", "[": "lsqb", "]": "rsqb", "{": "lcub", "}": "rcub", "\u2308": "lceil", "\u2309": "rceil", "\u230A": "lfloor", "\u230B": "rfloor", "\u2985": "lopar", "\u2986": "ropar", "\u298B": "lbrke", "\u298C": "rbrke", "\u298D": "lbrkslu", "\u298E": "rbrksld", "\u298F": "lbrksld", "\u2990": "rbrkslu", "\u2991": "langd", "\u2992": "rangd", "\u2993": "lparlt", "\u2994": "rpargt", "\u2995": "gtlPar", "\u2996": "ltrPar", "\u27E6": "lobrk", "\u27E7": "robrk", "\u27E8": "lang", "\u27E9": "rang", "\u27EA": "Lang", "\u27EB": "Rang", "\u27EC": "loang", "\u27ED": "roang", "\u2772": "lbbrk", "\u2773": "rbbrk", "\u2016": "Vert", "\xA7": "sect", "\xB6": "para", "@": "commat", "*": "ast", "/": "sol", "undefined": null, "&": "amp", "#": "num", "%": "percnt", "\u2030": "permil", "\u2031": "pertenk", "\u2020": "dagger", "\u2021": "Dagger", "\u2022": "bull", "\u2043": "hybull", "\u2032": "prime", "\u2033": "Prime", "\u2034": "tprime", "\u2057": "qprime", "\u2035": "bprime", "\u2041": "caret", "`": "grave", "\xB4": "acute", "\u02DC": "tilde", "^": "Hat", "\xAF": "macr", "\u02D8": "breve", "\u02D9": "dot", "\xA8": "die", "\u02DA": "ring", "\u02DD": "dblac", "\xB8": "cedil", "\u02DB": "ogon", "\u02C6": "circ", "\u02C7": "caron", "\xB0": "deg", "\xA9": "copy", "\xAE": "reg", "\u2117": "copysr", "\u2118": "wp", "\u211E": "rx", "\u2127": "mho", "\u2129": "iiota", "\u2190": "larr", "\u219A": "nlarr", "\u2192": "rarr", "\u219B": "nrarr", "\u2191": "uarr", "\u2193": "darr", "\u2194": "harr", "\u21AE": "nharr", "\u2195": "varr", "\u2196": "nwarr", "\u2197": "nearr", "\u2198": "searr", "\u2199": "swarr", "\u219D": "rarrw", "\u219D\u0338": "nrarrw", "\u219E": "Larr", "\u219F": "Uarr", "\u21A0": "Rarr", "\u21A1": "Darr", "\u21A2": "larrtl", "\u21A3": "rarrtl", "\u21A4": "mapstoleft", "\u21A5": "mapstoup", "\u21A6": "map", "\u21A7": "mapstodown", "\u21A9": "larrhk", "\u21AA": "rarrhk", "\u21AB": "larrlp", "\u21AC": "rarrlp", "\u21AD": "harrw", "\u21B0": "lsh", "\u21B1": "rsh", "\u21B2": "ldsh", "\u21B3": "rdsh", "\u21B5": "crarr", "\u21B6": "cularr", "\u21B7": "curarr", "\u21BA": "olarr", "\u21BB": "orarr", "\u21BC": "lharu", "\u21BD": "lhard", "\u21BE": "uharr", "\u21BF": "uharl", "\u21C0": "rharu", "\u21C1": "rhard", "\u21C2": "dharr", "\u21C3": "dharl", "\u21C4": "rlarr", "\u21C5": "udarr", "\u21C6": "lrarr", "\u21C7": "llarr", "\u21C8": "uuarr", "\u21C9": "rrarr", "\u21CA": "ddarr", "\u21CB": "lrhar", "\u21CC": "rlhar", "\u21D0": "lArr", "\u21CD": "nlArr", "\u21D1": "uArr", "\u21D2": "rArr", "\u21CF": "nrArr", "\u21D3": "dArr", "\u21D4": "iff", "\u21CE": "nhArr", "\u21D5": "vArr", "\u21D6": "nwArr", "\u21D7": "neArr", "\u21D8": "seArr", "\u21D9": "swArr", "\u21DA": "lAarr", "\u21DB": "rAarr", "\u21DD": "zigrarr", "\u21E4": "larrb", "\u21E5": "rarrb", "\u21F5": "duarr", "\u21FD": "loarr", "\u21FE": "roarr", "\u21FF": "hoarr", "\u2200": "forall", "\u2201": "comp", "\u2202": "part", "\u2202\u0338": "npart", "\u2203": "exist", "\u2204": "nexist", "\u2205": "empty", "\u2207": "Del", "\u2208": "in", "\u2209": "notin", "\u220B": "ni", "\u220C": "notni", "\u03F6": "bepsi", "\u220F": "prod", "\u2210": "coprod", "\u2211": "sum", "+": "plus", "\xB1": "pm", "\xF7": "div", "\xD7": "times", "<": "lt", "\u226E": "nlt", "<\u20D2": "nvlt", "=": "equals", "\u2260": "ne", "=\u20E5": "bne", "\u2A75": "Equal", ">": "gt", "\u226F": "ngt", ">\u20D2": "nvgt", "\xAC": "not", "|": "vert", "\xA6": "brvbar", "\u2212": "minus", "\u2213": "mp", "\u2214": "plusdo", "\u2044": "frasl", "\u2216": "setmn", "\u2217": "lowast", "\u2218": "compfn", "\u221A": "Sqrt", "\u221D": "prop", "\u221E": "infin", "\u221F": "angrt", "\u2220": "ang", "\u2220\u20D2": "nang", "\u2221": "angmsd", "\u2222": "angsph", "\u2223": "mid", "\u2224": "nmid", "\u2225": "par", "\u2226": "npar", "\u2227": "and", "\u2228": "or", "\u2229": "cap", "\u2229\uFE00": "caps", "\u222A": "cup", "\u222A\uFE00": "cups", "\u222B": "int", "\u222C": "Int", "\u222D": "tint", "\u2A0C": "qint", "\u222E": "oint", "\u222F": "Conint", "\u2230": "Cconint", "\u2231": "cwint", "\u2232": "cwconint", "\u2233": "awconint", "\u2234": "there4", "\u2235": "becaus", "\u2236": "ratio", "\u2237": "Colon", "\u2238": "minusd", "\u223A": "mDDot", "\u223B": "homtht", "\u223C": "sim", "\u2241": "nsim", "\u223C\u20D2": "nvsim", "\u223D": "bsim", "\u223D\u0331": "race", "\u223E": "ac", "\u223E\u0333": "acE", "\u223F": "acd", "\u2240": "wr", "\u2242": "esim", "\u2242\u0338": "nesim", "\u2243": "sime", "\u2244": "nsime", "\u2245": "cong", "\u2247": "ncong", "\u2246": "simne", "\u2248": "ap", "\u2249": "nap", "\u224A": "ape", "\u224B": "apid", "\u224B\u0338": "napid", "\u224C": "bcong", "\u224D": "CupCap", "\u226D": "NotCupCap", "\u224D\u20D2": "nvap", "\u224E": "bump", "\u224E\u0338": "nbump", "\u224F": "bumpe", "\u224F\u0338": "nbumpe", "\u2250": "doteq", "\u2250\u0338": "nedot", "\u2251": "eDot", "\u2252": "efDot", "\u2253": "erDot", "\u2254": "colone", "\u2255": "ecolon", "\u2256": "ecir", "\u2257": "cire", "\u2259": "wedgeq", "\u225A": "veeeq", "\u225C": "trie", "\u225F": "equest", "\u2261": "equiv", "\u2262": "nequiv", "\u2261\u20E5": "bnequiv", "\u2264": "le", "\u2270": "nle", "\u2264\u20D2": "nvle", "\u2265": "ge", "\u2271": "nge", "\u2265\u20D2": "nvge", "\u2266": "lE", "\u2266\u0338": "nlE", "\u2267": "gE", "\u2267\u0338": "ngE", "\u2268\uFE00": "lvnE", "\u2268": "lnE", "\u2269": "gnE", "\u2269\uFE00": "gvnE", "\u226A": "ll", "\u226A\u0338": "nLtv", "\u226A\u20D2": "nLt", "\u226B": "gg", "\u226B\u0338": "nGtv", "\u226B\u20D2": "nGt", "\u226C": "twixt", "\u2272": "lsim", "\u2274": "nlsim", "\u2273": "gsim", "\u2275": "ngsim", "\u2276": "lg", "\u2278": "ntlg", "\u2277": "gl", "\u2279": "ntgl", "\u227A": "pr", "\u2280": "npr", "\u227B": "sc", "\u2281": "nsc", "\u227C": "prcue", "\u22E0": "nprcue", "\u227D": "sccue", "\u22E1": "nsccue", "\u227E": "prsim", "\u227F": "scsim", "\u227F\u0338": "NotSucceedsTilde", "\u2282": "sub", "\u2284": "nsub", "\u2282\u20D2": "vnsub", "\u2283": "sup", "\u2285": "nsup", "\u2283\u20D2": "vnsup", "\u2286": "sube", "\u2288": "nsube", "\u2287": "supe", "\u2289": "nsupe", "\u228A\uFE00": "vsubne", "\u228A": "subne", "\u228B\uFE00": "vsupne", "\u228B": "supne", "\u228D": "cupdot", "\u228E": "uplus", "\u228F": "sqsub", "\u228F\u0338": "NotSquareSubset", "\u2290": "sqsup", "\u2290\u0338": "NotSquareSuperset", "\u2291": "sqsube", "\u22E2": "nsqsube", "\u2292": "sqsupe", "\u22E3": "nsqsupe", "\u2293": "sqcap", "\u2293\uFE00": "sqcaps", "\u2294": "sqcup", "\u2294\uFE00": "sqcups", "\u2295": "oplus", "\u2296": "ominus", "\u2297": "otimes", "\u2298": "osol", "\u2299": "odot", "\u229A": "ocir", "\u229B": "oast", "\u229D": "odash", "\u229E": "plusb", "\u229F": "minusb", "\u22A0": "timesb", "\u22A1": "sdotb", "\u22A2": "vdash", "\u22AC": "nvdash", "\u22A3": "dashv", "\u22A4": "top", "\u22A5": "bot", "\u22A7": "models", "\u22A8": "vDash", "\u22AD": "nvDash", "\u22A9": "Vdash", "\u22AE": "nVdash", "\u22AA": "Vvdash", "\u22AB": "VDash", "\u22AF": "nVDash", "\u22B0": "prurel", "\u22B2": "vltri", "\u22EA": "nltri", "\u22B3": "vrtri", "\u22EB": "nrtri", "\u22B4": "ltrie", "\u22EC": "nltrie", "\u22B4\u20D2": "nvltrie", "\u22B5": "rtrie", "\u22ED": "nrtrie", "\u22B5\u20D2": "nvrtrie", "\u22B6": "origof", "\u22B7": "imof", "\u22B8": "mumap", "\u22B9": "hercon", "\u22BA": "intcal", "\u22BB": "veebar", "\u22BD": "barvee", "\u22BE": "angrtvb", "\u22BF": "lrtri", "\u22C0": "Wedge", "\u22C1": "Vee", "\u22C2": "xcap", "\u22C3": "xcup", "\u22C4": "diam", "\u22C5": "sdot", "\u22C6": "Star", "\u22C7": "divonx", "\u22C8": "bowtie", "\u22C9": "ltimes", "\u22CA": "rtimes", "\u22CB": "lthree", "\u22CC": "rthree", "\u22CD": "bsime", "\u22CE": "cuvee", "\u22CF": "cuwed", "\u22D0": "Sub", "\u22D1": "Sup", "\u22D2": "Cap", "\u22D3": "Cup", "\u22D4": "fork", "\u22D5": "epar", "\u22D6": "ltdot", "\u22D7": "gtdot", "\u22D8": "Ll", "\u22D8\u0338": "nLl", "\u22D9": "Gg", "\u22D9\u0338": "nGg", "\u22DA\uFE00": "lesg", "\u22DA": "leg", "\u22DB": "gel", "\u22DB\uFE00": "gesl", "\u22DE": "cuepr", "\u22DF": "cuesc", "\u22E6": "lnsim", "\u22E7": "gnsim", "\u22E8": "prnsim", "\u22E9": "scnsim", "\u22EE": "vellip", "\u22EF": "ctdot", "\u22F0": "utdot", "\u22F1": "dtdot", "\u22F2": "disin", "\u22F3": "isinsv", "\u22F4": "isins", "\u22F5": "isindot", "\u22F5\u0338": "notindot", "\u22F6": "notinvc", "\u22F7": "notinvb", "\u22F9": "isinE", "\u22F9\u0338": "notinE", "\u22FA": "nisd", "\u22FB": "xnis", "\u22FC": "nis", "\u22FD": "notnivc", "\u22FE": "notnivb", "\u2305": "barwed", "\u2306": "Barwed", "\u230C": "drcrop", "\u230D": "dlcrop", "\u230E": "urcrop", "\u230F": "ulcrop", "\u2310": "bnot", "\u2312": "profline", "\u2313": "profsurf", "\u2315": "telrec", "\u2316": "target", "\u231C": "ulcorn", "\u231D": "urcorn", "\u231E": "dlcorn", "\u231F": "drcorn", "\u2322": "frown", "\u2323": "smile", "\u232D": "cylcty", "\u232E": "profalar", "\u2336": "topbot", "\u233D": "ovbar", "\u233F": "solbar", "\u237C": "angzarr", "\u23B0": "lmoust", "\u23B1": "rmoust", "\u23B4": "tbrk", "\u23B5": "bbrk", "\u23B6": "bbrktbrk", "\u23DC": "OverParenthesis", "\u23DD": "UnderParenthesis", "\u23DE": "OverBrace", "\u23DF": "UnderBrace", "\u23E2": "trpezium", "\u23E7": "elinters", "\u2423": "blank", "\u2500": "boxh", "\u2502": "boxv", "\u250C": "boxdr", "\u2510": "boxdl", "\u2514": "boxur", "\u2518": "boxul", "\u251C": "boxvr", "\u2524": "boxvl", "\u252C": "boxhd", "\u2534": "boxhu", "\u253C": "boxvh", "\u2550": "boxH", "\u2551": "boxV", "\u2552": "boxdR", "\u2553": "boxDr", "\u2554": "boxDR", "\u2555": "boxdL", "\u2556": "boxDl", "\u2557": "boxDL", "\u2558": "boxuR", "\u2559": "boxUr", "\u255A": "boxUR", "\u255B": "boxuL", "\u255C": "boxUl", "\u255D": "boxUL", "\u255E": "boxvR", "\u255F": "boxVr", "\u2560": "boxVR", "\u2561": "boxvL", "\u2562": "boxVl", "\u2563": "boxVL", "\u2564": "boxHd", "\u2565": "boxhD", "\u2566": "boxHD", "\u2567": "boxHu", "\u2568": "boxhU", "\u2569": "boxHU", "\u256A": "boxvH", "\u256B": "boxVh", "\u256C": "boxVH", "\u2580": "uhblk", "\u2584": "lhblk", "\u2588": "block", "\u2591": "blk14", "\u2592": "blk12", "\u2593": "blk34", "\u25A1": "squ", "\u25AA": "squf", "\u25AB": "EmptyVerySmallSquare", "\u25AD": "rect", "\u25AE": "marker", "\u25B1": "fltns", "\u25B3": "xutri", "\u25B4": "utrif", "\u25B5": "utri", "\u25B8": "rtrif", "\u25B9": "rtri", "\u25BD": "xdtri", "\u25BE": "dtrif", "\u25BF": "dtri", "\u25C2": "ltrif", "\u25C3": "ltri", "\u25CA": "loz", "\u25CB": "cir", "\u25EC": "tridot", "\u25EF": "xcirc", "\u25F8": "ultri", "\u25F9": "urtri", "\u25FA": "lltri", "\u25FB": "EmptySmallSquare", "\u25FC": "FilledSmallSquare", "\u2605": "starf", "\u2606": "star", "\u260E": "phone", "\u2640": "female", "\u2642": "male", "\u2660": "spades", "\u2663": "clubs", "\u2665": "hearts", "\u2666": "diams", "\u266A": "sung", "\u2713": "check", "\u2717": "cross", "\u2720": "malt", "\u2736": "sext", "\u2758": "VerticalSeparator", "\u27C8": "bsolhsub", "\u27C9": "suphsol", "\u27F5": "xlarr", "\u27F6": "xrarr", "\u27F7": "xharr", "\u27F8": "xlArr", "\u27F9": "xrArr", "\u27FA": "xhArr", "\u27FC": "xmap", "\u27FF": "dzigrarr", "\u2902": "nvlArr", "\u2903": "nvrArr", "\u2904": "nvHarr", "\u2905": "Map", "\u290C": "lbarr", "\u290D": "rbarr", "\u290E": "lBarr", "\u290F": "rBarr", "\u2910": "RBarr", "\u2911": "DDotrahd", "\u2912": "UpArrowBar", "\u2913": "DownArrowBar", "\u2916": "Rarrtl", "\u2919": "latail", "\u291A": "ratail", "\u291B": "lAtail", "\u291C": "rAtail", "\u291D": "larrfs", "\u291E": "rarrfs", "\u291F": "larrbfs", "\u2920": "rarrbfs", "\u2923": "nwarhk", "\u2924": "nearhk", "\u2925": "searhk", "\u2926": "swarhk", "\u2927": "nwnear", "\u2928": "toea", "\u2929": "tosa", "\u292A": "swnwar", "\u2933": "rarrc", "\u2933\u0338": "nrarrc", "\u2935": "cudarrr", "\u2936": "ldca", "\u2937": "rdca", "\u2938": "cudarrl", "\u2939": "larrpl", "\u293C": "curarrm", "\u293D": "cularrp", "\u2945": "rarrpl", "\u2948": "harrcir", "\u2949": "Uarrocir", "\u294A": "lurdshar", "\u294B": "ldrushar", "\u294E": "LeftRightVector", "\u294F": "RightUpDownVector", "\u2950": "DownLeftRightVector", "\u2951": "LeftUpDownVector", "\u2952": "LeftVectorBar", "\u2953": "RightVectorBar", "\u2954": "RightUpVectorBar", "\u2955": "RightDownVectorBar", "\u2956": "DownLeftVectorBar", "\u2957": "DownRightVectorBar", "\u2958": "LeftUpVectorBar", "\u2959": "LeftDownVectorBar", "\u295A": "LeftTeeVector", "\u295B": "RightTeeVector", "\u295C": "RightUpTeeVector", "\u295D": "RightDownTeeVector", "\u295E": "DownLeftTeeVector", "\u295F": "DownRightTeeVector", "\u2960": "LeftUpTeeVector", "\u2961": "LeftDownTeeVector", "\u2962": "lHar", "\u2963": "uHar", "\u2964": "rHar", "\u2965": "dHar", "\u2966": "luruhar", "\u2967": "ldrdhar", "\u2968": "ruluhar", "\u2969": "rdldhar", "\u296A": "lharul", "\u296B": "llhard", "\u296C": "rharul", "\u296D": "lrhard", "\u296E": "udhar", "\u296F": "duhar", "\u2970": "RoundImplies", "\u2971": "erarr", "\u2972": "simrarr", "\u2973": "larrsim", "\u2974": "rarrsim", "\u2975": "rarrap", "\u2976": "ltlarr", "\u2978": "gtrarr", "\u2979": "subrarr", "\u297B": "suplarr", "\u297C": "lfisht", "\u297D": "rfisht", "\u297E": "ufisht", "\u297F": "dfisht", "\u299A": "vzigzag", "\u299C": "vangrt", "\u299D": "angrtvbd", "\u29A4": "ange", "\u29A5": "range", "\u29A6": "dwangle", "\u29A7": "uwangle", "\u29A8": "angmsdaa", "\u29A9": "angmsdab", "\u29AA": "angmsdac", "\u29AB": "angmsdad", "\u29AC": "angmsdae", "\u29AD": "angmsdaf", "\u29AE": "angmsdag", "\u29AF": "angmsdah", "\u29B0": "bemptyv", "\u29B1": "demptyv", "\u29B2": "cemptyv", "\u29B3": "raemptyv", "\u29B4": "laemptyv", "\u29B5": "ohbar", "\u29B6": "omid", "\u29B7": "opar", "\u29B9": "operp", "\u29BB": "olcross", "\u29BC": "odsold", "\u29BE": "olcir", "\u29BF": "ofcir", "\u29C0": "olt", "\u29C1": "ogt", "\u29C2": "cirscir", "\u29C3": "cirE", "\u29C4": "solb", "\u29C5": "bsolb", "\u29C9": "boxbox", "\u29CD": "trisb", "\u29CE": "rtriltri", "\u29CF": "LeftTriangleBar", "\u29CF\u0338": "NotLeftTriangleBar", "\u29D0": "RightTriangleBar", "\u29D0\u0338": "NotRightTriangleBar", "\u29DC": "iinfin", "\u29DD": "infintie", "\u29DE": "nvinfin", "\u29E3": "eparsl", "\u29E4": "smeparsl", "\u29E5": "eqvparsl", "\u29EB": "lozf", "\u29F4": "RuleDelayed", "\u29F6": "dsol", "\u2A00": "xodot", "\u2A01": "xoplus", "\u2A02": "xotime", "\u2A04": "xuplus", "\u2A06": "xsqcup", "\u2A0D": "fpartint", "\u2A10": "cirfnint", "\u2A11": "awint", "\u2A12": "rppolint", "\u2A13": "scpolint", "\u2A14": "npolint", "\u2A15": "pointint", "\u2A16": "quatint", "\u2A17": "intlarhk", "\u2A22": "pluscir", "\u2A23": "plusacir", "\u2A24": "simplus", "\u2A25": "plusdu", "\u2A26": "plussim", "\u2A27": "plustwo", "\u2A29": "mcomma", "\u2A2A": "minusdu", "\u2A2D": "loplus", "\u2A2E": "roplus", "\u2A2F": "Cross", "\u2A30": "timesd", "\u2A31": "timesbar", "\u2A33": "smashp", "\u2A34": "lotimes", "\u2A35": "rotimes", "\u2A36": "otimesas", "\u2A37": "Otimes", "\u2A38": "odiv", "\u2A39": "triplus", "\u2A3A": "triminus", "\u2A3B": "tritime", "\u2A3C": "iprod", "\u2A3F": "amalg", "\u2A40": "capdot", "\u2A42": "ncup", "\u2A43": "ncap", "\u2A44": "capand", "\u2A45": "cupor", "\u2A46": "cupcap", "\u2A47": "capcup", "\u2A48": "cupbrcap", "\u2A49": "capbrcup", "\u2A4A": "cupcup", "\u2A4B": "capcap", "\u2A4C": "ccups", "\u2A4D": "ccaps", "\u2A50": "ccupssm", "\u2A53": "And", "\u2A54": "Or", "\u2A55": "andand", "\u2A56": "oror", "\u2A57": "orslope", "\u2A58": "andslope", "\u2A5A": "andv", "\u2A5B": "orv", "\u2A5C": "andd", "\u2A5D": "ord", "\u2A5F": "wedbar", "\u2A66": "sdote", "\u2A6A": "simdot", "\u2A6D": "congdot", "\u2A6D\u0338": "ncongdot", "\u2A6E": "easter", "\u2A6F": "apacir", "\u2A70": "apE", "\u2A70\u0338": "napE", "\u2A71": "eplus", "\u2A72": "pluse", "\u2A73": "Esim", "\u2A77": "eDDot", "\u2A78": "equivDD", "\u2A79": "ltcir", "\u2A7A": "gtcir", "\u2A7B": "ltquest", "\u2A7C": "gtquest", "\u2A7D": "les", "\u2A7D\u0338": "nles", "\u2A7E": "ges", "\u2A7E\u0338": "nges", "\u2A7F": "lesdot", "\u2A80": "gesdot", "\u2A81": "lesdoto", "\u2A82": "gesdoto", "\u2A83": "lesdotor", "\u2A84": "gesdotol", "\u2A85": "lap", "\u2A86": "gap", "\u2A87": "lne", "\u2A88": "gne", "\u2A89": "lnap", "\u2A8A": "gnap", "\u2A8B": "lEg", "\u2A8C": "gEl", "\u2A8D": "lsime", "\u2A8E": "gsime", "\u2A8F": "lsimg", "\u2A90": "gsiml", "\u2A91": "lgE", "\u2A92": "glE", "\u2A93": "lesges", "\u2A94": "gesles", "\u2A95": "els", "\u2A96": "egs", "\u2A97": "elsdot", "\u2A98": "egsdot", "\u2A99": "el", "\u2A9A": "eg", "\u2A9D": "siml", "\u2A9E": "simg", "\u2A9F": "simlE", "\u2AA0": "simgE", "\u2AA1": "LessLess", "\u2AA1\u0338": "NotNestedLessLess", "\u2AA2": "GreaterGreater", "\u2AA2\u0338": "NotNestedGreaterGreater", "\u2AA4": "glj", "\u2AA5": "gla", "\u2AA6": "ltcc", "\u2AA7": "gtcc", "\u2AA8": "lescc", "\u2AA9": "gescc", "\u2AAA": "smt", "\u2AAB": "lat", "\u2AAC": "smte", "\u2AAC\uFE00": "smtes", "\u2AAD": "late", "\u2AAD\uFE00": "lates", "\u2AAE": "bumpE", "\u2AAF": "pre", "\u2AAF\u0338": "npre", "\u2AB0": "sce", "\u2AB0\u0338": "nsce", "\u2AB3": "prE", "\u2AB4": "scE", "\u2AB5": "prnE", "\u2AB6": "scnE", "\u2AB7": "prap", "\u2AB8": "scap", "\u2AB9": "prnap", "\u2ABA": "scnap", "\u2ABB": "Pr", "\u2ABC": "Sc", "\u2ABD": "subdot", "\u2ABE": "supdot", "\u2ABF": "subplus", "\u2AC0": "supplus", "\u2AC1": "submult", "\u2AC2": "supmult", "\u2AC3": "subedot", "\u2AC4": "supedot", "\u2AC5": "subE", "\u2AC5\u0338": "nsubE", "\u2AC6": "supE", "\u2AC6\u0338": "nsupE", "\u2AC7": "subsim", "\u2AC8": "supsim", "\u2ACB\uFE00": "vsubnE", "\u2ACB": "subnE", "\u2ACC\uFE00": "vsupnE", "\u2ACC": "supnE", "\u2ACF": "csub", "\u2AD0": "csup", "\u2AD1": "csube", "\u2AD2": "csupe", "\u2AD3": "subsup", "\u2AD4": "supsub", "\u2AD5": "subsub", "\u2AD6": "supsup", "\u2AD7": "suphsub", "\u2AD8": "supdsub", "\u2AD9": "forkv", "\u2ADA": "topfork", "\u2ADB": "mlcp", "\u2AE4": "Dashv", "\u2AE6": "Vdashl", "\u2AE7": "Barv", "\u2AE8": "vBar", "\u2AE9": "vBarv", "\u2AEB": "Vbar", "\u2AEC": "Not", "\u2AED": "bNot", "\u2AEE": "rnmid", "\u2AEF": "cirmid", "\u2AF0": "midcir", "\u2AF1": "topcir", "\u2AF2": "nhpar", "\u2AF3": "parsim", "\u2AFD": "parsl", "\u2AFD\u20E5": "nparsl", "\u266D": "flat", "\u266E": "natur", "\u266F": "sharp", "\xA4": "curren", "\xA2": "cent", "$": "dollar", "\xA3": "pound", "\xA5": "yen", "\u20AC": "euro", "\xB9": "sup1", "\xBD": "half", "\u2153": "frac13", "\xBC": "frac14", "\u2155": "frac15", "\u2159": "frac16", "\u215B": "frac18", "\xB2": "sup2", "\u2154": "frac23", "\u2156": "frac25", "\xB3": "sup3", "\xBE": "frac34", "\u2157": "frac35", "\u215C": "frac38", "\u2158": "frac45", "\u215A": "frac56", "\u215D": "frac58", "\u215E": "frac78", "\u{1D4B6}": "ascr", "\u{1D552}": "aopf", "\u{1D51E}": "afr", "\u{1D538}": "Aopf", "\u{1D504}": "Afr", "\u{1D49C}": "Ascr", "\xAA": "ordf", "\xE1": "aacute", "\xC1": "Aacute", "\xE0": "agrave", "\xC0": "Agrave", "\u0103": "abreve", "\u0102": "Abreve", "\xE2": "acirc", "\xC2": "Acirc", "\xE5": "aring", "\xC5": "angst", "\xE4": "auml", "\xC4": "Auml", "\xE3": "atilde", "\xC3": "Atilde", "\u0105": "aogon", "\u0104": "Aogon", "\u0101": "amacr", "\u0100": "Amacr", "\xE6": "aelig", "\xC6": "AElig", "\u{1D4B7}": "bscr", "\u{1D553}": "bopf", "\u{1D51F}": "bfr", "\u{1D539}": "Bopf", "\u212C": "Bscr", "\u{1D505}": "Bfr", "\u{1D520}": "cfr", "\u{1D4B8}": "cscr", "\u{1D554}": "copf", "\u212D": "Cfr", "\u{1D49E}": "Cscr", "\u2102": "Copf", "\u0107": "cacute", "\u0106": "Cacute", "\u0109": "ccirc", "\u0108": "Ccirc", "\u010D": "ccaron", "\u010C": "Ccaron", "\u010B": "cdot", "\u010A": "Cdot", "\xE7": "ccedil", "\xC7": "Ccedil", "\u2105": "incare", "\u{1D521}": "dfr", "\u2146": "dd", "\u{1D555}": "dopf", "\u{1D4B9}": "dscr", "\u{1D49F}": "Dscr", "\u{1D507}": "Dfr", "\u2145": "DD", "\u{1D53B}": "Dopf", "\u010F": "dcaron", "\u010E": "Dcaron", "\u0111": "dstrok", "\u0110": "Dstrok", "\xF0": "eth", "\xD0": "ETH", "\u2147": "ee", "\u212F": "escr", "\u{1D522}": "efr", "\u{1D556}": "eopf", "\u2130": "Escr", "\u{1D508}": "Efr", "\u{1D53C}": "Eopf", "\xE9": "eacute", "\xC9": "Eacute", "\xE8": "egrave", "\xC8": "Egrave", "\xEA": "ecirc", "\xCA": "Ecirc", "\u011B": "ecaron", "\u011A": "Ecaron", "\xEB": "euml", "\xCB": "Euml", "\u0117": "edot", "\u0116": "Edot", "\u0119": "eogon", "\u0118": "Eogon", "\u0113": "emacr", "\u0112": "Emacr", "\u{1D523}": "ffr", "\u{1D557}": "fopf", "\u{1D4BB}": "fscr", "\u{1D509}": "Ffr", "\u{1D53D}": "Fopf", "\u2131": "Fscr", "\uFB00": "fflig", "\uFB03": "ffilig", "\uFB04": "ffllig", "\uFB01": "filig", "fj": "fjlig", "\uFB02": "fllig", "\u0192": "fnof", "\u210A": "gscr", "\u{1D558}": "gopf", "\u{1D524}": "gfr", "\u{1D4A2}": "Gscr", "\u{1D53E}": "Gopf", "\u{1D50A}": "Gfr", "\u01F5": "gacute", "\u011F": "gbreve", "\u011E": "Gbreve", "\u011D": "gcirc", "\u011C": "Gcirc", "\u0121": "gdot", "\u0120": "Gdot", "\u0122": "Gcedil", "\u{1D525}": "hfr", "\u210E": "planckh", "\u{1D4BD}": "hscr", "\u{1D559}": "hopf", "\u210B": "Hscr", "\u210C": "Hfr", "\u210D": "Hopf", "\u0125": "hcirc", "\u0124": "Hcirc", "\u210F": "hbar", "\u0127": "hstrok", "\u0126": "Hstrok", "\u{1D55A}": "iopf", "\u{1D526}": "ifr", "\u{1D4BE}": "iscr", "\u2148": "ii", "\u{1D540}": "Iopf", "\u2110": "Iscr", "\u2111": "Im", "\xED": "iacute", "\xCD": "Iacute", "\xEC": "igrave", "\xCC": "Igrave", "\xEE": "icirc", "\xCE": "Icirc", "\xEF": "iuml", "\xCF": "Iuml", "\u0129": "itilde", "\u0128": "Itilde", "\u0130": "Idot", "\u012F": "iogon", "\u012E": "Iogon", "\u012B": "imacr", "\u012A": "Imacr", "\u0133": "ijlig", "\u0132": "IJlig", "\u0131": "imath", "\u{1D4BF}": "jscr", "\u{1D55B}": "jopf", "\u{1D527}": "jfr", "\u{1D4A5}": "Jscr", "\u{1D50D}": "Jfr", "\u{1D541}": "Jopf", "\u0135": "jcirc", "\u0134": "Jcirc", "\u0237": "jmath", "\u{1D55C}": "kopf", "\u{1D4C0}": "kscr", "\u{1D528}": "kfr", "\u{1D4A6}": "Kscr", "\u{1D542}": "Kopf", "\u{1D50E}": "Kfr", "\u0137": "kcedil", "\u0136": "Kcedil", "\u{1D529}": "lfr", "\u{1D4C1}": "lscr", "\u2113": "ell", "\u{1D55D}": "lopf", "\u2112": "Lscr", "\u{1D50F}": "Lfr", "\u{1D543}": "Lopf", "\u013A": "lacute", "\u0139": "Lacute", "\u013E": "lcaron", "\u013D": "Lcaron", "\u013C": "lcedil", "\u013B": "Lcedil", "\u0142": "lstrok", "\u0141": "Lstrok", "\u0140": "lmidot", "\u013F": "Lmidot", "\u{1D52A}": "mfr", "\u{1D55E}": "mopf", "\u{1D4C2}": "mscr", "\u{1D510}": "Mfr", "\u{1D544}": "Mopf", "\u2133": "Mscr", "\u{1D52B}": "nfr", "\u{1D55F}": "nopf", "\u{1D4C3}": "nscr", "\u2115": "Nopf", "\u{1D4A9}": "Nscr", "\u{1D511}": "Nfr", "\u0144": "nacute", "\u0143": "Nacute", "\u0148": "ncaron", "\u0147": "Ncaron", "\xF1": "ntilde", "\xD1": "Ntilde", "\u0146": "ncedil", "\u0145": "Ncedil", "\u2116": "numero", "\u014B": "eng", "\u014A": "ENG", "\u{1D560}": "oopf", "\u{1D52C}": "ofr", "\u2134": "oscr", "\u{1D4AA}": "Oscr", "\u{1D512}": "Ofr", "\u{1D546}": "Oopf", "\xBA": "ordm", "\xF3": "oacute", "\xD3": "Oacute", "\xF2": "ograve", "\xD2": "Ograve", "\xF4": "ocirc", "\xD4": "Ocirc", "\xF6": "ouml", "\xD6": "Ouml", "\u0151": "odblac", "\u0150": "Odblac", "\xF5": "otilde", "\xD5": "Otilde", "\xF8": "oslash", "\xD8": "Oslash", "\u014D": "omacr", "\u014C": "Omacr", "\u0153": "oelig", "\u0152": "OElig", "\u{1D52D}": "pfr", "\u{1D4C5}": "pscr", "\u{1D561}": "popf", "\u2119": "Popf", "\u{1D513}": "Pfr", "\u{1D4AB}": "Pscr", "\u{1D562}": "qopf", "\u{1D52E}": "qfr", "\u{1D4C6}": "qscr", "\u{1D4AC}": "Qscr", "\u{1D514}": "Qfr", "\u211A": "Qopf", "\u0138": "kgreen", "\u{1D52F}": "rfr", "\u{1D563}": "ropf", "\u{1D4C7}": "rscr", "\u211B": "Rscr", "\u211C": "Re", "\u211D": "Ropf", "\u0155": "racute", "\u0154": "Racute", "\u0159": "rcaron", "\u0158": "Rcaron", "\u0157": "rcedil", "\u0156": "Rcedil", "\u{1D564}": "sopf", "\u{1D4C8}": "sscr", "\u{1D530}": "sfr", "\u{1D54A}": "Sopf", "\u{1D516}": "Sfr", "\u{1D4AE}": "Sscr", "\u24C8": "oS", "\u015B": "sacute", "\u015A": "Sacute", "\u015D": "scirc", "\u015C": "Scirc", "\u0161": "scaron", "\u0160": "Scaron", "\u015F": "scedil", "\u015E": "Scedil", "\xDF": "szlig", "\u{1D531}": "tfr", "\u{1D4C9}": "tscr", "\u{1D565}": "topf", "\u{1D4AF}": "Tscr", "\u{1D517}": "Tfr", "\u{1D54B}": "Topf", "\u0165": "tcaron", "\u0164": "Tcaron", "\u0163": "tcedil", "\u0162": "Tcedil", "\u2122": "trade", "\u0167": "tstrok", "\u0166": "Tstrok", "\u{1D4CA}": "uscr", "\u{1D566}": "uopf", "\u{1D532}": "ufr", "\u{1D54C}": "Uopf", "\u{1D518}": "Ufr", "\u{1D4B0}": "Uscr", "\xFA": "uacute", "\xDA": "Uacute", "\xF9": "ugrave", "\xD9": "Ugrave", "\u016D": "ubreve", "\u016C": "Ubreve", "\xFB": "ucirc", "\xDB": "Ucirc", "\u016F": "uring", "\u016E": "Uring", "\xFC": "uuml", "\xDC": "Uuml", "\u0171": "udblac", "\u0170": "Udblac", "\u0169": "utilde", "\u0168": "Utilde", "\u0173": "uogon", "\u0172": "Uogon", "\u016B": "umacr", "\u016A": "Umacr", "\u{1D533}": "vfr", "\u{1D567}": "vopf", "\u{1D4CB}": "vscr", "\u{1D519}": "Vfr", "\u{1D54D}": "Vopf", "\u{1D4B1}": "Vscr", "\u{1D568}": "wopf", "\u{1D4CC}": "wscr", "\u{1D534}": "wfr", "\u{1D4B2}": "Wscr", "\u{1D54E}": "Wopf", "\u{1D51A}": "Wfr", "\u0175": "wcirc", "\u0174": "Wcirc", "\u{1D535}": "xfr", "\u{1D4CD}": "xscr", "\u{1D569}": "xopf", "\u{1D54F}": "Xopf", "\u{1D51B}": "Xfr", "\u{1D4B3}": "Xscr", "\u{1D536}": "yfr", "\u{1D4CE}": "yscr", "\u{1D56A}": "yopf", "\u{1D4B4}": "Yscr", "\u{1D51C}": "Yfr", "\u{1D550}": "Yopf", "\xFD": "yacute", "\xDD": "Yacute", "\u0177": "ycirc", "\u0176": "Ycirc", "\xFF": "yuml", "\u0178": "Yuml", "\u{1D4CF}": "zscr", "\u{1D537}": "zfr", "\u{1D56B}": "zopf", "\u2128": "Zfr", "\u2124": "Zopf", "\u{1D4B5}": "Zscr", "\u017A": "zacute", "\u0179": "Zacute", "\u017E": "zcaron", "\u017D": "Zcaron", "\u017C": "zdot", "\u017B": "Zdot", "\u01B5": "imped", "\xFE": "thorn", "\xDE": "THORN", "\u0149": "napos", "\u03B1": "alpha", "\u0391": "Alpha", "\u03B2": "beta", "\u0392": "Beta", "\u03B3": "gamma", "\u0393": "Gamma", "\u03B4": "delta", "\u0394": "Delta", "\u03B5": "epsi", "\u03F5": "epsiv", "\u0395": "Epsilon", "\u03DD": "gammad", "\u03DC": "Gammad", "\u03B6": "zeta", "\u0396": "Zeta", "\u03B7": "eta", "\u0397": "Eta", "\u03B8": "theta", "\u03D1": "thetav", "\u0398": "Theta", "\u03B9": "iota", "\u0399": "Iota", "\u03BA": "kappa", "\u03F0": "kappav", "\u039A": "Kappa", "\u03BB": "lambda", "\u039B": "Lambda", "\u03BC": "mu", "\xB5": "micro", "\u039C": "Mu", "\u03BD": "nu", "\u039D": "Nu", "\u03BE": "xi", "\u039E": "Xi", "\u03BF": "omicron", "\u039F": "Omicron", "\u03C0": "pi", "\u03D6": "piv", "\u03A0": "Pi", "\u03C1": "rho", "\u03F1": "rhov", "\u03A1": "Rho", "\u03C3": "sigma", "\u03A3": "Sigma", "\u03C2": "sigmaf", "\u03C4": "tau", "\u03A4": "Tau", "\u03C5": "upsi", "\u03A5": "Upsilon", "\u03D2": "Upsi", "\u03C6": "phi", "\u03D5": "phiv", "\u03A6": "Phi", "\u03C7": "chi", "\u03A7": "Chi", "\u03C8": "psi", "\u03A8": "Psi", "\u03C9": "omega", "\u03A9": "ohm", "\u0430": "acy", "\u0410": "Acy", "\u0431": "bcy", "\u0411": "Bcy", "\u0432": "vcy", "\u0412": "Vcy", "\u0433": "gcy", "\u0413": "Gcy", "\u0453": "gjcy", "\u0403": "GJcy", "\u0434": "dcy", "\u0414": "Dcy", "\u0452": "djcy", "\u0402": "DJcy", "\u0435": "iecy", "\u0415": "IEcy", "\u0451": "iocy", "\u0401": "IOcy", "\u0454": "jukcy", "\u0404": "Jukcy", "\u0436": "zhcy", "\u0416": "ZHcy", "\u0437": "zcy", "\u0417": "Zcy", "\u0455": "dscy", "\u0405": "DScy", "\u0438": "icy", "\u0418": "Icy", "\u0456": "iukcy", "\u0406": "Iukcy", "\u0457": "yicy", "\u0407": "YIcy", "\u0439": "jcy", "\u0419": "Jcy", "\u0458": "jsercy", "\u0408": "Jsercy", "\u043A": "kcy", "\u041A": "Kcy", "\u045C": "kjcy", "\u040C": "KJcy", "\u043B": "lcy", "\u041B": "Lcy", "\u0459": "ljcy", "\u0409": "LJcy", "\u043C": "mcy", "\u041C": "Mcy", "\u043D": "ncy", "\u041D": "Ncy", "\u045A": "njcy", "\u040A": "NJcy", "\u043E": "ocy", "\u041E": "Ocy", "\u043F": "pcy", "\u041F": "Pcy", "\u0440": "rcy", "\u0420": "Rcy", "\u0441": "scy", "\u0421": "Scy", "\u0442": "tcy", "\u0422": "Tcy", "\u045B": "tshcy", "\u040B": "TSHcy", "\u0443": "ucy", "\u0423": "Ucy", "\u045E": "ubrcy", "\u040E": "Ubrcy", "\u0444": "fcy", "\u0424": "Fcy", "\u0445": "khcy", "\u0425": "KHcy", "\u0446": "tscy", "\u0426": "TScy", "\u0447": "chcy", "\u0427": "CHcy", "\u045F": "dzcy", "\u040F": "DZcy", "\u0448": "shcy", "\u0428": "SHcy", "\u0449": "shchcy", "\u0429": "SHCHcy", "\u044A": "hardcy", "\u042A": "HARDcy", "\u044B": "ycy", "\u042B": "Ycy", "\u044C": "softcy", "\u042C": "SOFTcy", "\u044D": "ecy", "\u042D": "Ecy", "\u044E": "yucy", "\u042E": "YUcy", "\u044F": "yacy", "\u042F": "YAcy", "\u2135": "aleph", "\u2136": "beth", "\u2137": "gimel", "\u2138": "daleth" }; + var regexEscape = /["&'<>`]/g; + var escapeMap = { + '"': """, + "&": "&", + "'": "'", + "<": "<", + ">": ">", + "`": "`" + }; + var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/; + var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var regexDecode = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g; + var decodeMap = { "aacute": "\xE1", "Aacute": "\xC1", "abreve": "\u0103", "Abreve": "\u0102", "ac": "\u223E", "acd": "\u223F", "acE": "\u223E\u0333", "acirc": "\xE2", "Acirc": "\xC2", "acute": "\xB4", "acy": "\u0430", "Acy": "\u0410", "aelig": "\xE6", "AElig": "\xC6", "af": "\u2061", "afr": "\u{1D51E}", "Afr": "\u{1D504}", "agrave": "\xE0", "Agrave": "\xC0", "alefsym": "\u2135", "aleph": "\u2135", "alpha": "\u03B1", "Alpha": "\u0391", "amacr": "\u0101", "Amacr": "\u0100", "amalg": "\u2A3F", "amp": "&", "AMP": "&", "and": "\u2227", "And": "\u2A53", "andand": "\u2A55", "andd": "\u2A5C", "andslope": "\u2A58", "andv": "\u2A5A", "ang": "\u2220", "ange": "\u29A4", "angle": "\u2220", "angmsd": "\u2221", "angmsdaa": "\u29A8", "angmsdab": "\u29A9", "angmsdac": "\u29AA", "angmsdad": "\u29AB", "angmsdae": "\u29AC", "angmsdaf": "\u29AD", "angmsdag": "\u29AE", "angmsdah": "\u29AF", "angrt": "\u221F", "angrtvb": "\u22BE", "angrtvbd": "\u299D", "angsph": "\u2222", "angst": "\xC5", "angzarr": "\u237C", "aogon": "\u0105", "Aogon": "\u0104", "aopf": "\u{1D552}", "Aopf": "\u{1D538}", "ap": "\u2248", "apacir": "\u2A6F", "ape": "\u224A", "apE": "\u2A70", "apid": "\u224B", "apos": "'", "ApplyFunction": "\u2061", "approx": "\u2248", "approxeq": "\u224A", "aring": "\xE5", "Aring": "\xC5", "ascr": "\u{1D4B6}", "Ascr": "\u{1D49C}", "Assign": "\u2254", "ast": "*", "asymp": "\u2248", "asympeq": "\u224D", "atilde": "\xE3", "Atilde": "\xC3", "auml": "\xE4", "Auml": "\xC4", "awconint": "\u2233", "awint": "\u2A11", "backcong": "\u224C", "backepsilon": "\u03F6", "backprime": "\u2035", "backsim": "\u223D", "backsimeq": "\u22CD", "Backslash": "\u2216", "Barv": "\u2AE7", "barvee": "\u22BD", "barwed": "\u2305", "Barwed": "\u2306", "barwedge": "\u2305", "bbrk": "\u23B5", "bbrktbrk": "\u23B6", "bcong": "\u224C", "bcy": "\u0431", "Bcy": "\u0411", "bdquo": "\u201E", "becaus": "\u2235", "because": "\u2235", "Because": "\u2235", "bemptyv": "\u29B0", "bepsi": "\u03F6", "bernou": "\u212C", "Bernoullis": "\u212C", "beta": "\u03B2", "Beta": "\u0392", "beth": "\u2136", "between": "\u226C", "bfr": "\u{1D51F}", "Bfr": "\u{1D505}", "bigcap": "\u22C2", "bigcirc": "\u25EF", "bigcup": "\u22C3", "bigodot": "\u2A00", "bigoplus": "\u2A01", "bigotimes": "\u2A02", "bigsqcup": "\u2A06", "bigstar": "\u2605", "bigtriangledown": "\u25BD", "bigtriangleup": "\u25B3", "biguplus": "\u2A04", "bigvee": "\u22C1", "bigwedge": "\u22C0", "bkarow": "\u290D", "blacklozenge": "\u29EB", "blacksquare": "\u25AA", "blacktriangle": "\u25B4", "blacktriangledown": "\u25BE", "blacktriangleleft": "\u25C2", "blacktriangleright": "\u25B8", "blank": "\u2423", "blk12": "\u2592", "blk14": "\u2591", "blk34": "\u2593", "block": "\u2588", "bne": "=\u20E5", "bnequiv": "\u2261\u20E5", "bnot": "\u2310", "bNot": "\u2AED", "bopf": "\u{1D553}", "Bopf": "\u{1D539}", "bot": "\u22A5", "bottom": "\u22A5", "bowtie": "\u22C8", "boxbox": "\u29C9", "boxdl": "\u2510", "boxdL": "\u2555", "boxDl": "\u2556", "boxDL": "\u2557", "boxdr": "\u250C", "boxdR": "\u2552", "boxDr": "\u2553", "boxDR": "\u2554", "boxh": "\u2500", "boxH": "\u2550", "boxhd": "\u252C", "boxhD": "\u2565", "boxHd": "\u2564", "boxHD": "\u2566", "boxhu": "\u2534", "boxhU": "\u2568", "boxHu": "\u2567", "boxHU": "\u2569", "boxminus": "\u229F", "boxplus": "\u229E", "boxtimes": "\u22A0", "boxul": "\u2518", "boxuL": "\u255B", "boxUl": "\u255C", "boxUL": "\u255D", "boxur": "\u2514", "boxuR": "\u2558", "boxUr": "\u2559", "boxUR": "\u255A", "boxv": "\u2502", "boxV": "\u2551", "boxvh": "\u253C", "boxvH": "\u256A", "boxVh": "\u256B", "boxVH": "\u256C", "boxvl": "\u2524", "boxvL": "\u2561", "boxVl": "\u2562", "boxVL": "\u2563", "boxvr": "\u251C", "boxvR": "\u255E", "boxVr": "\u255F", "boxVR": "\u2560", "bprime": "\u2035", "breve": "\u02D8", "Breve": "\u02D8", "brvbar": "\xA6", "bscr": "\u{1D4B7}", "Bscr": "\u212C", "bsemi": "\u204F", "bsim": "\u223D", "bsime": "\u22CD", "bsol": "\\", "bsolb": "\u29C5", "bsolhsub": "\u27C8", "bull": "\u2022", "bullet": "\u2022", "bump": "\u224E", "bumpe": "\u224F", "bumpE": "\u2AAE", "bumpeq": "\u224F", "Bumpeq": "\u224E", "cacute": "\u0107", "Cacute": "\u0106", "cap": "\u2229", "Cap": "\u22D2", "capand": "\u2A44", "capbrcup": "\u2A49", "capcap": "\u2A4B", "capcup": "\u2A47", "capdot": "\u2A40", "CapitalDifferentialD": "\u2145", "caps": "\u2229\uFE00", "caret": "\u2041", "caron": "\u02C7", "Cayleys": "\u212D", "ccaps": "\u2A4D", "ccaron": "\u010D", "Ccaron": "\u010C", "ccedil": "\xE7", "Ccedil": "\xC7", "ccirc": "\u0109", "Ccirc": "\u0108", "Cconint": "\u2230", "ccups": "\u2A4C", "ccupssm": "\u2A50", "cdot": "\u010B", "Cdot": "\u010A", "cedil": "\xB8", "Cedilla": "\xB8", "cemptyv": "\u29B2", "cent": "\xA2", "centerdot": "\xB7", "CenterDot": "\xB7", "cfr": "\u{1D520}", "Cfr": "\u212D", "chcy": "\u0447", "CHcy": "\u0427", "check": "\u2713", "checkmark": "\u2713", "chi": "\u03C7", "Chi": "\u03A7", "cir": "\u25CB", "circ": "\u02C6", "circeq": "\u2257", "circlearrowleft": "\u21BA", "circlearrowright": "\u21BB", "circledast": "\u229B", "circledcirc": "\u229A", "circleddash": "\u229D", "CircleDot": "\u2299", "circledR": "\xAE", "circledS": "\u24C8", "CircleMinus": "\u2296", "CirclePlus": "\u2295", "CircleTimes": "\u2297", "cire": "\u2257", "cirE": "\u29C3", "cirfnint": "\u2A10", "cirmid": "\u2AEF", "cirscir": "\u29C2", "ClockwiseContourIntegral": "\u2232", "CloseCurlyDoubleQuote": "\u201D", "CloseCurlyQuote": "\u2019", "clubs": "\u2663", "clubsuit": "\u2663", "colon": ":", "Colon": "\u2237", "colone": "\u2254", "Colone": "\u2A74", "coloneq": "\u2254", "comma": ",", "commat": "@", "comp": "\u2201", "compfn": "\u2218", "complement": "\u2201", "complexes": "\u2102", "cong": "\u2245", "congdot": "\u2A6D", "Congruent": "\u2261", "conint": "\u222E", "Conint": "\u222F", "ContourIntegral": "\u222E", "copf": "\u{1D554}", "Copf": "\u2102", "coprod": "\u2210", "Coproduct": "\u2210", "copy": "\xA9", "COPY": "\xA9", "copysr": "\u2117", "CounterClockwiseContourIntegral": "\u2233", "crarr": "\u21B5", "cross": "\u2717", "Cross": "\u2A2F", "cscr": "\u{1D4B8}", "Cscr": "\u{1D49E}", "csub": "\u2ACF", "csube": "\u2AD1", "csup": "\u2AD0", "csupe": "\u2AD2", "ctdot": "\u22EF", "cudarrl": "\u2938", "cudarrr": "\u2935", "cuepr": "\u22DE", "cuesc": "\u22DF", "cularr": "\u21B6", "cularrp": "\u293D", "cup": "\u222A", "Cup": "\u22D3", "cupbrcap": "\u2A48", "cupcap": "\u2A46", "CupCap": "\u224D", "cupcup": "\u2A4A", "cupdot": "\u228D", "cupor": "\u2A45", "cups": "\u222A\uFE00", "curarr": "\u21B7", "curarrm": "\u293C", "curlyeqprec": "\u22DE", "curlyeqsucc": "\u22DF", "curlyvee": "\u22CE", "curlywedge": "\u22CF", "curren": "\xA4", "curvearrowleft": "\u21B6", "curvearrowright": "\u21B7", "cuvee": "\u22CE", "cuwed": "\u22CF", "cwconint": "\u2232", "cwint": "\u2231", "cylcty": "\u232D", "dagger": "\u2020", "Dagger": "\u2021", "daleth": "\u2138", "darr": "\u2193", "dArr": "\u21D3", "Darr": "\u21A1", "dash": "\u2010", "dashv": "\u22A3", "Dashv": "\u2AE4", "dbkarow": "\u290F", "dblac": "\u02DD", "dcaron": "\u010F", "Dcaron": "\u010E", "dcy": "\u0434", "Dcy": "\u0414", "dd": "\u2146", "DD": "\u2145", "ddagger": "\u2021", "ddarr": "\u21CA", "DDotrahd": "\u2911", "ddotseq": "\u2A77", "deg": "\xB0", "Del": "\u2207", "delta": "\u03B4", "Delta": "\u0394", "demptyv": "\u29B1", "dfisht": "\u297F", "dfr": "\u{1D521}", "Dfr": "\u{1D507}", "dHar": "\u2965", "dharl": "\u21C3", "dharr": "\u21C2", "DiacriticalAcute": "\xB4", "DiacriticalDot": "\u02D9", "DiacriticalDoubleAcute": "\u02DD", "DiacriticalGrave": "`", "DiacriticalTilde": "\u02DC", "diam": "\u22C4", "diamond": "\u22C4", "Diamond": "\u22C4", "diamondsuit": "\u2666", "diams": "\u2666", "die": "\xA8", "DifferentialD": "\u2146", "digamma": "\u03DD", "disin": "\u22F2", "div": "\xF7", "divide": "\xF7", "divideontimes": "\u22C7", "divonx": "\u22C7", "djcy": "\u0452", "DJcy": "\u0402", "dlcorn": "\u231E", "dlcrop": "\u230D", "dollar": "$", "dopf": "\u{1D555}", "Dopf": "\u{1D53B}", "dot": "\u02D9", "Dot": "\xA8", "DotDot": "\u20DC", "doteq": "\u2250", "doteqdot": "\u2251", "DotEqual": "\u2250", "dotminus": "\u2238", "dotplus": "\u2214", "dotsquare": "\u22A1", "doublebarwedge": "\u2306", "DoubleContourIntegral": "\u222F", "DoubleDot": "\xA8", "DoubleDownArrow": "\u21D3", "DoubleLeftArrow": "\u21D0", "DoubleLeftRightArrow": "\u21D4", "DoubleLeftTee": "\u2AE4", "DoubleLongLeftArrow": "\u27F8", "DoubleLongLeftRightArrow": "\u27FA", "DoubleLongRightArrow": "\u27F9", "DoubleRightArrow": "\u21D2", "DoubleRightTee": "\u22A8", "DoubleUpArrow": "\u21D1", "DoubleUpDownArrow": "\u21D5", "DoubleVerticalBar": "\u2225", "downarrow": "\u2193", "Downarrow": "\u21D3", "DownArrow": "\u2193", "DownArrowBar": "\u2913", "DownArrowUpArrow": "\u21F5", "DownBreve": "\u0311", "downdownarrows": "\u21CA", "downharpoonleft": "\u21C3", "downharpoonright": "\u21C2", "DownLeftRightVector": "\u2950", "DownLeftTeeVector": "\u295E", "DownLeftVector": "\u21BD", "DownLeftVectorBar": "\u2956", "DownRightTeeVector": "\u295F", "DownRightVector": "\u21C1", "DownRightVectorBar": "\u2957", "DownTee": "\u22A4", "DownTeeArrow": "\u21A7", "drbkarow": "\u2910", "drcorn": "\u231F", "drcrop": "\u230C", "dscr": "\u{1D4B9}", "Dscr": "\u{1D49F}", "dscy": "\u0455", "DScy": "\u0405", "dsol": "\u29F6", "dstrok": "\u0111", "Dstrok": "\u0110", "dtdot": "\u22F1", "dtri": "\u25BF", "dtrif": "\u25BE", "duarr": "\u21F5", "duhar": "\u296F", "dwangle": "\u29A6", "dzcy": "\u045F", "DZcy": "\u040F", "dzigrarr": "\u27FF", "eacute": "\xE9", "Eacute": "\xC9", "easter": "\u2A6E", "ecaron": "\u011B", "Ecaron": "\u011A", "ecir": "\u2256", "ecirc": "\xEA", "Ecirc": "\xCA", "ecolon": "\u2255", "ecy": "\u044D", "Ecy": "\u042D", "eDDot": "\u2A77", "edot": "\u0117", "eDot": "\u2251", "Edot": "\u0116", "ee": "\u2147", "efDot": "\u2252", "efr": "\u{1D522}", "Efr": "\u{1D508}", "eg": "\u2A9A", "egrave": "\xE8", "Egrave": "\xC8", "egs": "\u2A96", "egsdot": "\u2A98", "el": "\u2A99", "Element": "\u2208", "elinters": "\u23E7", "ell": "\u2113", "els": "\u2A95", "elsdot": "\u2A97", "emacr": "\u0113", "Emacr": "\u0112", "empty": "\u2205", "emptyset": "\u2205", "EmptySmallSquare": "\u25FB", "emptyv": "\u2205", "EmptyVerySmallSquare": "\u25AB", "emsp": "\u2003", "emsp13": "\u2004", "emsp14": "\u2005", "eng": "\u014B", "ENG": "\u014A", "ensp": "\u2002", "eogon": "\u0119", "Eogon": "\u0118", "eopf": "\u{1D556}", "Eopf": "\u{1D53C}", "epar": "\u22D5", "eparsl": "\u29E3", "eplus": "\u2A71", "epsi": "\u03B5", "epsilon": "\u03B5", "Epsilon": "\u0395", "epsiv": "\u03F5", "eqcirc": "\u2256", "eqcolon": "\u2255", "eqsim": "\u2242", "eqslantgtr": "\u2A96", "eqslantless": "\u2A95", "Equal": "\u2A75", "equals": "=", "EqualTilde": "\u2242", "equest": "\u225F", "Equilibrium": "\u21CC", "equiv": "\u2261", "equivDD": "\u2A78", "eqvparsl": "\u29E5", "erarr": "\u2971", "erDot": "\u2253", "escr": "\u212F", "Escr": "\u2130", "esdot": "\u2250", "esim": "\u2242", "Esim": "\u2A73", "eta": "\u03B7", "Eta": "\u0397", "eth": "\xF0", "ETH": "\xD0", "euml": "\xEB", "Euml": "\xCB", "euro": "\u20AC", "excl": "!", "exist": "\u2203", "Exists": "\u2203", "expectation": "\u2130", "exponentiale": "\u2147", "ExponentialE": "\u2147", "fallingdotseq": "\u2252", "fcy": "\u0444", "Fcy": "\u0424", "female": "\u2640", "ffilig": "\uFB03", "fflig": "\uFB00", "ffllig": "\uFB04", "ffr": "\u{1D523}", "Ffr": "\u{1D509}", "filig": "\uFB01", "FilledSmallSquare": "\u25FC", "FilledVerySmallSquare": "\u25AA", "fjlig": "fj", "flat": "\u266D", "fllig": "\uFB02", "fltns": "\u25B1", "fnof": "\u0192", "fopf": "\u{1D557}", "Fopf": "\u{1D53D}", "forall": "\u2200", "ForAll": "\u2200", "fork": "\u22D4", "forkv": "\u2AD9", "Fouriertrf": "\u2131", "fpartint": "\u2A0D", "frac12": "\xBD", "frac13": "\u2153", "frac14": "\xBC", "frac15": "\u2155", "frac16": "\u2159", "frac18": "\u215B", "frac23": "\u2154", "frac25": "\u2156", "frac34": "\xBE", "frac35": "\u2157", "frac38": "\u215C", "frac45": "\u2158", "frac56": "\u215A", "frac58": "\u215D", "frac78": "\u215E", "frasl": "\u2044", "frown": "\u2322", "fscr": "\u{1D4BB}", "Fscr": "\u2131", "gacute": "\u01F5", "gamma": "\u03B3", "Gamma": "\u0393", "gammad": "\u03DD", "Gammad": "\u03DC", "gap": "\u2A86", "gbreve": "\u011F", "Gbreve": "\u011E", "Gcedil": "\u0122", "gcirc": "\u011D", "Gcirc": "\u011C", "gcy": "\u0433", "Gcy": "\u0413", "gdot": "\u0121", "Gdot": "\u0120", "ge": "\u2265", "gE": "\u2267", "gel": "\u22DB", "gEl": "\u2A8C", "geq": "\u2265", "geqq": "\u2267", "geqslant": "\u2A7E", "ges": "\u2A7E", "gescc": "\u2AA9", "gesdot": "\u2A80", "gesdoto": "\u2A82", "gesdotol": "\u2A84", "gesl": "\u22DB\uFE00", "gesles": "\u2A94", "gfr": "\u{1D524}", "Gfr": "\u{1D50A}", "gg": "\u226B", "Gg": "\u22D9", "ggg": "\u22D9", "gimel": "\u2137", "gjcy": "\u0453", "GJcy": "\u0403", "gl": "\u2277", "gla": "\u2AA5", "glE": "\u2A92", "glj": "\u2AA4", "gnap": "\u2A8A", "gnapprox": "\u2A8A", "gne": "\u2A88", "gnE": "\u2269", "gneq": "\u2A88", "gneqq": "\u2269", "gnsim": "\u22E7", "gopf": "\u{1D558}", "Gopf": "\u{1D53E}", "grave": "`", "GreaterEqual": "\u2265", "GreaterEqualLess": "\u22DB", "GreaterFullEqual": "\u2267", "GreaterGreater": "\u2AA2", "GreaterLess": "\u2277", "GreaterSlantEqual": "\u2A7E", "GreaterTilde": "\u2273", "gscr": "\u210A", "Gscr": "\u{1D4A2}", "gsim": "\u2273", "gsime": "\u2A8E", "gsiml": "\u2A90", "gt": ">", "Gt": "\u226B", "GT": ">", "gtcc": "\u2AA7", "gtcir": "\u2A7A", "gtdot": "\u22D7", "gtlPar": "\u2995", "gtquest": "\u2A7C", "gtrapprox": "\u2A86", "gtrarr": "\u2978", "gtrdot": "\u22D7", "gtreqless": "\u22DB", "gtreqqless": "\u2A8C", "gtrless": "\u2277", "gtrsim": "\u2273", "gvertneqq": "\u2269\uFE00", "gvnE": "\u2269\uFE00", "Hacek": "\u02C7", "hairsp": "\u200A", "half": "\xBD", "hamilt": "\u210B", "hardcy": "\u044A", "HARDcy": "\u042A", "harr": "\u2194", "hArr": "\u21D4", "harrcir": "\u2948", "harrw": "\u21AD", "Hat": "^", "hbar": "\u210F", "hcirc": "\u0125", "Hcirc": "\u0124", "hearts": "\u2665", "heartsuit": "\u2665", "hellip": "\u2026", "hercon": "\u22B9", "hfr": "\u{1D525}", "Hfr": "\u210C", "HilbertSpace": "\u210B", "hksearow": "\u2925", "hkswarow": "\u2926", "hoarr": "\u21FF", "homtht": "\u223B", "hookleftarrow": "\u21A9", "hookrightarrow": "\u21AA", "hopf": "\u{1D559}", "Hopf": "\u210D", "horbar": "\u2015", "HorizontalLine": "\u2500", "hscr": "\u{1D4BD}", "Hscr": "\u210B", "hslash": "\u210F", "hstrok": "\u0127", "Hstrok": "\u0126", "HumpDownHump": "\u224E", "HumpEqual": "\u224F", "hybull": "\u2043", "hyphen": "\u2010", "iacute": "\xED", "Iacute": "\xCD", "ic": "\u2063", "icirc": "\xEE", "Icirc": "\xCE", "icy": "\u0438", "Icy": "\u0418", "Idot": "\u0130", "iecy": "\u0435", "IEcy": "\u0415", "iexcl": "\xA1", "iff": "\u21D4", "ifr": "\u{1D526}", "Ifr": "\u2111", "igrave": "\xEC", "Igrave": "\xCC", "ii": "\u2148", "iiiint": "\u2A0C", "iiint": "\u222D", "iinfin": "\u29DC", "iiota": "\u2129", "ijlig": "\u0133", "IJlig": "\u0132", "Im": "\u2111", "imacr": "\u012B", "Imacr": "\u012A", "image": "\u2111", "ImaginaryI": "\u2148", "imagline": "\u2110", "imagpart": "\u2111", "imath": "\u0131", "imof": "\u22B7", "imped": "\u01B5", "Implies": "\u21D2", "in": "\u2208", "incare": "\u2105", "infin": "\u221E", "infintie": "\u29DD", "inodot": "\u0131", "int": "\u222B", "Int": "\u222C", "intcal": "\u22BA", "integers": "\u2124", "Integral": "\u222B", "intercal": "\u22BA", "Intersection": "\u22C2", "intlarhk": "\u2A17", "intprod": "\u2A3C", "InvisibleComma": "\u2063", "InvisibleTimes": "\u2062", "iocy": "\u0451", "IOcy": "\u0401", "iogon": "\u012F", "Iogon": "\u012E", "iopf": "\u{1D55A}", "Iopf": "\u{1D540}", "iota": "\u03B9", "Iota": "\u0399", "iprod": "\u2A3C", "iquest": "\xBF", "iscr": "\u{1D4BE}", "Iscr": "\u2110", "isin": "\u2208", "isindot": "\u22F5", "isinE": "\u22F9", "isins": "\u22F4", "isinsv": "\u22F3", "isinv": "\u2208", "it": "\u2062", "itilde": "\u0129", "Itilde": "\u0128", "iukcy": "\u0456", "Iukcy": "\u0406", "iuml": "\xEF", "Iuml": "\xCF", "jcirc": "\u0135", "Jcirc": "\u0134", "jcy": "\u0439", "Jcy": "\u0419", "jfr": "\u{1D527}", "Jfr": "\u{1D50D}", "jmath": "\u0237", "jopf": "\u{1D55B}", "Jopf": "\u{1D541}", "jscr": "\u{1D4BF}", "Jscr": "\u{1D4A5}", "jsercy": "\u0458", "Jsercy": "\u0408", "jukcy": "\u0454", "Jukcy": "\u0404", "kappa": "\u03BA", "Kappa": "\u039A", "kappav": "\u03F0", "kcedil": "\u0137", "Kcedil": "\u0136", "kcy": "\u043A", "Kcy": "\u041A", "kfr": "\u{1D528}", "Kfr": "\u{1D50E}", "kgreen": "\u0138", "khcy": "\u0445", "KHcy": "\u0425", "kjcy": "\u045C", "KJcy": "\u040C", "kopf": "\u{1D55C}", "Kopf": "\u{1D542}", "kscr": "\u{1D4C0}", "Kscr": "\u{1D4A6}", "lAarr": "\u21DA", "lacute": "\u013A", "Lacute": "\u0139", "laemptyv": "\u29B4", "lagran": "\u2112", "lambda": "\u03BB", "Lambda": "\u039B", "lang": "\u27E8", "Lang": "\u27EA", "langd": "\u2991", "langle": "\u27E8", "lap": "\u2A85", "Laplacetrf": "\u2112", "laquo": "\xAB", "larr": "\u2190", "lArr": "\u21D0", "Larr": "\u219E", "larrb": "\u21E4", "larrbfs": "\u291F", "larrfs": "\u291D", "larrhk": "\u21A9", "larrlp": "\u21AB", "larrpl": "\u2939", "larrsim": "\u2973", "larrtl": "\u21A2", "lat": "\u2AAB", "latail": "\u2919", "lAtail": "\u291B", "late": "\u2AAD", "lates": "\u2AAD\uFE00", "lbarr": "\u290C", "lBarr": "\u290E", "lbbrk": "\u2772", "lbrace": "{", "lbrack": "[", "lbrke": "\u298B", "lbrksld": "\u298F", "lbrkslu": "\u298D", "lcaron": "\u013E", "Lcaron": "\u013D", "lcedil": "\u013C", "Lcedil": "\u013B", "lceil": "\u2308", "lcub": "{", "lcy": "\u043B", "Lcy": "\u041B", "ldca": "\u2936", "ldquo": "\u201C", "ldquor": "\u201E", "ldrdhar": "\u2967", "ldrushar": "\u294B", "ldsh": "\u21B2", "le": "\u2264", "lE": "\u2266", "LeftAngleBracket": "\u27E8", "leftarrow": "\u2190", "Leftarrow": "\u21D0", "LeftArrow": "\u2190", "LeftArrowBar": "\u21E4", "LeftArrowRightArrow": "\u21C6", "leftarrowtail": "\u21A2", "LeftCeiling": "\u2308", "LeftDoubleBracket": "\u27E6", "LeftDownTeeVector": "\u2961", "LeftDownVector": "\u21C3", "LeftDownVectorBar": "\u2959", "LeftFloor": "\u230A", "leftharpoondown": "\u21BD", "leftharpoonup": "\u21BC", "leftleftarrows": "\u21C7", "leftrightarrow": "\u2194", "Leftrightarrow": "\u21D4", "LeftRightArrow": "\u2194", "leftrightarrows": "\u21C6", "leftrightharpoons": "\u21CB", "leftrightsquigarrow": "\u21AD", "LeftRightVector": "\u294E", "LeftTee": "\u22A3", "LeftTeeArrow": "\u21A4", "LeftTeeVector": "\u295A", "leftthreetimes": "\u22CB", "LeftTriangle": "\u22B2", "LeftTriangleBar": "\u29CF", "LeftTriangleEqual": "\u22B4", "LeftUpDownVector": "\u2951", "LeftUpTeeVector": "\u2960", "LeftUpVector": "\u21BF", "LeftUpVectorBar": "\u2958", "LeftVector": "\u21BC", "LeftVectorBar": "\u2952", "leg": "\u22DA", "lEg": "\u2A8B", "leq": "\u2264", "leqq": "\u2266", "leqslant": "\u2A7D", "les": "\u2A7D", "lescc": "\u2AA8", "lesdot": "\u2A7F", "lesdoto": "\u2A81", "lesdotor": "\u2A83", "lesg": "\u22DA\uFE00", "lesges": "\u2A93", "lessapprox": "\u2A85", "lessdot": "\u22D6", "lesseqgtr": "\u22DA", "lesseqqgtr": "\u2A8B", "LessEqualGreater": "\u22DA", "LessFullEqual": "\u2266", "LessGreater": "\u2276", "lessgtr": "\u2276", "LessLess": "\u2AA1", "lesssim": "\u2272", "LessSlantEqual": "\u2A7D", "LessTilde": "\u2272", "lfisht": "\u297C", "lfloor": "\u230A", "lfr": "\u{1D529}", "Lfr": "\u{1D50F}", "lg": "\u2276", "lgE": "\u2A91", "lHar": "\u2962", "lhard": "\u21BD", "lharu": "\u21BC", "lharul": "\u296A", "lhblk": "\u2584", "ljcy": "\u0459", "LJcy": "\u0409", "ll": "\u226A", "Ll": "\u22D8", "llarr": "\u21C7", "llcorner": "\u231E", "Lleftarrow": "\u21DA", "llhard": "\u296B", "lltri": "\u25FA", "lmidot": "\u0140", "Lmidot": "\u013F", "lmoust": "\u23B0", "lmoustache": "\u23B0", "lnap": "\u2A89", "lnapprox": "\u2A89", "lne": "\u2A87", "lnE": "\u2268", "lneq": "\u2A87", "lneqq": "\u2268", "lnsim": "\u22E6", "loang": "\u27EC", "loarr": "\u21FD", "lobrk": "\u27E6", "longleftarrow": "\u27F5", "Longleftarrow": "\u27F8", "LongLeftArrow": "\u27F5", "longleftrightarrow": "\u27F7", "Longleftrightarrow": "\u27FA", "LongLeftRightArrow": "\u27F7", "longmapsto": "\u27FC", "longrightarrow": "\u27F6", "Longrightarrow": "\u27F9", "LongRightArrow": "\u27F6", "looparrowleft": "\u21AB", "looparrowright": "\u21AC", "lopar": "\u2985", "lopf": "\u{1D55D}", "Lopf": "\u{1D543}", "loplus": "\u2A2D", "lotimes": "\u2A34", "lowast": "\u2217", "lowbar": "_", "LowerLeftArrow": "\u2199", "LowerRightArrow": "\u2198", "loz": "\u25CA", "lozenge": "\u25CA", "lozf": "\u29EB", "lpar": "(", "lparlt": "\u2993", "lrarr": "\u21C6", "lrcorner": "\u231F", "lrhar": "\u21CB", "lrhard": "\u296D", "lrm": "\u200E", "lrtri": "\u22BF", "lsaquo": "\u2039", "lscr": "\u{1D4C1}", "Lscr": "\u2112", "lsh": "\u21B0", "Lsh": "\u21B0", "lsim": "\u2272", "lsime": "\u2A8D", "lsimg": "\u2A8F", "lsqb": "[", "lsquo": "\u2018", "lsquor": "\u201A", "lstrok": "\u0142", "Lstrok": "\u0141", "lt": "<", "Lt": "\u226A", "LT": "<", "ltcc": "\u2AA6", "ltcir": "\u2A79", "ltdot": "\u22D6", "lthree": "\u22CB", "ltimes": "\u22C9", "ltlarr": "\u2976", "ltquest": "\u2A7B", "ltri": "\u25C3", "ltrie": "\u22B4", "ltrif": "\u25C2", "ltrPar": "\u2996", "lurdshar": "\u294A", "luruhar": "\u2966", "lvertneqq": "\u2268\uFE00", "lvnE": "\u2268\uFE00", "macr": "\xAF", "male": "\u2642", "malt": "\u2720", "maltese": "\u2720", "map": "\u21A6", "Map": "\u2905", "mapsto": "\u21A6", "mapstodown": "\u21A7", "mapstoleft": "\u21A4", "mapstoup": "\u21A5", "marker": "\u25AE", "mcomma": "\u2A29", "mcy": "\u043C", "Mcy": "\u041C", "mdash": "\u2014", "mDDot": "\u223A", "measuredangle": "\u2221", "MediumSpace": "\u205F", "Mellintrf": "\u2133", "mfr": "\u{1D52A}", "Mfr": "\u{1D510}", "mho": "\u2127", "micro": "\xB5", "mid": "\u2223", "midast": "*", "midcir": "\u2AF0", "middot": "\xB7", "minus": "\u2212", "minusb": "\u229F", "minusd": "\u2238", "minusdu": "\u2A2A", "MinusPlus": "\u2213", "mlcp": "\u2ADB", "mldr": "\u2026", "mnplus": "\u2213", "models": "\u22A7", "mopf": "\u{1D55E}", "Mopf": "\u{1D544}", "mp": "\u2213", "mscr": "\u{1D4C2}", "Mscr": "\u2133", "mstpos": "\u223E", "mu": "\u03BC", "Mu": "\u039C", "multimap": "\u22B8", "mumap": "\u22B8", "nabla": "\u2207", "nacute": "\u0144", "Nacute": "\u0143", "nang": "\u2220\u20D2", "nap": "\u2249", "napE": "\u2A70\u0338", "napid": "\u224B\u0338", "napos": "\u0149", "napprox": "\u2249", "natur": "\u266E", "natural": "\u266E", "naturals": "\u2115", "nbsp": "\xA0", "nbump": "\u224E\u0338", "nbumpe": "\u224F\u0338", "ncap": "\u2A43", "ncaron": "\u0148", "Ncaron": "\u0147", "ncedil": "\u0146", "Ncedil": "\u0145", "ncong": "\u2247", "ncongdot": "\u2A6D\u0338", "ncup": "\u2A42", "ncy": "\u043D", "Ncy": "\u041D", "ndash": "\u2013", "ne": "\u2260", "nearhk": "\u2924", "nearr": "\u2197", "neArr": "\u21D7", "nearrow": "\u2197", "nedot": "\u2250\u0338", "NegativeMediumSpace": "\u200B", "NegativeThickSpace": "\u200B", "NegativeThinSpace": "\u200B", "NegativeVeryThinSpace": "\u200B", "nequiv": "\u2262", "nesear": "\u2928", "nesim": "\u2242\u0338", "NestedGreaterGreater": "\u226B", "NestedLessLess": "\u226A", "NewLine": "\n", "nexist": "\u2204", "nexists": "\u2204", "nfr": "\u{1D52B}", "Nfr": "\u{1D511}", "nge": "\u2271", "ngE": "\u2267\u0338", "ngeq": "\u2271", "ngeqq": "\u2267\u0338", "ngeqslant": "\u2A7E\u0338", "nges": "\u2A7E\u0338", "nGg": "\u22D9\u0338", "ngsim": "\u2275", "ngt": "\u226F", "nGt": "\u226B\u20D2", "ngtr": "\u226F", "nGtv": "\u226B\u0338", "nharr": "\u21AE", "nhArr": "\u21CE", "nhpar": "\u2AF2", "ni": "\u220B", "nis": "\u22FC", "nisd": "\u22FA", "niv": "\u220B", "njcy": "\u045A", "NJcy": "\u040A", "nlarr": "\u219A", "nlArr": "\u21CD", "nldr": "\u2025", "nle": "\u2270", "nlE": "\u2266\u0338", "nleftarrow": "\u219A", "nLeftarrow": "\u21CD", "nleftrightarrow": "\u21AE", "nLeftrightarrow": "\u21CE", "nleq": "\u2270", "nleqq": "\u2266\u0338", "nleqslant": "\u2A7D\u0338", "nles": "\u2A7D\u0338", "nless": "\u226E", "nLl": "\u22D8\u0338", "nlsim": "\u2274", "nlt": "\u226E", "nLt": "\u226A\u20D2", "nltri": "\u22EA", "nltrie": "\u22EC", "nLtv": "\u226A\u0338", "nmid": "\u2224", "NoBreak": "\u2060", "NonBreakingSpace": "\xA0", "nopf": "\u{1D55F}", "Nopf": "\u2115", "not": "\xAC", "Not": "\u2AEC", "NotCongruent": "\u2262", "NotCupCap": "\u226D", "NotDoubleVerticalBar": "\u2226", "NotElement": "\u2209", "NotEqual": "\u2260", "NotEqualTilde": "\u2242\u0338", "NotExists": "\u2204", "NotGreater": "\u226F", "NotGreaterEqual": "\u2271", "NotGreaterFullEqual": "\u2267\u0338", "NotGreaterGreater": "\u226B\u0338", "NotGreaterLess": "\u2279", "NotGreaterSlantEqual": "\u2A7E\u0338", "NotGreaterTilde": "\u2275", "NotHumpDownHump": "\u224E\u0338", "NotHumpEqual": "\u224F\u0338", "notin": "\u2209", "notindot": "\u22F5\u0338", "notinE": "\u22F9\u0338", "notinva": "\u2209", "notinvb": "\u22F7", "notinvc": "\u22F6", "NotLeftTriangle": "\u22EA", "NotLeftTriangleBar": "\u29CF\u0338", "NotLeftTriangleEqual": "\u22EC", "NotLess": "\u226E", "NotLessEqual": "\u2270", "NotLessGreater": "\u2278", "NotLessLess": "\u226A\u0338", "NotLessSlantEqual": "\u2A7D\u0338", "NotLessTilde": "\u2274", "NotNestedGreaterGreater": "\u2AA2\u0338", "NotNestedLessLess": "\u2AA1\u0338", "notni": "\u220C", "notniva": "\u220C", "notnivb": "\u22FE", "notnivc": "\u22FD", "NotPrecedes": "\u2280", "NotPrecedesEqual": "\u2AAF\u0338", "NotPrecedesSlantEqual": "\u22E0", "NotReverseElement": "\u220C", "NotRightTriangle": "\u22EB", "NotRightTriangleBar": "\u29D0\u0338", "NotRightTriangleEqual": "\u22ED", "NotSquareSubset": "\u228F\u0338", "NotSquareSubsetEqual": "\u22E2", "NotSquareSuperset": "\u2290\u0338", "NotSquareSupersetEqual": "\u22E3", "NotSubset": "\u2282\u20D2", "NotSubsetEqual": "\u2288", "NotSucceeds": "\u2281", "NotSucceedsEqual": "\u2AB0\u0338", "NotSucceedsSlantEqual": "\u22E1", "NotSucceedsTilde": "\u227F\u0338", "NotSuperset": "\u2283\u20D2", "NotSupersetEqual": "\u2289", "NotTilde": "\u2241", "NotTildeEqual": "\u2244", "NotTildeFullEqual": "\u2247", "NotTildeTilde": "\u2249", "NotVerticalBar": "\u2224", "npar": "\u2226", "nparallel": "\u2226", "nparsl": "\u2AFD\u20E5", "npart": "\u2202\u0338", "npolint": "\u2A14", "npr": "\u2280", "nprcue": "\u22E0", "npre": "\u2AAF\u0338", "nprec": "\u2280", "npreceq": "\u2AAF\u0338", "nrarr": "\u219B", "nrArr": "\u21CF", "nrarrc": "\u2933\u0338", "nrarrw": "\u219D\u0338", "nrightarrow": "\u219B", "nRightarrow": "\u21CF", "nrtri": "\u22EB", "nrtrie": "\u22ED", "nsc": "\u2281", "nsccue": "\u22E1", "nsce": "\u2AB0\u0338", "nscr": "\u{1D4C3}", "Nscr": "\u{1D4A9}", "nshortmid": "\u2224", "nshortparallel": "\u2226", "nsim": "\u2241", "nsime": "\u2244", "nsimeq": "\u2244", "nsmid": "\u2224", "nspar": "\u2226", "nsqsube": "\u22E2", "nsqsupe": "\u22E3", "nsub": "\u2284", "nsube": "\u2288", "nsubE": "\u2AC5\u0338", "nsubset": "\u2282\u20D2", "nsubseteq": "\u2288", "nsubseteqq": "\u2AC5\u0338", "nsucc": "\u2281", "nsucceq": "\u2AB0\u0338", "nsup": "\u2285", "nsupe": "\u2289", "nsupE": "\u2AC6\u0338", "nsupset": "\u2283\u20D2", "nsupseteq": "\u2289", "nsupseteqq": "\u2AC6\u0338", "ntgl": "\u2279", "ntilde": "\xF1", "Ntilde": "\xD1", "ntlg": "\u2278", "ntriangleleft": "\u22EA", "ntrianglelefteq": "\u22EC", "ntriangleright": "\u22EB", "ntrianglerighteq": "\u22ED", "nu": "\u03BD", "Nu": "\u039D", "num": "#", "numero": "\u2116", "numsp": "\u2007", "nvap": "\u224D\u20D2", "nvdash": "\u22AC", "nvDash": "\u22AD", "nVdash": "\u22AE", "nVDash": "\u22AF", "nvge": "\u2265\u20D2", "nvgt": ">\u20D2", "nvHarr": "\u2904", "nvinfin": "\u29DE", "nvlArr": "\u2902", "nvle": "\u2264\u20D2", "nvlt": "<\u20D2", "nvltrie": "\u22B4\u20D2", "nvrArr": "\u2903", "nvrtrie": "\u22B5\u20D2", "nvsim": "\u223C\u20D2", "nwarhk": "\u2923", "nwarr": "\u2196", "nwArr": "\u21D6", "nwarrow": "\u2196", "nwnear": "\u2927", "oacute": "\xF3", "Oacute": "\xD3", "oast": "\u229B", "ocir": "\u229A", "ocirc": "\xF4", "Ocirc": "\xD4", "ocy": "\u043E", "Ocy": "\u041E", "odash": "\u229D", "odblac": "\u0151", "Odblac": "\u0150", "odiv": "\u2A38", "odot": "\u2299", "odsold": "\u29BC", "oelig": "\u0153", "OElig": "\u0152", "ofcir": "\u29BF", "ofr": "\u{1D52C}", "Ofr": "\u{1D512}", "ogon": "\u02DB", "ograve": "\xF2", "Ograve": "\xD2", "ogt": "\u29C1", "ohbar": "\u29B5", "ohm": "\u03A9", "oint": "\u222E", "olarr": "\u21BA", "olcir": "\u29BE", "olcross": "\u29BB", "oline": "\u203E", "olt": "\u29C0", "omacr": "\u014D", "Omacr": "\u014C", "omega": "\u03C9", "Omega": "\u03A9", "omicron": "\u03BF", "Omicron": "\u039F", "omid": "\u29B6", "ominus": "\u2296", "oopf": "\u{1D560}", "Oopf": "\u{1D546}", "opar": "\u29B7", "OpenCurlyDoubleQuote": "\u201C", "OpenCurlyQuote": "\u2018", "operp": "\u29B9", "oplus": "\u2295", "or": "\u2228", "Or": "\u2A54", "orarr": "\u21BB", "ord": "\u2A5D", "order": "\u2134", "orderof": "\u2134", "ordf": "\xAA", "ordm": "\xBA", "origof": "\u22B6", "oror": "\u2A56", "orslope": "\u2A57", "orv": "\u2A5B", "oS": "\u24C8", "oscr": "\u2134", "Oscr": "\u{1D4AA}", "oslash": "\xF8", "Oslash": "\xD8", "osol": "\u2298", "otilde": "\xF5", "Otilde": "\xD5", "otimes": "\u2297", "Otimes": "\u2A37", "otimesas": "\u2A36", "ouml": "\xF6", "Ouml": "\xD6", "ovbar": "\u233D", "OverBar": "\u203E", "OverBrace": "\u23DE", "OverBracket": "\u23B4", "OverParenthesis": "\u23DC", "par": "\u2225", "para": "\xB6", "parallel": "\u2225", "parsim": "\u2AF3", "parsl": "\u2AFD", "part": "\u2202", "PartialD": "\u2202", "pcy": "\u043F", "Pcy": "\u041F", "percnt": "%", "period": ".", "permil": "\u2030", "perp": "\u22A5", "pertenk": "\u2031", "pfr": "\u{1D52D}", "Pfr": "\u{1D513}", "phi": "\u03C6", "Phi": "\u03A6", "phiv": "\u03D5", "phmmat": "\u2133", "phone": "\u260E", "pi": "\u03C0", "Pi": "\u03A0", "pitchfork": "\u22D4", "piv": "\u03D6", "planck": "\u210F", "planckh": "\u210E", "plankv": "\u210F", "plus": "+", "plusacir": "\u2A23", "plusb": "\u229E", "pluscir": "\u2A22", "plusdo": "\u2214", "plusdu": "\u2A25", "pluse": "\u2A72", "PlusMinus": "\xB1", "plusmn": "\xB1", "plussim": "\u2A26", "plustwo": "\u2A27", "pm": "\xB1", "Poincareplane": "\u210C", "pointint": "\u2A15", "popf": "\u{1D561}", "Popf": "\u2119", "pound": "\xA3", "pr": "\u227A", "Pr": "\u2ABB", "prap": "\u2AB7", "prcue": "\u227C", "pre": "\u2AAF", "prE": "\u2AB3", "prec": "\u227A", "precapprox": "\u2AB7", "preccurlyeq": "\u227C", "Precedes": "\u227A", "PrecedesEqual": "\u2AAF", "PrecedesSlantEqual": "\u227C", "PrecedesTilde": "\u227E", "preceq": "\u2AAF", "precnapprox": "\u2AB9", "precneqq": "\u2AB5", "precnsim": "\u22E8", "precsim": "\u227E", "prime": "\u2032", "Prime": "\u2033", "primes": "\u2119", "prnap": "\u2AB9", "prnE": "\u2AB5", "prnsim": "\u22E8", "prod": "\u220F", "Product": "\u220F", "profalar": "\u232E", "profline": "\u2312", "profsurf": "\u2313", "prop": "\u221D", "Proportion": "\u2237", "Proportional": "\u221D", "propto": "\u221D", "prsim": "\u227E", "prurel": "\u22B0", "pscr": "\u{1D4C5}", "Pscr": "\u{1D4AB}", "psi": "\u03C8", "Psi": "\u03A8", "puncsp": "\u2008", "qfr": "\u{1D52E}", "Qfr": "\u{1D514}", "qint": "\u2A0C", "qopf": "\u{1D562}", "Qopf": "\u211A", "qprime": "\u2057", "qscr": "\u{1D4C6}", "Qscr": "\u{1D4AC}", "quaternions": "\u210D", "quatint": "\u2A16", "quest": "?", "questeq": "\u225F", "quot": '"', "QUOT": '"', "rAarr": "\u21DB", "race": "\u223D\u0331", "racute": "\u0155", "Racute": "\u0154", "radic": "\u221A", "raemptyv": "\u29B3", "rang": "\u27E9", "Rang": "\u27EB", "rangd": "\u2992", "range": "\u29A5", "rangle": "\u27E9", "raquo": "\xBB", "rarr": "\u2192", "rArr": "\u21D2", "Rarr": "\u21A0", "rarrap": "\u2975", "rarrb": "\u21E5", "rarrbfs": "\u2920", "rarrc": "\u2933", "rarrfs": "\u291E", "rarrhk": "\u21AA", "rarrlp": "\u21AC", "rarrpl": "\u2945", "rarrsim": "\u2974", "rarrtl": "\u21A3", "Rarrtl": "\u2916", "rarrw": "\u219D", "ratail": "\u291A", "rAtail": "\u291C", "ratio": "\u2236", "rationals": "\u211A", "rbarr": "\u290D", "rBarr": "\u290F", "RBarr": "\u2910", "rbbrk": "\u2773", "rbrace": "}", "rbrack": "]", "rbrke": "\u298C", "rbrksld": "\u298E", "rbrkslu": "\u2990", "rcaron": "\u0159", "Rcaron": "\u0158", "rcedil": "\u0157", "Rcedil": "\u0156", "rceil": "\u2309", "rcub": "}", "rcy": "\u0440", "Rcy": "\u0420", "rdca": "\u2937", "rdldhar": "\u2969", "rdquo": "\u201D", "rdquor": "\u201D", "rdsh": "\u21B3", "Re": "\u211C", "real": "\u211C", "realine": "\u211B", "realpart": "\u211C", "reals": "\u211D", "rect": "\u25AD", "reg": "\xAE", "REG": "\xAE", "ReverseElement": "\u220B", "ReverseEquilibrium": "\u21CB", "ReverseUpEquilibrium": "\u296F", "rfisht": "\u297D", "rfloor": "\u230B", "rfr": "\u{1D52F}", "Rfr": "\u211C", "rHar": "\u2964", "rhard": "\u21C1", "rharu": "\u21C0", "rharul": "\u296C", "rho": "\u03C1", "Rho": "\u03A1", "rhov": "\u03F1", "RightAngleBracket": "\u27E9", "rightarrow": "\u2192", "Rightarrow": "\u21D2", "RightArrow": "\u2192", "RightArrowBar": "\u21E5", "RightArrowLeftArrow": "\u21C4", "rightarrowtail": "\u21A3", "RightCeiling": "\u2309", "RightDoubleBracket": "\u27E7", "RightDownTeeVector": "\u295D", "RightDownVector": "\u21C2", "RightDownVectorBar": "\u2955", "RightFloor": "\u230B", "rightharpoondown": "\u21C1", "rightharpoonup": "\u21C0", "rightleftarrows": "\u21C4", "rightleftharpoons": "\u21CC", "rightrightarrows": "\u21C9", "rightsquigarrow": "\u219D", "RightTee": "\u22A2", "RightTeeArrow": "\u21A6", "RightTeeVector": "\u295B", "rightthreetimes": "\u22CC", "RightTriangle": "\u22B3", "RightTriangleBar": "\u29D0", "RightTriangleEqual": "\u22B5", "RightUpDownVector": "\u294F", "RightUpTeeVector": "\u295C", "RightUpVector": "\u21BE", "RightUpVectorBar": "\u2954", "RightVector": "\u21C0", "RightVectorBar": "\u2953", "ring": "\u02DA", "risingdotseq": "\u2253", "rlarr": "\u21C4", "rlhar": "\u21CC", "rlm": "\u200F", "rmoust": "\u23B1", "rmoustache": "\u23B1", "rnmid": "\u2AEE", "roang": "\u27ED", "roarr": "\u21FE", "robrk": "\u27E7", "ropar": "\u2986", "ropf": "\u{1D563}", "Ropf": "\u211D", "roplus": "\u2A2E", "rotimes": "\u2A35", "RoundImplies": "\u2970", "rpar": ")", "rpargt": "\u2994", "rppolint": "\u2A12", "rrarr": "\u21C9", "Rrightarrow": "\u21DB", "rsaquo": "\u203A", "rscr": "\u{1D4C7}", "Rscr": "\u211B", "rsh": "\u21B1", "Rsh": "\u21B1", "rsqb": "]", "rsquo": "\u2019", "rsquor": "\u2019", "rthree": "\u22CC", "rtimes": "\u22CA", "rtri": "\u25B9", "rtrie": "\u22B5", "rtrif": "\u25B8", "rtriltri": "\u29CE", "RuleDelayed": "\u29F4", "ruluhar": "\u2968", "rx": "\u211E", "sacute": "\u015B", "Sacute": "\u015A", "sbquo": "\u201A", "sc": "\u227B", "Sc": "\u2ABC", "scap": "\u2AB8", "scaron": "\u0161", "Scaron": "\u0160", "sccue": "\u227D", "sce": "\u2AB0", "scE": "\u2AB4", "scedil": "\u015F", "Scedil": "\u015E", "scirc": "\u015D", "Scirc": "\u015C", "scnap": "\u2ABA", "scnE": "\u2AB6", "scnsim": "\u22E9", "scpolint": "\u2A13", "scsim": "\u227F", "scy": "\u0441", "Scy": "\u0421", "sdot": "\u22C5", "sdotb": "\u22A1", "sdote": "\u2A66", "searhk": "\u2925", "searr": "\u2198", "seArr": "\u21D8", "searrow": "\u2198", "sect": "\xA7", "semi": ";", "seswar": "\u2929", "setminus": "\u2216", "setmn": "\u2216", "sext": "\u2736", "sfr": "\u{1D530}", "Sfr": "\u{1D516}", "sfrown": "\u2322", "sharp": "\u266F", "shchcy": "\u0449", "SHCHcy": "\u0429", "shcy": "\u0448", "SHcy": "\u0428", "ShortDownArrow": "\u2193", "ShortLeftArrow": "\u2190", "shortmid": "\u2223", "shortparallel": "\u2225", "ShortRightArrow": "\u2192", "ShortUpArrow": "\u2191", "shy": "\xAD", "sigma": "\u03C3", "Sigma": "\u03A3", "sigmaf": "\u03C2", "sigmav": "\u03C2", "sim": "\u223C", "simdot": "\u2A6A", "sime": "\u2243", "simeq": "\u2243", "simg": "\u2A9E", "simgE": "\u2AA0", "siml": "\u2A9D", "simlE": "\u2A9F", "simne": "\u2246", "simplus": "\u2A24", "simrarr": "\u2972", "slarr": "\u2190", "SmallCircle": "\u2218", "smallsetminus": "\u2216", "smashp": "\u2A33", "smeparsl": "\u29E4", "smid": "\u2223", "smile": "\u2323", "smt": "\u2AAA", "smte": "\u2AAC", "smtes": "\u2AAC\uFE00", "softcy": "\u044C", "SOFTcy": "\u042C", "sol": "/", "solb": "\u29C4", "solbar": "\u233F", "sopf": "\u{1D564}", "Sopf": "\u{1D54A}", "spades": "\u2660", "spadesuit": "\u2660", "spar": "\u2225", "sqcap": "\u2293", "sqcaps": "\u2293\uFE00", "sqcup": "\u2294", "sqcups": "\u2294\uFE00", "Sqrt": "\u221A", "sqsub": "\u228F", "sqsube": "\u2291", "sqsubset": "\u228F", "sqsubseteq": "\u2291", "sqsup": "\u2290", "sqsupe": "\u2292", "sqsupset": "\u2290", "sqsupseteq": "\u2292", "squ": "\u25A1", "square": "\u25A1", "Square": "\u25A1", "SquareIntersection": "\u2293", "SquareSubset": "\u228F", "SquareSubsetEqual": "\u2291", "SquareSuperset": "\u2290", "SquareSupersetEqual": "\u2292", "SquareUnion": "\u2294", "squarf": "\u25AA", "squf": "\u25AA", "srarr": "\u2192", "sscr": "\u{1D4C8}", "Sscr": "\u{1D4AE}", "ssetmn": "\u2216", "ssmile": "\u2323", "sstarf": "\u22C6", "star": "\u2606", "Star": "\u22C6", "starf": "\u2605", "straightepsilon": "\u03F5", "straightphi": "\u03D5", "strns": "\xAF", "sub": "\u2282", "Sub": "\u22D0", "subdot": "\u2ABD", "sube": "\u2286", "subE": "\u2AC5", "subedot": "\u2AC3", "submult": "\u2AC1", "subne": "\u228A", "subnE": "\u2ACB", "subplus": "\u2ABF", "subrarr": "\u2979", "subset": "\u2282", "Subset": "\u22D0", "subseteq": "\u2286", "subseteqq": "\u2AC5", "SubsetEqual": "\u2286", "subsetneq": "\u228A", "subsetneqq": "\u2ACB", "subsim": "\u2AC7", "subsub": "\u2AD5", "subsup": "\u2AD3", "succ": "\u227B", "succapprox": "\u2AB8", "succcurlyeq": "\u227D", "Succeeds": "\u227B", "SucceedsEqual": "\u2AB0", "SucceedsSlantEqual": "\u227D", "SucceedsTilde": "\u227F", "succeq": "\u2AB0", "succnapprox": "\u2ABA", "succneqq": "\u2AB6", "succnsim": "\u22E9", "succsim": "\u227F", "SuchThat": "\u220B", "sum": "\u2211", "Sum": "\u2211", "sung": "\u266A", "sup": "\u2283", "Sup": "\u22D1", "sup1": "\xB9", "sup2": "\xB2", "sup3": "\xB3", "supdot": "\u2ABE", "supdsub": "\u2AD8", "supe": "\u2287", "supE": "\u2AC6", "supedot": "\u2AC4", "Superset": "\u2283", "SupersetEqual": "\u2287", "suphsol": "\u27C9", "suphsub": "\u2AD7", "suplarr": "\u297B", "supmult": "\u2AC2", "supne": "\u228B", "supnE": "\u2ACC", "supplus": "\u2AC0", "supset": "\u2283", "Supset": "\u22D1", "supseteq": "\u2287", "supseteqq": "\u2AC6", "supsetneq": "\u228B", "supsetneqq": "\u2ACC", "supsim": "\u2AC8", "supsub": "\u2AD4", "supsup": "\u2AD6", "swarhk": "\u2926", "swarr": "\u2199", "swArr": "\u21D9", "swarrow": "\u2199", "swnwar": "\u292A", "szlig": "\xDF", "Tab": " ", "target": "\u2316", "tau": "\u03C4", "Tau": "\u03A4", "tbrk": "\u23B4", "tcaron": "\u0165", "Tcaron": "\u0164", "tcedil": "\u0163", "Tcedil": "\u0162", "tcy": "\u0442", "Tcy": "\u0422", "tdot": "\u20DB", "telrec": "\u2315", "tfr": "\u{1D531}", "Tfr": "\u{1D517}", "there4": "\u2234", "therefore": "\u2234", "Therefore": "\u2234", "theta": "\u03B8", "Theta": "\u0398", "thetasym": "\u03D1", "thetav": "\u03D1", "thickapprox": "\u2248", "thicksim": "\u223C", "ThickSpace": "\u205F\u200A", "thinsp": "\u2009", "ThinSpace": "\u2009", "thkap": "\u2248", "thksim": "\u223C", "thorn": "\xFE", "THORN": "\xDE", "tilde": "\u02DC", "Tilde": "\u223C", "TildeEqual": "\u2243", "TildeFullEqual": "\u2245", "TildeTilde": "\u2248", "times": "\xD7", "timesb": "\u22A0", "timesbar": "\u2A31", "timesd": "\u2A30", "tint": "\u222D", "toea": "\u2928", "top": "\u22A4", "topbot": "\u2336", "topcir": "\u2AF1", "topf": "\u{1D565}", "Topf": "\u{1D54B}", "topfork": "\u2ADA", "tosa": "\u2929", "tprime": "\u2034", "trade": "\u2122", "TRADE": "\u2122", "triangle": "\u25B5", "triangledown": "\u25BF", "triangleleft": "\u25C3", "trianglelefteq": "\u22B4", "triangleq": "\u225C", "triangleright": "\u25B9", "trianglerighteq": "\u22B5", "tridot": "\u25EC", "trie": "\u225C", "triminus": "\u2A3A", "TripleDot": "\u20DB", "triplus": "\u2A39", "trisb": "\u29CD", "tritime": "\u2A3B", "trpezium": "\u23E2", "tscr": "\u{1D4C9}", "Tscr": "\u{1D4AF}", "tscy": "\u0446", "TScy": "\u0426", "tshcy": "\u045B", "TSHcy": "\u040B", "tstrok": "\u0167", "Tstrok": "\u0166", "twixt": "\u226C", "twoheadleftarrow": "\u219E", "twoheadrightarrow": "\u21A0", "uacute": "\xFA", "Uacute": "\xDA", "uarr": "\u2191", "uArr": "\u21D1", "Uarr": "\u219F", "Uarrocir": "\u2949", "ubrcy": "\u045E", "Ubrcy": "\u040E", "ubreve": "\u016D", "Ubreve": "\u016C", "ucirc": "\xFB", "Ucirc": "\xDB", "ucy": "\u0443", "Ucy": "\u0423", "udarr": "\u21C5", "udblac": "\u0171", "Udblac": "\u0170", "udhar": "\u296E", "ufisht": "\u297E", "ufr": "\u{1D532}", "Ufr": "\u{1D518}", "ugrave": "\xF9", "Ugrave": "\xD9", "uHar": "\u2963", "uharl": "\u21BF", "uharr": "\u21BE", "uhblk": "\u2580", "ulcorn": "\u231C", "ulcorner": "\u231C", "ulcrop": "\u230F", "ultri": "\u25F8", "umacr": "\u016B", "Umacr": "\u016A", "uml": "\xA8", "UnderBar": "_", "UnderBrace": "\u23DF", "UnderBracket": "\u23B5", "UnderParenthesis": "\u23DD", "Union": "\u22C3", "UnionPlus": "\u228E", "uogon": "\u0173", "Uogon": "\u0172", "uopf": "\u{1D566}", "Uopf": "\u{1D54C}", "uparrow": "\u2191", "Uparrow": "\u21D1", "UpArrow": "\u2191", "UpArrowBar": "\u2912", "UpArrowDownArrow": "\u21C5", "updownarrow": "\u2195", "Updownarrow": "\u21D5", "UpDownArrow": "\u2195", "UpEquilibrium": "\u296E", "upharpoonleft": "\u21BF", "upharpoonright": "\u21BE", "uplus": "\u228E", "UpperLeftArrow": "\u2196", "UpperRightArrow": "\u2197", "upsi": "\u03C5", "Upsi": "\u03D2", "upsih": "\u03D2", "upsilon": "\u03C5", "Upsilon": "\u03A5", "UpTee": "\u22A5", "UpTeeArrow": "\u21A5", "upuparrows": "\u21C8", "urcorn": "\u231D", "urcorner": "\u231D", "urcrop": "\u230E", "uring": "\u016F", "Uring": "\u016E", "urtri": "\u25F9", "uscr": "\u{1D4CA}", "Uscr": "\u{1D4B0}", "utdot": "\u22F0", "utilde": "\u0169", "Utilde": "\u0168", "utri": "\u25B5", "utrif": "\u25B4", "uuarr": "\u21C8", "uuml": "\xFC", "Uuml": "\xDC", "uwangle": "\u29A7", "vangrt": "\u299C", "varepsilon": "\u03F5", "varkappa": "\u03F0", "varnothing": "\u2205", "varphi": "\u03D5", "varpi": "\u03D6", "varpropto": "\u221D", "varr": "\u2195", "vArr": "\u21D5", "varrho": "\u03F1", "varsigma": "\u03C2", "varsubsetneq": "\u228A\uFE00", "varsubsetneqq": "\u2ACB\uFE00", "varsupsetneq": "\u228B\uFE00", "varsupsetneqq": "\u2ACC\uFE00", "vartheta": "\u03D1", "vartriangleleft": "\u22B2", "vartriangleright": "\u22B3", "vBar": "\u2AE8", "Vbar": "\u2AEB", "vBarv": "\u2AE9", "vcy": "\u0432", "Vcy": "\u0412", "vdash": "\u22A2", "vDash": "\u22A8", "Vdash": "\u22A9", "VDash": "\u22AB", "Vdashl": "\u2AE6", "vee": "\u2228", "Vee": "\u22C1", "veebar": "\u22BB", "veeeq": "\u225A", "vellip": "\u22EE", "verbar": "|", "Verbar": "\u2016", "vert": "|", "Vert": "\u2016", "VerticalBar": "\u2223", "VerticalLine": "|", "VerticalSeparator": "\u2758", "VerticalTilde": "\u2240", "VeryThinSpace": "\u200A", "vfr": "\u{1D533}", "Vfr": "\u{1D519}", "vltri": "\u22B2", "vnsub": "\u2282\u20D2", "vnsup": "\u2283\u20D2", "vopf": "\u{1D567}", "Vopf": "\u{1D54D}", "vprop": "\u221D", "vrtri": "\u22B3", "vscr": "\u{1D4CB}", "Vscr": "\u{1D4B1}", "vsubne": "\u228A\uFE00", "vsubnE": "\u2ACB\uFE00", "vsupne": "\u228B\uFE00", "vsupnE": "\u2ACC\uFE00", "Vvdash": "\u22AA", "vzigzag": "\u299A", "wcirc": "\u0175", "Wcirc": "\u0174", "wedbar": "\u2A5F", "wedge": "\u2227", "Wedge": "\u22C0", "wedgeq": "\u2259", "weierp": "\u2118", "wfr": "\u{1D534}", "Wfr": "\u{1D51A}", "wopf": "\u{1D568}", "Wopf": "\u{1D54E}", "wp": "\u2118", "wr": "\u2240", "wreath": "\u2240", "wscr": "\u{1D4CC}", "Wscr": "\u{1D4B2}", "xcap": "\u22C2", "xcirc": "\u25EF", "xcup": "\u22C3", "xdtri": "\u25BD", "xfr": "\u{1D535}", "Xfr": "\u{1D51B}", "xharr": "\u27F7", "xhArr": "\u27FA", "xi": "\u03BE", "Xi": "\u039E", "xlarr": "\u27F5", "xlArr": "\u27F8", "xmap": "\u27FC", "xnis": "\u22FB", "xodot": "\u2A00", "xopf": "\u{1D569}", "Xopf": "\u{1D54F}", "xoplus": "\u2A01", "xotime": "\u2A02", "xrarr": "\u27F6", "xrArr": "\u27F9", "xscr": "\u{1D4CD}", "Xscr": "\u{1D4B3}", "xsqcup": "\u2A06", "xuplus": "\u2A04", "xutri": "\u25B3", "xvee": "\u22C1", "xwedge": "\u22C0", "yacute": "\xFD", "Yacute": "\xDD", "yacy": "\u044F", "YAcy": "\u042F", "ycirc": "\u0177", "Ycirc": "\u0176", "ycy": "\u044B", "Ycy": "\u042B", "yen": "\xA5", "yfr": "\u{1D536}", "Yfr": "\u{1D51C}", "yicy": "\u0457", "YIcy": "\u0407", "yopf": "\u{1D56A}", "Yopf": "\u{1D550}", "yscr": "\u{1D4CE}", "Yscr": "\u{1D4B4}", "yucy": "\u044E", "YUcy": "\u042E", "yuml": "\xFF", "Yuml": "\u0178", "zacute": "\u017A", "Zacute": "\u0179", "zcaron": "\u017E", "Zcaron": "\u017D", "zcy": "\u0437", "Zcy": "\u0417", "zdot": "\u017C", "Zdot": "\u017B", "zeetrf": "\u2128", "ZeroWidthSpace": "\u200B", "zeta": "\u03B6", "Zeta": "\u0396", "zfr": "\u{1D537}", "Zfr": "\u2128", "zhcy": "\u0436", "ZHcy": "\u0416", "zigrarr": "\u21DD", "zopf": "\u{1D56B}", "Zopf": "\u2124", "zscr": "\u{1D4CF}", "Zscr": "\u{1D4B5}", "zwj": "\u200D", "zwnj": "\u200C" }; + var decodeMapLegacy = { "aacute": "\xE1", "Aacute": "\xC1", "acirc": "\xE2", "Acirc": "\xC2", "acute": "\xB4", "aelig": "\xE6", "AElig": "\xC6", "agrave": "\xE0", "Agrave": "\xC0", "amp": "&", "AMP": "&", "aring": "\xE5", "Aring": "\xC5", "atilde": "\xE3", "Atilde": "\xC3", "auml": "\xE4", "Auml": "\xC4", "brvbar": "\xA6", "ccedil": "\xE7", "Ccedil": "\xC7", "cedil": "\xB8", "cent": "\xA2", "copy": "\xA9", "COPY": "\xA9", "curren": "\xA4", "deg": "\xB0", "divide": "\xF7", "eacute": "\xE9", "Eacute": "\xC9", "ecirc": "\xEA", "Ecirc": "\xCA", "egrave": "\xE8", "Egrave": "\xC8", "eth": "\xF0", "ETH": "\xD0", "euml": "\xEB", "Euml": "\xCB", "frac12": "\xBD", "frac14": "\xBC", "frac34": "\xBE", "gt": ">", "GT": ">", "iacute": "\xED", "Iacute": "\xCD", "icirc": "\xEE", "Icirc": "\xCE", "iexcl": "\xA1", "igrave": "\xEC", "Igrave": "\xCC", "iquest": "\xBF", "iuml": "\xEF", "Iuml": "\xCF", "laquo": "\xAB", "lt": "<", "LT": "<", "macr": "\xAF", "micro": "\xB5", "middot": "\xB7", "nbsp": "\xA0", "not": "\xAC", "ntilde": "\xF1", "Ntilde": "\xD1", "oacute": "\xF3", "Oacute": "\xD3", "ocirc": "\xF4", "Ocirc": "\xD4", "ograve": "\xF2", "Ograve": "\xD2", "ordf": "\xAA", "ordm": "\xBA", "oslash": "\xF8", "Oslash": "\xD8", "otilde": "\xF5", "Otilde": "\xD5", "ouml": "\xF6", "Ouml": "\xD6", "para": "\xB6", "plusmn": "\xB1", "pound": "\xA3", "quot": '"', "QUOT": '"', "raquo": "\xBB", "reg": "\xAE", "REG": "\xAE", "sect": "\xA7", "shy": "\xAD", "sup1": "\xB9", "sup2": "\xB2", "sup3": "\xB3", "szlig": "\xDF", "thorn": "\xFE", "THORN": "\xDE", "times": "\xD7", "uacute": "\xFA", "Uacute": "\xDA", "ucirc": "\xFB", "Ucirc": "\xDB", "ugrave": "\xF9", "Ugrave": "\xD9", "uml": "\xA8", "uuml": "\xFC", "Uuml": "\xDC", "yacute": "\xFD", "Yacute": "\xDD", "yen": "\xA5", "yuml": "\xFF" }; + var decodeMapNumeric = { "0": "\uFFFD", "128": "\u20AC", "130": "\u201A", "131": "\u0192", "132": "\u201E", "133": "\u2026", "134": "\u2020", "135": "\u2021", "136": "\u02C6", "137": "\u2030", "138": "\u0160", "139": "\u2039", "140": "\u0152", "142": "\u017D", "145": "\u2018", "146": "\u2019", "147": "\u201C", "148": "\u201D", "149": "\u2022", "150": "\u2013", "151": "\u2014", "152": "\u02DC", "153": "\u2122", "154": "\u0161", "155": "\u203A", "156": "\u0153", "158": "\u017E", "159": "\u0178" }; + var invalidReferenceCodePoints = [1, 2, 3, 4, 5, 6, 7, 8, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 64976, 64977, 64978, 64979, 64980, 64981, 64982, 64983, 64984, 64985, 64986, 64987, 64988, 64989, 64990, 64991, 64992, 64993, 64994, 64995, 64996, 64997, 64998, 64999, 65e3, 65001, 65002, 65003, 65004, 65005, 65006, 65007, 65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, 1048575, 1114110, 1114111]; + var stringFromCharCode = String.fromCharCode; + var object = {}; + var hasOwnProperty2 = object.hasOwnProperty; + var has = function(object2, propertyName) { + return hasOwnProperty2.call(object2, propertyName); + }; + var contains = function(array, value) { + var index = -1; + var length = array.length; + while (++index < length) { + if (array[index] == value) { + return true; } } - return function(id2, v3) { - return exports2[id2] = previous ? previous(id2, v3) : v3; - }; - } - })(function(exporter) { - var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b4) { - d5.__proto__ = b4; - } || function(d5, b4) { - for (var p3 in b4) - if (Object.prototype.hasOwnProperty.call(b4, p3)) - d5[p3] = b4[p3]; + return false; }; - __extends4 = function(d5, b4) { - if (typeof b4 !== "function" && b4 !== null) - throw new TypeError("Class extends value " + String(b4) + " is not a constructor or null"); - extendStatics(d5, b4); - function __() { - this.constructor = d5; + var merge = function(options, defaults) { + if (!options) { + return defaults; } - d5.prototype = b4 === null ? Object.create(b4) : (__.prototype = b4.prototype, new __()); - }; - __assign5 = Object.assign || function(t4) { - for (var s5, i4 = 1, n2 = arguments.length; i4 < n2; i4++) { - s5 = arguments[i4]; - for (var p3 in s5) - if (Object.prototype.hasOwnProperty.call(s5, p3)) - t4[p3] = s5[p3]; + var result = {}; + var key3; + for (key3 in defaults) { + result[key3] = has(options, key3) ? options[key3] : defaults[key3]; } - return t4; + return result; }; - __rest3 = function(s5, e4) { - var t4 = {}; - for (var p3 in s5) - if (Object.prototype.hasOwnProperty.call(s5, p3) && e4.indexOf(p3) < 0) - t4[p3] = s5[p3]; - if (s5 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i4 = 0, p3 = Object.getOwnPropertySymbols(s5); i4 < p3.length; i4++) { - if (e4.indexOf(p3[i4]) < 0 && Object.prototype.propertyIsEnumerable.call(s5, p3[i4])) - t4[p3[i4]] = s5[p3[i4]]; + var codePointToSymbol = function(codePoint, strict) { + var output = ""; + if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) { + if (strict) { + parseError("character reference outside the permissible Unicode range"); } - return t4; - }; - __decorate2 = function(decorators, target, key2, desc) { - var c4 = arguments.length, r3 = c4 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d5; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r3 = Reflect.decorate(decorators, target, key2, desc); - else - for (var i4 = decorators.length - 1; i4 >= 0; i4--) - if (d5 = decorators[i4]) - r3 = (c4 < 3 ? d5(r3) : c4 > 3 ? d5(target, key2, r3) : d5(target, key2)) || r3; - return c4 > 3 && r3 && Object.defineProperty(target, key2, r3), r3; - }; - __param2 = function(paramIndex, decorator) { - return function(target, key2) { - decorator(target, key2, paramIndex); - }; - }; - __esDecorate2 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f4) { - if (f4 !== void 0 && typeof f4 !== "function") - throw new TypeError("Function expected"); - return f4; + return "\uFFFD"; } - var kind = contextIn.kind, key2 = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _12, done = false; - for (var i4 = decorators.length - 1; i4 >= 0; i4--) { - var context = {}; - for (var p3 in contextIn) - context[p3] = p3 === "access" ? {} : contextIn[p3]; - for (var p3 in contextIn.access) - context.access[p3] = contextIn.access[p3]; - context.addInitializer = function(f4) { - if (done) - throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f4 || null)); - }; - var result = (0, decorators[i4])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key2], context); - if (kind === "accessor") { - if (result === void 0) - continue; - if (result === null || typeof result !== "object") - throw new TypeError("Object expected"); - if (_12 = accept(result.get)) - descriptor.get = _12; - if (_12 = accept(result.set)) - descriptor.set = _12; - if (_12 = accept(result.init)) - initializers.push(_12); - } else if (_12 = accept(result)) { - if (kind === "field") - initializers.push(_12); - else - descriptor[key2] = _12; + if (has(decodeMapNumeric, codePoint)) { + if (strict) { + parseError("disallowed character reference"); } + return decodeMapNumeric[codePoint]; } - if (target) - Object.defineProperty(target, contextIn.name, descriptor); - done = true; - }; - __runInitializers2 = function(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i4 = 0; i4 < initializers.length; i4++) { - value = useValue ? initializers[i4].call(thisArg, value) : initializers[i4].call(thisArg); + if (strict && contains(invalidReferenceCodePoints, codePoint)) { + parseError("disallowed character reference"); } - return useValue ? value : void 0; + if (codePoint > 65535) { + codePoint -= 65536; + output += stringFromCharCode(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + output += stringFromCharCode(codePoint); + return output; }; - __propKey2 = function(x5) { - return typeof x5 === "symbol" ? x5 : "".concat(x5); + var hexEscape = function(codePoint) { + return "&#x" + codePoint.toString(16).toUpperCase() + ";"; }; - __setFunctionName2 = function(f4, name, prefix) { - if (typeof name === "symbol") - name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f4, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + var decEscape = function(codePoint) { + return "&#" + codePoint + ";"; }; - __metadata2 = function(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); - }; - __awaiter2 = function(thisArg, _arguments, P4, generator) { - function adopt(value) { - return value instanceof P4 ? value : new P4(function(resolve) { - resolve(value); - }); - } - return new (P4 || (P4 = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e4) { - reject(e4); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e4) { - reject(e4); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - __generator2 = function(thisArg, body) { - var _12 = { label: 0, sent: function() { - if (t4[0] & 1) - throw t4[1]; - return t4[1]; - }, trys: [], ops: [] }, f4, y5, t4, g4; - return g4 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g4[Symbol.iterator] = function() { - return this; - }), g4; - function verb(n2) { - return function(v3) { - return step([n2, v3]); - }; - } - function step(op) { - if (f4) - throw new TypeError("Generator is already executing."); - while (g4 && (g4 = 0, op[0] && (_12 = 0)), _12) - try { - if (f4 = 1, y5 && (t4 = op[0] & 2 ? y5["return"] : op[0] ? y5["throw"] || ((t4 = y5["return"]) && t4.call(y5), 0) : y5.next) && !(t4 = t4.call(y5, op[1])).done) - return t4; - if (y5 = 0, t4) - op = [op[0] & 2, t4.value]; - switch (op[0]) { - case 0: - case 1: - t4 = op; - break; - case 4: - _12.label++; - return { value: op[1], done: false }; - case 5: - _12.label++; - y5 = op[1]; - op = [0]; - continue; - case 7: - op = _12.ops.pop(); - _12.trys.pop(); - continue; - default: - if (!(t4 = _12.trys, t4 = t4.length > 0 && t4[t4.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _12 = 0; - continue; - } - if (op[0] === 3 && (!t4 || op[1] > t4[0] && op[1] < t4[3])) { - _12.label = op[1]; - break; - } - if (op[0] === 6 && _12.label < t4[1]) { - _12.label = t4[1]; - t4 = op; - break; - } - if (t4 && _12.label < t4[2]) { - _12.label = t4[2]; - _12.ops.push(op); - break; - } - if (t4[2]) - _12.ops.pop(); - _12.trys.pop(); - continue; - } - op = body.call(thisArg, _12); - } catch (e4) { - op = [6, e4]; - y5 = 0; - } finally { - f4 = t4 = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar2 = function(m5, o3) { - for (var p3 in m5) - if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(o3, p3)) - __createBinding2(o3, m5, p3); - }; - __createBinding2 = Object.create ? function(o3, m5, k5, k22) { - if (k22 === void 0) - k22 = k5; - var desc = Object.getOwnPropertyDescriptor(m5, k5); - if (!desc || ("get" in desc ? !m5.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m5[k5]; - } }; - } - Object.defineProperty(o3, k22, desc); - } : function(o3, m5, k5, k22) { - if (k22 === void 0) - k22 = k5; - o3[k22] = m5[k5]; - }; - __values2 = function(o3) { - var s5 = typeof Symbol === "function" && Symbol.iterator, m5 = s5 && o3[s5], i4 = 0; - if (m5) - return m5.call(o3); - if (o3 && typeof o3.length === "number") - return { - next: function() { - if (o3 && i4 >= o3.length) - o3 = void 0; - return { value: o3 && o3[i4++], done: !o3 }; - } - }; - throw new TypeError(s5 ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read2 = function(o3, n2) { - var m5 = typeof Symbol === "function" && o3[Symbol.iterator]; - if (!m5) - return o3; - var i4 = m5.call(o3), r3, ar = [], e4; - try { - while ((n2 === void 0 || n2-- > 0) && !(r3 = i4.next()).done) - ar.push(r3.value); - } catch (error) { - e4 = { error }; - } finally { - try { - if (r3 && !r3.done && (m5 = i4["return"])) - m5.call(i4); - } finally { - if (e4) - throw e4.error; - } - } - return ar; - }; - __spread2 = function() { - for (var ar = [], i4 = 0; i4 < arguments.length; i4++) - ar = ar.concat(__read2(arguments[i4])); - return ar; - }; - __spreadArrays2 = function() { - for (var s5 = 0, i4 = 0, il = arguments.length; i4 < il; i4++) - s5 += arguments[i4].length; - for (var r3 = Array(s5), k5 = 0, i4 = 0; i4 < il; i4++) - for (var a5 = arguments[i4], j4 = 0, jl = a5.length; j4 < jl; j4++, k5++) - r3[k5] = a5[j4]; - return r3; - }; - __spreadArray3 = function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i4 = 0, l3 = from.length, ar; i4 < l3; i4++) { - if (ar || !(i4 in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i4); - ar[i4] = from[i4]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await2 = function(v3) { - return this instanceof __await2 ? (this.v = v3, this) : new __await2(v3); - }; - __asyncGenerator2 = function(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g4 = generator.apply(thisArg, _arguments || []), i4, q5 = []; - return i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { - return this; - }, i4; - function verb(n2) { - if (g4[n2]) - i4[n2] = function(v3) { - return new Promise(function(a5, b4) { - q5.push([n2, v3, a5, b4]) > 1 || resume(n2, v3); - }); - }; - } - function resume(n2, v3) { - try { - step(g4[n2](v3)); - } catch (e4) { - settle(q5[0][3], e4); - } - } - function step(r3) { - r3.value instanceof __await2 ? Promise.resolve(r3.value.v).then(fulfill, reject) : settle(q5[0][2], r3); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f4, v3) { - if (f4(v3), q5.shift(), q5.length) - resume(q5[0][0], q5[0][1]); - } - }; - __asyncDelegator2 = function(o3) { - var i4, p3; - return i4 = {}, verb("next"), verb("throw", function(e4) { - throw e4; - }), verb("return"), i4[Symbol.iterator] = function() { - return this; - }, i4; - function verb(n2, f4) { - i4[n2] = o3[n2] ? function(v3) { - return (p3 = !p3) ? { value: __await2(o3[n2](v3)), done: false } : f4 ? f4(v3) : v3; - } : f4; - } - }; - __asyncValues2 = function(o3) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m5 = o3[Symbol.asyncIterator], i4; - return m5 ? m5.call(o3) : (o3 = typeof __values2 === "function" ? __values2(o3) : o3[Symbol.iterator](), i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { - return this; - }, i4); - function verb(n2) { - i4[n2] = o3[n2] && function(v3) { - return new Promise(function(resolve, reject) { - v3 = o3[n2](v3), settle(resolve, reject, v3.done, v3.value); - }); - }; - } - function settle(resolve, reject, d5, v3) { - Promise.resolve(v3).then(function(v4) { - resolve({ value: v4, done: d5 }); - }, reject); - } - }; - __makeTemplateObject2 = function(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; - }; - var __setModuleDefault = Object.create ? function(o3, v3) { - Object.defineProperty(o3, "default", { enumerable: true, value: v3 }); - } : function(o3, v3) { - o3["default"] = v3; - }; - __importStar2 = function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k5 in mod) - if (k5 !== "default" && Object.prototype.hasOwnProperty.call(mod, k5)) - __createBinding2(result, mod, k5); - } - __setModuleDefault(result, mod); - return result; - }; - __importDefault2 = function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - __classPrivateFieldGet2 = function(receiver, state, kind, f4) { - if (kind === "a" && !f4) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); - }; - __classPrivateFieldSet2 = function(receiver, state, value, kind, f4) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f4) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; - }; - __classPrivateFieldIn2 = function(state, receiver) { - if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") - throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends4); - exporter("__assign", __assign5); - exporter("__rest", __rest3); - exporter("__decorate", __decorate2); - exporter("__param", __param2); - exporter("__esDecorate", __esDecorate2); - exporter("__runInitializers", __runInitializers2); - exporter("__propKey", __propKey2); - exporter("__setFunctionName", __setFunctionName2); - exporter("__metadata", __metadata2); - exporter("__awaiter", __awaiter2); - exporter("__generator", __generator2); - exporter("__exportStar", __exportStar2); - exporter("__createBinding", __createBinding2); - exporter("__values", __values2); - exporter("__read", __read2); - exporter("__spread", __spread2); - exporter("__spreadArrays", __spreadArrays2); - exporter("__spreadArray", __spreadArray3); - exporter("__await", __await2); - exporter("__asyncGenerator", __asyncGenerator2); - exporter("__asyncDelegator", __asyncDelegator2); - exporter("__asyncValues", __asyncValues2); - exporter("__makeTemplateObject", __makeTemplateObject2); - exporter("__importStar", __importStar2); - exporter("__importDefault", __importDefault2); - exporter("__classPrivateFieldGet", __classPrivateFieldGet2); - exporter("__classPrivateFieldSet", __classPrivateFieldSet2); - exporter("__classPrivateFieldIn", __classPrivateFieldIn2); - }); - } -}); - -// node_modules/he/he.js -var require_he = __commonJS({ - "node_modules/he/he.js"(exports, module2) { - (function(root) { - var freeExports = typeof exports == "object" && exports; - var freeModule = typeof module2 == "object" && module2 && module2.exports == freeExports && module2; - var freeGlobal = typeof global == "object" && global; - if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { - root = freeGlobal; - } - var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - var regexAsciiWhitelist = /[\x01-\x7F]/g; - var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; - var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g; - var encodeMap = { "\xAD": "shy", "\u200C": "zwnj", "\u200D": "zwj", "\u200E": "lrm", "\u2063": "ic", "\u2062": "it", "\u2061": "af", "\u200F": "rlm", "\u200B": "ZeroWidthSpace", "\u2060": "NoBreak", "\u0311": "DownBreve", "\u20DB": "tdot", "\u20DC": "DotDot", " ": "Tab", "\n": "NewLine", "\u2008": "puncsp", "\u205F": "MediumSpace", "\u2009": "thinsp", "\u200A": "hairsp", "\u2004": "emsp13", "\u2002": "ensp", "\u2005": "emsp14", "\u2003": "emsp", "\u2007": "numsp", "\xA0": "nbsp", "\u205F\u200A": "ThickSpace", "\u203E": "oline", "_": "lowbar", "\u2010": "dash", "\u2013": "ndash", "\u2014": "mdash", "\u2015": "horbar", ",": "comma", ";": "semi", "\u204F": "bsemi", ":": "colon", "\u2A74": "Colone", "!": "excl", "\xA1": "iexcl", "?": "quest", "\xBF": "iquest", ".": "period", "\u2025": "nldr", "\u2026": "mldr", "\xB7": "middot", "'": "apos", "\u2018": "lsquo", "\u2019": "rsquo", "\u201A": "sbquo", "\u2039": "lsaquo", "\u203A": "rsaquo", '"': "quot", "\u201C": "ldquo", "\u201D": "rdquo", "\u201E": "bdquo", "\xAB": "laquo", "\xBB": "raquo", "(": "lpar", ")": "rpar", "[": "lsqb", "]": "rsqb", "{": "lcub", "}": "rcub", "\u2308": "lceil", "\u2309": "rceil", "\u230A": "lfloor", "\u230B": "rfloor", "\u2985": "lopar", "\u2986": "ropar", "\u298B": "lbrke", "\u298C": "rbrke", "\u298D": "lbrkslu", "\u298E": "rbrksld", "\u298F": "lbrksld", "\u2990": "rbrkslu", "\u2991": "langd", "\u2992": "rangd", "\u2993": "lparlt", "\u2994": "rpargt", "\u2995": "gtlPar", "\u2996": "ltrPar", "\u27E6": "lobrk", "\u27E7": "robrk", "\u27E8": "lang", "\u27E9": "rang", "\u27EA": "Lang", "\u27EB": "Rang", "\u27EC": "loang", "\u27ED": "roang", "\u2772": "lbbrk", "\u2773": "rbbrk", "\u2016": "Vert", "\xA7": "sect", "\xB6": "para", "@": "commat", "*": "ast", "/": "sol", "undefined": null, "&": "amp", "#": "num", "%": "percnt", "\u2030": "permil", "\u2031": "pertenk", "\u2020": "dagger", "\u2021": "Dagger", "\u2022": "bull", "\u2043": "hybull", "\u2032": "prime", "\u2033": "Prime", "\u2034": "tprime", "\u2057": "qprime", "\u2035": "bprime", "\u2041": "caret", "`": "grave", "\xB4": "acute", "\u02DC": "tilde", "^": "Hat", "\xAF": "macr", "\u02D8": "breve", "\u02D9": "dot", "\xA8": "die", "\u02DA": "ring", "\u02DD": "dblac", "\xB8": "cedil", "\u02DB": "ogon", "\u02C6": "circ", "\u02C7": "caron", "\xB0": "deg", "\xA9": "copy", "\xAE": "reg", "\u2117": "copysr", "\u2118": "wp", "\u211E": "rx", "\u2127": "mho", "\u2129": "iiota", "\u2190": "larr", "\u219A": "nlarr", "\u2192": "rarr", "\u219B": "nrarr", "\u2191": "uarr", "\u2193": "darr", "\u2194": "harr", "\u21AE": "nharr", "\u2195": "varr", "\u2196": "nwarr", "\u2197": "nearr", "\u2198": "searr", "\u2199": "swarr", "\u219D": "rarrw", "\u219D\u0338": "nrarrw", "\u219E": "Larr", "\u219F": "Uarr", "\u21A0": "Rarr", "\u21A1": "Darr", "\u21A2": "larrtl", "\u21A3": "rarrtl", "\u21A4": "mapstoleft", "\u21A5": "mapstoup", "\u21A6": "map", "\u21A7": "mapstodown", "\u21A9": "larrhk", "\u21AA": "rarrhk", "\u21AB": "larrlp", "\u21AC": "rarrlp", "\u21AD": "harrw", "\u21B0": "lsh", "\u21B1": "rsh", "\u21B2": "ldsh", "\u21B3": "rdsh", "\u21B5": "crarr", "\u21B6": "cularr", "\u21B7": "curarr", "\u21BA": "olarr", "\u21BB": "orarr", "\u21BC": "lharu", "\u21BD": "lhard", "\u21BE": "uharr", "\u21BF": "uharl", "\u21C0": "rharu", "\u21C1": "rhard", "\u21C2": "dharr", "\u21C3": "dharl", "\u21C4": "rlarr", "\u21C5": "udarr", "\u21C6": "lrarr", "\u21C7": "llarr", "\u21C8": "uuarr", "\u21C9": "rrarr", "\u21CA": "ddarr", "\u21CB": "lrhar", "\u21CC": "rlhar", "\u21D0": "lArr", "\u21CD": "nlArr", "\u21D1": "uArr", "\u21D2": "rArr", "\u21CF": "nrArr", "\u21D3": "dArr", "\u21D4": "iff", "\u21CE": "nhArr", "\u21D5": "vArr", "\u21D6": "nwArr", "\u21D7": "neArr", "\u21D8": "seArr", "\u21D9": "swArr", "\u21DA": "lAarr", "\u21DB": "rAarr", "\u21DD": "zigrarr", "\u21E4": "larrb", "\u21E5": "rarrb", "\u21F5": "duarr", "\u21FD": "loarr", "\u21FE": "roarr", "\u21FF": "hoarr", "\u2200": "forall", "\u2201": "comp", "\u2202": "part", "\u2202\u0338": "npart", "\u2203": "exist", "\u2204": "nexist", "\u2205": "empty", "\u2207": "Del", "\u2208": "in", "\u2209": "notin", "\u220B": "ni", "\u220C": "notni", "\u03F6": "bepsi", "\u220F": "prod", "\u2210": "coprod", "\u2211": "sum", "+": "plus", "\xB1": "pm", "\xF7": "div", "\xD7": "times", "<": "lt", "\u226E": "nlt", "<\u20D2": "nvlt", "=": "equals", "\u2260": "ne", "=\u20E5": "bne", "\u2A75": "Equal", ">": "gt", "\u226F": "ngt", ">\u20D2": "nvgt", "\xAC": "not", "|": "vert", "\xA6": "brvbar", "\u2212": "minus", "\u2213": "mp", "\u2214": "plusdo", "\u2044": "frasl", "\u2216": "setmn", "\u2217": "lowast", "\u2218": "compfn", "\u221A": "Sqrt", "\u221D": "prop", "\u221E": "infin", "\u221F": "angrt", "\u2220": "ang", "\u2220\u20D2": "nang", "\u2221": "angmsd", "\u2222": "angsph", "\u2223": "mid", "\u2224": "nmid", "\u2225": "par", "\u2226": "npar", "\u2227": "and", "\u2228": "or", "\u2229": "cap", "\u2229\uFE00": "caps", "\u222A": "cup", "\u222A\uFE00": "cups", "\u222B": "int", "\u222C": "Int", "\u222D": "tint", "\u2A0C": "qint", "\u222E": "oint", "\u222F": "Conint", "\u2230": "Cconint", "\u2231": "cwint", "\u2232": "cwconint", "\u2233": "awconint", "\u2234": "there4", "\u2235": "becaus", "\u2236": "ratio", "\u2237": "Colon", "\u2238": "minusd", "\u223A": "mDDot", "\u223B": "homtht", "\u223C": "sim", "\u2241": "nsim", "\u223C\u20D2": "nvsim", "\u223D": "bsim", "\u223D\u0331": "race", "\u223E": "ac", "\u223E\u0333": "acE", "\u223F": "acd", "\u2240": "wr", "\u2242": "esim", "\u2242\u0338": "nesim", "\u2243": "sime", "\u2244": "nsime", "\u2245": "cong", "\u2247": "ncong", "\u2246": "simne", "\u2248": "ap", "\u2249": "nap", "\u224A": "ape", "\u224B": "apid", "\u224B\u0338": "napid", "\u224C": "bcong", "\u224D": "CupCap", "\u226D": "NotCupCap", "\u224D\u20D2": "nvap", "\u224E": "bump", "\u224E\u0338": "nbump", "\u224F": "bumpe", "\u224F\u0338": "nbumpe", "\u2250": "doteq", "\u2250\u0338": "nedot", "\u2251": "eDot", "\u2252": "efDot", "\u2253": "erDot", "\u2254": "colone", "\u2255": "ecolon", "\u2256": "ecir", "\u2257": "cire", "\u2259": "wedgeq", "\u225A": "veeeq", "\u225C": "trie", "\u225F": "equest", "\u2261": "equiv", "\u2262": "nequiv", "\u2261\u20E5": "bnequiv", "\u2264": "le", "\u2270": "nle", "\u2264\u20D2": "nvle", "\u2265": "ge", "\u2271": "nge", "\u2265\u20D2": "nvge", "\u2266": "lE", "\u2266\u0338": "nlE", "\u2267": "gE", "\u2267\u0338": "ngE", "\u2268\uFE00": "lvnE", "\u2268": "lnE", "\u2269": "gnE", "\u2269\uFE00": "gvnE", "\u226A": "ll", "\u226A\u0338": "nLtv", "\u226A\u20D2": "nLt", "\u226B": "gg", "\u226B\u0338": "nGtv", "\u226B\u20D2": "nGt", "\u226C": "twixt", "\u2272": "lsim", "\u2274": "nlsim", "\u2273": "gsim", "\u2275": "ngsim", "\u2276": "lg", "\u2278": "ntlg", "\u2277": "gl", "\u2279": "ntgl", "\u227A": "pr", "\u2280": "npr", "\u227B": "sc", "\u2281": "nsc", "\u227C": "prcue", "\u22E0": "nprcue", "\u227D": "sccue", "\u22E1": "nsccue", "\u227E": "prsim", "\u227F": "scsim", "\u227F\u0338": "NotSucceedsTilde", "\u2282": "sub", "\u2284": "nsub", "\u2282\u20D2": "vnsub", "\u2283": "sup", "\u2285": "nsup", "\u2283\u20D2": "vnsup", "\u2286": "sube", "\u2288": "nsube", "\u2287": "supe", "\u2289": "nsupe", "\u228A\uFE00": "vsubne", "\u228A": "subne", "\u228B\uFE00": "vsupne", "\u228B": "supne", "\u228D": "cupdot", "\u228E": "uplus", "\u228F": "sqsub", "\u228F\u0338": "NotSquareSubset", "\u2290": "sqsup", "\u2290\u0338": "NotSquareSuperset", "\u2291": "sqsube", "\u22E2": "nsqsube", "\u2292": "sqsupe", "\u22E3": "nsqsupe", "\u2293": "sqcap", "\u2293\uFE00": "sqcaps", "\u2294": "sqcup", "\u2294\uFE00": "sqcups", "\u2295": "oplus", "\u2296": "ominus", "\u2297": "otimes", "\u2298": "osol", "\u2299": "odot", "\u229A": "ocir", "\u229B": "oast", "\u229D": "odash", "\u229E": "plusb", "\u229F": "minusb", "\u22A0": "timesb", "\u22A1": "sdotb", "\u22A2": "vdash", "\u22AC": "nvdash", "\u22A3": "dashv", "\u22A4": "top", "\u22A5": "bot", "\u22A7": "models", "\u22A8": "vDash", "\u22AD": "nvDash", "\u22A9": "Vdash", "\u22AE": "nVdash", "\u22AA": "Vvdash", "\u22AB": "VDash", "\u22AF": "nVDash", "\u22B0": "prurel", "\u22B2": "vltri", "\u22EA": "nltri", "\u22B3": "vrtri", "\u22EB": "nrtri", "\u22B4": "ltrie", "\u22EC": "nltrie", "\u22B4\u20D2": "nvltrie", "\u22B5": "rtrie", "\u22ED": "nrtrie", "\u22B5\u20D2": "nvrtrie", "\u22B6": "origof", "\u22B7": "imof", "\u22B8": "mumap", "\u22B9": "hercon", "\u22BA": "intcal", "\u22BB": "veebar", "\u22BD": "barvee", "\u22BE": "angrtvb", "\u22BF": "lrtri", "\u22C0": "Wedge", "\u22C1": "Vee", "\u22C2": "xcap", "\u22C3": "xcup", "\u22C4": "diam", "\u22C5": "sdot", "\u22C6": "Star", "\u22C7": "divonx", "\u22C8": "bowtie", "\u22C9": "ltimes", "\u22CA": "rtimes", "\u22CB": "lthree", "\u22CC": "rthree", "\u22CD": "bsime", "\u22CE": "cuvee", "\u22CF": "cuwed", "\u22D0": "Sub", "\u22D1": "Sup", "\u22D2": "Cap", "\u22D3": "Cup", "\u22D4": "fork", "\u22D5": "epar", "\u22D6": "ltdot", "\u22D7": "gtdot", "\u22D8": "Ll", "\u22D8\u0338": "nLl", "\u22D9": "Gg", "\u22D9\u0338": "nGg", "\u22DA\uFE00": "lesg", "\u22DA": "leg", "\u22DB": "gel", "\u22DB\uFE00": "gesl", "\u22DE": "cuepr", "\u22DF": "cuesc", "\u22E6": "lnsim", "\u22E7": "gnsim", "\u22E8": "prnsim", "\u22E9": "scnsim", "\u22EE": "vellip", "\u22EF": "ctdot", "\u22F0": "utdot", "\u22F1": "dtdot", "\u22F2": "disin", "\u22F3": "isinsv", "\u22F4": "isins", "\u22F5": "isindot", "\u22F5\u0338": "notindot", "\u22F6": "notinvc", "\u22F7": "notinvb", "\u22F9": "isinE", "\u22F9\u0338": "notinE", "\u22FA": "nisd", "\u22FB": "xnis", "\u22FC": "nis", "\u22FD": "notnivc", "\u22FE": "notnivb", "\u2305": "barwed", "\u2306": "Barwed", "\u230C": "drcrop", "\u230D": "dlcrop", "\u230E": "urcrop", "\u230F": "ulcrop", "\u2310": "bnot", "\u2312": "profline", "\u2313": "profsurf", "\u2315": "telrec", "\u2316": "target", "\u231C": "ulcorn", "\u231D": "urcorn", "\u231E": "dlcorn", "\u231F": "drcorn", "\u2322": "frown", "\u2323": "smile", "\u232D": "cylcty", "\u232E": "profalar", "\u2336": "topbot", "\u233D": "ovbar", "\u233F": "solbar", "\u237C": "angzarr", "\u23B0": "lmoust", "\u23B1": "rmoust", "\u23B4": "tbrk", "\u23B5": "bbrk", "\u23B6": "bbrktbrk", "\u23DC": "OverParenthesis", "\u23DD": "UnderParenthesis", "\u23DE": "OverBrace", "\u23DF": "UnderBrace", "\u23E2": "trpezium", "\u23E7": "elinters", "\u2423": "blank", "\u2500": "boxh", "\u2502": "boxv", "\u250C": "boxdr", "\u2510": "boxdl", "\u2514": "boxur", "\u2518": "boxul", "\u251C": "boxvr", "\u2524": "boxvl", "\u252C": "boxhd", "\u2534": "boxhu", "\u253C": "boxvh", "\u2550": "boxH", "\u2551": "boxV", "\u2552": "boxdR", "\u2553": "boxDr", "\u2554": "boxDR", "\u2555": "boxdL", "\u2556": "boxDl", "\u2557": "boxDL", "\u2558": "boxuR", "\u2559": "boxUr", "\u255A": "boxUR", "\u255B": "boxuL", "\u255C": "boxUl", "\u255D": "boxUL", "\u255E": "boxvR", "\u255F": "boxVr", "\u2560": "boxVR", "\u2561": "boxvL", "\u2562": "boxVl", "\u2563": "boxVL", "\u2564": "boxHd", "\u2565": "boxhD", "\u2566": "boxHD", "\u2567": "boxHu", "\u2568": "boxhU", "\u2569": "boxHU", "\u256A": "boxvH", "\u256B": "boxVh", "\u256C": "boxVH", "\u2580": "uhblk", "\u2584": "lhblk", "\u2588": "block", "\u2591": "blk14", "\u2592": "blk12", "\u2593": "blk34", "\u25A1": "squ", "\u25AA": "squf", "\u25AB": "EmptyVerySmallSquare", "\u25AD": "rect", "\u25AE": "marker", "\u25B1": "fltns", "\u25B3": "xutri", "\u25B4": "utrif", "\u25B5": "utri", "\u25B8": "rtrif", "\u25B9": "rtri", "\u25BD": "xdtri", "\u25BE": "dtrif", "\u25BF": "dtri", "\u25C2": "ltrif", "\u25C3": "ltri", "\u25CA": "loz", "\u25CB": "cir", "\u25EC": "tridot", "\u25EF": "xcirc", "\u25F8": "ultri", "\u25F9": "urtri", "\u25FA": "lltri", "\u25FB": "EmptySmallSquare", "\u25FC": "FilledSmallSquare", "\u2605": "starf", "\u2606": "star", "\u260E": "phone", "\u2640": "female", "\u2642": "male", "\u2660": "spades", "\u2663": "clubs", "\u2665": "hearts", "\u2666": "diams", "\u266A": "sung", "\u2713": "check", "\u2717": "cross", "\u2720": "malt", "\u2736": "sext", "\u2758": "VerticalSeparator", "\u27C8": "bsolhsub", "\u27C9": "suphsol", "\u27F5": "xlarr", "\u27F6": "xrarr", "\u27F7": "xharr", "\u27F8": "xlArr", "\u27F9": "xrArr", "\u27FA": "xhArr", "\u27FC": "xmap", "\u27FF": "dzigrarr", "\u2902": "nvlArr", "\u2903": "nvrArr", "\u2904": "nvHarr", "\u2905": "Map", "\u290C": "lbarr", "\u290D": "rbarr", "\u290E": "lBarr", "\u290F": "rBarr", "\u2910": "RBarr", "\u2911": "DDotrahd", "\u2912": "UpArrowBar", "\u2913": "DownArrowBar", "\u2916": "Rarrtl", "\u2919": "latail", "\u291A": "ratail", "\u291B": "lAtail", "\u291C": "rAtail", "\u291D": "larrfs", "\u291E": "rarrfs", "\u291F": "larrbfs", "\u2920": "rarrbfs", "\u2923": "nwarhk", "\u2924": "nearhk", "\u2925": "searhk", "\u2926": "swarhk", "\u2927": "nwnear", "\u2928": "toea", "\u2929": "tosa", "\u292A": "swnwar", "\u2933": "rarrc", "\u2933\u0338": "nrarrc", "\u2935": "cudarrr", "\u2936": "ldca", "\u2937": "rdca", "\u2938": "cudarrl", "\u2939": "larrpl", "\u293C": "curarrm", "\u293D": "cularrp", "\u2945": "rarrpl", "\u2948": "harrcir", "\u2949": "Uarrocir", "\u294A": "lurdshar", "\u294B": "ldrushar", "\u294E": "LeftRightVector", "\u294F": "RightUpDownVector", "\u2950": "DownLeftRightVector", "\u2951": "LeftUpDownVector", "\u2952": "LeftVectorBar", "\u2953": "RightVectorBar", "\u2954": "RightUpVectorBar", "\u2955": "RightDownVectorBar", "\u2956": "DownLeftVectorBar", "\u2957": "DownRightVectorBar", "\u2958": "LeftUpVectorBar", "\u2959": "LeftDownVectorBar", "\u295A": "LeftTeeVector", "\u295B": "RightTeeVector", "\u295C": "RightUpTeeVector", "\u295D": "RightDownTeeVector", "\u295E": "DownLeftTeeVector", "\u295F": "DownRightTeeVector", "\u2960": "LeftUpTeeVector", "\u2961": "LeftDownTeeVector", "\u2962": "lHar", "\u2963": "uHar", "\u2964": "rHar", "\u2965": "dHar", "\u2966": "luruhar", "\u2967": "ldrdhar", "\u2968": "ruluhar", "\u2969": "rdldhar", "\u296A": "lharul", "\u296B": "llhard", "\u296C": "rharul", "\u296D": "lrhard", "\u296E": "udhar", "\u296F": "duhar", "\u2970": "RoundImplies", "\u2971": "erarr", "\u2972": "simrarr", "\u2973": "larrsim", "\u2974": "rarrsim", "\u2975": "rarrap", "\u2976": "ltlarr", "\u2978": "gtrarr", "\u2979": "subrarr", "\u297B": "suplarr", "\u297C": "lfisht", "\u297D": "rfisht", "\u297E": "ufisht", "\u297F": "dfisht", "\u299A": "vzigzag", "\u299C": "vangrt", "\u299D": "angrtvbd", "\u29A4": "ange", "\u29A5": "range", "\u29A6": "dwangle", "\u29A7": "uwangle", "\u29A8": "angmsdaa", "\u29A9": "angmsdab", "\u29AA": "angmsdac", "\u29AB": "angmsdad", "\u29AC": "angmsdae", "\u29AD": "angmsdaf", "\u29AE": "angmsdag", "\u29AF": "angmsdah", "\u29B0": "bemptyv", "\u29B1": "demptyv", "\u29B2": "cemptyv", "\u29B3": "raemptyv", "\u29B4": "laemptyv", "\u29B5": "ohbar", "\u29B6": "omid", "\u29B7": "opar", "\u29B9": "operp", "\u29BB": "olcross", "\u29BC": "odsold", "\u29BE": "olcir", "\u29BF": "ofcir", "\u29C0": "olt", "\u29C1": "ogt", "\u29C2": "cirscir", "\u29C3": "cirE", "\u29C4": "solb", "\u29C5": "bsolb", "\u29C9": "boxbox", "\u29CD": "trisb", "\u29CE": "rtriltri", "\u29CF": "LeftTriangleBar", "\u29CF\u0338": "NotLeftTriangleBar", "\u29D0": "RightTriangleBar", "\u29D0\u0338": "NotRightTriangleBar", "\u29DC": "iinfin", "\u29DD": "infintie", "\u29DE": "nvinfin", "\u29E3": "eparsl", "\u29E4": "smeparsl", "\u29E5": "eqvparsl", "\u29EB": "lozf", "\u29F4": "RuleDelayed", "\u29F6": "dsol", "\u2A00": "xodot", "\u2A01": "xoplus", "\u2A02": "xotime", "\u2A04": "xuplus", "\u2A06": "xsqcup", "\u2A0D": "fpartint", "\u2A10": "cirfnint", "\u2A11": "awint", "\u2A12": "rppolint", "\u2A13": "scpolint", "\u2A14": "npolint", "\u2A15": "pointint", "\u2A16": "quatint", "\u2A17": "intlarhk", "\u2A22": "pluscir", "\u2A23": "plusacir", "\u2A24": "simplus", "\u2A25": "plusdu", "\u2A26": "plussim", "\u2A27": "plustwo", "\u2A29": "mcomma", "\u2A2A": "minusdu", "\u2A2D": "loplus", "\u2A2E": "roplus", "\u2A2F": "Cross", "\u2A30": "timesd", "\u2A31": "timesbar", "\u2A33": "smashp", "\u2A34": "lotimes", "\u2A35": "rotimes", "\u2A36": "otimesas", "\u2A37": "Otimes", "\u2A38": "odiv", "\u2A39": "triplus", "\u2A3A": "triminus", "\u2A3B": "tritime", "\u2A3C": "iprod", "\u2A3F": "amalg", "\u2A40": "capdot", "\u2A42": "ncup", "\u2A43": "ncap", "\u2A44": "capand", "\u2A45": "cupor", "\u2A46": "cupcap", "\u2A47": "capcup", "\u2A48": "cupbrcap", "\u2A49": "capbrcup", "\u2A4A": "cupcup", "\u2A4B": "capcap", "\u2A4C": "ccups", "\u2A4D": "ccaps", "\u2A50": "ccupssm", "\u2A53": "And", "\u2A54": "Or", "\u2A55": "andand", "\u2A56": "oror", "\u2A57": "orslope", "\u2A58": "andslope", "\u2A5A": "andv", "\u2A5B": "orv", "\u2A5C": "andd", "\u2A5D": "ord", "\u2A5F": "wedbar", "\u2A66": "sdote", "\u2A6A": "simdot", "\u2A6D": "congdot", "\u2A6D\u0338": "ncongdot", "\u2A6E": "easter", "\u2A6F": "apacir", "\u2A70": "apE", "\u2A70\u0338": "napE", "\u2A71": "eplus", "\u2A72": "pluse", "\u2A73": "Esim", "\u2A77": "eDDot", "\u2A78": "equivDD", "\u2A79": "ltcir", "\u2A7A": "gtcir", "\u2A7B": "ltquest", "\u2A7C": "gtquest", "\u2A7D": "les", "\u2A7D\u0338": "nles", "\u2A7E": "ges", "\u2A7E\u0338": "nges", "\u2A7F": "lesdot", "\u2A80": "gesdot", "\u2A81": "lesdoto", "\u2A82": "gesdoto", "\u2A83": "lesdotor", "\u2A84": "gesdotol", "\u2A85": "lap", "\u2A86": "gap", "\u2A87": "lne", "\u2A88": "gne", "\u2A89": "lnap", "\u2A8A": "gnap", "\u2A8B": "lEg", "\u2A8C": "gEl", "\u2A8D": "lsime", "\u2A8E": "gsime", "\u2A8F": "lsimg", "\u2A90": "gsiml", "\u2A91": "lgE", "\u2A92": "glE", "\u2A93": "lesges", "\u2A94": "gesles", "\u2A95": "els", "\u2A96": "egs", "\u2A97": "elsdot", "\u2A98": "egsdot", "\u2A99": "el", "\u2A9A": "eg", "\u2A9D": "siml", "\u2A9E": "simg", "\u2A9F": "simlE", "\u2AA0": "simgE", "\u2AA1": "LessLess", "\u2AA1\u0338": "NotNestedLessLess", "\u2AA2": "GreaterGreater", "\u2AA2\u0338": "NotNestedGreaterGreater", "\u2AA4": "glj", "\u2AA5": "gla", "\u2AA6": "ltcc", "\u2AA7": "gtcc", "\u2AA8": "lescc", "\u2AA9": "gescc", "\u2AAA": "smt", "\u2AAB": "lat", "\u2AAC": "smte", "\u2AAC\uFE00": "smtes", "\u2AAD": "late", "\u2AAD\uFE00": "lates", "\u2AAE": "bumpE", "\u2AAF": "pre", "\u2AAF\u0338": "npre", "\u2AB0": "sce", "\u2AB0\u0338": "nsce", "\u2AB3": "prE", "\u2AB4": "scE", "\u2AB5": "prnE", "\u2AB6": "scnE", "\u2AB7": "prap", "\u2AB8": "scap", "\u2AB9": "prnap", "\u2ABA": "scnap", "\u2ABB": "Pr", "\u2ABC": "Sc", "\u2ABD": "subdot", "\u2ABE": "supdot", "\u2ABF": "subplus", "\u2AC0": "supplus", "\u2AC1": "submult", "\u2AC2": "supmult", "\u2AC3": "subedot", "\u2AC4": "supedot", "\u2AC5": "subE", "\u2AC5\u0338": "nsubE", "\u2AC6": "supE", "\u2AC6\u0338": "nsupE", "\u2AC7": "subsim", "\u2AC8": "supsim", "\u2ACB\uFE00": "vsubnE", "\u2ACB": "subnE", "\u2ACC\uFE00": "vsupnE", "\u2ACC": "supnE", "\u2ACF": "csub", "\u2AD0": "csup", "\u2AD1": "csube", "\u2AD2": "csupe", "\u2AD3": "subsup", "\u2AD4": "supsub", "\u2AD5": "subsub", "\u2AD6": "supsup", "\u2AD7": "suphsub", "\u2AD8": "supdsub", "\u2AD9": "forkv", "\u2ADA": "topfork", "\u2ADB": "mlcp", "\u2AE4": "Dashv", "\u2AE6": "Vdashl", "\u2AE7": "Barv", "\u2AE8": "vBar", "\u2AE9": "vBarv", "\u2AEB": "Vbar", "\u2AEC": "Not", "\u2AED": "bNot", "\u2AEE": "rnmid", "\u2AEF": "cirmid", "\u2AF0": "midcir", "\u2AF1": "topcir", "\u2AF2": "nhpar", "\u2AF3": "parsim", "\u2AFD": "parsl", "\u2AFD\u20E5": "nparsl", "\u266D": "flat", "\u266E": "natur", "\u266F": "sharp", "\xA4": "curren", "\xA2": "cent", "$": "dollar", "\xA3": "pound", "\xA5": "yen", "\u20AC": "euro", "\xB9": "sup1", "\xBD": "half", "\u2153": "frac13", "\xBC": "frac14", "\u2155": "frac15", "\u2159": "frac16", "\u215B": "frac18", "\xB2": "sup2", "\u2154": "frac23", "\u2156": "frac25", "\xB3": "sup3", "\xBE": "frac34", "\u2157": "frac35", "\u215C": "frac38", "\u2158": "frac45", "\u215A": "frac56", "\u215D": "frac58", "\u215E": "frac78", "\u{1D4B6}": "ascr", "\u{1D552}": "aopf", "\u{1D51E}": "afr", "\u{1D538}": "Aopf", "\u{1D504}": "Afr", "\u{1D49C}": "Ascr", "\xAA": "ordf", "\xE1": "aacute", "\xC1": "Aacute", "\xE0": "agrave", "\xC0": "Agrave", "\u0103": "abreve", "\u0102": "Abreve", "\xE2": "acirc", "\xC2": "Acirc", "\xE5": "aring", "\xC5": "angst", "\xE4": "auml", "\xC4": "Auml", "\xE3": "atilde", "\xC3": "Atilde", "\u0105": "aogon", "\u0104": "Aogon", "\u0101": "amacr", "\u0100": "Amacr", "\xE6": "aelig", "\xC6": "AElig", "\u{1D4B7}": "bscr", "\u{1D553}": "bopf", "\u{1D51F}": "bfr", "\u{1D539}": "Bopf", "\u212C": "Bscr", "\u{1D505}": "Bfr", "\u{1D520}": "cfr", "\u{1D4B8}": "cscr", "\u{1D554}": "copf", "\u212D": "Cfr", "\u{1D49E}": "Cscr", "\u2102": "Copf", "\u0107": "cacute", "\u0106": "Cacute", "\u0109": "ccirc", "\u0108": "Ccirc", "\u010D": "ccaron", "\u010C": "Ccaron", "\u010B": "cdot", "\u010A": "Cdot", "\xE7": "ccedil", "\xC7": "Ccedil", "\u2105": "incare", "\u{1D521}": "dfr", "\u2146": "dd", "\u{1D555}": "dopf", "\u{1D4B9}": "dscr", "\u{1D49F}": "Dscr", "\u{1D507}": "Dfr", "\u2145": "DD", "\u{1D53B}": "Dopf", "\u010F": "dcaron", "\u010E": "Dcaron", "\u0111": "dstrok", "\u0110": "Dstrok", "\xF0": "eth", "\xD0": "ETH", "\u2147": "ee", "\u212F": "escr", "\u{1D522}": "efr", "\u{1D556}": "eopf", "\u2130": "Escr", "\u{1D508}": "Efr", "\u{1D53C}": "Eopf", "\xE9": "eacute", "\xC9": "Eacute", "\xE8": "egrave", "\xC8": "Egrave", "\xEA": "ecirc", "\xCA": "Ecirc", "\u011B": "ecaron", "\u011A": "Ecaron", "\xEB": "euml", "\xCB": "Euml", "\u0117": "edot", "\u0116": "Edot", "\u0119": "eogon", "\u0118": "Eogon", "\u0113": "emacr", "\u0112": "Emacr", "\u{1D523}": "ffr", "\u{1D557}": "fopf", "\u{1D4BB}": "fscr", "\u{1D509}": "Ffr", "\u{1D53D}": "Fopf", "\u2131": "Fscr", "\uFB00": "fflig", "\uFB03": "ffilig", "\uFB04": "ffllig", "\uFB01": "filig", "fj": "fjlig", "\uFB02": "fllig", "\u0192": "fnof", "\u210A": "gscr", "\u{1D558}": "gopf", "\u{1D524}": "gfr", "\u{1D4A2}": "Gscr", "\u{1D53E}": "Gopf", "\u{1D50A}": "Gfr", "\u01F5": "gacute", "\u011F": "gbreve", "\u011E": "Gbreve", "\u011D": "gcirc", "\u011C": "Gcirc", "\u0121": "gdot", "\u0120": "Gdot", "\u0122": "Gcedil", "\u{1D525}": "hfr", "\u210E": "planckh", "\u{1D4BD}": "hscr", "\u{1D559}": "hopf", "\u210B": "Hscr", "\u210C": "Hfr", "\u210D": "Hopf", "\u0125": "hcirc", "\u0124": "Hcirc", "\u210F": "hbar", "\u0127": "hstrok", "\u0126": "Hstrok", "\u{1D55A}": "iopf", "\u{1D526}": "ifr", "\u{1D4BE}": "iscr", "\u2148": "ii", "\u{1D540}": "Iopf", "\u2110": "Iscr", "\u2111": "Im", "\xED": "iacute", "\xCD": "Iacute", "\xEC": "igrave", "\xCC": "Igrave", "\xEE": "icirc", "\xCE": "Icirc", "\xEF": "iuml", "\xCF": "Iuml", "\u0129": "itilde", "\u0128": "Itilde", "\u0130": "Idot", "\u012F": "iogon", "\u012E": "Iogon", "\u012B": "imacr", "\u012A": "Imacr", "\u0133": "ijlig", "\u0132": "IJlig", "\u0131": "imath", "\u{1D4BF}": "jscr", "\u{1D55B}": "jopf", "\u{1D527}": "jfr", "\u{1D4A5}": "Jscr", "\u{1D50D}": "Jfr", "\u{1D541}": "Jopf", "\u0135": "jcirc", "\u0134": "Jcirc", "\u0237": "jmath", "\u{1D55C}": "kopf", "\u{1D4C0}": "kscr", "\u{1D528}": "kfr", "\u{1D4A6}": "Kscr", "\u{1D542}": "Kopf", "\u{1D50E}": "Kfr", "\u0137": "kcedil", "\u0136": "Kcedil", "\u{1D529}": "lfr", "\u{1D4C1}": "lscr", "\u2113": "ell", "\u{1D55D}": "lopf", "\u2112": "Lscr", "\u{1D50F}": "Lfr", "\u{1D543}": "Lopf", "\u013A": "lacute", "\u0139": "Lacute", "\u013E": "lcaron", "\u013D": "Lcaron", "\u013C": "lcedil", "\u013B": "Lcedil", "\u0142": "lstrok", "\u0141": "Lstrok", "\u0140": "lmidot", "\u013F": "Lmidot", "\u{1D52A}": "mfr", "\u{1D55E}": "mopf", "\u{1D4C2}": "mscr", "\u{1D510}": "Mfr", "\u{1D544}": "Mopf", "\u2133": "Mscr", "\u{1D52B}": "nfr", "\u{1D55F}": "nopf", "\u{1D4C3}": "nscr", "\u2115": "Nopf", "\u{1D4A9}": "Nscr", "\u{1D511}": "Nfr", "\u0144": "nacute", "\u0143": "Nacute", "\u0148": "ncaron", "\u0147": "Ncaron", "\xF1": "ntilde", "\xD1": "Ntilde", "\u0146": "ncedil", "\u0145": "Ncedil", "\u2116": "numero", "\u014B": "eng", "\u014A": "ENG", "\u{1D560}": "oopf", "\u{1D52C}": "ofr", "\u2134": "oscr", "\u{1D4AA}": "Oscr", "\u{1D512}": "Ofr", "\u{1D546}": "Oopf", "\xBA": "ordm", "\xF3": "oacute", "\xD3": "Oacute", "\xF2": "ograve", "\xD2": "Ograve", "\xF4": "ocirc", "\xD4": "Ocirc", "\xF6": "ouml", "\xD6": "Ouml", "\u0151": "odblac", "\u0150": "Odblac", "\xF5": "otilde", "\xD5": "Otilde", "\xF8": "oslash", "\xD8": "Oslash", "\u014D": "omacr", "\u014C": "Omacr", "\u0153": "oelig", "\u0152": "OElig", "\u{1D52D}": "pfr", "\u{1D4C5}": "pscr", "\u{1D561}": "popf", "\u2119": "Popf", "\u{1D513}": "Pfr", "\u{1D4AB}": "Pscr", "\u{1D562}": "qopf", "\u{1D52E}": "qfr", "\u{1D4C6}": "qscr", "\u{1D4AC}": "Qscr", "\u{1D514}": "Qfr", "\u211A": "Qopf", "\u0138": "kgreen", "\u{1D52F}": "rfr", "\u{1D563}": "ropf", "\u{1D4C7}": "rscr", "\u211B": "Rscr", "\u211C": "Re", "\u211D": "Ropf", "\u0155": "racute", "\u0154": "Racute", "\u0159": "rcaron", "\u0158": "Rcaron", "\u0157": "rcedil", "\u0156": "Rcedil", "\u{1D564}": "sopf", "\u{1D4C8}": "sscr", "\u{1D530}": "sfr", "\u{1D54A}": "Sopf", "\u{1D516}": "Sfr", "\u{1D4AE}": "Sscr", "\u24C8": "oS", "\u015B": "sacute", "\u015A": "Sacute", "\u015D": "scirc", "\u015C": "Scirc", "\u0161": "scaron", "\u0160": "Scaron", "\u015F": "scedil", "\u015E": "Scedil", "\xDF": "szlig", "\u{1D531}": "tfr", "\u{1D4C9}": "tscr", "\u{1D565}": "topf", "\u{1D4AF}": "Tscr", "\u{1D517}": "Tfr", "\u{1D54B}": "Topf", "\u0165": "tcaron", "\u0164": "Tcaron", "\u0163": "tcedil", "\u0162": "Tcedil", "\u2122": "trade", "\u0167": "tstrok", "\u0166": "Tstrok", "\u{1D4CA}": "uscr", "\u{1D566}": "uopf", "\u{1D532}": "ufr", "\u{1D54C}": "Uopf", "\u{1D518}": "Ufr", "\u{1D4B0}": "Uscr", "\xFA": "uacute", "\xDA": "Uacute", "\xF9": "ugrave", "\xD9": "Ugrave", "\u016D": "ubreve", "\u016C": "Ubreve", "\xFB": "ucirc", "\xDB": "Ucirc", "\u016F": "uring", "\u016E": "Uring", "\xFC": "uuml", "\xDC": "Uuml", "\u0171": "udblac", "\u0170": "Udblac", "\u0169": "utilde", "\u0168": "Utilde", "\u0173": "uogon", "\u0172": "Uogon", "\u016B": "umacr", "\u016A": "Umacr", "\u{1D533}": "vfr", "\u{1D567}": "vopf", "\u{1D4CB}": "vscr", "\u{1D519}": "Vfr", "\u{1D54D}": "Vopf", "\u{1D4B1}": "Vscr", "\u{1D568}": "wopf", "\u{1D4CC}": "wscr", "\u{1D534}": "wfr", "\u{1D4B2}": "Wscr", "\u{1D54E}": "Wopf", "\u{1D51A}": "Wfr", "\u0175": "wcirc", "\u0174": "Wcirc", "\u{1D535}": "xfr", "\u{1D4CD}": "xscr", "\u{1D569}": "xopf", "\u{1D54F}": "Xopf", "\u{1D51B}": "Xfr", "\u{1D4B3}": "Xscr", "\u{1D536}": "yfr", "\u{1D4CE}": "yscr", "\u{1D56A}": "yopf", "\u{1D4B4}": "Yscr", "\u{1D51C}": "Yfr", "\u{1D550}": "Yopf", "\xFD": "yacute", "\xDD": "Yacute", "\u0177": "ycirc", "\u0176": "Ycirc", "\xFF": "yuml", "\u0178": "Yuml", "\u{1D4CF}": "zscr", "\u{1D537}": "zfr", "\u{1D56B}": "zopf", "\u2128": "Zfr", "\u2124": "Zopf", "\u{1D4B5}": "Zscr", "\u017A": "zacute", "\u0179": "Zacute", "\u017E": "zcaron", "\u017D": "Zcaron", "\u017C": "zdot", "\u017B": "Zdot", "\u01B5": "imped", "\xFE": "thorn", "\xDE": "THORN", "\u0149": "napos", "\u03B1": "alpha", "\u0391": "Alpha", "\u03B2": "beta", "\u0392": "Beta", "\u03B3": "gamma", "\u0393": "Gamma", "\u03B4": "delta", "\u0394": "Delta", "\u03B5": "epsi", "\u03F5": "epsiv", "\u0395": "Epsilon", "\u03DD": "gammad", "\u03DC": "Gammad", "\u03B6": "zeta", "\u0396": "Zeta", "\u03B7": "eta", "\u0397": "Eta", "\u03B8": "theta", "\u03D1": "thetav", "\u0398": "Theta", "\u03B9": "iota", "\u0399": "Iota", "\u03BA": "kappa", "\u03F0": "kappav", "\u039A": "Kappa", "\u03BB": "lambda", "\u039B": "Lambda", "\u03BC": "mu", "\xB5": "micro", "\u039C": "Mu", "\u03BD": "nu", "\u039D": "Nu", "\u03BE": "xi", "\u039E": "Xi", "\u03BF": "omicron", "\u039F": "Omicron", "\u03C0": "pi", "\u03D6": "piv", "\u03A0": "Pi", "\u03C1": "rho", "\u03F1": "rhov", "\u03A1": "Rho", "\u03C3": "sigma", "\u03A3": "Sigma", "\u03C2": "sigmaf", "\u03C4": "tau", "\u03A4": "Tau", "\u03C5": "upsi", "\u03A5": "Upsilon", "\u03D2": "Upsi", "\u03C6": "phi", "\u03D5": "phiv", "\u03A6": "Phi", "\u03C7": "chi", "\u03A7": "Chi", "\u03C8": "psi", "\u03A8": "Psi", "\u03C9": "omega", "\u03A9": "ohm", "\u0430": "acy", "\u0410": "Acy", "\u0431": "bcy", "\u0411": "Bcy", "\u0432": "vcy", "\u0412": "Vcy", "\u0433": "gcy", "\u0413": "Gcy", "\u0453": "gjcy", "\u0403": "GJcy", "\u0434": "dcy", "\u0414": "Dcy", "\u0452": "djcy", "\u0402": "DJcy", "\u0435": "iecy", "\u0415": "IEcy", "\u0451": "iocy", "\u0401": "IOcy", "\u0454": "jukcy", "\u0404": "Jukcy", "\u0436": "zhcy", "\u0416": "ZHcy", "\u0437": "zcy", "\u0417": "Zcy", "\u0455": "dscy", "\u0405": "DScy", "\u0438": "icy", "\u0418": "Icy", "\u0456": "iukcy", "\u0406": "Iukcy", "\u0457": "yicy", "\u0407": "YIcy", "\u0439": "jcy", "\u0419": "Jcy", "\u0458": "jsercy", "\u0408": "Jsercy", "\u043A": "kcy", "\u041A": "Kcy", "\u045C": "kjcy", "\u040C": "KJcy", "\u043B": "lcy", "\u041B": "Lcy", "\u0459": "ljcy", "\u0409": "LJcy", "\u043C": "mcy", "\u041C": "Mcy", "\u043D": "ncy", "\u041D": "Ncy", "\u045A": "njcy", "\u040A": "NJcy", "\u043E": "ocy", "\u041E": "Ocy", "\u043F": "pcy", "\u041F": "Pcy", "\u0440": "rcy", "\u0420": "Rcy", "\u0441": "scy", "\u0421": "Scy", "\u0442": "tcy", "\u0422": "Tcy", "\u045B": "tshcy", "\u040B": "TSHcy", "\u0443": "ucy", "\u0423": "Ucy", "\u045E": "ubrcy", "\u040E": "Ubrcy", "\u0444": "fcy", "\u0424": "Fcy", "\u0445": "khcy", "\u0425": "KHcy", "\u0446": "tscy", "\u0426": "TScy", "\u0447": "chcy", "\u0427": "CHcy", "\u045F": "dzcy", "\u040F": "DZcy", "\u0448": "shcy", "\u0428": "SHcy", "\u0449": "shchcy", "\u0429": "SHCHcy", "\u044A": "hardcy", "\u042A": "HARDcy", "\u044B": "ycy", "\u042B": "Ycy", "\u044C": "softcy", "\u042C": "SOFTcy", "\u044D": "ecy", "\u042D": "Ecy", "\u044E": "yucy", "\u042E": "YUcy", "\u044F": "yacy", "\u042F": "YAcy", "\u2135": "aleph", "\u2136": "beth", "\u2137": "gimel", "\u2138": "daleth" }; - var regexEscape = /["&'<>`]/g; - var escapeMap = { - '"': """, - "&": "&", - "'": "'", - "<": "<", - ">": ">", - "`": "`" - }; - var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/; - var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - var regexDecode = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g; - var decodeMap = { "aacute": "\xE1", "Aacute": "\xC1", "abreve": "\u0103", "Abreve": "\u0102", "ac": "\u223E", "acd": "\u223F", "acE": "\u223E\u0333", "acirc": "\xE2", "Acirc": "\xC2", "acute": "\xB4", "acy": "\u0430", "Acy": "\u0410", "aelig": "\xE6", "AElig": "\xC6", "af": "\u2061", "afr": "\u{1D51E}", "Afr": "\u{1D504}", "agrave": "\xE0", "Agrave": "\xC0", "alefsym": "\u2135", "aleph": "\u2135", "alpha": "\u03B1", "Alpha": "\u0391", "amacr": "\u0101", "Amacr": "\u0100", "amalg": "\u2A3F", "amp": "&", "AMP": "&", "and": "\u2227", "And": "\u2A53", "andand": "\u2A55", "andd": "\u2A5C", "andslope": "\u2A58", "andv": "\u2A5A", "ang": "\u2220", "ange": "\u29A4", "angle": "\u2220", "angmsd": "\u2221", "angmsdaa": "\u29A8", "angmsdab": "\u29A9", "angmsdac": "\u29AA", "angmsdad": "\u29AB", "angmsdae": "\u29AC", "angmsdaf": "\u29AD", "angmsdag": "\u29AE", "angmsdah": "\u29AF", "angrt": "\u221F", "angrtvb": "\u22BE", "angrtvbd": "\u299D", "angsph": "\u2222", "angst": "\xC5", "angzarr": "\u237C", "aogon": "\u0105", "Aogon": "\u0104", "aopf": "\u{1D552}", "Aopf": "\u{1D538}", "ap": "\u2248", "apacir": "\u2A6F", "ape": "\u224A", "apE": "\u2A70", "apid": "\u224B", "apos": "'", "ApplyFunction": "\u2061", "approx": "\u2248", "approxeq": "\u224A", "aring": "\xE5", "Aring": "\xC5", "ascr": "\u{1D4B6}", "Ascr": "\u{1D49C}", "Assign": "\u2254", "ast": "*", "asymp": "\u2248", "asympeq": "\u224D", "atilde": "\xE3", "Atilde": "\xC3", "auml": "\xE4", "Auml": "\xC4", "awconint": "\u2233", "awint": "\u2A11", "backcong": "\u224C", "backepsilon": "\u03F6", "backprime": "\u2035", "backsim": "\u223D", "backsimeq": "\u22CD", "Backslash": "\u2216", "Barv": "\u2AE7", "barvee": "\u22BD", "barwed": "\u2305", "Barwed": "\u2306", "barwedge": "\u2305", "bbrk": "\u23B5", "bbrktbrk": "\u23B6", "bcong": "\u224C", "bcy": "\u0431", "Bcy": "\u0411", "bdquo": "\u201E", "becaus": "\u2235", "because": "\u2235", "Because": "\u2235", "bemptyv": "\u29B0", "bepsi": "\u03F6", "bernou": "\u212C", "Bernoullis": "\u212C", "beta": "\u03B2", "Beta": "\u0392", "beth": "\u2136", "between": "\u226C", "bfr": "\u{1D51F}", "Bfr": "\u{1D505}", "bigcap": "\u22C2", "bigcirc": "\u25EF", "bigcup": "\u22C3", "bigodot": "\u2A00", "bigoplus": "\u2A01", "bigotimes": "\u2A02", "bigsqcup": "\u2A06", "bigstar": "\u2605", "bigtriangledown": "\u25BD", "bigtriangleup": "\u25B3", "biguplus": "\u2A04", "bigvee": "\u22C1", "bigwedge": "\u22C0", "bkarow": "\u290D", "blacklozenge": "\u29EB", "blacksquare": "\u25AA", "blacktriangle": "\u25B4", "blacktriangledown": "\u25BE", "blacktriangleleft": "\u25C2", "blacktriangleright": "\u25B8", "blank": "\u2423", "blk12": "\u2592", "blk14": "\u2591", "blk34": "\u2593", "block": "\u2588", "bne": "=\u20E5", "bnequiv": "\u2261\u20E5", "bnot": "\u2310", "bNot": "\u2AED", "bopf": "\u{1D553}", "Bopf": "\u{1D539}", "bot": "\u22A5", "bottom": "\u22A5", "bowtie": "\u22C8", "boxbox": "\u29C9", "boxdl": "\u2510", "boxdL": "\u2555", "boxDl": "\u2556", "boxDL": "\u2557", "boxdr": "\u250C", "boxdR": "\u2552", "boxDr": "\u2553", "boxDR": "\u2554", "boxh": "\u2500", "boxH": "\u2550", "boxhd": "\u252C", "boxhD": "\u2565", "boxHd": "\u2564", "boxHD": "\u2566", "boxhu": "\u2534", "boxhU": "\u2568", "boxHu": "\u2567", "boxHU": "\u2569", "boxminus": "\u229F", "boxplus": "\u229E", "boxtimes": "\u22A0", "boxul": "\u2518", "boxuL": "\u255B", "boxUl": "\u255C", "boxUL": "\u255D", "boxur": "\u2514", "boxuR": "\u2558", "boxUr": "\u2559", "boxUR": "\u255A", "boxv": "\u2502", "boxV": "\u2551", "boxvh": "\u253C", "boxvH": "\u256A", "boxVh": "\u256B", "boxVH": "\u256C", "boxvl": "\u2524", "boxvL": "\u2561", "boxVl": "\u2562", "boxVL": "\u2563", "boxvr": "\u251C", "boxvR": "\u255E", "boxVr": "\u255F", "boxVR": "\u2560", "bprime": "\u2035", "breve": "\u02D8", "Breve": "\u02D8", "brvbar": "\xA6", "bscr": "\u{1D4B7}", "Bscr": "\u212C", "bsemi": "\u204F", "bsim": "\u223D", "bsime": "\u22CD", "bsol": "\\", "bsolb": "\u29C5", "bsolhsub": "\u27C8", "bull": "\u2022", "bullet": "\u2022", "bump": "\u224E", "bumpe": "\u224F", "bumpE": "\u2AAE", "bumpeq": "\u224F", "Bumpeq": "\u224E", "cacute": "\u0107", "Cacute": "\u0106", "cap": "\u2229", "Cap": "\u22D2", "capand": "\u2A44", "capbrcup": "\u2A49", "capcap": "\u2A4B", "capcup": "\u2A47", "capdot": "\u2A40", "CapitalDifferentialD": "\u2145", "caps": "\u2229\uFE00", "caret": "\u2041", "caron": "\u02C7", "Cayleys": "\u212D", "ccaps": "\u2A4D", "ccaron": "\u010D", "Ccaron": "\u010C", "ccedil": "\xE7", "Ccedil": "\xC7", "ccirc": "\u0109", "Ccirc": "\u0108", "Cconint": "\u2230", "ccups": "\u2A4C", "ccupssm": "\u2A50", "cdot": "\u010B", "Cdot": "\u010A", "cedil": "\xB8", "Cedilla": "\xB8", "cemptyv": "\u29B2", "cent": "\xA2", "centerdot": "\xB7", "CenterDot": "\xB7", "cfr": "\u{1D520}", "Cfr": "\u212D", "chcy": "\u0447", "CHcy": "\u0427", "check": "\u2713", "checkmark": "\u2713", "chi": "\u03C7", "Chi": "\u03A7", "cir": "\u25CB", "circ": "\u02C6", "circeq": "\u2257", "circlearrowleft": "\u21BA", "circlearrowright": "\u21BB", "circledast": "\u229B", "circledcirc": "\u229A", "circleddash": "\u229D", "CircleDot": "\u2299", "circledR": "\xAE", "circledS": "\u24C8", "CircleMinus": "\u2296", "CirclePlus": "\u2295", "CircleTimes": "\u2297", "cire": "\u2257", "cirE": "\u29C3", "cirfnint": "\u2A10", "cirmid": "\u2AEF", "cirscir": "\u29C2", "ClockwiseContourIntegral": "\u2232", "CloseCurlyDoubleQuote": "\u201D", "CloseCurlyQuote": "\u2019", "clubs": "\u2663", "clubsuit": "\u2663", "colon": ":", "Colon": "\u2237", "colone": "\u2254", "Colone": "\u2A74", "coloneq": "\u2254", "comma": ",", "commat": "@", "comp": "\u2201", "compfn": "\u2218", "complement": "\u2201", "complexes": "\u2102", "cong": "\u2245", "congdot": "\u2A6D", "Congruent": "\u2261", "conint": "\u222E", "Conint": "\u222F", "ContourIntegral": "\u222E", "copf": "\u{1D554}", "Copf": "\u2102", "coprod": "\u2210", "Coproduct": "\u2210", "copy": "\xA9", "COPY": "\xA9", "copysr": "\u2117", "CounterClockwiseContourIntegral": "\u2233", "crarr": "\u21B5", "cross": "\u2717", "Cross": "\u2A2F", "cscr": "\u{1D4B8}", "Cscr": "\u{1D49E}", "csub": "\u2ACF", "csube": "\u2AD1", "csup": "\u2AD0", "csupe": "\u2AD2", "ctdot": "\u22EF", "cudarrl": "\u2938", "cudarrr": "\u2935", "cuepr": "\u22DE", "cuesc": "\u22DF", "cularr": "\u21B6", "cularrp": "\u293D", "cup": "\u222A", "Cup": "\u22D3", "cupbrcap": "\u2A48", "cupcap": "\u2A46", "CupCap": "\u224D", "cupcup": "\u2A4A", "cupdot": "\u228D", "cupor": "\u2A45", "cups": "\u222A\uFE00", "curarr": "\u21B7", "curarrm": "\u293C", "curlyeqprec": "\u22DE", "curlyeqsucc": "\u22DF", "curlyvee": "\u22CE", "curlywedge": "\u22CF", "curren": "\xA4", "curvearrowleft": "\u21B6", "curvearrowright": "\u21B7", "cuvee": "\u22CE", "cuwed": "\u22CF", "cwconint": "\u2232", "cwint": "\u2231", "cylcty": "\u232D", "dagger": "\u2020", "Dagger": "\u2021", "daleth": "\u2138", "darr": "\u2193", "dArr": "\u21D3", "Darr": "\u21A1", "dash": "\u2010", "dashv": "\u22A3", "Dashv": "\u2AE4", "dbkarow": "\u290F", "dblac": "\u02DD", "dcaron": "\u010F", "Dcaron": "\u010E", "dcy": "\u0434", "Dcy": "\u0414", "dd": "\u2146", "DD": "\u2145", "ddagger": "\u2021", "ddarr": "\u21CA", "DDotrahd": "\u2911", "ddotseq": "\u2A77", "deg": "\xB0", "Del": "\u2207", "delta": "\u03B4", "Delta": "\u0394", "demptyv": "\u29B1", "dfisht": "\u297F", "dfr": "\u{1D521}", "Dfr": "\u{1D507}", "dHar": "\u2965", "dharl": "\u21C3", "dharr": "\u21C2", "DiacriticalAcute": "\xB4", "DiacriticalDot": "\u02D9", "DiacriticalDoubleAcute": "\u02DD", "DiacriticalGrave": "`", "DiacriticalTilde": "\u02DC", "diam": "\u22C4", "diamond": "\u22C4", "Diamond": "\u22C4", "diamondsuit": "\u2666", "diams": "\u2666", "die": "\xA8", "DifferentialD": "\u2146", "digamma": "\u03DD", "disin": "\u22F2", "div": "\xF7", "divide": "\xF7", "divideontimes": "\u22C7", "divonx": "\u22C7", "djcy": "\u0452", "DJcy": "\u0402", "dlcorn": "\u231E", "dlcrop": "\u230D", "dollar": "$", "dopf": "\u{1D555}", "Dopf": "\u{1D53B}", "dot": "\u02D9", "Dot": "\xA8", "DotDot": "\u20DC", "doteq": "\u2250", "doteqdot": "\u2251", "DotEqual": "\u2250", "dotminus": "\u2238", "dotplus": "\u2214", "dotsquare": "\u22A1", "doublebarwedge": "\u2306", "DoubleContourIntegral": "\u222F", "DoubleDot": "\xA8", "DoubleDownArrow": "\u21D3", "DoubleLeftArrow": "\u21D0", "DoubleLeftRightArrow": "\u21D4", "DoubleLeftTee": "\u2AE4", "DoubleLongLeftArrow": "\u27F8", "DoubleLongLeftRightArrow": "\u27FA", "DoubleLongRightArrow": "\u27F9", "DoubleRightArrow": "\u21D2", "DoubleRightTee": "\u22A8", "DoubleUpArrow": "\u21D1", "DoubleUpDownArrow": "\u21D5", "DoubleVerticalBar": "\u2225", "downarrow": "\u2193", "Downarrow": "\u21D3", "DownArrow": "\u2193", "DownArrowBar": "\u2913", "DownArrowUpArrow": "\u21F5", "DownBreve": "\u0311", "downdownarrows": "\u21CA", "downharpoonleft": "\u21C3", "downharpoonright": "\u21C2", "DownLeftRightVector": "\u2950", "DownLeftTeeVector": "\u295E", "DownLeftVector": "\u21BD", "DownLeftVectorBar": "\u2956", "DownRightTeeVector": "\u295F", "DownRightVector": "\u21C1", "DownRightVectorBar": "\u2957", "DownTee": "\u22A4", "DownTeeArrow": "\u21A7", "drbkarow": "\u2910", "drcorn": "\u231F", "drcrop": "\u230C", "dscr": "\u{1D4B9}", "Dscr": "\u{1D49F}", "dscy": "\u0455", "DScy": "\u0405", "dsol": "\u29F6", "dstrok": "\u0111", "Dstrok": "\u0110", "dtdot": "\u22F1", "dtri": "\u25BF", "dtrif": "\u25BE", "duarr": "\u21F5", "duhar": "\u296F", "dwangle": "\u29A6", "dzcy": "\u045F", "DZcy": "\u040F", "dzigrarr": "\u27FF", "eacute": "\xE9", "Eacute": "\xC9", "easter": "\u2A6E", "ecaron": "\u011B", "Ecaron": "\u011A", "ecir": "\u2256", "ecirc": "\xEA", "Ecirc": "\xCA", "ecolon": "\u2255", "ecy": "\u044D", "Ecy": "\u042D", "eDDot": "\u2A77", "edot": "\u0117", "eDot": "\u2251", "Edot": "\u0116", "ee": "\u2147", "efDot": "\u2252", "efr": "\u{1D522}", "Efr": "\u{1D508}", "eg": "\u2A9A", "egrave": "\xE8", "Egrave": "\xC8", "egs": "\u2A96", "egsdot": "\u2A98", "el": "\u2A99", "Element": "\u2208", "elinters": "\u23E7", "ell": "\u2113", "els": "\u2A95", "elsdot": "\u2A97", "emacr": "\u0113", "Emacr": "\u0112", "empty": "\u2205", "emptyset": "\u2205", "EmptySmallSquare": "\u25FB", "emptyv": "\u2205", "EmptyVerySmallSquare": "\u25AB", "emsp": "\u2003", "emsp13": "\u2004", "emsp14": "\u2005", "eng": "\u014B", "ENG": "\u014A", "ensp": "\u2002", "eogon": "\u0119", "Eogon": "\u0118", "eopf": "\u{1D556}", "Eopf": "\u{1D53C}", "epar": "\u22D5", "eparsl": "\u29E3", "eplus": "\u2A71", "epsi": "\u03B5", "epsilon": "\u03B5", "Epsilon": "\u0395", "epsiv": "\u03F5", "eqcirc": "\u2256", "eqcolon": "\u2255", "eqsim": "\u2242", "eqslantgtr": "\u2A96", "eqslantless": "\u2A95", "Equal": "\u2A75", "equals": "=", "EqualTilde": "\u2242", "equest": "\u225F", "Equilibrium": "\u21CC", "equiv": "\u2261", "equivDD": "\u2A78", "eqvparsl": "\u29E5", "erarr": "\u2971", "erDot": "\u2253", "escr": "\u212F", "Escr": "\u2130", "esdot": "\u2250", "esim": "\u2242", "Esim": "\u2A73", "eta": "\u03B7", "Eta": "\u0397", "eth": "\xF0", "ETH": "\xD0", "euml": "\xEB", "Euml": "\xCB", "euro": "\u20AC", "excl": "!", "exist": "\u2203", "Exists": "\u2203", "expectation": "\u2130", "exponentiale": "\u2147", "ExponentialE": "\u2147", "fallingdotseq": "\u2252", "fcy": "\u0444", "Fcy": "\u0424", "female": "\u2640", "ffilig": "\uFB03", "fflig": "\uFB00", "ffllig": "\uFB04", "ffr": "\u{1D523}", "Ffr": "\u{1D509}", "filig": "\uFB01", "FilledSmallSquare": "\u25FC", "FilledVerySmallSquare": "\u25AA", "fjlig": "fj", "flat": "\u266D", "fllig": "\uFB02", "fltns": "\u25B1", "fnof": "\u0192", "fopf": "\u{1D557}", "Fopf": "\u{1D53D}", "forall": "\u2200", "ForAll": "\u2200", "fork": "\u22D4", "forkv": "\u2AD9", "Fouriertrf": "\u2131", "fpartint": "\u2A0D", "frac12": "\xBD", "frac13": "\u2153", "frac14": "\xBC", "frac15": "\u2155", "frac16": "\u2159", "frac18": "\u215B", "frac23": "\u2154", "frac25": "\u2156", "frac34": "\xBE", "frac35": "\u2157", "frac38": "\u215C", "frac45": "\u2158", "frac56": "\u215A", "frac58": "\u215D", "frac78": "\u215E", "frasl": "\u2044", "frown": "\u2322", "fscr": "\u{1D4BB}", "Fscr": "\u2131", "gacute": "\u01F5", "gamma": "\u03B3", "Gamma": "\u0393", "gammad": "\u03DD", "Gammad": "\u03DC", "gap": "\u2A86", "gbreve": "\u011F", "Gbreve": "\u011E", "Gcedil": "\u0122", "gcirc": "\u011D", "Gcirc": "\u011C", "gcy": "\u0433", "Gcy": "\u0413", "gdot": "\u0121", "Gdot": "\u0120", "ge": "\u2265", "gE": "\u2267", "gel": "\u22DB", "gEl": "\u2A8C", "geq": "\u2265", "geqq": "\u2267", "geqslant": "\u2A7E", "ges": "\u2A7E", "gescc": "\u2AA9", "gesdot": "\u2A80", "gesdoto": "\u2A82", "gesdotol": "\u2A84", "gesl": "\u22DB\uFE00", "gesles": "\u2A94", "gfr": "\u{1D524}", "Gfr": "\u{1D50A}", "gg": "\u226B", "Gg": "\u22D9", "ggg": "\u22D9", "gimel": "\u2137", "gjcy": "\u0453", "GJcy": "\u0403", "gl": "\u2277", "gla": "\u2AA5", "glE": "\u2A92", "glj": "\u2AA4", "gnap": "\u2A8A", "gnapprox": "\u2A8A", "gne": "\u2A88", "gnE": "\u2269", "gneq": "\u2A88", "gneqq": "\u2269", "gnsim": "\u22E7", "gopf": "\u{1D558}", "Gopf": "\u{1D53E}", "grave": "`", "GreaterEqual": "\u2265", "GreaterEqualLess": "\u22DB", "GreaterFullEqual": "\u2267", "GreaterGreater": "\u2AA2", "GreaterLess": "\u2277", "GreaterSlantEqual": "\u2A7E", "GreaterTilde": "\u2273", "gscr": "\u210A", "Gscr": "\u{1D4A2}", "gsim": "\u2273", "gsime": "\u2A8E", "gsiml": "\u2A90", "gt": ">", "Gt": "\u226B", "GT": ">", "gtcc": "\u2AA7", "gtcir": "\u2A7A", "gtdot": "\u22D7", "gtlPar": "\u2995", "gtquest": "\u2A7C", "gtrapprox": "\u2A86", "gtrarr": "\u2978", "gtrdot": "\u22D7", "gtreqless": "\u22DB", "gtreqqless": "\u2A8C", "gtrless": "\u2277", "gtrsim": "\u2273", "gvertneqq": "\u2269\uFE00", "gvnE": "\u2269\uFE00", "Hacek": "\u02C7", "hairsp": "\u200A", "half": "\xBD", "hamilt": "\u210B", "hardcy": "\u044A", "HARDcy": "\u042A", "harr": "\u2194", "hArr": "\u21D4", "harrcir": "\u2948", "harrw": "\u21AD", "Hat": "^", "hbar": "\u210F", "hcirc": "\u0125", "Hcirc": "\u0124", "hearts": "\u2665", "heartsuit": "\u2665", "hellip": "\u2026", "hercon": "\u22B9", "hfr": "\u{1D525}", "Hfr": "\u210C", "HilbertSpace": "\u210B", "hksearow": "\u2925", "hkswarow": "\u2926", "hoarr": "\u21FF", "homtht": "\u223B", "hookleftarrow": "\u21A9", "hookrightarrow": "\u21AA", "hopf": "\u{1D559}", "Hopf": "\u210D", "horbar": "\u2015", "HorizontalLine": "\u2500", "hscr": "\u{1D4BD}", "Hscr": "\u210B", "hslash": "\u210F", "hstrok": "\u0127", "Hstrok": "\u0126", "HumpDownHump": "\u224E", "HumpEqual": "\u224F", "hybull": "\u2043", "hyphen": "\u2010", "iacute": "\xED", "Iacute": "\xCD", "ic": "\u2063", "icirc": "\xEE", "Icirc": "\xCE", "icy": "\u0438", "Icy": "\u0418", "Idot": "\u0130", "iecy": "\u0435", "IEcy": "\u0415", "iexcl": "\xA1", "iff": "\u21D4", "ifr": "\u{1D526}", "Ifr": "\u2111", "igrave": "\xEC", "Igrave": "\xCC", "ii": "\u2148", "iiiint": "\u2A0C", "iiint": "\u222D", "iinfin": "\u29DC", "iiota": "\u2129", "ijlig": "\u0133", "IJlig": "\u0132", "Im": "\u2111", "imacr": "\u012B", "Imacr": "\u012A", "image": "\u2111", "ImaginaryI": "\u2148", "imagline": "\u2110", "imagpart": "\u2111", "imath": "\u0131", "imof": "\u22B7", "imped": "\u01B5", "Implies": "\u21D2", "in": "\u2208", "incare": "\u2105", "infin": "\u221E", "infintie": "\u29DD", "inodot": "\u0131", "int": "\u222B", "Int": "\u222C", "intcal": "\u22BA", "integers": "\u2124", "Integral": "\u222B", "intercal": "\u22BA", "Intersection": "\u22C2", "intlarhk": "\u2A17", "intprod": "\u2A3C", "InvisibleComma": "\u2063", "InvisibleTimes": "\u2062", "iocy": "\u0451", "IOcy": "\u0401", "iogon": "\u012F", "Iogon": "\u012E", "iopf": "\u{1D55A}", "Iopf": "\u{1D540}", "iota": "\u03B9", "Iota": "\u0399", "iprod": "\u2A3C", "iquest": "\xBF", "iscr": "\u{1D4BE}", "Iscr": "\u2110", "isin": "\u2208", "isindot": "\u22F5", "isinE": "\u22F9", "isins": "\u22F4", "isinsv": "\u22F3", "isinv": "\u2208", "it": "\u2062", "itilde": "\u0129", "Itilde": "\u0128", "iukcy": "\u0456", "Iukcy": "\u0406", "iuml": "\xEF", "Iuml": "\xCF", "jcirc": "\u0135", "Jcirc": "\u0134", "jcy": "\u0439", "Jcy": "\u0419", "jfr": "\u{1D527}", "Jfr": "\u{1D50D}", "jmath": "\u0237", "jopf": "\u{1D55B}", "Jopf": "\u{1D541}", "jscr": "\u{1D4BF}", "Jscr": "\u{1D4A5}", "jsercy": "\u0458", "Jsercy": "\u0408", "jukcy": "\u0454", "Jukcy": "\u0404", "kappa": "\u03BA", "Kappa": "\u039A", "kappav": "\u03F0", "kcedil": "\u0137", "Kcedil": "\u0136", "kcy": "\u043A", "Kcy": "\u041A", "kfr": "\u{1D528}", "Kfr": "\u{1D50E}", "kgreen": "\u0138", "khcy": "\u0445", "KHcy": "\u0425", "kjcy": "\u045C", "KJcy": "\u040C", "kopf": "\u{1D55C}", "Kopf": "\u{1D542}", "kscr": "\u{1D4C0}", "Kscr": "\u{1D4A6}", "lAarr": "\u21DA", "lacute": "\u013A", "Lacute": "\u0139", "laemptyv": "\u29B4", "lagran": "\u2112", "lambda": "\u03BB", "Lambda": "\u039B", "lang": "\u27E8", "Lang": "\u27EA", "langd": "\u2991", "langle": "\u27E8", "lap": "\u2A85", "Laplacetrf": "\u2112", "laquo": "\xAB", "larr": "\u2190", "lArr": "\u21D0", "Larr": "\u219E", "larrb": "\u21E4", "larrbfs": "\u291F", "larrfs": "\u291D", "larrhk": "\u21A9", "larrlp": "\u21AB", "larrpl": "\u2939", "larrsim": "\u2973", "larrtl": "\u21A2", "lat": "\u2AAB", "latail": "\u2919", "lAtail": "\u291B", "late": "\u2AAD", "lates": "\u2AAD\uFE00", "lbarr": "\u290C", "lBarr": "\u290E", "lbbrk": "\u2772", "lbrace": "{", "lbrack": "[", "lbrke": "\u298B", "lbrksld": "\u298F", "lbrkslu": "\u298D", "lcaron": "\u013E", "Lcaron": "\u013D", "lcedil": "\u013C", "Lcedil": "\u013B", "lceil": "\u2308", "lcub": "{", "lcy": "\u043B", "Lcy": "\u041B", "ldca": "\u2936", "ldquo": "\u201C", "ldquor": "\u201E", "ldrdhar": "\u2967", "ldrushar": "\u294B", "ldsh": "\u21B2", "le": "\u2264", "lE": "\u2266", "LeftAngleBracket": "\u27E8", "leftarrow": "\u2190", "Leftarrow": "\u21D0", "LeftArrow": "\u2190", "LeftArrowBar": "\u21E4", "LeftArrowRightArrow": "\u21C6", "leftarrowtail": "\u21A2", "LeftCeiling": "\u2308", "LeftDoubleBracket": "\u27E6", "LeftDownTeeVector": "\u2961", "LeftDownVector": "\u21C3", "LeftDownVectorBar": "\u2959", "LeftFloor": "\u230A", "leftharpoondown": "\u21BD", "leftharpoonup": "\u21BC", "leftleftarrows": "\u21C7", "leftrightarrow": "\u2194", "Leftrightarrow": "\u21D4", "LeftRightArrow": "\u2194", "leftrightarrows": "\u21C6", "leftrightharpoons": "\u21CB", "leftrightsquigarrow": "\u21AD", "LeftRightVector": "\u294E", "LeftTee": "\u22A3", "LeftTeeArrow": "\u21A4", "LeftTeeVector": "\u295A", "leftthreetimes": "\u22CB", "LeftTriangle": "\u22B2", "LeftTriangleBar": "\u29CF", "LeftTriangleEqual": "\u22B4", "LeftUpDownVector": "\u2951", "LeftUpTeeVector": "\u2960", "LeftUpVector": "\u21BF", "LeftUpVectorBar": "\u2958", "LeftVector": "\u21BC", "LeftVectorBar": "\u2952", "leg": "\u22DA", "lEg": "\u2A8B", "leq": "\u2264", "leqq": "\u2266", "leqslant": "\u2A7D", "les": "\u2A7D", "lescc": "\u2AA8", "lesdot": "\u2A7F", "lesdoto": "\u2A81", "lesdotor": "\u2A83", "lesg": "\u22DA\uFE00", "lesges": "\u2A93", "lessapprox": "\u2A85", "lessdot": "\u22D6", "lesseqgtr": "\u22DA", "lesseqqgtr": "\u2A8B", "LessEqualGreater": "\u22DA", "LessFullEqual": "\u2266", "LessGreater": "\u2276", "lessgtr": "\u2276", "LessLess": "\u2AA1", "lesssim": "\u2272", "LessSlantEqual": "\u2A7D", "LessTilde": "\u2272", "lfisht": "\u297C", "lfloor": "\u230A", "lfr": "\u{1D529}", "Lfr": "\u{1D50F}", "lg": "\u2276", "lgE": "\u2A91", "lHar": "\u2962", "lhard": "\u21BD", "lharu": "\u21BC", "lharul": "\u296A", "lhblk": "\u2584", "ljcy": "\u0459", "LJcy": "\u0409", "ll": "\u226A", "Ll": "\u22D8", "llarr": "\u21C7", "llcorner": "\u231E", "Lleftarrow": "\u21DA", "llhard": "\u296B", "lltri": "\u25FA", "lmidot": "\u0140", "Lmidot": "\u013F", "lmoust": "\u23B0", "lmoustache": "\u23B0", "lnap": "\u2A89", "lnapprox": "\u2A89", "lne": "\u2A87", "lnE": "\u2268", "lneq": "\u2A87", "lneqq": "\u2268", "lnsim": "\u22E6", "loang": "\u27EC", "loarr": "\u21FD", "lobrk": "\u27E6", "longleftarrow": "\u27F5", "Longleftarrow": "\u27F8", "LongLeftArrow": "\u27F5", "longleftrightarrow": "\u27F7", "Longleftrightarrow": "\u27FA", "LongLeftRightArrow": "\u27F7", "longmapsto": "\u27FC", "longrightarrow": "\u27F6", "Longrightarrow": "\u27F9", "LongRightArrow": "\u27F6", "looparrowleft": "\u21AB", "looparrowright": "\u21AC", "lopar": "\u2985", "lopf": "\u{1D55D}", "Lopf": "\u{1D543}", "loplus": "\u2A2D", "lotimes": "\u2A34", "lowast": "\u2217", "lowbar": "_", "LowerLeftArrow": "\u2199", "LowerRightArrow": "\u2198", "loz": "\u25CA", "lozenge": "\u25CA", "lozf": "\u29EB", "lpar": "(", "lparlt": "\u2993", "lrarr": "\u21C6", "lrcorner": "\u231F", "lrhar": "\u21CB", "lrhard": "\u296D", "lrm": "\u200E", "lrtri": "\u22BF", "lsaquo": "\u2039", "lscr": "\u{1D4C1}", "Lscr": "\u2112", "lsh": "\u21B0", "Lsh": "\u21B0", "lsim": "\u2272", "lsime": "\u2A8D", "lsimg": "\u2A8F", "lsqb": "[", "lsquo": "\u2018", "lsquor": "\u201A", "lstrok": "\u0142", "Lstrok": "\u0141", "lt": "<", "Lt": "\u226A", "LT": "<", "ltcc": "\u2AA6", "ltcir": "\u2A79", "ltdot": "\u22D6", "lthree": "\u22CB", "ltimes": "\u22C9", "ltlarr": "\u2976", "ltquest": "\u2A7B", "ltri": "\u25C3", "ltrie": "\u22B4", "ltrif": "\u25C2", "ltrPar": "\u2996", "lurdshar": "\u294A", "luruhar": "\u2966", "lvertneqq": "\u2268\uFE00", "lvnE": "\u2268\uFE00", "macr": "\xAF", "male": "\u2642", "malt": "\u2720", "maltese": "\u2720", "map": "\u21A6", "Map": "\u2905", "mapsto": "\u21A6", "mapstodown": "\u21A7", "mapstoleft": "\u21A4", "mapstoup": "\u21A5", "marker": "\u25AE", "mcomma": "\u2A29", "mcy": "\u043C", "Mcy": "\u041C", "mdash": "\u2014", "mDDot": "\u223A", "measuredangle": "\u2221", "MediumSpace": "\u205F", "Mellintrf": "\u2133", "mfr": "\u{1D52A}", "Mfr": "\u{1D510}", "mho": "\u2127", "micro": "\xB5", "mid": "\u2223", "midast": "*", "midcir": "\u2AF0", "middot": "\xB7", "minus": "\u2212", "minusb": "\u229F", "minusd": "\u2238", "minusdu": "\u2A2A", "MinusPlus": "\u2213", "mlcp": "\u2ADB", "mldr": "\u2026", "mnplus": "\u2213", "models": "\u22A7", "mopf": "\u{1D55E}", "Mopf": "\u{1D544}", "mp": "\u2213", "mscr": "\u{1D4C2}", "Mscr": "\u2133", "mstpos": "\u223E", "mu": "\u03BC", "Mu": "\u039C", "multimap": "\u22B8", "mumap": "\u22B8", "nabla": "\u2207", "nacute": "\u0144", "Nacute": "\u0143", "nang": "\u2220\u20D2", "nap": "\u2249", "napE": "\u2A70\u0338", "napid": "\u224B\u0338", "napos": "\u0149", "napprox": "\u2249", "natur": "\u266E", "natural": "\u266E", "naturals": "\u2115", "nbsp": "\xA0", "nbump": "\u224E\u0338", "nbumpe": "\u224F\u0338", "ncap": "\u2A43", "ncaron": "\u0148", "Ncaron": "\u0147", "ncedil": "\u0146", "Ncedil": "\u0145", "ncong": "\u2247", "ncongdot": "\u2A6D\u0338", "ncup": "\u2A42", "ncy": "\u043D", "Ncy": "\u041D", "ndash": "\u2013", "ne": "\u2260", "nearhk": "\u2924", "nearr": "\u2197", "neArr": "\u21D7", "nearrow": "\u2197", "nedot": "\u2250\u0338", "NegativeMediumSpace": "\u200B", "NegativeThickSpace": "\u200B", "NegativeThinSpace": "\u200B", "NegativeVeryThinSpace": "\u200B", "nequiv": "\u2262", "nesear": "\u2928", "nesim": "\u2242\u0338", "NestedGreaterGreater": "\u226B", "NestedLessLess": "\u226A", "NewLine": "\n", "nexist": "\u2204", "nexists": "\u2204", "nfr": "\u{1D52B}", "Nfr": "\u{1D511}", "nge": "\u2271", "ngE": "\u2267\u0338", "ngeq": "\u2271", "ngeqq": "\u2267\u0338", "ngeqslant": "\u2A7E\u0338", "nges": "\u2A7E\u0338", "nGg": "\u22D9\u0338", "ngsim": "\u2275", "ngt": "\u226F", "nGt": "\u226B\u20D2", "ngtr": "\u226F", "nGtv": "\u226B\u0338", "nharr": "\u21AE", "nhArr": "\u21CE", "nhpar": "\u2AF2", "ni": "\u220B", "nis": "\u22FC", "nisd": "\u22FA", "niv": "\u220B", "njcy": "\u045A", "NJcy": "\u040A", "nlarr": "\u219A", "nlArr": "\u21CD", "nldr": "\u2025", "nle": "\u2270", "nlE": "\u2266\u0338", "nleftarrow": "\u219A", "nLeftarrow": "\u21CD", "nleftrightarrow": "\u21AE", "nLeftrightarrow": "\u21CE", "nleq": "\u2270", "nleqq": "\u2266\u0338", "nleqslant": "\u2A7D\u0338", "nles": "\u2A7D\u0338", "nless": "\u226E", "nLl": "\u22D8\u0338", "nlsim": "\u2274", "nlt": "\u226E", "nLt": "\u226A\u20D2", "nltri": "\u22EA", "nltrie": "\u22EC", "nLtv": "\u226A\u0338", "nmid": "\u2224", "NoBreak": "\u2060", "NonBreakingSpace": "\xA0", "nopf": "\u{1D55F}", "Nopf": "\u2115", "not": "\xAC", "Not": "\u2AEC", "NotCongruent": "\u2262", "NotCupCap": "\u226D", "NotDoubleVerticalBar": "\u2226", "NotElement": "\u2209", "NotEqual": "\u2260", "NotEqualTilde": "\u2242\u0338", "NotExists": "\u2204", "NotGreater": "\u226F", "NotGreaterEqual": "\u2271", "NotGreaterFullEqual": "\u2267\u0338", "NotGreaterGreater": "\u226B\u0338", "NotGreaterLess": "\u2279", "NotGreaterSlantEqual": "\u2A7E\u0338", "NotGreaterTilde": "\u2275", "NotHumpDownHump": "\u224E\u0338", "NotHumpEqual": "\u224F\u0338", "notin": "\u2209", "notindot": "\u22F5\u0338", "notinE": "\u22F9\u0338", "notinva": "\u2209", "notinvb": "\u22F7", "notinvc": "\u22F6", "NotLeftTriangle": "\u22EA", "NotLeftTriangleBar": "\u29CF\u0338", "NotLeftTriangleEqual": "\u22EC", "NotLess": "\u226E", "NotLessEqual": "\u2270", "NotLessGreater": "\u2278", "NotLessLess": "\u226A\u0338", "NotLessSlantEqual": "\u2A7D\u0338", "NotLessTilde": "\u2274", "NotNestedGreaterGreater": "\u2AA2\u0338", "NotNestedLessLess": "\u2AA1\u0338", "notni": "\u220C", "notniva": "\u220C", "notnivb": "\u22FE", "notnivc": "\u22FD", "NotPrecedes": "\u2280", "NotPrecedesEqual": "\u2AAF\u0338", "NotPrecedesSlantEqual": "\u22E0", "NotReverseElement": "\u220C", "NotRightTriangle": "\u22EB", "NotRightTriangleBar": "\u29D0\u0338", "NotRightTriangleEqual": "\u22ED", "NotSquareSubset": "\u228F\u0338", "NotSquareSubsetEqual": "\u22E2", "NotSquareSuperset": "\u2290\u0338", "NotSquareSupersetEqual": "\u22E3", "NotSubset": "\u2282\u20D2", "NotSubsetEqual": "\u2288", "NotSucceeds": "\u2281", "NotSucceedsEqual": "\u2AB0\u0338", "NotSucceedsSlantEqual": "\u22E1", "NotSucceedsTilde": "\u227F\u0338", "NotSuperset": "\u2283\u20D2", "NotSupersetEqual": "\u2289", "NotTilde": "\u2241", "NotTildeEqual": "\u2244", "NotTildeFullEqual": "\u2247", "NotTildeTilde": "\u2249", "NotVerticalBar": "\u2224", "npar": "\u2226", "nparallel": "\u2226", "nparsl": "\u2AFD\u20E5", "npart": "\u2202\u0338", "npolint": "\u2A14", "npr": "\u2280", "nprcue": "\u22E0", "npre": "\u2AAF\u0338", "nprec": "\u2280", "npreceq": "\u2AAF\u0338", "nrarr": "\u219B", "nrArr": "\u21CF", "nrarrc": "\u2933\u0338", "nrarrw": "\u219D\u0338", "nrightarrow": "\u219B", "nRightarrow": "\u21CF", "nrtri": "\u22EB", "nrtrie": "\u22ED", "nsc": "\u2281", "nsccue": "\u22E1", "nsce": "\u2AB0\u0338", "nscr": "\u{1D4C3}", "Nscr": "\u{1D4A9}", "nshortmid": "\u2224", "nshortparallel": "\u2226", "nsim": "\u2241", "nsime": "\u2244", "nsimeq": "\u2244", "nsmid": "\u2224", "nspar": "\u2226", "nsqsube": "\u22E2", "nsqsupe": "\u22E3", "nsub": "\u2284", "nsube": "\u2288", "nsubE": "\u2AC5\u0338", "nsubset": "\u2282\u20D2", "nsubseteq": "\u2288", "nsubseteqq": "\u2AC5\u0338", "nsucc": "\u2281", "nsucceq": "\u2AB0\u0338", "nsup": "\u2285", "nsupe": "\u2289", "nsupE": "\u2AC6\u0338", "nsupset": "\u2283\u20D2", "nsupseteq": "\u2289", "nsupseteqq": "\u2AC6\u0338", "ntgl": "\u2279", "ntilde": "\xF1", "Ntilde": "\xD1", "ntlg": "\u2278", "ntriangleleft": "\u22EA", "ntrianglelefteq": "\u22EC", "ntriangleright": "\u22EB", "ntrianglerighteq": "\u22ED", "nu": "\u03BD", "Nu": "\u039D", "num": "#", "numero": "\u2116", "numsp": "\u2007", "nvap": "\u224D\u20D2", "nvdash": "\u22AC", "nvDash": "\u22AD", "nVdash": "\u22AE", "nVDash": "\u22AF", "nvge": "\u2265\u20D2", "nvgt": ">\u20D2", "nvHarr": "\u2904", "nvinfin": "\u29DE", "nvlArr": "\u2902", "nvle": "\u2264\u20D2", "nvlt": "<\u20D2", "nvltrie": "\u22B4\u20D2", "nvrArr": "\u2903", "nvrtrie": "\u22B5\u20D2", "nvsim": "\u223C\u20D2", "nwarhk": "\u2923", "nwarr": "\u2196", "nwArr": "\u21D6", "nwarrow": "\u2196", "nwnear": "\u2927", "oacute": "\xF3", "Oacute": "\xD3", "oast": "\u229B", "ocir": "\u229A", "ocirc": "\xF4", "Ocirc": "\xD4", "ocy": "\u043E", "Ocy": "\u041E", "odash": "\u229D", "odblac": "\u0151", "Odblac": "\u0150", "odiv": "\u2A38", "odot": "\u2299", "odsold": "\u29BC", "oelig": "\u0153", "OElig": "\u0152", "ofcir": "\u29BF", "ofr": "\u{1D52C}", "Ofr": "\u{1D512}", "ogon": "\u02DB", "ograve": "\xF2", "Ograve": "\xD2", "ogt": "\u29C1", "ohbar": "\u29B5", "ohm": "\u03A9", "oint": "\u222E", "olarr": "\u21BA", "olcir": "\u29BE", "olcross": "\u29BB", "oline": "\u203E", "olt": "\u29C0", "omacr": "\u014D", "Omacr": "\u014C", "omega": "\u03C9", "Omega": "\u03A9", "omicron": "\u03BF", "Omicron": "\u039F", "omid": "\u29B6", "ominus": "\u2296", "oopf": "\u{1D560}", "Oopf": "\u{1D546}", "opar": "\u29B7", "OpenCurlyDoubleQuote": "\u201C", "OpenCurlyQuote": "\u2018", "operp": "\u29B9", "oplus": "\u2295", "or": "\u2228", "Or": "\u2A54", "orarr": "\u21BB", "ord": "\u2A5D", "order": "\u2134", "orderof": "\u2134", "ordf": "\xAA", "ordm": "\xBA", "origof": "\u22B6", "oror": "\u2A56", "orslope": "\u2A57", "orv": "\u2A5B", "oS": "\u24C8", "oscr": "\u2134", "Oscr": "\u{1D4AA}", "oslash": "\xF8", "Oslash": "\xD8", "osol": "\u2298", "otilde": "\xF5", "Otilde": "\xD5", "otimes": "\u2297", "Otimes": "\u2A37", "otimesas": "\u2A36", "ouml": "\xF6", "Ouml": "\xD6", "ovbar": "\u233D", "OverBar": "\u203E", "OverBrace": "\u23DE", "OverBracket": "\u23B4", "OverParenthesis": "\u23DC", "par": "\u2225", "para": "\xB6", "parallel": "\u2225", "parsim": "\u2AF3", "parsl": "\u2AFD", "part": "\u2202", "PartialD": "\u2202", "pcy": "\u043F", "Pcy": "\u041F", "percnt": "%", "period": ".", "permil": "\u2030", "perp": "\u22A5", "pertenk": "\u2031", "pfr": "\u{1D52D}", "Pfr": "\u{1D513}", "phi": "\u03C6", "Phi": "\u03A6", "phiv": "\u03D5", "phmmat": "\u2133", "phone": "\u260E", "pi": "\u03C0", "Pi": "\u03A0", "pitchfork": "\u22D4", "piv": "\u03D6", "planck": "\u210F", "planckh": "\u210E", "plankv": "\u210F", "plus": "+", "plusacir": "\u2A23", "plusb": "\u229E", "pluscir": "\u2A22", "plusdo": "\u2214", "plusdu": "\u2A25", "pluse": "\u2A72", "PlusMinus": "\xB1", "plusmn": "\xB1", "plussim": "\u2A26", "plustwo": "\u2A27", "pm": "\xB1", "Poincareplane": "\u210C", "pointint": "\u2A15", "popf": "\u{1D561}", "Popf": "\u2119", "pound": "\xA3", "pr": "\u227A", "Pr": "\u2ABB", "prap": "\u2AB7", "prcue": "\u227C", "pre": "\u2AAF", "prE": "\u2AB3", "prec": "\u227A", "precapprox": "\u2AB7", "preccurlyeq": "\u227C", "Precedes": "\u227A", "PrecedesEqual": "\u2AAF", "PrecedesSlantEqual": "\u227C", "PrecedesTilde": "\u227E", "preceq": "\u2AAF", "precnapprox": "\u2AB9", "precneqq": "\u2AB5", "precnsim": "\u22E8", "precsim": "\u227E", "prime": "\u2032", "Prime": "\u2033", "primes": "\u2119", "prnap": "\u2AB9", "prnE": "\u2AB5", "prnsim": "\u22E8", "prod": "\u220F", "Product": "\u220F", "profalar": "\u232E", "profline": "\u2312", "profsurf": "\u2313", "prop": "\u221D", "Proportion": "\u2237", "Proportional": "\u221D", "propto": "\u221D", "prsim": "\u227E", "prurel": "\u22B0", "pscr": "\u{1D4C5}", "Pscr": "\u{1D4AB}", "psi": "\u03C8", "Psi": "\u03A8", "puncsp": "\u2008", "qfr": "\u{1D52E}", "Qfr": "\u{1D514}", "qint": "\u2A0C", "qopf": "\u{1D562}", "Qopf": "\u211A", "qprime": "\u2057", "qscr": "\u{1D4C6}", "Qscr": "\u{1D4AC}", "quaternions": "\u210D", "quatint": "\u2A16", "quest": "?", "questeq": "\u225F", "quot": '"', "QUOT": '"', "rAarr": "\u21DB", "race": "\u223D\u0331", "racute": "\u0155", "Racute": "\u0154", "radic": "\u221A", "raemptyv": "\u29B3", "rang": "\u27E9", "Rang": "\u27EB", "rangd": "\u2992", "range": "\u29A5", "rangle": "\u27E9", "raquo": "\xBB", "rarr": "\u2192", "rArr": "\u21D2", "Rarr": "\u21A0", "rarrap": "\u2975", "rarrb": "\u21E5", "rarrbfs": "\u2920", "rarrc": "\u2933", "rarrfs": "\u291E", "rarrhk": "\u21AA", "rarrlp": "\u21AC", "rarrpl": "\u2945", "rarrsim": "\u2974", "rarrtl": "\u21A3", "Rarrtl": "\u2916", "rarrw": "\u219D", "ratail": "\u291A", "rAtail": "\u291C", "ratio": "\u2236", "rationals": "\u211A", "rbarr": "\u290D", "rBarr": "\u290F", "RBarr": "\u2910", "rbbrk": "\u2773", "rbrace": "}", "rbrack": "]", "rbrke": "\u298C", "rbrksld": "\u298E", "rbrkslu": "\u2990", "rcaron": "\u0159", "Rcaron": "\u0158", "rcedil": "\u0157", "Rcedil": "\u0156", "rceil": "\u2309", "rcub": "}", "rcy": "\u0440", "Rcy": "\u0420", "rdca": "\u2937", "rdldhar": "\u2969", "rdquo": "\u201D", "rdquor": "\u201D", "rdsh": "\u21B3", "Re": "\u211C", "real": "\u211C", "realine": "\u211B", "realpart": "\u211C", "reals": "\u211D", "rect": "\u25AD", "reg": "\xAE", "REG": "\xAE", "ReverseElement": "\u220B", "ReverseEquilibrium": "\u21CB", "ReverseUpEquilibrium": "\u296F", "rfisht": "\u297D", "rfloor": "\u230B", "rfr": "\u{1D52F}", "Rfr": "\u211C", "rHar": "\u2964", "rhard": "\u21C1", "rharu": "\u21C0", "rharul": "\u296C", "rho": "\u03C1", "Rho": "\u03A1", "rhov": "\u03F1", "RightAngleBracket": "\u27E9", "rightarrow": "\u2192", "Rightarrow": "\u21D2", "RightArrow": "\u2192", "RightArrowBar": "\u21E5", "RightArrowLeftArrow": "\u21C4", "rightarrowtail": "\u21A3", "RightCeiling": "\u2309", "RightDoubleBracket": "\u27E7", "RightDownTeeVector": "\u295D", "RightDownVector": "\u21C2", "RightDownVectorBar": "\u2955", "RightFloor": "\u230B", "rightharpoondown": "\u21C1", "rightharpoonup": "\u21C0", "rightleftarrows": "\u21C4", "rightleftharpoons": "\u21CC", "rightrightarrows": "\u21C9", "rightsquigarrow": "\u219D", "RightTee": "\u22A2", "RightTeeArrow": "\u21A6", "RightTeeVector": "\u295B", "rightthreetimes": "\u22CC", "RightTriangle": "\u22B3", "RightTriangleBar": "\u29D0", "RightTriangleEqual": "\u22B5", "RightUpDownVector": "\u294F", "RightUpTeeVector": "\u295C", "RightUpVector": "\u21BE", "RightUpVectorBar": "\u2954", "RightVector": "\u21C0", "RightVectorBar": "\u2953", "ring": "\u02DA", "risingdotseq": "\u2253", "rlarr": "\u21C4", "rlhar": "\u21CC", "rlm": "\u200F", "rmoust": "\u23B1", "rmoustache": "\u23B1", "rnmid": "\u2AEE", "roang": "\u27ED", "roarr": "\u21FE", "robrk": "\u27E7", "ropar": "\u2986", "ropf": "\u{1D563}", "Ropf": "\u211D", "roplus": "\u2A2E", "rotimes": "\u2A35", "RoundImplies": "\u2970", "rpar": ")", "rpargt": "\u2994", "rppolint": "\u2A12", "rrarr": "\u21C9", "Rrightarrow": "\u21DB", "rsaquo": "\u203A", "rscr": "\u{1D4C7}", "Rscr": "\u211B", "rsh": "\u21B1", "Rsh": "\u21B1", "rsqb": "]", "rsquo": "\u2019", "rsquor": "\u2019", "rthree": "\u22CC", "rtimes": "\u22CA", "rtri": "\u25B9", "rtrie": "\u22B5", "rtrif": "\u25B8", "rtriltri": "\u29CE", "RuleDelayed": "\u29F4", "ruluhar": "\u2968", "rx": "\u211E", "sacute": "\u015B", "Sacute": "\u015A", "sbquo": "\u201A", "sc": "\u227B", "Sc": "\u2ABC", "scap": "\u2AB8", "scaron": "\u0161", "Scaron": "\u0160", "sccue": "\u227D", "sce": "\u2AB0", "scE": "\u2AB4", "scedil": "\u015F", "Scedil": "\u015E", "scirc": "\u015D", "Scirc": "\u015C", "scnap": "\u2ABA", "scnE": "\u2AB6", "scnsim": "\u22E9", "scpolint": "\u2A13", "scsim": "\u227F", "scy": "\u0441", "Scy": "\u0421", "sdot": "\u22C5", "sdotb": "\u22A1", "sdote": "\u2A66", "searhk": "\u2925", "searr": "\u2198", "seArr": "\u21D8", "searrow": "\u2198", "sect": "\xA7", "semi": ";", "seswar": "\u2929", "setminus": "\u2216", "setmn": "\u2216", "sext": "\u2736", "sfr": "\u{1D530}", "Sfr": "\u{1D516}", "sfrown": "\u2322", "sharp": "\u266F", "shchcy": "\u0449", "SHCHcy": "\u0429", "shcy": "\u0448", "SHcy": "\u0428", "ShortDownArrow": "\u2193", "ShortLeftArrow": "\u2190", "shortmid": "\u2223", "shortparallel": "\u2225", "ShortRightArrow": "\u2192", "ShortUpArrow": "\u2191", "shy": "\xAD", "sigma": "\u03C3", "Sigma": "\u03A3", "sigmaf": "\u03C2", "sigmav": "\u03C2", "sim": "\u223C", "simdot": "\u2A6A", "sime": "\u2243", "simeq": "\u2243", "simg": "\u2A9E", "simgE": "\u2AA0", "siml": "\u2A9D", "simlE": "\u2A9F", "simne": "\u2246", "simplus": "\u2A24", "simrarr": "\u2972", "slarr": "\u2190", "SmallCircle": "\u2218", "smallsetminus": "\u2216", "smashp": "\u2A33", "smeparsl": "\u29E4", "smid": "\u2223", "smile": "\u2323", "smt": "\u2AAA", "smte": "\u2AAC", "smtes": "\u2AAC\uFE00", "softcy": "\u044C", "SOFTcy": "\u042C", "sol": "/", "solb": "\u29C4", "solbar": "\u233F", "sopf": "\u{1D564}", "Sopf": "\u{1D54A}", "spades": "\u2660", "spadesuit": "\u2660", "spar": "\u2225", "sqcap": "\u2293", "sqcaps": "\u2293\uFE00", "sqcup": "\u2294", "sqcups": "\u2294\uFE00", "Sqrt": "\u221A", "sqsub": "\u228F", "sqsube": "\u2291", "sqsubset": "\u228F", "sqsubseteq": "\u2291", "sqsup": "\u2290", "sqsupe": "\u2292", "sqsupset": "\u2290", "sqsupseteq": "\u2292", "squ": "\u25A1", "square": "\u25A1", "Square": "\u25A1", "SquareIntersection": "\u2293", "SquareSubset": "\u228F", "SquareSubsetEqual": "\u2291", "SquareSuperset": "\u2290", "SquareSupersetEqual": "\u2292", "SquareUnion": "\u2294", "squarf": "\u25AA", "squf": "\u25AA", "srarr": "\u2192", "sscr": "\u{1D4C8}", "Sscr": "\u{1D4AE}", "ssetmn": "\u2216", "ssmile": "\u2323", "sstarf": "\u22C6", "star": "\u2606", "Star": "\u22C6", "starf": "\u2605", "straightepsilon": "\u03F5", "straightphi": "\u03D5", "strns": "\xAF", "sub": "\u2282", "Sub": "\u22D0", "subdot": "\u2ABD", "sube": "\u2286", "subE": "\u2AC5", "subedot": "\u2AC3", "submult": "\u2AC1", "subne": "\u228A", "subnE": "\u2ACB", "subplus": "\u2ABF", "subrarr": "\u2979", "subset": "\u2282", "Subset": "\u22D0", "subseteq": "\u2286", "subseteqq": "\u2AC5", "SubsetEqual": "\u2286", "subsetneq": "\u228A", "subsetneqq": "\u2ACB", "subsim": "\u2AC7", "subsub": "\u2AD5", "subsup": "\u2AD3", "succ": "\u227B", "succapprox": "\u2AB8", "succcurlyeq": "\u227D", "Succeeds": "\u227B", "SucceedsEqual": "\u2AB0", "SucceedsSlantEqual": "\u227D", "SucceedsTilde": "\u227F", "succeq": "\u2AB0", "succnapprox": "\u2ABA", "succneqq": "\u2AB6", "succnsim": "\u22E9", "succsim": "\u227F", "SuchThat": "\u220B", "sum": "\u2211", "Sum": "\u2211", "sung": "\u266A", "sup": "\u2283", "Sup": "\u22D1", "sup1": "\xB9", "sup2": "\xB2", "sup3": "\xB3", "supdot": "\u2ABE", "supdsub": "\u2AD8", "supe": "\u2287", "supE": "\u2AC6", "supedot": "\u2AC4", "Superset": "\u2283", "SupersetEqual": "\u2287", "suphsol": "\u27C9", "suphsub": "\u2AD7", "suplarr": "\u297B", "supmult": "\u2AC2", "supne": "\u228B", "supnE": "\u2ACC", "supplus": "\u2AC0", "supset": "\u2283", "Supset": "\u22D1", "supseteq": "\u2287", "supseteqq": "\u2AC6", "supsetneq": "\u228B", "supsetneqq": "\u2ACC", "supsim": "\u2AC8", "supsub": "\u2AD4", "supsup": "\u2AD6", "swarhk": "\u2926", "swarr": "\u2199", "swArr": "\u21D9", "swarrow": "\u2199", "swnwar": "\u292A", "szlig": "\xDF", "Tab": " ", "target": "\u2316", "tau": "\u03C4", "Tau": "\u03A4", "tbrk": "\u23B4", "tcaron": "\u0165", "Tcaron": "\u0164", "tcedil": "\u0163", "Tcedil": "\u0162", "tcy": "\u0442", "Tcy": "\u0422", "tdot": "\u20DB", "telrec": "\u2315", "tfr": "\u{1D531}", "Tfr": "\u{1D517}", "there4": "\u2234", "therefore": "\u2234", "Therefore": "\u2234", "theta": "\u03B8", "Theta": "\u0398", "thetasym": "\u03D1", "thetav": "\u03D1", "thickapprox": "\u2248", "thicksim": "\u223C", "ThickSpace": "\u205F\u200A", "thinsp": "\u2009", "ThinSpace": "\u2009", "thkap": "\u2248", "thksim": "\u223C", "thorn": "\xFE", "THORN": "\xDE", "tilde": "\u02DC", "Tilde": "\u223C", "TildeEqual": "\u2243", "TildeFullEqual": "\u2245", "TildeTilde": "\u2248", "times": "\xD7", "timesb": "\u22A0", "timesbar": "\u2A31", "timesd": "\u2A30", "tint": "\u222D", "toea": "\u2928", "top": "\u22A4", "topbot": "\u2336", "topcir": "\u2AF1", "topf": "\u{1D565}", "Topf": "\u{1D54B}", "topfork": "\u2ADA", "tosa": "\u2929", "tprime": "\u2034", "trade": "\u2122", "TRADE": "\u2122", "triangle": "\u25B5", "triangledown": "\u25BF", "triangleleft": "\u25C3", "trianglelefteq": "\u22B4", "triangleq": "\u225C", "triangleright": "\u25B9", "trianglerighteq": "\u22B5", "tridot": "\u25EC", "trie": "\u225C", "triminus": "\u2A3A", "TripleDot": "\u20DB", "triplus": "\u2A39", "trisb": "\u29CD", "tritime": "\u2A3B", "trpezium": "\u23E2", "tscr": "\u{1D4C9}", "Tscr": "\u{1D4AF}", "tscy": "\u0446", "TScy": "\u0426", "tshcy": "\u045B", "TSHcy": "\u040B", "tstrok": "\u0167", "Tstrok": "\u0166", "twixt": "\u226C", "twoheadleftarrow": "\u219E", "twoheadrightarrow": "\u21A0", "uacute": "\xFA", "Uacute": "\xDA", "uarr": "\u2191", "uArr": "\u21D1", "Uarr": "\u219F", "Uarrocir": "\u2949", "ubrcy": "\u045E", "Ubrcy": "\u040E", "ubreve": "\u016D", "Ubreve": "\u016C", "ucirc": "\xFB", "Ucirc": "\xDB", "ucy": "\u0443", "Ucy": "\u0423", "udarr": "\u21C5", "udblac": "\u0171", "Udblac": "\u0170", "udhar": "\u296E", "ufisht": "\u297E", "ufr": "\u{1D532}", "Ufr": "\u{1D518}", "ugrave": "\xF9", "Ugrave": "\xD9", "uHar": "\u2963", "uharl": "\u21BF", "uharr": "\u21BE", "uhblk": "\u2580", "ulcorn": "\u231C", "ulcorner": "\u231C", "ulcrop": "\u230F", "ultri": "\u25F8", "umacr": "\u016B", "Umacr": "\u016A", "uml": "\xA8", "UnderBar": "_", "UnderBrace": "\u23DF", "UnderBracket": "\u23B5", "UnderParenthesis": "\u23DD", "Union": "\u22C3", "UnionPlus": "\u228E", "uogon": "\u0173", "Uogon": "\u0172", "uopf": "\u{1D566}", "Uopf": "\u{1D54C}", "uparrow": "\u2191", "Uparrow": "\u21D1", "UpArrow": "\u2191", "UpArrowBar": "\u2912", "UpArrowDownArrow": "\u21C5", "updownarrow": "\u2195", "Updownarrow": "\u21D5", "UpDownArrow": "\u2195", "UpEquilibrium": "\u296E", "upharpoonleft": "\u21BF", "upharpoonright": "\u21BE", "uplus": "\u228E", "UpperLeftArrow": "\u2196", "UpperRightArrow": "\u2197", "upsi": "\u03C5", "Upsi": "\u03D2", "upsih": "\u03D2", "upsilon": "\u03C5", "Upsilon": "\u03A5", "UpTee": "\u22A5", "UpTeeArrow": "\u21A5", "upuparrows": "\u21C8", "urcorn": "\u231D", "urcorner": "\u231D", "urcrop": "\u230E", "uring": "\u016F", "Uring": "\u016E", "urtri": "\u25F9", "uscr": "\u{1D4CA}", "Uscr": "\u{1D4B0}", "utdot": "\u22F0", "utilde": "\u0169", "Utilde": "\u0168", "utri": "\u25B5", "utrif": "\u25B4", "uuarr": "\u21C8", "uuml": "\xFC", "Uuml": "\xDC", "uwangle": "\u29A7", "vangrt": "\u299C", "varepsilon": "\u03F5", "varkappa": "\u03F0", "varnothing": "\u2205", "varphi": "\u03D5", "varpi": "\u03D6", "varpropto": "\u221D", "varr": "\u2195", "vArr": "\u21D5", "varrho": "\u03F1", "varsigma": "\u03C2", "varsubsetneq": "\u228A\uFE00", "varsubsetneqq": "\u2ACB\uFE00", "varsupsetneq": "\u228B\uFE00", "varsupsetneqq": "\u2ACC\uFE00", "vartheta": "\u03D1", "vartriangleleft": "\u22B2", "vartriangleright": "\u22B3", "vBar": "\u2AE8", "Vbar": "\u2AEB", "vBarv": "\u2AE9", "vcy": "\u0432", "Vcy": "\u0412", "vdash": "\u22A2", "vDash": "\u22A8", "Vdash": "\u22A9", "VDash": "\u22AB", "Vdashl": "\u2AE6", "vee": "\u2228", "Vee": "\u22C1", "veebar": "\u22BB", "veeeq": "\u225A", "vellip": "\u22EE", "verbar": "|", "Verbar": "\u2016", "vert": "|", "Vert": "\u2016", "VerticalBar": "\u2223", "VerticalLine": "|", "VerticalSeparator": "\u2758", "VerticalTilde": "\u2240", "VeryThinSpace": "\u200A", "vfr": "\u{1D533}", "Vfr": "\u{1D519}", "vltri": "\u22B2", "vnsub": "\u2282\u20D2", "vnsup": "\u2283\u20D2", "vopf": "\u{1D567}", "Vopf": "\u{1D54D}", "vprop": "\u221D", "vrtri": "\u22B3", "vscr": "\u{1D4CB}", "Vscr": "\u{1D4B1}", "vsubne": "\u228A\uFE00", "vsubnE": "\u2ACB\uFE00", "vsupne": "\u228B\uFE00", "vsupnE": "\u2ACC\uFE00", "Vvdash": "\u22AA", "vzigzag": "\u299A", "wcirc": "\u0175", "Wcirc": "\u0174", "wedbar": "\u2A5F", "wedge": "\u2227", "Wedge": "\u22C0", "wedgeq": "\u2259", "weierp": "\u2118", "wfr": "\u{1D534}", "Wfr": "\u{1D51A}", "wopf": "\u{1D568}", "Wopf": "\u{1D54E}", "wp": "\u2118", "wr": "\u2240", "wreath": "\u2240", "wscr": "\u{1D4CC}", "Wscr": "\u{1D4B2}", "xcap": "\u22C2", "xcirc": "\u25EF", "xcup": "\u22C3", "xdtri": "\u25BD", "xfr": "\u{1D535}", "Xfr": "\u{1D51B}", "xharr": "\u27F7", "xhArr": "\u27FA", "xi": "\u03BE", "Xi": "\u039E", "xlarr": "\u27F5", "xlArr": "\u27F8", "xmap": "\u27FC", "xnis": "\u22FB", "xodot": "\u2A00", "xopf": "\u{1D569}", "Xopf": "\u{1D54F}", "xoplus": "\u2A01", "xotime": "\u2A02", "xrarr": "\u27F6", "xrArr": "\u27F9", "xscr": "\u{1D4CD}", "Xscr": "\u{1D4B3}", "xsqcup": "\u2A06", "xuplus": "\u2A04", "xutri": "\u25B3", "xvee": "\u22C1", "xwedge": "\u22C0", "yacute": "\xFD", "Yacute": "\xDD", "yacy": "\u044F", "YAcy": "\u042F", "ycirc": "\u0177", "Ycirc": "\u0176", "ycy": "\u044B", "Ycy": "\u042B", "yen": "\xA5", "yfr": "\u{1D536}", "Yfr": "\u{1D51C}", "yicy": "\u0457", "YIcy": "\u0407", "yopf": "\u{1D56A}", "Yopf": "\u{1D550}", "yscr": "\u{1D4CE}", "Yscr": "\u{1D4B4}", "yucy": "\u044E", "YUcy": "\u042E", "yuml": "\xFF", "Yuml": "\u0178", "zacute": "\u017A", "Zacute": "\u0179", "zcaron": "\u017E", "Zcaron": "\u017D", "zcy": "\u0437", "Zcy": "\u0417", "zdot": "\u017C", "Zdot": "\u017B", "zeetrf": "\u2128", "ZeroWidthSpace": "\u200B", "zeta": "\u03B6", "Zeta": "\u0396", "zfr": "\u{1D537}", "Zfr": "\u2128", "zhcy": "\u0436", "ZHcy": "\u0416", "zigrarr": "\u21DD", "zopf": "\u{1D56B}", "Zopf": "\u2124", "zscr": "\u{1D4CF}", "Zscr": "\u{1D4B5}", "zwj": "\u200D", "zwnj": "\u200C" }; - var decodeMapLegacy = { "aacute": "\xE1", "Aacute": "\xC1", "acirc": "\xE2", "Acirc": "\xC2", "acute": "\xB4", "aelig": "\xE6", "AElig": "\xC6", "agrave": "\xE0", "Agrave": "\xC0", "amp": "&", "AMP": "&", "aring": "\xE5", "Aring": "\xC5", "atilde": "\xE3", "Atilde": "\xC3", "auml": "\xE4", "Auml": "\xC4", "brvbar": "\xA6", "ccedil": "\xE7", "Ccedil": "\xC7", "cedil": "\xB8", "cent": "\xA2", "copy": "\xA9", "COPY": "\xA9", "curren": "\xA4", "deg": "\xB0", "divide": "\xF7", "eacute": "\xE9", "Eacute": "\xC9", "ecirc": "\xEA", "Ecirc": "\xCA", "egrave": "\xE8", "Egrave": "\xC8", "eth": "\xF0", "ETH": "\xD0", "euml": "\xEB", "Euml": "\xCB", "frac12": "\xBD", "frac14": "\xBC", "frac34": "\xBE", "gt": ">", "GT": ">", "iacute": "\xED", "Iacute": "\xCD", "icirc": "\xEE", "Icirc": "\xCE", "iexcl": "\xA1", "igrave": "\xEC", "Igrave": "\xCC", "iquest": "\xBF", "iuml": "\xEF", "Iuml": "\xCF", "laquo": "\xAB", "lt": "<", "LT": "<", "macr": "\xAF", "micro": "\xB5", "middot": "\xB7", "nbsp": "\xA0", "not": "\xAC", "ntilde": "\xF1", "Ntilde": "\xD1", "oacute": "\xF3", "Oacute": "\xD3", "ocirc": "\xF4", "Ocirc": "\xD4", "ograve": "\xF2", "Ograve": "\xD2", "ordf": "\xAA", "ordm": "\xBA", "oslash": "\xF8", "Oslash": "\xD8", "otilde": "\xF5", "Otilde": "\xD5", "ouml": "\xF6", "Ouml": "\xD6", "para": "\xB6", "plusmn": "\xB1", "pound": "\xA3", "quot": '"', "QUOT": '"', "raquo": "\xBB", "reg": "\xAE", "REG": "\xAE", "sect": "\xA7", "shy": "\xAD", "sup1": "\xB9", "sup2": "\xB2", "sup3": "\xB3", "szlig": "\xDF", "thorn": "\xFE", "THORN": "\xDE", "times": "\xD7", "uacute": "\xFA", "Uacute": "\xDA", "ucirc": "\xFB", "Ucirc": "\xDB", "ugrave": "\xF9", "Ugrave": "\xD9", "uml": "\xA8", "uuml": "\xFC", "Uuml": "\xDC", "yacute": "\xFD", "Yacute": "\xDD", "yen": "\xA5", "yuml": "\xFF" }; - var decodeMapNumeric = { "0": "\uFFFD", "128": "\u20AC", "130": "\u201A", "131": "\u0192", "132": "\u201E", "133": "\u2026", "134": "\u2020", "135": "\u2021", "136": "\u02C6", "137": "\u2030", "138": "\u0160", "139": "\u2039", "140": "\u0152", "142": "\u017D", "145": "\u2018", "146": "\u2019", "147": "\u201C", "148": "\u201D", "149": "\u2022", "150": "\u2013", "151": "\u2014", "152": "\u02DC", "153": "\u2122", "154": "\u0161", "155": "\u203A", "156": "\u0153", "158": "\u017E", "159": "\u0178" }; - var invalidReferenceCodePoints = [1, 2, 3, 4, 5, 6, 7, 8, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 64976, 64977, 64978, 64979, 64980, 64981, 64982, 64983, 64984, 64985, 64986, 64987, 64988, 64989, 64990, 64991, 64992, 64993, 64994, 64995, 64996, 64997, 64998, 64999, 65e3, 65001, 65002, 65003, 65004, 65005, 65006, 65007, 65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, 1048575, 1114110, 1114111]; - var stringFromCharCode = String.fromCharCode; - var object = {}; - var hasOwnProperty2 = object.hasOwnProperty; - var has = function(object2, propertyName) { - return hasOwnProperty2.call(object2, propertyName); - }; - var contains = function(array, value) { - var index = -1; - var length = array.length; - while (++index < length) { - if (array[index] == value) { - return true; - } - } - return false; - }; - var merge = function(options, defaults) { - if (!options) { - return defaults; - } - var result = {}; - var key3; - for (key3 in defaults) { - result[key3] = has(options, key3) ? options[key3] : defaults[key3]; - } - return result; - }; - var codePointToSymbol = function(codePoint, strict) { - var output = ""; - if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) { - if (strict) { - parseError("character reference outside the permissible Unicode range"); - } - return "\uFFFD"; - } - if (has(decodeMapNumeric, codePoint)) { - if (strict) { - parseError("disallowed character reference"); - } - return decodeMapNumeric[codePoint]; - } - if (strict && contains(invalidReferenceCodePoints, codePoint)) { - parseError("disallowed character reference"); - } - if (codePoint > 65535) { - codePoint -= 65536; - output += stringFromCharCode(codePoint >>> 10 & 1023 | 55296); - codePoint = 56320 | codePoint & 1023; - } - output += stringFromCharCode(codePoint); - return output; - }; - var hexEscape = function(codePoint) { - return "&#x" + codePoint.toString(16).toUpperCase() + ";"; - }; - var decEscape = function(codePoint) { - return "&#" + codePoint + ";"; - }; - var parseError = function(message) { - throw Error("Parse error: " + message); + var parseError = function(message) { + throw Error("Parse error: " + message); }; var encode = function(string, options) { options = merge(options, encode.options); @@ -6868,29083 +5726,23807 @@ var require_he = __commonJS({ } }); -// node_modules/react-is/cjs/react-is.development.js -var require_react_is_development = __commonJS({ - "node_modules/react-is/cjs/react-is.development.js"(exports) { - "use strict"; - if (true) { - (function() { - "use strict"; - var hasSymbol = typeof Symbol === "function" && Symbol.for; - var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; - var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; - var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; - var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; - var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; - var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; - var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; - var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; - var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; - var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; - var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; - var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; - var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; - var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; - var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; - var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; - var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; - function isValidElementType(type) { - return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); - } - function typeOf(object) { - if (typeof object === "object" && object !== null) { - var $$typeof = object.$$typeof; - switch ($$typeof) { - case REACT_ELEMENT_TYPE: - var type = object.type; - switch (type) { - case REACT_ASYNC_MODE_TYPE: - case REACT_CONCURRENT_MODE_TYPE: - case REACT_FRAGMENT_TYPE: - case REACT_PROFILER_TYPE: - case REACT_STRICT_MODE_TYPE: - case REACT_SUSPENSE_TYPE: - return type; - default: - var $$typeofType = type && type.$$typeof; - switch ($$typeofType) { - case REACT_CONTEXT_TYPE: - case REACT_FORWARD_REF_TYPE: - case REACT_LAZY_TYPE: - case REACT_MEMO_TYPE: - case REACT_PROVIDER_TYPE: - return $$typeofType; - default: - return $$typeof; - } - } - case REACT_PORTAL_TYPE: - return $$typeof; - } - } - return void 0; - } - var AsyncMode = REACT_ASYNC_MODE_TYPE; - var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; - var ContextConsumer = REACT_CONTEXT_TYPE; - var ContextProvider = REACT_PROVIDER_TYPE; - var Element = REACT_ELEMENT_TYPE; - var ForwardRef = REACT_FORWARD_REF_TYPE; - var Fragment = REACT_FRAGMENT_TYPE; - var Lazy = REACT_LAZY_TYPE; - var Memo = REACT_MEMO_TYPE; - var Portal = REACT_PORTAL_TYPE; - var Profiler = REACT_PROFILER_TYPE; - var StrictMode = REACT_STRICT_MODE_TYPE; - var Suspense = REACT_SUSPENSE_TYPE; - var hasWarnedAboutDeprecatedIsAsyncMode = false; - function isAsyncMode(object) { - { - if (!hasWarnedAboutDeprecatedIsAsyncMode) { - hasWarnedAboutDeprecatedIsAsyncMode = true; - console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); - } - } - return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; - } - function isConcurrentMode(object) { - return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; - } - function isContextConsumer(object) { - return typeOf(object) === REACT_CONTEXT_TYPE; - } - function isContextProvider(object) { - return typeOf(object) === REACT_PROVIDER_TYPE; - } - function isElement(object) { - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; - } - function isForwardRef(object) { - return typeOf(object) === REACT_FORWARD_REF_TYPE; - } - function isFragment(object) { - return typeOf(object) === REACT_FRAGMENT_TYPE; - } - function isLazy(object) { - return typeOf(object) === REACT_LAZY_TYPE; - } - function isMemo(object) { - return typeOf(object) === REACT_MEMO_TYPE; - } - function isPortal(object) { - return typeOf(object) === REACT_PORTAL_TYPE; - } - function isProfiler(object) { - return typeOf(object) === REACT_PROFILER_TYPE; - } - function isStrictMode(object) { - return typeOf(object) === REACT_STRICT_MODE_TYPE; - } - function isSuspense(object) { - return typeOf(object) === REACT_SUSPENSE_TYPE; - } - exports.AsyncMode = AsyncMode; - exports.ConcurrentMode = ConcurrentMode; - exports.ContextConsumer = ContextConsumer; - exports.ContextProvider = ContextProvider; - exports.Element = Element; - exports.ForwardRef = ForwardRef; - exports.Fragment = Fragment; - exports.Lazy = Lazy; - exports.Memo = Memo; - exports.Portal = Portal; - exports.Profiler = Profiler; - exports.StrictMode = StrictMode; - exports.Suspense = Suspense; - exports.isAsyncMode = isAsyncMode; - exports.isConcurrentMode = isConcurrentMode; - exports.isContextConsumer = isContextConsumer; - exports.isContextProvider = isContextProvider; - exports.isElement = isElement; - exports.isForwardRef = isForwardRef; - exports.isFragment = isFragment; - exports.isLazy = isLazy; - exports.isMemo = isMemo; - exports.isPortal = isPortal; - exports.isProfiler = isProfiler; - exports.isStrictMode = isStrictMode; - exports.isSuspense = isSuspense; - exports.isValidElementType = isValidElementType; - exports.typeOf = typeOf; - })(); - } - } -}); - -// node_modules/react-is/index.js -var require_react_is = __commonJS({ - "node_modules/react-is/index.js"(exports, module2) { - "use strict"; - if (false) { - module2.exports = null; - } else { - module2.exports = require_react_is_development(); - } - } -}); - -// node_modules/object-assign/index.js -var require_object_assign = __commonJS({ - "node_modules/object-assign/index.js"(exports, module2) { - "use strict"; - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var hasOwnProperty2 = Object.prototype.hasOwnProperty; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; - function toObject(val) { - if (val === null || val === void 0) { - throw new TypeError("Object.assign cannot be called with null or undefined"); - } - return Object(val); - } - function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - var test1 = new String("abc"); - test1[5] = "de"; - if (Object.getOwnPropertyNames(test1)[0] === "5") { - return false; - } - var test2 = {}; - for (var i4 = 0; i4 < 10; i4++) { - test2["_" + String.fromCharCode(i4)] = i4; - } - var order2 = Object.getOwnPropertyNames(test2).map(function(n2) { - return test2[n2]; - }); - if (order2.join("") !== "0123456789") { - return false; - } - var test3 = {}; - "abcdefghijklmnopqrst".split("").forEach(function(letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { - return false; - } - return true; - } catch (err) { - return false; - } - } - module2.exports = shouldUseNative() ? Object.assign : function(target, source) { - var from; - var to = toObject(target); - var symbols; - for (var s5 = 1; s5 < arguments.length; s5++) { - from = Object(arguments[s5]); - for (var key2 in from) { - if (hasOwnProperty2.call(from, key2)) { - to[key2] = from[key2]; - } - } - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i4 = 0; i4 < symbols.length; i4++) { - if (propIsEnumerable.call(from, symbols[i4])) { - to[symbols[i4]] = from[symbols[i4]]; +// node_modules/fuzzysort/fuzzysort.js +var require_fuzzysort = __commonJS({ + "node_modules/fuzzysort/fuzzysort.js"(exports, module2) { + ((root, UMD) => { + if (typeof define === "function" && define.amd) + define([], UMD); + else if (typeof module2 === "object" && module2.exports) + module2.exports = UMD(); + else + root["fuzzysort"] = UMD(); + })(exports, (_12) => { + "use strict"; + var single = (search, target) => { + if (search == "farzher") + return { target: "farzher was here (^-^*)/", score: 0, _indexes: [0] }; + if (!search || !target) + return NULL; + var preparedSearch = getPreparedSearch(search); + if (!isObj(target)) + target = getPrepared(target); + var searchBitflags = preparedSearch.bitflags; + if ((searchBitflags & target._bitflags) !== searchBitflags) + return NULL; + return algorithm(preparedSearch, target); + }; + var go = (search, targets, options) => { + if (search == "farzher") + return [{ target: "farzher was here (^-^*)/", score: 0, _indexes: [0], obj: targets ? targets[0] : NULL }]; + if (!search) + return options && options.all ? all(search, targets, options) : noResults; + var preparedSearch = getPreparedSearch(search); + var searchBitflags = preparedSearch.bitflags; + var containsSpace = preparedSearch.containsSpace; + var threshold = options && options.threshold || INT_MIN; + var limit = options && options["limit"] || INT_MAX; + var resultsLen = 0; + var limitedCount = 0; + var targetsLen = targets.length; + if (options && options.key) { + var key2 = options.key; + for (var i4 = 0; i4 < targetsLen; ++i4) { + var obj = targets[i4]; + var target = getValue(obj, key2); + if (!target) + continue; + if (!isObj(target)) + target = getPrepared(target); + if ((searchBitflags & target._bitflags) !== searchBitflags) + continue; + var result = algorithm(preparedSearch, target); + if (result === NULL) + continue; + if (result.score < threshold) + continue; + result = { target: result.target, _targetLower: "", _targetLowerCodes: NULL, _nextBeginningIndexes: NULL, _bitflags: 0, score: result.score, _indexes: result._indexes, obj }; + if (resultsLen < limit) { + q5.add(result); + ++resultsLen; + } else { + ++limitedCount; + if (result.score > q5.peek().score) + q5.replaceTop(result); } } - } - } - return to; - }; - } -}); - -// node_modules/prop-types/lib/ReactPropTypesSecret.js -var require_ReactPropTypesSecret = __commonJS({ - "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module2) { - "use strict"; - var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; - module2.exports = ReactPropTypesSecret; - } -}); - -// node_modules/prop-types/lib/has.js -var require_has = __commonJS({ - "node_modules/prop-types/lib/has.js"(exports, module2) { - module2.exports = Function.call.bind(Object.prototype.hasOwnProperty); - } -}); - -// node_modules/prop-types/checkPropTypes.js -var require_checkPropTypes = __commonJS({ - "node_modules/prop-types/checkPropTypes.js"(exports, module2) { - "use strict"; - var printWarning = function() { - }; - if (true) { - ReactPropTypesSecret = require_ReactPropTypesSecret(); - loggedTypeFailures = {}; - has = require_has(); - printWarning = function(text2) { - var message = "Warning: " + text2; - if (typeof console !== "undefined") { - console.error(message); - } - try { - throw new Error(message); - } catch (x5) { - } - }; - } - var ReactPropTypesSecret; - var loggedTypeFailures; - var has; - function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (true) { - for (var typeSpecName in typeSpecs) { - if (has(typeSpecs, typeSpecName)) { - var error; - try { - if (typeof typeSpecs[typeSpecName] !== "function") { - var err = Error( - (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." - ); - err.name = "Invariant Violation"; - throw err; + } else if (options && options.keys) { + var scoreFn = options["scoreFn"] || defaultScoreFn; + var keys = options.keys; + var keysLen = keys.length; + for (var i4 = 0; i4 < targetsLen; ++i4) { + var obj = targets[i4]; + var objResults = new Array(keysLen); + for (var keyI = 0; keyI < keysLen; ++keyI) { + var key2 = keys[keyI]; + var target = getValue(obj, key2); + if (!target) { + objResults[keyI] = NULL; + continue; } - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; + if (!isObj(target)) + target = getPrepared(target); + if ((searchBitflags & target._bitflags) !== searchBitflags) + objResults[keyI] = NULL; + else + objResults[keyI] = algorithm(preparedSearch, target); } - if (error && !(error instanceof Error)) { - printWarning( - (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." - ); + objResults.obj = obj; + var score = scoreFn(objResults); + if (score === NULL) + continue; + if (score < threshold) + continue; + objResults.score = score; + if (resultsLen < limit) { + q5.add(objResults); + ++resultsLen; + } else { + ++limitedCount; + if (score > q5.peek().score) + q5.replaceTop(objResults); } - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - loggedTypeFailures[error.message] = true; - var stack = getStack ? getStack() : ""; - printWarning( - "Failed " + location + " type: " + error.message + (stack != null ? stack : "") - ); + } + } else { + for (var i4 = 0; i4 < targetsLen; ++i4) { + var target = targets[i4]; + if (!target) + continue; + if (!isObj(target)) + target = getPrepared(target); + if ((searchBitflags & target._bitflags) !== searchBitflags) + continue; + var result = algorithm(preparedSearch, target); + if (result === NULL) + continue; + if (result.score < threshold) + continue; + if (resultsLen < limit) { + q5.add(result); + ++resultsLen; + } else { + ++limitedCount; + if (result.score > q5.peek().score) + q5.replaceTop(result); } } } - } - } - checkPropTypes.resetWarningCache = function() { - if (true) { - loggedTypeFailures = {}; - } - }; - module2.exports = checkPropTypes; - } -}); - -// node_modules/prop-types/factoryWithTypeCheckers.js -var require_factoryWithTypeCheckers = __commonJS({ - "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module2) { - "use strict"; - var ReactIs = require_react_is(); - var assign2 = require_object_assign(); - var ReactPropTypesSecret = require_ReactPropTypesSecret(); - var has = require_has(); - var checkPropTypes = require_checkPropTypes(); - var printWarning = function() { - }; - if (true) { - printWarning = function(text2) { - var message = "Warning: " + text2; - if (typeof console !== "undefined") { - console.error(message); - } - try { - throw new Error(message); - } catch (x5) { - } + if (resultsLen === 0) + return noResults; + var results = new Array(resultsLen); + for (var i4 = resultsLen - 1; i4 >= 0; --i4) + results[i4] = q5.poll(); + results.total = resultsLen + limitedCount; + return results; }; - } - function emptyFunctionThatReturnsNull() { - return null; - } - module2.exports = function(isValidElement, throwOnDirectAccess) { - var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === "function") { - return iteratorFn; + var highlight = (result, hOpen, hClose) => { + if (typeof hOpen === "function") + return highlightCallback(result, hOpen); + if (result === NULL) + return NULL; + if (hOpen === void 0) + hOpen = ""; + if (hClose === void 0) + hClose = ""; + var highlighted = ""; + var matchesIndex = 0; + var opened = false; + var target = result.target; + var targetLen = target.length; + var indexes2 = result._indexes; + indexes2 = indexes2.slice(0, indexes2.len).sort((a5, b4) => a5 - b4); + for (var i4 = 0; i4 < targetLen; ++i4) { + var char = target[i4]; + if (indexes2[matchesIndex] === i4) { + ++matchesIndex; + if (!opened) { + opened = true; + highlighted += hOpen; + } + if (matchesIndex === indexes2.length) { + highlighted += char + hClose + target.substr(i4 + 1); + break; + } + } else { + if (opened) { + opened = false; + highlighted += hClose; + } + } + highlighted += char; } - } - var ANONYMOUS = "<>"; - var ReactPropTypes = { - array: createPrimitiveTypeChecker("array"), - bigint: createPrimitiveTypeChecker("bigint"), - bool: createPrimitiveTypeChecker("boolean"), - func: createPrimitiveTypeChecker("function"), - number: createPrimitiveTypeChecker("number"), - object: createPrimitiveTypeChecker("object"), - string: createPrimitiveTypeChecker("string"), - symbol: createPrimitiveTypeChecker("symbol"), - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - elementType: createElementTypeTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker + return highlighted; }; - function is(x5, y5) { - if (x5 === y5) { - return x5 !== 0 || 1 / x5 === 1 / y5; - } else { - return x5 !== x5 && y5 !== y5; - } - } - function PropTypeError(message, data2) { - this.message = message; - this.data = data2 && typeof data2 === "object" ? data2 : {}; - this.stack = ""; - } - PropTypeError.prototype = Error.prototype; - function createChainableTypeChecker(validate) { - if (true) { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props2, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - var err = new Error( - "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" - ); - err.name = "Invariant Violation"; - throw err; - } else if (typeof console !== "undefined") { - var cacheKey = componentName + ":" + propName; - if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { - printWarning( - "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } + var highlightCallback = (result, cb) => { + if (result === NULL) + return NULL; + var target = result.target; + var targetLen = target.length; + var indexes2 = result._indexes; + indexes2 = indexes2.slice(0, indexes2.len).sort((a5, b4) => a5 - b4); + var highlighted = ""; + var matchI = 0; + var indexesI = 0; + var opened = false; + var result = []; + for (var i4 = 0; i4 < targetLen; ++i4) { + var char = target[i4]; + if (indexes2[indexesI] === i4) { + ++indexesI; + if (!opened) { + opened = true; + result.push(highlighted); + highlighted = ""; } - } - if (props2[propName] == null) { - if (isRequired) { - if (props2[propName] === null) { - return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); - } - return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); + if (indexesI === indexes2.length) { + highlighted += char; + result.push(cb(highlighted, matchI++)); + highlighted = ""; + result.push(target.substr(i4 + 1)); + break; } - return null; } else { - return validate(props2, propName, componentName, location, propFullName); + if (opened) { + opened = false; + result.push(cb(highlighted, matchI++)); + highlighted = ""; + } } + highlighted += char; } - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - return chainedCheckType; - } - function createPrimitiveTypeChecker(expectedType) { - function validate(props2, propName, componentName, location, propFullName, secret) { - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - var preciseType = getPreciseType(propValue); - return new PropTypeError( - "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), - { expectedType } - ); + return result; + }; + var indexes = (result) => result._indexes.slice(0, result._indexes.len).sort((a5, b4) => a5 - b4); + var prepare = (target) => { + if (typeof target !== "string") + target = ""; + var info = prepareLowerInfo(target); + return { "target": target, _targetLower: info._lower, _targetLowerCodes: info.lowerCodes, _nextBeginningIndexes: NULL, _bitflags: info.bitflags, "score": NULL, _indexes: [0], "obj": NULL }; + }; + var prepareSearch = (search) => { + if (typeof search !== "string") + search = ""; + search = search.trim(); + var info = prepareLowerInfo(search); + var spaceSearches = []; + if (info.containsSpace) { + var searches = search.split(/\s+/); + searches = [...new Set(searches)]; + for (var i4 = 0; i4 < searches.length; i4++) { + if (searches[i4] === "") + continue; + var _info = prepareLowerInfo(searches[i4]); + spaceSearches.push({ lowerCodes: _info.lowerCodes, _lower: searches[i4].toLowerCase(), containsSpace: false }); } - return null; } - return createChainableTypeChecker(validate); - } - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunctionThatReturnsNull); - } - function createArrayOfTypeChecker(typeChecker) { - function validate(props2, propName, componentName, location, propFullName) { - if (typeof typeChecker !== "function") { - return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); - } - var propValue = props2[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); + return { lowerCodes: info.lowerCodes, bitflags: info.bitflags, containsSpace: info.containsSpace, _lower: info._lower, spaceSearches }; + }; + var getPrepared = (target) => { + if (target.length > 999) + return prepare(target); + var targetPrepared = preparedCache.get(target); + if (targetPrepared !== void 0) + return targetPrepared; + targetPrepared = prepare(target); + preparedCache.set(target, targetPrepared); + return targetPrepared; + }; + var getPreparedSearch = (search) => { + if (search.length > 999) + return prepareSearch(search); + var searchPrepared = preparedSearchCache.get(search); + if (searchPrepared !== void 0) + return searchPrepared; + searchPrepared = prepareSearch(search); + preparedSearchCache.set(search, searchPrepared); + return searchPrepared; + }; + var all = (search, targets, options) => { + var results = []; + results.total = targets.length; + var limit = options && options.limit || INT_MAX; + if (options && options.key) { + for (var i4 = 0; i4 < targets.length; i4++) { + var obj = targets[i4]; + var target = getValue(obj, options.key); + if (!target) + continue; + if (!isObj(target)) + target = getPrepared(target); + target.score = INT_MIN; + target._indexes.len = 0; + var result = target; + result = { target: result.target, _targetLower: "", _targetLowerCodes: NULL, _nextBeginningIndexes: NULL, _bitflags: 0, score: target.score, _indexes: NULL, obj }; + results.push(result); + if (results.length >= limit) + return results; } - for (var i4 = 0; i4 < propValue.length; i4++) { - var error = typeChecker(propValue, i4, componentName, location, propFullName + "[" + i4 + "]", ReactPropTypesSecret); - if (error instanceof Error) { - return error; + } else if (options && options.keys) { + for (var i4 = 0; i4 < targets.length; i4++) { + var obj = targets[i4]; + var objResults = new Array(options.keys.length); + for (var keyI = options.keys.length - 1; keyI >= 0; --keyI) { + var target = getValue(obj, options.keys[keyI]); + if (!target) { + objResults[keyI] = NULL; + continue; + } + if (!isObj(target)) + target = getPrepared(target); + target.score = INT_MIN; + target._indexes.len = 0; + objResults[keyI] = target; } + objResults.obj = obj; + objResults.score = INT_MIN; + results.push(objResults); + if (results.length >= limit) + return results; } - return null; - } - return createChainableTypeChecker(validate); - } - function createElementTypeChecker() { - function validate(props2, propName, componentName, location, propFullName) { - var propValue = props2[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); - } - return null; - } - return createChainableTypeChecker(validate); - } - function createElementTypeTypeChecker() { - function validate(props2, propName, componentName, location, propFullName) { - var propValue = props2[propName]; - if (!ReactIs.isValidElementType(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); + } else { + for (var i4 = 0; i4 < targets.length; i4++) { + var target = targets[i4]; + if (!target) + continue; + if (!isObj(target)) + target = getPrepared(target); + target.score = INT_MIN; + target._indexes.len = 0; + results.push(target); + if (results.length >= limit) + return results; } - return null; } - return createChainableTypeChecker(validate); - } - function createInstanceTypeChecker(expectedClass) { - function validate(props2, propName, componentName, location, propFullName) { - if (!(props2[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props2[propName]); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); + return results; + }; + var algorithm = (preparedSearch, prepared, allowSpaces = false) => { + if (allowSpaces === false && preparedSearch.containsSpace) + return algorithmSpaces(preparedSearch, prepared); + var searchLower = preparedSearch._lower; + var searchLowerCodes = preparedSearch.lowerCodes; + var searchLowerCode = searchLowerCodes[0]; + var targetLowerCodes = prepared._targetLowerCodes; + var searchLen = searchLowerCodes.length; + var targetLen = targetLowerCodes.length; + var searchI = 0; + var targetI = 0; + var matchesSimpleLen = 0; + for (; ; ) { + var isMatch2 = searchLowerCode === targetLowerCodes[targetI]; + if (isMatch2) { + matchesSimple[matchesSimpleLen++] = targetI; + ++searchI; + if (searchI === searchLen) + break; + searchLowerCode = searchLowerCodes[searchI]; } - return null; + ++targetI; + if (targetI >= targetLen) + return NULL; } - return createChainableTypeChecker(validate); - } - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - if (true) { - if (arguments.length > 1) { - printWarning( - "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." - ); + var searchI = 0; + var successStrict = false; + var matchesStrictLen = 0; + var nextBeginningIndexes = prepared._nextBeginningIndexes; + if (nextBeginningIndexes === NULL) + nextBeginningIndexes = prepared._nextBeginningIndexes = prepareNextBeginningIndexes(prepared.target); + var firstPossibleI = targetI = matchesSimple[0] === 0 ? 0 : nextBeginningIndexes[matchesSimple[0] - 1]; + var backtrackCount = 0; + if (targetI !== targetLen) + for (; ; ) { + if (targetI >= targetLen) { + if (searchI <= 0) + break; + ++backtrackCount; + if (backtrackCount > 200) + break; + --searchI; + var lastMatch = matchesStrict[--matchesStrictLen]; + targetI = nextBeginningIndexes[lastMatch]; } else { - printWarning("Invalid argument supplied to oneOf, expected an array."); + var isMatch2 = searchLowerCodes[searchI] === targetLowerCodes[targetI]; + if (isMatch2) { + matchesStrict[matchesStrictLen++] = targetI; + ++searchI; + if (searchI === searchLen) { + successStrict = true; + break; + } + ++targetI; + } else { + targetI = nextBeginningIndexes[targetI]; + } } } - return emptyFunctionThatReturnsNull; + var substringIndex = prepared._targetLower.indexOf(searchLower, matchesSimple[0]); + var isSubstring = ~substringIndex; + if (isSubstring && !successStrict) { + for (var i4 = 0; i4 < matchesSimpleLen; ++i4) + matchesSimple[i4] = substringIndex + i4; } - function validate(props2, propName, componentName, location, propFullName) { - var propValue = props2[propName]; - for (var i4 = 0; i4 < expectedValues.length; i4++) { - if (is(propValue, expectedValues[i4])) { - return null; - } + var isSubstringBeginning = false; + if (isSubstring) { + isSubstringBeginning = prepared._nextBeginningIndexes[substringIndex - 1] === substringIndex; + } + { + if (successStrict) { + var matchesBest = matchesStrict; + var matchesBestLen = matchesStrictLen; + } else { + var matchesBest = matchesSimple; + var matchesBestLen = matchesSimpleLen; } - var valuesString = JSON.stringify(expectedValues, function replacer(key2, value) { - var type = getPreciseType(value); - if (type === "symbol") { - return String(value); + var score = 0; + var extraMatchGroupCount = 0; + for (var i4 = 1; i4 < searchLen; ++i4) { + if (matchesBest[i4] - matchesBest[i4 - 1] !== 1) { + score -= matchesBest[i4]; + ++extraMatchGroupCount; } - return value; - }); - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); - } - return createChainableTypeChecker(validate); - } - function createObjectOfTypeChecker(typeChecker) { - function validate(props2, propName, componentName, location, propFullName) { - if (typeof typeChecker !== "function") { - return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); } - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== "object") { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); + var unmatchedDistance = matchesBest[searchLen - 1] - matchesBest[0] - (searchLen - 1); + score -= (12 + unmatchedDistance) * extraMatchGroupCount; + if (matchesBest[0] !== 0) + score -= matchesBest[0] * matchesBest[0] * 0.2; + if (!successStrict) { + score *= 1e3; + } else { + var uniqueBeginningIndexes = 1; + for (var i4 = nextBeginningIndexes[0]; i4 < targetLen; i4 = nextBeginningIndexes[i4]) + ++uniqueBeginningIndexes; + if (uniqueBeginningIndexes > 24) + score *= (uniqueBeginningIndexes - 24) * 10; } - for (var key2 in propValue) { - if (has(propValue, key2)) { - var error = typeChecker(propValue, key2, componentName, location, propFullName + "." + key2, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } + if (isSubstring) + score /= 1 + searchLen * searchLen * 1; + if (isSubstringBeginning) + score /= 1 + searchLen * searchLen * 1; + score -= targetLen - searchLen; + prepared.score = score; + for (var i4 = 0; i4 < matchesBestLen; ++i4) + prepared._indexes[i4] = matchesBest[i4]; + prepared._indexes.len = matchesBestLen; + return prepared; + } + }; + var algorithmSpaces = (preparedSearch, target) => { + var seen_indexes = /* @__PURE__ */ new Set(); + var score = 0; + var result = NULL; + var first_seen_index_last_search = 0; + var searches = preparedSearch.spaceSearches; + for (var i4 = 0; i4 < searches.length; ++i4) { + var search = searches[i4]; + result = algorithm(search, target); + if (result === NULL) + return NULL; + score += result.score; + if (result._indexes[0] < first_seen_index_last_search) { + score -= first_seen_index_last_search - result._indexes[0]; } - return null; + first_seen_index_last_search = result._indexes[0]; + for (var j4 = 0; j4 < result._indexes.len; ++j4) + seen_indexes.add(result._indexes[j4]); } - return createChainableTypeChecker(validate); - } - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0; - return emptyFunctionThatReturnsNull; + var allowSpacesResult = algorithm(preparedSearch, target, true); + if (allowSpacesResult !== NULL && allowSpacesResult.score > score) { + return allowSpacesResult; } - for (var i4 = 0; i4 < arrayOfTypeCheckers.length; i4++) { - var checker = arrayOfTypeCheckers[i4]; - if (typeof checker !== "function") { - printWarning( - "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i4 + "." - ); - return emptyFunctionThatReturnsNull; + result.score = score; + var i4 = 0; + for (let index of seen_indexes) + result._indexes[i4++] = index; + result._indexes.len = i4; + return result; + }; + var prepareLowerInfo = (str) => { + var strLen = str.length; + var lower = str.toLowerCase(); + var lowerCodes = []; + var bitflags = 0; + var containsSpace = false; + for (var i4 = 0; i4 < strLen; ++i4) { + var lowerCode = lowerCodes[i4] = lower.charCodeAt(i4); + if (lowerCode === 32) { + containsSpace = true; + continue; } + var bit = lowerCode >= 97 && lowerCode <= 122 ? lowerCode - 97 : lowerCode >= 48 && lowerCode <= 57 ? 26 : lowerCode <= 127 ? 30 : 31; + bitflags |= 1 << bit; } - function validate(props2, propName, componentName, location, propFullName) { - var expectedTypes = []; - for (var i5 = 0; i5 < arrayOfTypeCheckers.length; i5++) { - var checker2 = arrayOfTypeCheckers[i5]; - var checkerResult = checker2(props2, propName, componentName, location, propFullName, ReactPropTypesSecret); - if (checkerResult == null) { - return null; - } - if (checkerResult.data && has(checkerResult.data, "expectedType")) { - expectedTypes.push(checkerResult.data.expectedType); - } - } - var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; - return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); + return { lowerCodes, bitflags, containsSpace, _lower: lower }; + }; + var prepareBeginningIndexes = (target) => { + var targetLen = target.length; + var beginningIndexes = []; + var beginningIndexesLen = 0; + var wasUpper = false; + var wasAlphanum = false; + for (var i4 = 0; i4 < targetLen; ++i4) { + var targetCode = target.charCodeAt(i4); + var isUpper = targetCode >= 65 && targetCode <= 90; + var isAlphanum = isUpper || targetCode >= 97 && targetCode <= 122 || targetCode >= 48 && targetCode <= 57; + var isBeginning = isUpper && !wasUpper || !wasAlphanum || !isAlphanum; + wasUpper = isUpper; + wasAlphanum = isAlphanum; + if (isBeginning) + beginningIndexes[beginningIndexesLen++] = i4; } - return createChainableTypeChecker(validate); - } - function createNodeChecker() { - function validate(props2, propName, componentName, location, propFullName) { - if (!isNode2(props2[propName])) { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); + return beginningIndexes; + }; + var prepareNextBeginningIndexes = (target) => { + var targetLen = target.length; + var beginningIndexes = prepareBeginningIndexes(target); + var nextBeginningIndexes = []; + var lastIsBeginning = beginningIndexes[0]; + var lastIsBeginningI = 0; + for (var i4 = 0; i4 < targetLen; ++i4) { + if (lastIsBeginning > i4) { + nextBeginningIndexes[i4] = lastIsBeginning; + } else { + lastIsBeginning = beginningIndexes[++lastIsBeginningI]; + nextBeginningIndexes[i4] = lastIsBeginning === void 0 ? targetLen : lastIsBeginning; } - return null; } - return createChainableTypeChecker(validate); - } - function invalidValidatorError(componentName, location, propFullName, key2, type) { - return new PropTypeError( - (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key2 + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." - ); - } - function createShapeTypeChecker(shapeTypes) { - function validate(props2, propName, componentName, location, propFullName) { - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== "object") { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); - } - for (var key2 in shapeTypes) { - var checker = shapeTypes[key2]; - if (typeof checker !== "function") { - return invalidValidatorError(componentName, location, propFullName, key2, getPreciseType(checker)); - } - var error = checker(propValue, key2, componentName, location, propFullName + "." + key2, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; + return nextBeginningIndexes; + }; + var cleanup = () => { + preparedCache.clear(); + preparedSearchCache.clear(); + matchesSimple = []; + matchesStrict = []; + }; + var preparedCache = /* @__PURE__ */ new Map(); + var preparedSearchCache = /* @__PURE__ */ new Map(); + var matchesSimple = []; + var matchesStrict = []; + var defaultScoreFn = (a5) => { + var max3 = INT_MIN; + var len = a5.length; + for (var i4 = 0; i4 < len; ++i4) { + var result = a5[i4]; + if (result === NULL) + continue; + var score = result.score; + if (score > max3) + max3 = score; } - return createChainableTypeChecker(validate); - } - function createStrictShapeTypeChecker(shapeTypes) { - function validate(props2, propName, componentName, location, propFullName) { - var propValue = props2[propName]; - var propType = getPropType(propValue); - if (propType !== "object") { - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); - } - var allKeys = assign2({}, props2[propName], shapeTypes); - for (var key2 in allKeys) { - var checker = shapeTypes[key2]; - if (has(shapeTypes, key2) && typeof checker !== "function") { - return invalidValidatorError(componentName, location, propFullName, key2, getPreciseType(checker)); - } - if (!checker) { - return new PropTypeError( - "Invalid " + location + " `" + propFullName + "` key `" + key2 + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props2[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ") - ); - } - var error = checker(propValue, key2, componentName, location, propFullName + "." + key2, ReactPropTypesSecret); - if (error) { - return error; - } + if (max3 === INT_MIN) + return NULL; + return max3; + }; + var getValue = (obj, prop) => { + var tmp = obj[prop]; + if (tmp !== void 0) + return tmp; + var segs = prop; + if (!Array.isArray(prop)) + segs = prop.split("."); + var len = segs.length; + var i4 = -1; + while (obj && ++i4 < len) + obj = obj[segs[i4]]; + return obj; + }; + var isObj = (x5) => { + return typeof x5 === "object"; + }; + var INT_MAX = Infinity; + var INT_MIN = -INT_MAX; + var noResults = []; + noResults.total = 0; + var NULL = null; + var fastpriorityqueue = (r3) => { + var e4 = [], o3 = 0, a5 = {}, v3 = (r4) => { + for (var a6 = 0, v4 = e4[a6], c4 = 1; c4 < o3; ) { + var s5 = c4 + 1; + a6 = c4, s5 < o3 && e4[s5].score < e4[c4].score && (a6 = s5), e4[a6 - 1 >> 1] = e4[a6], c4 = 1 + (a6 << 1); } - return null; - } - return createChainableTypeChecker(validate); - } - function isNode2(propValue) { - switch (typeof propValue) { - case "number": - case "string": - case "undefined": - return true; - case "boolean": - return !propValue; - case "object": - if (Array.isArray(propValue)) { - return propValue.every(isNode2); + for (var f4 = a6 - 1 >> 1; a6 > 0 && v4.score < e4[f4].score; f4 = (a6 = f4) - 1 >> 1) + e4[a6] = e4[f4]; + e4[a6] = v4; + }; + return a5.add = (r4) => { + var a6 = o3; + e4[o3++] = r4; + for (var v4 = a6 - 1 >> 1; a6 > 0 && r4.score < e4[v4].score; v4 = (a6 = v4) - 1 >> 1) + e4[a6] = e4[v4]; + e4[a6] = r4; + }, a5.poll = (r4) => { + if (0 !== o3) { + var a6 = e4[0]; + return e4[0] = e4[--o3], v3(), a6; + } + }, a5.peek = (r4) => { + if (0 !== o3) + return e4[0]; + }, a5.replaceTop = (r4) => { + e4[0] = r4, v3(); + }, a5; + }; + var q5 = fastpriorityqueue(); + return { "single": single, "go": go, "highlight": highlight, "prepare": prepare, "indexes": indexes, "cleanup": cleanup }; + }); + } +}); + +// node_modules/classnames/index.js +var require_classnames = __commonJS({ + "node_modules/classnames/index.js"(exports, module2) { + (function() { + "use strict"; + var hasOwn2 = {}.hasOwnProperty; + var nativeCodeString = "[native code]"; + function classNames9() { + var classes = []; + for (var i4 = 0; i4 < arguments.length; i4++) { + var arg = arguments[i4]; + if (!arg) + continue; + var argType = typeof arg; + if (argType === "string" || argType === "number") { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames9.apply(null, arg); + if (inner) { + classes.push(inner); + } } - if (propValue === null || isValidElement(propValue)) { - return true; + } else if (argType === "object") { + if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) { + classes.push(arg.toString()); + continue; } - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode2(step.value)) { - return false; - } - } - } else { - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode2(entry[1])) { - return false; - } - } - } + for (var key2 in arg) { + if (hasOwn2.call(arg, key2) && arg[key2]) { + classes.push(key2); } - } else { - return false; } - return true; - default: - return false; - } - } - function isSymbol(propType, propValue) { - if (propType === "symbol") { - return true; - } - if (!propValue) { - return false; - } - if (propValue["@@toStringTag"] === "Symbol") { - return true; - } - if (typeof Symbol === "function" && propValue instanceof Symbol) { - return true; - } - return false; - } - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return "array"; - } - if (propValue instanceof RegExp) { - return "object"; - } - if (isSymbol(propType, propValue)) { - return "symbol"; - } - return propType; - } - function getPreciseType(propValue) { - if (typeof propValue === "undefined" || propValue === null) { - return "" + propValue; - } - var propType = getPropType(propValue); - if (propType === "object") { - if (propValue instanceof Date) { - return "date"; - } else if (propValue instanceof RegExp) { - return "regexp"; } } - return propType; - } - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case "array": - case "object": - return "an " + type; - case "boolean": - case "date": - case "regexp": - return "a " + type; - default: - return type; - } - } - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; + return classes.join(" "); } - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; - ReactPropTypes.PropTypes = ReactPropTypes; - return ReactPropTypes; - }; - } -}); - -// node_modules/prop-types/index.js -var require_prop_types = __commonJS({ - "node_modules/prop-types/index.js"(exports, module2) { - if (true) { - ReactIs = require_react_is(); - throwOnDirectAccess = true; - module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); - } else { - module2.exports = null(); - } - var ReactIs; - var throwOnDirectAccess; - } -}); - -// node_modules/attr-accept/dist/es/index.js -var require_es = __commonJS({ - "node_modules/attr-accept/dist/es/index.js"(exports) { - "use strict"; - exports.__esModule = true; - exports.default = function(file, acceptedFiles) { - if (file && acceptedFiles) { - var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(","); - var fileName = file.name || ""; - var mimeType = (file.type || "").toLowerCase(); - var baseMimeType = mimeType.replace(/\/.*$/, ""); - return acceptedFilesArray.some(function(type) { - var validType = type.trim().toLowerCase(); - if (validType.charAt(0) === ".") { - return fileName.toLowerCase().endsWith(validType); - } else if (validType.endsWith("/*")) { - return baseMimeType === validType.replace(/\/.*$/, ""); - } - return mimeType === validType; + if (typeof module2 !== "undefined" && module2.exports) { + classNames9.default = classNames9; + module2.exports = classNames9; + } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) { + define("classnames", [], function() { + return classNames9; }); + } else { + window.classNames = classNames9; } - return true; - }; - } -}); - -// node_modules/obsidian-dataview/lib/index.js -var require_lib = __commonJS({ - "node_modules/obsidian-dataview/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("obsidian"); - var getAPI2 = (app2) => { - var _a2; - if (app2) - return (_a2 = app2.plugins.plugins.dataview) === null || _a2 === void 0 ? void 0 : _a2.api; - else - return window["DataviewAPI"]; - }; - var isPluginEnabled = (app2) => app2.plugins.enabledPlugins.has("dataview"); - exports.getAPI = getAPI2; - exports.isPluginEnabled = isPluginEnabled; + })(); } }); -// node_modules/localforage/dist/localforage.js -var require_localforage = __commonJS({ - "node_modules/localforage/dist/localforage.js"(exports, module2) { - (function(f4) { - if (typeof exports === "object" && typeof module2 !== "undefined") { - module2.exports = f4(); - } else if (typeof define === "function" && define.amd) { - define([], f4); +// node_modules/tslib/tslib.js +var require_tslib = __commonJS({ + "node_modules/tslib/tslib.js"(exports, module2) { + var __extends4; + var __assign5; + var __rest3; + var __decorate2; + var __param2; + var __esDecorate2; + var __runInitializers2; + var __propKey2; + var __setFunctionName2; + var __metadata2; + var __awaiter2; + var __generator2; + var __exportStar2; + var __values2; + var __read2; + var __spread2; + var __spreadArrays2; + var __spreadArray3; + var __await2; + var __asyncGenerator2; + var __asyncDelegator2; + var __asyncValues2; + var __makeTemplateObject2; + var __importStar2; + var __importDefault2; + var __classPrivateFieldGet2; + var __classPrivateFieldSet2; + var __classPrivateFieldIn2; + var __createBinding2; + (function(factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function(exports2) { + factory(createExporter(root, createExporter(exports2))); + }); + } else if (typeof module2 === "object" && typeof module2.exports === "object") { + factory(createExporter(root, createExporter(module2.exports))); } else { - var g4; - if (typeof window !== "undefined") { - g4 = window; - } else if (typeof global !== "undefined") { - g4 = global; - } else if (typeof self !== "undefined") { - g4 = self; - } else { - g4 = this; + factory(createExporter(root)); + } + function createExporter(exports2, previous) { + if (exports2 !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports2, "__esModule", { value: true }); + } else { + exports2.__esModule = true; + } } - g4.localforage = f4(); + return function(id2, v3) { + return exports2[id2] = previous ? previous(id2, v3) : v3; + }; } - })(function() { - var define2, module3, exports2; - return function e4(t4, n2, r3) { - function s5(o4, u4) { - if (!n2[o4]) { - if (!t4[o4]) { - var a5 = typeof require == "function" && require; - if (!u4 && a5) - return a5(o4, true); - if (i4) - return i4(o4, true); - var f4 = new Error("Cannot find module '" + o4 + "'"); - throw f4.code = "MODULE_NOT_FOUND", f4; - } - var l3 = n2[o4] = { exports: {} }; - t4[o4][0].call(l3.exports, function(e5) { - var n3 = t4[o4][1][e5]; - return s5(n3 ? n3 : e5); - }, l3, l3.exports, e4, t4, n2, r3); + })(function(exporter) { + var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b4) { + d5.__proto__ = b4; + } || function(d5, b4) { + for (var p3 in b4) + if (Object.prototype.hasOwnProperty.call(b4, p3)) + d5[p3] = b4[p3]; + }; + __extends4 = function(d5, b4) { + if (typeof b4 !== "function" && b4 !== null) + throw new TypeError("Class extends value " + String(b4) + " is not a constructor or null"); + extendStatics(d5, b4); + function __() { + this.constructor = d5; + } + d5.prototype = b4 === null ? Object.create(b4) : (__.prototype = b4.prototype, new __()); + }; + __assign5 = Object.assign || function(t4) { + for (var s5, i4 = 1, n2 = arguments.length; i4 < n2; i4++) { + s5 = arguments[i4]; + for (var p3 in s5) + if (Object.prototype.hasOwnProperty.call(s5, p3)) + t4[p3] = s5[p3]; + } + return t4; + }; + __rest3 = function(s5, e4) { + var t4 = {}; + for (var p3 in s5) + if (Object.prototype.hasOwnProperty.call(s5, p3) && e4.indexOf(p3) < 0) + t4[p3] = s5[p3]; + if (s5 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i4 = 0, p3 = Object.getOwnPropertySymbols(s5); i4 < p3.length; i4++) { + if (e4.indexOf(p3[i4]) < 0 && Object.prototype.propertyIsEnumerable.call(s5, p3[i4])) + t4[p3[i4]] = s5[p3[i4]]; } - return n2[o4].exports; + return t4; + }; + __decorate2 = function(decorators, target, key2, desc) { + var c4 = arguments.length, r3 = c4 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d5; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r3 = Reflect.decorate(decorators, target, key2, desc); + else + for (var i4 = decorators.length - 1; i4 >= 0; i4--) + if (d5 = decorators[i4]) + r3 = (c4 < 3 ? d5(r3) : c4 > 3 ? d5(target, key2, r3) : d5(target, key2)) || r3; + return c4 > 3 && r3 && Object.defineProperty(target, key2, r3), r3; + }; + __param2 = function(paramIndex, decorator) { + return function(target, key2) { + decorator(target, key2, paramIndex); + }; + }; + __esDecorate2 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f4) { + if (f4 !== void 0 && typeof f4 !== "function") + throw new TypeError("Function expected"); + return f4; } - var i4 = typeof require == "function" && require; - for (var o3 = 0; o3 < r3.length; o3++) - s5(r3[o3]); - return s5; - }({ 1: [function(_dereq_, module4, exports3) { - (function(global2) { - "use strict"; - var Mutation = global2.MutationObserver || global2.WebKitMutationObserver; - var scheduleDrain; - { - if (Mutation) { - var called = 0; - var observer = new Mutation(nextTick); - var element = global2.document.createTextNode(""); - observer.observe(element, { - characterData: true - }); - scheduleDrain = function() { - element.data = called = ++called % 2; - }; - } else if (!global2.setImmediate && typeof global2.MessageChannel !== "undefined") { - var channel = new global2.MessageChannel(); - channel.port1.onmessage = nextTick; - scheduleDrain = function() { - channel.port2.postMessage(0); - }; - } else if ("document" in global2 && "onreadystatechange" in global2.document.createElement("script")) { - scheduleDrain = function() { - var scriptEl = global2.document.createElement("script"); - scriptEl.onreadystatechange = function() { - nextTick(); - scriptEl.onreadystatechange = null; - scriptEl.parentNode.removeChild(scriptEl); - scriptEl = null; - }; - global2.document.documentElement.appendChild(scriptEl); - }; - } else { - scheduleDrain = function() { - setTimeout(nextTick, 0); - }; - } + var kind = contextIn.kind, key2 = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _12, done = false; + for (var i4 = decorators.length - 1; i4 >= 0; i4--) { + var context = {}; + for (var p3 in contextIn) + context[p3] = p3 === "access" ? {} : contextIn[p3]; + for (var p3 in contextIn.access) + context.access[p3] = contextIn.access[p3]; + context.addInitializer = function(f4) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f4 || null)); + }; + var result = (0, decorators[i4])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key2], context); + if (kind === "accessor") { + if (result === void 0) + continue; + if (result === null || typeof result !== "object") + throw new TypeError("Object expected"); + if (_12 = accept(result.get)) + descriptor.get = _12; + if (_12 = accept(result.set)) + descriptor.set = _12; + if (_12 = accept(result.init)) + initializers.push(_12); + } else if (_12 = accept(result)) { + if (kind === "field") + initializers.push(_12); + else + descriptor[key2] = _12; } - var draining; - var queue = []; - function nextTick() { - draining = true; - var i4, oldQueue; - var len = queue.length; - while (len) { - oldQueue = queue; - queue = []; - i4 = -1; - while (++i4 < len) { - oldQueue[i4](); - } - len = queue.length; + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; + }; + __runInitializers2 = function(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i4 = 0; i4 < initializers.length; i4++) { + value = useValue ? initializers[i4].call(thisArg, value) : initializers[i4].call(thisArg); + } + return useValue ? value : void 0; + }; + __propKey2 = function(x5) { + return typeof x5 === "symbol" ? x5 : "".concat(x5); + }; + __setFunctionName2 = function(f4, name, prefix) { + if (typeof name === "symbol") + name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f4, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); + }; + __metadata2 = function(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); + }; + __awaiter2 = function(thisArg, _arguments, P4, generator) { + function adopt(value) { + return value instanceof P4 ? value : new P4(function(resolve) { + resolve(value); + }); + } + return new (P4 || (P4 = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e4) { + reject(e4); } - draining = false; } - module4.exports = immediate; - function immediate(task) { - if (queue.push(task) === 1 && !draining) { - scheduleDrain(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e4) { + reject(e4); } } - }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); - }, {}], 2: [function(_dereq_, module4, exports3) { - "use strict"; - var immediate = _dereq_(1); - function INTERNAL() { - } - var handlers = {}; - var REJECTED = ["REJECTED"]; - var FULFILLED = ["FULFILLED"]; - var PENDING = ["PENDING"]; - module4.exports = Promise2; - function Promise2(resolver) { - if (typeof resolver !== "function") { - throw new TypeError("resolver must be a function"); - } - this.state = PENDING; - this.queue = []; - this.outcome = void 0; - if (resolver !== INTERNAL) { - safelyResolveThenable(this, resolver); - } - } - Promise2.prototype["catch"] = function(onRejected) { - return this.then(null, onRejected); - }; - Promise2.prototype.then = function(onFulfilled, onRejected) { - if (typeof onFulfilled !== "function" && this.state === FULFILLED || typeof onRejected !== "function" && this.state === REJECTED) { - return this; - } - var promise = new this.constructor(INTERNAL); - if (this.state !== PENDING) { - var resolver = this.state === FULFILLED ? onFulfilled : onRejected; - unwrap(promise, resolver, this.outcome); - } else { - this.queue.push(new QueueItem(promise, onFulfilled, onRejected)); - } - return promise; - }; - function QueueItem(promise, onFulfilled, onRejected) { - this.promise = promise; - if (typeof onFulfilled === "function") { - this.onFulfilled = onFulfilled; - this.callFulfilled = this.otherCallFulfilled; - } - if (typeof onRejected === "function") { - this.onRejected = onRejected; - this.callRejected = this.otherCallRejected; + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + __generator2 = function(thisArg, body) { + var _12 = { label: 0, sent: function() { + if (t4[0] & 1) + throw t4[1]; + return t4[1]; + }, trys: [], ops: [] }, f4, y5, t4, g4; + return g4 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g4[Symbol.iterator] = function() { + return this; + }), g4; + function verb(n2) { + return function(v3) { + return step([n2, v3]); + }; } - QueueItem.prototype.callFulfilled = function(value) { - handlers.resolve(this.promise, value); - }; - QueueItem.prototype.otherCallFulfilled = function(value) { - unwrap(this.promise, this.onFulfilled, value); - }; - QueueItem.prototype.callRejected = function(value) { - handlers.reject(this.promise, value); - }; - QueueItem.prototype.otherCallRejected = function(value) { - unwrap(this.promise, this.onRejected, value); - }; - function unwrap(promise, func, value) { - immediate(function() { - var returnValue; + function step(op) { + if (f4) + throw new TypeError("Generator is already executing."); + while (g4 && (g4 = 0, op[0] && (_12 = 0)), _12) try { - returnValue = func(value); + if (f4 = 1, y5 && (t4 = op[0] & 2 ? y5["return"] : op[0] ? y5["throw"] || ((t4 = y5["return"]) && t4.call(y5), 0) : y5.next) && !(t4 = t4.call(y5, op[1])).done) + return t4; + if (y5 = 0, t4) + op = [op[0] & 2, t4.value]; + switch (op[0]) { + case 0: + case 1: + t4 = op; + break; + case 4: + _12.label++; + return { value: op[1], done: false }; + case 5: + _12.label++; + y5 = op[1]; + op = [0]; + continue; + case 7: + op = _12.ops.pop(); + _12.trys.pop(); + continue; + default: + if (!(t4 = _12.trys, t4 = t4.length > 0 && t4[t4.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _12 = 0; + continue; + } + if (op[0] === 3 && (!t4 || op[1] > t4[0] && op[1] < t4[3])) { + _12.label = op[1]; + break; + } + if (op[0] === 6 && _12.label < t4[1]) { + _12.label = t4[1]; + t4 = op; + break; + } + if (t4 && _12.label < t4[2]) { + _12.label = t4[2]; + _12.ops.push(op); + break; + } + if (t4[2]) + _12.ops.pop(); + _12.trys.pop(); + continue; + } + op = body.call(thisArg, _12); } catch (e4) { - return handlers.reject(promise, e4); - } - if (returnValue === promise) { - handlers.reject(promise, new TypeError("Cannot resolve promise with itself")); - } else { - handlers.resolve(promise, returnValue); + op = [6, e4]; + y5 = 0; + } finally { + f4 = t4 = 0; } - }); + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } - handlers.resolve = function(self2, value) { - var result = tryCatch(getThen, value); - if (result.status === "error") { - return handlers.reject(self2, result.value); - } - var thenable = result.value; - if (thenable) { - safelyResolveThenable(self2, thenable); - } else { - self2.state = FULFILLED; - self2.outcome = value; - var i4 = -1; - var len = self2.queue.length; - while (++i4 < len) { - self2.queue[i4].callFulfilled(value); - } - } - return self2; - }; - handlers.reject = function(self2, error) { - self2.state = REJECTED; - self2.outcome = error; - var i4 = -1; - var len = self2.queue.length; - while (++i4 < len) { - self2.queue[i4].callRejected(error); - } - return self2; - }; - function getThen(obj) { - var then = obj && obj.then; - if (obj && (typeof obj === "object" || typeof obj === "function") && typeof then === "function") { - return function appyThen() { - then.apply(obj, arguments); - }; - } + }; + __exportStar2 = function(m5, o3) { + for (var p3 in m5) + if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(o3, p3)) + __createBinding2(o3, m5, p3); + }; + __createBinding2 = Object.create ? function(o3, m5, k5, k22) { + if (k22 === void 0) + k22 = k5; + var desc = Object.getOwnPropertyDescriptor(m5, k5); + if (!desc || ("get" in desc ? !m5.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m5[k5]; + } }; } - function safelyResolveThenable(self2, thenable) { - var called = false; - function onError(value) { - if (called) { - return; - } - called = true; - handlers.reject(self2, value); - } - function onSuccess(value) { - if (called) { - return; + Object.defineProperty(o3, k22, desc); + } : function(o3, m5, k5, k22) { + if (k22 === void 0) + k22 = k5; + o3[k22] = m5[k5]; + }; + __values2 = function(o3) { + var s5 = typeof Symbol === "function" && Symbol.iterator, m5 = s5 && o3[s5], i4 = 0; + if (m5) + return m5.call(o3); + if (o3 && typeof o3.length === "number") + return { + next: function() { + if (o3 && i4 >= o3.length) + o3 = void 0; + return { value: o3 && o3[i4++], done: !o3 }; } - called = true; - handlers.resolve(self2, value); - } - function tryToUnwrap() { - thenable(onSuccess, onError); - } - var result = tryCatch(tryToUnwrap); - if (result.status === "error") { - onError(result.value); - } - } - function tryCatch(func, value) { - var out = {}; + }; + throw new TypeError(s5 ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + __read2 = function(o3, n2) { + var m5 = typeof Symbol === "function" && o3[Symbol.iterator]; + if (!m5) + return o3; + var i4 = m5.call(o3), r3, ar = [], e4; + try { + while ((n2 === void 0 || n2-- > 0) && !(r3 = i4.next()).done) + ar.push(r3.value); + } catch (error) { + e4 = { error }; + } finally { try { - out.value = func(value); - out.status = "success"; - } catch (e4) { - out.status = "error"; - out.value = e4; - } - return out; - } - Promise2.resolve = resolve; - function resolve(value) { - if (value instanceof this) { - return value; + if (r3 && !r3.done && (m5 = i4["return"])) + m5.call(i4); + } finally { + if (e4) + throw e4.error; } - return handlers.resolve(new this(INTERNAL), value); - } - Promise2.reject = reject; - function reject(reason) { - var promise = new this(INTERNAL); - return handlers.reject(promise, reason); } - Promise2.all = all; - function all(iterable) { - var self2 = this; - if (Object.prototype.toString.call(iterable) !== "[object Array]") { - return this.reject(new TypeError("must be an array")); - } - var len = iterable.length; - var called = false; - if (!len) { - return this.resolve([]); - } - var values = new Array(len); - var resolved = 0; - var i4 = -1; - var promise = new this(INTERNAL); - while (++i4 < len) { - allResolver(iterable[i4], i4); - } - return promise; - function allResolver(value, i5) { - self2.resolve(value).then(resolveFromAll, function(error) { - if (!called) { - called = true; - handlers.reject(promise, error); - } - }); - function resolveFromAll(outValue) { - values[i5] = outValue; - if (++resolved === len && !called) { - called = true; - handlers.resolve(promise, values); - } + return ar; + }; + __spread2 = function() { + for (var ar = [], i4 = 0; i4 < arguments.length; i4++) + ar = ar.concat(__read2(arguments[i4])); + return ar; + }; + __spreadArrays2 = function() { + for (var s5 = 0, i4 = 0, il = arguments.length; i4 < il; i4++) + s5 += arguments[i4].length; + for (var r3 = Array(s5), k5 = 0, i4 = 0; i4 < il; i4++) + for (var a5 = arguments[i4], j4 = 0, jl = a5.length; j4 < jl; j4++, k5++) + r3[k5] = a5[j4]; + return r3; + }; + __spreadArray3 = function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i4 = 0, l3 = from.length, ar; i4 < l3; i4++) { + if (ar || !(i4 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i4); + ar[i4] = from[i4]; } } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + __await2 = function(v3) { + return this instanceof __await2 ? (this.v = v3, this) : new __await2(v3); + }; + __asyncGenerator2 = function(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g4 = generator.apply(thisArg, _arguments || []), i4, q5 = []; + return i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { + return this; + }, i4; + function verb(n2) { + if (g4[n2]) + i4[n2] = function(v3) { + return new Promise(function(a5, b4) { + q5.push([n2, v3, a5, b4]) > 1 || resume(n2, v3); + }); + }; } - Promise2.race = race; - function race(iterable) { - var self2 = this; - if (Object.prototype.toString.call(iterable) !== "[object Array]") { - return this.reject(new TypeError("must be an array")); - } - var len = iterable.length; - var called = false; - if (!len) { - return this.resolve([]); - } - var i4 = -1; - var promise = new this(INTERNAL); - while (++i4 < len) { - resolver(iterable[i4]); - } - return promise; - function resolver(value) { - self2.resolve(value).then(function(response) { - if (!called) { - called = true; - handlers.resolve(promise, response); - } - }, function(error) { - if (!called) { - called = true; - handlers.reject(promise, error); - } - }); - } - } - }, { "1": 1 }], 3: [function(_dereq_, module4, exports3) { - (function(global2) { - "use strict"; - if (typeof global2.Promise !== "function") { - global2.Promise = _dereq_(2); - } - }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); - }, { "2": 2 }], 4: [function(_dereq_, module4, exports3) { - "use strict"; - var _typeof5 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { - return typeof obj; - } : function(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function getIDB() { + function resume(n2, v3) { try { - if (typeof indexedDB !== "undefined") { - return indexedDB; - } - if (typeof webkitIndexedDB !== "undefined") { - return webkitIndexedDB; - } - if (typeof mozIndexedDB !== "undefined") { - return mozIndexedDB; - } - if (typeof OIndexedDB !== "undefined") { - return OIndexedDB; - } - if (typeof msIndexedDB !== "undefined") { - return msIndexedDB; - } + step(g4[n2](v3)); } catch (e4) { - return; + settle(q5[0][3], e4); } } - var idb = getIDB(); - function isIndexedDBValid() { - try { - if (!idb || !idb.open) { - return false; - } - var isSafari = typeof openDatabase !== "undefined" && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform); - var hasFetch = typeof fetch === "function" && fetch.toString().indexOf("[native code") !== -1; - return (!isSafari || hasFetch) && typeof indexedDB !== "undefined" && typeof IDBKeyRange !== "undefined"; - } catch (e4) { - return false; - } + function step(r3) { + r3.value instanceof __await2 ? Promise.resolve(r3.value.v).then(fulfill, reject) : settle(q5[0][2], r3); } - function createBlob(parts, properties2) { - parts = parts || []; - properties2 = properties2 || {}; - try { - return new Blob(parts, properties2); - } catch (e4) { - if (e4.name !== "TypeError") { - throw e4; - } - var Builder = typeof BlobBuilder !== "undefined" ? BlobBuilder : typeof MSBlobBuilder !== "undefined" ? MSBlobBuilder : typeof MozBlobBuilder !== "undefined" ? MozBlobBuilder : WebKitBlobBuilder; - var builder = new Builder(); - for (var i4 = 0; i4 < parts.length; i4 += 1) { - builder.append(parts[i4]); - } - return builder.getBlob(properties2.type); - } + function fulfill(value) { + resume("next", value); } - if (typeof Promise === "undefined") { - _dereq_(3); + function reject(value) { + resume("throw", value); } - var Promise$1 = Promise; - function executeCallback(promise, callback) { - if (callback) { - promise.then(function(result) { - callback(null, result); - }, function(error) { - callback(error); - }); - } + function settle(f4, v3) { + if (f4(v3), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); } - function executeTwoCallbacks(promise, callback, errorCallback) { - if (typeof callback === "function") { - promise.then(callback); - } - if (typeof errorCallback === "function") { - promise["catch"](errorCallback); - } + }; + __asyncDelegator2 = function(o3) { + var i4, p3; + return i4 = {}, verb("next"), verb("throw", function(e4) { + throw e4; + }), verb("return"), i4[Symbol.iterator] = function() { + return this; + }, i4; + function verb(n2, f4) { + i4[n2] = o3[n2] ? function(v3) { + return (p3 = !p3) ? { value: __await2(o3[n2](v3)), done: false } : f4 ? f4(v3) : v3; + } : f4; } - function normalizeKey(key3) { - if (typeof key3 !== "string") { - console.warn(key3 + " used as a key, but it is not a string."); - key3 = String(key3); - } - return key3; + }; + __asyncValues2 = function(o3) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m5 = o3[Symbol.asyncIterator], i4; + return m5 ? m5.call(o3) : (o3 = typeof __values2 === "function" ? __values2(o3) : o3[Symbol.iterator](), i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { + return this; + }, i4); + function verb(n2) { + i4[n2] = o3[n2] && function(v3) { + return new Promise(function(resolve, reject) { + v3 = o3[n2](v3), settle(resolve, reject, v3.done, v3.value); + }); + }; } - function getCallback() { - if (arguments.length && typeof arguments[arguments.length - 1] === "function") { - return arguments[arguments.length - 1]; - } + function settle(resolve, reject, d5, v3) { + Promise.resolve(v3).then(function(v4) { + resolve({ value: v4, done: d5 }); + }, reject); } - var DETECT_BLOB_SUPPORT_STORE = "local-forage-detect-blob-support"; - var supportsBlobs = void 0; - var dbContexts = {}; - var toString3 = Object.prototype.toString; - var READ_ONLY = "readonly"; - var READ_WRITE = "readwrite"; - function _binStringToArrayBuffer(bin) { - var length2 = bin.length; - var buf = new ArrayBuffer(length2); - var arr = new Uint8Array(buf); - for (var i4 = 0; i4 < length2; i4++) { - arr[i4] = bin.charCodeAt(i4); - } - return buf; + }; + __makeTemplateObject2 = function(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; } - function _checkBlobSupportWithoutCaching(idb2) { - return new Promise$1(function(resolve) { - var txn = idb2.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE); - var blob = createBlob([""]); - txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, "key"); - txn.onabort = function(e4) { - e4.preventDefault(); - e4.stopPropagation(); - resolve(false); - }; - txn.oncomplete = function() { - var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/); - var matchedEdge = navigator.userAgent.match(/Edge\//); - resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43); - }; - })["catch"](function() { - return false; - }); + return cooked; + }; + var __setModuleDefault = Object.create ? function(o3, v3) { + Object.defineProperty(o3, "default", { enumerable: true, value: v3 }); + } : function(o3, v3) { + o3["default"] = v3; + }; + __importStar2 = function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k5 in mod) + if (k5 !== "default" && Object.prototype.hasOwnProperty.call(mod, k5)) + __createBinding2(result, mod, k5); } - function _checkBlobSupport(idb2) { - if (typeof supportsBlobs === "boolean") { - return Promise$1.resolve(supportsBlobs); - } - return _checkBlobSupportWithoutCaching(idb2).then(function(value) { - supportsBlobs = value; - return supportsBlobs; - }); + __setModuleDefault(result, mod); + return result; + }; + __importDefault2 = function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + __classPrivateFieldGet2 = function(receiver, state, kind, f4) { + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state.get(receiver); + }; + __classPrivateFieldSet2 = function(receiver, state, value, kind, f4) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f4 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state.set(receiver, value), value; + }; + __classPrivateFieldIn2 = function(state, receiver) { + if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") + throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); + }; + exporter("__extends", __extends4); + exporter("__assign", __assign5); + exporter("__rest", __rest3); + exporter("__decorate", __decorate2); + exporter("__param", __param2); + exporter("__esDecorate", __esDecorate2); + exporter("__runInitializers", __runInitializers2); + exporter("__propKey", __propKey2); + exporter("__setFunctionName", __setFunctionName2); + exporter("__metadata", __metadata2); + exporter("__awaiter", __awaiter2); + exporter("__generator", __generator2); + exporter("__exportStar", __exportStar2); + exporter("__createBinding", __createBinding2); + exporter("__values", __values2); + exporter("__read", __read2); + exporter("__spread", __spread2); + exporter("__spreadArrays", __spreadArrays2); + exporter("__spreadArray", __spreadArray3); + exporter("__await", __await2); + exporter("__asyncGenerator", __asyncGenerator2); + exporter("__asyncDelegator", __asyncDelegator2); + exporter("__asyncValues", __asyncValues2); + exporter("__makeTemplateObject", __makeTemplateObject2); + exporter("__importStar", __importStar2); + exporter("__importDefault", __importDefault2); + exporter("__classPrivateFieldGet", __classPrivateFieldGet2); + exporter("__classPrivateFieldSet", __classPrivateFieldSet2); + exporter("__classPrivateFieldIn", __classPrivateFieldIn2); + }); + } +}); + +// node_modules/react-is/cjs/react-is.development.js +var require_react_is_development = __commonJS({ + "node_modules/react-is/cjs/react-is.development.js"(exports) { + "use strict"; + if (true) { + (function() { + "use strict"; + var hasSymbol = typeof Symbol === "function" && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; + function isValidElementType(type) { + return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } - function _deferReadiness(dbInfo) { - var dbContext = dbContexts[dbInfo.name]; - var deferredOperation = {}; - deferredOperation.promise = new Promise$1(function(resolve, reject) { - deferredOperation.resolve = resolve; - deferredOperation.reject = reject; - }); - dbContext.deferredOperations.push(deferredOperation); - if (!dbContext.dbReady) { - dbContext.dbReady = deferredOperation.promise; - } else { - dbContext.dbReady = dbContext.dbReady.then(function() { - return deferredOperation.promise; - }); + function typeOf(object) { + if (typeof object === "object" && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } } + return void 0; } - function _advanceReadiness(dbInfo) { - var dbContext = dbContexts[dbInfo.name]; - var deferredOperation = dbContext.deferredOperations.pop(); - if (deferredOperation) { - deferredOperation.resolve(); - return deferredOperation.promise; + var AsyncMode = REACT_ASYNC_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); + } } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } - function _rejectReadiness(dbInfo, err) { - var dbContext = dbContexts[dbInfo.name]; - var deferredOperation = dbContext.deferredOperations.pop(); - if (deferredOperation) { - deferredOperation.reject(err); - return deferredOperation.promise; - } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } - function _getConnection(dbInfo, upgradeNeeded) { - return new Promise$1(function(resolve, reject) { - dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext(); - if (dbInfo.db) { - if (upgradeNeeded) { - _deferReadiness(dbInfo); - dbInfo.db.close(); - } else { - return resolve(dbInfo.db); - } - } - var dbArgs = [dbInfo.name]; - if (upgradeNeeded) { - dbArgs.push(dbInfo.version); - } - var openreq = idb.open.apply(idb, dbArgs); - if (upgradeNeeded) { - openreq.onupgradeneeded = function(e4) { - var db = openreq.result; - try { - db.createObjectStore(dbInfo.storeName); - if (e4.oldVersion <= 1) { - db.createObjectStore(DETECT_BLOB_SUPPORT_STORE); - } - } catch (ex) { - if (ex.name === "ConstraintError") { - console.warn('The database "' + dbInfo.name + '" has been upgraded from version ' + e4.oldVersion + " to version " + e4.newVersion + ', but the storage "' + dbInfo.storeName + '" already exists.'); - } else { - throw ex; - } - } - }; - } - openreq.onerror = function(e4) { - e4.preventDefault(); - reject(openreq.error); - }; - openreq.onsuccess = function() { - var db = openreq.result; - db.onversionchange = function(e4) { - e4.target.close(); - }; - resolve(db); - _advanceReadiness(dbInfo); - }; - }); + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; } - function _getOriginalConnection(dbInfo) { - return _getConnection(dbInfo, false); + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; } - function _getUpgradedConnection(dbInfo) { - return _getConnection(dbInfo, true); + function isElement(object) { + return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } - function _isUpgradeNeeded(dbInfo, defaultVersion) { - if (!dbInfo.db) { - return true; - } - var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName); - var isDowngrade = dbInfo.version < dbInfo.db.version; - var isUpgrade = dbInfo.version > dbInfo.db.version; - if (isDowngrade) { - if (dbInfo.version !== defaultVersion) { - console.warn('The database "' + dbInfo.name + `" can't be downgraded from version ` + dbInfo.db.version + " to version " + dbInfo.version + "."); - } - dbInfo.version = dbInfo.db.version; - } - if (isUpgrade || isNewStore) { - if (isNewStore) { - var incVersion = dbInfo.db.version + 1; - if (incVersion > dbInfo.version) { - dbInfo.version = incVersion; - } - } - return true; - } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal; + exports.Profiler = Profiler; + exports.StrictMode = StrictMode; + exports.Suspense = Suspense; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isLazy = isLazy; + exports.isMemo = isMemo; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; + })(); + } + } +}); + +// node_modules/react-is/index.js +var require_react_is = __commonJS({ + "node_modules/react-is/index.js"(exports, module2) { + "use strict"; + if (false) { + module2.exports = null; + } else { + module2.exports = require_react_is_development(); + } + } +}); + +// node_modules/object-assign/index.js +var require_object_assign = __commonJS({ + "node_modules/object-assign/index.js"(exports, module2) { + "use strict"; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty2 = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === void 0) { + throw new TypeError("Object.assign cannot be called with null or undefined"); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { return false; } - function _encodeBlob(blob) { - return new Promise$1(function(resolve, reject) { - var reader = new FileReader(); - reader.onerror = reject; - reader.onloadend = function(e4) { - var base64 = btoa(e4.target.result || ""); - resolve({ - __local_forage_encoded_blob: true, - data: base64, - type: blob.type - }); - }; - reader.readAsBinaryString(blob); - }); + var test1 = new String("abc"); + test1[5] = "de"; + if (Object.getOwnPropertyNames(test1)[0] === "5") { + return false; } - function _decodeBlob(encodedBlob) { - var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data)); - return createBlob([arrayBuff], { type: encodedBlob.type }); + var test2 = {}; + for (var i4 = 0; i4 < 10; i4++) { + test2["_" + String.fromCharCode(i4)] = i4; } - function _isEncodedBlob(value) { - return value && value.__local_forage_encoded_blob; + var order2 = Object.getOwnPropertyNames(test2).map(function(n2) { + return test2[n2]; + }); + if (order2.join("") !== "0123456789") { + return false; } - function _fullyReady(callback) { - var self2 = this; - var promise = self2._initReady().then(function() { - var dbContext = dbContexts[self2._dbInfo.name]; - if (dbContext && dbContext.dbReady) { - return dbContext.dbReady; - } - }); - executeTwoCallbacks(promise, callback, callback); - return promise; + var test3 = {}; + "abcdefghijklmnopqrst".split("").forEach(function(letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { + return false; } - function _tryReconnect(dbInfo) { - _deferReadiness(dbInfo); - var dbContext = dbContexts[dbInfo.name]; - var forages = dbContext.forages; - for (var i4 = 0; i4 < forages.length; i4++) { - var forage = forages[i4]; - if (forage._dbInfo.db) { - forage._dbInfo.db.close(); - forage._dbInfo.db = null; - } + return true; + } catch (err) { + return false; + } + } + module2.exports = shouldUseNative() ? Object.assign : function(target, source) { + var from; + var to = toObject(target); + var symbols; + for (var s5 = 1; s5 < arguments.length; s5++) { + from = Object(arguments[s5]); + for (var key2 in from) { + if (hasOwnProperty2.call(from, key2)) { + to[key2] = from[key2]; } - dbInfo.db = null; - return _getOriginalConnection(dbInfo).then(function(db) { - dbInfo.db = db; - if (_isUpgradeNeeded(dbInfo)) { - return _getUpgradedConnection(dbInfo); - } - return db; - }).then(function(db) { - dbInfo.db = dbContext.db = db; - for (var i5 = 0; i5 < forages.length; i5++) { - forages[i5]._dbInfo.db = db; - } - })["catch"](function(err) { - _rejectReadiness(dbInfo, err); - throw err; - }); } - function createTransaction(dbInfo, mode, callback, retries) { - if (retries === void 0) { - retries = 1; - } - try { - var tx = dbInfo.db.transaction(dbInfo.storeName, mode); - callback(null, tx); - } catch (err) { - if (retries > 0 && (!dbInfo.db || err.name === "InvalidStateError" || err.name === "NotFoundError")) { - return Promise$1.resolve().then(function() { - if (!dbInfo.db || err.name === "NotFoundError" && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) { - if (dbInfo.db) { - dbInfo.version = dbInfo.db.version + 1; - } - return _getUpgradedConnection(dbInfo); - } - }).then(function() { - return _tryReconnect(dbInfo).then(function() { - createTransaction(dbInfo, mode, callback, retries - 1); - }); - })["catch"](callback); + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i4 = 0; i4 < symbols.length; i4++) { + if (propIsEnumerable.call(from, symbols[i4])) { + to[symbols[i4]] = from[symbols[i4]]; } - callback(err); } } - function createDbContext() { - return { - forages: [], - db: null, - dbReady: null, - deferredOperations: [] - }; - } - function _initStorage(options) { - var self2 = this; - var dbInfo = { - db: null - }; - if (options) { - for (var i4 in options) { - dbInfo[i4] = options[i4]; + } + return to; + }; + } +}); + +// node_modules/prop-types/lib/ReactPropTypesSecret.js +var require_ReactPropTypesSecret = __commonJS({ + "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module2) { + "use strict"; + var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; + module2.exports = ReactPropTypesSecret; + } +}); + +// node_modules/prop-types/lib/has.js +var require_has = __commonJS({ + "node_modules/prop-types/lib/has.js"(exports, module2) { + module2.exports = Function.call.bind(Object.prototype.hasOwnProperty); + } +}); + +// node_modules/prop-types/checkPropTypes.js +var require_checkPropTypes = __commonJS({ + "node_modules/prop-types/checkPropTypes.js"(exports, module2) { + "use strict"; + var printWarning = function() { + }; + if (true) { + ReactPropTypesSecret = require_ReactPropTypesSecret(); + loggedTypeFailures = {}; + has = require_has(); + printWarning = function(text2) { + var message = "Warning: " + text2; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x5) { + } + }; + } + var ReactPropTypesSecret; + var loggedTypeFailures; + var has; + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + try { + if (typeof typeSpecs[typeSpecName] !== "function") { + var err = Error( + (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." + ); + err.name = "Invariant Violation"; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = true; + var stack = getStack ? getStack() : ""; + printWarning( + "Failed " + location + " type: " + error.message + (stack != null ? stack : "") + ); } } - var dbContext = dbContexts[dbInfo.name]; - if (!dbContext) { - dbContext = createDbContext(); - dbContexts[dbInfo.name] = dbContext; + } + } + } + checkPropTypes.resetWarningCache = function() { + if (true) { + loggedTypeFailures = {}; + } + }; + module2.exports = checkPropTypes; + } +}); + +// node_modules/prop-types/factoryWithTypeCheckers.js +var require_factoryWithTypeCheckers = __commonJS({ + "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module2) { + "use strict"; + var ReactIs = require_react_is(); + var assign2 = require_object_assign(); + var ReactPropTypesSecret = require_ReactPropTypesSecret(); + var has = require_has(); + var checkPropTypes = require_checkPropTypes(); + var printWarning = function() { + }; + if (true) { + printWarning = function(text2) { + var message = "Warning: " + text2; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x5) { + } + }; + } + function emptyFunctionThatReturnsNull() { + return null; + } + module2.exports = function(isValidElement, throwOnDirectAccess) { + var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === "function") { + return iteratorFn; + } + } + var ANONYMOUS = "<>"; + var ReactPropTypes = { + array: createPrimitiveTypeChecker("array"), + bigint: createPrimitiveTypeChecker("bigint"), + bool: createPrimitiveTypeChecker("boolean"), + func: createPrimitiveTypeChecker("function"), + number: createPrimitiveTypeChecker("number"), + object: createPrimitiveTypeChecker("object"), + string: createPrimitiveTypeChecker("string"), + symbol: createPrimitiveTypeChecker("symbol"), + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; + function is(x5, y5) { + if (x5 === y5) { + return x5 !== 0 || 1 / x5 === 1 / y5; + } else { + return x5 !== x5 && y5 !== y5; + } + } + function PropTypeError(message, data2) { + this.message = message; + this.data = data2 && typeof data2 === "object" ? data2 : {}; + this.stack = ""; + } + PropTypeError.prototype = Error.prototype; + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props2, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + var err = new Error( + "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" + ); + err.name = "Invariant Violation"; + throw err; + } else if (typeof console !== "undefined") { + var cacheKey = componentName + ":" + propName; + if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { + printWarning( + "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } } - dbContext.forages.push(self2); - if (!self2._initReady) { - self2._initReady = self2.ready; - self2.ready = _fullyReady; + if (props2[propName] == null) { + if (isRequired) { + if (props2[propName] === null) { + return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); + } + return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); + } + return null; + } else { + return validate(props2, propName, componentName, location, propFullName); } - var initPromises = []; - function ignoreErrors() { - return Promise$1.resolve(); + } + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + function createPrimitiveTypeChecker(expectedType) { + function validate(props2, propName, componentName, location, propFullName, secret) { + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + var preciseType = getPreciseType(propValue); + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), + { expectedType } + ); } - for (var j4 = 0; j4 < dbContext.forages.length; j4++) { - var forage = dbContext.forages[j4]; - if (forage !== self2) { - initPromises.push(forage._initReady()["catch"](ignoreErrors)); - } + return null; + } + return createChainableTypeChecker(validate); + } + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + function createArrayOfTypeChecker(typeChecker) { + function validate(props2, propName, componentName, location, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); } - var forages = dbContext.forages.slice(0); - return Promise$1.all(initPromises).then(function() { - dbInfo.db = dbContext.db; - return _getOriginalConnection(dbInfo); - }).then(function(db) { - dbInfo.db = db; - if (_isUpgradeNeeded(dbInfo, self2._defaultConfig.version)) { - return _getUpgradedConnection(dbInfo); - } - return db; - }).then(function(db) { - dbInfo.db = dbContext.db = db; - self2._dbInfo = dbInfo; - for (var k5 = 0; k5 < forages.length; k5++) { - var forage2 = forages[k5]; - if (forage2 !== self2) { - forage2._dbInfo.db = dbInfo.db; - forage2._dbInfo.version = dbInfo.version; - } + var propValue = props2[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); + } + for (var i4 = 0; i4 < propValue.length; i4++) { + var error = typeChecker(propValue, i4, componentName, location, propFullName + "[" + i4 + "]", ReactPropTypesSecret); + if (error instanceof Error) { + return error; } - }); + } + return null; } - function getItem(key3, callback) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - var req = store.get(key3); - req.onsuccess = function() { - var value = req.result; - if (value === void 0) { - value = null; - } - if (_isEncodedBlob(value)) { - value = _decodeBlob(value); - } - resolve(value); - }; - req.onerror = function() { - reject(req.error); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + return createChainableTypeChecker(validate); + } + function createElementTypeChecker() { + function validate(props2, propName, componentName, location, propFullName) { + var propValue = props2[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); + } + return null; } - function iterate(iterator, callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - var req = store.openCursor(); - var iterationNumber = 1; - req.onsuccess = function() { - var cursor = req.result; - if (cursor) { - var value = cursor.value; - if (_isEncodedBlob(value)) { - value = _decodeBlob(value); - } - var result = iterator(value, cursor.key, iterationNumber++); - if (result !== void 0) { - resolve(result); - } else { - cursor["continue"](); - } - } else { - resolve(); - } - }; - req.onerror = function() { - reject(req.error); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + return createChainableTypeChecker(validate); + } + function createElementTypeTypeChecker() { + function validate(props2, propName, componentName, location, propFullName) { + var propValue = props2[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); + } + return null; } - function setItem(key3, value, callback) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = new Promise$1(function(resolve, reject) { - var dbInfo; - self2.ready().then(function() { - dbInfo = self2._dbInfo; - if (toString3.call(value) === "[object Blob]") { - return _checkBlobSupport(dbInfo.db).then(function(blobSupport) { - if (blobSupport) { - return value; - } - return _encodeBlob(value); - }); - } - return value; - }).then(function(value2) { - createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - if (value2 === null) { - value2 = void 0; - } - var req = store.put(value2, key3); - transaction.oncomplete = function() { - if (value2 === void 0) { - value2 = null; - } - resolve(value2); - }; - transaction.onabort = transaction.onerror = function() { - var err2 = req.error ? req.error : req.transaction.error; - reject(err2); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + return createChainableTypeChecker(validate); + } + function createInstanceTypeChecker(expectedClass) { + function validate(props2, propName, componentName, location, propFullName) { + if (!(props2[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props2[propName]); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); + } + return null; } - function removeItem(key3, callback) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - var req = store["delete"](key3); - transaction.oncomplete = function() { - resolve(); - }; - transaction.onerror = function() { - reject(req.error); - }; - transaction.onabort = function() { - var err2 = req.error ? req.error : req.transaction.error; - reject(err2); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + return createChainableTypeChecker(validate); + } + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning( + "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." + ); + } else { + printWarning("Invalid argument supplied to oneOf, expected an array."); + } + } + return emptyFunctionThatReturnsNull; } - function clear(callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - var req = store.clear(); - transaction.oncomplete = function() { - resolve(); - }; - transaction.onabort = transaction.onerror = function() { - var err2 = req.error ? req.error : req.transaction.error; - reject(err2); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); + function validate(props2, propName, componentName, location, propFullName) { + var propValue = props2[propName]; + for (var i4 = 0; i4 < expectedValues.length; i4++) { + if (is(propValue, expectedValues[i4])) { + return null; + } + } + var valuesString = JSON.stringify(expectedValues, function replacer(key2, value) { + var type = getPreciseType(value); + if (type === "symbol") { + return String(value); + } + return value; }); - executeCallback(promise, callback); - return promise; + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); } - function length(callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - var req = store.count(); - req.onsuccess = function() { - resolve(req.result); - }; - req.onerror = function() { - reject(req.error); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; - } - function key2(n2, callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - if (n2 < 0) { - resolve(null); - return; - } - self2.ready().then(function() { - createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - var advanced = false; - var req = store.openKeyCursor(); - req.onsuccess = function() { - var cursor = req.result; - if (!cursor) { - resolve(null); - return; - } - if (n2 === 0) { - resolve(cursor.key); - } else { - if (!advanced) { - advanced = true; - cursor.advance(n2); - } else { - resolve(cursor.key); - } - } - }; - req.onerror = function() { - reject(req.error); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; - } - function keys(callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { - if (err) { - return reject(err); - } - try { - var store = transaction.objectStore(self2._dbInfo.storeName); - var req = store.openKeyCursor(); - var keys2 = []; - req.onsuccess = function() { - var cursor = req.result; - if (!cursor) { - resolve(keys2); - return; - } - keys2.push(cursor.key); - cursor["continue"](); - }; - req.onerror = function() { - reject(req.error); - }; - } catch (e4) { - reject(e4); - } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; - } - function dropInstance(options, callback) { - callback = getCallback.apply(this, arguments); - var currentConfig = this.config(); - options = typeof options !== "function" && options || {}; - if (!options.name) { - options.name = options.name || currentConfig.name; - options.storeName = options.storeName || currentConfig.storeName; + return createChainableTypeChecker(validate); + } + function createObjectOfTypeChecker(typeChecker) { + function validate(props2, propName, componentName, location, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); } - var self2 = this; - var promise; - if (!options.name) { - promise = Promise$1.reject("Invalid arguments"); - } else { - var isCurrentDb = options.name === currentConfig.name && self2._dbInfo.db; - var dbPromise = isCurrentDb ? Promise$1.resolve(self2._dbInfo.db) : _getOriginalConnection(options).then(function(db) { - var dbContext = dbContexts[options.name]; - var forages = dbContext.forages; - dbContext.db = db; - for (var i4 = 0; i4 < forages.length; i4++) { - forages[i4]._dbInfo.db = db; + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); + } + for (var key2 in propValue) { + if (has(propValue, key2)) { + var error = typeChecker(propValue, key2, componentName, location, propFullName + "." + key2, ReactPropTypesSecret); + if (error instanceof Error) { + return error; } - return db; - }); - if (!options.storeName) { - promise = dbPromise.then(function(db) { - _deferReadiness(options); - var dbContext = dbContexts[options.name]; - var forages = dbContext.forages; - db.close(); - for (var i4 = 0; i4 < forages.length; i4++) { - var forage = forages[i4]; - forage._dbInfo.db = null; - } - var dropDBPromise = new Promise$1(function(resolve, reject) { - var req = idb.deleteDatabase(options.name); - req.onerror = function() { - var db2 = req.result; - if (db2) { - db2.close(); - } - reject(req.error); - }; - req.onblocked = function() { - console.warn('dropInstance blocked for database "' + options.name + '" until all open connections are closed'); - }; - req.onsuccess = function() { - var db2 = req.result; - if (db2) { - db2.close(); - } - resolve(db2); - }; - }); - return dropDBPromise.then(function(db2) { - dbContext.db = db2; - for (var i5 = 0; i5 < forages.length; i5++) { - var _forage = forages[i5]; - _advanceReadiness(_forage._dbInfo); - } - })["catch"](function(err) { - (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() { - }); - throw err; - }); - }); - } else { - promise = dbPromise.then(function(db) { - if (!db.objectStoreNames.contains(options.storeName)) { - return; - } - var newVersion = db.version + 1; - _deferReadiness(options); - var dbContext = dbContexts[options.name]; - var forages = dbContext.forages; - db.close(); - for (var i4 = 0; i4 < forages.length; i4++) { - var forage = forages[i4]; - forage._dbInfo.db = null; - forage._dbInfo.version = newVersion; - } - var dropObjectPromise = new Promise$1(function(resolve, reject) { - var req = idb.open(options.name, newVersion); - req.onerror = function(err) { - var db2 = req.result; - db2.close(); - reject(err); - }; - req.onupgradeneeded = function() { - var db2 = req.result; - db2.deleteObjectStore(options.storeName); - }; - req.onsuccess = function() { - var db2 = req.result; - db2.close(); - resolve(db2); - }; - }); - return dropObjectPromise.then(function(db2) { - dbContext.db = db2; - for (var j4 = 0; j4 < forages.length; j4++) { - var _forage2 = forages[j4]; - _forage2._dbInfo.db = db2; - _advanceReadiness(_forage2._dbInfo); - } - })["catch"](function(err) { - (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() { - }); - throw err; - }); - }); } } - executeCallback(promise, callback); - return promise; + return null; } - var asyncStorage = { - _driver: "asyncStorage", - _initStorage, - _support: isIndexedDBValid(), - iterate, - getItem, - setItem, - removeItem, - clear, - length, - key: key2, - keys, - dropInstance - }; - function isWebSQLValid() { - return typeof openDatabase === "function"; + return createChainableTypeChecker(validate); + } + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0; + return emptyFunctionThatReturnsNull; } - var BASE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var BLOB_TYPE_PREFIX = "~~local_forage_type~"; - var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/; - var SERIALIZED_MARKER = "__lfsc__:"; - var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length; - var TYPE_ARRAYBUFFER = "arbf"; - var TYPE_BLOB = "blob"; - var TYPE_INT8ARRAY = "si08"; - var TYPE_UINT8ARRAY = "ui08"; - var TYPE_UINT8CLAMPEDARRAY = "uic8"; - var TYPE_INT16ARRAY = "si16"; - var TYPE_INT32ARRAY = "si32"; - var TYPE_UINT16ARRAY = "ur16"; - var TYPE_UINT32ARRAY = "ui32"; - var TYPE_FLOAT32ARRAY = "fl32"; - var TYPE_FLOAT64ARRAY = "fl64"; - var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length; - var toString$1 = Object.prototype.toString; - function stringToBuffer(serializedString) { - var bufferLength = serializedString.length * 0.75; - var len = serializedString.length; - var i4; - var p3 = 0; - var encoded1, encoded2, encoded3, encoded4; - if (serializedString[serializedString.length - 1] === "=") { - bufferLength--; - if (serializedString[serializedString.length - 2] === "=") { - bufferLength--; - } - } - var buffer = new ArrayBuffer(bufferLength); - var bytes = new Uint8Array(buffer); - for (i4 = 0; i4 < len; i4 += 4) { - encoded1 = BASE_CHARS.indexOf(serializedString[i4]); - encoded2 = BASE_CHARS.indexOf(serializedString[i4 + 1]); - encoded3 = BASE_CHARS.indexOf(serializedString[i4 + 2]); - encoded4 = BASE_CHARS.indexOf(serializedString[i4 + 3]); - bytes[p3++] = encoded1 << 2 | encoded2 >> 4; - bytes[p3++] = (encoded2 & 15) << 4 | encoded3 >> 2; - bytes[p3++] = (encoded3 & 3) << 6 | encoded4 & 63; + for (var i4 = 0; i4 < arrayOfTypeCheckers.length; i4++) { + var checker = arrayOfTypeCheckers[i4]; + if (typeof checker !== "function") { + printWarning( + "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i4 + "." + ); + return emptyFunctionThatReturnsNull; } - return buffer; } - function bufferToString(buffer) { - var bytes = new Uint8Array(buffer); - var base64String = ""; - var i4; - for (i4 = 0; i4 < bytes.length; i4 += 3) { - base64String += BASE_CHARS[bytes[i4] >> 2]; - base64String += BASE_CHARS[(bytes[i4] & 3) << 4 | bytes[i4 + 1] >> 4]; - base64String += BASE_CHARS[(bytes[i4 + 1] & 15) << 2 | bytes[i4 + 2] >> 6]; - base64String += BASE_CHARS[bytes[i4 + 2] & 63]; + function validate(props2, propName, componentName, location, propFullName) { + var expectedTypes = []; + for (var i5 = 0; i5 < arrayOfTypeCheckers.length; i5++) { + var checker2 = arrayOfTypeCheckers[i5]; + var checkerResult = checker2(props2, propName, componentName, location, propFullName, ReactPropTypesSecret); + if (checkerResult == null) { + return null; + } + if (checkerResult.data && has(checkerResult.data, "expectedType")) { + expectedTypes.push(checkerResult.data.expectedType); + } } - if (bytes.length % 3 === 2) { - base64String = base64String.substring(0, base64String.length - 1) + "="; - } else if (bytes.length % 3 === 1) { - base64String = base64String.substring(0, base64String.length - 2) + "=="; + var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); + } + return createChainableTypeChecker(validate); + } + function createNodeChecker() { + function validate(props2, propName, componentName, location, propFullName) { + if (!isNode2(props2[propName])) { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); } - return base64String; + return null; } - function serialize(value, callback) { - var valueType = ""; - if (value) { - valueType = toString$1.call(value); + return createChainableTypeChecker(validate); + } + function invalidValidatorError(componentName, location, propFullName, key2, type) { + return new PropTypeError( + (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key2 + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." + ); + } + function createShapeTypeChecker(shapeTypes) { + function validate(props2, propName, componentName, location, propFullName) { + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); } - if (value && (valueType === "[object ArrayBuffer]" || value.buffer && toString$1.call(value.buffer) === "[object ArrayBuffer]")) { - var buffer; - var marker = SERIALIZED_MARKER; - if (value instanceof ArrayBuffer) { - buffer = value; - marker += TYPE_ARRAYBUFFER; - } else { - buffer = value.buffer; - if (valueType === "[object Int8Array]") { - marker += TYPE_INT8ARRAY; - } else if (valueType === "[object Uint8Array]") { - marker += TYPE_UINT8ARRAY; - } else if (valueType === "[object Uint8ClampedArray]") { - marker += TYPE_UINT8CLAMPEDARRAY; - } else if (valueType === "[object Int16Array]") { - marker += TYPE_INT16ARRAY; - } else if (valueType === "[object Uint16Array]") { - marker += TYPE_UINT16ARRAY; - } else if (valueType === "[object Int32Array]") { - marker += TYPE_INT32ARRAY; - } else if (valueType === "[object Uint32Array]") { - marker += TYPE_UINT32ARRAY; - } else if (valueType === "[object Float32Array]") { - marker += TYPE_FLOAT32ARRAY; - } else if (valueType === "[object Float64Array]") { - marker += TYPE_FLOAT64ARRAY; - } else { - callback(new Error("Failed to get type for BinaryArray")); - } + for (var key2 in shapeTypes) { + var checker = shapeTypes[key2]; + if (typeof checker !== "function") { + return invalidValidatorError(componentName, location, propFullName, key2, getPreciseType(checker)); } - callback(marker + bufferToString(buffer)); - } else if (valueType === "[object Blob]") { - var fileReader = new FileReader(); - fileReader.onload = function() { - var str = BLOB_TYPE_PREFIX + value.type + "~" + bufferToString(this.result); - callback(SERIALIZED_MARKER + TYPE_BLOB + str); - }; - fileReader.readAsArrayBuffer(value); - } else { - try { - callback(JSON.stringify(value)); - } catch (e4) { - console.error("Couldn't convert value into a JSON string: ", value); - callback(null, e4); + var error = checker(propValue, key2, componentName, location, propFullName + "." + key2, ReactPropTypesSecret); + if (error) { + return error; } } + return null; } - function deserialize(value) { - if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) { - return JSON.parse(value); - } - var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH); - var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH); - var blobType; - if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) { - var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX); - blobType = matcher[1]; - serializedString = serializedString.substring(matcher[0].length); - } - var buffer = stringToBuffer(serializedString); - switch (type) { - case TYPE_ARRAYBUFFER: - return buffer; - case TYPE_BLOB: - return createBlob([buffer], { type: blobType }); - case TYPE_INT8ARRAY: - return new Int8Array(buffer); - case TYPE_UINT8ARRAY: - return new Uint8Array(buffer); - case TYPE_UINT8CLAMPEDARRAY: - return new Uint8ClampedArray(buffer); - case TYPE_INT16ARRAY: - return new Int16Array(buffer); - case TYPE_UINT16ARRAY: - return new Uint16Array(buffer); - case TYPE_INT32ARRAY: - return new Int32Array(buffer); - case TYPE_UINT32ARRAY: - return new Uint32Array(buffer); - case TYPE_FLOAT32ARRAY: - return new Float32Array(buffer); - case TYPE_FLOAT64ARRAY: - return new Float64Array(buffer); - default: - throw new Error("Unkown type: " + type); + return createChainableTypeChecker(validate); + } + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props2, propName, componentName, location, propFullName) { + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); } - } - var localforageSerializer = { - serialize, - deserialize, - stringToBuffer, - bufferToString - }; - function createDbTable(t4, dbInfo, callback, errorCallback) { - t4.executeSql("CREATE TABLE IF NOT EXISTS " + dbInfo.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], callback, errorCallback); - } - function _initStorage$1(options) { - var self2 = this; - var dbInfo = { - db: null - }; - if (options) { - for (var i4 in options) { - dbInfo[i4] = typeof options[i4] !== "string" ? options[i4].toString() : options[i4]; + var allKeys = assign2({}, props2[propName], shapeTypes); + for (var key2 in allKeys) { + var checker = shapeTypes[key2]; + if (has(shapeTypes, key2) && typeof checker !== "function") { + return invalidValidatorError(componentName, location, propFullName, key2, getPreciseType(checker)); } - } - var dbInfoPromise = new Promise$1(function(resolve, reject) { - try { - dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size); - } catch (e4) { - return reject(e4); + if (!checker) { + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` key `" + key2 + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props2[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ") + ); } - dbInfo.db.transaction(function(t4) { - createDbTable(t4, dbInfo, function() { - self2._dbInfo = dbInfo; - resolve(); - }, function(t5, error) { - reject(error); - }); - }, reject); - }); - dbInfo.serializer = localforageSerializer; - return dbInfoPromise; - } - function tryExecuteSql(t4, dbInfo, sqlStatement, args, callback, errorCallback) { - t4.executeSql(sqlStatement, args, callback, function(t5, error) { - if (error.code === error.SYNTAX_ERR) { - t5.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [dbInfo.storeName], function(t6, results) { - if (!results.rows.length) { - createDbTable(t6, dbInfo, function() { - t6.executeSql(sqlStatement, args, callback, errorCallback); - }, errorCallback); - } else { - errorCallback(t6, error); - } - }, errorCallback); - } else { - errorCallback(t5, error); + var error = checker(propValue, key2, componentName, location, propFullName + "." + key2, ReactPropTypesSecret); + if (error) { + return error; } - }, errorCallback); + } + return null; } - function getItem$1(key3, callback) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - var dbInfo = self2._dbInfo; - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "SELECT * FROM " + dbInfo.storeName + " WHERE key = ? LIMIT 1", [key3], function(t5, results) { - var result = results.rows.length ? results.rows.item(0).value : null; - if (result) { - result = dbInfo.serializer.deserialize(result); + return createChainableTypeChecker(validate); + } + function isNode2(propValue) { + switch (typeof propValue) { + case "number": + case "string": + case "undefined": + return true; + case "boolean": + return !propValue; + case "object": + if (Array.isArray(propValue)) { + return propValue.every(isNode2); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode2(step.value)) { + return false; } - resolve(result); - }, function(t5, error) { - reject(error); - }); - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; - } - function iterate$1(iterator, callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - var dbInfo = self2._dbInfo; - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "SELECT * FROM " + dbInfo.storeName, [], function(t5, results) { - var rows = results.rows; - var length2 = rows.length; - for (var i4 = 0; i4 < length2; i4++) { - var item = rows.item(i4); - var result = item.value; - if (result) { - result = dbInfo.serializer.deserialize(result); - } - result = iterator(result, item.key, i4 + 1); - if (result !== void 0) { - resolve(result); - return; + } + } else { + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode2(entry[1])) { + return false; } } - resolve(); - }, function(t5, error) { - reject(error); - }); - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; - } - function _setItem(key3, value, callback, retriesLeft) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - if (value === void 0) { - value = null; - } - var originalValue = value; - var dbInfo = self2._dbInfo; - dbInfo.serializer.serialize(value, function(value2, error) { - if (error) { - reject(error); - } else { - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "INSERT OR REPLACE INTO " + dbInfo.storeName + " (key, value) VALUES (?, ?)", [key3, value2], function() { - resolve(originalValue); - }, function(t5, error2) { - reject(error2); - }); - }, function(sqlError) { - if (sqlError.code === sqlError.QUOTA_ERR) { - if (retriesLeft > 0) { - resolve(_setItem.apply(self2, [key3, originalValue, callback, retriesLeft - 1])); - return; - } - reject(sqlError); - } - }); } - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; - } - function setItem$1(key3, value, callback) { - return _setItem.apply(this, [key3, value, callback, 1]); + } + } else { + return false; + } + return true; + default: + return false; } - function removeItem$1(key3, callback) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - var dbInfo = self2._dbInfo; - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "DELETE FROM " + dbInfo.storeName + " WHERE key = ?", [key3], function() { - resolve(); - }, function(t5, error) { - reject(error); - }); - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + } + function isSymbol(propType, propValue) { + if (propType === "symbol") { + return true; } - function clear$1(callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - var dbInfo = self2._dbInfo; - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "DELETE FROM " + dbInfo.storeName, [], function() { - resolve(); - }, function(t5, error) { - reject(error); - }); - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + if (!propValue) { + return false; } - function length$1(callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - var dbInfo = self2._dbInfo; - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "SELECT COUNT(key) as c FROM " + dbInfo.storeName, [], function(t5, results) { - var result = results.rows.item(0).c; - resolve(result); - }, function(t5, error) { - reject(error); - }); - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + if (propValue["@@toStringTag"] === "Symbol") { + return true; } - function key$1(n2, callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - var dbInfo = self2._dbInfo; - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "SELECT key FROM " + dbInfo.storeName + " WHERE id = ? LIMIT 1", [n2 + 1], function(t5, results) { - var result = results.rows.length ? results.rows.item(0).key : null; - resolve(result); - }, function(t5, error) { - reject(error); - }); - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + if (typeof Symbol === "function" && propValue instanceof Symbol) { + return true; } - function keys$1(callback) { - var self2 = this; - var promise = new Promise$1(function(resolve, reject) { - self2.ready().then(function() { - var dbInfo = self2._dbInfo; - dbInfo.db.transaction(function(t4) { - tryExecuteSql(t4, dbInfo, "SELECT key FROM " + dbInfo.storeName, [], function(t5, results) { - var keys2 = []; - for (var i4 = 0; i4 < results.rows.length; i4++) { - keys2.push(results.rows.item(i4).key); - } - resolve(keys2); - }, function(t5, error) { - reject(error); - }); - }); - })["catch"](reject); - }); - executeCallback(promise, callback); - return promise; + return false; + } + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return "array"; } - function getAllStoreNames(db) { - return new Promise$1(function(resolve, reject) { - db.transaction(function(t4) { - t4.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(t5, results) { - var storeNames = []; - for (var i4 = 0; i4 < results.rows.length; i4++) { - storeNames.push(results.rows.item(i4).name); - } - resolve({ - db, - storeNames - }); - }, function(t5, error) { - reject(error); - }); - }, function(sqlError) { - reject(sqlError); - }); - }); + if (propValue instanceof RegExp) { + return "object"; } - function dropInstance$1(options, callback) { - callback = getCallback.apply(this, arguments); - var currentConfig = this.config(); - options = typeof options !== "function" && options || {}; - if (!options.name) { - options.name = options.name || currentConfig.name; - options.storeName = options.storeName || currentConfig.storeName; - } - var self2 = this; - var promise; - if (!options.name) { - promise = Promise$1.reject("Invalid arguments"); - } else { - promise = new Promise$1(function(resolve) { - var db; - if (options.name === currentConfig.name) { - db = self2._dbInfo.db; - } else { - db = openDatabase(options.name, "", "", 0); - } - if (!options.storeName) { - resolve(getAllStoreNames(db)); - } else { - resolve({ - db, - storeNames: [options.storeName] - }); - } - }).then(function(operationInfo) { - return new Promise$1(function(resolve, reject) { - operationInfo.db.transaction(function(t4) { - function dropTable2(storeName) { - return new Promise$1(function(resolve2, reject2) { - t4.executeSql("DROP TABLE IF EXISTS " + storeName, [], function() { - resolve2(); - }, function(t5, error) { - reject2(error); - }); - }); - } - var operations = []; - for (var i4 = 0, len = operationInfo.storeNames.length; i4 < len; i4++) { - operations.push(dropTable2(operationInfo.storeNames[i4])); - } - Promise$1.all(operations).then(function() { - resolve(); - })["catch"](function(e4) { - reject(e4); - }); - }, function(sqlError) { - reject(sqlError); - }); - }); - }); - } - executeCallback(promise, callback); - return promise; + if (isSymbol(propType, propValue)) { + return "symbol"; } - var webSQLStorage = { - _driver: "webSQLStorage", - _initStorage: _initStorage$1, - _support: isWebSQLValid(), - iterate: iterate$1, - getItem: getItem$1, - setItem: setItem$1, - removeItem: removeItem$1, - clear: clear$1, - length: length$1, - key: key$1, - keys: keys$1, - dropInstance: dropInstance$1 - }; - function isLocalStorageValid() { - try { - return typeof localStorage !== "undefined" && "setItem" in localStorage && !!localStorage.setItem; - } catch (e4) { - return false; - } + return propType; + } + function getPreciseType(propValue) { + if (typeof propValue === "undefined" || propValue === null) { + return "" + propValue; } - function _getKeyPrefix(options, defaultConfig) { - var keyPrefix = options.name + "/"; - if (options.storeName !== defaultConfig.storeName) { - keyPrefix += options.storeName + "/"; + var propType = getPropType(propValue); + if (propType === "object") { + if (propValue instanceof Date) { + return "date"; + } else if (propValue instanceof RegExp) { + return "regexp"; } - return keyPrefix; } - function checkIfLocalStorageThrows() { - var localStorageTestKey = "_localforage_support_test"; - try { - localStorage.setItem(localStorageTestKey, true); - localStorage.removeItem(localStorageTestKey); - return false; - } catch (e4) { - return true; - } + return propType; + } + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case "array": + case "object": + return "an " + type; + case "boolean": + case "date": + case "regexp": + return "a " + type; + default: + return type; } - function _isLocalStorageUsable() { - return !checkIfLocalStorageThrows() || localStorage.length > 0; + } + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; } - function _initStorage$2(options) { - var self2 = this; - var dbInfo = {}; - if (options) { - for (var i4 in options) { - dbInfo[i4] = options[i4]; - } - } - dbInfo.keyPrefix = _getKeyPrefix(options, self2._defaultConfig); - if (!_isLocalStorageUsable()) { - return Promise$1.reject(); + return propValue.constructor.name; + } + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; + }; + } +}); + +// node_modules/prop-types/index.js +var require_prop_types = __commonJS({ + "node_modules/prop-types/index.js"(exports, module2) { + if (true) { + ReactIs = require_react_is(); + throwOnDirectAccess = true; + module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); + } else { + module2.exports = null(); + } + var ReactIs; + var throwOnDirectAccess; + } +}); + +// node_modules/attr-accept/dist/es/index.js +var require_es = __commonJS({ + "node_modules/attr-accept/dist/es/index.js"(exports) { + "use strict"; + exports.__esModule = true; + exports.default = function(file, acceptedFiles) { + if (file && acceptedFiles) { + var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(","); + var fileName = file.name || ""; + var mimeType = (file.type || "").toLowerCase(); + var baseMimeType = mimeType.replace(/\/.*$/, ""); + return acceptedFilesArray.some(function(type) { + var validType = type.trim().toLowerCase(); + if (validType.charAt(0) === ".") { + return fileName.toLowerCase().endsWith(validType); + } else if (validType.endsWith("/*")) { + return baseMimeType === validType.replace(/\/.*$/, ""); } - self2._dbInfo = dbInfo; - dbInfo.serializer = localforageSerializer; - return Promise$1.resolve(); + return mimeType === validType; + }); + } + return true; + }; + } +}); + +// node_modules/obsidian-dataview/lib/index.js +var require_lib = __commonJS({ + "node_modules/obsidian-dataview/lib/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + require("obsidian"); + var getAPI2 = (app2) => { + var _a2; + if (app2) + return (_a2 = app2.plugins.plugins.dataview) === null || _a2 === void 0 ? void 0 : _a2.api; + else + return window["DataviewAPI"]; + }; + var isPluginEnabled = (app2) => app2.plugins.enabledPlugins.has("dataview"); + exports.getAPI = getAPI2; + exports.isPluginEnabled = isPluginEnabled; + } +}); + +// node_modules/localforage/dist/localforage.js +var require_localforage = __commonJS({ + "node_modules/localforage/dist/localforage.js"(exports, module2) { + (function(f4) { + if (typeof exports === "object" && typeof module2 !== "undefined") { + module2.exports = f4(); + } else if (typeof define === "function" && define.amd) { + define([], f4); + } else { + var g4; + if (typeof window !== "undefined") { + g4 = window; + } else if (typeof global !== "undefined") { + g4 = global; + } else if (typeof self !== "undefined") { + g4 = self; + } else { + g4 = this; } - function clear$2(callback) { - var self2 = this; - var promise = self2.ready().then(function() { - var keyPrefix = self2._dbInfo.keyPrefix; - for (var i4 = localStorage.length - 1; i4 >= 0; i4--) { - var key3 = localStorage.key(i4); - if (key3.indexOf(keyPrefix) === 0) { - localStorage.removeItem(key3); - } + g4.localforage = f4(); + } + })(function() { + var define2, module3, exports2; + return function e4(t4, n2, r3) { + function s5(o4, u4) { + if (!n2[o4]) { + if (!t4[o4]) { + var a5 = typeof require == "function" && require; + if (!u4 && a5) + return a5(o4, true); + if (i4) + return i4(o4, true); + var f4 = new Error("Cannot find module '" + o4 + "'"); + throw f4.code = "MODULE_NOT_FOUND", f4; } - }); - executeCallback(promise, callback); - return promise; + var l3 = n2[o4] = { exports: {} }; + t4[o4][0].call(l3.exports, function(e5) { + var n3 = t4[o4][1][e5]; + return s5(n3 ? n3 : e5); + }, l3, l3.exports, e4, t4, n2, r3); + } + return n2[o4].exports; } - function getItem$2(key3, callback) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = self2.ready().then(function() { - var dbInfo = self2._dbInfo; - var result = localStorage.getItem(dbInfo.keyPrefix + key3); - if (result) { - result = dbInfo.serializer.deserialize(result); - } - return result; - }); - executeCallback(promise, callback); - return promise; - } - function iterate$2(iterator, callback) { - var self2 = this; - var promise = self2.ready().then(function() { - var dbInfo = self2._dbInfo; - var keyPrefix = dbInfo.keyPrefix; - var keyPrefixLength = keyPrefix.length; - var length2 = localStorage.length; - var iterationNumber = 1; - for (var i4 = 0; i4 < length2; i4++) { - var key3 = localStorage.key(i4); - if (key3.indexOf(keyPrefix) !== 0) { - continue; - } - var value = localStorage.getItem(key3); - if (value) { - value = dbInfo.serializer.deserialize(value); - } - value = iterator(value, key3.substring(keyPrefixLength), iterationNumber++); - if (value !== void 0) { - return value; + var i4 = typeof require == "function" && require; + for (var o3 = 0; o3 < r3.length; o3++) + s5(r3[o3]); + return s5; + }({ 1: [function(_dereq_, module4, exports3) { + (function(global2) { + "use strict"; + var Mutation = global2.MutationObserver || global2.WebKitMutationObserver; + var scheduleDrain; + { + if (Mutation) { + var called = 0; + var observer = new Mutation(nextTick); + var element = global2.document.createTextNode(""); + observer.observe(element, { + characterData: true + }); + scheduleDrain = function() { + element.data = called = ++called % 2; + }; + } else if (!global2.setImmediate && typeof global2.MessageChannel !== "undefined") { + var channel = new global2.MessageChannel(); + channel.port1.onmessage = nextTick; + scheduleDrain = function() { + channel.port2.postMessage(0); + }; + } else if ("document" in global2 && "onreadystatechange" in global2.document.createElement("script")) { + scheduleDrain = function() { + var scriptEl = global2.document.createElement("script"); + scriptEl.onreadystatechange = function() { + nextTick(); + scriptEl.onreadystatechange = null; + scriptEl.parentNode.removeChild(scriptEl); + scriptEl = null; + }; + global2.document.documentElement.appendChild(scriptEl); + }; + } else { + scheduleDrain = function() { + setTimeout(nextTick, 0); + }; + } + } + var draining; + var queue = []; + function nextTick() { + draining = true; + var i4, oldQueue; + var len = queue.length; + while (len) { + oldQueue = queue; + queue = []; + i4 = -1; + while (++i4 < len) { + oldQueue[i4](); } + len = queue.length; } - }); - executeCallback(promise, callback); + draining = false; + } + module4.exports = immediate; + function immediate(task) { + if (queue.push(task) === 1 && !draining) { + scheduleDrain(); + } + } + }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); + }, {}], 2: [function(_dereq_, module4, exports3) { + "use strict"; + var immediate = _dereq_(1); + function INTERNAL() { + } + var handlers = {}; + var REJECTED = ["REJECTED"]; + var FULFILLED = ["FULFILLED"]; + var PENDING = ["PENDING"]; + module4.exports = Promise2; + function Promise2(resolver) { + if (typeof resolver !== "function") { + throw new TypeError("resolver must be a function"); + } + this.state = PENDING; + this.queue = []; + this.outcome = void 0; + if (resolver !== INTERNAL) { + safelyResolveThenable(this, resolver); + } + } + Promise2.prototype["catch"] = function(onRejected) { + return this.then(null, onRejected); + }; + Promise2.prototype.then = function(onFulfilled, onRejected) { + if (typeof onFulfilled !== "function" && this.state === FULFILLED || typeof onRejected !== "function" && this.state === REJECTED) { + return this; + } + var promise = new this.constructor(INTERNAL); + if (this.state !== PENDING) { + var resolver = this.state === FULFILLED ? onFulfilled : onRejected; + unwrap(promise, resolver, this.outcome); + } else { + this.queue.push(new QueueItem(promise, onFulfilled, onRejected)); + } return promise; + }; + function QueueItem(promise, onFulfilled, onRejected) { + this.promise = promise; + if (typeof onFulfilled === "function") { + this.onFulfilled = onFulfilled; + this.callFulfilled = this.otherCallFulfilled; + } + if (typeof onRejected === "function") { + this.onRejected = onRejected; + this.callRejected = this.otherCallRejected; + } } - function key$2(n2, callback) { - var self2 = this; - var promise = self2.ready().then(function() { - var dbInfo = self2._dbInfo; - var result; + QueueItem.prototype.callFulfilled = function(value) { + handlers.resolve(this.promise, value); + }; + QueueItem.prototype.otherCallFulfilled = function(value) { + unwrap(this.promise, this.onFulfilled, value); + }; + QueueItem.prototype.callRejected = function(value) { + handlers.reject(this.promise, value); + }; + QueueItem.prototype.otherCallRejected = function(value) { + unwrap(this.promise, this.onRejected, value); + }; + function unwrap(promise, func, value) { + immediate(function() { + var returnValue; try { - result = localStorage.key(n2); - } catch (error) { - result = null; + returnValue = func(value); + } catch (e4) { + return handlers.reject(promise, e4); } - if (result) { - result = result.substring(dbInfo.keyPrefix.length); + if (returnValue === promise) { + handlers.reject(promise, new TypeError("Cannot resolve promise with itself")); + } else { + handlers.resolve(promise, returnValue); } - return result; }); - executeCallback(promise, callback); - return promise; } - function keys$2(callback) { - var self2 = this; - var promise = self2.ready().then(function() { - var dbInfo = self2._dbInfo; - var length2 = localStorage.length; - var keys2 = []; - for (var i4 = 0; i4 < length2; i4++) { - var itemKey = localStorage.key(i4); - if (itemKey.indexOf(dbInfo.keyPrefix) === 0) { - keys2.push(itemKey.substring(dbInfo.keyPrefix.length)); - } + handlers.resolve = function(self2, value) { + var result = tryCatch(getThen, value); + if (result.status === "error") { + return handlers.reject(self2, result.value); + } + var thenable = result.value; + if (thenable) { + safelyResolveThenable(self2, thenable); + } else { + self2.state = FULFILLED; + self2.outcome = value; + var i4 = -1; + var len = self2.queue.length; + while (++i4 < len) { + self2.queue[i4].callFulfilled(value); } - return keys2; - }); - executeCallback(promise, callback); - return promise; + } + return self2; + }; + handlers.reject = function(self2, error) { + self2.state = REJECTED; + self2.outcome = error; + var i4 = -1; + var len = self2.queue.length; + while (++i4 < len) { + self2.queue[i4].callRejected(error); + } + return self2; + }; + function getThen(obj) { + var then = obj && obj.then; + if (obj && (typeof obj === "object" || typeof obj === "function") && typeof then === "function") { + return function appyThen() { + then.apply(obj, arguments); + }; + } } - function length$2(callback) { - var self2 = this; - var promise = self2.keys().then(function(keys2) { - return keys2.length; - }); - executeCallback(promise, callback); - return promise; + function safelyResolveThenable(self2, thenable) { + var called = false; + function onError(value) { + if (called) { + return; + } + called = true; + handlers.reject(self2, value); + } + function onSuccess(value) { + if (called) { + return; + } + called = true; + handlers.resolve(self2, value); + } + function tryToUnwrap() { + thenable(onSuccess, onError); + } + var result = tryCatch(tryToUnwrap); + if (result.status === "error") { + onError(result.value); + } } - function removeItem$2(key3, callback) { - var self2 = this; - key3 = normalizeKey(key3); - var promise = self2.ready().then(function() { - var dbInfo = self2._dbInfo; - localStorage.removeItem(dbInfo.keyPrefix + key3); - }); - executeCallback(promise, callback); - return promise; + function tryCatch(func, value) { + var out = {}; + try { + out.value = func(value); + out.status = "success"; + } catch (e4) { + out.status = "error"; + out.value = e4; + } + return out; } - function setItem$2(key3, value, callback) { + Promise2.resolve = resolve; + function resolve(value) { + if (value instanceof this) { + return value; + } + return handlers.resolve(new this(INTERNAL), value); + } + Promise2.reject = reject; + function reject(reason) { + var promise = new this(INTERNAL); + return handlers.reject(promise, reason); + } + Promise2.all = all; + function all(iterable) { var self2 = this; - key3 = normalizeKey(key3); - var promise = self2.ready().then(function() { - if (value === void 0) { - value = null; - } - var originalValue = value; - return new Promise$1(function(resolve, reject) { - var dbInfo = self2._dbInfo; - dbInfo.serializer.serialize(value, function(value2, error) { - if (error) { - reject(error); - } else { - try { - localStorage.setItem(dbInfo.keyPrefix + key3, value2); - resolve(originalValue); - } catch (e4) { - if (e4.name === "QuotaExceededError" || e4.name === "NS_ERROR_DOM_QUOTA_REACHED") { - reject(e4); - } - reject(e4); - } - } - }); - }); - }); - executeCallback(promise, callback); + if (Object.prototype.toString.call(iterable) !== "[object Array]") { + return this.reject(new TypeError("must be an array")); + } + var len = iterable.length; + var called = false; + if (!len) { + return this.resolve([]); + } + var values = new Array(len); + var resolved = 0; + var i4 = -1; + var promise = new this(INTERNAL); + while (++i4 < len) { + allResolver(iterable[i4], i4); + } return promise; - } - function dropInstance$2(options, callback) { - callback = getCallback.apply(this, arguments); - options = typeof options !== "function" && options || {}; - if (!options.name) { - var currentConfig = this.config(); - options.name = options.name || currentConfig.name; - options.storeName = options.storeName || currentConfig.storeName; + function allResolver(value, i5) { + self2.resolve(value).then(resolveFromAll, function(error) { + if (!called) { + called = true; + handlers.reject(promise, error); + } + }); + function resolveFromAll(outValue) { + values[i5] = outValue; + if (++resolved === len && !called) { + called = true; + handlers.resolve(promise, values); + } + } } + } + Promise2.race = race; + function race(iterable) { var self2 = this; - var promise; - if (!options.name) { - promise = Promise$1.reject("Invalid arguments"); - } else { - promise = new Promise$1(function(resolve) { - if (!options.storeName) { - resolve(options.name + "/"); - } else { - resolve(_getKeyPrefix(options, self2._defaultConfig)); + if (Object.prototype.toString.call(iterable) !== "[object Array]") { + return this.reject(new TypeError("must be an array")); + } + var len = iterable.length; + var called = false; + if (!len) { + return this.resolve([]); + } + var i4 = -1; + var promise = new this(INTERNAL); + while (++i4 < len) { + resolver(iterable[i4]); + } + return promise; + function resolver(value) { + self2.resolve(value).then(function(response) { + if (!called) { + called = true; + handlers.resolve(promise, response); } - }).then(function(keyPrefix) { - for (var i4 = localStorage.length - 1; i4 >= 0; i4--) { - var key3 = localStorage.key(i4); - if (key3.indexOf(keyPrefix) === 0) { - localStorage.removeItem(key3); - } + }, function(error) { + if (!called) { + called = true; + handlers.reject(promise, error); } }); } - executeCallback(promise, callback); - return promise; } - var localStorageWrapper = { - _driver: "localStorageWrapper", - _initStorage: _initStorage$2, - _support: isLocalStorageValid(), - iterate: iterate$2, - getItem: getItem$2, - setItem: setItem$2, - removeItem: removeItem$2, - clear: clear$2, - length: length$2, - key: key$2, - keys: keys$2, - dropInstance: dropInstance$2 - }; - var sameValue = function sameValue2(x5, y5) { - return x5 === y5 || typeof x5 === "number" && typeof y5 === "number" && isNaN(x5) && isNaN(y5); - }; - var includes = function includes2(array, searchElement) { - var len = array.length; - var i4 = 0; - while (i4 < len) { - if (sameValue(array[i4], searchElement)) { - return true; - } - i4++; + }, { "1": 1 }], 3: [function(_dereq_, module4, exports3) { + (function(global2) { + "use strict"; + if (typeof global2.Promise !== "function") { + global2.Promise = _dereq_(2); } - return false; - }; - var isArray2 = Array.isArray || function(arg) { - return Object.prototype.toString.call(arg) === "[object Array]"; - }; - var DefinedDrivers = {}; - var DriverSupport = {}; - var DefaultDrivers = { - INDEXEDDB: asyncStorage, - WEBSQL: webSQLStorage, - LOCALSTORAGE: localStorageWrapper - }; - var DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver]; - var OptionalDriverMethods = ["dropInstance"]; - var LibraryMethods = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(OptionalDriverMethods); - var DefaultConfig = { - description: "", - driver: DefaultDriverOrder.slice(), - name: "localforage", - size: 4980736, - storeName: "keyvaluepairs", - version: 1 + }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); + }, { "2": 2 }], 4: [function(_dereq_, module4, exports3) { + "use strict"; + var _typeof5 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { + return typeof obj; + } : function(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - function callWhenReady(localForageInstance, libraryMethod) { - localForageInstance[libraryMethod] = function() { - var _args = arguments; - return localForageInstance.ready().then(function() { - return localForageInstance[libraryMethod].apply(localForageInstance, _args); - }); - }; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } } - function extend2() { - for (var i4 = 1; i4 < arguments.length; i4++) { - var arg = arguments[i4]; - if (arg) { - for (var _key in arg) { - if (arg.hasOwnProperty(_key)) { - if (isArray2(arg[_key])) { - arguments[0][_key] = arg[_key].slice(); - } else { - arguments[0][_key] = arg[_key]; - } - } - } + function getIDB() { + try { + if (typeof indexedDB !== "undefined") { + return indexedDB; } + if (typeof webkitIndexedDB !== "undefined") { + return webkitIndexedDB; + } + if (typeof mozIndexedDB !== "undefined") { + return mozIndexedDB; + } + if (typeof OIndexedDB !== "undefined") { + return OIndexedDB; + } + if (typeof msIndexedDB !== "undefined") { + return msIndexedDB; + } + } catch (e4) { + return; } - return arguments[0]; } - var LocalForage = function() { - function LocalForage2(options) { - _classCallCheck(this, LocalForage2); - for (var driverTypeKey in DefaultDrivers) { - if (DefaultDrivers.hasOwnProperty(driverTypeKey)) { - var driver = DefaultDrivers[driverTypeKey]; - var driverName = driver._driver; - this[driverTypeKey] = driverName; - if (!DefinedDrivers[driverName]) { - this.defineDriver(driver); - } - } + var idb = getIDB(); + function isIndexedDBValid() { + try { + if (!idb || !idb.open) { + return false; } - this._defaultConfig = extend2({}, DefaultConfig); - this._config = extend2({}, this._defaultConfig, options); - this._driverSet = null; - this._initDriver = null; - this._ready = false; - this._dbInfo = null; - this._wrapLibraryMethodsWithReady(); - this.setDriver(this._config.driver)["catch"](function() { + var isSafari = typeof openDatabase !== "undefined" && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform); + var hasFetch = typeof fetch === "function" && fetch.toString().indexOf("[native code") !== -1; + return (!isSafari || hasFetch) && typeof indexedDB !== "undefined" && typeof IDBKeyRange !== "undefined"; + } catch (e4) { + return false; + } + } + function createBlob(parts, properties2) { + parts = parts || []; + properties2 = properties2 || {}; + try { + return new Blob(parts, properties2); + } catch (e4) { + if (e4.name !== "TypeError") { + throw e4; + } + var Builder = typeof BlobBuilder !== "undefined" ? BlobBuilder : typeof MSBlobBuilder !== "undefined" ? MSBlobBuilder : typeof MozBlobBuilder !== "undefined" ? MozBlobBuilder : WebKitBlobBuilder; + var builder = new Builder(); + for (var i4 = 0; i4 < parts.length; i4 += 1) { + builder.append(parts[i4]); + } + return builder.getBlob(properties2.type); + } + } + if (typeof Promise === "undefined") { + _dereq_(3); + } + var Promise$1 = Promise; + function executeCallback(promise, callback) { + if (callback) { + promise.then(function(result) { + callback(null, result); + }, function(error) { + callback(error); }); } - LocalForage2.prototype.config = function config(options) { - if ((typeof options === "undefined" ? "undefined" : _typeof5(options)) === "object") { - if (this._ready) { - return new Error("Can't call config() after localforage has been used."); - } - for (var i4 in options) { - if (i4 === "storeName") { - options[i4] = options[i4].replace(/\W/g, "_"); - } - if (i4 === "version" && typeof options[i4] !== "number") { - return new Error("Database version must be a number."); - } - this._config[i4] = options[i4]; - } - if ("driver" in options && options.driver) { - return this.setDriver(this._config.driver); + } + function executeTwoCallbacks(promise, callback, errorCallback) { + if (typeof callback === "function") { + promise.then(callback); + } + if (typeof errorCallback === "function") { + promise["catch"](errorCallback); + } + } + function normalizeKey(key3) { + if (typeof key3 !== "string") { + console.warn(key3 + " used as a key, but it is not a string."); + key3 = String(key3); + } + return key3; + } + function getCallback() { + if (arguments.length && typeof arguments[arguments.length - 1] === "function") { + return arguments[arguments.length - 1]; + } + } + var DETECT_BLOB_SUPPORT_STORE = "local-forage-detect-blob-support"; + var supportsBlobs = void 0; + var dbContexts = {}; + var toString3 = Object.prototype.toString; + var READ_ONLY = "readonly"; + var READ_WRITE = "readwrite"; + function _binStringToArrayBuffer(bin) { + var length2 = bin.length; + var buf = new ArrayBuffer(length2); + var arr = new Uint8Array(buf); + for (var i4 = 0; i4 < length2; i4++) { + arr[i4] = bin.charCodeAt(i4); + } + return buf; + } + function _checkBlobSupportWithoutCaching(idb2) { + return new Promise$1(function(resolve) { + var txn = idb2.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE); + var blob = createBlob([""]); + txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, "key"); + txn.onabort = function(e4) { + e4.preventDefault(); + e4.stopPropagation(); + resolve(false); + }; + txn.oncomplete = function() { + var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/); + var matchedEdge = navigator.userAgent.match(/Edge\//); + resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43); + }; + })["catch"](function() { + return false; + }); + } + function _checkBlobSupport(idb2) { + if (typeof supportsBlobs === "boolean") { + return Promise$1.resolve(supportsBlobs); + } + return _checkBlobSupportWithoutCaching(idb2).then(function(value) { + supportsBlobs = value; + return supportsBlobs; + }); + } + function _deferReadiness(dbInfo) { + var dbContext = dbContexts[dbInfo.name]; + var deferredOperation = {}; + deferredOperation.promise = new Promise$1(function(resolve, reject) { + deferredOperation.resolve = resolve; + deferredOperation.reject = reject; + }); + dbContext.deferredOperations.push(deferredOperation); + if (!dbContext.dbReady) { + dbContext.dbReady = deferredOperation.promise; + } else { + dbContext.dbReady = dbContext.dbReady.then(function() { + return deferredOperation.promise; + }); + } + } + function _advanceReadiness(dbInfo) { + var dbContext = dbContexts[dbInfo.name]; + var deferredOperation = dbContext.deferredOperations.pop(); + if (deferredOperation) { + deferredOperation.resolve(); + return deferredOperation.promise; + } + } + function _rejectReadiness(dbInfo, err) { + var dbContext = dbContexts[dbInfo.name]; + var deferredOperation = dbContext.deferredOperations.pop(); + if (deferredOperation) { + deferredOperation.reject(err); + return deferredOperation.promise; + } + } + function _getConnection(dbInfo, upgradeNeeded) { + return new Promise$1(function(resolve, reject) { + dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext(); + if (dbInfo.db) { + if (upgradeNeeded) { + _deferReadiness(dbInfo); + dbInfo.db.close(); + } else { + return resolve(dbInfo.db); } - return true; - } else if (typeof options === "string") { - return this._config[options]; - } else { - return this._config; } - }; - LocalForage2.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) { - var promise = new Promise$1(function(resolve, reject) { - try { - var driverName = driverObject._driver; - var complianceError = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"); - if (!driverObject._driver) { - reject(complianceError); - return; - } - var driverMethods = LibraryMethods.concat("_initStorage"); - for (var i4 = 0, len = driverMethods.length; i4 < len; i4++) { - var driverMethodName = driverMethods[i4]; - var isRequired = !includes(OptionalDriverMethods, driverMethodName); - if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== "function") { - reject(complianceError); - return; - } - } - var configureMissingMethods = function configureMissingMethods2() { - var methodNotImplementedFactory = function methodNotImplementedFactory2(methodName) { - return function() { - var error = new Error("Method " + methodName + " is not implemented by the current driver"); - var promise2 = Promise$1.reject(error); - executeCallback(promise2, arguments[arguments.length - 1]); - return promise2; - }; - }; - for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) { - var optionalDriverMethod = OptionalDriverMethods[_i]; - if (!driverObject[optionalDriverMethod]) { - driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod); - } - } - }; - configureMissingMethods(); - var setDriverSupport = function setDriverSupport2(support) { - if (DefinedDrivers[driverName]) { - console.info("Redefining LocalForage driver: " + driverName); + var dbArgs = [dbInfo.name]; + if (upgradeNeeded) { + dbArgs.push(dbInfo.version); + } + var openreq = idb.open.apply(idb, dbArgs); + if (upgradeNeeded) { + openreq.onupgradeneeded = function(e4) { + var db = openreq.result; + try { + db.createObjectStore(dbInfo.storeName); + if (e4.oldVersion <= 1) { + db.createObjectStore(DETECT_BLOB_SUPPORT_STORE); } - DefinedDrivers[driverName] = driverObject; - DriverSupport[driverName] = support; - resolve(); - }; - if ("_support" in driverObject) { - if (driverObject._support && typeof driverObject._support === "function") { - driverObject._support().then(setDriverSupport, reject); + } catch (ex) { + if (ex.name === "ConstraintError") { + console.warn('The database "' + dbInfo.name + '" has been upgraded from version ' + e4.oldVersion + " to version " + e4.newVersion + ', but the storage "' + dbInfo.storeName + '" already exists.'); } else { - setDriverSupport(!!driverObject._support); + throw ex; } - } else { - setDriverSupport(true); } - } catch (e4) { - reject(e4); - } - }); - executeTwoCallbacks(promise, callback, errorCallback); - return promise; - }; - LocalForage2.prototype.driver = function driver() { - return this._driver || null; - }; - LocalForage2.prototype.getDriver = function getDriver(driverName, callback, errorCallback) { - var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error("Driver not found.")); - executeTwoCallbacks(getDriverPromise, callback, errorCallback); - return getDriverPromise; - }; - LocalForage2.prototype.getSerializer = function getSerializer(callback) { - var serializerPromise = Promise$1.resolve(localforageSerializer); - executeTwoCallbacks(serializerPromise, callback); - return serializerPromise; - }; - LocalForage2.prototype.ready = function ready(callback) { - var self2 = this; - var promise = self2._driverSet.then(function() { - if (self2._ready === null) { - self2._ready = self2._initDriver(); + }; + } + openreq.onerror = function(e4) { + e4.preventDefault(); + reject(openreq.error); + }; + openreq.onsuccess = function() { + var db = openreq.result; + db.onversionchange = function(e4) { + e4.target.close(); + }; + resolve(db); + _advanceReadiness(dbInfo); + }; + }); + } + function _getOriginalConnection(dbInfo) { + return _getConnection(dbInfo, false); + } + function _getUpgradedConnection(dbInfo) { + return _getConnection(dbInfo, true); + } + function _isUpgradeNeeded(dbInfo, defaultVersion) { + if (!dbInfo.db) { + return true; + } + var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName); + var isDowngrade = dbInfo.version < dbInfo.db.version; + var isUpgrade = dbInfo.version > dbInfo.db.version; + if (isDowngrade) { + if (dbInfo.version !== defaultVersion) { + console.warn('The database "' + dbInfo.name + `" can't be downgraded from version ` + dbInfo.db.version + " to version " + dbInfo.version + "."); + } + dbInfo.version = dbInfo.db.version; + } + if (isUpgrade || isNewStore) { + if (isNewStore) { + var incVersion = dbInfo.db.version + 1; + if (incVersion > dbInfo.version) { + dbInfo.version = incVersion; } - return self2._ready; - }); - executeTwoCallbacks(promise, callback, callback); - return promise; - }; - LocalForage2.prototype.setDriver = function setDriver(drivers, callback, errorCallback) { - var self2 = this; - if (!isArray2(drivers)) { - drivers = [drivers]; } - var supportedDrivers = this._getSupportedDrivers(drivers); - function setDriverToConfig() { - self2._config.driver = self2.driver(); + return true; + } + return false; + } + function _encodeBlob(blob) { + return new Promise$1(function(resolve, reject) { + var reader = new FileReader(); + reader.onerror = reject; + reader.onloadend = function(e4) { + var base64 = btoa(e4.target.result || ""); + resolve({ + __local_forage_encoded_blob: true, + data: base64, + type: blob.type + }); + }; + reader.readAsBinaryString(blob); + }); + } + function _decodeBlob(encodedBlob) { + var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data)); + return createBlob([arrayBuff], { type: encodedBlob.type }); + } + function _isEncodedBlob(value) { + return value && value.__local_forage_encoded_blob; + } + function _fullyReady(callback) { + var self2 = this; + var promise = self2._initReady().then(function() { + var dbContext = dbContexts[self2._dbInfo.name]; + if (dbContext && dbContext.dbReady) { + return dbContext.dbReady; } - function extendSelfWithDriver(driver) { - self2._extend(driver); - setDriverToConfig(); - self2._ready = self2._initStorage(self2._config); - return self2._ready; + }); + executeTwoCallbacks(promise, callback, callback); + return promise; + } + function _tryReconnect(dbInfo) { + _deferReadiness(dbInfo); + var dbContext = dbContexts[dbInfo.name]; + var forages = dbContext.forages; + for (var i4 = 0; i4 < forages.length; i4++) { + var forage = forages[i4]; + if (forage._dbInfo.db) { + forage._dbInfo.db.close(); + forage._dbInfo.db = null; } - function initDriver(supportedDrivers2) { - return function() { - var currentDriverIndex = 0; - function driverPromiseLoop() { - while (currentDriverIndex < supportedDrivers2.length) { - var driverName = supportedDrivers2[currentDriverIndex]; - currentDriverIndex++; - self2._dbInfo = null; - self2._ready = null; - return self2.getDriver(driverName).then(extendSelfWithDriver)["catch"](driverPromiseLoop); + } + dbInfo.db = null; + return _getOriginalConnection(dbInfo).then(function(db) { + dbInfo.db = db; + if (_isUpgradeNeeded(dbInfo)) { + return _getUpgradedConnection(dbInfo); + } + return db; + }).then(function(db) { + dbInfo.db = dbContext.db = db; + for (var i5 = 0; i5 < forages.length; i5++) { + forages[i5]._dbInfo.db = db; + } + })["catch"](function(err) { + _rejectReadiness(dbInfo, err); + throw err; + }); + } + function createTransaction(dbInfo, mode, callback, retries) { + if (retries === void 0) { + retries = 1; + } + try { + var tx = dbInfo.db.transaction(dbInfo.storeName, mode); + callback(null, tx); + } catch (err) { + if (retries > 0 && (!dbInfo.db || err.name === "InvalidStateError" || err.name === "NotFoundError")) { + return Promise$1.resolve().then(function() { + if (!dbInfo.db || err.name === "NotFoundError" && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) { + if (dbInfo.db) { + dbInfo.version = dbInfo.db.version + 1; } - setDriverToConfig(); - var error = new Error("No available storage method found."); - self2._driverSet = Promise$1.reject(error); - return self2._driverSet; + return _getUpgradedConnection(dbInfo); } - return driverPromiseLoop(); - }; + }).then(function() { + return _tryReconnect(dbInfo).then(function() { + createTransaction(dbInfo, mode, callback, retries - 1); + }); + })["catch"](callback); } - var oldDriverSetDone = this._driverSet !== null ? this._driverSet["catch"](function() { - return Promise$1.resolve(); - }) : Promise$1.resolve(); - this._driverSet = oldDriverSetDone.then(function() { - var driverName = supportedDrivers[0]; - self2._dbInfo = null; - self2._ready = null; - return self2.getDriver(driverName).then(function(driver) { - self2._driver = driver._driver; - setDriverToConfig(); - self2._wrapLibraryMethodsWithReady(); - self2._initDriver = initDriver(supportedDrivers); - }); - })["catch"](function() { - setDriverToConfig(); - var error = new Error("No available storage method found."); - self2._driverSet = Promise$1.reject(error); - return self2._driverSet; - }); - executeTwoCallbacks(this._driverSet, callback, errorCallback); - return this._driverSet; - }; - LocalForage2.prototype.supports = function supports(driverName) { - return !!DriverSupport[driverName]; - }; - LocalForage2.prototype._extend = function _extend(libraryMethodsAndProperties) { - extend2(this, libraryMethodsAndProperties); + callback(err); + } + } + function createDbContext() { + return { + forages: [], + db: null, + dbReady: null, + deferredOperations: [] }; - LocalForage2.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) { - var supportedDrivers = []; - for (var i4 = 0, len = drivers.length; i4 < len; i4++) { - var driverName = drivers[i4]; - if (this.supports(driverName)) { - supportedDrivers.push(driverName); - } - } - return supportedDrivers; + } + function _initStorage(options) { + var self2 = this; + var dbInfo = { + db: null }; - LocalForage2.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() { - for (var i4 = 0, len = LibraryMethods.length; i4 < len; i4++) { - callWhenReady(this, LibraryMethods[i4]); + if (options) { + for (var i4 in options) { + dbInfo[i4] = options[i4]; } - }; - LocalForage2.prototype.createInstance = function createInstance(options) { - return new LocalForage2(options); - }; - return LocalForage2; - }(); - var localforage_js = new LocalForage(); - module4.exports = localforage_js; - }, { "3": 3 }] }, {}, [4])(4); - }); - } -}); - -// node_modules/sql.js/dist/sql-wasm.js -var require_sql_wasm = __commonJS({ - "node_modules/sql.js/dist/sql-wasm.js"(exports, module2) { - var initSqlJsPromise = void 0; - var initSqlJs2 = function(moduleConfig) { - if (initSqlJsPromise) { - return initSqlJsPromise; - } - initSqlJsPromise = new Promise(function(resolveModule, reject) { - var Module = typeof moduleConfig !== "undefined" ? moduleConfig : {}; - var originalOnAbortFunction = Module["onAbort"]; - Module["onAbort"] = function(errorThatCausedAbort) { - reject(new Error(errorThatCausedAbort)); - if (originalOnAbortFunction) { - originalOnAbortFunction(errorThatCausedAbort); } - }; - Module["postRun"] = Module["postRun"] || []; - Module["postRun"].push(function() { - resolveModule(Module); - }); - module2 = void 0; - var e4; - e4 || (e4 = typeof Module !== "undefined" ? Module : {}); - null; - e4.onRuntimeInitialized = function() { - function a5(g4, m5) { - switch (typeof m5) { - case "boolean": - gc(g4, m5 ? 1 : 0); - break; - case "number": - hc(g4, m5); - break; - case "string": - ic(g4, m5, -1, -1); - break; - case "object": - if (null === m5) - kb(g4); - else if (null != m5.length) { - var n2 = aa(m5); - jc(g4, n2, m5.length, -1); - ba(n2); - } else - xa(g4, "Wrong API use : tried to return a value of an unknown type (" + m5 + ").", -1); - break; - default: - kb(g4); - } - } - function b4(g4, m5) { - for (var n2 = [], p3 = 0; p3 < g4; p3 += 1) { - var v3 = l3(m5 + 4 * p3, "i32"), y5 = kc(v3); - if (1 === y5 || 2 === y5) - v3 = lc(v3); - else if (3 === y5) - v3 = mc(v3); - else if (4 === y5) { - y5 = v3; - v3 = nc(y5); - y5 = oc(y5); - for (var L4 = new Uint8Array(v3), G3 = 0; G3 < v3; G3 += 1) - L4[G3] = r3[y5 + G3]; - v3 = L4; - } else - v3 = null; - n2.push(v3); - } - return n2; + var dbContext = dbContexts[dbInfo.name]; + if (!dbContext) { + dbContext = createDbContext(); + dbContexts[dbInfo.name] = dbContext; } - function c4(g4, m5) { - this.La = g4; - this.db = m5; - this.Ja = 1; - this.fb = []; + dbContext.forages.push(self2); + if (!self2._initReady) { + self2._initReady = self2.ready; + self2.ready = _fullyReady; } - function d5(g4, m5) { - this.db = m5; - m5 = ca(g4) + 1; - this.Ya = da(m5); - if (null === this.Ya) - throw Error("Unable to allocate memory for the SQL string"); - t4(g4, u4, this.Ya, m5); - this.eb = this.Ya; - this.Ua = this.ib = null; + var initPromises = []; + function ignoreErrors() { + return Promise$1.resolve(); } - function f4(g4) { - this.filename = "dbfile_" + (4294967295 * Math.random() >>> 0); - if (null != g4) { - var m5 = this.filename, n2 = "/", p3 = m5; - n2 && (n2 = "string" == typeof n2 ? n2 : ea(n2), p3 = m5 ? z5(n2 + "/" + m5) : n2); - m5 = fa( - true, - true - ); - p3 = ha(p3, (void 0 !== m5 ? m5 : 438) & 4095 | 32768, 0); - if (g4) { - if ("string" == typeof g4) { - n2 = Array(g4.length); - for (var v3 = 0, y5 = g4.length; v3 < y5; ++v3) - n2[v3] = g4.charCodeAt(v3); - g4 = n2; - } - ia(p3, m5 | 146); - n2 = ja(p3, 577); - ka(n2, g4, 0, g4.length, 0); - la(n2); - ia(p3, m5); - } + for (var j4 = 0; j4 < dbContext.forages.length; j4++) { + var forage = dbContext.forages[j4]; + if (forage !== self2) { + initPromises.push(forage._initReady()["catch"](ignoreErrors)); } - this.handleError(q5(this.filename, h5)); - this.db = l3(h5, "i32"); - pc(this.db); - this.Za = {}; - this.Na = {}; } - var h5 = B5(4), k5 = e4.cwrap, q5 = k5("sqlite3_open", "number", ["string", "number"]), x5 = k5("sqlite3_close_v2", "number", ["number"]), w5 = k5("sqlite3_exec", "number", ["number", "string", "number", "number", "number"]), A4 = k5( - "sqlite3_changes", - "number", - ["number"] - ), S4 = k5("sqlite3_prepare_v2", "number", ["number", "string", "number", "number", "number"]), nb = k5("sqlite3_sql", "string", ["number"]), qc = k5("sqlite3_normalized_sql", "string", ["number"]), ob = k5("sqlite3_prepare_v2", "number", ["number", "number", "number", "number", "number"]), rc = k5("sqlite3_bind_text", "number", ["number", "number", "number", "number", "number"]), pb = k5("sqlite3_bind_blob", "number", ["number", "number", "number", "number", "number"]), sc = k5("sqlite3_bind_double", "number", ["number", "number", "number"]), tc = k5("sqlite3_bind_int", "number", ["number", "number", "number"]), uc = k5("sqlite3_bind_parameter_index", "number", ["number", "string"]), vc = k5("sqlite3_step", "number", ["number"]), wc = k5("sqlite3_errmsg", "string", ["number"]), xc = k5("sqlite3_column_count", "number", ["number"]), yc = k5("sqlite3_data_count", "number", ["number"]), zc = k5("sqlite3_column_double", "number", ["number", "number"]), qb = k5("sqlite3_column_text", "string", ["number", "number"]), Ac = k5("sqlite3_column_blob", "number", ["number", "number"]), Bc = k5( - "sqlite3_column_bytes", - "number", - ["number", "number"] - ), Cc = k5("sqlite3_column_type", "number", ["number", "number"]), Dc = k5("sqlite3_column_name", "string", ["number", "number"]), Ec = k5("sqlite3_reset", "number", ["number"]), Fc = k5("sqlite3_clear_bindings", "number", ["number"]), Gc = k5("sqlite3_finalize", "number", ["number"]), rb = k5("sqlite3_create_function_v2", "number", "number string number number number number number number number".split(" ")), kc = k5("sqlite3_value_type", "number", ["number"]), nc = k5("sqlite3_value_bytes", "number", ["number"]), mc = k5( - "sqlite3_value_text", - "string", - ["number"] - ), oc = k5("sqlite3_value_blob", "number", ["number"]), lc = k5("sqlite3_value_double", "number", ["number"]), hc = k5("sqlite3_result_double", "", ["number", "number"]), kb = k5("sqlite3_result_null", "", ["number"]), ic = k5("sqlite3_result_text", "", ["number", "string", "number", "number"]), jc = k5("sqlite3_result_blob", "", ["number", "number", "number", "number"]), gc = k5("sqlite3_result_int", "", ["number", "number"]), xa = k5("sqlite3_result_error", "", ["number", "string", "number"]), sb = k5( - "sqlite3_aggregate_context", - "number", - ["number", "number"] - ), pc = k5("RegisterExtensionFunctions", "number", ["number"]); - c4.prototype.bind = function(g4) { - if (!this.La) - throw "Statement closed"; - this.reset(); - return Array.isArray(g4) ? this.xb(g4) : null != g4 && "object" === typeof g4 ? this.yb(g4) : true; - }; - c4.prototype.step = function() { - if (!this.La) - throw "Statement closed"; - this.Ja = 1; - var g4 = vc(this.La); - switch (g4) { - case 100: - return true; - case 101: - return false; - default: - throw this.db.handleError(g4); + var forages = dbContext.forages.slice(0); + return Promise$1.all(initPromises).then(function() { + dbInfo.db = dbContext.db; + return _getOriginalConnection(dbInfo); + }).then(function(db) { + dbInfo.db = db; + if (_isUpgradeNeeded(dbInfo, self2._defaultConfig.version)) { + return _getUpgradedConnection(dbInfo); } - }; - c4.prototype.sb = function(g4) { - null == g4 && (g4 = this.Ja, this.Ja += 1); - return zc(this.La, g4); - }; - c4.prototype.Cb = function(g4) { - null == g4 && (g4 = this.Ja, this.Ja += 1); - g4 = qb(this.La, g4); - if ("function" !== typeof BigInt) - throw Error("BigInt is not supported"); - return BigInt(g4); - }; - c4.prototype.Db = function(g4) { - null == g4 && (g4 = this.Ja, this.Ja += 1); - return qb(this.La, g4); - }; - c4.prototype.getBlob = function(g4) { - null == g4 && (g4 = this.Ja, this.Ja += 1); - var m5 = Bc(this.La, g4); - g4 = Ac(this.La, g4); - for (var n2 = new Uint8Array(m5), p3 = 0; p3 < m5; p3 += 1) - n2[p3] = r3[g4 + p3]; - return n2; - }; - c4.prototype.get = function(g4, m5) { - m5 = m5 || {}; - null != g4 && this.bind(g4) && this.step(); - g4 = []; - for (var n2 = yc(this.La), p3 = 0; p3 < n2; p3 += 1) - switch (Cc(this.La, p3)) { - case 1: - var v3 = m5.useBigInt ? this.Cb(p3) : this.sb(p3); - g4.push(v3); - break; - case 2: - g4.push(this.sb(p3)); - break; - case 3: - g4.push(this.Db(p3)); - break; - case 4: - g4.push(this.getBlob(p3)); - break; - default: - g4.push(null); + return db; + }).then(function(db) { + dbInfo.db = dbContext.db = db; + self2._dbInfo = dbInfo; + for (var k5 = 0; k5 < forages.length; k5++) { + var forage2 = forages[k5]; + if (forage2 !== self2) { + forage2._dbInfo.db = dbInfo.db; + forage2._dbInfo.version = dbInfo.version; } - return g4; - }; - c4.prototype.getColumnNames = function() { - for (var g4 = [], m5 = xc(this.La), n2 = 0; n2 < m5; n2 += 1) - g4.push(Dc(this.La, n2)); - return g4; - }; - c4.prototype.getAsObject = function(g4, m5) { - g4 = this.get(g4, m5); - m5 = this.getColumnNames(); - for (var n2 = {}, p3 = 0; p3 < m5.length; p3 += 1) - n2[m5[p3]] = g4[p3]; - return n2; - }; - c4.prototype.getSQL = function() { - return nb(this.La); - }; - c4.prototype.getNormalizedSQL = function() { - return qc(this.La); - }; - c4.prototype.run = function(g4) { - null != g4 && this.bind(g4); - this.step(); - return this.reset(); - }; - c4.prototype.nb = function(g4, m5) { - null == m5 && (m5 = this.Ja, this.Ja += 1); - g4 = ma(g4); - var n2 = aa(g4); - this.fb.push(n2); - this.db.handleError(rc(this.La, m5, n2, g4.length - 1, 0)); - }; - c4.prototype.wb = function(g4, m5) { - null == m5 && (m5 = this.Ja, this.Ja += 1); - var n2 = aa(g4); - this.fb.push(n2); - this.db.handleError(pb(this.La, m5, n2, g4.length, 0)); - }; - c4.prototype.mb = function(g4, m5) { - null == m5 && (m5 = this.Ja, this.Ja += 1); - this.db.handleError((g4 === (g4 | 0) ? tc : sc)(this.La, m5, g4)); - }; - c4.prototype.zb = function(g4) { - null == g4 && (g4 = this.Ja, this.Ja += 1); - pb(this.La, g4, 0, 0, 0); - }; - c4.prototype.ob = function(g4, m5) { - null == m5 && (m5 = this.Ja, this.Ja += 1); - switch (typeof g4) { - case "string": - this.nb(g4, m5); - return; - case "number": - this.mb(g4, m5); - return; - case "bigint": - this.nb(g4.toString(), m5); - return; - case "boolean": - this.mb(g4 + 0, m5); - return; - case "object": - if (null === g4) { - this.zb(m5); - return; + } + }); + } + function getItem(key3, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { + if (err) { + return reject(err); } - if (null != g4.length) { - this.wb(g4, m5); - return; + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + var req = store.get(key3); + req.onsuccess = function() { + var value = req.result; + if (value === void 0) { + value = null; + } + if (_isEncodedBlob(value)) { + value = _decodeBlob(value); + } + resolve(value); + }; + req.onerror = function() { + reject(req.error); + }; + } catch (e4) { + reject(e4); } - } - throw "Wrong API use : tried to bind a value of an unknown type (" + g4 + ")."; - }; - c4.prototype.yb = function(g4) { - var m5 = this; - Object.keys(g4).forEach(function(n2) { - var p3 = uc(m5.La, n2); - 0 !== p3 && m5.ob(g4[n2], p3); - }); - return true; - }; - c4.prototype.xb = function(g4) { - for (var m5 = 0; m5 < g4.length; m5 += 1) - this.ob(g4[m5], m5 + 1); - return true; - }; - c4.prototype.reset = function() { - this.freemem(); - return 0 === Fc(this.La) && 0 === Ec(this.La); - }; - c4.prototype.freemem = function() { - for (var g4; void 0 !== (g4 = this.fb.pop()); ) - ba(g4); - }; - c4.prototype.free = function() { - this.freemem(); - var g4 = 0 === Gc(this.La); - delete this.db.Za[this.La]; - this.La = 0; - return g4; - }; - d5.prototype.next = function() { - if (null === this.Ya) - return { done: true }; - null !== this.Ua && (this.Ua.free(), this.Ua = null); - if (!this.db.db) - throw this.gb(), Error("Database closed"); - var g4 = oa(), m5 = B5(4); - pa(h5); - pa(m5); - try { - this.db.handleError(ob(this.db.db, this.eb, -1, h5, m5)); - this.eb = l3(m5, "i32"); - var n2 = l3(h5, "i32"); - if (0 === n2) - return this.gb(), { done: true }; - this.Ua = new c4(n2, this.db); - this.db.Za[n2] = this.Ua; - return { value: this.Ua, done: false }; - } catch (p3) { - throw this.ib = C3(this.eb), this.gb(), p3; - } finally { - qa(g4); - } - }; - d5.prototype.gb = function() { - ba(this.Ya); - this.Ya = null; - }; - d5.prototype.getRemainingSQL = function() { - return null !== this.ib ? this.ib : C3(this.eb); - }; - "function" === typeof Symbol && "symbol" === typeof Symbol.iterator && (d5.prototype[Symbol.iterator] = function() { - return this; + }); + })["catch"](reject); }); - f4.prototype.run = function(g4, m5) { - if (!this.db) - throw "Database closed"; - if (m5) { - g4 = this.prepare(g4, m5); - try { - g4.step(); - } finally { - g4.free(); - } - } else - this.handleError(w5(this.db, g4, 0, 0, h5)); - return this; - }; - f4.prototype.exec = function(g4, m5, n2) { - if (!this.db) - throw "Database closed"; - var p3 = oa(), v3 = null; - try { - var y5 = ca(g4) + 1, L4 = B5(y5); - t4(g4, r3, L4, y5); - var G3 = L4; - var H5 = B5(4); - for (g4 = []; 0 !== l3(G3, "i8"); ) { - pa(h5); - pa(H5); - this.handleError(ob(this.db, G3, -1, h5, H5)); - var I4 = l3(h5, "i32"); - G3 = l3(H5, "i32"); - if (0 !== I4) { - y5 = null; - v3 = new c4(I4, this); - for (null != m5 && v3.bind(m5); v3.step(); ) - null === y5 && (y5 = { columns: v3.getColumnNames(), values: [] }, g4.push(y5)), y5.values.push(v3.get(null, n2)); - v3.free(); + executeCallback(promise, callback); + return promise; + } + function iterate(iterator, callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { + if (err) { + return reject(err); + } + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + var req = store.openCursor(); + var iterationNumber = 1; + req.onsuccess = function() { + var cursor = req.result; + if (cursor) { + var value = cursor.value; + if (_isEncodedBlob(value)) { + value = _decodeBlob(value); + } + var result = iterator(value, cursor.key, iterationNumber++); + if (result !== void 0) { + resolve(result); + } else { + cursor["continue"](); + } + } else { + resolve(); + } + }; + req.onerror = function() { + reject(req.error); + }; + } catch (e4) { + reject(e4); } + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function setItem(key3, value, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = new Promise$1(function(resolve, reject) { + var dbInfo; + self2.ready().then(function() { + dbInfo = self2._dbInfo; + if (toString3.call(value) === "[object Blob]") { + return _checkBlobSupport(dbInfo.db).then(function(blobSupport) { + if (blobSupport) { + return value; + } + return _encodeBlob(value); + }); } - return g4; - } catch (na) { - throw v3 && v3.free(), na; - } finally { - qa(p3); - } - }; - f4.prototype.each = function(g4, m5, n2, p3, v3) { - "function" === typeof m5 && (p3 = n2, n2 = m5, m5 = void 0); - g4 = this.prepare(g4, m5); - try { - for (; g4.step(); ) - n2(g4.getAsObject(null, v3)); - } finally { - g4.free(); - } - if ("function" === typeof p3) - return p3(); - }; - f4.prototype.prepare = function(g4, m5) { - pa(h5); - this.handleError(S4(this.db, g4, -1, h5, 0)); - g4 = l3(h5, "i32"); - if (0 === g4) - throw "Nothing to prepare"; - var n2 = new c4(g4, this); - null != m5 && n2.bind(m5); - return this.Za[g4] = n2; - }; - f4.prototype.iterateStatements = function(g4) { - return new d5(g4, this); - }; - f4.prototype["export"] = function() { - Object.values(this.Za).forEach(function(m5) { - m5.free(); - }); - Object.values(this.Na).forEach(ra); - this.Na = {}; - this.handleError(x5(this.db)); - var g4 = sa(this.filename); - this.handleError(q5(this.filename, h5)); - this.db = l3(h5, "i32"); - return g4; - }; - f4.prototype.close = function() { - null !== this.db && (Object.values(this.Za).forEach(function(g4) { - g4.free(); - }), Object.values(this.Na).forEach(ra), this.Na = {}, this.handleError(x5(this.db)), ta("/" + this.filename), this.db = null); - }; - f4.prototype.handleError = function(g4) { - if (0 === g4) - return null; - g4 = wc(this.db); - throw Error(g4); - }; - f4.prototype.getRowsModified = function() { - return A4(this.db); - }; - f4.prototype.create_function = function(g4, m5) { - Object.prototype.hasOwnProperty.call(this.Na, g4) && (ra(this.Na[g4]), delete this.Na[g4]); - var n2 = ua(function(p3, v3, y5) { - v3 = b4(v3, y5); - try { - var L4 = m5.apply(null, v3); - } catch (G3) { - xa(p3, G3, -1); - return; - } - a5(p3, L4); - }, "viii"); - this.Na[g4] = n2; - this.handleError(rb(this.db, g4, m5.length, 1, 0, n2, 0, 0, 0)); - return this; - }; - f4.prototype.create_aggregate = function(g4, m5) { - var n2 = m5.init || function() { - return null; - }, p3 = m5.finalize || function(H5) { - return H5; - }, v3 = m5.step; - if (!v3) - throw "An aggregate function must have a step function in " + g4; - var y5 = {}; - Object.hasOwnProperty.call(this.Na, g4) && (ra(this.Na[g4]), delete this.Na[g4]); - m5 = g4 + "__finalize"; - Object.hasOwnProperty.call(this.Na, m5) && (ra(this.Na[m5]), delete this.Na[m5]); - var L4 = ua(function(H5, I4, na) { - var Z2 = sb(H5, 1); - Object.hasOwnProperty.call(y5, Z2) || (y5[Z2] = n2()); - I4 = b4(I4, na); - I4 = [y5[Z2]].concat(I4); - try { - y5[Z2] = v3.apply(null, I4); - } catch (Ic) { - delete y5[Z2], xa(H5, Ic, -1); - } - }, "viii"), G3 = ua(function(H5) { - var I4 = sb(H5, 1); - try { - var na = p3(y5[I4]); - } catch (Z2) { - delete y5[I4]; - xa(H5, Z2, -1); - return; - } - a5(H5, na); - delete y5[I4]; - }, "vi"); - this.Na[g4] = L4; - this.Na[m5] = G3; - this.handleError(rb(this.db, g4, v3.length - 1, 1, 0, 0, L4, G3, 0)); - return this; - }; - e4.Database = f4; - }; - var va = Object.assign({}, e4), wa = "./this.program", ya = "object" == typeof window, za = "function" == typeof importScripts, Aa = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, D4 = "", Ba, Ca, Da, fs, Ea, Fa; - if (Aa) - D4 = za ? require("path").dirname(D4) + "/" : __dirname + "/", Fa = () => { - Ea || (fs = require("fs"), Ea = require("path")); - }, Ba = function(a5, b4) { - Fa(); - a5 = Ea.normalize(a5); - return fs.readFileSync(a5, b4 ? void 0 : "utf8"); - }, Da = (a5) => { - a5 = Ba(a5, true); - a5.buffer || (a5 = new Uint8Array(a5)); - return a5; - }, Ca = (a5, b4, c4) => { - Fa(); - a5 = Ea.normalize(a5); - fs.readFile(a5, function(d5, f4) { - d5 ? c4(d5) : b4(f4.buffer); - }); - }, 1 < process.argv.length && (wa = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), "undefined" != typeof module2 && (module2.exports = e4), e4.inspect = function() { - return "[Emscripten Module object]"; - }; - else if (ya || za) - za ? D4 = self.location.href : "undefined" != typeof document && document.currentScript && (D4 = document.currentScript.src), D4 = 0 !== D4.indexOf("blob:") ? D4.substr(0, D4.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", Ba = (a5) => { - var b4 = new XMLHttpRequest(); - b4.open("GET", a5, false); - b4.send(null); - return b4.responseText; - }, za && (Da = (a5) => { - var b4 = new XMLHttpRequest(); - b4.open("GET", a5, false); - b4.responseType = "arraybuffer"; - b4.send(null); - return new Uint8Array(b4.response); - }), Ca = (a5, b4, c4) => { - var d5 = new XMLHttpRequest(); - d5.open("GET", a5, true); - d5.responseType = "arraybuffer"; - d5.onload = () => { - 200 == d5.status || 0 == d5.status && d5.response ? b4(d5.response) : c4(); - }; - d5.onerror = c4; - d5.send(null); - }; - var Ga = e4.print || console.log.bind(console), Ha = e4.printErr || console.warn.bind(console); - Object.assign(e4, va); - va = null; - e4.thisProgram && (wa = e4.thisProgram); - var Ia; - e4.wasmBinary && (Ia = e4.wasmBinary); - var noExitRuntime = e4.noExitRuntime || true; - "object" != typeof WebAssembly && E4("no native wasm support detected"); - var Ja, Ka = false, La = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0; - function Ma(a5, b4, c4) { - var d5 = b4 + c4; - for (c4 = b4; a5[c4] && !(c4 >= d5); ) - ++c4; - if (16 < c4 - b4 && a5.buffer && La) - return La.decode(a5.subarray(b4, c4)); - for (d5 = ""; b4 < c4; ) { - var f4 = a5[b4++]; - if (f4 & 128) { - var h5 = a5[b4++] & 63; - if (192 == (f4 & 224)) - d5 += String.fromCharCode((f4 & 31) << 6 | h5); - else { - var k5 = a5[b4++] & 63; - f4 = 224 == (f4 & 240) ? (f4 & 15) << 12 | h5 << 6 | k5 : (f4 & 7) << 18 | h5 << 12 | k5 << 6 | a5[b4++] & 63; - 65536 > f4 ? d5 += String.fromCharCode(f4) : (f4 -= 65536, d5 += String.fromCharCode(55296 | f4 >> 10, 56320 | f4 & 1023)); - } - } else - d5 += String.fromCharCode(f4); - } - return d5; - } - function C3(a5, b4) { - return a5 ? Ma(u4, a5, b4) : ""; - } - function t4(a5, b4, c4, d5) { - if (!(0 < d5)) - return 0; - var f4 = c4; - d5 = c4 + d5 - 1; - for (var h5 = 0; h5 < a5.length; ++h5) { - var k5 = a5.charCodeAt(h5); - if (55296 <= k5 && 57343 >= k5) { - var q5 = a5.charCodeAt(++h5); - k5 = 65536 + ((k5 & 1023) << 10) | q5 & 1023; - } - if (127 >= k5) { - if (c4 >= d5) - break; - b4[c4++] = k5; - } else { - if (2047 >= k5) { - if (c4 + 1 >= d5) - break; - b4[c4++] = 192 | k5 >> 6; - } else { - if (65535 >= k5) { - if (c4 + 2 >= d5) - break; - b4[c4++] = 224 | k5 >> 12; - } else { - if (c4 + 3 >= d5) - break; - b4[c4++] = 240 | k5 >> 18; - b4[c4++] = 128 | k5 >> 12 & 63; + return value; + }).then(function(value2) { + createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) { + if (err) { + return reject(err); } - b4[c4++] = 128 | k5 >> 6 & 63; - } - b4[c4++] = 128 | k5 & 63; - } - } - b4[c4] = 0; - return c4 - f4; - } - function ca(a5) { - for (var b4 = 0, c4 = 0; c4 < a5.length; ++c4) { - var d5 = a5.charCodeAt(c4); - 127 >= d5 ? b4++ : 2047 >= d5 ? b4 += 2 : 55296 <= d5 && 57343 >= d5 ? (b4 += 4, ++c4) : b4 += 3; - } - return b4; - } - var Na, r3, u4, Oa, F4, J2, Pa, Qa; - function Ra() { - var a5 = Ja.buffer; - Na = a5; - e4.HEAP8 = r3 = new Int8Array(a5); - e4.HEAP16 = Oa = new Int16Array(a5); - e4.HEAP32 = F4 = new Int32Array(a5); - e4.HEAPU8 = u4 = new Uint8Array(a5); - e4.HEAPU16 = new Uint16Array(a5); - e4.HEAPU32 = J2 = new Uint32Array(a5); - e4.HEAPF32 = Pa = new Float32Array(a5); - e4.HEAPF64 = Qa = new Float64Array(a5); - } - var K3, Sa = [], Ta = [], Ua = []; - function Va() { - var a5 = e4.preRun.shift(); - Sa.unshift(a5); - } - var Wa = 0, Xa = null, Ya = null; - function E4(a5) { - if (e4.onAbort) - e4.onAbort(a5); - a5 = "Aborted(" + a5 + ")"; - Ha(a5); - Ka = true; - throw new WebAssembly.RuntimeError(a5 + ". Build with -sASSERTIONS for more info."); - } - function Za() { - return M5.startsWith("data:application/octet-stream;base64,"); - } - var M5; - M5 = "sql-wasm.wasm"; - if (!Za()) { - var $a = M5; - M5 = e4.locateFile ? e4.locateFile($a, D4) : D4 + $a; - } - function ab() { - var a5 = M5; - try { - if (a5 == M5 && Ia) - return new Uint8Array(Ia); - if (Da) - return Da(a5); - throw "both async and sync fetching of the wasm failed"; - } catch (b4) { - E4(b4); - } + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + if (value2 === null) { + value2 = void 0; + } + var req = store.put(value2, key3); + transaction.oncomplete = function() { + if (value2 === void 0) { + value2 = null; + } + resolve(value2); + }; + transaction.onabort = transaction.onerror = function() { + var err2 = req.error ? req.error : req.transaction.error; + reject(err2); + }; + } catch (e4) { + reject(e4); + } + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; } - function bb() { - if (!Ia && (ya || za)) { - if ("function" == typeof fetch && !M5.startsWith("file://")) - return fetch(M5, { credentials: "same-origin" }).then(function(a5) { - if (!a5.ok) - throw "failed to load wasm binary file at '" + M5 + "'"; - return a5.arrayBuffer(); - }).catch(function() { - return ab(); + function removeItem(key3, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) { + if (err) { + return reject(err); + } + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + var req = store["delete"](key3); + transaction.oncomplete = function() { + resolve(); + }; + transaction.onerror = function() { + reject(req.error); + }; + transaction.onabort = function() { + var err2 = req.error ? req.error : req.transaction.error; + reject(err2); + }; + } catch (e4) { + reject(e4); + } }); - if (Ca) - return new Promise(function(a5, b4) { - Ca(M5, function(c4) { - a5(new Uint8Array(c4)); - }, b4); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function clear(callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + createTransaction(self2._dbInfo, READ_WRITE, function(err, transaction) { + if (err) { + return reject(err); + } + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + var req = store.clear(); + transaction.oncomplete = function() { + resolve(); + }; + transaction.onabort = transaction.onerror = function() { + var err2 = req.error ? req.error : req.transaction.error; + reject(err2); + }; + } catch (e4) { + reject(e4); + } }); - } - return Promise.resolve().then(function() { - return ab(); + })["catch"](reject); }); + executeCallback(promise, callback); + return promise; } - var N3, O4; - function cb(a5) { - for (; 0 < a5.length; ) - a5.shift()(e4); + function length(callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { + if (err) { + return reject(err); + } + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + var req = store.count(); + req.onsuccess = function() { + resolve(req.result); + }; + req.onerror = function() { + reject(req.error); + }; + } catch (e4) { + reject(e4); + } + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; } - function l3(a5, b4 = "i8") { - b4.endsWith("*") && (b4 = "*"); - switch (b4) { - case "i1": - return r3[a5 >> 0]; - case "i8": - return r3[a5 >> 0]; - case "i16": - return Oa[a5 >> 1]; - case "i32": - return F4[a5 >> 2]; - case "i64": - return F4[a5 >> 2]; - case "float": - return Pa[a5 >> 2]; - case "double": - return Qa[a5 >> 3]; - case "*": - return J2[a5 >> 2]; - default: - E4("invalid type for getValue: " + b4); - } - return null; + function key2(n2, callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + if (n2 < 0) { + resolve(null); + return; + } + self2.ready().then(function() { + createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { + if (err) { + return reject(err); + } + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + var advanced = false; + var req = store.openKeyCursor(); + req.onsuccess = function() { + var cursor = req.result; + if (!cursor) { + resolve(null); + return; + } + if (n2 === 0) { + resolve(cursor.key); + } else { + if (!advanced) { + advanced = true; + cursor.advance(n2); + } else { + resolve(cursor.key); + } + } + }; + req.onerror = function() { + reject(req.error); + }; + } catch (e4) { + reject(e4); + } + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; } - function pa(a5) { - var b4 = "i32"; - b4.endsWith("*") && (b4 = "*"); - switch (b4) { - case "i1": - r3[a5 >> 0] = 0; - break; - case "i8": - r3[a5 >> 0] = 0; - break; - case "i16": - Oa[a5 >> 1] = 0; - break; - case "i32": - F4[a5 >> 2] = 0; - break; - case "i64": - O4 = [0, (N3 = 0, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; - F4[a5 >> 2] = O4[0]; - F4[a5 + 4 >> 2] = O4[1]; - break; - case "float": - Pa[a5 >> 2] = 0; - break; - case "double": - Qa[a5 >> 3] = 0; - break; - case "*": - J2[a5 >> 2] = 0; - break; - default: - E4("invalid type for setValue: " + b4); - } + function keys(callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + createTransaction(self2._dbInfo, READ_ONLY, function(err, transaction) { + if (err) { + return reject(err); + } + try { + var store = transaction.objectStore(self2._dbInfo.storeName); + var req = store.openKeyCursor(); + var keys2 = []; + req.onsuccess = function() { + var cursor = req.result; + if (!cursor) { + resolve(keys2); + return; + } + keys2.push(cursor.key); + cursor["continue"](); + }; + req.onerror = function() { + reject(req.error); + }; + } catch (e4) { + reject(e4); + } + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; } - var db = (a5, b4) => { - for (var c4 = 0, d5 = a5.length - 1; 0 <= d5; d5--) { - var f4 = a5[d5]; - "." === f4 ? a5.splice(d5, 1) : ".." === f4 ? (a5.splice(d5, 1), c4++) : c4 && (a5.splice(d5, 1), c4--); + function dropInstance(options, callback) { + callback = getCallback.apply(this, arguments); + var currentConfig = this.config(); + options = typeof options !== "function" && options || {}; + if (!options.name) { + options.name = options.name || currentConfig.name; + options.storeName = options.storeName || currentConfig.storeName; } - if (b4) - for (; c4; c4--) - a5.unshift(".."); - return a5; - }, z5 = (a5) => { - var b4 = "/" === a5.charAt(0), c4 = "/" === a5.substr(-1); - (a5 = db(a5.split("/").filter((d5) => !!d5), !b4).join("/")) || b4 || (a5 = "."); - a5 && c4 && (a5 += "/"); - return (b4 ? "/" : "") + a5; - }, eb = (a5) => { - var b4 = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a5).slice(1); - a5 = b4[0]; - b4 = b4[1]; - if (!a5 && !b4) - return "."; - b4 && (b4 = b4.substr(0, b4.length - 1)); - return a5 + b4; - }, fb = (a5) => { - if ("/" === a5) - return "/"; - a5 = z5(a5); - a5 = a5.replace(/\/$/, ""); - var b4 = a5.lastIndexOf("/"); - return -1 === b4 ? a5 : a5.substr(b4 + 1); - }; - function gb() { - if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) { - var a5 = new Uint8Array(1); - return () => { - crypto.getRandomValues(a5); - return a5[0]; - }; - } - if (Aa) - try { - var b4 = require("crypto"); - return () => b4.randomBytes(1)[0]; - } catch (c4) { + var self2 = this; + var promise; + if (!options.name) { + promise = Promise$1.reject("Invalid arguments"); + } else { + var isCurrentDb = options.name === currentConfig.name && self2._dbInfo.db; + var dbPromise = isCurrentDb ? Promise$1.resolve(self2._dbInfo.db) : _getOriginalConnection(options).then(function(db) { + var dbContext = dbContexts[options.name]; + var forages = dbContext.forages; + dbContext.db = db; + for (var i4 = 0; i4 < forages.length; i4++) { + forages[i4]._dbInfo.db = db; + } + return db; + }); + if (!options.storeName) { + promise = dbPromise.then(function(db) { + _deferReadiness(options); + var dbContext = dbContexts[options.name]; + var forages = dbContext.forages; + db.close(); + for (var i4 = 0; i4 < forages.length; i4++) { + var forage = forages[i4]; + forage._dbInfo.db = null; + } + var dropDBPromise = new Promise$1(function(resolve, reject) { + var req = idb.deleteDatabase(options.name); + req.onerror = function() { + var db2 = req.result; + if (db2) { + db2.close(); + } + reject(req.error); + }; + req.onblocked = function() { + console.warn('dropInstance blocked for database "' + options.name + '" until all open connections are closed'); + }; + req.onsuccess = function() { + var db2 = req.result; + if (db2) { + db2.close(); + } + resolve(db2); + }; + }); + return dropDBPromise.then(function(db2) { + dbContext.db = db2; + for (var i5 = 0; i5 < forages.length; i5++) { + var _forage = forages[i5]; + _advanceReadiness(_forage._dbInfo); + } + })["catch"](function(err) { + (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() { + }); + throw err; + }); + }); + } else { + promise = dbPromise.then(function(db) { + if (!db.objectStoreNames.contains(options.storeName)) { + return; + } + var newVersion = db.version + 1; + _deferReadiness(options); + var dbContext = dbContexts[options.name]; + var forages = dbContext.forages; + db.close(); + for (var i4 = 0; i4 < forages.length; i4++) { + var forage = forages[i4]; + forage._dbInfo.db = null; + forage._dbInfo.version = newVersion; + } + var dropObjectPromise = new Promise$1(function(resolve, reject) { + var req = idb.open(options.name, newVersion); + req.onerror = function(err) { + var db2 = req.result; + db2.close(); + reject(err); + }; + req.onupgradeneeded = function() { + var db2 = req.result; + db2.deleteObjectStore(options.storeName); + }; + req.onsuccess = function() { + var db2 = req.result; + db2.close(); + resolve(db2); + }; + }); + return dropObjectPromise.then(function(db2) { + dbContext.db = db2; + for (var j4 = 0; j4 < forages.length; j4++) { + var _forage2 = forages[j4]; + _forage2._dbInfo.db = db2; + _advanceReadiness(_forage2._dbInfo); + } + })["catch"](function(err) { + (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() { + }); + throw err; + }); + }); } - return () => E4("randomDevice"); - } - function hb() { - for (var a5 = "", b4 = false, c4 = arguments.length - 1; -1 <= c4 && !b4; c4--) { - b4 = 0 <= c4 ? arguments[c4] : "/"; - if ("string" != typeof b4) - throw new TypeError("Arguments to path.resolve must be strings"); - if (!b4) - return ""; - a5 = b4 + "/" + a5; - b4 = "/" === b4.charAt(0); } - a5 = db(a5.split("/").filter((d5) => !!d5), !b4).join("/"); - return (b4 ? "/" : "") + a5 || "."; - } - function ma(a5, b4) { - var c4 = Array(ca(a5) + 1); - a5 = t4(a5, c4, 0, c4.length); - b4 && (c4.length = a5); - return c4; + executeCallback(promise, callback); + return promise; } - var ib = []; - function jb(a5, b4) { - ib[a5] = { input: [], output: [], Xa: b4 }; - lb(a5, mb); + var asyncStorage = { + _driver: "asyncStorage", + _initStorage, + _support: isIndexedDBValid(), + iterate, + getItem, + setItem, + removeItem, + clear, + length, + key: key2, + keys, + dropInstance + }; + function isWebSQLValid() { + return typeof openDatabase === "function"; } - var mb = { open: function(a5) { - var b4 = ib[a5.node.rdev]; - if (!b4) - throw new P4(43); - a5.tty = b4; - a5.seekable = false; - }, close: function(a5) { - a5.tty.Xa.fsync(a5.tty); - }, fsync: function(a5) { - a5.tty.Xa.fsync(a5.tty); - }, read: function(a5, b4, c4, d5) { - if (!a5.tty || !a5.tty.Xa.tb) - throw new P4(60); - for (var f4 = 0, h5 = 0; h5 < d5; h5++) { - try { - var k5 = a5.tty.Xa.tb(a5.tty); - } catch (q5) { - throw new P4(29); + var BASE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var BLOB_TYPE_PREFIX = "~~local_forage_type~"; + var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/; + var SERIALIZED_MARKER = "__lfsc__:"; + var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length; + var TYPE_ARRAYBUFFER = "arbf"; + var TYPE_BLOB = "blob"; + var TYPE_INT8ARRAY = "si08"; + var TYPE_UINT8ARRAY = "ui08"; + var TYPE_UINT8CLAMPEDARRAY = "uic8"; + var TYPE_INT16ARRAY = "si16"; + var TYPE_INT32ARRAY = "si32"; + var TYPE_UINT16ARRAY = "ur16"; + var TYPE_UINT32ARRAY = "ui32"; + var TYPE_FLOAT32ARRAY = "fl32"; + var TYPE_FLOAT64ARRAY = "fl64"; + var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length; + var toString$1 = Object.prototype.toString; + function stringToBuffer(serializedString) { + var bufferLength = serializedString.length * 0.75; + var len = serializedString.length; + var i4; + var p3 = 0; + var encoded1, encoded2, encoded3, encoded4; + if (serializedString[serializedString.length - 1] === "=") { + bufferLength--; + if (serializedString[serializedString.length - 2] === "=") { + bufferLength--; } - if (void 0 === k5 && 0 === f4) - throw new P4(6); - if (null === k5 || void 0 === k5) - break; - f4++; - b4[c4 + h5] = k5; } - f4 && (a5.node.timestamp = Date.now()); - return f4; - }, write: function(a5, b4, c4, d5) { - if (!a5.tty || !a5.tty.Xa.jb) - throw new P4(60); - try { - for (var f4 = 0; f4 < d5; f4++) - a5.tty.Xa.jb(a5.tty, b4[c4 + f4]); - } catch (h5) { - throw new P4(29); + var buffer = new ArrayBuffer(bufferLength); + var bytes = new Uint8Array(buffer); + for (i4 = 0; i4 < len; i4 += 4) { + encoded1 = BASE_CHARS.indexOf(serializedString[i4]); + encoded2 = BASE_CHARS.indexOf(serializedString[i4 + 1]); + encoded3 = BASE_CHARS.indexOf(serializedString[i4 + 2]); + encoded4 = BASE_CHARS.indexOf(serializedString[i4 + 3]); + bytes[p3++] = encoded1 << 2 | encoded2 >> 4; + bytes[p3++] = (encoded2 & 15) << 4 | encoded3 >> 2; + bytes[p3++] = (encoded3 & 3) << 6 | encoded4 & 63; } - d5 && (a5.node.timestamp = Date.now()); - return f4; - } }, tb = { tb: function(a5) { - if (!a5.input.length) { - var b4 = null; - if (Aa) { - var c4 = Buffer.alloc(256), d5 = 0; - try { - d5 = fs.readSync(process.stdin.fd, c4, 0, 256, -1); - } catch (f4) { - if (f4.toString().includes("EOF")) - d5 = 0; - else - throw f4; - } - 0 < d5 ? b4 = c4.slice(0, d5).toString("utf-8") : b4 = null; - } else - "undefined" != typeof window && "function" == typeof window.prompt ? (b4 = window.prompt("Input: "), null !== b4 && (b4 += "\n")) : "function" == typeof readline && (b4 = readline(), null !== b4 && (b4 += "\n")); - if (!b4) - return null; - a5.input = ma(b4, true); + return buffer; + } + function bufferToString(buffer) { + var bytes = new Uint8Array(buffer); + var base64String = ""; + var i4; + for (i4 = 0; i4 < bytes.length; i4 += 3) { + base64String += BASE_CHARS[bytes[i4] >> 2]; + base64String += BASE_CHARS[(bytes[i4] & 3) << 4 | bytes[i4 + 1] >> 4]; + base64String += BASE_CHARS[(bytes[i4 + 1] & 15) << 2 | bytes[i4 + 2] >> 6]; + base64String += BASE_CHARS[bytes[i4 + 2] & 63]; } - return a5.input.shift(); - }, jb: function(a5, b4) { - null === b4 || 10 === b4 ? (Ga(Ma(a5.output, 0)), a5.output = []) : 0 != b4 && a5.output.push(b4); - }, fsync: function(a5) { - a5.output && 0 < a5.output.length && (Ga(Ma(a5.output, 0)), a5.output = []); - } }, ub = { jb: function(a5, b4) { - null === b4 || 10 === b4 ? (Ha(Ma(a5.output, 0)), a5.output = []) : 0 != b4 && a5.output.push(b4); - }, fsync: function(a5) { - a5.output && 0 < a5.output.length && (Ha(Ma(a5.output, 0)), a5.output = []); - } }, Q3 = { Qa: null, Ra: function() { - return Q3.createNode( - null, - "/", - 16895, - 0 - ); - }, createNode: function(a5, b4, c4, d5) { - if (24576 === (c4 & 61440) || 4096 === (c4 & 61440)) - throw new P4(63); - Q3.Qa || (Q3.Qa = { dir: { node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa, lookup: Q3.Ga.lookup, ab: Q3.Ga.ab, rename: Q3.Ga.rename, unlink: Q3.Ga.unlink, rmdir: Q3.Ga.rmdir, readdir: Q3.Ga.readdir, symlink: Q3.Ga.symlink }, stream: { Ta: Q3.Ha.Ta } }, file: { node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa }, stream: { Ta: Q3.Ha.Ta, read: Q3.Ha.read, write: Q3.Ha.write, lb: Q3.Ha.lb, bb: Q3.Ha.bb, cb: Q3.Ha.cb } }, link: { node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa, readlink: Q3.Ga.readlink }, stream: {} }, pb: { - node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa }, - stream: vb - } }); - c4 = wb(a5, b4, c4, d5); - 16384 === (c4.mode & 61440) ? (c4.Ga = Q3.Qa.dir.node, c4.Ha = Q3.Qa.dir.stream, c4.Ia = {}) : 32768 === (c4.mode & 61440) ? (c4.Ga = Q3.Qa.file.node, c4.Ha = Q3.Qa.file.stream, c4.Ma = 0, c4.Ia = null) : 40960 === (c4.mode & 61440) ? (c4.Ga = Q3.Qa.link.node, c4.Ha = Q3.Qa.link.stream) : 8192 === (c4.mode & 61440) && (c4.Ga = Q3.Qa.pb.node, c4.Ha = Q3.Qa.pb.stream); - c4.timestamp = Date.now(); - a5 && (a5.Ia[b4] = c4, a5.timestamp = c4.timestamp); - return c4; - }, Jb: function(a5) { - return a5.Ia ? a5.Ia.subarray ? a5.Ia.subarray(0, a5.Ma) : new Uint8Array(a5.Ia) : new Uint8Array(0); - }, qb: function(a5, b4) { - var c4 = a5.Ia ? a5.Ia.length : 0; - c4 >= b4 || (b4 = Math.max(b4, c4 * (1048576 > c4 ? 2 : 1.125) >>> 0), 0 != c4 && (b4 = Math.max(b4, 256)), c4 = a5.Ia, a5.Ia = new Uint8Array(b4), 0 < a5.Ma && a5.Ia.set(c4.subarray(0, a5.Ma), 0)); - }, Gb: function(a5, b4) { - if (a5.Ma != b4) - if (0 == b4) - a5.Ia = null, a5.Ma = 0; - else { - var c4 = a5.Ia; - a5.Ia = new Uint8Array(b4); - c4 && a5.Ia.set(c4.subarray(0, Math.min(b4, a5.Ma))); - a5.Ma = b4; + if (bytes.length % 3 === 2) { + base64String = base64String.substring(0, base64String.length - 1) + "="; + } else if (bytes.length % 3 === 1) { + base64String = base64String.substring(0, base64String.length - 2) + "=="; + } + return base64String; + } + function serialize(value, callback) { + var valueType = ""; + if (value) { + valueType = toString$1.call(value); + } + if (value && (valueType === "[object ArrayBuffer]" || value.buffer && toString$1.call(value.buffer) === "[object ArrayBuffer]")) { + var buffer; + var marker = SERIALIZED_MARKER; + if (value instanceof ArrayBuffer) { + buffer = value; + marker += TYPE_ARRAYBUFFER; + } else { + buffer = value.buffer; + if (valueType === "[object Int8Array]") { + marker += TYPE_INT8ARRAY; + } else if (valueType === "[object Uint8Array]") { + marker += TYPE_UINT8ARRAY; + } else if (valueType === "[object Uint8ClampedArray]") { + marker += TYPE_UINT8CLAMPEDARRAY; + } else if (valueType === "[object Int16Array]") { + marker += TYPE_INT16ARRAY; + } else if (valueType === "[object Uint16Array]") { + marker += TYPE_UINT16ARRAY; + } else if (valueType === "[object Int32Array]") { + marker += TYPE_INT32ARRAY; + } else if (valueType === "[object Uint32Array]") { + marker += TYPE_UINT32ARRAY; + } else if (valueType === "[object Float32Array]") { + marker += TYPE_FLOAT32ARRAY; + } else if (valueType === "[object Float64Array]") { + marker += TYPE_FLOAT64ARRAY; + } else { + callback(new Error("Failed to get type for BinaryArray")); + } } - }, Ga: { Pa: function(a5) { - var b4 = {}; - b4.dev = 8192 === (a5.mode & 61440) ? a5.id : 1; - b4.ino = a5.id; - b4.mode = a5.mode; - b4.nlink = 1; - b4.uid = 0; - b4.gid = 0; - b4.rdev = a5.rdev; - 16384 === (a5.mode & 61440) ? b4.size = 4096 : 32768 === (a5.mode & 61440) ? b4.size = a5.Ma : 40960 === (a5.mode & 61440) ? b4.size = a5.link.length : b4.size = 0; - b4.atime = new Date(a5.timestamp); - b4.mtime = new Date(a5.timestamp); - b4.ctime = new Date(a5.timestamp); - b4.Ab = 4096; - b4.blocks = Math.ceil(b4.size / b4.Ab); - return b4; - }, Oa: function(a5, b4) { - void 0 !== b4.mode && (a5.mode = b4.mode); - void 0 !== b4.timestamp && (a5.timestamp = b4.timestamp); - void 0 !== b4.size && Q3.Gb(a5, b4.size); - }, lookup: function() { - throw xb[44]; - }, ab: function(a5, b4, c4, d5) { - return Q3.createNode(a5, b4, c4, d5); - }, rename: function(a5, b4, c4) { - if (16384 === (a5.mode & 61440)) { + callback(marker + bufferToString(buffer)); + } else if (valueType === "[object Blob]") { + var fileReader = new FileReader(); + fileReader.onload = function() { + var str = BLOB_TYPE_PREFIX + value.type + "~" + bufferToString(this.result); + callback(SERIALIZED_MARKER + TYPE_BLOB + str); + }; + fileReader.readAsArrayBuffer(value); + } else { try { - var d5 = yb(b4, c4); - } catch (h5) { + callback(JSON.stringify(value)); + } catch (e4) { + console.error("Couldn't convert value into a JSON string: ", value); + callback(null, e4); } - if (d5) - for (var f4 in d5.Ia) - throw new P4(55); - } - delete a5.parent.Ia[a5.name]; - a5.parent.timestamp = Date.now(); - a5.name = c4; - b4.Ia[c4] = a5; - b4.timestamp = a5.parent.timestamp; - a5.parent = b4; - }, unlink: function(a5, b4) { - delete a5.Ia[b4]; - a5.timestamp = Date.now(); - }, rmdir: function(a5, b4) { - var c4 = yb(a5, b4), d5; - for (d5 in c4.Ia) - throw new P4(55); - delete a5.Ia[b4]; - a5.timestamp = Date.now(); - }, readdir: function(a5) { - var b4 = [".", ".."], c4; - for (c4 in a5.Ia) - a5.Ia.hasOwnProperty(c4) && b4.push(c4); - return b4; - }, symlink: function(a5, b4, c4) { - a5 = Q3.createNode(a5, b4, 41471, 0); - a5.link = c4; - return a5; - }, readlink: function(a5) { - if (40960 !== (a5.mode & 61440)) - throw new P4(28); - return a5.link; - } }, Ha: { read: function(a5, b4, c4, d5, f4) { - var h5 = a5.node.Ia; - if (f4 >= a5.node.Ma) - return 0; - a5 = Math.min(a5.node.Ma - f4, d5); - if (8 < a5 && h5.subarray) - b4.set(h5.subarray(f4, f4 + a5), c4); - else - for (d5 = 0; d5 < a5; d5++) - b4[c4 + d5] = h5[f4 + d5]; - return a5; - }, write: function(a5, b4, c4, d5, f4, h5) { - b4.buffer === r3.buffer && (h5 = false); - if (!d5) - return 0; - a5 = a5.node; - a5.timestamp = Date.now(); - if (b4.subarray && (!a5.Ia || a5.Ia.subarray)) { - if (h5) - return a5.Ia = b4.subarray(c4, c4 + d5), a5.Ma = d5; - if (0 === a5.Ma && 0 === f4) - return a5.Ia = b4.slice(c4, c4 + d5), a5.Ma = d5; - if (f4 + d5 <= a5.Ma) - return a5.Ia.set(b4.subarray(c4, c4 + d5), f4), d5; } - Q3.qb(a5, f4 + d5); - if (a5.Ia.subarray && b4.subarray) - a5.Ia.set(b4.subarray(c4, c4 + d5), f4); - else - for (h5 = 0; h5 < d5; h5++) - a5.Ia[f4 + h5] = b4[c4 + h5]; - a5.Ma = Math.max(a5.Ma, f4 + d5); - return d5; - }, Ta: function(a5, b4, c4) { - 1 === c4 ? b4 += a5.position : 2 === c4 && 32768 === (a5.node.mode & 61440) && (b4 += a5.node.Ma); - if (0 > b4) - throw new P4(28); - return b4; - }, lb: function(a5, b4, c4) { - Q3.qb(a5.node, b4 + c4); - a5.node.Ma = Math.max(a5.node.Ma, b4 + c4); - }, bb: function(a5, b4, c4, d5, f4) { - if (32768 !== (a5.node.mode & 61440)) - throw new P4(43); - a5 = a5.node.Ia; - if (f4 & 2 || a5.buffer !== Na) { - if (0 < c4 || c4 + b4 < a5.length) - a5.subarray ? a5 = a5.subarray(c4, c4 + b4) : a5 = Array.prototype.slice.call( - a5, - c4, - c4 + b4 - ); - c4 = true; - b4 = 65536 * Math.ceil(b4 / 65536); - (f4 = zb(65536, b4)) ? (u4.fill(0, f4, f4 + b4), b4 = f4) : b4 = 0; - if (!b4) - throw new P4(48); - r3.set(a5, b4); - } else - c4 = false, b4 = a5.byteOffset; - return { Fb: b4, vb: c4 }; - }, cb: function(a5, b4, c4, d5, f4) { - if (32768 !== (a5.node.mode & 61440)) - throw new P4(43); - if (f4 & 2) - return 0; - Q3.Ha.write(a5, b4, 0, d5, c4, false); - return 0; - } } }, Ab = null, Bb = {}, R3 = [], Cb = 1, T6 = null, Db = true, P4 = null, xb = {}, U2 = (a5, b4 = {}) => { - a5 = hb("/", a5); - if (!a5) - return { path: "", node: null }; - b4 = Object.assign({ rb: true, kb: 0 }, b4); - if (8 < b4.kb) - throw new P4(32); - a5 = db(a5.split("/").filter((k5) => !!k5), false); - for (var c4 = Ab, d5 = "/", f4 = 0; f4 < a5.length; f4++) { - var h5 = f4 === a5.length - 1; - if (h5 && b4.parent) - break; - c4 = yb(c4, a5[f4]); - d5 = z5(d5 + "/" + a5[f4]); - c4.Va && (!h5 || h5 && b4.rb) && (c4 = c4.Va.root); - if (!h5 || b4.Sa) { - for (h5 = 0; 40960 === (c4.mode & 61440); ) - if (c4 = Eb(d5), d5 = hb(eb(d5), c4), c4 = U2(d5, { kb: b4.kb + 1 }).node, 40 < h5++) - throw new P4(32); - } + } + function deserialize(value) { + if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) { + return JSON.parse(value); } - return { path: d5, node: c4 }; - }, ea = (a5) => { - for (var b4; ; ) { - if (a5 === a5.parent) - return a5 = a5.Ra.ub, b4 ? "/" !== a5[a5.length - 1] ? a5 + "/" + b4 : a5 + b4 : a5; - b4 = b4 ? a5.name + "/" + b4 : a5.name; - a5 = a5.parent; + var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH); + var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH); + var blobType; + if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) { + var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX); + blobType = matcher[1]; + serializedString = serializedString.substring(matcher[0].length); } - }, Fb = (a5, b4) => { - for (var c4 = 0, d5 = 0; d5 < b4.length; d5++) - c4 = (c4 << 5) - c4 + b4.charCodeAt(d5) | 0; - return (a5 + c4 >>> 0) % T6.length; - }, Gb = (a5) => { - var b4 = Fb(a5.parent.id, a5.name); - if (T6[b4] === a5) - T6[b4] = a5.Wa; - else - for (b4 = T6[b4]; b4; ) { - if (b4.Wa === a5) { - b4.Wa = a5.Wa; - break; - } - b4 = b4.Wa; + var buffer = stringToBuffer(serializedString); + switch (type) { + case TYPE_ARRAYBUFFER: + return buffer; + case TYPE_BLOB: + return createBlob([buffer], { type: blobType }); + case TYPE_INT8ARRAY: + return new Int8Array(buffer); + case TYPE_UINT8ARRAY: + return new Uint8Array(buffer); + case TYPE_UINT8CLAMPEDARRAY: + return new Uint8ClampedArray(buffer); + case TYPE_INT16ARRAY: + return new Int16Array(buffer); + case TYPE_UINT16ARRAY: + return new Uint16Array(buffer); + case TYPE_INT32ARRAY: + return new Int32Array(buffer); + case TYPE_UINT32ARRAY: + return new Uint32Array(buffer); + case TYPE_FLOAT32ARRAY: + return new Float32Array(buffer); + case TYPE_FLOAT64ARRAY: + return new Float64Array(buffer); + default: + throw new Error("Unkown type: " + type); + } + } + var localforageSerializer = { + serialize, + deserialize, + stringToBuffer, + bufferToString + }; + function createDbTable(t4, dbInfo, callback, errorCallback) { + t4.executeSql("CREATE TABLE IF NOT EXISTS " + dbInfo.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], callback, errorCallback); + } + function _initStorage$1(options) { + var self2 = this; + var dbInfo = { + db: null + }; + if (options) { + for (var i4 in options) { + dbInfo[i4] = typeof options[i4] !== "string" ? options[i4].toString() : options[i4]; } - }, yb = (a5, b4) => { - var c4; - if (c4 = (c4 = Hb(a5, "x")) ? c4 : a5.Ga.lookup ? 0 : 2) - throw new P4(c4, a5); - for (c4 = T6[Fb(a5.id, b4)]; c4; c4 = c4.Wa) { - var d5 = c4.name; - if (c4.parent.id === a5.id && d5 === b4) - return c4; } - return a5.Ga.lookup(a5, b4); - }, wb = (a5, b4, c4, d5) => { - a5 = new Ib(a5, b4, c4, d5); - b4 = Fb(a5.parent.id, a5.name); - a5.Wa = T6[b4]; - return T6[b4] = a5; - }, Jb = { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }, Kb = (a5) => { - var b4 = ["r", "w", "rw"][a5 & 3]; - a5 & 512 && (b4 += "w"); - return b4; - }, Hb = (a5, b4) => { - if (Db) - return 0; - if (!b4.includes("r") || a5.mode & 292) { - if (b4.includes("w") && !(a5.mode & 146) || b4.includes("x") && !(a5.mode & 73)) - return 2; - } else - return 2; - return 0; - }, Lb = (a5, b4) => { + var dbInfoPromise = new Promise$1(function(resolve, reject) { + try { + dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size); + } catch (e4) { + return reject(e4); + } + dbInfo.db.transaction(function(t4) { + createDbTable(t4, dbInfo, function() { + self2._dbInfo = dbInfo; + resolve(); + }, function(t5, error) { + reject(error); + }); + }, reject); + }); + dbInfo.serializer = localforageSerializer; + return dbInfoPromise; + } + function tryExecuteSql(t4, dbInfo, sqlStatement, args, callback, errorCallback) { + t4.executeSql(sqlStatement, args, callback, function(t5, error) { + if (error.code === error.SYNTAX_ERR) { + t5.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [dbInfo.storeName], function(t6, results) { + if (!results.rows.length) { + createDbTable(t6, dbInfo, function() { + t6.executeSql(sqlStatement, args, callback, errorCallback); + }, errorCallback); + } else { + errorCallback(t6, error); + } + }, errorCallback); + } else { + errorCallback(t5, error); + } + }, errorCallback); + } + function getItem$1(key3, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + var dbInfo = self2._dbInfo; + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "SELECT * FROM " + dbInfo.storeName + " WHERE key = ? LIMIT 1", [key3], function(t5, results) { + var result = results.rows.length ? results.rows.item(0).value : null; + if (result) { + result = dbInfo.serializer.deserialize(result); + } + resolve(result); + }, function(t5, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function iterate$1(iterator, callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + var dbInfo = self2._dbInfo; + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "SELECT * FROM " + dbInfo.storeName, [], function(t5, results) { + var rows = results.rows; + var length2 = rows.length; + for (var i4 = 0; i4 < length2; i4++) { + var item = rows.item(i4); + var result = item.value; + if (result) { + result = dbInfo.serializer.deserialize(result); + } + result = iterator(result, item.key, i4 + 1); + if (result !== void 0) { + resolve(result); + return; + } + } + resolve(); + }, function(t5, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function _setItem(key3, value, callback, retriesLeft) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + if (value === void 0) { + value = null; + } + var originalValue = value; + var dbInfo = self2._dbInfo; + dbInfo.serializer.serialize(value, function(value2, error) { + if (error) { + reject(error); + } else { + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "INSERT OR REPLACE INTO " + dbInfo.storeName + " (key, value) VALUES (?, ?)", [key3, value2], function() { + resolve(originalValue); + }, function(t5, error2) { + reject(error2); + }); + }, function(sqlError) { + if (sqlError.code === sqlError.QUOTA_ERR) { + if (retriesLeft > 0) { + resolve(_setItem.apply(self2, [key3, originalValue, callback, retriesLeft - 1])); + return; + } + reject(sqlError); + } + }); + } + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function setItem$1(key3, value, callback) { + return _setItem.apply(this, [key3, value, callback, 1]); + } + function removeItem$1(key3, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + var dbInfo = self2._dbInfo; + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "DELETE FROM " + dbInfo.storeName + " WHERE key = ?", [key3], function() { + resolve(); + }, function(t5, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function clear$1(callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + var dbInfo = self2._dbInfo; + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "DELETE FROM " + dbInfo.storeName, [], function() { + resolve(); + }, function(t5, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function length$1(callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + var dbInfo = self2._dbInfo; + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "SELECT COUNT(key) as c FROM " + dbInfo.storeName, [], function(t5, results) { + var result = results.rows.item(0).c; + resolve(result); + }, function(t5, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function key$1(n2, callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + var dbInfo = self2._dbInfo; + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "SELECT key FROM " + dbInfo.storeName + " WHERE id = ? LIMIT 1", [n2 + 1], function(t5, results) { + var result = results.rows.length ? results.rows.item(0).key : null; + resolve(result); + }, function(t5, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function keys$1(callback) { + var self2 = this; + var promise = new Promise$1(function(resolve, reject) { + self2.ready().then(function() { + var dbInfo = self2._dbInfo; + dbInfo.db.transaction(function(t4) { + tryExecuteSql(t4, dbInfo, "SELECT key FROM " + dbInfo.storeName, [], function(t5, results) { + var keys2 = []; + for (var i4 = 0; i4 < results.rows.length; i4++) { + keys2.push(results.rows.item(i4).key); + } + resolve(keys2); + }, function(t5, error) { + reject(error); + }); + }); + })["catch"](reject); + }); + executeCallback(promise, callback); + return promise; + } + function getAllStoreNames(db) { + return new Promise$1(function(resolve, reject) { + db.transaction(function(t4) { + t4.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(t5, results) { + var storeNames = []; + for (var i4 = 0; i4 < results.rows.length; i4++) { + storeNames.push(results.rows.item(i4).name); + } + resolve({ + db, + storeNames + }); + }, function(t5, error) { + reject(error); + }); + }, function(sqlError) { + reject(sqlError); + }); + }); + } + function dropInstance$1(options, callback) { + callback = getCallback.apply(this, arguments); + var currentConfig = this.config(); + options = typeof options !== "function" && options || {}; + if (!options.name) { + options.name = options.name || currentConfig.name; + options.storeName = options.storeName || currentConfig.storeName; + } + var self2 = this; + var promise; + if (!options.name) { + promise = Promise$1.reject("Invalid arguments"); + } else { + promise = new Promise$1(function(resolve) { + var db; + if (options.name === currentConfig.name) { + db = self2._dbInfo.db; + } else { + db = openDatabase(options.name, "", "", 0); + } + if (!options.storeName) { + resolve(getAllStoreNames(db)); + } else { + resolve({ + db, + storeNames: [options.storeName] + }); + } + }).then(function(operationInfo) { + return new Promise$1(function(resolve, reject) { + operationInfo.db.transaction(function(t4) { + function dropTable2(storeName) { + return new Promise$1(function(resolve2, reject2) { + t4.executeSql("DROP TABLE IF EXISTS " + storeName, [], function() { + resolve2(); + }, function(t5, error) { + reject2(error); + }); + }); + } + var operations = []; + for (var i4 = 0, len = operationInfo.storeNames.length; i4 < len; i4++) { + operations.push(dropTable2(operationInfo.storeNames[i4])); + } + Promise$1.all(operations).then(function() { + resolve(); + })["catch"](function(e4) { + reject(e4); + }); + }, function(sqlError) { + reject(sqlError); + }); + }); + }); + } + executeCallback(promise, callback); + return promise; + } + var webSQLStorage = { + _driver: "webSQLStorage", + _initStorage: _initStorage$1, + _support: isWebSQLValid(), + iterate: iterate$1, + getItem: getItem$1, + setItem: setItem$1, + removeItem: removeItem$1, + clear: clear$1, + length: length$1, + key: key$1, + keys: keys$1, + dropInstance: dropInstance$1 + }; + function isLocalStorageValid() { try { - return yb(a5, b4), 20; - } catch (c4) { + return typeof localStorage !== "undefined" && "setItem" in localStorage && !!localStorage.setItem; + } catch (e4) { + return false; } - return Hb(a5, "wx"); - }, Mb = (a5, b4, c4) => { + } + function _getKeyPrefix(options, defaultConfig) { + var keyPrefix = options.name + "/"; + if (options.storeName !== defaultConfig.storeName) { + keyPrefix += options.storeName + "/"; + } + return keyPrefix; + } + function checkIfLocalStorageThrows() { + var localStorageTestKey = "_localforage_support_test"; try { - var d5 = yb(a5, b4); - } catch (f4) { - return f4.Ka; + localStorage.setItem(localStorageTestKey, true); + localStorage.removeItem(localStorageTestKey); + return false; + } catch (e4) { + return true; } - if (a5 = Hb(a5, "wx")) - return a5; - if (c4) { - if (16384 !== (d5.mode & 61440)) - return 54; - if (d5 === d5.parent || "/" === ea(d5)) - return 10; - } else if (16384 === (d5.mode & 61440)) - return 31; - return 0; - }, Nb = (a5 = 0) => { - for (; 4096 >= a5; a5++) - if (!R3[a5]) - return a5; - throw new P4(33); - }, Pb = (a5, b4) => { - Ob || (Ob = function() { - this.$a = {}; - }, Ob.prototype = {}, Object.defineProperties(Ob.prototype, { object: { get: function() { - return this.node; - }, set: function(c4) { - this.node = c4; - } }, flags: { get: function() { - return this.$a.flags; - }, set: function(c4) { - this.$a.flags = c4; - } }, position: { get: function() { - return this.$a.position; - }, set: function(c4) { - this.$a.position = c4; - } } })); - a5 = Object.assign(new Ob(), a5); - b4 = Nb(b4); - a5.fd = b4; - return R3[b4] = a5; - }, vb = { open: (a5) => { - a5.Ha = Bb[a5.node.rdev].Ha; - a5.Ha.open && a5.Ha.open(a5); - }, Ta: () => { - throw new P4(70); - } }, lb = (a5, b4) => { - Bb[a5] = { Ha: b4 }; - }, Qb = (a5, b4) => { - var c4 = "/" === b4, d5 = !b4; - if (c4 && Ab) - throw new P4(10); - if (!c4 && !d5) { - var f4 = U2(b4, { rb: false }); - b4 = f4.path; - f4 = f4.node; - if (f4.Va) - throw new P4(10); - if (16384 !== (f4.mode & 61440)) - throw new P4(54); + } + function _isLocalStorageUsable() { + return !checkIfLocalStorageThrows() || localStorage.length > 0; + } + function _initStorage$2(options) { + var self2 = this; + var dbInfo = {}; + if (options) { + for (var i4 in options) { + dbInfo[i4] = options[i4]; + } } - b4 = { type: a5, Kb: {}, ub: b4, Eb: [] }; - a5 = a5.Ra(b4); - a5.Ra = b4; - b4.root = a5; - c4 ? Ab = a5 : f4 && (f4.Va = b4, f4.Ra && f4.Ra.Eb.push(b4)); - }, ha = (a5, b4, c4) => { - var d5 = U2(a5, { parent: true }).node; - a5 = fb(a5); - if (!a5 || "." === a5 || ".." === a5) - throw new P4(28); - var f4 = Lb(d5, a5); - if (f4) - throw new P4(f4); - if (!d5.Ga.ab) - throw new P4(63); - return d5.Ga.ab(d5, a5, b4, c4); - }, V3 = (a5, b4) => ha(a5, (void 0 !== b4 ? b4 : 511) & 1023 | 16384, 0), Rb = (a5, b4, c4) => { - "undefined" == typeof c4 && (c4 = b4, b4 = 438); - ha(a5, b4 | 8192, c4); - }, Sb = (a5, b4) => { - if (!hb(a5)) - throw new P4(44); - var c4 = U2(b4, { parent: true }).node; - if (!c4) - throw new P4(44); - b4 = fb(b4); - var d5 = Lb(c4, b4); - if (d5) - throw new P4(d5); - if (!c4.Ga.symlink) - throw new P4(63); - c4.Ga.symlink(c4, b4, a5); - }, Tb = (a5) => { - var b4 = U2(a5, { parent: true }).node; - a5 = fb(a5); - var c4 = yb(b4, a5), d5 = Mb(b4, a5, true); - if (d5) - throw new P4(d5); - if (!b4.Ga.rmdir) - throw new P4(63); - if (c4.Va) - throw new P4(10); - b4.Ga.rmdir(b4, a5); - Gb(c4); - }, ta = (a5) => { - var b4 = U2(a5, { parent: true }).node; - if (!b4) - throw new P4(44); - a5 = fb(a5); - var c4 = yb(b4, a5), d5 = Mb(b4, a5, false); - if (d5) - throw new P4(d5); - if (!b4.Ga.unlink) - throw new P4(63); - if (c4.Va) - throw new P4(10); - b4.Ga.unlink(b4, a5); - Gb(c4); - }, Eb = (a5) => { - a5 = U2(a5).node; - if (!a5) - throw new P4(44); - if (!a5.Ga.readlink) - throw new P4(28); - return hb(ea(a5.parent), a5.Ga.readlink(a5)); - }, Ub = (a5, b4) => { - a5 = U2(a5, { Sa: !b4 }).node; - if (!a5) - throw new P4(44); - if (!a5.Ga.Pa) - throw new P4(63); - return a5.Ga.Pa(a5); - }, Vb = (a5) => Ub(a5, true), ia = (a5, b4) => { - a5 = "string" == typeof a5 ? U2(a5, { Sa: true }).node : a5; - if (!a5.Ga.Oa) - throw new P4(63); - a5.Ga.Oa(a5, { mode: b4 & 4095 | a5.mode & -4096, timestamp: Date.now() }); - }, Wb = (a5, b4) => { - if (0 > b4) - throw new P4(28); - a5 = "string" == typeof a5 ? U2(a5, { Sa: true }).node : a5; - if (!a5.Ga.Oa) - throw new P4(63); - if (16384 === (a5.mode & 61440)) - throw new P4(31); - if (32768 !== (a5.mode & 61440)) - throw new P4(28); - var c4 = Hb(a5, "w"); - if (c4) - throw new P4(c4); - a5.Ga.Oa(a5, { size: b4, timestamp: Date.now() }); - }, ja = (a5, b4, c4) => { - if ("" === a5) - throw new P4(44); - if ("string" == typeof b4) { - var d5 = Jb[b4]; - if ("undefined" == typeof d5) - throw Error("Unknown file open mode: " + b4); - b4 = d5; - } - c4 = b4 & 64 ? ("undefined" == typeof c4 ? 438 : c4) & 4095 | 32768 : 0; - if ("object" == typeof a5) - var f4 = a5; - else { - a5 = z5(a5); - try { - f4 = U2(a5, { Sa: !(b4 & 131072) }).node; - } catch (h5) { - } - } - d5 = false; - if (b4 & 64) - if (f4) { - if (b4 & 128) - throw new P4(20); - } else - f4 = ha(a5, c4, 0), d5 = true; - if (!f4) - throw new P4(44); - 8192 === (f4.mode & 61440) && (b4 &= -513); - if (b4 & 65536 && 16384 !== (f4.mode & 61440)) - throw new P4(54); - if (!d5 && (c4 = f4 ? 40960 === (f4.mode & 61440) ? 32 : 16384 === (f4.mode & 61440) && ("r" !== Kb(b4) || b4 & 512) ? 31 : Hb(f4, Kb(b4)) : 44)) - throw new P4(c4); - b4 & 512 && !d5 && Wb(f4, 0); - b4 &= -131713; - f4 = Pb({ node: f4, path: ea(f4), flags: b4, seekable: true, position: 0, Ha: f4.Ha, Ib: [], error: false }); - f4.Ha.open && f4.Ha.open(f4); - !e4.logReadFiles || b4 & 1 || (Xb || (Xb = {}), a5 in Xb || (Xb[a5] = 1)); - return f4; - }, la = (a5) => { - if (null === a5.fd) - throw new P4(8); - a5.hb && (a5.hb = null); - try { - a5.Ha.close && a5.Ha.close(a5); - } catch (b4) { - throw b4; - } finally { - R3[a5.fd] = null; + dbInfo.keyPrefix = _getKeyPrefix(options, self2._defaultConfig); + if (!_isLocalStorageUsable()) { + return Promise$1.reject(); } - a5.fd = null; - }, Yb = (a5, b4, c4) => { - if (null === a5.fd) - throw new P4(8); - if (!a5.seekable || !a5.Ha.Ta) - throw new P4(70); - if (0 != c4 && 1 != c4 && 2 != c4) - throw new P4(28); - a5.position = a5.Ha.Ta(a5, b4, c4); - a5.Ib = []; - }, Zb = (a5, b4, c4, d5, f4) => { - if (0 > d5 || 0 > f4) - throw new P4(28); - if (null === a5.fd) - throw new P4(8); - if (1 === (a5.flags & 2097155)) - throw new P4(8); - if (16384 === (a5.node.mode & 61440)) - throw new P4(31); - if (!a5.Ha.read) - throw new P4(28); - var h5 = "undefined" != typeof f4; - if (!h5) - f4 = a5.position; - else if (!a5.seekable) - throw new P4(70); - b4 = a5.Ha.read(a5, b4, c4, d5, f4); - h5 || (a5.position += b4); - return b4; - }, ka = (a5, b4, c4, d5, f4) => { - if (0 > d5 || 0 > f4) - throw new P4(28); - if (null === a5.fd) - throw new P4(8); - if (0 === (a5.flags & 2097155)) - throw new P4(8); - if (16384 === (a5.node.mode & 61440)) - throw new P4(31); - if (!a5.Ha.write) - throw new P4(28); - a5.seekable && a5.flags & 1024 && Yb(a5, 0, 2); - var h5 = "undefined" != typeof f4; - if (!h5) - f4 = a5.position; - else if (!a5.seekable) - throw new P4(70); - b4 = a5.Ha.write(a5, b4, c4, d5, f4, void 0); - h5 || (a5.position += b4); - return b4; - }, sa = (a5) => { - var b4 = "binary"; - if ("utf8" !== b4 && "binary" !== b4) - throw Error('Invalid encoding type "' + b4 + '"'); - var c4; - var d5 = ja(a5, d5 || 0); - a5 = Ub(a5).size; - var f4 = new Uint8Array(a5); - Zb(d5, f4, 0, a5, 0); - "utf8" === b4 ? c4 = Ma(f4, 0) : "binary" === b4 && (c4 = f4); - la(d5); - return c4; - }, $b = () => { - P4 || (P4 = function(a5, b4) { - this.node = b4; - this.Hb = function(c4) { - this.Ka = c4; - }; - this.Hb(a5); - this.message = "FS error"; - }, P4.prototype = Error(), P4.prototype.constructor = P4, [44].forEach((a5) => { - xb[a5] = new P4(a5); - xb[a5].stack = ""; - })); - }, ac, fa = (a5, b4) => { - var c4 = 0; - a5 && (c4 |= 365); - b4 && (c4 |= 146); - return c4; - }, cc = (a5, b4, c4) => { - a5 = z5("/dev/" + a5); - var d5 = fa(!!b4, !!c4); - bc || (bc = 64); - var f4 = bc++ << 8 | 0; - lb(f4, { open: (h5) => { - h5.seekable = false; - }, close: () => { - c4 && c4.buffer && c4.buffer.length && c4(10); - }, read: (h5, k5, q5, x5) => { - for (var w5 = 0, A4 = 0; A4 < x5; A4++) { - try { - var S4 = b4(); - } catch (nb) { - throw new P4(29); + self2._dbInfo = dbInfo; + dbInfo.serializer = localforageSerializer; + return Promise$1.resolve(); + } + function clear$2(callback) { + var self2 = this; + var promise = self2.ready().then(function() { + var keyPrefix = self2._dbInfo.keyPrefix; + for (var i4 = localStorage.length - 1; i4 >= 0; i4--) { + var key3 = localStorage.key(i4); + if (key3.indexOf(keyPrefix) === 0) { + localStorage.removeItem(key3); } - if (void 0 === S4 && 0 === w5) - throw new P4(6); - if (null === S4 || void 0 === S4) - break; - w5++; - k5[q5 + A4] = S4; } - w5 && (h5.node.timestamp = Date.now()); - return w5; - }, write: (h5, k5, q5, x5) => { - for (var w5 = 0; w5 < x5; w5++) - try { - c4(k5[q5 + w5]); - } catch (A4) { - throw new P4(29); - } - x5 && (h5.node.timestamp = Date.now()); - return w5; - } }); - Rb(a5, d5, f4); - }, bc, W2 = {}, Ob, Xb; - function dc(a5, b4, c4) { - if ("/" === b4.charAt(0)) - return b4; - a5 = -100 === a5 ? "/" : X3(a5).path; - if (0 == b4.length) { - if (!c4) - throw new P4(44); - return a5; - } - return z5(a5 + "/" + b4); + }); + executeCallback(promise, callback); + return promise; } - function ec(a5, b4, c4) { - try { - var d5 = a5(b4); - } catch (f4) { - if (f4 && f4.node && z5(b4) !== z5(ea(f4.node))) - return -54; - throw f4; - } - F4[c4 >> 2] = d5.dev; - F4[c4 + 8 >> 2] = d5.ino; - F4[c4 + 12 >> 2] = d5.mode; - J2[c4 + 16 >> 2] = d5.nlink; - F4[c4 + 20 >> 2] = d5.uid; - F4[c4 + 24 >> 2] = d5.gid; - F4[c4 + 28 >> 2] = d5.rdev; - O4 = [d5.size >>> 0, (N3 = d5.size, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; - F4[c4 + 40 >> 2] = O4[0]; - F4[c4 + 44 >> 2] = O4[1]; - F4[c4 + 48 >> 2] = 4096; - F4[c4 + 52 >> 2] = d5.blocks; - O4 = [Math.floor(d5.atime.getTime() / 1e3) >>> 0, (N3 = Math.floor(d5.atime.getTime() / 1e3), 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; - F4[c4 + 56 >> 2] = O4[0]; - F4[c4 + 60 >> 2] = O4[1]; - J2[c4 + 64 >> 2] = 0; - O4 = [Math.floor(d5.mtime.getTime() / 1e3) >>> 0, (N3 = Math.floor(d5.mtime.getTime() / 1e3), 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; - F4[c4 + 72 >> 2] = O4[0]; - F4[c4 + 76 >> 2] = O4[1]; - J2[c4 + 80 >> 2] = 0; - O4 = [Math.floor(d5.ctime.getTime() / 1e3) >>> 0, (N3 = Math.floor(d5.ctime.getTime() / 1e3), 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; - F4[c4 + 88 >> 2] = O4[0]; - F4[c4 + 92 >> 2] = O4[1]; - J2[c4 + 96 >> 2] = 0; - O4 = [d5.ino >>> 0, (N3 = d5.ino, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; - F4[c4 + 104 >> 2] = O4[0]; - F4[c4 + 108 >> 2] = O4[1]; - return 0; + function getItem$2(key3, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = self2.ready().then(function() { + var dbInfo = self2._dbInfo; + var result = localStorage.getItem(dbInfo.keyPrefix + key3); + if (result) { + result = dbInfo.serializer.deserialize(result); + } + return result; + }); + executeCallback(promise, callback); + return promise; } - var fc = void 0; - function Hc() { - fc += 4; - return F4[fc - 4 >> 2]; + function iterate$2(iterator, callback) { + var self2 = this; + var promise = self2.ready().then(function() { + var dbInfo = self2._dbInfo; + var keyPrefix = dbInfo.keyPrefix; + var keyPrefixLength = keyPrefix.length; + var length2 = localStorage.length; + var iterationNumber = 1; + for (var i4 = 0; i4 < length2; i4++) { + var key3 = localStorage.key(i4); + if (key3.indexOf(keyPrefix) !== 0) { + continue; + } + var value = localStorage.getItem(key3); + if (value) { + value = dbInfo.serializer.deserialize(value); + } + value = iterator(value, key3.substring(keyPrefixLength), iterationNumber++); + if (value !== void 0) { + return value; + } + } + }); + executeCallback(promise, callback); + return promise; } - function X3(a5) { - a5 = R3[a5]; - if (!a5) - throw new P4(8); - return a5; + function key$2(n2, callback) { + var self2 = this; + var promise = self2.ready().then(function() { + var dbInfo = self2._dbInfo; + var result; + try { + result = localStorage.key(n2); + } catch (error) { + result = null; + } + if (result) { + result = result.substring(dbInfo.keyPrefix.length); + } + return result; + }); + executeCallback(promise, callback); + return promise; } - function Jc(a5) { - return J2[a5 >> 2] + 4294967296 * F4[a5 + 4 >> 2]; + function keys$2(callback) { + var self2 = this; + var promise = self2.ready().then(function() { + var dbInfo = self2._dbInfo; + var length2 = localStorage.length; + var keys2 = []; + for (var i4 = 0; i4 < length2; i4++) { + var itemKey = localStorage.key(i4); + if (itemKey.indexOf(dbInfo.keyPrefix) === 0) { + keys2.push(itemKey.substring(dbInfo.keyPrefix.length)); + } + } + return keys2; + }); + executeCallback(promise, callback); + return promise; } - function Kc(a5) { - var b4 = ca(a5) + 1, c4 = da(b4); - c4 && t4(a5, r3, c4, b4); - return c4; + function length$2(callback) { + var self2 = this; + var promise = self2.keys().then(function(keys2) { + return keys2.length; + }); + executeCallback(promise, callback); + return promise; } - function Lc(a5, b4, c4) { - function d5(x5) { - return (x5 = x5.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? x5[1] : "GMT"; - } - var f4 = new Date().getFullYear(), h5 = new Date(f4, 0, 1), k5 = new Date(f4, 6, 1); - f4 = h5.getTimezoneOffset(); - var q5 = k5.getTimezoneOffset(); - F4[a5 >> 2] = 60 * Math.max(f4, q5); - F4[b4 >> 2] = Number(f4 != q5); - a5 = d5(h5); - b4 = d5(k5); - a5 = Kc(a5); - b4 = Kc(b4); - q5 < f4 ? (J2[c4 >> 2] = a5, J2[c4 + 4 >> 2] = b4) : (J2[c4 >> 2] = b4, J2[c4 + 4 >> 2] = a5); + function removeItem$2(key3, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = self2.ready().then(function() { + var dbInfo = self2._dbInfo; + localStorage.removeItem(dbInfo.keyPrefix + key3); + }); + executeCallback(promise, callback); + return promise; } - function Mc(a5, b4, c4) { - Mc.Bb || (Mc.Bb = true, Lc(a5, b4, c4)); + function setItem$2(key3, value, callback) { + var self2 = this; + key3 = normalizeKey(key3); + var promise = self2.ready().then(function() { + if (value === void 0) { + value = null; + } + var originalValue = value; + return new Promise$1(function(resolve, reject) { + var dbInfo = self2._dbInfo; + dbInfo.serializer.serialize(value, function(value2, error) { + if (error) { + reject(error); + } else { + try { + localStorage.setItem(dbInfo.keyPrefix + key3, value2); + resolve(originalValue); + } catch (e4) { + if (e4.name === "QuotaExceededError" || e4.name === "NS_ERROR_DOM_QUOTA_REACHED") { + reject(e4); + } + reject(e4); + } + } + }); + }); + }); + executeCallback(promise, callback); + return promise; } - var Nc; - Nc = Aa ? () => { - var a5 = process.hrtime(); - return 1e3 * a5[0] + a5[1] / 1e6; - } : () => performance.now(); - var Oc = {}; - function Pc() { - if (!Qc) { - var a5 = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: wa || "./this.program" }, b4; - for (b4 in Oc) - void 0 === Oc[b4] ? delete a5[b4] : a5[b4] = Oc[b4]; - var c4 = []; - for (b4 in a5) - c4.push(b4 + "=" + a5[b4]); - Qc = c4; + function dropInstance$2(options, callback) { + callback = getCallback.apply(this, arguments); + options = typeof options !== "function" && options || {}; + if (!options.name) { + var currentConfig = this.config(); + options.name = options.name || currentConfig.name; + options.storeName = options.storeName || currentConfig.storeName; } - return Qc; - } - var Qc, Y3 = void 0, Rc = []; - function ua(a5, b4) { - if (!Y3) { - Y3 = /* @__PURE__ */ new WeakMap(); - var c4 = K3.length; - if (Y3) - for (var d5 = 0; d5 < 0 + c4; d5++) { - var f4 = K3.get(d5); - f4 && Y3.set(f4, d5); + var self2 = this; + var promise; + if (!options.name) { + promise = Promise$1.reject("Invalid arguments"); + } else { + promise = new Promise$1(function(resolve) { + if (!options.storeName) { + resolve(options.name + "/"); + } else { + resolve(_getKeyPrefix(options, self2._defaultConfig)); + } + }).then(function(keyPrefix) { + for (var i4 = localStorage.length - 1; i4 >= 0; i4--) { + var key3 = localStorage.key(i4); + if (key3.indexOf(keyPrefix) === 0) { + localStorage.removeItem(key3); + } } + }); } - if (Y3.has(a5)) - return Y3.get(a5); - if (Rc.length) - c4 = Rc.pop(); - else { - try { - K3.grow(1); - } catch (q5) { - if (!(q5 instanceof RangeError)) - throw q5; - throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."; + executeCallback(promise, callback); + return promise; + } + var localStorageWrapper = { + _driver: "localStorageWrapper", + _initStorage: _initStorage$2, + _support: isLocalStorageValid(), + iterate: iterate$2, + getItem: getItem$2, + setItem: setItem$2, + removeItem: removeItem$2, + clear: clear$2, + length: length$2, + key: key$2, + keys: keys$2, + dropInstance: dropInstance$2 + }; + var sameValue = function sameValue2(x5, y5) { + return x5 === y5 || typeof x5 === "number" && typeof y5 === "number" && isNaN(x5) && isNaN(y5); + }; + var includes = function includes2(array, searchElement) { + var len = array.length; + var i4 = 0; + while (i4 < len) { + if (sameValue(array[i4], searchElement)) { + return true; } - c4 = K3.length - 1; + i4++; } - try { - K3.set(c4, a5); - } catch (q5) { - if (!(q5 instanceof TypeError)) - throw q5; - if ("function" == typeof WebAssembly.Function) { - d5 = WebAssembly.Function; - f4 = { i: "i32", j: "i64", f: "f32", d: "f64", p: "i32" }; - for (var h5 = { parameters: [], results: "v" == b4[0] ? [] : [f4[b4[0]]] }, k5 = 1; k5 < b4.length; ++k5) - h5.parameters.push(f4[b4[k5]]); - b4 = new d5(h5, a5); - } else { - d5 = [1, 96]; - f4 = b4.slice(0, 1); - b4 = b4.slice(1); - h5 = { i: 127, p: 127, j: 126, f: 125, d: 124 }; - k5 = b4.length; - 128 > k5 ? d5.push(k5) : d5.push(k5 % 128 | 128, k5 >> 7); - for (k5 = 0; k5 < b4.length; ++k5) - d5.push(h5[b4[k5]]); - "v" == f4 ? d5.push(0) : d5.push(1, h5[f4]); - b4 = [0, 97, 115, 109, 1, 0, 0, 0, 1]; - f4 = d5.length; - 128 > f4 ? b4.push(f4) : b4.push(f4 % 128 | 128, f4 >> 7); - b4.push.apply(b4, d5); - b4.push(2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0); - b4 = new WebAssembly.Module(new Uint8Array(b4)); - b4 = new WebAssembly.Instance(b4, { e: { f: a5 } }).exports.f; + return false; + }; + var isArray2 = Array.isArray || function(arg) { + return Object.prototype.toString.call(arg) === "[object Array]"; + }; + var DefinedDrivers = {}; + var DriverSupport = {}; + var DefaultDrivers = { + INDEXEDDB: asyncStorage, + WEBSQL: webSQLStorage, + LOCALSTORAGE: localStorageWrapper + }; + var DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver]; + var OptionalDriverMethods = ["dropInstance"]; + var LibraryMethods = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(OptionalDriverMethods); + var DefaultConfig = { + description: "", + driver: DefaultDriverOrder.slice(), + name: "localforage", + size: 4980736, + storeName: "keyvaluepairs", + version: 1 + }; + function callWhenReady(localForageInstance, libraryMethod) { + localForageInstance[libraryMethod] = function() { + var _args = arguments; + return localForageInstance.ready().then(function() { + return localForageInstance[libraryMethod].apply(localForageInstance, _args); + }); + }; + } + function extend2() { + for (var i4 = 1; i4 < arguments.length; i4++) { + var arg = arguments[i4]; + if (arg) { + for (var _key in arg) { + if (arg.hasOwnProperty(_key)) { + if (isArray2(arg[_key])) { + arguments[0][_key] = arg[_key].slice(); + } else { + arguments[0][_key] = arg[_key]; + } + } + } } - K3.set( - c4, - b4 - ); } - Y3.set(a5, c4); - return c4; - } - function ra(a5) { - Y3.delete(K3.get(a5)); - Rc.push(a5); - } - var Sc = 0, Tc = 1; - function aa(a5) { - var b4 = Sc == Tc ? B5(a5.length) : da(a5.length); - a5.subarray || a5.slice || (a5 = new Uint8Array(a5)); - u4.set(a5, b4); - return b4; + return arguments[0]; } - function Uc(a5, b4, c4, d5) { - var f4 = { string: (w5) => { - var A4 = 0; - if (null !== w5 && void 0 !== w5 && 0 !== w5) { - var S4 = (w5.length << 2) + 1; - A4 = B5(S4); - t4(w5, u4, A4, S4); - } - return A4; - }, array: (w5) => { - var A4 = B5(w5.length); - r3.set(w5, A4); - return A4; - } }; - a5 = e4["_" + a5]; - var h5 = [], k5 = 0; - if (d5) - for (var q5 = 0; q5 < d5.length; q5++) { - var x5 = f4[c4[q5]]; - x5 ? (0 === k5 && (k5 = oa()), h5[q5] = x5(d5[q5])) : h5[q5] = d5[q5]; + var LocalForage = function() { + function LocalForage2(options) { + _classCallCheck(this, LocalForage2); + for (var driverTypeKey in DefaultDrivers) { + if (DefaultDrivers.hasOwnProperty(driverTypeKey)) { + var driver = DefaultDrivers[driverTypeKey]; + var driverName = driver._driver; + this[driverTypeKey] = driverName; + if (!DefinedDrivers[driverName]) { + this.defineDriver(driver); + } + } } - c4 = a5.apply(null, h5); - return c4 = function(w5) { - 0 !== k5 && qa(k5); - return "string" === b4 ? C3(w5) : "boolean" === b4 ? !!w5 : w5; - }(c4); - } - function Ib(a5, b4, c4, d5) { - a5 || (a5 = this); - this.parent = a5; - this.Ra = a5.Ra; - this.Va = null; - this.id = Cb++; - this.name = b4; - this.mode = c4; - this.Ga = {}; - this.Ha = {}; - this.rdev = d5; - } - Object.defineProperties(Ib.prototype, { read: { get: function() { - return 365 === (this.mode & 365); - }, set: function(a5) { - a5 ? this.mode |= 365 : this.mode &= -366; - } }, write: { get: function() { - return 146 === (this.mode & 146); - }, set: function(a5) { - a5 ? this.mode |= 146 : this.mode &= -147; - } } }); - $b(); - T6 = Array(4096); - Qb(Q3, "/"); - V3("/tmp"); - V3("/home"); - V3("/home/web_user"); - (() => { - V3("/dev"); - lb(259, { read: () => 0, write: (b4, c4, d5, f4) => f4 }); - Rb("/dev/null", 259); - jb(1280, tb); - jb(1536, ub); - Rb("/dev/tty", 1280); - Rb("/dev/tty1", 1536); - var a5 = gb(); - cc("random", a5); - cc("urandom", a5); - V3("/dev/shm"); - V3("/dev/shm/tmp"); - })(); - (() => { - V3("/proc"); - var a5 = V3("/proc/self"); - V3("/proc/self/fd"); - Qb({ Ra: () => { - var b4 = wb(a5, "fd", 16895, 73); - b4.Ga = { lookup: (c4, d5) => { - var f4 = R3[+d5]; - if (!f4) - throw new P4(8); - c4 = { parent: null, Ra: { ub: "fake" }, Ga: { readlink: () => f4.path } }; - return c4.parent = c4; - } }; - return b4; - } }, "/proc/self/fd"); - })(); - var Wc = { a: function(a5, b4, c4, d5) { - E4("Assertion failed: " + C3(a5) + ", at: " + [b4 ? C3(b4) : "unknown filename", c4, d5 ? C3(d5) : "unknown function"]); - }, h: function(a5, b4) { - try { - return a5 = C3(a5), ia(a5, b4), 0; - } catch (c4) { - if ("undefined" == typeof W2 || !(c4 instanceof P4)) - throw c4; - return -c4.Ka; + this._defaultConfig = extend2({}, DefaultConfig); + this._config = extend2({}, this._defaultConfig, options); + this._driverSet = null; + this._initDriver = null; + this._ready = false; + this._dbInfo = null; + this._wrapLibraryMethodsWithReady(); + this.setDriver(this._config.driver)["catch"](function() { + }); } - }, H: function(a5, b4, c4) { - try { - b4 = C3(b4); - b4 = dc(a5, b4); - if (c4 & -8) - return -28; - var d5 = U2(b4, { Sa: true }).node; - if (!d5) - return -44; - a5 = ""; - c4 & 4 && (a5 += "r"); - c4 & 2 && (a5 += "w"); - c4 & 1 && (a5 += "x"); - return a5 && Hb(d5, a5) ? -2 : 0; - } catch (f4) { - if ("undefined" == typeof W2 || !(f4 instanceof P4)) - throw f4; - return -f4.Ka; + LocalForage2.prototype.config = function config(options) { + if ((typeof options === "undefined" ? "undefined" : _typeof5(options)) === "object") { + if (this._ready) { + return new Error("Can't call config() after localforage has been used."); + } + for (var i4 in options) { + if (i4 === "storeName") { + options[i4] = options[i4].replace(/\W/g, "_"); + } + if (i4 === "version" && typeof options[i4] !== "number") { + return new Error("Database version must be a number."); + } + this._config[i4] = options[i4]; + } + if ("driver" in options && options.driver) { + return this.setDriver(this._config.driver); + } + return true; + } else if (typeof options === "string") { + return this._config[options]; + } else { + return this._config; + } + }; + LocalForage2.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) { + var promise = new Promise$1(function(resolve, reject) { + try { + var driverName = driverObject._driver; + var complianceError = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"); + if (!driverObject._driver) { + reject(complianceError); + return; + } + var driverMethods = LibraryMethods.concat("_initStorage"); + for (var i4 = 0, len = driverMethods.length; i4 < len; i4++) { + var driverMethodName = driverMethods[i4]; + var isRequired = !includes(OptionalDriverMethods, driverMethodName); + if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== "function") { + reject(complianceError); + return; + } + } + var configureMissingMethods = function configureMissingMethods2() { + var methodNotImplementedFactory = function methodNotImplementedFactory2(methodName) { + return function() { + var error = new Error("Method " + methodName + " is not implemented by the current driver"); + var promise2 = Promise$1.reject(error); + executeCallback(promise2, arguments[arguments.length - 1]); + return promise2; + }; + }; + for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) { + var optionalDriverMethod = OptionalDriverMethods[_i]; + if (!driverObject[optionalDriverMethod]) { + driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod); + } + } + }; + configureMissingMethods(); + var setDriverSupport = function setDriverSupport2(support) { + if (DefinedDrivers[driverName]) { + console.info("Redefining LocalForage driver: " + driverName); + } + DefinedDrivers[driverName] = driverObject; + DriverSupport[driverName] = support; + resolve(); + }; + if ("_support" in driverObject) { + if (driverObject._support && typeof driverObject._support === "function") { + driverObject._support().then(setDriverSupport, reject); + } else { + setDriverSupport(!!driverObject._support); + } + } else { + setDriverSupport(true); + } + } catch (e4) { + reject(e4); + } + }); + executeTwoCallbacks(promise, callback, errorCallback); + return promise; + }; + LocalForage2.prototype.driver = function driver() { + return this._driver || null; + }; + LocalForage2.prototype.getDriver = function getDriver(driverName, callback, errorCallback) { + var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error("Driver not found.")); + executeTwoCallbacks(getDriverPromise, callback, errorCallback); + return getDriverPromise; + }; + LocalForage2.prototype.getSerializer = function getSerializer(callback) { + var serializerPromise = Promise$1.resolve(localforageSerializer); + executeTwoCallbacks(serializerPromise, callback); + return serializerPromise; + }; + LocalForage2.prototype.ready = function ready(callback) { + var self2 = this; + var promise = self2._driverSet.then(function() { + if (self2._ready === null) { + self2._ready = self2._initDriver(); + } + return self2._ready; + }); + executeTwoCallbacks(promise, callback, callback); + return promise; + }; + LocalForage2.prototype.setDriver = function setDriver(drivers, callback, errorCallback) { + var self2 = this; + if (!isArray2(drivers)) { + drivers = [drivers]; + } + var supportedDrivers = this._getSupportedDrivers(drivers); + function setDriverToConfig() { + self2._config.driver = self2.driver(); + } + function extendSelfWithDriver(driver) { + self2._extend(driver); + setDriverToConfig(); + self2._ready = self2._initStorage(self2._config); + return self2._ready; + } + function initDriver(supportedDrivers2) { + return function() { + var currentDriverIndex = 0; + function driverPromiseLoop() { + while (currentDriverIndex < supportedDrivers2.length) { + var driverName = supportedDrivers2[currentDriverIndex]; + currentDriverIndex++; + self2._dbInfo = null; + self2._ready = null; + return self2.getDriver(driverName).then(extendSelfWithDriver)["catch"](driverPromiseLoop); + } + setDriverToConfig(); + var error = new Error("No available storage method found."); + self2._driverSet = Promise$1.reject(error); + return self2._driverSet; + } + return driverPromiseLoop(); + }; + } + var oldDriverSetDone = this._driverSet !== null ? this._driverSet["catch"](function() { + return Promise$1.resolve(); + }) : Promise$1.resolve(); + this._driverSet = oldDriverSetDone.then(function() { + var driverName = supportedDrivers[0]; + self2._dbInfo = null; + self2._ready = null; + return self2.getDriver(driverName).then(function(driver) { + self2._driver = driver._driver; + setDriverToConfig(); + self2._wrapLibraryMethodsWithReady(); + self2._initDriver = initDriver(supportedDrivers); + }); + })["catch"](function() { + setDriverToConfig(); + var error = new Error("No available storage method found."); + self2._driverSet = Promise$1.reject(error); + return self2._driverSet; + }); + executeTwoCallbacks(this._driverSet, callback, errorCallback); + return this._driverSet; + }; + LocalForage2.prototype.supports = function supports(driverName) { + return !!DriverSupport[driverName]; + }; + LocalForage2.prototype._extend = function _extend(libraryMethodsAndProperties) { + extend2(this, libraryMethodsAndProperties); + }; + LocalForage2.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) { + var supportedDrivers = []; + for (var i4 = 0, len = drivers.length; i4 < len; i4++) { + var driverName = drivers[i4]; + if (this.supports(driverName)) { + supportedDrivers.push(driverName); + } + } + return supportedDrivers; + }; + LocalForage2.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() { + for (var i4 = 0, len = LibraryMethods.length; i4 < len; i4++) { + callWhenReady(this, LibraryMethods[i4]); + } + }; + LocalForage2.prototype.createInstance = function createInstance(options) { + return new LocalForage2(options); + }; + return LocalForage2; + }(); + var localforage_js = new LocalForage(); + module4.exports = localforage_js; + }, { "3": 3 }] }, {}, [4])(4); + }); + } +}); + +// node_modules/sql.js/dist/sql-wasm.js +var require_sql_wasm = __commonJS({ + "node_modules/sql.js/dist/sql-wasm.js"(exports, module2) { + var initSqlJsPromise = void 0; + var initSqlJs2 = function(moduleConfig) { + if (initSqlJsPromise) { + return initSqlJsPromise; + } + initSqlJsPromise = new Promise(function(resolveModule, reject) { + var Module = typeof moduleConfig !== "undefined" ? moduleConfig : {}; + var originalOnAbortFunction = Module["onAbort"]; + Module["onAbort"] = function(errorThatCausedAbort) { + reject(new Error(errorThatCausedAbort)); + if (originalOnAbortFunction) { + originalOnAbortFunction(errorThatCausedAbort); } - }, i: function(a5, b4) { - try { - var c4 = R3[a5]; - if (!c4) - throw new P4(8); - ia(c4.node, b4); - return 0; - } catch (d5) { - if ("undefined" == typeof W2 || !(d5 instanceof P4)) - throw d5; - return -d5.Ka; + }; + Module["postRun"] = Module["postRun"] || []; + Module["postRun"].push(function() { + resolveModule(Module); + }); + module2 = void 0; + var e4; + e4 || (e4 = typeof Module !== "undefined" ? Module : {}); + null; + e4.onRuntimeInitialized = function() { + function a5(g4, m5) { + switch (typeof m5) { + case "boolean": + gc(g4, m5 ? 1 : 0); + break; + case "number": + hc(g4, m5); + break; + case "string": + ic(g4, m5, -1, -1); + break; + case "object": + if (null === m5) + kb(g4); + else if (null != m5.length) { + var n2 = aa(m5); + jc(g4, n2, m5.length, -1); + ba(n2); + } else + xa(g4, "Wrong API use : tried to return a value of an unknown type (" + m5 + ").", -1); + break; + default: + kb(g4); + } } - }, g: function(a5) { - try { - var b4 = R3[a5]; - if (!b4) - throw new P4(8); - var c4 = b4.node; - var d5 = "string" == typeof c4 ? U2(c4, { Sa: true }).node : c4; - if (!d5.Ga.Oa) - throw new P4(63); - d5.Ga.Oa(d5, { timestamp: Date.now() }); - return 0; - } catch (f4) { - if ("undefined" == typeof W2 || !(f4 instanceof P4)) - throw f4; - return -f4.Ka; - } - }, b: function(a5, b4, c4) { - fc = c4; - try { - var d5 = X3(a5); - switch (b4) { - case 0: - var f4 = Hc(); - return 0 > f4 ? -28 : Pb(d5, f4).fd; - case 1: - case 2: - return 0; - case 3: - return d5.flags; - case 4: - return f4 = Hc(), d5.flags |= f4, 0; - case 5: - return f4 = Hc(), Oa[f4 + 0 >> 1] = 2, 0; - case 6: - case 7: - return 0; - case 16: - case 8: - return -28; - case 9: - return F4[Vc() >> 2] = 28, -1; - default: - return -28; - } - } catch (h5) { - if ("undefined" == typeof W2 || !(h5 instanceof P4)) - throw h5; - return -h5.Ka; - } - }, G: function(a5, b4) { - try { - var c4 = X3(a5); - return ec(Ub, c4.path, b4); - } catch (d5) { - if ("undefined" == typeof W2 || !(d5 instanceof P4)) - throw d5; - return -d5.Ka; - } - }, l: function(a5, b4, c4) { - try { - b4 = c4 + 2097152 >>> 0 < 4194305 - !!b4 ? (b4 >>> 0) + 4294967296 * c4 : NaN; - if (isNaN(b4)) - return -61; - var d5 = R3[a5]; - if (!d5) - throw new P4(8); - if (0 === (d5.flags & 2097155)) - throw new P4(28); - Wb(d5.node, b4); - return 0; - } catch (f4) { - if ("undefined" == typeof W2 || !(f4 instanceof P4)) - throw f4; - return -f4.Ka; - } - }, B: function(a5, b4) { - try { - if (0 === b4) - return -28; - var c4 = ca("/") + 1; - if (b4 < c4) - return -68; - t4("/", u4, a5, b4); - return c4; - } catch (d5) { - if ("undefined" == typeof W2 || !(d5 instanceof P4)) - throw d5; - return -d5.Ka; - } - }, E: function(a5, b4) { - try { - return a5 = C3(a5), ec(Vb, a5, b4); - } catch (c4) { - if ("undefined" == typeof W2 || !(c4 instanceof P4)) - throw c4; - return -c4.Ka; - } - }, y: function(a5, b4, c4) { - try { - return b4 = C3(b4), b4 = dc(a5, b4), b4 = z5(b4), "/" === b4[b4.length - 1] && (b4 = b4.substr(0, b4.length - 1)), V3(b4, c4), 0; - } catch (d5) { - if ("undefined" == typeof W2 || !(d5 instanceof P4)) - throw d5; - return -d5.Ka; - } - }, D: function(a5, b4, c4, d5) { - try { - b4 = C3(b4); - var f4 = d5 & 256; - b4 = dc(a5, b4, d5 & 4096); - return ec(f4 ? Vb : Ub, b4, c4); - } catch (h5) { - if ("undefined" == typeof W2 || !(h5 instanceof P4)) - throw h5; - return -h5.Ka; - } - }, v: function(a5, b4, c4, d5) { - fc = d5; - try { - b4 = C3(b4); - b4 = dc(a5, b4); - var f4 = d5 ? Hc() : 0; - return ja(b4, c4, f4).fd; - } catch (h5) { - if ("undefined" == typeof W2 || !(h5 instanceof P4)) - throw h5; - return -h5.Ka; - } - }, t: function(a5, b4, c4, d5) { - try { - b4 = C3(b4); - b4 = dc(a5, b4); - if (0 >= d5) - return -28; - var f4 = Eb(b4), h5 = Math.min( - d5, - ca(f4) - ), k5 = r3[c4 + h5]; - t4(f4, u4, c4, d5 + 1); - r3[c4 + h5] = k5; - return h5; - } catch (q5) { - if ("undefined" == typeof W2 || !(q5 instanceof P4)) - throw q5; - return -q5.Ka; - } - }, s: function(a5) { - try { - return a5 = C3(a5), Tb(a5), 0; - } catch (b4) { - if ("undefined" == typeof W2 || !(b4 instanceof P4)) - throw b4; - return -b4.Ka; - } - }, F: function(a5, b4) { - try { - return a5 = C3(a5), ec(Ub, a5, b4); - } catch (c4) { - if ("undefined" == typeof W2 || !(c4 instanceof P4)) - throw c4; - return -c4.Ka; - } - }, p: function(a5, b4, c4) { - try { - return b4 = C3(b4), b4 = dc(a5, b4), 0 === c4 ? ta(b4) : 512 === c4 ? Tb(b4) : E4("Invalid flags passed to unlinkat"), 0; - } catch (d5) { - if ("undefined" == typeof W2 || !(d5 instanceof P4)) - throw d5; - return -d5.Ka; - } - }, o: function(a5, b4, c4) { - try { - b4 = C3(b4); - b4 = dc(a5, b4, true); - if (c4) { - var d5 = Jc(c4), f4 = F4[c4 + 8 >> 2]; - h5 = 1e3 * d5 + f4 / 1e6; - c4 += 16; - d5 = Jc(c4); - f4 = F4[c4 + 8 >> 2]; - k5 = 1e3 * d5 + f4 / 1e6; - } else - var h5 = Date.now(), k5 = h5; - a5 = h5; - var q5 = U2(b4, { Sa: true }).node; - q5.Ga.Oa(q5, { timestamp: Math.max(a5, k5) }); - return 0; - } catch (x5) { - if ("undefined" == typeof W2 || !(x5 instanceof P4)) - throw x5; - return -x5.Ka; - } - }, e: function() { - return Date.now(); - }, j: function(a5, b4) { - a5 = new Date(1e3 * Jc(a5)); - F4[b4 >> 2] = a5.getSeconds(); - F4[b4 + 4 >> 2] = a5.getMinutes(); - F4[b4 + 8 >> 2] = a5.getHours(); - F4[b4 + 12 >> 2] = a5.getDate(); - F4[b4 + 16 >> 2] = a5.getMonth(); - F4[b4 + 20 >> 2] = a5.getFullYear() - 1900; - F4[b4 + 24 >> 2] = a5.getDay(); - var c4 = new Date(a5.getFullYear(), 0, 1); - F4[b4 + 28 >> 2] = (a5.getTime() - c4.getTime()) / 864e5 | 0; - F4[b4 + 36 >> 2] = -(60 * a5.getTimezoneOffset()); - var d5 = new Date(a5.getFullYear(), 6, 1).getTimezoneOffset(); - c4 = c4.getTimezoneOffset(); - F4[b4 + 32 >> 2] = (d5 != c4 && a5.getTimezoneOffset() == Math.min(c4, d5)) | 0; - }, w: function(a5, b4, c4, d5, f4, h5) { - try { - var k5 = X3(d5); - if (0 !== (b4 & 2) && 0 === (c4 & 2) && 2 !== (k5.flags & 2097155)) - throw new P4(2); - if (1 === (k5.flags & 2097155)) - throw new P4(2); - if (!k5.Ha.bb) - throw new P4(43); - var q5 = k5.Ha.bb(k5, a5, f4, b4, c4); - var x5 = q5.Fb; - F4[h5 >> 2] = q5.vb; - return x5; - } catch (w5) { - if ("undefined" == typeof W2 || !(w5 instanceof P4)) - throw w5; - return -w5.Ka; - } - }, x: function(a5, b4, c4, d5, f4, h5) { - try { - var k5 = X3(f4); - if (c4 & 2) { - var q5 = u4.slice(a5, a5 + b4); - k5 && k5.Ha.cb && k5.Ha.cb(k5, q5, h5, b4, d5); - } - } catch (x5) { - if ("undefined" == typeof W2 || !(x5 instanceof P4)) - throw x5; - return -x5.Ka; - } - }, n: Mc, q: function() { - return 2147483648; - }, d: Nc, c: function(a5) { - var b4 = u4.length; - a5 >>>= 0; - if (2147483648 < a5) - return false; - for (var c4 = 1; 4 >= c4; c4 *= 2) { - var d5 = b4 * (1 + 0.2 / c4); - d5 = Math.min(d5, a5 + 100663296); - var f4 = Math; - d5 = Math.max( - a5, - d5 - ); - f4 = f4.min.call(f4, 2147483648, d5 + (65536 - d5 % 65536) % 65536); - a: { - try { - Ja.grow(f4 - Na.byteLength + 65535 >>> 16); - Ra(); - var h5 = 1; - break a; - } catch (k5) { - } - h5 = void 0; - } - if (h5) - return true; - } - return false; - }, z: function(a5, b4) { - var c4 = 0; - Pc().forEach(function(d5, f4) { - var h5 = b4 + c4; - f4 = J2[a5 + 4 * f4 >> 2] = h5; - for (h5 = 0; h5 < d5.length; ++h5) - r3[f4++ >> 0] = d5.charCodeAt(h5); - r3[f4 >> 0] = 0; - c4 += d5.length + 1; - }); - return 0; - }, A: function(a5, b4) { - var c4 = Pc(); - J2[a5 >> 2] = c4.length; - var d5 = 0; - c4.forEach(function(f4) { - d5 += f4.length + 1; - }); - J2[b4 >> 2] = d5; - return 0; - }, f: function(a5) { - try { - var b4 = X3(a5); - la(b4); - return 0; - } catch (c4) { - if ("undefined" == typeof W2 || !(c4 instanceof P4)) - throw c4; - return c4.Ka; - } - }, m: function(a5, b4) { - try { - var c4 = X3(a5); - r3[b4 >> 0] = c4.tty ? 2 : 16384 === (c4.mode & 61440) ? 3 : 40960 === (c4.mode & 61440) ? 7 : 4; - return 0; - } catch (d5) { - if ("undefined" == typeof W2 || !(d5 instanceof P4)) - throw d5; - return d5.Ka; - } - }, u: function(a5, b4, c4, d5) { - try { - a: { - var f4 = X3(a5); - a5 = b4; - for (var h5 = b4 = 0; h5 < c4; h5++) { - var k5 = J2[a5 >> 2], q5 = J2[a5 + 4 >> 2]; - a5 += 8; - var x5 = Zb(f4, r3, k5, q5); - if (0 > x5) { - var w5 = -1; - break a; - } - b4 += x5; - if (x5 < q5) - break; - } - w5 = b4; + function b4(g4, m5) { + for (var n2 = [], p3 = 0; p3 < g4; p3 += 1) { + var v3 = l3(m5 + 4 * p3, "i32"), y5 = kc(v3); + if (1 === y5 || 2 === y5) + v3 = lc(v3); + else if (3 === y5) + v3 = mc(v3); + else if (4 === y5) { + y5 = v3; + v3 = nc(y5); + y5 = oc(y5); + for (var L4 = new Uint8Array(v3), G3 = 0; G3 < v3; G3 += 1) + L4[G3] = r3[y5 + G3]; + v3 = L4; + } else + v3 = null; + n2.push(v3); } - J2[d5 >> 2] = w5; - return 0; - } catch (A4) { - if ("undefined" == typeof W2 || !(A4 instanceof P4)) - throw A4; - return A4.Ka; + return n2; } - }, k: function(a5, b4, c4, d5, f4) { - try { - b4 = c4 + 2097152 >>> 0 < 4194305 - !!b4 ? (b4 >>> 0) + 4294967296 * c4 : NaN; - if (isNaN(b4)) - return 61; - var h5 = X3(a5); - Yb(h5, b4, d5); - O4 = [h5.position >>> 0, (N3 = h5.position, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; - F4[f4 >> 2] = O4[0]; - F4[f4 + 4 >> 2] = O4[1]; - h5.hb && 0 === b4 && 0 === d5 && (h5.hb = null); - return 0; - } catch (k5) { - if ("undefined" == typeof W2 || !(k5 instanceof P4)) - throw k5; - return k5.Ka; + function c4(g4, m5) { + this.La = g4; + this.db = m5; + this.Ja = 1; + this.fb = []; } - }, C: function(a5) { - try { - var b4 = X3(a5); - return b4.Ha && b4.Ha.fsync ? b4.Ha.fsync(b4) : 0; - } catch (c4) { - if ("undefined" == typeof W2 || !(c4 instanceof P4)) - throw c4; - return c4.Ka; + function d5(g4, m5) { + this.db = m5; + m5 = ca(g4) + 1; + this.Ya = da(m5); + if (null === this.Ya) + throw Error("Unable to allocate memory for the SQL string"); + t4(g4, u4, this.Ya, m5); + this.eb = this.Ya; + this.Ua = this.ib = null; } - }, r: function(a5, b4, c4, d5) { - try { - a: { - var f4 = X3(a5); - a5 = b4; - for (var h5 = b4 = 0; h5 < c4; h5++) { - var k5 = J2[a5 >> 2], q5 = J2[a5 + 4 >> 2]; - a5 += 8; - var x5 = ka(f4, r3, k5, q5); - if (0 > x5) { - var w5 = -1; - break a; + function f4(g4) { + this.filename = "dbfile_" + (4294967295 * Math.random() >>> 0); + if (null != g4) { + var m5 = this.filename, n2 = "/", p3 = m5; + n2 && (n2 = "string" == typeof n2 ? n2 : ea(n2), p3 = m5 ? z5(n2 + "/" + m5) : n2); + m5 = fa( + true, + true + ); + p3 = ha(p3, (void 0 !== m5 ? m5 : 438) & 4095 | 32768, 0); + if (g4) { + if ("string" == typeof g4) { + n2 = Array(g4.length); + for (var v3 = 0, y5 = g4.length; v3 < y5; ++v3) + n2[v3] = g4.charCodeAt(v3); + g4 = n2; } - b4 += x5; + ia(p3, m5 | 146); + n2 = ja(p3, 577); + ka(n2, g4, 0, g4.length, 0); + la(n2); + ia(p3, m5); } - w5 = b4; } - J2[d5 >> 2] = w5; - return 0; - } catch (A4) { - if ("undefined" == typeof W2 || !(A4 instanceof P4)) - throw A4; - return A4.Ka; - } - } }; - (function() { - function a5(f4) { - e4.asm = f4.exports; - Ja = e4.asm.I; - Ra(); - K3 = e4.asm.Aa; - Ta.unshift(e4.asm.J); - Wa--; - e4.monitorRunDependencies && e4.monitorRunDependencies(Wa); - 0 == Wa && (null !== Xa && (clearInterval(Xa), Xa = null), Ya && (f4 = Ya, Ya = null, f4())); - } - function b4(f4) { - a5(f4.instance); - } - function c4(f4) { - return bb().then(function(h5) { - return WebAssembly.instantiate(h5, d5); - }).then(function(h5) { - return h5; - }).then(f4, function(h5) { - Ha("failed to asynchronously prepare wasm: " + h5); - E4(h5); - }); + this.handleError(q5(this.filename, h5)); + this.db = l3(h5, "i32"); + pc(this.db); + this.Za = {}; + this.Na = {}; } - var d5 = { a: Wc }; - Wa++; - e4.monitorRunDependencies && e4.monitorRunDependencies(Wa); - if (e4.instantiateWasm) - try { - return e4.instantiateWasm(d5, a5); - } catch (f4) { - return Ha("Module.instantiateWasm callback failed with error: " + f4), false; + var h5 = B5(4), k5 = e4.cwrap, q5 = k5("sqlite3_open", "number", ["string", "number"]), x5 = k5("sqlite3_close_v2", "number", ["number"]), w5 = k5("sqlite3_exec", "number", ["number", "string", "number", "number", "number"]), A4 = k5( + "sqlite3_changes", + "number", + ["number"] + ), S4 = k5("sqlite3_prepare_v2", "number", ["number", "string", "number", "number", "number"]), nb = k5("sqlite3_sql", "string", ["number"]), qc = k5("sqlite3_normalized_sql", "string", ["number"]), ob = k5("sqlite3_prepare_v2", "number", ["number", "number", "number", "number", "number"]), rc = k5("sqlite3_bind_text", "number", ["number", "number", "number", "number", "number"]), pb = k5("sqlite3_bind_blob", "number", ["number", "number", "number", "number", "number"]), sc = k5("sqlite3_bind_double", "number", ["number", "number", "number"]), tc = k5("sqlite3_bind_int", "number", ["number", "number", "number"]), uc = k5("sqlite3_bind_parameter_index", "number", ["number", "string"]), vc = k5("sqlite3_step", "number", ["number"]), wc = k5("sqlite3_errmsg", "string", ["number"]), xc = k5("sqlite3_column_count", "number", ["number"]), yc = k5("sqlite3_data_count", "number", ["number"]), zc = k5("sqlite3_column_double", "number", ["number", "number"]), qb = k5("sqlite3_column_text", "string", ["number", "number"]), Ac = k5("sqlite3_column_blob", "number", ["number", "number"]), Bc = k5( + "sqlite3_column_bytes", + "number", + ["number", "number"] + ), Cc = k5("sqlite3_column_type", "number", ["number", "number"]), Dc = k5("sqlite3_column_name", "string", ["number", "number"]), Ec = k5("sqlite3_reset", "number", ["number"]), Fc = k5("sqlite3_clear_bindings", "number", ["number"]), Gc = k5("sqlite3_finalize", "number", ["number"]), rb = k5("sqlite3_create_function_v2", "number", "number string number number number number number number number".split(" ")), kc = k5("sqlite3_value_type", "number", ["number"]), nc = k5("sqlite3_value_bytes", "number", ["number"]), mc = k5( + "sqlite3_value_text", + "string", + ["number"] + ), oc = k5("sqlite3_value_blob", "number", ["number"]), lc = k5("sqlite3_value_double", "number", ["number"]), hc = k5("sqlite3_result_double", "", ["number", "number"]), kb = k5("sqlite3_result_null", "", ["number"]), ic = k5("sqlite3_result_text", "", ["number", "string", "number", "number"]), jc = k5("sqlite3_result_blob", "", ["number", "number", "number", "number"]), gc = k5("sqlite3_result_int", "", ["number", "number"]), xa = k5("sqlite3_result_error", "", ["number", "string", "number"]), sb = k5( + "sqlite3_aggregate_context", + "number", + ["number", "number"] + ), pc = k5("RegisterExtensionFunctions", "number", ["number"]); + c4.prototype.bind = function(g4) { + if (!this.La) + throw "Statement closed"; + this.reset(); + return Array.isArray(g4) ? this.xb(g4) : null != g4 && "object" === typeof g4 ? this.yb(g4) : true; + }; + c4.prototype.step = function() { + if (!this.La) + throw "Statement closed"; + this.Ja = 1; + var g4 = vc(this.La); + switch (g4) { + case 100: + return true; + case 101: + return false; + default: + throw this.db.handleError(g4); } - (function() { - return Ia || "function" != typeof WebAssembly.instantiateStreaming || Za() || M5.startsWith("file://") || Aa || "function" != typeof fetch ? c4(b4) : fetch(M5, { credentials: "same-origin" }).then(function(f4) { - return WebAssembly.instantiateStreaming(f4, d5).then(b4, function(h5) { - Ha("wasm streaming compile failed: " + h5); - Ha("falling back to ArrayBuffer instantiation"); - return c4(b4); - }); - }); - })(); - return {}; - })(); - e4.___wasm_call_ctors = function() { - return (e4.___wasm_call_ctors = e4.asm.J).apply(null, arguments); - }; - e4._sqlite3_free = function() { - return (e4._sqlite3_free = e4.asm.K).apply(null, arguments); - }; - e4._sqlite3_value_double = function() { - return (e4._sqlite3_value_double = e4.asm.L).apply(null, arguments); - }; - e4._sqlite3_value_text = function() { - return (e4._sqlite3_value_text = e4.asm.M).apply(null, arguments); - }; - var Vc = e4.___errno_location = function() { - return (Vc = e4.___errno_location = e4.asm.N).apply(null, arguments); - }; - e4._sqlite3_prepare_v2 = function() { - return (e4._sqlite3_prepare_v2 = e4.asm.O).apply(null, arguments); - }; - e4._sqlite3_step = function() { - return (e4._sqlite3_step = e4.asm.P).apply(null, arguments); - }; - e4._sqlite3_finalize = function() { - return (e4._sqlite3_finalize = e4.asm.Q).apply(null, arguments); - }; - e4._sqlite3_reset = function() { - return (e4._sqlite3_reset = e4.asm.R).apply(null, arguments); - }; - e4._sqlite3_value_int = function() { - return (e4._sqlite3_value_int = e4.asm.S).apply(null, arguments); - }; - e4._sqlite3_clear_bindings = function() { - return (e4._sqlite3_clear_bindings = e4.asm.T).apply(null, arguments); - }; - e4._sqlite3_value_blob = function() { - return (e4._sqlite3_value_blob = e4.asm.U).apply(null, arguments); - }; - e4._sqlite3_value_bytes = function() { - return (e4._sqlite3_value_bytes = e4.asm.V).apply(null, arguments); - }; - e4._sqlite3_value_type = function() { - return (e4._sqlite3_value_type = e4.asm.W).apply(null, arguments); - }; - e4._sqlite3_result_blob = function() { - return (e4._sqlite3_result_blob = e4.asm.X).apply(null, arguments); - }; - e4._sqlite3_result_double = function() { - return (e4._sqlite3_result_double = e4.asm.Y).apply(null, arguments); - }; - e4._sqlite3_result_error = function() { - return (e4._sqlite3_result_error = e4.asm.Z).apply(null, arguments); - }; - e4._sqlite3_result_int = function() { - return (e4._sqlite3_result_int = e4.asm._).apply(null, arguments); - }; - e4._sqlite3_result_int64 = function() { - return (e4._sqlite3_result_int64 = e4.asm.$).apply(null, arguments); - }; - e4._sqlite3_result_null = function() { - return (e4._sqlite3_result_null = e4.asm.aa).apply(null, arguments); - }; - e4._sqlite3_result_text = function() { - return (e4._sqlite3_result_text = e4.asm.ba).apply(null, arguments); - }; - e4._sqlite3_sql = function() { - return (e4._sqlite3_sql = e4.asm.ca).apply(null, arguments); - }; - e4._sqlite3_aggregate_context = function() { - return (e4._sqlite3_aggregate_context = e4.asm.da).apply(null, arguments); - }; - e4._sqlite3_column_count = function() { - return (e4._sqlite3_column_count = e4.asm.ea).apply(null, arguments); - }; - e4._sqlite3_data_count = function() { - return (e4._sqlite3_data_count = e4.asm.fa).apply(null, arguments); - }; - e4._sqlite3_column_blob = function() { - return (e4._sqlite3_column_blob = e4.asm.ga).apply(null, arguments); - }; - e4._sqlite3_column_bytes = function() { - return (e4._sqlite3_column_bytes = e4.asm.ha).apply(null, arguments); - }; - e4._sqlite3_column_double = function() { - return (e4._sqlite3_column_double = e4.asm.ia).apply(null, arguments); - }; - e4._sqlite3_column_text = function() { - return (e4._sqlite3_column_text = e4.asm.ja).apply(null, arguments); - }; - e4._sqlite3_column_type = function() { - return (e4._sqlite3_column_type = e4.asm.ka).apply(null, arguments); - }; - e4._sqlite3_column_name = function() { - return (e4._sqlite3_column_name = e4.asm.la).apply(null, arguments); - }; - e4._sqlite3_bind_blob = function() { - return (e4._sqlite3_bind_blob = e4.asm.ma).apply(null, arguments); - }; - e4._sqlite3_bind_double = function() { - return (e4._sqlite3_bind_double = e4.asm.na).apply(null, arguments); - }; - e4._sqlite3_bind_int = function() { - return (e4._sqlite3_bind_int = e4.asm.oa).apply(null, arguments); - }; - e4._sqlite3_bind_text = function() { - return (e4._sqlite3_bind_text = e4.asm.pa).apply(null, arguments); - }; - e4._sqlite3_bind_parameter_index = function() { - return (e4._sqlite3_bind_parameter_index = e4.asm.qa).apply(null, arguments); - }; - e4._sqlite3_normalized_sql = function() { - return (e4._sqlite3_normalized_sql = e4.asm.ra).apply(null, arguments); - }; - e4._sqlite3_errmsg = function() { - return (e4._sqlite3_errmsg = e4.asm.sa).apply(null, arguments); - }; - e4._sqlite3_exec = function() { - return (e4._sqlite3_exec = e4.asm.ta).apply(null, arguments); - }; - e4._sqlite3_changes = function() { - return (e4._sqlite3_changes = e4.asm.ua).apply(null, arguments); - }; - e4._sqlite3_close_v2 = function() { - return (e4._sqlite3_close_v2 = e4.asm.va).apply(null, arguments); - }; - e4._sqlite3_create_function_v2 = function() { - return (e4._sqlite3_create_function_v2 = e4.asm.wa).apply(null, arguments); - }; - e4._sqlite3_open = function() { - return (e4._sqlite3_open = e4.asm.xa).apply(null, arguments); - }; - var da = e4._malloc = function() { - return (da = e4._malloc = e4.asm.ya).apply(null, arguments); - }, ba = e4._free = function() { - return (ba = e4._free = e4.asm.za).apply(null, arguments); - }; - e4._RegisterExtensionFunctions = function() { - return (e4._RegisterExtensionFunctions = e4.asm.Ba).apply(null, arguments); - }; - var zb = e4._emscripten_builtin_memalign = function() { - return (zb = e4._emscripten_builtin_memalign = e4.asm.Ca).apply(null, arguments); - }, oa = e4.stackSave = function() { - return (oa = e4.stackSave = e4.asm.Da).apply(null, arguments); - }, qa = e4.stackRestore = function() { - return (qa = e4.stackRestore = e4.asm.Ea).apply(null, arguments); - }, B5 = e4.stackAlloc = function() { - return (B5 = e4.stackAlloc = e4.asm.Fa).apply(null, arguments); - }; - e4.UTF8ToString = C3; - e4.stackAlloc = B5; - e4.stackSave = oa; - e4.stackRestore = qa; - e4.cwrap = function(a5, b4, c4, d5) { - c4 = c4 || []; - var f4 = c4.every((h5) => "number" === h5 || "boolean" === h5); - return "string" !== b4 && f4 && !d5 ? e4["_" + a5] : function() { - return Uc(a5, b4, c4, arguments); }; - }; - var Xc; - Ya = function Yc() { - Xc || Zc(); - Xc || (Ya = Yc); - }; - function Zc() { - function a5() { - if (!Xc && (Xc = true, e4.calledRun = true, !Ka)) { - e4.noFSInit || ac || (ac = true, $b(), e4.stdin = e4.stdin, e4.stdout = e4.stdout, e4.stderr = e4.stderr, e4.stdin ? cc("stdin", e4.stdin) : Sb("/dev/tty", "/dev/stdin"), e4.stdout ? cc("stdout", null, e4.stdout) : Sb("/dev/tty", "/dev/stdout"), e4.stderr ? cc("stderr", null, e4.stderr) : Sb("/dev/tty1", "/dev/stderr"), ja("/dev/stdin", 0), ja("/dev/stdout", 1), ja("/dev/stderr", 1)); - Db = false; - cb(Ta); - if (e4.onRuntimeInitialized) - e4.onRuntimeInitialized(); - if (e4.postRun) - for ("function" == typeof e4.postRun && (e4.postRun = [e4.postRun]); e4.postRun.length; ) { - var b4 = e4.postRun.shift(); - Ua.unshift(b4); + c4.prototype.sb = function(g4) { + null == g4 && (g4 = this.Ja, this.Ja += 1); + return zc(this.La, g4); + }; + c4.prototype.Cb = function(g4) { + null == g4 && (g4 = this.Ja, this.Ja += 1); + g4 = qb(this.La, g4); + if ("function" !== typeof BigInt) + throw Error("BigInt is not supported"); + return BigInt(g4); + }; + c4.prototype.Db = function(g4) { + null == g4 && (g4 = this.Ja, this.Ja += 1); + return qb(this.La, g4); + }; + c4.prototype.getBlob = function(g4) { + null == g4 && (g4 = this.Ja, this.Ja += 1); + var m5 = Bc(this.La, g4); + g4 = Ac(this.La, g4); + for (var n2 = new Uint8Array(m5), p3 = 0; p3 < m5; p3 += 1) + n2[p3] = r3[g4 + p3]; + return n2; + }; + c4.prototype.get = function(g4, m5) { + m5 = m5 || {}; + null != g4 && this.bind(g4) && this.step(); + g4 = []; + for (var n2 = yc(this.La), p3 = 0; p3 < n2; p3 += 1) + switch (Cc(this.La, p3)) { + case 1: + var v3 = m5.useBigInt ? this.Cb(p3) : this.sb(p3); + g4.push(v3); + break; + case 2: + g4.push(this.sb(p3)); + break; + case 3: + g4.push(this.Db(p3)); + break; + case 4: + g4.push(this.getBlob(p3)); + break; + default: + g4.push(null); + } + return g4; + }; + c4.prototype.getColumnNames = function() { + for (var g4 = [], m5 = xc(this.La), n2 = 0; n2 < m5; n2 += 1) + g4.push(Dc(this.La, n2)); + return g4; + }; + c4.prototype.getAsObject = function(g4, m5) { + g4 = this.get(g4, m5); + m5 = this.getColumnNames(); + for (var n2 = {}, p3 = 0; p3 < m5.length; p3 += 1) + n2[m5[p3]] = g4[p3]; + return n2; + }; + c4.prototype.getSQL = function() { + return nb(this.La); + }; + c4.prototype.getNormalizedSQL = function() { + return qc(this.La); + }; + c4.prototype.run = function(g4) { + null != g4 && this.bind(g4); + this.step(); + return this.reset(); + }; + c4.prototype.nb = function(g4, m5) { + null == m5 && (m5 = this.Ja, this.Ja += 1); + g4 = ma(g4); + var n2 = aa(g4); + this.fb.push(n2); + this.db.handleError(rc(this.La, m5, n2, g4.length - 1, 0)); + }; + c4.prototype.wb = function(g4, m5) { + null == m5 && (m5 = this.Ja, this.Ja += 1); + var n2 = aa(g4); + this.fb.push(n2); + this.db.handleError(pb(this.La, m5, n2, g4.length, 0)); + }; + c4.prototype.mb = function(g4, m5) { + null == m5 && (m5 = this.Ja, this.Ja += 1); + this.db.handleError((g4 === (g4 | 0) ? tc : sc)(this.La, m5, g4)); + }; + c4.prototype.zb = function(g4) { + null == g4 && (g4 = this.Ja, this.Ja += 1); + pb(this.La, g4, 0, 0, 0); + }; + c4.prototype.ob = function(g4, m5) { + null == m5 && (m5 = this.Ja, this.Ja += 1); + switch (typeof g4) { + case "string": + this.nb(g4, m5); + return; + case "number": + this.mb(g4, m5); + return; + case "bigint": + this.nb(g4.toString(), m5); + return; + case "boolean": + this.mb(g4 + 0, m5); + return; + case "object": + if (null === g4) { + this.zb(m5); + return; + } + if (null != g4.length) { + this.wb(g4, m5); + return; } - cb(Ua); } + throw "Wrong API use : tried to bind a value of an unknown type (" + g4 + ")."; + }; + c4.prototype.yb = function(g4) { + var m5 = this; + Object.keys(g4).forEach(function(n2) { + var p3 = uc(m5.La, n2); + 0 !== p3 && m5.ob(g4[n2], p3); + }); + return true; + }; + c4.prototype.xb = function(g4) { + for (var m5 = 0; m5 < g4.length; m5 += 1) + this.ob(g4[m5], m5 + 1); + return true; + }; + c4.prototype.reset = function() { + this.freemem(); + return 0 === Fc(this.La) && 0 === Ec(this.La); + }; + c4.prototype.freemem = function() { + for (var g4; void 0 !== (g4 = this.fb.pop()); ) + ba(g4); + }; + c4.prototype.free = function() { + this.freemem(); + var g4 = 0 === Gc(this.La); + delete this.db.Za[this.La]; + this.La = 0; + return g4; + }; + d5.prototype.next = function() { + if (null === this.Ya) + return { done: true }; + null !== this.Ua && (this.Ua.free(), this.Ua = null); + if (!this.db.db) + throw this.gb(), Error("Database closed"); + var g4 = oa(), m5 = B5(4); + pa(h5); + pa(m5); + try { + this.db.handleError(ob(this.db.db, this.eb, -1, h5, m5)); + this.eb = l3(m5, "i32"); + var n2 = l3(h5, "i32"); + if (0 === n2) + return this.gb(), { done: true }; + this.Ua = new c4(n2, this.db); + this.db.Za[n2] = this.Ua; + return { value: this.Ua, done: false }; + } catch (p3) { + throw this.ib = C3(this.eb), this.gb(), p3; + } finally { + qa(g4); + } + }; + d5.prototype.gb = function() { + ba(this.Ya); + this.Ya = null; + }; + d5.prototype.getRemainingSQL = function() { + return null !== this.ib ? this.ib : C3(this.eb); + }; + "function" === typeof Symbol && "symbol" === typeof Symbol.iterator && (d5.prototype[Symbol.iterator] = function() { + return this; + }); + f4.prototype.run = function(g4, m5) { + if (!this.db) + throw "Database closed"; + if (m5) { + g4 = this.prepare(g4, m5); + try { + g4.step(); + } finally { + g4.free(); + } + } else + this.handleError(w5(this.db, g4, 0, 0, h5)); + return this; + }; + f4.prototype.exec = function(g4, m5, n2) { + if (!this.db) + throw "Database closed"; + var p3 = oa(), v3 = null; + try { + var y5 = ca(g4) + 1, L4 = B5(y5); + t4(g4, r3, L4, y5); + var G3 = L4; + var H5 = B5(4); + for (g4 = []; 0 !== l3(G3, "i8"); ) { + pa(h5); + pa(H5); + this.handleError(ob(this.db, G3, -1, h5, H5)); + var I4 = l3(h5, "i32"); + G3 = l3(H5, "i32"); + if (0 !== I4) { + y5 = null; + v3 = new c4(I4, this); + for (null != m5 && v3.bind(m5); v3.step(); ) + null === y5 && (y5 = { columns: v3.getColumnNames(), values: [] }, g4.push(y5)), y5.values.push(v3.get(null, n2)); + v3.free(); + } + } + return g4; + } catch (na) { + throw v3 && v3.free(), na; + } finally { + qa(p3); + } + }; + f4.prototype.each = function(g4, m5, n2, p3, v3) { + "function" === typeof m5 && (p3 = n2, n2 = m5, m5 = void 0); + g4 = this.prepare(g4, m5); + try { + for (; g4.step(); ) + n2(g4.getAsObject(null, v3)); + } finally { + g4.free(); + } + if ("function" === typeof p3) + return p3(); + }; + f4.prototype.prepare = function(g4, m5) { + pa(h5); + this.handleError(S4(this.db, g4, -1, h5, 0)); + g4 = l3(h5, "i32"); + if (0 === g4) + throw "Nothing to prepare"; + var n2 = new c4(g4, this); + null != m5 && n2.bind(m5); + return this.Za[g4] = n2; + }; + f4.prototype.iterateStatements = function(g4) { + return new d5(g4, this); + }; + f4.prototype["export"] = function() { + Object.values(this.Za).forEach(function(m5) { + m5.free(); + }); + Object.values(this.Na).forEach(ra); + this.Na = {}; + this.handleError(x5(this.db)); + var g4 = sa(this.filename); + this.handleError(q5(this.filename, h5)); + this.db = l3(h5, "i32"); + return g4; + }; + f4.prototype.close = function() { + null !== this.db && (Object.values(this.Za).forEach(function(g4) { + g4.free(); + }), Object.values(this.Na).forEach(ra), this.Na = {}, this.handleError(x5(this.db)), ta("/" + this.filename), this.db = null); + }; + f4.prototype.handleError = function(g4) { + if (0 === g4) + return null; + g4 = wc(this.db); + throw Error(g4); + }; + f4.prototype.getRowsModified = function() { + return A4(this.db); + }; + f4.prototype.create_function = function(g4, m5) { + Object.prototype.hasOwnProperty.call(this.Na, g4) && (ra(this.Na[g4]), delete this.Na[g4]); + var n2 = ua(function(p3, v3, y5) { + v3 = b4(v3, y5); + try { + var L4 = m5.apply(null, v3); + } catch (G3) { + xa(p3, G3, -1); + return; + } + a5(p3, L4); + }, "viii"); + this.Na[g4] = n2; + this.handleError(rb(this.db, g4, m5.length, 1, 0, n2, 0, 0, 0)); + return this; + }; + f4.prototype.create_aggregate = function(g4, m5) { + var n2 = m5.init || function() { + return null; + }, p3 = m5.finalize || function(H5) { + return H5; + }, v3 = m5.step; + if (!v3) + throw "An aggregate function must have a step function in " + g4; + var y5 = {}; + Object.hasOwnProperty.call(this.Na, g4) && (ra(this.Na[g4]), delete this.Na[g4]); + m5 = g4 + "__finalize"; + Object.hasOwnProperty.call(this.Na, m5) && (ra(this.Na[m5]), delete this.Na[m5]); + var L4 = ua(function(H5, I4, na) { + var Z2 = sb(H5, 1); + Object.hasOwnProperty.call(y5, Z2) || (y5[Z2] = n2()); + I4 = b4(I4, na); + I4 = [y5[Z2]].concat(I4); + try { + y5[Z2] = v3.apply(null, I4); + } catch (Ic) { + delete y5[Z2], xa(H5, Ic, -1); + } + }, "viii"), G3 = ua(function(H5) { + var I4 = sb(H5, 1); + try { + var na = p3(y5[I4]); + } catch (Z2) { + delete y5[I4]; + xa(H5, Z2, -1); + return; + } + a5(H5, na); + delete y5[I4]; + }, "vi"); + this.Na[g4] = L4; + this.Na[m5] = G3; + this.handleError(rb(this.db, g4, v3.length - 1, 1, 0, 0, L4, G3, 0)); + return this; + }; + e4.Database = f4; + }; + var va = Object.assign({}, e4), wa = "./this.program", ya = "object" == typeof window, za = "function" == typeof importScripts, Aa = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, D4 = "", Ba, Ca, Da, fs, Ea, Fa; + if (Aa) + D4 = za ? require("path").dirname(D4) + "/" : __dirname + "/", Fa = () => { + Ea || (fs = require("fs"), Ea = require("path")); + }, Ba = function(a5, b4) { + Fa(); + a5 = Ea.normalize(a5); + return fs.readFileSync(a5, b4 ? void 0 : "utf8"); + }, Da = (a5) => { + a5 = Ba(a5, true); + a5.buffer || (a5 = new Uint8Array(a5)); + return a5; + }, Ca = (a5, b4, c4) => { + Fa(); + a5 = Ea.normalize(a5); + fs.readFile(a5, function(d5, f4) { + d5 ? c4(d5) : b4(f4.buffer); + }); + }, 1 < process.argv.length && (wa = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), "undefined" != typeof module2 && (module2.exports = e4), e4.inspect = function() { + return "[Emscripten Module object]"; + }; + else if (ya || za) + za ? D4 = self.location.href : "undefined" != typeof document && document.currentScript && (D4 = document.currentScript.src), D4 = 0 !== D4.indexOf("blob:") ? D4.substr(0, D4.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", Ba = (a5) => { + var b4 = new XMLHttpRequest(); + b4.open("GET", a5, false); + b4.send(null); + return b4.responseText; + }, za && (Da = (a5) => { + var b4 = new XMLHttpRequest(); + b4.open("GET", a5, false); + b4.responseType = "arraybuffer"; + b4.send(null); + return new Uint8Array(b4.response); + }), Ca = (a5, b4, c4) => { + var d5 = new XMLHttpRequest(); + d5.open("GET", a5, true); + d5.responseType = "arraybuffer"; + d5.onload = () => { + 200 == d5.status || 0 == d5.status && d5.response ? b4(d5.response) : c4(); + }; + d5.onerror = c4; + d5.send(null); + }; + var Ga = e4.print || console.log.bind(console), Ha = e4.printErr || console.warn.bind(console); + Object.assign(e4, va); + va = null; + e4.thisProgram && (wa = e4.thisProgram); + var Ia; + e4.wasmBinary && (Ia = e4.wasmBinary); + var noExitRuntime = e4.noExitRuntime || true; + "object" != typeof WebAssembly && E4("no native wasm support detected"); + var Ja, Ka = false, La = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0; + function Ma(a5, b4, c4) { + var d5 = b4 + c4; + for (c4 = b4; a5[c4] && !(c4 >= d5); ) + ++c4; + if (16 < c4 - b4 && a5.buffer && La) + return La.decode(a5.subarray(b4, c4)); + for (d5 = ""; b4 < c4; ) { + var f4 = a5[b4++]; + if (f4 & 128) { + var h5 = a5[b4++] & 63; + if (192 == (f4 & 224)) + d5 += String.fromCharCode((f4 & 31) << 6 | h5); + else { + var k5 = a5[b4++] & 63; + f4 = 224 == (f4 & 240) ? (f4 & 15) << 12 | h5 << 6 | k5 : (f4 & 7) << 18 | h5 << 12 | k5 << 6 | a5[b4++] & 63; + 65536 > f4 ? d5 += String.fromCharCode(f4) : (f4 -= 65536, d5 += String.fromCharCode(55296 | f4 >> 10, 56320 | f4 & 1023)); + } + } else + d5 += String.fromCharCode(f4); } - if (!(0 < Wa)) { - if (e4.preRun) - for ("function" == typeof e4.preRun && (e4.preRun = [e4.preRun]); e4.preRun.length; ) - Va(); - cb(Sa); - 0 < Wa || (e4.setStatus ? (e4.setStatus("Running..."), setTimeout(function() { - setTimeout(function() { - e4.setStatus(""); - }, 1); - a5(); - }, 1)) : a5()); - } - } - if (e4.preInit) - for ("function" == typeof e4.preInit && (e4.preInit = [e4.preInit]); 0 < e4.preInit.length; ) - e4.preInit.pop()(); - Zc(); - return Module; - }); - return initSqlJsPromise; - }; - if (typeof exports === "object" && typeof module2 === "object") { - module2.exports = initSqlJs2; - module2.exports.default = initSqlJs2; - } else if (typeof define === "function" && define["amd"]) { - define([], function() { - return initSqlJs2; - }); - } else if (typeof exports === "object") { - exports["Module"] = initSqlJs2; - } - } -}); - -// src/main.ts -var main_exports = {}; -__export(main_exports, { - default: () => MakeMDPlugin -}); -module.exports = __toCommonJS(main_exports); - -// src/cm-extensions/flowEditor/flowEditor.tsx -var import_state6 = require("@codemirror/state"); -var import_view4 = require("@codemirror/view"); - -// src/cm-extensions/tooltip.ts -var import_state = require("@codemirror/state"); -var import_view = require("@codemirror/view"); -var ios = typeof navigator != "undefined" && !/Edge\/(\d+)/.exec(navigator.userAgent) && /Apple Computer/.test(navigator.vendor) && (/Mobile\/\w+/.test(navigator.userAgent) || navigator.maxTouchPoints > 2); -var Outside = "-10000px"; -var TooltipViewManager = class { - constructor(view, facet, createTooltipView) { - this.facet = facet; - this.createTooltipView = createTooltipView; - this.input = view.state.facet(facet); - this.tooltips = this.input.filter((t4) => t4); - this.tooltipViews = this.tooltips.map(createTooltipView); - } - update(update) { - if (update.focusChanged && !update.view.hasFocus) { - const input2 = update.state.facet(this.facet); - for (const t4 of this.tooltipViews) - t4.dom.remove(); - this.input = input2; - this.tooltips = []; - this.tooltipViews = []; - return true; - } - const input = update.state.facet(this.facet); - const tooltips2 = input.filter((x5) => x5); - if (input === this.input) { - for (const t4 of this.tooltipViews) - if (t4.update) - t4.update(update); - return false; - } - const tooltipViews = []; - for (let i4 = 0; i4 < tooltips2.length; i4++) { - const tip = tooltips2[i4]; - let known = -1; - if (!tip) - continue; - for (let i5 = 0; i5 < this.tooltips.length; i5++) { - const other = this.tooltips[i5]; - if (other && other.create == tip.create) - known = i5; - } - if (known < 0) { - tooltipViews[i4] = this.createTooltipView(tip); - } else { - const tooltipView = tooltipViews[i4] = this.tooltipViews[known]; - if (tooltipView.update) - tooltipView.update(update); - } - } - for (const t4 of this.tooltipViews) - if (tooltipViews.indexOf(t4) < 0) - t4.dom.remove(); - this.input = input; - this.tooltips = tooltips2; - this.tooltipViews = tooltipViews; - return true; - } -}; -function tooltips(config = {}) { - return tooltipConfig.of(config); -} -function windowSpace() { - return { top: 0, left: 0, bottom: innerHeight, right: innerWidth }; -} -var tooltipConfig = import_state.Facet.define({ - combine: (values) => { - var _a2, _b2, _c2; - return { - position: ios ? "absolute" : ((_a2 = values.find((conf) => conf.position)) == null ? void 0 : _a2.position) || "fixed", - parent: ((_b2 = values.find((conf) => conf.parent)) == null ? void 0 : _b2.parent) || null, - tooltipSpace: ((_c2 = values.find((conf) => conf.tooltipSpace)) == null ? void 0 : _c2.tooltipSpace) || windowSpace - }; - } -}); -var tooltipPlugin = import_view.ViewPlugin.fromClass( - class { - constructor(view) { - this.view = view; - this.inView = true; - this.lastTransaction = 0; - this.measureTimeout = -1; - var _a2; - const config = view.state.facet(tooltipConfig); - this.position = config.position; - this.parent = config.parent; - this.classes = view.themeClasses; - this.createContainer(); - this.measureReq = { - read: this.readMeasure.bind(this), - write: this.writeMeasure.bind(this), - key: this - }; - this.manager = new TooltipViewManager( - view, - showTooltip, - (t4) => this.createTooltip(t4) - ); - this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver( - (entries) => { - if (Date.now() > this.lastTransaction - 50 && entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1) - this.measureSoon(); - }, - { threshold: [1] } - ) : null; - this.observeIntersection(); - (_a2 = view.dom.ownerDocument.defaultView) == null ? void 0 : _a2.addEventListener( - "resize", - this.measureSoon = this.measureSoon.bind(this) - ); - this.maybeMeasure(); - } - createContainer() { - if (this.parent) { - this.container = document.createElement("div"); - this.container.style.position = "relative"; - this.container.className = this.view.themeClasses; - this.parent.appendChild(this.container); - } else { - this.container = this.view.dom; - } - } - observeIntersection() { - if (this.intersectionObserver) { - this.intersectionObserver.disconnect(); - for (const tooltip of this.manager.tooltipViews) - this.intersectionObserver.observe(tooltip.dom); - } - } - measureSoon() { - if (this.measureTimeout < 0) - this.measureTimeout = setTimeout(() => { - this.measureTimeout = -1; - this.maybeMeasure(); - }, 50); - } - update(update) { - if (update.transactions.length) - this.lastTransaction = Date.now(); - const updated = this.manager.update(update); - if (updated) - this.observeIntersection(); - let shouldMeasure = updated || update.geometryChanged; - const newConfig = update.state.facet(tooltipConfig); - if (newConfig.position != this.position) { - this.position = newConfig.position; - for (const t4 of this.manager.tooltipViews) - t4.dom.style.position = this.position; - shouldMeasure = true; - } - if (newConfig.parent != this.parent) { - if (this.parent) - this.container.remove(); - this.parent = newConfig.parent; - this.createContainer(); - for (const t4 of this.manager.tooltipViews) - this.container.appendChild(t4.dom); - shouldMeasure = true; - } else if (this.parent && this.view.themeClasses != this.classes) { - this.classes = this.container.className = this.view.themeClasses; - } - if (shouldMeasure) - this.maybeMeasure(); - } - createTooltip(tooltip) { - const tooltipView = tooltip.create(this.view); - tooltipView.dom.classList.add("cm-tooltip"); - if (tooltip.arrow && !tooltipView.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) { - const arrow = document.createElement("div"); - arrow.className = "cm-tooltip-arrow"; - tooltipView.dom.appendChild(arrow); - } - tooltipView.dom.style.position = this.position; - tooltipView.dom.style.top = Outside; - this.container.appendChild(tooltipView.dom); - if (tooltipView.mount) - tooltipView.mount(this.view); - return tooltipView; - } - destroy() { - var _a2, _b2; - (_a2 = this.view.dom.ownerDocument.defaultView) == null ? void 0 : _a2.removeEventListener( - "resize", - this.measureSoon - ); - for (const { dom } of this.manager.tooltipViews) - dom.remove(); - (_b2 = this.intersectionObserver) == null ? void 0 : _b2.disconnect(); - clearTimeout(this.measureTimeout); - } - readMeasure() { - const editor = this.view.dom.getBoundingClientRect(); - return { - editor, - parent: this.parent ? this.container.getBoundingClientRect() : editor, - pos: this.manager.tooltips.map((t4, i4) => { - const tv = this.manager.tooltipViews[i4]; - return tv.getCoords ? tv.getCoords(t4.pos) : this.view.coordsAtPos(t4.pos); - }), - size: this.manager.tooltipViews.map( - ({ dom }) => { - const size = dom.getBoundingClientRect(); - return size; - } - ), - space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view) - }; - } - writeMeasure(measured) { - const { editor, space } = measured; - const others = []; - for (let i4 = 0; i4 < this.manager.tooltips.length; i4++) { - const tooltip = this.manager.tooltips[i4], tView = this.manager.tooltipViews[i4], { dom } = tView; - const pos = measured.pos[i4], size = measured.size[i4]; - if (!pos || pos.bottom <= Math.max(editor.top, space.top) || pos.top >= Math.min(editor.bottom, space.bottom) || pos.right < Math.max(editor.left, space.left) - 0.1 || pos.left > Math.min(editor.right, space.right) + 0.1) { - dom.style.top = Outside; - continue; + return d5; } - const arrow = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null; - const arrowHeight = arrow ? 7 /* Size */ : 0; - const width = size.right - size.left, height = size.bottom - size.top; - const offset2 = tView.offset || noOffset, ltr = this.view.textDirection == import_view.Direction.LTR; - const left = size.width > space.right - space.left ? ltr ? space.left : space.right - size.width : ltr ? Math.min( - pos.left - (arrow ? 14 /* Offset */ : 0) + offset2.x, - space.right - width - ) : Math.max( - space.left, - pos.left - width + (arrow ? 14 /* Offset */ : 0) - offset2.x - ); - let above = !!tooltip.above; - if (!tooltip.strictSide && (above ? pos.top - (size.bottom - size.top) - offset2.y < space.top : pos.bottom + (size.bottom - size.top) + offset2.y > space.bottom) && above == space.bottom - pos.bottom > pos.top - space.top) - above = !above; - let top = above ? pos.top - height - arrowHeight - offset2.y : pos.bottom + arrowHeight + offset2.y; - const right = left + width; - if (tView.overlap !== true) { - for (const r3 of others) - if (r3.left < right && r3.right > left && r3.top < top + height && r3.bottom > top) - top = above ? r3.top - height - 2 - arrowHeight : r3.bottom + arrowHeight + 2; + function C3(a5, b4) { + return a5 ? Ma(u4, a5, b4) : ""; } - const computeFrameOffset = (win, rect) => { - const { top: top2, right: right2, bottom, left: left2, width: width2, height: height2, x: x5, y: y5 } = rect; - const dims = { top: top2, right: right2, bottom, left: left2 }; - if (typeof dims === "undefined") { - const dims2 = { top: 0, left: 0 }; - } - const frames2 = win.parent.document.getElementsByTagName("iframe"); - let frame; - let found = false; - for (let i5 = 0, len = frames2.length; i5 < len; i5++) { - frame = frames2[i5]; - if (frame.contentWindow == win) { - found = true; - break; + function t4(a5, b4, c4, d5) { + if (!(0 < d5)) + return 0; + var f4 = c4; + d5 = c4 + d5 - 1; + for (var h5 = 0; h5 < a5.length; ++h5) { + var k5 = a5.charCodeAt(h5); + if (55296 <= k5 && 57343 >= k5) { + var q5 = a5.charCodeAt(++h5); + k5 = 65536 + ((k5 & 1023) << 10) | q5 & 1023; } - } - if (found) { - const rect2 = frame.getBoundingClientRect(); - dims.left += rect2.left; - dims.top += rect2.top; - if (win !== top2) { - computeFrameOffset(win.parent, rect2); + if (127 >= k5) { + if (c4 >= d5) + break; + b4[c4++] = k5; + } else { + if (2047 >= k5) { + if (c4 + 1 >= d5) + break; + b4[c4++] = 192 | k5 >> 6; + } else { + if (65535 >= k5) { + if (c4 + 2 >= d5) + break; + b4[c4++] = 224 | k5 >> 12; + } else { + if (c4 + 3 >= d5) + break; + b4[c4++] = 240 | k5 >> 18; + b4[c4++] = 128 | k5 >> 12 & 63; + } + b4[c4++] = 128 | k5 >> 6 & 63; + } + b4[c4++] = 128 | k5 & 63; } - } else { - return { top: 0, left: 0 }; } - return dims; - }; - const viewCoords = computeFrameOffset(this.view.dom.ownerDocument.defaultView, editor); - if (this.position == "absolute") { - dom.style.top = viewCoords.top + top - measured.parent.top + "px"; - dom.style.left = viewCoords.left + left - measured.parent.left + "px"; - } else { - dom.style.top = viewCoords.top + top + "px"; - dom.style.left = viewCoords.left + left + "px"; + b4[c4] = 0; + return c4 - f4; } - if (arrow) - arrow.style.left = `${pos.left + (ltr ? offset2.x : -offset2.x) - (left + 14 /* Offset */ - 7 /* Size */)}px`; - if (tView.overlap !== true) - others.push({ left, top, right, bottom: top + height }); - dom.classList.toggle("cm-tooltip-above", above); - dom.classList.toggle("cm-tooltip-below", !above); - if (tView.positioned) - tView.positioned(); - } - } - maybeMeasure() { - if (this.manager.tooltips.length) { - if (this.view.inView) - this.view.requestMeasure(this.measureReq); - if (this.inView != this.view.inView) { - this.inView = this.view.inView; - if (!this.inView) - for (const tv of this.manager.tooltipViews) - tv.dom.style.top = Outside; + function ca(a5) { + for (var b4 = 0, c4 = 0; c4 < a5.length; ++c4) { + var d5 = a5.charCodeAt(c4); + 127 >= d5 ? b4++ : 2047 >= d5 ? b4 += 2 : 55296 <= d5 && 57343 >= d5 ? (b4 += 4, ++c4) : b4 += 3; + } + return b4; } - } - } - }, - { - eventHandlers: { - scroll() { - this.maybeMeasure(); - } - } - } -); -var baseTheme = import_view.EditorView.baseTheme({ - ".cm-tooltip": { - zIndex: 100 - }, - "&light .cm-tooltip": { - border: "1px solid #bbb", - backgroundColor: "#f5f5f5" - }, - "&light .cm-tooltip-section:not(:first-child)": { - borderTop: "1px solid #bbb" - }, - "&dark .cm-tooltip": { - backgroundColor: "#333338", - color: "white" - }, - ".cm-tooltip-arrow": { - height: `${7 /* Size */}px`, - width: `${7 /* Size */ * 2}px`, - position: "absolute", - zIndex: -1, - overflow: "hidden", - "&:before, &:after": { - content: "''", - position: "absolute", - width: 0, - height: 0, - borderLeft: `${7 /* Size */}px solid transparent`, - borderRight: `${7 /* Size */}px solid transparent` - }, - ".cm-tooltip-above &": { - bottom: `-${7 /* Size */}px`, - "&:before": { - borderTop: `${7 /* Size */}px solid #bbb` - }, - "&:after": { - borderTop: `${7 /* Size */}px solid #f5f5f5`, - bottom: "1px" - } - }, - ".cm-tooltip-below &": { - top: `-${7 /* Size */}px`, - "&:before": { - borderBottom: `${7 /* Size */}px solid #bbb` - }, - "&:after": { - borderBottom: `${7 /* Size */}px solid #f5f5f5`, - top: "1px" - } - } - }, - "&dark .cm-tooltip .cm-tooltip-arrow": { - "&:before": { - borderTopColor: "#333338", - borderBottomColor: "#333338" - }, - "&:after": { - borderTopColor: "transparent", - borderBottomColor: "transparent" - } - } -}); -var noOffset = { x: 0, y: 0 }; -var showTooltip = import_state.Facet.define({ - enables: [tooltipPlugin, baseTheme] -}); -var showHoverTooltip = import_state.Facet.define(); -var HoverTooltipHost = class { - constructor(view) { - this.view = view; - this.mounted = false; - this.dom = document.createElement("div"); - this.dom.classList.add("cm-tooltip-hover"); - this.manager = new TooltipViewManager( - view, - showHoverTooltip, - (t4) => this.createHostedView(t4) - ); - } - static create(view) { - return new HoverTooltipHost(view); - } - createHostedView(tooltip) { - const hostedView = tooltip.create(this.view); - hostedView.dom.classList.add("cm-tooltip-section"); - this.dom.appendChild(hostedView.dom); - if (this.mounted && hostedView.mount) - hostedView.mount(this.view); - return hostedView; - } - mount(view) { - for (const hostedView of this.manager.tooltipViews) { - if (hostedView.mount) - hostedView.mount(view); - } - this.mounted = true; - } - positioned() { - for (const hostedView of this.manager.tooltipViews) { - if (hostedView.positioned) - hostedView.positioned(); - } - } - update(update) { - this.manager.update(update); - } -}; -var showHoverTooltipHost = showTooltip.compute( - [showHoverTooltip], - (state) => { - const tooltips2 = state.facet(showHoverTooltip).filter((t4) => t4); - if (tooltips2.length === 0) - return null; - return { - pos: Math.min(...tooltips2.map((t4) => t4.pos)), - end: Math.max( - ...tooltips2.filter((t4) => t4.end != null).map((t4) => t4.end) - ), - create: HoverTooltipHost.create, - above: tooltips2[0].above, - arrow: tooltips2.some((t4) => t4.arrow) - }; - } -); -var HoverPlugin = class { - constructor(view, source, field, setHover, hoverTime) { - this.view = view; - this.source = source; - this.field = field; - this.setHover = setHover; - this.hoverTime = hoverTime; - this.hoverTimeout = -1; - this.restartTimeout = -1; - this.pending = null; - this.lastMove = { x: 0, y: 0, target: view.dom, time: 0 }; - this.checkHover = this.checkHover.bind(this); - view.dom.addEventListener( - "mouseleave", - this.mouseleave = this.mouseleave.bind(this) - ); - view.dom.addEventListener( - "mousemove", - this.mousemove = this.mousemove.bind(this) - ); - } - update() { - if (this.pending) { - this.pending = null; - clearTimeout(this.restartTimeout); - this.restartTimeout = setTimeout(() => this.startHover(), 20); - } - } - get active() { - return this.view.state.field(this.field); - } - checkHover() { - this.hoverTimeout = -1; - if (this.active) - return; - const hovered = Date.now() - this.lastMove.time; - if (hovered < this.hoverTime) - this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime - hovered); - else - this.startHover(); - } - startHover() { - clearTimeout(this.restartTimeout); - const { lastMove } = this; - const pos = this.view.contentDOM.contains(lastMove.target) ? this.view.posAtCoords(lastMove) : null; - if (pos == null) - return; - const posCoords = this.view.coordsAtPos(pos); - if (posCoords == null || lastMove.y < posCoords.top || lastMove.y > posCoords.bottom || lastMove.x < posCoords.left - this.view.defaultCharacterWidth || lastMove.x > posCoords.right + this.view.defaultCharacterWidth) - return; - const bidi = this.view.bidiSpans(this.view.state.doc.lineAt(pos)).find((s5) => s5.from <= pos && s5.to >= pos); - const rtl = bidi && bidi.dir == import_view.Direction.RTL ? -1 : 1; - const open = this.source( - this.view, - pos, - lastMove.x < posCoords.left ? -rtl : rtl - ); - if (open == null ? void 0 : open.then) { - const pending = this.pending = { pos }; - open.then( - (result) => { - if (this.pending == pending) { - this.pending = null; - if (result) - this.view.dispatch({ effects: this.setHover.of(result) }); - } - }, - (e4) => (0, import_view.logException)(this.view.state, e4, "hover tooltip") - ); - } else if (open) { - this.view.dispatch({ effects: this.setHover.of(open) }); - } - } - mousemove(event) { - var _a2; - this.lastMove = { - x: event.clientX, - y: event.clientY, - target: event.target, - time: Date.now() - }; - if (this.hoverTimeout < 0) - this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime); - const tooltip = this.active; - if (tooltip && !isInTooltip(this.lastMove.target) || this.pending) { - const { pos } = tooltip || this.pending, end = (_a2 = tooltip == null ? void 0 : tooltip.end) != null ? _a2 : pos; - if (pos == end ? this.view.posAtCoords(this.lastMove) != pos : !isOverRange( - this.view, - pos, - end, - event.clientX, - event.clientY, - 6 /* MaxDist */ - )) { - this.view.dispatch({ effects: this.setHover.of(null) }); - this.pending = null; - } - } - } - mouseleave(e4) { - clearTimeout(this.hoverTimeout); - this.hoverTimeout = -1; - if (this.active && !isInTooltip(e4.relatedTarget)) - this.view.dispatch({ effects: this.setHover.of(null) }); - } - destroy() { - clearTimeout(this.hoverTimeout); - this.view.dom.removeEventListener("mouseleave", this.mouseleave); - this.view.dom.removeEventListener("mousemove", this.mousemove); - } -}; -function isInTooltip(elt) { - for (let cur = elt; cur; cur = cur.parentNode) - if (cur.nodeType == 1 && cur.classList.contains("cm-tooltip")) - return true; - return false; -} -function isOverRange(view, from, to, x5, y5, margin) { - const range = document.createRange(); - const fromDOM = view.domAtPos(from), toDOM = view.domAtPos(to); - range.setEnd(toDOM.node, toDOM.offset); - range.setStart(fromDOM.node, fromDOM.offset); - const rects = range.getClientRects(); - range.detach(); - for (let i4 = 0; i4 < rects.length; i4++) { - const rect = rects[i4]; - const dist = Math.max( - rect.top - y5, - y5 - rect.bottom, - rect.left - x5, - x5 - rect.right - ); - if (dist <= margin) - return true; - } - return false; -} -function hoverTooltip(source, options = {}) { - const setHover = import_state.StateEffect.define(); - const hoverState = import_state.StateField.define({ - create() { - return null; - }, - update(value, tr) { - if (value && options.hideOnChange && (tr.docChanged || tr.selection)) - return null; - for (const effect of tr.effects) { - if (effect.is(setHover)) { - return effect.value; + var Na, r3, u4, Oa, F4, J2, Pa, Qa; + function Ra() { + var a5 = Ja.buffer; + Na = a5; + e4.HEAP8 = r3 = new Int8Array(a5); + e4.HEAP16 = Oa = new Int16Array(a5); + e4.HEAP32 = F4 = new Int32Array(a5); + e4.HEAPU8 = u4 = new Uint8Array(a5); + e4.HEAPU16 = new Uint16Array(a5); + e4.HEAPU32 = J2 = new Uint32Array(a5); + e4.HEAPF32 = Pa = new Float32Array(a5); + e4.HEAPF64 = Qa = new Float64Array(a5); } - if (effect.is(closeHoverTooltipEffect)) - return null; - } - if (value && tr.docChanged) { - const newPos = tr.changes.mapPos(value.pos, -1, import_state.MapMode.TrackDel); - if (newPos == null) - return null; - const copy = Object.assign(/* @__PURE__ */ Object.create(null), value); - copy.pos = newPos; - if (value.end != null) - copy.end = tr.changes.mapPos(value.end); - return copy; - } - return value; - }, - provide: (f4) => showHoverTooltip.from(f4) - }); - return [ - hoverState, - import_view.ViewPlugin.define( - (view) => new HoverPlugin( - view, - source, - hoverState, - setHover, - options.hoverTime || 300 /* Time */ - ) - ), - showHoverTooltipHost - ]; -} -var closeHoverTooltipEffect = import_state.StateEffect.define(); -var closeHoverTooltips = closeHoverTooltipEffect.of(null); - -// node_modules/preact/dist/preact.module.js -var n; -var l; -var u; -var i; -var t; -var r; -var o; -var f; -var e; -var c = {}; -var s = []; -var a = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i; -function h(n2, l3) { - for (var u4 in l3) - n2[u4] = l3[u4]; - return n2; -} -function v(n2) { - var l3 = n2.parentNode; - l3 && l3.removeChild(n2); -} -function y(l3, u4, i4) { - var t4, r3, o3, f4 = {}; - for (o3 in u4) - "key" == o3 ? t4 = u4[o3] : "ref" == o3 ? r3 = u4[o3] : f4[o3] = u4[o3]; - if (arguments.length > 2 && (f4.children = arguments.length > 3 ? n.call(arguments, 2) : i4), "function" == typeof l3 && null != l3.defaultProps) - for (o3 in l3.defaultProps) - void 0 === f4[o3] && (f4[o3] = l3.defaultProps[o3]); - return p(l3, f4, t4, r3, null); -} -function p(n2, i4, t4, r3, o3) { - var f4 = { type: n2, props: i4, key: t4, ref: r3, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: null == o3 ? ++u : o3 }; - return null == o3 && null != l.vnode && l.vnode(f4), f4; -} -function d() { - return { current: null }; -} -function _(n2) { - return n2.children; -} -function k(n2, l3) { - this.props = n2, this.context = l3; -} -function b(n2, l3) { - if (null == l3) - return n2.__ ? b(n2.__, n2.__.__k.indexOf(n2) + 1) : null; - for (var u4; l3 < n2.__k.length; l3++) - if (null != (u4 = n2.__k[l3]) && null != u4.__e) - return u4.__e; - return "function" == typeof n2.type ? b(n2) : null; -} -function g(n2) { - var l3, u4; - if (null != (n2 = n2.__) && null != n2.__c) { - for (n2.__e = n2.__c.base = null, l3 = 0; l3 < n2.__k.length; l3++) - if (null != (u4 = n2.__k[l3]) && null != u4.__e) { - n2.__e = n2.__c.base = u4.__e; - break; - } - return g(n2); - } -} -function m(n2) { - (!n2.__d && (n2.__d = true) && t.push(n2) && !w.__r++ || r !== l.debounceRendering) && ((r = l.debounceRendering) || o)(w); -} -function w() { - var n2, l3, u4, i4, r3, o3, e4, c4; - for (t.sort(f); n2 = t.shift(); ) - n2.__d && (l3 = t.length, i4 = void 0, r3 = void 0, e4 = (o3 = (u4 = n2).__v).__e, (c4 = u4.__P) && (i4 = [], (r3 = h({}, o3)).__v = o3.__v + 1, L(c4, o3, r3, u4.__n, void 0 !== c4.ownerSVGElement, null != o3.__h ? [e4] : null, i4, null == e4 ? b(o3) : e4, o3.__h), M(i4, o3), o3.__e != e4 && g(o3)), t.length > l3 && t.sort(f)); - w.__r = 0; -} -function x(n2, l3, u4, i4, t4, r3, o3, f4, e4, a5) { - var h5, v3, y5, d5, k5, g4, m5, w5 = i4 && i4.__k || s, x5 = w5.length; - for (u4.__k = [], h5 = 0; h5 < l3.length; h5++) - if (null != (d5 = u4.__k[h5] = null == (d5 = l3[h5]) || "boolean" == typeof d5 || "function" == typeof d5 ? null : "string" == typeof d5 || "number" == typeof d5 || "bigint" == typeof d5 ? p(null, d5, null, null, d5) : Array.isArray(d5) ? p(_, { children: d5 }, null, null, null) : d5.__b > 0 ? p(d5.type, d5.props, d5.key, d5.ref ? d5.ref : null, d5.__v) : d5)) { - if (d5.__ = u4, d5.__b = u4.__b + 1, null === (y5 = w5[h5]) || y5 && d5.key == y5.key && d5.type === y5.type) - w5[h5] = void 0; - else - for (v3 = 0; v3 < x5; v3++) { - if ((y5 = w5[v3]) && d5.key == y5.key && d5.type === y5.type) { - w5[v3] = void 0; - break; - } - y5 = null; + var K3, Sa = [], Ta = [], Ua = []; + function Va() { + var a5 = e4.preRun.shift(); + Sa.unshift(a5); } - L(n2, d5, y5 = y5 || c, t4, r3, o3, f4, e4, a5), k5 = d5.__e, (v3 = d5.ref) && y5.ref != v3 && (m5 || (m5 = []), y5.ref && m5.push(y5.ref, null, d5), m5.push(v3, d5.__c || k5, d5)), null != k5 ? (null == g4 && (g4 = k5), "function" == typeof d5.type && d5.__k === y5.__k ? d5.__d = e4 = A(d5, e4, n2) : e4 = C(n2, d5, y5, w5, k5, e4), "function" == typeof u4.type && (u4.__d = e4)) : e4 && y5.__e == e4 && e4.parentNode != n2 && (e4 = b(y5)); - } - for (u4.__e = g4, h5 = x5; h5--; ) - null != w5[h5] && ("function" == typeof u4.type && null != w5[h5].__e && w5[h5].__e == u4.__d && (u4.__d = $(i4).nextSibling), S(w5[h5], w5[h5])); - if (m5) - for (h5 = 0; h5 < m5.length; h5++) - O(m5[h5], m5[++h5], m5[++h5]); -} -function A(n2, l3, u4) { - for (var i4, t4 = n2.__k, r3 = 0; t4 && r3 < t4.length; r3++) - (i4 = t4[r3]) && (i4.__ = n2, l3 = "function" == typeof i4.type ? A(i4, l3, u4) : C(u4, i4, i4, t4, i4.__e, l3)); - return l3; -} -function P(n2, l3) { - return l3 = l3 || [], null == n2 || "boolean" == typeof n2 || (Array.isArray(n2) ? n2.some(function(n3) { - P(n3, l3); - }) : l3.push(n2)), l3; -} -function C(n2, l3, u4, i4, t4, r3) { - var o3, f4, e4; - if (void 0 !== l3.__d) - o3 = l3.__d, l3.__d = void 0; - else if (null == u4 || t4 != r3 || null == t4.parentNode) - n: - if (null == r3 || r3.parentNode !== n2) - n2.appendChild(t4), o3 = null; - else { - for (f4 = r3, e4 = 0; (f4 = f4.nextSibling) && e4 < i4.length; e4 += 1) - if (f4 == t4) - break n; - n2.insertBefore(t4, r3), o3 = r3; - } - return void 0 !== o3 ? o3 : t4.nextSibling; -} -function $(n2) { - var l3, u4, i4; - if (null == n2.type || "string" == typeof n2.type) - return n2.__e; - if (n2.__k) { - for (l3 = n2.__k.length - 1; l3 >= 0; l3--) - if ((u4 = n2.__k[l3]) && (i4 = $(u4))) - return i4; - } - return null; -} -function H(n2, l3, u4, i4, t4) { - var r3; - for (r3 in u4) - "children" === r3 || "key" === r3 || r3 in l3 || T(n2, r3, null, u4[r3], i4); - for (r3 in l3) - t4 && "function" != typeof l3[r3] || "children" === r3 || "key" === r3 || "value" === r3 || "checked" === r3 || u4[r3] === l3[r3] || T(n2, r3, l3[r3], u4[r3], i4); -} -function I(n2, l3, u4) { - "-" === l3[0] ? n2.setProperty(l3, null == u4 ? "" : u4) : n2[l3] = null == u4 ? "" : "number" != typeof u4 || a.test(l3) ? u4 : u4 + "px"; -} -function T(n2, l3, u4, i4, t4) { - var r3; - n: - if ("style" === l3) - if ("string" == typeof u4) - n2.style.cssText = u4; - else { - if ("string" == typeof i4 && (n2.style.cssText = i4 = ""), i4) - for (l3 in i4) - u4 && l3 in u4 || I(n2.style, l3, ""); - if (u4) - for (l3 in u4) - i4 && u4[l3] === i4[l3] || I(n2.style, l3, u4[l3]); - } - else if ("o" === l3[0] && "n" === l3[1]) - r3 = l3 !== (l3 = l3.replace(/Capture$/, "")), l3 = l3.toLowerCase() in n2 ? l3.toLowerCase().slice(2) : l3.slice(2), n2.l || (n2.l = {}), n2.l[l3 + r3] = u4, u4 ? i4 || n2.addEventListener(l3, r3 ? z : j, r3) : n2.removeEventListener(l3, r3 ? z : j, r3); - else if ("dangerouslySetInnerHTML" !== l3) { - if (t4) - l3 = l3.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); - else if ("width" !== l3 && "height" !== l3 && "href" !== l3 && "list" !== l3 && "form" !== l3 && "tabIndex" !== l3 && "download" !== l3 && l3 in n2) - try { - n2[l3] = null == u4 ? "" : u4; - break n; - } catch (n3) { + var Wa = 0, Xa = null, Ya = null; + function E4(a5) { + if (e4.onAbort) + e4.onAbort(a5); + a5 = "Aborted(" + a5 + ")"; + Ha(a5); + Ka = true; + throw new WebAssembly.RuntimeError(a5 + ". Build with -sASSERTIONS for more info."); } - "function" == typeof u4 || (null == u4 || false === u4 && -1 == l3.indexOf("-") ? n2.removeAttribute(l3) : n2.setAttribute(l3, u4)); - } -} -function j(n2) { - return this.l[n2.type + false](l.event ? l.event(n2) : n2); -} -function z(n2) { - return this.l[n2.type + true](l.event ? l.event(n2) : n2); -} -function L(n2, u4, i4, t4, r3, o3, f4, e4, c4) { - var s5, a5, v3, y5, p3, d5, b4, g4, m5, w5, A4, P4, C3, $3, H5, I4 = u4.type; - if (void 0 !== u4.constructor) - return null; - null != i4.__h && (c4 = i4.__h, e4 = u4.__e = i4.__e, u4.__h = null, o3 = [e4]), (s5 = l.__b) && s5(u4); - try { - n: - if ("function" == typeof I4) { - if (g4 = u4.props, m5 = (s5 = I4.contextType) && t4[s5.__c], w5 = s5 ? m5 ? m5.props.value : s5.__ : t4, i4.__c ? b4 = (a5 = u4.__c = i4.__c).__ = a5.__E : ("prototype" in I4 && I4.prototype.render ? u4.__c = a5 = new I4(g4, w5) : (u4.__c = a5 = new k(g4, w5), a5.constructor = I4, a5.render = q), m5 && m5.sub(a5), a5.props = g4, a5.state || (a5.state = {}), a5.context = w5, a5.__n = t4, v3 = a5.__d = true, a5.__h = [], a5._sb = []), null == a5.__s && (a5.__s = a5.state), null != I4.getDerivedStateFromProps && (a5.__s == a5.state && (a5.__s = h({}, a5.__s)), h(a5.__s, I4.getDerivedStateFromProps(g4, a5.__s))), y5 = a5.props, p3 = a5.state, a5.__v = u4, v3) - null == I4.getDerivedStateFromProps && null != a5.componentWillMount && a5.componentWillMount(), null != a5.componentDidMount && a5.__h.push(a5.componentDidMount); - else { - if (null == I4.getDerivedStateFromProps && g4 !== y5 && null != a5.componentWillReceiveProps && a5.componentWillReceiveProps(g4, w5), !a5.__e && null != a5.shouldComponentUpdate && false === a5.shouldComponentUpdate(g4, a5.__s, w5) || u4.__v === i4.__v) { - for (u4.__v !== i4.__v && (a5.props = g4, a5.state = a5.__s, a5.__d = false), a5.__e = false, u4.__e = i4.__e, u4.__k = i4.__k, u4.__k.forEach(function(n3) { - n3 && (n3.__ = u4); - }), A4 = 0; A4 < a5._sb.length; A4++) - a5.__h.push(a5._sb[A4]); - a5._sb = [], a5.__h.length && f4.push(a5); - break n; + function Za() { + return M5.startsWith("data:application/octet-stream;base64,"); + } + var M5; + M5 = "sql-wasm.wasm"; + if (!Za()) { + var $a = M5; + M5 = e4.locateFile ? e4.locateFile($a, D4) : D4 + $a; + } + function ab() { + var a5 = M5; + try { + if (a5 == M5 && Ia) + return new Uint8Array(Ia); + if (Da) + return Da(a5); + throw "both async and sync fetching of the wasm failed"; + } catch (b4) { + E4(b4); } - null != a5.componentWillUpdate && a5.componentWillUpdate(g4, a5.__s, w5), null != a5.componentDidUpdate && a5.__h.push(function() { - a5.componentDidUpdate(y5, p3, d5); + } + function bb() { + if (!Ia && (ya || za)) { + if ("function" == typeof fetch && !M5.startsWith("file://")) + return fetch(M5, { credentials: "same-origin" }).then(function(a5) { + if (!a5.ok) + throw "failed to load wasm binary file at '" + M5 + "'"; + return a5.arrayBuffer(); + }).catch(function() { + return ab(); + }); + if (Ca) + return new Promise(function(a5, b4) { + Ca(M5, function(c4) { + a5(new Uint8Array(c4)); + }, b4); + }); + } + return Promise.resolve().then(function() { + return ab(); }); } - if (a5.context = w5, a5.props = g4, a5.__P = n2, P4 = l.__r, C3 = 0, "prototype" in I4 && I4.prototype.render) { - for (a5.state = a5.__s, a5.__d = false, P4 && P4(u4), s5 = a5.render(a5.props, a5.state, a5.context), $3 = 0; $3 < a5._sb.length; $3++) - a5.__h.push(a5._sb[$3]); - a5._sb = []; - } else - do { - a5.__d = false, P4 && P4(u4), s5 = a5.render(a5.props, a5.state, a5.context), a5.state = a5.__s; - } while (a5.__d && ++C3 < 25); - a5.state = a5.__s, null != a5.getChildContext && (t4 = h(h({}, t4), a5.getChildContext())), v3 || null == a5.getSnapshotBeforeUpdate || (d5 = a5.getSnapshotBeforeUpdate(y5, p3)), H5 = null != s5 && s5.type === _ && null == s5.key ? s5.props.children : s5, x(n2, Array.isArray(H5) ? H5 : [H5], u4, i4, t4, r3, o3, f4, e4, c4), a5.base = u4.__e, u4.__h = null, a5.__h.length && f4.push(a5), b4 && (a5.__E = a5.__ = null), a5.__e = false; - } else - null == o3 && u4.__v === i4.__v ? (u4.__k = i4.__k, u4.__e = i4.__e) : u4.__e = N(i4.__e, u4, i4, t4, r3, o3, f4, c4); - (s5 = l.diffed) && s5(u4); - } catch (n3) { - u4.__v = null, (c4 || null != o3) && (u4.__e = e4, u4.__h = !!c4, o3[o3.indexOf(e4)] = null), l.__e(n3, u4, i4); - } -} -function M(n2, u4) { - l.__c && l.__c(u4, n2), n2.some(function(u5) { - try { - n2 = u5.__h, u5.__h = [], n2.some(function(n3) { - n3.call(u5); - }); - } catch (n3) { - l.__e(n3, u5.__v); - } - }); -} -function N(l3, u4, i4, t4, r3, o3, f4, e4) { - var s5, a5, h5, y5 = i4.props, p3 = u4.props, d5 = u4.type, _12 = 0; - if ("svg" === d5 && (r3 = true), null != o3) { - for (; _12 < o3.length; _12++) - if ((s5 = o3[_12]) && "setAttribute" in s5 == !!d5 && (d5 ? s5.localName === d5 : 3 === s5.nodeType)) { - l3 = s5, o3[_12] = null; - break; - } - } - if (null == l3) { - if (null === d5) - return document.createTextNode(p3); - l3 = r3 ? document.createElementNS("http://www.w3.org/2000/svg", d5) : document.createElement(d5, p3.is && p3), o3 = null, e4 = false; - } - if (null === d5) - y5 === p3 || e4 && l3.data === p3 || (l3.data = p3); - else { - if (o3 = o3 && n.call(l3.childNodes), a5 = (y5 = i4.props || c).dangerouslySetInnerHTML, h5 = p3.dangerouslySetInnerHTML, !e4) { - if (null != o3) - for (y5 = {}, _12 = 0; _12 < l3.attributes.length; _12++) - y5[l3.attributes[_12].name] = l3.attributes[_12].value; - (h5 || a5) && (h5 && (a5 && h5.__html == a5.__html || h5.__html === l3.innerHTML) || (l3.innerHTML = h5 && h5.__html || "")); - } - if (H(l3, p3, y5, r3, e4), h5) - u4.__k = []; - else if (_12 = u4.props.children, x(l3, Array.isArray(_12) ? _12 : [_12], u4, i4, t4, r3 && "foreignObject" !== d5, o3, f4, o3 ? o3[0] : i4.__k && b(i4, 0), e4), null != o3) - for (_12 = o3.length; _12--; ) - null != o3[_12] && v(o3[_12]); - e4 || ("value" in p3 && void 0 !== (_12 = p3.value) && (_12 !== l3.value || "progress" === d5 && !_12 || "option" === d5 && _12 !== y5.value) && T(l3, "value", _12, y5.value, false), "checked" in p3 && void 0 !== (_12 = p3.checked) && _12 !== l3.checked && T(l3, "checked", _12, y5.checked, false)); - } - return l3; -} -function O(n2, u4, i4) { - try { - "function" == typeof n2 ? n2(u4) : n2.current = u4; - } catch (n3) { - l.__e(n3, i4); - } -} -function S(n2, u4, i4) { - var t4, r3; - if (l.unmount && l.unmount(n2), (t4 = n2.ref) && (t4.current && t4.current !== n2.__e || O(t4, null, u4)), null != (t4 = n2.__c)) { - if (t4.componentWillUnmount) - try { - t4.componentWillUnmount(); - } catch (n3) { - l.__e(n3, u4); - } - t4.base = t4.__P = null, n2.__c = void 0; - } - if (t4 = n2.__k) - for (r3 = 0; r3 < t4.length; r3++) - t4[r3] && S(t4[r3], u4, i4 || "function" != typeof n2.type); - i4 || null == n2.__e || v(n2.__e), n2.__ = n2.__e = n2.__d = void 0; -} -function q(n2, l3, u4) { - return this.constructor(n2, u4); -} -function B(u4, i4, t4) { - var r3, o3, f4; - l.__ && l.__(u4, i4), o3 = (r3 = "function" == typeof t4) ? null : t4 && t4.__k || i4.__k, f4 = [], L(i4, u4 = (!r3 && t4 || i4).__k = y(_, null, [u4]), o3 || c, c, void 0 !== i4.ownerSVGElement, !r3 && t4 ? [t4] : o3 ? null : i4.firstChild ? n.call(i4.childNodes) : null, f4, !r3 && t4 ? t4 : o3 ? o3.__e : i4.firstChild, r3), M(f4, u4); -} -function D(n2, l3) { - B(n2, l3, D); -} -function E(l3, u4, i4) { - var t4, r3, o3, f4 = h({}, l3.props); - for (o3 in u4) - "key" == o3 ? t4 = u4[o3] : "ref" == o3 ? r3 = u4[o3] : f4[o3] = u4[o3]; - return arguments.length > 2 && (f4.children = arguments.length > 3 ? n.call(arguments, 2) : i4), p(l3.type, f4, t4 || l3.key, r3 || l3.ref, null); -} -function F(n2, l3) { - var u4 = { __c: l3 = "__cC" + e++, __: n2, Consumer: function(n3, l4) { - return n3.children(l4); - }, Provider: function(n3) { - var u5, i4; - return this.getChildContext || (u5 = [], (i4 = {})[l3] = this, this.getChildContext = function() { - return i4; - }, this.shouldComponentUpdate = function(n4) { - this.props.value !== n4.value && u5.some(function(n5) { - n5.__e = true, m(n5); - }); - }, this.sub = function(n4) { - u5.push(n4); - var l4 = n4.componentWillUnmount; - n4.componentWillUnmount = function() { - u5.splice(u5.indexOf(n4), 1), l4 && l4.call(n4); - }; - }), n3.children; - } }; - return u4.Provider.__ = u4.Consumer.contextType = u4; -} -n = s.slice, l = { __e: function(n2, l3, u4, i4) { - for (var t4, r3, o3; l3 = l3.__; ) - if ((t4 = l3.__c) && !t4.__) - try { - if ((r3 = t4.constructor) && null != r3.getDerivedStateFromError && (t4.setState(r3.getDerivedStateFromError(n2)), o3 = t4.__d), null != t4.componentDidCatch && (t4.componentDidCatch(n2, i4 || {}), o3 = t4.__d), o3) - return t4.__E = t4; - } catch (l4) { - n2 = l4; - } - throw n2; -} }, u = 0, i = function(n2) { - return null != n2 && void 0 === n2.constructor; -}, k.prototype.setState = function(n2, l3) { - var u4; - u4 = null != this.__s && this.__s !== this.state ? this.__s : this.__s = h({}, this.state), "function" == typeof n2 && (n2 = n2(h({}, u4), this.props)), n2 && h(u4, n2), null != n2 && this.__v && (l3 && this._sb.push(l3), m(this)); -}, k.prototype.forceUpdate = function(n2) { - this.__v && (this.__e = true, n2 && this.__h.push(n2), m(this)); -}, k.prototype.render = _, t = [], o = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, f = function(n2, l3) { - return n2.__v.__b - l3.__v.__b; -}, w.__r = 0, e = 0; - -// node_modules/preact/hooks/dist/hooks.module.js -var t2; -var r2; -var u2; -var i2; -var o2 = 0; -var f2 = []; -var c2 = []; -var e2 = l.__b; -var a2 = l.__r; -var v2 = l.diffed; -var l2 = l.__c; -var m2 = l.unmount; -function d2(t4, u4) { - l.__h && l.__h(r2, t4, o2 || u4), o2 = 0; - var i4 = r2.__H || (r2.__H = { __: [], __h: [] }); - return t4 >= i4.__.length && i4.__.push({ __V: c2 }), i4.__[t4]; -} -function h2(n2) { - return o2 = 1, s2(B2, n2); -} -function s2(n2, u4, i4) { - var o3 = d2(t2++, 2); - if (o3.t = n2, !o3.__c && (o3.__ = [i4 ? i4(u4) : B2(void 0, u4), function(n3) { - var t4 = o3.__N ? o3.__N[0] : o3.__[0], r3 = o3.t(t4, n3); - t4 !== r3 && (o3.__N = [r3, o3.__[1]], o3.__c.setState({})); - }], o3.__c = r2, !r2.u)) { - var f4 = function(n3, t4, r3) { - if (!o3.__c.__H) - return true; - var u5 = o3.__c.__H.__.filter(function(n4) { - return n4.__c; - }); - if (u5.every(function(n4) { - return !n4.__N; - })) - return !c4 || c4.call(this, n3, t4, r3); - var i5 = false; - return u5.forEach(function(n4) { - if (n4.__N) { - var t5 = n4.__[0]; - n4.__ = n4.__N, n4.__N = void 0, t5 !== n4.__[0] && (i5 = true); + var N3, O4; + function cb(a5) { + for (; 0 < a5.length; ) + a5.shift()(e4); } - }), !(!i5 && o3.__c.props === n3) && (!c4 || c4.call(this, n3, t4, r3)); - }; - r2.u = true; - var c4 = r2.shouldComponentUpdate, e4 = r2.componentWillUpdate; - r2.componentWillUpdate = function(n3, t4, r3) { - if (this.__e) { - var u5 = c4; - c4 = void 0, f4(n3, t4, r3), c4 = u5; - } - e4 && e4.call(this, n3, t4, r3); - }, r2.shouldComponentUpdate = f4; - } - return o3.__N || o3.__; -} -function p2(u4, i4) { - var o3 = d2(t2++, 3); - !l.__s && z2(o3.__H, i4) && (o3.__ = u4, o3.i = i4, r2.__H.__h.push(o3)); -} -function y2(u4, i4) { - var o3 = d2(t2++, 4); - !l.__s && z2(o3.__H, i4) && (o3.__ = u4, o3.i = i4, r2.__h.push(o3)); -} -function _2(n2) { - return o2 = 5, F2(function() { - return { current: n2 }; - }, []); -} -function A2(n2, t4, r3) { - o2 = 6, y2(function() { - return "function" == typeof n2 ? (n2(t4()), function() { - return n2(null); - }) : n2 ? (n2.current = t4(), function() { - return n2.current = null; - }) : void 0; - }, null == r3 ? r3 : r3.concat(n2)); -} -function F2(n2, r3) { - var u4 = d2(t2++, 7); - return z2(u4.__H, r3) ? (u4.__V = n2(), u4.i = r3, u4.__h = n2, u4.__V) : u4.__; -} -function T2(n2, t4) { - return o2 = 8, F2(function() { - return n2; - }, t4); -} -function q2(n2) { - var u4 = r2.context[n2.__c], i4 = d2(t2++, 9); - return i4.c = n2, u4 ? (null == i4.__ && (i4.__ = true, u4.sub(r2)), u4.props.value) : n2.__; -} -function x2(t4, r3) { - l.useDebugValue && l.useDebugValue(r3 ? r3(t4) : t4); -} -function P2(n2) { - var u4 = d2(t2++, 10), i4 = h2(); - return u4.__ = n2, r2.componentDidCatch || (r2.componentDidCatch = function(n3, t4) { - u4.__ && u4.__(n3, t4), i4[1](n3); - }), [i4[0], function() { - i4[1](void 0); - }]; -} -function V() { - var n2 = d2(t2++, 11); - if (!n2.__) { - for (var u4 = r2.__v; null !== u4 && !u4.__m && null !== u4.__; ) - u4 = u4.__; - var i4 = u4.__m || (u4.__m = [0, 0]); - n2.__ = "P" + i4[0] + "-" + i4[1]++; - } - return n2.__; -} -function b2() { - for (var t4; t4 = f2.shift(); ) - if (t4.__P && t4.__H) - try { - t4.__H.__h.forEach(k2), t4.__H.__h.forEach(w2), t4.__H.__h = []; - } catch (r3) { - t4.__H.__h = [], l.__e(r3, t4.__v); - } -} -l.__b = function(n2) { - r2 = null, e2 && e2(n2); -}, l.__r = function(n2) { - a2 && a2(n2), t2 = 0; - var i4 = (r2 = n2.__c).__H; - i4 && (u2 === r2 ? (i4.__h = [], r2.__h = [], i4.__.forEach(function(n3) { - n3.__N && (n3.__ = n3.__N), n3.__V = c2, n3.__N = n3.i = void 0; - })) : (i4.__h.forEach(k2), i4.__h.forEach(w2), i4.__h = [])), u2 = r2; -}, l.diffed = function(t4) { - v2 && v2(t4); - var o3 = t4.__c; - o3 && o3.__H && (o3.__H.__h.length && (1 !== f2.push(o3) && i2 === l.requestAnimationFrame || ((i2 = l.requestAnimationFrame) || j2)(b2)), o3.__H.__.forEach(function(n2) { - n2.i && (n2.__H = n2.i), n2.__V !== c2 && (n2.__ = n2.__V), n2.i = void 0, n2.__V = c2; - })), u2 = r2 = null; -}, l.__c = function(t4, r3) { - r3.some(function(t5) { - try { - t5.__h.forEach(k2), t5.__h = t5.__h.filter(function(n2) { - return !n2.__ || w2(n2); - }); - } catch (u4) { - r3.some(function(n2) { - n2.__h && (n2.__h = []); - }), r3 = [], l.__e(u4, t5.__v); - } - }), l2 && l2(t4, r3); -}, l.unmount = function(t4) { - m2 && m2(t4); - var r3, u4 = t4.__c; - u4 && u4.__H && (u4.__H.__.forEach(function(n2) { - try { - k2(n2); - } catch (n3) { - r3 = n3; - } - }), u4.__H = void 0, r3 && l.__e(r3, u4.__v)); -}; -var g2 = "function" == typeof requestAnimationFrame; -function j2(n2) { - var t4, r3 = function() { - clearTimeout(u4), g2 && cancelAnimationFrame(t4), setTimeout(n2); - }, u4 = setTimeout(r3, 100); - g2 && (t4 = requestAnimationFrame(r3)); -} -function k2(n2) { - var t4 = r2, u4 = n2.__c; - "function" == typeof u4 && (n2.__c = void 0, u4()), r2 = t4; -} -function w2(n2) { - var t4 = r2; - n2.__c = n2.__(), r2 = t4; -} -function z2(n2, t4) { - return !n2 || n2.length !== t4.length || t4.some(function(t5, r3) { - return t5 !== n2[r3]; - }); -} -function B2(n2, t4) { - return "function" == typeof t4 ? t4(n2) : t4; -} - -// node_modules/preact/compat/dist/compat.module.js -function g3(n2, t4) { - for (var e4 in t4) - n2[e4] = t4[e4]; - return n2; -} -function C2(n2, t4) { - for (var e4 in n2) - if ("__source" !== e4 && !(e4 in t4)) - return true; - for (var r3 in t4) - if ("__source" !== r3 && n2[r3] !== t4[r3]) - return true; - return false; -} -function E2(n2, t4) { - return n2 === t4 && (0 !== n2 || 1 / n2 == 1 / t4) || n2 != n2 && t4 != t4; -} -function w3(n2) { - this.props = n2; -} -function x3(n2, e4) { - function r3(n3) { - var t4 = this.props.ref, r4 = t4 == n3.ref; - return !r4 && t4 && (t4.call ? t4(null) : t4.current = null), e4 ? !e4(this.props, n3) || !r4 : C2(this.props, n3); - } - function u4(e5) { - return this.shouldComponentUpdate = r3, y(n2, e5); - } - return u4.displayName = "Memo(" + (n2.displayName || n2.name) + ")", u4.prototype.isReactComponent = true, u4.__f = true, u4; -} -(w3.prototype = new k()).isPureReactComponent = true, w3.prototype.shouldComponentUpdate = function(n2, t4) { - return C2(this.props, n2) || C2(this.state, t4); -}; -var R = l.__b; -l.__b = function(n2) { - n2.type && n2.type.__f && n2.ref && (n2.props.ref = n2.ref, n2.ref = null), R && R(n2); -}; -var N2 = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.forward_ref") || 3911; -function k3(n2) { - function t4(t5) { - var e4 = g3({}, t5); - return delete e4.ref, n2(e4, t5.ref || null); - } - return t4.$$typeof = N2, t4.render = t4, t4.prototype.isReactComponent = t4.__f = true, t4.displayName = "ForwardRef(" + (n2.displayName || n2.name) + ")", t4; -} -var A3 = function(n2, t4) { - return null == n2 ? null : P(P(n2).map(t4)); -}; -var O2 = { map: A3, forEach: A3, count: function(n2) { - return n2 ? P(n2).length : 0; -}, only: function(n2) { - var t4 = P(n2); - if (1 !== t4.length) - throw "Children.only"; - return t4[0]; -}, toArray: P }; -var T3 = l.__e; -l.__e = function(n2, t4, e4, r3) { - if (n2.then) { - for (var u4, o3 = t4; o3 = o3.__; ) - if ((u4 = o3.__c) && u4.__c) - return null == t4.__e && (t4.__e = e4.__e, t4.__k = e4.__k), u4.__c(n2, t4); - } - T3(n2, t4, e4, r3); -}; -var I2 = l.unmount; -function L2(n2, t4, e4) { - return n2 && (n2.__c && n2.__c.__H && (n2.__c.__H.__.forEach(function(n3) { - "function" == typeof n3.__c && n3.__c(); - }), n2.__c.__H = null), null != (n2 = g3({}, n2)).__c && (n2.__c.__P === e4 && (n2.__c.__P = t4), n2.__c = null), n2.__k = n2.__k && n2.__k.map(function(n3) { - return L2(n3, t4, e4); - })), n2; -} -function U(n2, t4, e4) { - return n2 && (n2.__v = null, n2.__k = n2.__k && n2.__k.map(function(n3) { - return U(n3, t4, e4); - }), n2.__c && n2.__c.__P === t4 && (n2.__e && e4.insertBefore(n2.__e, n2.__d), n2.__c.__e = true, n2.__c.__P = e4)), n2; -} -function D2() { - this.__u = 0, this.t = null, this.__b = null; -} -function F3(n2) { - var t4 = n2.__.__c; - return t4 && t4.__a && t4.__a(n2); -} -function M2(n2) { - var e4, r3, u4; - function o3(o4) { - if (e4 || (e4 = n2()).then(function(n3) { - r3 = n3.default || n3; - }, function(n3) { - u4 = n3; - }), u4) - throw u4; - if (!r3) - throw e4; - return y(r3, o4); - } - return o3.displayName = "Lazy", o3.__f = true, o3; -} -function V2() { - this.u = null, this.o = null; -} -l.unmount = function(n2) { - var t4 = n2.__c; - t4 && t4.__R && t4.__R(), t4 && true === n2.__h && (n2.type = null), I2 && I2(n2); -}, (D2.prototype = new k()).__c = function(n2, t4) { - var e4 = t4.__c, r3 = this; - null == r3.t && (r3.t = []), r3.t.push(e4); - var u4 = F3(r3.__v), o3 = false, i4 = function() { - o3 || (o3 = true, e4.__R = null, u4 ? u4(l3) : l3()); - }; - e4.__R = i4; - var l3 = function() { - if (!--r3.__u) { - if (r3.state.__a) { - var n3 = r3.state.__a; - r3.__v.__k[0] = U(n3, n3.__c.__P, n3.__c.__O); - } - var t5; - for (r3.setState({ __a: r3.__b = null }); t5 = r3.t.pop(); ) - t5.forceUpdate(); - } - }, c4 = true === t4.__h; - r3.__u++ || c4 || r3.setState({ __a: r3.__b = r3.__v.__k[0] }), n2.then(i4, i4); -}, D2.prototype.componentWillUnmount = function() { - this.t = []; -}, D2.prototype.render = function(n2, e4) { - if (this.__b) { - if (this.__v.__k) { - var r3 = document.createElement("div"), o3 = this.__v.__k[0].__c; - this.__v.__k[0] = L2(this.__b, r3, o3.__O = o3.__P); - } - this.__b = null; - } - var i4 = e4.__a && y(_, null, n2.fallback); - return i4 && (i4.__h = null), [y(_, null, e4.__a ? null : n2.children), i4]; -}; -var W = function(n2, t4, e4) { - if (++e4[1] === e4[0] && n2.o.delete(t4), n2.props.revealOrder && ("t" !== n2.props.revealOrder[0] || !n2.o.size)) - for (e4 = n2.u; e4; ) { - for (; e4.length > 3; ) - e4.pop()(); - if (e4[1] < e4[0]) - break; - n2.u = e4 = e4[2]; - } -}; -function P3(n2) { - return this.getChildContext = function() { - return n2.context; - }, n2.children; -} -function j3(n2) { - var e4 = this, r3 = n2.i; - e4.componentWillUnmount = function() { - B(null, e4.l), e4.l = null, e4.i = null; - }, e4.i && e4.i !== r3 && e4.componentWillUnmount(), n2.__v ? (e4.l || (e4.i = r3, e4.l = { nodeType: 1, parentNode: r3, childNodes: [], appendChild: function(n3) { - this.childNodes.push(n3), e4.i.appendChild(n3); - }, insertBefore: function(n3, t4) { - this.childNodes.push(n3), e4.i.appendChild(n3); - }, removeChild: function(n3) { - this.childNodes.splice(this.childNodes.indexOf(n3) >>> 1, 1), e4.i.removeChild(n3); - } }), B(y(P3, { context: e4.context }, n2.__v), e4.l)) : e4.l && e4.componentWillUnmount(); -} -function z3(n2, e4) { - var r3 = y(j3, { __v: n2, i: e4 }); - return r3.containerInfo = e4, r3; -} -(V2.prototype = new k()).__a = function(n2) { - var t4 = this, e4 = F3(t4.__v), r3 = t4.o.get(n2); - return r3[0]++, function(u4) { - var o3 = function() { - t4.props.revealOrder ? (r3.push(u4), W(t4, n2, r3)) : u4(); - }; - e4 ? e4(o3) : o3(); - }; -}, V2.prototype.render = function(n2) { - this.u = null, this.o = /* @__PURE__ */ new Map(); - var t4 = P(n2.children); - n2.revealOrder && "b" === n2.revealOrder[0] && t4.reverse(); - for (var e4 = t4.length; e4--; ) - this.o.set(t4[e4], this.u = [1, 0, this.u]); - return n2.children; -}, V2.prototype.componentDidUpdate = V2.prototype.componentDidMount = function() { - var n2 = this; - this.o.forEach(function(t4, e4) { - W(n2, e4, t4); - }); -}; -var B3 = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103; -var H2 = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/; -var Z = /^on(Ani|Tra|Tou|BeforeInp|Compo)/; -var Y = /[A-Z0-9]/g; -var $2 = "undefined" != typeof document; -var q3 = function(n2) { - return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/ : /fil|che|ra/).test(n2); -}; -function G(n2, t4, e4) { - return null == t4.__k && (t4.textContent = ""), B(n2, t4), "function" == typeof e4 && e4(), n2 ? n2.__c : null; -} -function J(n2, t4, e4) { - return D(n2, t4), "function" == typeof e4 && e4(), n2 ? n2.__c : null; -} -k.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t4) { - Object.defineProperty(k.prototype, t4, { configurable: true, get: function() { - return this["UNSAFE_" + t4]; - }, set: function(n2) { - Object.defineProperty(this, t4, { configurable: true, writable: true, value: n2 }); - } }); -}); -var K = l.event; -function Q() { -} -function X() { - return this.cancelBubble; -} -function nn() { - return this.defaultPrevented; -} -l.event = function(n2) { - return K && (n2 = K(n2)), n2.persist = Q, n2.isPropagationStopped = X, n2.isDefaultPrevented = nn, n2.nativeEvent = n2; -}; -var tn; -var en = { configurable: true, get: function() { - return this.class; -} }; -var rn = l.vnode; -l.vnode = function(n2) { - var t4 = n2.type, e4 = n2.props, u4 = e4; - if ("string" == typeof t4) { - for (var o3 in u4 = {}, e4) { - var i4 = e4[o3]; - if (!("value" === o3 && "defaultValue" in e4 && null == i4 || $2 && "children" === o3 && "noscript" === t4)) { - var l3 = o3.toLowerCase(); - "defaultValue" === o3 && "value" in e4 && null == e4.value ? o3 = "value" : "download" === o3 && true === i4 ? i4 = "" : "ondoubleclick" === l3 ? o3 = "ondblclick" : "onchange" !== l3 || "input" !== t4 && "textarea" !== t4 || q3(e4.type) ? "onfocus" === l3 ? o3 = "onfocusin" : "onblur" === l3 ? o3 = "onfocusout" : Z.test(o3) ? o3 = l3 : -1 === t4.indexOf("-") && H2.test(o3) ? o3 = o3.replace(Y, "-$&").toLowerCase() : null === i4 && (i4 = void 0) : l3 = o3 = "oninput", "oninput" === l3 && u4[o3 = l3] && (o3 = "oninputCapture"), u4[o3] = i4; - } - } - "select" == t4 && u4.multiple && Array.isArray(u4.value) && (u4.value = P(e4.children).forEach(function(n3) { - n3.props.selected = -1 != u4.value.indexOf(n3.props.value); - })), "select" == t4 && null != u4.defaultValue && (u4.value = P(e4.children).forEach(function(n3) { - n3.props.selected = u4.multiple ? -1 != u4.defaultValue.indexOf(n3.props.value) : u4.defaultValue == n3.props.value; - })), n2.props = u4, e4.class != e4.className && (en.enumerable = "className" in e4, null != e4.className && (u4.class = e4.className), Object.defineProperty(u4, "className", en)); - } - n2.$$typeof = B3, rn && rn(n2); -}; -var un = l.__r; -l.__r = function(n2) { - un && un(n2), tn = n2.__c; -}; -var on = l.diffed; -l.diffed = function(n2) { - on && on(n2); - var t4 = n2.props, e4 = n2.__e; - null != e4 && "textarea" === n2.type && "value" in t4 && t4.value !== e4.value && (e4.value = null == t4.value ? "" : t4.value), tn = null; -}; -var ln = { ReactCurrentDispatcher: { current: { readContext: function(n2) { - return tn.__n[n2.__c].props.value; -} } } }; -function fn(n2) { - return y.bind(null, n2); -} -function an(n2) { - return !!n2 && n2.$$typeof === B3; -} -function sn(n2) { - return an(n2) ? E.apply(null, arguments) : n2; -} -function hn(n2) { - return !!n2.__k && (B(null, n2), true); -} -function vn(n2) { - return n2 && (n2.base || 1 === n2.nodeType && n2) || null; -} -var dn = function(n2, t4) { - return n2(t4); -}; -var pn = function(n2, t4) { - return n2(t4); -}; -var mn = _; -function yn(n2) { - n2(); -} -function _n(n2) { - return n2; -} -function bn() { - return [false, yn]; -} -var Sn = y2; -function gn(n2, t4) { - var e4 = t4(), r3 = h2({ h: { __: e4, v: t4 } }), u4 = r3[0].h, o3 = r3[1]; - return y2(function() { - u4.__ = e4, u4.v = t4, E2(u4.__, t4()) || o3({ h: u4 }); - }, [n2, e4, t4]), p2(function() { - return E2(u4.__, u4.v()) || o3({ h: u4 }), n2(function() { - E2(u4.__, u4.v()) || o3({ h: u4 }); - }); - }, [n2]), e4; -} -var Cn = { useState: h2, useId: V, useReducer: s2, useEffect: p2, useLayoutEffect: y2, useInsertionEffect: Sn, useTransition: bn, useDeferredValue: _n, useSyncExternalStore: gn, startTransition: yn, useRef: _2, useImperativeHandle: A2, useMemo: F2, useCallback: T2, useContext: q2, useDebugValue: x2, version: "17.0.2", Children: O2, render: G, hydrate: J, unmountComponentAtNode: hn, createPortal: z3, createElement: y, createContext: F, createFactory: fn, cloneElement: sn, createRef: d, Fragment: _, isValidElement: an, findDOMNode: vn, Component: k, PureComponent: w3, memo: x3, forwardRef: k3, flushSync: pn, unstable_batchedUpdates: dn, StrictMode: mn, Suspense: D2, SuspenseList: V2, lazy: M2, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ln }; - -// node_modules/preact/compat/client.mjs -function createRoot(container) { - return { - render(children) { - G(children, container); - }, - unmount() { - hn(container); - } - }; -} - -// src/utils/codemirror.ts -var import_language = require("@codemirror/language"); -var getActiveCM = (plugin) => { - let rcm; - plugin.app.workspace.iterateLeaves((leaf) => { - var _a2; - const cm = (_a2 = leaf.view.editor) == null ? void 0 : _a2.cm; - if (cm == null ? void 0 : cm.hasFocus) { - rcm = cm; - return true; - } - }, plugin.app.workspace["rootSplit"]); - return rcm; -}; -var getActiveMarkdownView = (plugin) => { - let rv; - plugin.app.workspace.iterateLeaves((leaf) => { - var _a2; - const cm = (_a2 = leaf.view.editor) == null ? void 0 : _a2.cm; - if (cm == null ? void 0 : cm.hasFocus) { - rv = leaf.view; - return true; - } - }, plugin.app.workspace["rootSplit"]); - return rv; -}; -function iterateTreeAtPos(pos, state, iterateFns) { - (0, import_language.syntaxTree)(state).iterate({ ...iterateFns, from: pos, to: pos }); -} -function iterateTreeInSelection(selection, state, iterateFns) { - (0, import_language.syntaxTree)(state).iterate({ - ...iterateFns, - from: selection.from, - to: selection.to - }); -} -function iterateTreeInDocument(state, iterateFns) { - (0, import_language.syntaxTree)(state).iterate({ ...iterateFns }); -} - -// src/cm-extensions/markSans/callout.tsx -var import_language2 = require("@codemirror/language"); -var import_state2 = require("@codemirror/state"); -var import_view2 = require("@codemirror/view"); - -// src/utils/uuid.js -function genId() { - return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace( - /[018]/g, - (c4) => (c4 ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c4 / 4).toString(16) - ); -} - -// src/cm-extensions/markSans/callout.tsx -var portalTypeAnnotation = import_state2.Annotation.define(); -var flowIDAnnotation = import_state2.Annotation.define(); -var flowIDStateField = import_state2.StateField.define({ - create: () => void 0, - update(value, tr) { - if (tr.annotation(flowIDAnnotation)) - return tr.annotation(flowIDAnnotation); - return value; - } -}); -var flowTypeStateField = import_state2.StateField.define({ - create: (state) => "none", - update(value, tr) { - if (tr.annotation(portalTypeAnnotation)) - return tr.annotation(portalTypeAnnotation); - return value; - } -}); -var calloutField = import_state2.StateField.define({ - create() { - return import_view2.Decoration.none; - }, - update(value, tr) { - if (tr.state.field(flowTypeStateField, false) != "doc") { - return value; - } - const builder = new import_state2.RangeSetBuilder(); - const nodes = []; - (0, import_language2.syntaxTree)(tr.state).iterate({ - enter: ({ name, from, to }) => { - nodes.push({ name, from, to }); - } - }); - const nextQuote = (ns, to) => { - const nq = ns.find( - (f4) => f4.from == to + 1 && f4.name.contains("HyperMD-quote") - ); - if (nq) { - return nextQuote(ns, nq.to); - } - return to; - }; - const previous = value.iter(); - const previousSpecs = []; - while (previous.value !== null) { - previousSpecs.push(previous.value.spec.widget.info); - previous.next(); - } - let index = 0; - nodes.map(({ name, from, to }) => { - if (name.contains("HyperMD-callout")) { - const existingCallout = previousSpecs[index]; - const endQuote = nextQuote(nodes, to); - const lineStart = tr.state.doc.lineAt(from).number; - const lineEnd = tr.state.doc.lineAt(endQuote).number; - if (existingCallout) { - builder.add( - from, - endQuote + 1, - calloutBlock( - { from: lineStart, to: lineEnd }, - tr.state.sliceDoc(from, endQuote), - existingCallout.id - ) - ); - } else { - builder.add( - from, - endQuote + 1, - calloutBlock( - { from: lineStart, to: lineEnd }, - tr.state.sliceDoc(from, endQuote), - genId() - ) - ); + function l3(a5, b4 = "i8") { + b4.endsWith("*") && (b4 = "*"); + switch (b4) { + case "i1": + return r3[a5 >> 0]; + case "i8": + return r3[a5 >> 0]; + case "i16": + return Oa[a5 >> 1]; + case "i32": + return F4[a5 >> 2]; + case "i64": + return F4[a5 >> 2]; + case "float": + return Pa[a5 >> 2]; + case "double": + return Qa[a5 >> 3]; + case "*": + return J2[a5 >> 2]; + default: + E4("invalid type for getValue: " + b4); + } + return null; } - index++; - } - }); - const dec = builder.finish(); - return dec; - }, - provide: (f4) => import_view2.EditorView.decorations.from(f4) -}); -var CalloutWidget = class extends import_view2.WidgetType { - constructor(info) { - super(); - this.info = info; - } - eq(other) { - return other.info.id === this.info.id; - } - toDOM() { - const parseTextToCallout = (text2) => { - if (!this.info.text) { - return { icon: "", title: "" }; - } - const stringArray = text2.split("\n"); - const titleRegex = RegExp(/.*\[!(\w*)\]\s(.*)/); - const title = titleRegex.exec(stringArray[0]); - if (!title || title.length < 3) { - return { icon: "", title: "" }; - } - return { - icon: title[1], - title: title[2] - }; - }; - const callOutData = parseTextToCallout(this.info.text); - const div = document.createElement("div"); - div.toggleClass("callout", true); - const divTitle = div.createDiv("div"); - divTitle.toggleClass("callout-title", true); - const div2 = div.createDiv("div"); - div2.toggleClass("callout-content", true); - div2.setAttribute("id", "mk-callout-" + this.info.id); - return div; - } -}; -var calloutBlock = (range, text2, id2) => import_view2.Decoration.widget({ - widget: new CalloutWidget({ range, text: text2, id: id2 }), - block: true -}); - -// src/types/types.ts -var eventTypes = { - activePathChange: "mkmd-active-path", - frameSelected: "mkmd-active-frame", - frameLayerSelected: "mkmd-frame-layer", - refreshView: "mkmd-refresh-view", - revealFile: "mkmd-reveal-file", - collapseFolders: "mkmd-collapse-folders", - toggleBacklinks: "mkmd-toggle-backlinks", - metadataChange: "mkmd-tags-change", - vaultChange: "mkmd-vault-change", - mdbChange: "mkmd-mdb-change", - spacesChange: "mkmd-spaces-change", - frameChange: "mkmd-frame-change", - updateSections: "mkmd-update-sections", - settingsChanged: "mkmd-settings-changed", - spawnPortal: "mkmd-portal-spawn", - loadPortal: "mkmd-portal-load", - openFilePortal: "mkmd-portal-file", - focusPortal: "mkmd-portal-focus" -}; - -// src/dispatch/flowDispatch.ts -var createFlowEditorInElement = (id2, leaf, source, el, type, path, from, to) => { - const evt = new CustomEvent(eventTypes.spawnPortal, { - detail: { id: id2, leaf, source, el, path, from, to, type } - }); - activeWindow.dispatchEvent(evt); -}; -var loadFlowEditorByDOM = (el, view, id2) => { - const evt = new CustomEvent(eventTypes.loadPortal, { - detail: { id: id2, el, view } - }); - activeWindow.dispatchEvent(evt); -}; -var focusFlowEditor = (id2, top) => { - const evt = new CustomEvent(eventTypes.focusPortal, { - detail: { id: id2, parent: false, top } - }); - activeWindow.dispatchEvent(evt); -}; -var focusFlowEditorParent = (id2, top) => { - const evt = new CustomEvent(eventTypes.focusPortal, { - detail: { id: id2, parent: true, top } - }); - activeWindow.dispatchEvent(evt); -}; -var openFileFlowEditor = (file, source) => { - const evt = new CustomEvent(eventTypes.openFilePortal, { - detail: { file, source } - }); - activeWindow.dispatchEvent(evt); -}; - -// src/i18n.ts -var T4 = class { - constructor() { - this.all = { - en: { - commands: { - h1: "Heading 1", - h2: "Heading 2", - h3: "Heading 3", - list: "Bullet List", - "ordered-list": "Numbered List", - todo: "To-do List", - quote: "Quote", - divider: "Divider", - note: "Link to Note", - link: "Web Link", - callout: "Callout", - table: "Table", - codeblock: "Code Block", - emoji: "Emoji", - image: "Image", - flow: "Flow Block", - tag: "Tag", - makeMenu: "Flow Menu", - selectStyle: "Style", - toggleKeyboard: "Toggle Keyboard" - }, - 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", - reloadSpaces: "Reload Spaces", - blink: "Blink", - openFileContext: "Open Explorer", - convertFolderNote: "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" - }, - menu: { - fileMetadata: "None", - fileMetadataDescription: "This note only", - openFilePane: "Open in a new pane", - rename: "Rename", - changeToFolderNote: "New Space from Note", - moveFile: "Move file to...", - duplicate: "Make a copy", - edit: "Edit", - delete: "Delete", - getHelp: "Make.md Community", - openVault: "Open Another Vault", - openVaultInFolder: "Open Vault Folder", - obSettings: "Obsidian Settings", - commandPalette: "Command Palette", - backToSpace: "Back to Spaces", - newSpace: "New Space", - collapseAllSections: "Collapse All Spaces", - expandAllSections: "Expand All Spaces", - collapseAllFolders: "Collapse All Folders", - expandAllFolders: "Expand All Folders", - spaceTitle: "Add/Remove in Space", - home: "Home", - none: "None", - tableView: "Table View", - cardView: "Card View", - listView: "List View", - flowView: "Flow View", - groupBy: "Group By", - sortBy: "Sort By", - newFilter: "New Filter", - clearFilters: "Clear Filters", - unhideFields: "Unhide All Properties", - importDataview: "Import All Dataview Properties", - saveAllProperties: "Save All Properties to Files", - mergeProperties: "Merge Properties", - openSpace: "Open Space", - removeFromSpace: "Remove from Space", - 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)", - spaces: "Spaces", - tags: "Tags", - manageHiddenFiles: "Manage Hidden Files", - unpinSpace: "Remove from Waypoints", - pinSpace: "Add to Waypoints", - deleteSpace: "Delete Space", - changeColor: "Change Color", - changePropertyType: "Change Type", - deleteFiles: "Delete Files", - createFolderSpace: "Create Space from Folder", - folder: "Folder", - syncToContext: "Add to Space" - }, - buttons: { - moreOptions: "More Options", - newNote: "New Note", - changeIcon: "Change Sticker", - removeIcon: "Remove Sticker", - changeBanner: "Change Cover", - removeBanner: "Remove Cover", - rename: "Change Name", - saveSpace: "Save Space", - createFolder: "New Space", - createNote: "New Note", - createCanvas: "New Canvas", - cancel: "Cancel", - search: "Search", - delete: "Delete", - toggleFlow: "Toggle Flow", - openFlow: "Open Flow", - hideFlow: "Hide Flow", - openLink: "Open Link", - addToSpace: "Add to Space", - 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", - renameTable: "Rename Table", - currentFolder: "Current Folder", - sync: "Sync" - }, - 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" - }, - 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" - }, - number: { - label: "Number" - }, - preview: { - label: "Preview" - }, - boolean: { - label: "Yes/No" - }, - date: { - label: "Date" - }, - option: { - label: "Option" - }, - file: { - label: "File" - }, - link: { - label: "Link" - }, - tag: { - label: "Tag" - }, - object: { - label: "Object" - }, - context: { - label: "Relation" - }, - image: { - label: "Image" - }, - color: { - label: "Color" - }, - space: { - label: "Space" - }, - icon: { - label: "Icon" - }, - fileProperty: { - label: "Look Up", - createdTime: "Created", - modifiedTime: "Last Edited", - extension: "Extension", - size: "Size", - preview: "Note Preview", - parentFolder: "Folder" + function pa(a5) { + var b4 = "i32"; + b4.endsWith("*") && (b4 = "*"); + switch (b4) { + case "i1": + r3[a5 >> 0] = 0; + break; + case "i8": + r3[a5 >> 0] = 0; + break; + case "i16": + Oa[a5 >> 1] = 0; + break; + case "i32": + F4[a5 >> 2] = 0; + break; + case "i64": + O4 = [0, (N3 = 0, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; + F4[a5 >> 2] = O4[0]; + F4[a5 + 4 >> 2] = O4[1]; + break; + case "float": + Pa[a5 >> 2] = 0; + break; + case "double": + Qa[a5 >> 3] = 0; + break; + case "*": + J2[a5 >> 2] = 0; + break; + default: + E4("invalid type for setValue: " + b4); } - }, - labels: { - createFolder: "New Folder Name", - rename: "Rename", - selectDateFormat: "Select/Type Date Format", - renameSectionSmart: "Edit Smart Space", - renameSection: "Edit Space", - createSectionSmart: "New Smart Space", - createSection: "New Space", - createNote: "New Note Name", - contextMaker: "Context Maker", - select: "Select", - collapse: "Collapse", - expand: "Expand", - findStickers: "Find Sticker", - mergeProperties: "Merge Properties", - placeholder: "Type '${1}' for commands", - noFile: "is not created yet. Click to create.", - blinkPlaceholder: "Quickly Search a File, Folder, Tag... Press Tab to Edit", - searchPlaceholder: "Type to search...", - contextItemSelectPlaceholder: "Find Item", - linkItemSelectPlaceholder: "Find or Create Note", - optionItemSelectPlaceholder: "Select Option", - viewItemSelectPlaceholder: "Select View", - tagItemSelectPlaceholder: "Find Tag", - spaceSelectPlaceholder: "Select Space", - propertyItemSelectPlaceholder: "Select Property", - sortItemSelectPlaceholder: "Select Sort", - filterItemSelectPlaceholder: "Select Filter", - syncFrontmatterProperty: "Sync Frontmatter Property", - newProperty: "New Property", - propertyType: "Type", - propertyValueSpace: "Space", - propertyValueProperty: "Property", - 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", - context: "Context" - }, - descriptions: { - 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" - }, - settings: { - layoutVertical: "Vertical", - layoutHorizontal: "Horizontal", - sectionSidebar: "Spaces", - sectionEditor: "Maker Mode", - sectionFlow: "Flow", - sectionAdvanced: "Advanced", - sectionDataview: "Dataview", - sectionAppearance: "Appearance", - sectionContext: "Context", - 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" - }, - 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)" - }, - 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", - desc: "Hide the frontmatter when inline context is enabled" - }, - 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" - }, - lineNumbers: { - name: "Line Numbers", - desc: "Display line numbers" - }, - contexts: { - name: "Contexts", - desc: `Contexts allows you to have full control over the metadata of your files` - }, - spaces: { - name: "Spaces", - desc: `Spaces gives you control over how you organize your files` - }, - 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` - }, - 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" + } + var db = (a5, b4) => { + for (var c4 = 0, d5 = a5.length - 1; 0 <= d5; d5--) { + var f4 = a5[d5]; + "." === f4 ? a5.splice(d5, 1) : ".." === f4 ? (a5.splice(d5, 1), c4++) : c4 && (a5.splice(d5, 1), c4--); + } + if (b4) + for (; c4; c4--) + a5.unshift(".."); + return a5; + }, z5 = (a5) => { + var b4 = "/" === a5.charAt(0), c4 = "/" === a5.substr(-1); + (a5 = db(a5.split("/").filter((d5) => !!d5), !b4).join("/")) || b4 || (a5 = "."); + a5 && c4 && (a5 += "/"); + return (b4 ? "/" : "") + a5; + }, eb = (a5) => { + var b4 = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a5).slice(1); + a5 = b4[0]; + b4 = b4[1]; + if (!a5 && !b4) + return "."; + b4 && (b4 = b4.substr(0, b4.length - 1)); + return a5 + b4; + }, fb = (a5) => { + if ("/" === a5) + return "/"; + a5 = z5(a5); + a5 = a5.replace(/\/$/, ""); + var b4 = a5.lastIndexOf("/"); + return -1 === b4 ? a5 : a5.substr(b4 + 1); + }; + function gb() { + if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) { + var a5 = new Uint8Array(1); + return () => { + crypto.getRandomValues(a5); + return a5[0]; + }; } + if (Aa) + try { + var b4 = require("crypto"); + return () => b4.randomBytes(1)[0]; + } catch (c4) { + } + return () => E4("randomDevice"); } - } - }; - this.lang = localStorage.getItem("language"); - } - get texts() { - return this.all["en"]; - } -}; -var i18n_default = new T4().texts; - -// src/utils/array.ts -var insert = (arr, index, newItem) => !index || index <= 0 ? [ - newItem, - ...arr -] : [ - ...arr.slice(0, index), - newItem, - ...arr.slice(index) -]; -var insertMulti = (arr, index, newItem) => !index || index <= 0 ? [ - ...newItem, - ...arr -] : [ - ...arr.slice(0, index), - ...newItem, - ...arr.slice(index) -]; -var uniq = (a5) => [...new Set(a5)]; -var uniqCaseInsensitive = (a5) => [ - ...new Map(a5.map((s5) => [s5.toLowerCase(), s5])).values() -]; -var uniqueNameFromString = (name, cols) => { - let newName = name; - if (cols.includes(newName)) { - let append = 1; - while (cols.includes(newName)) { - newName = name + append.toString(); - append += 1; - } - } - return newName; -}; -var onlyUniqueProp = (prop) => (value, index, self2) => { - return self2.findIndex((v3) => value[prop] == v3[prop]) === index; -}; -var orderArrayByArray = (array, order, key2) => { - return array.sort(function(a5, b4) { - const A4 = order.indexOf(a5[key2]), B5 = order.indexOf(b4[key2]); - if (A4 > B5) { - if (A4 != -1 && B5 == -1) { - return -1; - } - return 1; - } else { - if (B5 != -1 && A4 == -1) { - return 1; - } - return -1; - } - }); -}; - -// src/utils/strings.ts -function ensureArray(value) { - if (Array.isArray(value)) { - return value; - } - return []; -} -function ensureStringValueFromSet(value, values, defaultValue2) { - const _v = ensureString(value); - return values.some((f4) => f4 == _v) ? _v : defaultValue2; -} -function ensureString(value) { - if (!value) - return ""; - if (typeof value !== "string") { - return value.toString(); - } - return value; -} -function ensureBoolean(value) { - if (!value) - return false; - return true; -} -function parseStickerString(input) { - if (!input) { - return ["", ""]; - } - const match2 = input.match(/^(.*?)\s*\/\/\s*(.*)$/); - if (match2) { - return [match2[1], match2[2]]; - } else { - return ["", input]; - } -} -var emojiFromString = (emoji) => { - let html; - try { - html = unifiedToNative(emoji); - } catch (e4) { - html = emoji; - } - return html; -}; -var unifiedToNative = (unified) => { - const unicodes = unified.split("-"); - const codePoints = unicodes.map((u4) => `0x${u4}`); - return String.fromCodePoint(...codePoints); -}; -var indexOfCharElseEOS = (char, str) => { - if (str.indexOf(char) > 0) - return str.indexOf(char); - return str.length; -}; -var spaceNameFromSpacePath = (contextPath, plugin) => { - var _a2, _b2; - return (_b2 = (_a2 = plugin.index.spacesIndex.get(contextPath)) == null ? void 0 : _a2.name) != null ? _b2 : contextPath; -}; -var spacePathFromName = (spaceName) => "spaces://" + encodeSpaceName(spaceName); -var encodeSpaceName = (spaceName) => spaceName.replace(/\//g, "+"); -var tagSpacePathFromTag = (tag) => "spaces://" + tag; -var wrapQuotes = (s5) => `"${s5}"`; -var removeQuotes = (s5) => { - if (!s5) - return s5; - const singleQuoteWithSemicolon = s5.startsWith("'") && (s5.endsWith("';") || s5.endsWith("'")); - const doubleQuoteWithSemicolon = s5.startsWith('"') && (s5.endsWith('";') || s5.endsWith('"')); - if (singleQuoteWithSemicolon || doubleQuoteWithSemicolon) { - s5 = s5.substring(1, s5.length - 1); - if (s5.endsWith('"') || s5.endsWith("'")) { - s5 = s5.substring(0, s5.length - 1); - } - return s5; - } else { - return s5; - } -}; -var filePathToString = (filename) => { - if (filename.lastIndexOf("/") != -1) { - if (filename.lastIndexOf(".") != -1) - return removeLeadingSlash( - filename.substring( - filename.lastIndexOf("/") + 1, - filename.lastIndexOf(".") - ) - ); - return filename.substring(filename.lastIndexOf("/") + 1); - } - if (filename.lastIndexOf(".") != -1) { - return filename.substring(0, filename.lastIndexOf(".")); - } - return filename; -}; -var stringFromTag = (string) => { - if (string.charAt(0) == "#") { - if (string.charAt(1) == "#") { - return string.substring(2, string.length); - } - return string.substring(1, string.length); - } - return string; -}; -var fileNameToString = (filename) => filename.substring(0, filename.lastIndexOf(".")) || filename; -var removeLeadingSlash = (path) => path.charAt(0) == "/" ? path.substring(1) : path; -var filePathToFolderPath = (filename) => removeLeadingSlash(filename.substring(0, filename.lastIndexOf("/"))) || filename; -var folderPathToString = (filename) => removeLeadingSlash(filename.substring(filename.lastIndexOf("/"))) || filename; -var pathDisplayName = (path, plugin) => { - if (!path) - return ""; - if (path.type == "vault") - return plugin.app.vault.getName(); - if ((path == null ? void 0 : path.type) == "folder") { - return folderPathToString(path.path); - } - if ((path == null ? void 0 : path.type) == "tag") - return stringFromTag(path.space); - if ((path == null ? void 0 : path.type) == "space") - return spaceNameFromSpacePath(path.space, plugin); - if (path.isRemote) { - return folderPathToString(path.path); - } - return path.path; -}; -var folderNotePathFromAFile = (settings, aFile) => !aFile ? null : settings.folderNoteInsideFolder ? `${aFile.path}/${aFile.name}.md` : aFile.parent == "/" ? `${aFile.name}.md` : `${aFile.parent}/${aFile.name}.md`; -var folderPathFromFolderNoteFile = (settings, aFile) => !aFile ? null : settings.folderNoteInsideFolder ? aFile.parent : `${aFile.parent}/${aFile.name}`; -var spacePathFromSpaceDefFile = (aFile) => !aFile ? null : "spaces://" + aFile.name; - -// src/utils/parser.tsx -var parseSortStrat = (str) => { - const [a5, b4] = str.split("_"); - return { field: a5, asc: b4 == "asc", group: true }; -}; -var parseMultiString = (str) => { - var _a2; - return (_a2 = str == null ? void 0 : str.match(/(\\.|[^,])+/g)) != null ? _a2 : []; -}; -var parseLinkString = (string) => { - if (!string) - return ""; - const match2 = /\[\[(.*?)\]\]/g.exec(string); - const stringValue = (match2 == null ? void 0 : match2.length) > 1 ? match2[1].substring(0, indexOfCharElseEOS("|", match2[1])) : string; - if (stringValue) - return stringValue; - return string; -}; -var parseLinkDisplayString = (string) => { - return filePathToString(parseLinkString(string)); -}; - -// src/utils/serializer.ts -var serializeMultiString = (value) => value.join(","); -var serializeMultiDisplayString = (value) => value.join(", "); -var serializeSQLValues = (value) => value.join(", "); -var serializeSQLStatements = (value) => value.join("; "); -var serializeSQLFieldNames = (value) => value.join(","); - -// src/components/RemoteMarkdownView/FileView.tsx -var import_obsidian2 = require("obsidian"); - -// src/components/RemoteMarkdownView/FileLinkViewComponent.tsx -var import_obsidian = require("obsidian"); -var FileLinkViewComponent = (props2) => { - const ref2 = _2(null); - const [markdown, setMarkdown] = h2(""); - p2(() => { - if (ref2.current) - import_obsidian.MarkdownRenderer.render( - props2.plugin.app, - markdown, - ref2.current, - props2.path, - props2.component - ); - }, [markdown]); - p2(() => { - fetch(props2.path).then((res) => res.text()).then((f4) => setMarkdown(f4)); - }, [props2.path]); - return /* @__PURE__ */ Cn.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__ */ Cn.createElement("div", { - className: "markdown-preview-sizer markdown-preview-section", - ref: ref2 - })); -}; - -// src/components/RemoteMarkdownView/FileView.tsx -var FILE_VIEW_TYPE = "make-file-view"; -var FileLinkView = class extends import_obsidian2.ItemView { - constructor(leaf, plugin, viewType) { - super(leaf); - this.navigation = true; - this.plugin = plugin; - this.viewType = viewType; - } - getViewType() { - return FILE_VIEW_TYPE; - } - getDisplayText() { - return this.path; - } - async onClose() { - this.destroy(); - } - destroy() { - if (this.root) - this.root.unmount(); - } - async onOpen() { - this.destroy(); - } - async setState(state, result) { - this.path = state.path; - this.constructView(this.path); - const displayName = this.path; - await super.setState(state, result); - this.leaf.tabHeaderInnerTitleEl.innerText = displayName; - this.leaf.view.titleEl = displayName; - const headerEl = this.leaf.view.headerEl; - if (headerEl) { - headerEl.querySelector(".view-header-title").innerText = displayName; - } - result.history = true; - return; - } - getState() { - const state = super.getState(); - state.path = this.path; - return state; - } - constructView(path) { - this.destroy(); - this.root = createRoot(this.contentEl); - this.root.render( - /* @__PURE__ */ Cn.createElement("div", { - className: "markdown-reading-view" - }, /* @__PURE__ */ Cn.createElement(FileLinkViewComponent, { - path, - plugin: this.plugin, - component: this - })) - ); - } -}; - -// src/types/mframe.ts -var defaultFrameEditorProps = { editMode: 0 }; - -// src/utils/objects.ts -var replaceKeys = (object1, object2) => { - const newObject = {}; - for (const key2 in object1) { - const newKey = Object.prototype.hasOwnProperty.call(object2, key2) ? object2[key2] : key2; - newObject[newKey] = object1[key2]; - } - return newObject; -}; -function applyFunctionToObject(object, func) { - const newObject = {}; - for (const key2 in object) { - if (Object.prototype.hasOwnProperty.call(object, key2)) { - newObject[key2] = func(object[key2]); - } - } - return newObject; -} -var replaceKeysByValue = (object1, object2) => { - const reversedObject2 = {}; - for (const key2 in object2) { - reversedObject2[object2[key2]] = key2; - } - return replaceKeys(object1, reversedObject2); -}; - -// src/utils/uri.ts -var import_obsidian3 = require("obsidian"); - -// src/utils/regex.ts -var relativeURLRegex = /^[a-zA-Z0-9][^\\\\:|<\>"*?]*$/g; -var urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi; - -// src/utils/uri.ts -var openPath = (plugin, _path, location) => { - if (!_path) - return; - const { type, path } = _path; - if (type == "file" || type == "folder") { - const afile = getAbstractFileAtPath(plugin, path); - if (afile) { - openAFile(afile, plugin, location); - } else { - if (type == "file") - createNewMarkdownFile( - plugin, - defaultNoteFolder(plugin, null), - path - ); - } - return; - } - if (type == "tag") { - openTagContext(path, plugin, location); - return; - } - if (type == "url") { - openURL(path, plugin, location); - return; - } -}; -var uriForFolder = (path) => { - if (path == "/") - return { - type: "vault", - basePath: path, - fullPath: path, - space: null, - path, - alias: null, - ref: null, - refStr: null, - refType: null, - query: null - }; - return { - type: "folder", - basePath: path, - fullPath: path, - space: null, - path, - alias: null, - ref: null, - refStr: null, - refType: null, - query: null - }; -}; -function uriByString(plugin, uri, source) { - if (!uri) - return null; - const fullPath = uri; - let refTypeChar = ""; - const parseQuery = (queryString) => { - const query2 = {}; - queryString.split("&").forEach((param) => { - const [key2, value] = param.split("="); - query2[decodeURIComponent(key2)] = decodeURIComponent(value); - }); - return query2; - }; - const mapRefType = (refTypeChar2) => { - if (refTypeChar2 === "^") - return "context"; - if (refTypeChar2 === "*") - return "frame"; - return null; - }; - let space = null; - let path = null; - let alias = null; - let reference = null; - let refType = null; - let query = null; - if (uri.startsWith("spaces://")) { - const spaceStr = uri.slice("spaces://".length); - if (spaceStr.charAt(0) == "#") { - const endIndex = spaceStr.lastIndexOf("/#"); - if (endIndex != -1) { - space = spaceStr.slice(0, endIndex); - uri = spaceStr.slice(endIndex); - } else { - space = spaceStr; - uri = "/"; - } - } else { - const spaceParts = spaceStr.split("/"); - space = spaceParts[0]; - uri = "/" + (spaceParts.slice(1).join("/") || ""); - } - } - const lastSlashIndex = uri.lastIndexOf("/"); - const lastHashIndex = uri.lastIndexOf("#"); - const lastPipeIndex = uri.lastIndexOf("|"); - const queryIndex = uri.lastIndexOf("?"); - if (queryIndex !== -1) { - query = parseQuery(uri.slice(queryIndex + 1)); - uri = uri.slice(0, queryIndex); - } - if (lastHashIndex !== -1 && lastHashIndex > lastSlashIndex) { - const refPart = uri.slice(lastHashIndex + 1); - refType = mapRefType(refPart[0]); - if (refType || lastHashIndex != lastSlashIndex + 1) { - refTypeChar = refPart[0]; - reference = refType ? refPart.slice(1) : refPart; - uri = uri.slice(0, lastHashIndex); - } - } - if (lastPipeIndex !== -1 && lastPipeIndex > lastSlashIndex) { - alias = uri.slice(lastPipeIndex + 1); - uri = uri.slice(0, lastPipeIndex); - } - path = uri; - return { - basePath: `${space ? `spaces://${space}` : path}`, - type: uriTypeByString(plugin, space, path, source), - space, - fullPath, - path: removeTrailingSlashFromFolder(uri), - alias, - ref: reference, - refType, - refStr: refTypeChar ? refTypeChar + reference : null, - query - }; -} -var uriTypeByString = (plugin, space, file, source) => { - if ((space == null ? void 0 : space.charAt(0)) == "#") { - return "tag"; - } - if ((space == null ? void 0 : space.length) > 0) { - return "space"; - } - if (file.charAt(file.length - 1) == "/") { - if (file == "/") - return "vault"; - return "folder"; - } - let portalFile; - if (source) { - portalFile = plugin.app.metadataCache.getFirstLinkpathDest(file, source); - } else { - portalFile = plugin.app.vault.getAbstractFileByPath(file); - } - if (portalFile instanceof import_obsidian3.TFolder) { - return "folder"; - } - if (portalFile instanceof import_obsidian3.TFile || file.match(relativeURLRegex)) { - return "file"; - } - if (file.match(urlRegex)) - return "url"; - return "unknown"; -}; - -// node_modules/acorn/dist/acorn.mjs -var astralIdentifierCodes = [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]; -var astralIdentifierStartCodes = [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, 3104, 541, 1507, 4938, 6, 4191]; -var nonASCIIidentifierChars = "\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\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\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"; -var nonASCIIidentifierStartChars = "\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"; -var reservedWords = { - 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" -}; -var ecma5AndLessKeywords = "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"; -var keywords$1 = { - 5: ecma5AndLessKeywords, - "5module": ecma5AndLessKeywords + " export import", - 6: ecma5AndLessKeywords + " const class extends export import super" -}; -var keywordRelationalOperator = /^in(stanceof)?$/; -var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -function isInAstralSet(code, set) { - var pos = 65536; - for (var i4 = 0; i4 < set.length; i4 += 2) { - pos += set[i4]; - if (pos > code) { - return false; - } - pos += set[i4 + 1]; - if (pos >= code) { - return true; - } - } - return false; -} -function isIdentifierStart(code, astral) { - if (code < 65) { - return code === 36; - } - if (code < 91) { - return true; - } - if (code < 97) { - return code === 95; - } - if (code < 123) { - return true; - } - if (code <= 65535) { - return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - if (astral === false) { - return false; - } - return isInAstralSet(code, astralIdentifierStartCodes); -} -function isIdentifierChar(code, astral) { - if (code < 48) { - return code === 36; - } - if (code < 58) { - return true; - } - if (code < 65) { - return false; - } - if (code < 91) { - return true; - } - if (code < 97) { - return code === 95; - } - if (code < 123) { - return true; - } - if (code <= 65535) { - return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); - } - if (astral === false) { - return false; - } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} -var TokenType = function TokenType2(label, conf) { - if (conf === void 0) - conf = {}; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop || null; - this.updateContext = null; -}; -function binop(name, prec) { - return new TokenType(name, { beforeExpr: true, binop: prec }); -} -var beforeExpr = { beforeExpr: true }; -var startsExpr = { startsExpr: true }; -var keywords = {}; -function kw(name, options) { - if (options === void 0) - options = {}; - options.keyword = name; - return keywords[name] = new TokenType(name, options); -} -var types$1 = { - num: new TokenType("num", startsExpr), - regexp: new TokenType("regexp", startsExpr), - string: new TokenType("string", startsExpr), - name: new TokenType("name", startsExpr), - privateId: new TokenType("privateId", startsExpr), - eof: new TokenType("eof"), - bracketL: new TokenType("[", { beforeExpr: true, startsExpr: true }), - bracketR: new TokenType("]"), - braceL: new TokenType("{", { beforeExpr: true, startsExpr: true }), - braceR: new TokenType("}"), - parenL: new TokenType("(", { beforeExpr: true, startsExpr: true }), - parenR: new TokenType(")"), - comma: new TokenType(",", beforeExpr), - semi: new TokenType(";", beforeExpr), - colon: new TokenType(":", beforeExpr), - dot: new TokenType("."), - question: new TokenType("?", beforeExpr), - questionDot: new TokenType("?."), - arrow: new TokenType("=>", beforeExpr), - template: new TokenType("template"), - invalidTemplate: new TokenType("invalidTemplate"), - ellipsis: new TokenType("...", beforeExpr), - backQuote: new TokenType("`", startsExpr), - dollarBraceL: new TokenType("${", { beforeExpr: true, startsExpr: true }), - eq: new TokenType("=", { beforeExpr: true, isAssign: true }), - assign: new TokenType("_=", { beforeExpr: true, isAssign: true }), - incDec: new TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), - prefix: new TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), - logicalOR: binop("||", 1), - logicalAND: binop("&&", 2), - bitwiseOR: binop("|", 3), - bitwiseXOR: binop("^", 4), - bitwiseAND: binop("&", 5), - equality: binop("==/!=/===/!==", 6), - relational: binop("/<=/>=", 7), - bitShift: binop("<>/>>>", 8), - plusMin: new TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), - modulo: binop("%", 10), - star: binop("*", 10), - slash: binop("/", 10), - starstar: new TokenType("**", { beforeExpr: true }), - coalesce: binop("??", 1), - _break: kw("break"), - _case: kw("case", beforeExpr), - _catch: kw("catch"), - _continue: kw("continue"), - _debugger: kw("debugger"), - _default: kw("default", beforeExpr), - _do: kw("do", { isLoop: true, beforeExpr: true }), - _else: kw("else", beforeExpr), - _finally: kw("finally"), - _for: kw("for", { isLoop: true }), - _function: kw("function", startsExpr), - _if: kw("if"), - _return: kw("return", beforeExpr), - _switch: kw("switch"), - _throw: kw("throw", beforeExpr), - _try: kw("try"), - _var: kw("var"), - _const: kw("const"), - _while: kw("while", { isLoop: true }), - _with: kw("with"), - _new: kw("new", { beforeExpr: true, startsExpr: true }), - _this: kw("this", startsExpr), - _super: kw("super", startsExpr), - _class: kw("class", startsExpr), - _extends: kw("extends", beforeExpr), - _export: kw("export"), - _import: kw("import", startsExpr), - _null: kw("null", startsExpr), - _true: kw("true", startsExpr), - _false: kw("false", startsExpr), - _in: kw("in", { beforeExpr: true, binop: 7 }), - _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), - _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), - _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), - _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) -}; -var lineBreak = /\r\n?|\n|\u2028|\u2029/; -var lineBreakG = new RegExp(lineBreak.source, "g"); -function isNewLine(code) { - return code === 10 || code === 13 || code === 8232 || code === 8233; -} -function nextLineBreak(code, from, end) { - if (end === void 0) - end = code.length; - for (var i4 = from; i4 < end; i4++) { - var next = code.charCodeAt(i4); - if (isNewLine(next)) { - return i4 < end - 1 && next === 13 && code.charCodeAt(i4 + 1) === 10 ? i4 + 2 : i4 + 1; - } - } - return -1; -} -var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; -var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -var ref = Object.prototype; -var hasOwnProperty = ref.hasOwnProperty; -var toString = ref.toString; -var hasOwn = Object.hasOwn || function(obj, propName) { - return hasOwnProperty.call(obj, propName); -}; -var isArray = Array.isArray || function(obj) { - return toString.call(obj) === "[object Array]"; -}; -function wordsRegexp(words) { - return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); -} -function codePointToString(code) { - if (code <= 65535) { - return String.fromCharCode(code); - } - code -= 65536; - return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); -} -var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; -var Position = function Position2(line, col) { - this.line = line; - this.column = col; -}; -Position.prototype.offset = function offset(n2) { - return new Position(this.line, this.column + n2); -}; -var SourceLocation = function SourceLocation2(p3, start, end) { - this.start = start; - this.end = end; - if (p3.sourceFile !== null) { - this.source = p3.sourceFile; - } -}; -function getLineInfo(input, offset2) { - for (var line = 1, cur = 0; ; ) { - var nextBreak = nextLineBreak(input, cur, offset2); - if (nextBreak < 0) { - return new Position(line, offset2 - cur); - } - ++line; - cur = nextBreak; - } -} -var defaultOptions = { - ecmaVersion: null, - sourceType: "script", - onInsertedSemicolon: null, - onTrailingComma: null, - allowReserved: null, - allowReturnOutsideFunction: false, - allowImportExportEverywhere: false, - allowAwaitOutsideFunction: null, - allowSuperOutsideMethod: null, - allowHashBang: false, - locations: false, - onToken: null, - onComment: null, - ranges: false, - program: null, - sourceFile: null, - directSourceFile: null, - preserveParens: false -}; -var warnedAboutEcmaVersion = false; -function getOptions(opts) { - var options = {}; - for (var opt in defaultOptions) { - options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; - } - if (options.ecmaVersion === "latest") { - options.ecmaVersion = 1e8; - } else if (options.ecmaVersion == null) { - if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { - warnedAboutEcmaVersion = true; - console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); - } - options.ecmaVersion = 11; - } else if (options.ecmaVersion >= 2015) { - options.ecmaVersion -= 2009; - } - if (options.allowReserved == null) { - options.allowReserved = options.ecmaVersion < 5; - } - if (!opts || opts.allowHashBang == null) { - options.allowHashBang = options.ecmaVersion >= 14; - } - if (isArray(options.onToken)) { - var tokens = options.onToken; - options.onToken = function(token) { - return tokens.push(token); - }; - } - if (isArray(options.onComment)) { - options.onComment = pushComment(options, options.onComment); - } - return options; -} -function pushComment(options, array) { - return function(block, text2, start, end, startLoc, endLoc) { - var comment = { - type: block ? "Block" : "Line", - value: text2, - start, - end - }; - if (options.locations) { - comment.loc = new SourceLocation(this, startLoc, endLoc); - } - if (options.ranges) { - comment.range = [start, end]; - } - array.push(comment); - }; -} -var SCOPE_TOP = 1; -var SCOPE_FUNCTION = 2; -var SCOPE_ASYNC = 4; -var SCOPE_GENERATOR = 8; -var SCOPE_ARROW = 16; -var SCOPE_SIMPLE_CATCH = 32; -var SCOPE_SUPER = 64; -var SCOPE_DIRECT_SUPER = 128; -var SCOPE_CLASS_STATIC_BLOCK = 256; -var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; -function functionFlags(async, generator) { - return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0); -} -var BIND_NONE = 0; -var BIND_VAR = 1; -var BIND_LEXICAL = 2; -var BIND_FUNCTION = 3; -var BIND_SIMPLE_CATCH = 4; -var BIND_OUTSIDE = 5; -var Parser = function Parser2(options, input, startPos) { - this.options = options = getOptions(options); - this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); - var reserved = ""; - if (options.allowReserved !== true) { - reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; - if (options.sourceType === "module") { - reserved += " await"; - } - } - this.reservedWords = wordsRegexp(reserved); - var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; - this.reservedWordsStrict = wordsRegexp(reservedStrict); - this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); - this.input = String(input); - this.containsEsc = false; - if (startPos) { - this.pos = startPos; - this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; - this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; - } - this.type = types$1.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 = true; - this.inModule = options.sourceType === "module"; - this.strict = this.inModule || this.strictDirective(this.pos); - this.potentialArrowAt = -1; - this.potentialArrowInForAwait = false; - this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; - this.labels = []; - this.undefinedExports = /* @__PURE__ */ Object.create(null); - if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { - this.skipLineComment(2); - } - this.scopeStack = []; - this.enterScope(SCOPE_TOP); - this.regexpState = null; - this.privateNameStack = []; -}; -var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } }; -Parser.prototype.parse = function parse() { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node); -}; -prototypeAccessors.inFunction.get = function() { - return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; -}; -prototypeAccessors.inGenerator.get = function() { - return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit; -}; -prototypeAccessors.inAsync.get = function() { - return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit; -}; -prototypeAccessors.canAwait.get = function() { - for (var i4 = this.scopeStack.length - 1; i4 >= 0; i4--) { - var scope = this.scopeStack[i4]; - if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { - return false; - } - if (scope.flags & SCOPE_FUNCTION) { - return (scope.flags & SCOPE_ASYNC) > 0; - } - } - return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; -}; -prototypeAccessors.allowSuper.get = function() { - var ref2 = this.currentThisScope(); - var flags = ref2.flags; - var inClassFieldInit = ref2.inClassFieldInit; - return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; -}; -prototypeAccessors.allowDirectSuper.get = function() { - return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; -}; -prototypeAccessors.treatFunctionsAsVar.get = function() { - return this.treatFunctionsAsVarInScope(this.currentScope()); -}; -prototypeAccessors.allowNewDotTarget.get = function() { - var ref2 = this.currentThisScope(); - var flags = ref2.flags; - var inClassFieldInit = ref2.inClassFieldInit; - return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit; -}; -prototypeAccessors.inClassStaticBlock.get = function() { - return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0; -}; -Parser.extend = function extend() { - var plugins = [], len = arguments.length; - while (len--) - plugins[len] = arguments[len]; - var cls = this; - for (var i4 = 0; i4 < plugins.length; i4++) { - cls = plugins[i4](cls); - } - return cls; -}; -Parser.parse = function parse2(input, options) { - return new this(options, input).parse(); -}; -Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) { - var parser = new this(options, input, pos); - parser.nextToken(); - return parser.parseExpression(); -}; -Parser.tokenizer = function tokenizer(input, options) { - return new this(options, input); -}; -Object.defineProperties(Parser.prototype, prototypeAccessors); -var pp$9 = Parser.prototype; -var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; -pp$9.strictDirective = function(start) { - if (this.options.ecmaVersion < 5) { - return false; - } - for (; ; ) { - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - var match2 = literal.exec(this.input.slice(start)); - if (!match2) { - return false; - } - if ((match2[1] || match2[2]) === "use strict") { - skipWhiteSpace.lastIndex = start + match2[0].length; - var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; - var next = this.input.charAt(end); - return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); - } - start += match2[0].length; - skipWhiteSpace.lastIndex = start; - start += skipWhiteSpace.exec(this.input)[0].length; - if (this.input[start] === ";") { - start++; - } - } -}; -pp$9.eat = function(type) { - if (this.type === type) { - this.next(); - return true; - } else { - return false; - } -}; -pp$9.isContextual = function(name) { - return this.type === types$1.name && this.value === name && !this.containsEsc; -}; -pp$9.eatContextual = function(name) { - if (!this.isContextual(name)) { - return false; - } - this.next(); - return true; -}; -pp$9.expectContextual = function(name) { - if (!this.eatContextual(name)) { - this.unexpected(); - } -}; -pp$9.canInsertSemicolon = function() { - return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); -}; -pp$9.insertSemicolon = function() { - if (this.canInsertSemicolon()) { - if (this.options.onInsertedSemicolon) { - this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); - } - return true; - } -}; -pp$9.semicolon = function() { - if (!this.eat(types$1.semi) && !this.insertSemicolon()) { - this.unexpected(); - } -}; -pp$9.afterTrailingComma = function(tokType, notNext) { - if (this.type === tokType) { - if (this.options.onTrailingComma) { - this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); - } - if (!notNext) { - this.next(); - } - return true; - } -}; -pp$9.expect = function(type) { - this.eat(type) || this.unexpected(); -}; -pp$9.unexpected = function(pos) { - this.raise(pos != null ? pos : this.start, "Unexpected token"); -}; -var DestructuringErrors = function DestructuringErrors2() { - this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; -}; -pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { - if (!refDestructuringErrors) { - return; - } - if (refDestructuringErrors.trailingComma > -1) { - this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); - } - var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { - this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); - } -}; -pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { - if (!refDestructuringErrors) { - return false; - } - var shorthandAssign = refDestructuringErrors.shorthandAssign; - var doubleProto = refDestructuringErrors.doubleProto; - if (!andThrow) { - return shorthandAssign >= 0 || doubleProto >= 0; - } - if (shorthandAssign >= 0) { - this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); - } - if (doubleProto >= 0) { - this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); - } -}; -pp$9.checkYieldAwaitInDefaultParams = function() { - if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { - this.raise(this.yieldPos, "Yield expression cannot be a default value"); - } - if (this.awaitPos) { - this.raise(this.awaitPos, "Await expression cannot be a default value"); - } -}; -pp$9.isSimpleAssignTarget = function(expr) { - if (expr.type === "ParenthesizedExpression") { - return this.isSimpleAssignTarget(expr.expression); - } - return expr.type === "Identifier" || expr.type === "MemberExpression"; -}; -var pp$8 = Parser.prototype; -pp$8.parseTopLevel = function(node) { - var exports = /* @__PURE__ */ Object.create(null); - if (!node.body) { - node.body = []; - } - while (this.type !== types$1.eof) { - var stmt = this.parseStatement(null, true, exports); - node.body.push(stmt); - } - if (this.inModule) { - for (var i4 = 0, list = Object.keys(this.undefinedExports); i4 < list.length; i4 += 1) { - var name = list[i4]; - this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined"); - } - } - this.adaptDirectivePrologue(node.body); - this.next(); - node.sourceType = this.options.sourceType; - return this.finishNode(node, "Program"); -}; -var loopLabel = { kind: "loop" }; -var switchLabel = { kind: "switch" }; -pp$8.isLet = function(context) { - if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { - return false; - } - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - if (nextCh === 91 || nextCh === 92) { - return true; - } - if (context) { - return false; - } - if (nextCh === 123 || nextCh > 55295 && nextCh < 56320) { - return true; - } - if (isIdentifierStart(nextCh, true)) { - var pos = next + 1; - while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { - ++pos; - } - if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { - return true; - } - var ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) { - return true; - } - } - return false; -}; -pp$8.isAsyncFunction = function() { - if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { - return false; - } - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, after; - return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320)); -}; -pp$8.parseStatement = function(context, topLevel, exports) { - var starttype = this.type, node = this.startNode(), kind; - if (this.isLet(context)) { - starttype = types$1._var; - kind = "let"; - } - switch (starttype) { - case types$1._break: - case types$1._continue: - return this.parseBreakContinueStatement(node, starttype.keyword); - case types$1._debugger: - return this.parseDebuggerStatement(node); - case types$1._do: - return this.parseDoStatement(node); - case types$1._for: - return this.parseForStatement(node); - case types$1._function: - if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) { - this.unexpected(); - } - return this.parseFunctionStatement(node, false, !context); - case types$1._class: - if (context) { - this.unexpected(); - } - return this.parseClass(node, true); - case types$1._if: - return this.parseIfStatement(node); - case types$1._return: - return this.parseReturnStatement(node); - case types$1._switch: - return this.parseSwitchStatement(node); - case types$1._throw: - return this.parseThrowStatement(node); - case types$1._try: - return this.parseTryStatement(node); - case types$1._const: - case types$1._var: - kind = kind || this.value; - if (context && kind !== "var") { - this.unexpected(); - } - return this.parseVarStatement(node, kind); - case types$1._while: - return this.parseWhileStatement(node); - case types$1._with: - return this.parseWithStatement(node); - case types$1.braceL: - return this.parseBlock(true, node); - case types$1.semi: - return this.parseEmptyStatement(node); - case types$1._export: - case types$1._import: - if (this.options.ecmaVersion > 10 && starttype === types$1._import) { - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); - if (nextCh === 40 || nextCh === 46) { - return this.parseExpressionStatement(node, this.parseExpression()); - } - } - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) { - this.raise(this.start, "'import' and 'export' may only appear at the top level"); - } - if (!this.inModule) { - this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); - } - } - return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports); - default: - if (this.isAsyncFunction()) { - if (context) { - this.unexpected(); - } - this.next(); - return this.parseFunctionStatement(node, true, !context); - } - var maybeName = this.value, expr = this.parseExpression(); - if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { - return this.parseLabeledStatement(node, maybeName, expr, context); - } else { - return this.parseExpressionStatement(node, expr); - } - } -}; -pp$8.parseBreakContinueStatement = function(node, keyword) { - var isBreak = keyword === "break"; - this.next(); - if (this.eat(types$1.semi) || this.insertSemicolon()) { - node.label = null; - } else if (this.type !== types$1.name) { - this.unexpected(); - } else { - node.label = this.parseIdent(); - this.semicolon(); - } - var i4 = 0; - for (; i4 < this.labels.length; ++i4) { - var lab = this.labels[i4]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) { - break; - } - if (node.label && isBreak) { - break; - } - } - } - if (i4 === this.labels.length) { - this.raise(node.start, "Unsyntactic " + keyword); - } - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); -}; -pp$8.parseDebuggerStatement = function(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); -}; -pp$8.parseDoStatement = function(node) { - this.next(); - this.labels.push(loopLabel); - node.body = this.parseStatement("do"); - this.labels.pop(); - this.expect(types$1._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) { - this.eat(types$1.semi); - } else { - this.semicolon(); - } - return this.finishNode(node, "DoWhileStatement"); -}; -pp$8.parseForStatement = function(node) { - this.next(); - var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; - this.labels.push(loopLabel); - this.enterScope(0); - this.expect(types$1.parenL); - if (this.type === types$1.semi) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, null); - } - var isLet = this.isLet(); - if (this.type === types$1._var || this.type === types$1._const || isLet) { - var init$1 = this.startNode(), kind = isLet ? "let" : this.value; - this.next(); - this.parseVar(init$1, true, kind); - this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$1._in) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - } else { - node.await = awaitAt > -1; - } - } - return this.parseForIn(node, init$1); - } - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init$1); - } - var startsWithLet = this.isContextual("let"), isForOf = false; - var refDestructuringErrors = new DestructuringErrors(); - var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); - if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$1._in) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - } else { - node.await = awaitAt > -1; - } - } - if (startsWithLet && isForOf) { - this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); - } - this.toAssignable(init, false, refDestructuringErrors); - this.checkLValPattern(init); - return this.parseForIn(node, init); - } else { - this.checkExpressionErrors(refDestructuringErrors, true); - } - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init); -}; -pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync); -}; -pp$8.parseIfStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement"); -}; -pp$8.parseReturnStatement = function(node) { - if (!this.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.start, "'return' outside of function"); - } - this.next(); - if (this.eat(types$1.semi) || this.insertSemicolon()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - return this.finishNode(node, "ReturnStatement"); -}; -pp$8.parseSwitchStatement = function(node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(types$1.braceL); - this.labels.push(switchLabel); - this.enterScope(0); - var cur; - for (var sawDefault = false; this.type !== types$1.braceR; ) { - if (this.type === types$1._case || this.type === types$1._default) { - var isCase = this.type === types$1._case; - if (cur) { - this.finishNode(cur, "SwitchCase"); - } - node.cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { - this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); - } - sawDefault = true; - cur.test = null; - } - this.expect(types$1.colon); - } else { - if (!cur) { - this.unexpected(); - } - cur.consequent.push(this.parseStatement(null)); - } - } - this.exitScope(); - if (cur) { - this.finishNode(cur, "SwitchCase"); - } - this.next(); - this.labels.pop(); - return this.finishNode(node, "SwitchStatement"); -}; -pp$8.parseThrowStatement = function(node) { - this.next(); - if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { - this.raise(this.lastTokEnd, "Illegal newline after throw"); - } - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); -}; -var empty$1 = []; -pp$8.parseTryStatement = function(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === types$1._catch) { - var clause = this.startNode(); - this.next(); - if (this.eat(types$1.parenL)) { - clause.param = this.parseBindingAtom(); - var simple = clause.param.type === "Identifier"; - this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); - this.expect(types$1.parenR); - } else { - if (this.options.ecmaVersion < 10) { - this.unexpected(); - } - clause.param = null; - this.enterScope(0); - } - clause.body = this.parseBlock(false); - this.exitScope(); - node.handler = this.finishNode(clause, "CatchClause"); - } - node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) { - this.raise(node.start, "Missing catch or finally clause"); - } - return this.finishNode(node, "TryStatement"); -}; -pp$8.parseVarStatement = function(node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); -}; -pp$8.parseWhileStatement = function(node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel); - node.body = this.parseStatement("while"); - this.labels.pop(); - return this.finishNode(node, "WhileStatement"); -}; -pp$8.parseWithStatement = function(node) { - if (this.strict) { - this.raise(this.start, "'with' in strict mode"); - } - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement("with"); - return this.finishNode(node, "WithStatement"); -}; -pp$8.parseEmptyStatement = function(node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); -}; -pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { - for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { - var label = list[i$1]; - if (label.name === maybeName) { - this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - } - } - var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; - for (var i4 = this.labels.length - 1; i4 >= 0; i4--) { - var label$1 = this.labels[i4]; - if (label$1.statementStart === node.start) { - label$1.statementStart = this.start; - label$1.kind = kind; - } else { - break; - } - } - this.labels.push({ name: maybeName, kind, statementStart: this.start }); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); -}; -pp$8.parseExpressionStatement = function(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); -}; -pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { - if (createNewLexicalScope === void 0) - createNewLexicalScope = true; - if (node === void 0) - node = this.startNode(); - node.body = []; - this.expect(types$1.braceL); - if (createNewLexicalScope) { - this.enterScope(0); - } - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - if (exitStrict) { - this.strict = false; - } - this.next(); - if (createNewLexicalScope) { - this.exitScope(); - } - return this.finishNode(node, "BlockStatement"); -}; -pp$8.parseFor = function(node, init) { - node.init = init; - this.expect(types$1.semi); - node.test = this.type === types$1.semi ? null : this.parseExpression(); - this.expect(types$1.semi); - node.update = this.type === types$1.parenR ? null : this.parseExpression(); - this.expect(types$1.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, "ForStatement"); -}; -pp$8.parseForIn = function(node, init) { - var isForIn = this.type === types$1._in; - this.next(); - if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { - this.raise( - init.start, - (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" - ); - } - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types$1.parenR); - node.body = this.parseStatement("for"); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); -}; -pp$8.parseVar = function(node, isFor, kind) { - node.declarations = []; - node.kind = kind; - for (; ; ) { - var decl = this.startNode(); - this.parseVarId(decl, kind); - if (this.eat(types$1.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { - this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types$1.comma)) { - break; - } - } - return node; -}; -pp$8.parseVarId = function(decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); -}; -var FUNC_STATEMENT = 1; -var FUNC_HANGING_STATEMENT = 2; -var FUNC_NULLABLE_ID = 4; -pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { - this.initFunction(node); - if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { - if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) { - this.unexpected(); - } - node.generator = this.eat(types$1.star); - } - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - if (statement & FUNC_STATEMENT) { - node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent(); - if (node.id && !(statement & FUNC_HANGING_STATEMENT)) { - this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); - } - } - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(node.async, node.generator)); - if (!(statement & FUNC_STATEMENT)) { - node.id = this.type === types$1.name ? this.parseIdent() : null; - } - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false, forInit); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression"); -}; -pp$8.parseFunctionParams = function(node) { - this.expect(types$1.parenL); - node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); -}; -pp$8.parseClass = function(node, isStatement) { - this.next(); - var oldStrict = this.strict; - this.strict = true; - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var privateNameMap = this.enterClassBody(); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(types$1.braceL); - while (this.type !== types$1.braceR) { - var element = this.parseClassElement(node.superClass !== null); - if (element) { - classBody.body.push(element); - if (element.type === "MethodDefinition" && element.kind === "constructor") { - if (hadConstructor) { - this.raise(element.start, "Duplicate constructor in the same class"); - } - hadConstructor = true; - } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { - this.raiseRecoverable(element.key.start, "Identifier '#" + element.key.name + "' has already been declared"); - } - } - } - this.strict = oldStrict; - this.next(); - node.body = this.finishNode(classBody, "ClassBody"); - this.exitClassBody(); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); -}; -pp$8.parseClassElement = function(constructorAllowsSuper) { - if (this.eat(types$1.semi)) { - return null; - } - var ecmaVersion = this.options.ecmaVersion; - var node = this.startNode(); - var keyName = ""; - var isGenerator = false; - var isAsync = false; - var kind = "method"; - var isStatic = false; - if (this.eatContextual("static")) { - if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { - this.parseClassStaticBlock(node); - return node; - } - if (this.isClassElementNameStart() || this.type === types$1.star) { - isStatic = true; - } else { - keyName = "static"; - } - } - node.static = isStatic; - if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { - if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { - isAsync = true; - } else { - keyName = "async"; - } - } - if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { - isGenerator = true; - } - if (!keyName && !isAsync && !isGenerator) { - var lastValue = this.value; - if (this.eatContextual("get") || this.eatContextual("set")) { - if (this.isClassElementNameStart()) { - kind = lastValue; - } else { - keyName = lastValue; - } - } - } - if (keyName) { - node.computed = false; - node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); - node.key.name = keyName; - this.finishNode(node.key, "Identifier"); - } else { - this.parseClassElementName(node); - } - if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { - var isConstructor = !node.static && checkKeyName(node, "constructor"); - var allowsDirectSuper = isConstructor && constructorAllowsSuper; - if (isConstructor && kind !== "method") { - this.raise(node.key.start, "Constructor can't have get/set modifier"); - } - node.kind = isConstructor ? "constructor" : kind; - this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); - } else { - this.parseClassField(node); - } - return node; -}; -pp$8.isClassElementNameStart = function() { - return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword; -}; -pp$8.parseClassElementName = function(element) { - if (this.type === types$1.privateId) { - if (this.value === "constructor") { - this.raise(this.start, "Classes can't have an element named '#constructor'"); - } - element.computed = false; - element.key = this.parsePrivateIdent(); - } else { - this.parsePropertyName(element); - } -}; -pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { - var key2 = method.key; - if (method.kind === "constructor") { - if (isGenerator) { - this.raise(key2.start, "Constructor can't be a generator"); - } - if (isAsync) { - this.raise(key2.start, "Constructor can't be an async method"); - } - } else if (method.static && checkKeyName(method, "prototype")) { - this.raise(key2.start, "Classes may not have a static property named prototype"); - } - var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); - if (method.kind === "get" && value.params.length !== 0) { - this.raiseRecoverable(value.start, "getter should have no params"); - } - if (method.kind === "set" && value.params.length !== 1) { - this.raiseRecoverable(value.start, "setter should have exactly one param"); - } - if (method.kind === "set" && value.params[0].type === "RestElement") { - this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); - } - return this.finishNode(method, "MethodDefinition"); -}; -pp$8.parseClassField = function(field) { - if (checkKeyName(field, "constructor")) { - this.raise(field.key.start, "Classes can't have a field named 'constructor'"); - } else if (field.static && checkKeyName(field, "prototype")) { - this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); - } - if (this.eat(types$1.eq)) { - var scope = this.currentThisScope(); - var inClassFieldInit = scope.inClassFieldInit; - scope.inClassFieldInit = true; - field.value = this.parseMaybeAssign(); - scope.inClassFieldInit = inClassFieldInit; - } else { - field.value = null; - } - this.semicolon(); - return this.finishNode(field, "PropertyDefinition"); -}; -pp$8.parseClassStaticBlock = function(node) { - node.body = []; - var oldLabels = this.labels; - this.labels = []; - this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - this.next(); - this.exitScope(); - this.labels = oldLabels; - return this.finishNode(node, "StaticBlock"); -}; -pp$8.parseClassId = function(node, isStatement) { - if (this.type === types$1.name) { - node.id = this.parseIdent(); - if (isStatement) { - this.checkLValSimple(node.id, BIND_LEXICAL, false); - } - } else { - if (isStatement === true) { - this.unexpected(); - } - node.id = null; - } -}; -pp$8.parseClassSuper = function(node) { - node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; -}; -pp$8.enterClassBody = function() { - var element = { declared: /* @__PURE__ */ Object.create(null), used: [] }; - this.privateNameStack.push(element); - return element.declared; -}; -pp$8.exitClassBody = function() { - var ref2 = this.privateNameStack.pop(); - var declared = ref2.declared; - var used = ref2.used; - var len = this.privateNameStack.length; - var parent = len === 0 ? null : this.privateNameStack[len - 1]; - for (var i4 = 0; i4 < used.length; ++i4) { - var id2 = used[i4]; - if (!hasOwn(declared, id2.name)) { - if (parent) { - parent.used.push(id2); - } else { - this.raiseRecoverable(id2.start, "Private field '#" + id2.name + "' must be declared in an enclosing class"); - } - } - } -}; -function isPrivateNameConflicted(privateNameMap, element) { - var name = element.key.name; - var curr = privateNameMap[name]; - var next = "true"; - if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { - next = (element.static ? "s" : "i") + element.kind; - } - if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { - privateNameMap[name] = "true"; - return false; - } else if (!curr) { - privateNameMap[name] = next; - return false; - } else { - return true; - } -} -function checkKeyName(node, name) { - var computed = node.computed; - var key2 = node.key; - return !computed && (key2.type === "Identifier" && key2.name === name || key2.type === "Literal" && key2.value === name); -} -pp$8.parseExport = function(node, exports) { - this.next(); - if (this.eat(types$1.star)) { - if (this.options.ecmaVersion >= 11) { - if (this.eatContextual("as")) { - node.exported = this.parseModuleExportName(); - this.checkExport(exports, node.exported, this.lastTokStart); - } else { - node.exported = null; - } - } - this.expectContextual("from"); - if (this.type !== types$1.string) { - this.unexpected(); - } - node.source = this.parseExprAtom(); - this.semicolon(); - return this.finishNode(node, "ExportAllDeclaration"); - } - if (this.eat(types$1._default)) { - this.checkExport(exports, "default", this.lastTokStart); - var isAsync; - if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { - var fNode = this.startNode(); - this.next(); - if (isAsync) { - this.next(); - } - node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); - } else if (this.type === types$1._class) { - var cNode = this.startNode(); - node.declaration = this.parseClass(cNode, "nullableID"); - } else { - node.declaration = this.parseMaybeAssign(); - this.semicolon(); - } - return this.finishNode(node, "ExportDefaultDeclaration"); - } - if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(null); - if (node.declaration.type === "VariableDeclaration") { - this.checkVariableExport(exports, node.declaration.declarations); - } else { - this.checkExport(exports, node.declaration.id, node.declaration.id.start); - } - node.specifiers = []; - node.source = null; - } else { - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual("from")) { - if (this.type !== types$1.string) { - this.unexpected(); - } - node.source = this.parseExprAtom(); - } else { - for (var i4 = 0, list = node.specifiers; i4 < list.length; i4 += 1) { - var spec = list[i4]; - this.checkUnreserved(spec.local); - this.checkLocalExport(spec.local); - if (spec.local.type === "Literal") { - this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); - } - } - node.source = null; - } - this.semicolon(); - } - return this.finishNode(node, "ExportNamedDeclaration"); -}; -pp$8.checkExport = function(exports, name, pos) { - if (!exports) { - return; - } - if (typeof name !== "string") { - name = name.type === "Identifier" ? name.name : name.value; - } - if (hasOwn(exports, name)) { - this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); - } - exports[name] = true; -}; -pp$8.checkPatternExport = function(exports, pat) { - var type = pat.type; - if (type === "Identifier") { - this.checkExport(exports, pat, pat.start); - } else if (type === "ObjectPattern") { - for (var i4 = 0, list = pat.properties; i4 < list.length; i4 += 1) { - var prop = list[i4]; - this.checkPatternExport(exports, prop); - } - } else if (type === "ArrayPattern") { - for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { - var elt = list$1[i$1]; - if (elt) { - this.checkPatternExport(exports, elt); - } - } - } else if (type === "Property") { - this.checkPatternExport(exports, pat.value); - } else if (type === "AssignmentPattern") { - this.checkPatternExport(exports, pat.left); - } else if (type === "RestElement") { - this.checkPatternExport(exports, pat.argument); - } else if (type === "ParenthesizedExpression") { - this.checkPatternExport(exports, pat.expression); - } -}; -pp$8.checkVariableExport = function(exports, decls) { - if (!exports) { - return; - } - for (var i4 = 0, list = decls; i4 < list.length; i4 += 1) { - var decl = list[i4]; - this.checkPatternExport(exports, decl.id); - } -}; -pp$8.shouldParseExportStatement = function() { - return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); -}; -pp$8.parseExportSpecifiers = function(exports) { - var nodes = [], first = true; - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { - break; - } - } else { - first = false; - } - var node = this.startNode(); - node.local = this.parseModuleExportName(); - node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; - this.checkExport( - exports, - node.exported, - node.exported.start - ); - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - return nodes; -}; -pp$8.parseImport = function(node) { - this.next(); - if (this.type === types$1.string) { - node.specifiers = empty$1; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual("from"); - node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); -}; -pp$8.parseImportSpecifiers = function() { - var nodes = [], first = true; - if (this.type === types$1.name) { - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLValSimple(node.local, BIND_LEXICAL); - nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types$1.comma)) { - return nodes; - } - } - if (this.type === types$1.star) { - var node$1 = this.startNode(); - this.next(); - this.expectContextual("as"); - node$1.local = this.parseIdent(); - this.checkLValSimple(node$1.local, BIND_LEXICAL); - nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); - return nodes; - } - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { - break; - } - } else { - first = false; - } - var node$2 = this.startNode(); - node$2.imported = this.parseModuleExportName(); - if (this.eatContextual("as")) { - node$2.local = this.parseIdent(); - } else { - this.checkUnreserved(node$2.imported); - node$2.local = node$2.imported; - } - this.checkLValSimple(node$2.local, BIND_LEXICAL); - nodes.push(this.finishNode(node$2, "ImportSpecifier")); - } - return nodes; -}; -pp$8.parseModuleExportName = function() { - if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { - var stringLiteral = this.parseLiteral(this.value); - if (loneSurrogate.test(stringLiteral.value)) { - this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); - } - return stringLiteral; - } - return this.parseIdent(true); -}; -pp$8.adaptDirectivePrologue = function(statements) { - for (var i4 = 0; i4 < statements.length && this.isDirectiveCandidate(statements[i4]); ++i4) { - statements[i4].directive = statements[i4].expression.raw.slice(1, -1); - } -}; -pp$8.isDirectiveCandidate = function(statement) { - return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && (this.input[statement.start] === '"' || this.input[statement.start] === "'"); -}; -var pp$7 = Parser.prototype; -pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case "Identifier": - if (this.inAsync && node.name === "await") { - this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); - } - break; - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - break; - case "ObjectExpression": - node.type = "ObjectPattern"; - if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - for (var i4 = 0, list = node.properties; i4 < list.length; i4 += 1) { - var prop = list[i4]; - this.toAssignable(prop, isBinding); - if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { - this.raise(prop.argument.start, "Unexpected token"); - } - } - break; - case "Property": - if (node.kind !== "init") { - this.raise(node.key.start, "Object pattern can't contain getter or setter"); - } - this.toAssignable(node.value, isBinding); - break; - case "ArrayExpression": - node.type = "ArrayPattern"; - if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - this.toAssignableList(node.elements, isBinding); - break; - case "SpreadElement": - node.type = "RestElement"; - this.toAssignable(node.argument, isBinding); - if (node.argument.type === "AssignmentPattern") { - this.raise(node.argument.start, "Rest elements cannot have a default value"); - } - break; - case "AssignmentExpression": - if (node.operator !== "=") { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); - } - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isBinding); - break; - case "ParenthesizedExpression": - this.toAssignable(node.expression, isBinding, refDestructuringErrors); - break; - case "ChainExpression": - this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); - break; - case "MemberExpression": - if (!isBinding) { - break; - } - default: - this.raise(node.start, "Assigning to rvalue"); - } - } else if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - return node; -}; -pp$7.toAssignableList = function(exprList, isBinding) { - var end = exprList.length; - for (var i4 = 0; i4 < end; i4++) { - var elt = exprList[i4]; - if (elt) { - this.toAssignable(elt, isBinding); - } - } - if (end) { - var last = exprList[end - 1]; - if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { - this.unexpected(last.argument.start); - } - } - return exprList; -}; -pp$7.parseSpread = function(refDestructuringErrors) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refDestructuringErrors); - return this.finishNode(node, "SpreadElement"); -}; -pp$7.parseRestBinding = function() { - var node = this.startNode(); - this.next(); - if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { - this.unexpected(); - } - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement"); -}; -pp$7.parseBindingAtom = function() { - if (this.options.ecmaVersion >= 6) { - switch (this.type) { - case types$1.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(types$1.bracketR, true, true); - return this.finishNode(node, "ArrayPattern"); - case types$1.braceL: - return this.parseObj(true); - } - } - return this.parseIdent(); -}; -pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { - var elts = [], first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types$1.comma); - } - if (allowEmpty && this.type === types$1.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } else if (this.type === types$1.ellipsis) { - var rest = this.parseRestBinding(); - this.parseBindingListItem(rest); - elts.push(rest); - if (this.type === types$1.comma) { - this.raise(this.start, "Comma is not permitted after the rest element"); - } - this.expect(close); - break; - } else { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - elts.push(elem); - } - } - return elts; -}; -pp$7.parseBindingListItem = function(param) { - return param; -}; -pp$7.parseMaybeDefault = function(startPos, startLoc, left) { - left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { - return left; - } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern"); -}; -pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { - if (bindingType === void 0) - bindingType = BIND_NONE; - var isBind = bindingType !== BIND_NONE; - switch (expr.type) { - case "Identifier": - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { - this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); - } - if (isBind) { - if (bindingType === BIND_LEXICAL && expr.name === "let") { - this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); - } - if (checkClashes) { - if (hasOwn(checkClashes, expr.name)) { - this.raiseRecoverable(expr.start, "Argument name clash"); - } - checkClashes[expr.name] = true; - } - if (bindingType !== BIND_OUTSIDE) { - this.declareName(expr.name, bindingType, expr.start); - } - } - break; - case "ChainExpression": - this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); - break; - case "MemberExpression": - if (isBind) { - this.raiseRecoverable(expr.start, "Binding member expression"); - } - break; - case "ParenthesizedExpression": - if (isBind) { - this.raiseRecoverable(expr.start, "Binding parenthesized expression"); - } - return this.checkLValSimple(expr.expression, bindingType, checkClashes); - default: - this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); - } -}; -pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { - if (bindingType === void 0) - bindingType = BIND_NONE; - switch (expr.type) { - case "ObjectPattern": - for (var i4 = 0, list = expr.properties; i4 < list.length; i4 += 1) { - var prop = list[i4]; - this.checkLValInnerPattern(prop, bindingType, checkClashes); - } - break; - case "ArrayPattern": - for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { - var elem = list$1[i$1]; - if (elem) { - this.checkLValInnerPattern(elem, bindingType, checkClashes); - } - } - break; - default: - this.checkLValSimple(expr, bindingType, checkClashes); - } -}; -pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { - if (bindingType === void 0) - bindingType = BIND_NONE; - switch (expr.type) { - case "Property": - this.checkLValInnerPattern(expr.value, bindingType, checkClashes); - break; - case "AssignmentPattern": - this.checkLValPattern(expr.left, bindingType, checkClashes); - break; - case "RestElement": - this.checkLValPattern(expr.argument, bindingType, checkClashes); - break; - default: - this.checkLValPattern(expr, bindingType, checkClashes); - } -}; -var TokContext = function TokContext2(token, isExpr, preserveSpace, override, generator) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; -}; -var types = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", false), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function(p3) { - return p3.tryReadTemplateToken(); - }), - f_stat: new TokContext("function", false), - f_expr: new TokContext("function", true), - f_expr_gen: new TokContext("function", true, false, null, true), - f_gen: new TokContext("function", false, false, null, true) -}; -var pp$6 = Parser.prototype; -pp$6.initialContext = function() { - return [types.b_stat]; -}; -pp$6.curContext = function() { - return this.context[this.context.length - 1]; -}; -pp$6.braceIsBlock = function(prevType) { - var parent = this.curContext(); - if (parent === types.f_expr || parent === types.f_stat) { - return true; - } - if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) { - return !parent.isExpr; - } - if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { - return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); - } - if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { - return true; - } - if (prevType === types$1.braceL) { - return parent === types.b_stat; - } - if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { - return false; - } - return !this.exprAllowed; -}; -pp$6.inGeneratorContext = function() { - for (var i4 = this.context.length - 1; i4 >= 1; i4--) { - var context = this.context[i4]; - if (context.token === "function") { - return context.generator; - } - } - return false; -}; -pp$6.updateContext = function(prevType) { - var update, type = this.type; - if (type.keyword && prevType === types$1.dot) { - this.exprAllowed = false; - } else if (update = type.updateContext) { - update.call(this, prevType); - } else { - this.exprAllowed = type.beforeExpr; - } -}; -pp$6.overrideContext = function(tokenCtx) { - if (this.curContext() !== tokenCtx) { - this.context[this.context.length - 1] = tokenCtx; - } -}; -types$1.parenR.updateContext = types$1.braceR.updateContext = function() { - if (this.context.length === 1) { - this.exprAllowed = true; - return; - } - var out = this.context.pop(); - if (out === types.b_stat && this.curContext().token === "function") { - out = this.context.pop(); - } - this.exprAllowed = !out.isExpr; -}; -types$1.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); - this.exprAllowed = true; -}; -types$1.dollarBraceL.updateContext = function() { - this.context.push(types.b_tmpl); - this.exprAllowed = true; -}; -types$1.parenL.updateContext = function(prevType) { - var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; - this.context.push(statementParens ? types.p_stat : types.p_expr); - this.exprAllowed = true; -}; -types$1.incDec.updateContext = function() { -}; -types$1._function.updateContext = types$1._class.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) { - this.context.push(types.f_expr); - } else { - this.context.push(types.f_stat); - } - this.exprAllowed = false; -}; -types$1.backQuote.updateContext = function() { - if (this.curContext() === types.q_tmpl) { - this.context.pop(); - } else { - this.context.push(types.q_tmpl); - } - this.exprAllowed = false; -}; -types$1.star.updateContext = function(prevType) { - if (prevType === types$1._function) { - var index = this.context.length - 1; - if (this.context[index] === types.f_expr) { - this.context[index] = types.f_expr_gen; - } else { - this.context[index] = types.f_gen; - } - } - this.exprAllowed = true; -}; -types$1.name.updateContext = function(prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { - if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { - allowed = true; - } - } - this.exprAllowed = allowed; -}; -var pp$5 = Parser.prototype; -pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { - if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { - return; - } - if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { - return; - } - var key2 = prop.key; - var name; - switch (key2.type) { - case "Identifier": - name = key2.name; - break; - case "Literal": - name = String(key2.value); - break; - default: - return; - } - var kind = prop.kind; - if (this.options.ecmaVersion >= 6) { - if (name === "__proto__" && kind === "init") { - if (propHash.proto) { - if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) { - refDestructuringErrors.doubleProto = key2.start; - } - } else { - this.raiseRecoverable(key2.start, "Redefinition of __proto__ property"); - } - } - propHash.proto = true; - } - return; - } - name = "$" + name; - var other = propHash[name]; - if (other) { - var redefinition; - if (kind === "init") { - redefinition = this.strict && other.init || other.get || other.set; - } else { - redefinition = other.init || other[kind]; - } - if (redefinition) { - this.raiseRecoverable(key2.start, "Redefinition of property"); - } - } else { - other = propHash[name] = { - init: false, - get: false, - set: false - }; - } - other[kind] = true; -}; -pp$5.parseExpression = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types$1.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(types$1.comma)) { - node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); - } - return this.finishNode(node, "SequenceExpression"); - } - return expr; -}; -pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { - if (this.isContextual("yield")) { - if (this.inGenerator) { - return this.parseYield(forInit); - } else { - this.exprAllowed = false; - } - } - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; - if (refDestructuringErrors) { - oldParenAssign = refDestructuringErrors.parenthesizedAssign; - oldTrailingComma = refDestructuringErrors.trailingComma; - oldDoubleProto = refDestructuringErrors.doubleProto; - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; - } else { - refDestructuringErrors = new DestructuringErrors(); - ownDestructuringErrors = true; - } - var startPos = this.start, startLoc = this.startLoc; - if (this.type === types$1.parenL || this.type === types$1.name) { - this.potentialArrowAt = this.start; - this.potentialArrowInForAwait = forInit === "await"; - } - var left = this.parseMaybeConditional(forInit, refDestructuringErrors); - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - if (this.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - if (this.type === types$1.eq) { - left = this.toAssignable(left, false, refDestructuringErrors); - } - if (!ownDestructuringErrors) { - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; - } - if (refDestructuringErrors.shorthandAssign >= left.start) { - refDestructuringErrors.shorthandAssign = -1; - } - if (this.type === types$1.eq) { - this.checkLValPattern(left); - } else { - this.checkLValSimple(left); - } - node.left = left; - this.next(); - node.right = this.parseMaybeAssign(forInit); - if (oldDoubleProto > -1) { - refDestructuringErrors.doubleProto = oldDoubleProto; - } - return this.finishNode(node, "AssignmentExpression"); - } else { - if (ownDestructuringErrors) { - this.checkExpressionErrors(refDestructuringErrors, true); - } - } - if (oldParenAssign > -1) { - refDestructuringErrors.parenthesizedAssign = oldParenAssign; - } - if (oldTrailingComma > -1) { - refDestructuringErrors.trailingComma = oldTrailingComma; - } - return left; -}; -pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprOps(forInit, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - if (this.eat(types$1.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(types$1.colon); - node.alternate = this.parseMaybeAssign(forInit); - return this.finishNode(node, "ConditionalExpression"); - } - return expr; -}; -pp$5.parseExprOps = function(forInit, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); -}; -pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { - var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types$1._in)) { - if (prec > minPrec) { - var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; - var coalesce = this.type === types$1.coalesce; - if (coalesce) { - prec = types$1.logicalAND.binop; - } - var op = this.value; - this.next(); - var startPos = this.start, startLoc = this.startLoc; - var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); - var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) { - this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); - } - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); - } - } - return left; -}; -pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { - if (right.type === "PrivateIdentifier") { - this.raise(right.start, "Private identifier can only be left side of binary expression"); - } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.operator = op; - node.right = right; - return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); -}; -pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { - var startPos = this.start, startLoc = this.startLoc, expr; - if (this.isContextual("await") && this.canAwait) { - expr = this.parseAwait(forInit); - sawUnary = true; - } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === types$1.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(null, true, update, forInit); - this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { - this.checkLValSimple(node.argument); - } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { - this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); - } else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) { - this.raiseRecoverable(node.start, "Private fields can not be deleted"); - } else { - sawUnary = true; - } - expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } else if (!sawUnary && this.type === types$1.privateId) { - if (forInit || this.privateNameStack.length === 0) { - this.unexpected(); - } - expr = this.parsePrivateIdent(); - if (this.type !== types$1._in) { - this.unexpected(); - } - } else { - expr = this.parseExprSubscripts(refDestructuringErrors, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - while (this.type.postfix && !this.canInsertSemicolon()) { - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.operator = this.value; - node$1.prefix = false; - node$1.argument = expr; - this.checkLValSimple(expr); - this.next(); - expr = this.finishNode(node$1, "UpdateExpression"); - } - } - if (!incDec && this.eat(types$1.starstar)) { - if (sawUnary) { - this.unexpected(this.lastTokStart); - } else { - return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false); - } - } else { - return expr; - } -}; -function isPrivateFieldAccess(node) { - return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression); -} -pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { - var startPos = this.start, startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors, forInit); - if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { - return expr; - } - var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); - if (refDestructuringErrors && result.type === "MemberExpression") { - if (refDestructuringErrors.parenthesizedAssign >= result.start) { - refDestructuringErrors.parenthesizedAssign = -1; - } - if (refDestructuringErrors.parenthesizedBind >= result.start) { - refDestructuringErrors.parenthesizedBind = -1; - } - if (refDestructuringErrors.trailingComma >= result.start) { - refDestructuringErrors.trailingComma = -1; - } - } - return result; -}; -pp$5.parseSubscripts = function(base2, startPos, startLoc, noCalls, forInit) { - var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base2.type === "Identifier" && base2.name === "async" && this.lastTokEnd === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && this.potentialArrowAt === base2.start; - var optionalChained = false; - while (true) { - var element = this.parseSubscript(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); - if (element.optional) { - optionalChained = true; - } - if (element === base2 || element.type === "ArrowFunctionExpression") { - if (optionalChained) { - var chainNode = this.startNodeAt(startPos, startLoc); - chainNode.expression = element; - element = this.finishNode(chainNode, "ChainExpression"); - } - return element; - } - base2 = element; - } -}; -pp$5.parseSubscript = function(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { - var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types$1.questionDot); - if (noCalls && optional) { - this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); - } - var computed = this.eat(types$1.bracketL); - if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base2; - if (computed) { - node.property = this.parseExpression(); - this.expect(types$1.bracketR); - } else if (this.type === types$1.privateId && base2.type !== "Super") { - node.property = this.parsePrivateIdent(); - } else { - node.property = this.parseIdent(this.options.allowReserved !== "never"); - } - node.computed = !!computed; - if (optionalSupported) { - node.optional = optional; - } - base2 = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(types$1.parenL)) { - var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) { - this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); - } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.callee = base2; - node$1.arguments = exprList; - if (optionalSupported) { - node$1.optional = optional; - } - base2 = this.finishNode(node$1, "CallExpression"); - } else if (this.type === types$1.backQuote) { - if (optional || optionalChained) { - this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); - } - var node$2 = this.startNodeAt(startPos, startLoc); - node$2.tag = base2; - node$2.quasi = this.parseTemplate({ isTagged: true }); - base2 = this.finishNode(node$2, "TaggedTemplateExpression"); - } - return base2; -}; -pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { - if (this.type === types$1.slash) { - this.readRegexp(); - } - var node, canBeArrow = this.potentialArrowAt === this.start; - switch (this.type) { - case types$1._super: - if (!this.allowSuper) { - this.raise(this.start, "'super' keyword outside a method"); - } - node = this.startNode(); - this.next(); - if (this.type === types$1.parenL && !this.allowDirectSuper) { - this.raise(node.start, "super() call outside constructor of a subclass"); - } - if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { - this.unexpected(); - } - return this.finishNode(node, "Super"); - case types$1._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression"); - case types$1.name: - var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; - var id2 = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id2.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { - this.overrideContext(types.f_expr); - return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); - } - if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types$1.arrow)) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id2], false, forInit); - } - if (this.options.ecmaVersion >= 8 && id2.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { - id2 = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { - this.unexpected(); - } - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id2], true, forInit); - } - } - return id2; - case types$1.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = { pattern: value.pattern, flags: value.flags }; - return node; - case types$1.num: - case types$1.string: - return this.parseLiteral(this.value); - case types$1._null: - case types$1._true: - case types$1._false: - node = this.startNode(); - node.value = this.type === types$1._null ? null : this.type === types$1._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, "Literal"); - case types$1.parenL: - var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); - if (refDestructuringErrors) { - if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { - refDestructuringErrors.parenthesizedAssign = start; - } - if (refDestructuringErrors.parenthesizedBind < 0) { - refDestructuringErrors.parenthesizedBind = start; - } - } - return expr; - case types$1.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); - return this.finishNode(node, "ArrayExpression"); - case types$1.braceL: - this.overrideContext(types.b_expr); - return this.parseObj(false, refDestructuringErrors); - case types$1._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, 0); - case types$1._class: - return this.parseClass(this.startNode(), false); - case types$1._new: - return this.parseNew(); - case types$1.backQuote: - return this.parseTemplate(); - case types$1._import: - if (this.options.ecmaVersion >= 11) { - return this.parseExprImport(); - } else { - return this.unexpected(); - } - default: - this.unexpected(); - } -}; -pp$5.parseExprImport = function() { - var node = this.startNode(); - if (this.containsEsc) { - this.raiseRecoverable(this.start, "Escape sequence in keyword import"); - } - var meta = this.parseIdent(true); - switch (this.type) { - case types$1.parenL: - return this.parseDynamicImport(node); - case types$1.dot: - node.meta = meta; - return this.parseImportMeta(node); - default: - this.unexpected(); - } -}; -pp$5.parseDynamicImport = function(node) { - this.next(); - node.source = this.parseMaybeAssign(); - if (!this.eat(types$1.parenR)) { - var errorPos = this.start; - if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { - this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); - } else { - this.unexpected(errorPos); - } - } - return this.finishNode(node, "ImportExpression"); -}; -pp$5.parseImportMeta = function(node) { - this.next(); - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== "meta") { - this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); - } - if (containsEsc) { - this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); - } - if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { - this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); - } - return this.finishNode(node, "MetaProperty"); -}; -pp$5.parseLiteral = function(value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) { - node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); - } - this.next(); - return this.finishNode(node, "Literal"); -}; -pp$5.parseParenExpression = function() { - this.expect(types$1.parenL); - var val = this.parseExpression(); - this.expect(types$1.parenR); - return val; -}; -pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { - var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; - if (this.options.ecmaVersion >= 6) { - this.next(); - var innerStartPos = this.start, innerStartLoc = this.startLoc; - var exprList = [], first = true, lastIsComma = false; - var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; - this.yieldPos = 0; - this.awaitPos = 0; - while (this.type !== types$1.parenR) { - first ? first = false : this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { - lastIsComma = true; - break; - } else if (this.type === types$1.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types$1.comma) { - this.raise(this.start, "Comma is not permitted after the rest element"); - } - break; - } else { - exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); - } - } - var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; - this.expect(types$1.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList, forInit); - } - if (!exprList.length || lastIsComma) { - this.unexpected(this.lastTokStart); - } - if (spreadStart) { - this.unexpected(spreadStart); - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } - if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, "ParenthesizedExpression"); - } else { - return val; - } -}; -pp$5.parseParenItem = function(item) { - return item; -}; -pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); -}; -var empty = []; -pp$5.parseNew = function() { - if (this.containsEsc) { - this.raiseRecoverable(this.start, "Escape sequence in keyword new"); - } - var node = this.startNode(); - var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { - node.meta = meta; - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== "target") { - this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); - } - if (containsEsc) { - this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); - } - if (!this.allowNewDotTarget) { - this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); - } - return this.finishNode(node, "MetaProperty"); - } - var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; - node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); - if (isImport && node.callee.type === "ImportExpression") { - this.raise(startPos, "Cannot use new with import()"); - } - if (this.eat(types$1.parenL)) { - node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); - } else { - node.arguments = empty; - } - return this.finishNode(node, "NewExpression"); -}; -pp$5.parseTemplateElement = function(ref2) { - var isTagged = ref2.isTagged; - var elem = this.startNode(); - if (this.type === types$1.invalidTemplate) { - if (!isTagged) { - this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); - } - elem.value = { - raw: this.value, - cooked: null - }; - } else { - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), - cooked: this.value - }; - } - this.next(); - elem.tail = this.type === types$1.backQuote; - return this.finishNode(elem, "TemplateElement"); -}; -pp$5.parseTemplate = function(ref2) { - if (ref2 === void 0) - ref2 = {}; - var isTagged = ref2.isTagged; - if (isTagged === void 0) - isTagged = false; - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement({ isTagged }); - node.quasis = [curElt]; - while (!curElt.tail) { - if (this.type === types$1.eof) { - this.raise(this.pos, "Unterminated template literal"); - } - this.expect(types$1.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(types$1.braceR); - node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); - } - this.next(); - return this.finishNode(node, "TemplateLiteral"); -}; -pp$5.isAsyncProp = function(prop) { - return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); -}; -pp$5.parseObj = function(isPattern, refDestructuringErrors) { - var node = this.startNode(), first = true, propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { - break; - } - } else { - first = false; - } - var prop = this.parseProperty(isPattern, refDestructuringErrors); - if (!isPattern) { - this.checkPropClash(prop, propHash, refDestructuringErrors); - } - node.properties.push(prop); - } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); -}; -pp$5.parseProperty = function(isPattern, refDestructuringErrors) { - var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { - if (isPattern) { - prop.argument = this.parseIdent(false); - if (this.type === types$1.comma) { - this.raise(this.start, "Comma is not permitted after the rest element"); - } - return this.finishNode(prop, "RestElement"); - } - prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); - if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { - refDestructuringErrors.trailingComma = this.start; - } - return this.finishNode(prop, "SpreadElement"); - } - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - if (isPattern || refDestructuringErrors) { - startPos = this.start; - startLoc = this.startLoc; - } - if (!isPattern) { - isGenerator = this.eat(types$1.star); - } - } - var containsEsc = this.containsEsc; - this.parsePropertyName(prop); - if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); - this.parsePropertyName(prop); - } else { - isAsync = false; - } - this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); - return this.finishNode(prop, "Property"); -}; -pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { - if ((isGenerator || isAsync) && this.type === types$1.colon) { - this.unexpected(); - } - if (this.eat(types$1.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); - prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { - if (isPattern) { - this.unexpected(); - } - prop.kind = "init"; - prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { - if (isGenerator || isAsync) { - this.unexpected(); - } - prop.kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - var paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { - var start = prop.value.start; - if (prop.kind === "get") { - this.raiseRecoverable(start, "getter should have no params"); - } else { - this.raiseRecoverable(start, "setter should have exactly one param"); - } - } else { - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { - this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); - } - } - } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { - if (isGenerator || isAsync) { - this.unexpected(); - } - this.checkUnreserved(prop.key); - if (prop.key.name === "await" && !this.awaitIdentPos) { - this.awaitIdentPos = startPos; - } - prop.kind = "init"; - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else if (this.type === types$1.eq && refDestructuringErrors) { - if (refDestructuringErrors.shorthandAssign < 0) { - refDestructuringErrors.shorthandAssign = this.start; - } - prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); - } else { - prop.value = this.copyNode(prop.key); - } - prop.shorthand = true; - } else { - this.unexpected(); - } -}; -pp$5.parsePropertyName = function(prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(types$1.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(types$1.bracketR); - return prop.key; - } else { - prop.computed = false; - } - } - return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); -}; -pp$5.initFunction = function(node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { - node.generator = node.expression = false; - } - if (this.options.ecmaVersion >= 8) { - node.async = false; - } -}; -pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { - var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.initFunction(node); - if (this.options.ecmaVersion >= 6) { - node.generator = isGenerator; - } - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.expect(types$1.parenL); - node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true, false); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "FunctionExpression"); -}; -pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { - var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); - this.initFunction(node); - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false, forInit); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, "ArrowFunctionExpression"); -}; -pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { - var isExpression = isArrowFunction && this.type !== types$1.braceL; - var oldStrict = this.strict, useStrict = false; - if (isExpression) { - node.body = this.parseMaybeAssign(forInit); - node.expression = true; - this.checkParams(node, false); - } else { - var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.end); - if (useStrict && nonSimple) { - this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); - } - } - var oldLabels = this.labels; - this.labels = []; - if (useStrict) { - this.strict = true; - } - this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); - if (this.strict && node.id) { - this.checkLValSimple(node.id, BIND_OUTSIDE); - } - node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); - node.expression = false; - this.adaptDirectivePrologue(node.body.body); - this.labels = oldLabels; - } - this.exitScope(); -}; -pp$5.isSimpleParamList = function(params) { - for (var i4 = 0, list = params; i4 < list.length; i4 += 1) { - var param = list[i4]; - if (param.type !== "Identifier") { - return false; - } - } - return true; -}; -pp$5.checkParams = function(node, allowDuplicates) { - var nameHash = /* @__PURE__ */ Object.create(null); - for (var i4 = 0, list = node.params; i4 < list.length; i4 += 1) { - var param = list[i4]; - this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); - } -}; -pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { - var elts = [], first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } - } else { - first = false; - } - var elt = void 0; - if (allowEmpty && this.type === types$1.comma) { - elt = null; - } else if (this.type === types$1.ellipsis) { - elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { - refDestructuringErrors.trailingComma = this.start; - } - } else { - elt = this.parseMaybeAssign(false, refDestructuringErrors); - } - elts.push(elt); - } - return elts; -}; -pp$5.checkUnreserved = function(ref2) { - var start = ref2.start; - var end = ref2.end; - var name = ref2.name; - if (this.inGenerator && name === "yield") { - this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); - } - if (this.inAsync && name === "await") { - this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); - } - if (this.currentThisScope().inClassFieldInit && name === "arguments") { - this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); - } - if (this.inClassStaticBlock && (name === "arguments" || name === "await")) { - this.raise(start, "Cannot use " + name + " in class static initialization block"); - } - if (this.keywords.test(name)) { - this.raise(start, "Unexpected keyword '" + name + "'"); - } - if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) { - return; - } - var re = this.strict ? this.reservedWordsStrict : this.reservedWords; - if (re.test(name)) { - if (!this.inAsync && name === "await") { - this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); - } - this.raiseRecoverable(start, "The keyword '" + name + "' is reserved"); - } -}; -pp$5.parseIdent = function(liberal) { - var node = this.startNode(); - if (this.type === types$1.name) { - node.name = this.value; - } else if (this.type.keyword) { - node.name = this.type.keyword; - if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { - this.context.pop(); - } - } else { - this.unexpected(); - } - this.next(!!liberal); - this.finishNode(node, "Identifier"); - if (!liberal) { - this.checkUnreserved(node); - if (node.name === "await" && !this.awaitIdentPos) { - this.awaitIdentPos = node.start; - } - } - return node; -}; -pp$5.parsePrivateIdent = function() { - var node = this.startNode(); - if (this.type === types$1.privateId) { - node.name = this.value; - } else { - this.unexpected(); - } - this.next(); - this.finishNode(node, "PrivateIdentifier"); - if (this.privateNameStack.length === 0) { - this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); - } else { - this.privateNameStack[this.privateNameStack.length - 1].used.push(node); - } - return node; -}; -pp$5.parseYield = function(forInit) { - if (!this.yieldPos) { - this.yieldPos = this.start; - } - var node = this.startNode(); - this.next(); - if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types$1.star); - node.argument = this.parseMaybeAssign(forInit); - } - return this.finishNode(node, "YieldExpression"); -}; -pp$5.parseAwait = function(forInit) { - if (!this.awaitPos) { - this.awaitPos = this.start; - } - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeUnary(null, true, false, forInit); - return this.finishNode(node, "AwaitExpression"); -}; -var pp$4 = Parser.prototype; -pp$4.raise = function(pos, message) { - var loc = getLineInfo(this.input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - var err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; - err.raisedAt = this.pos; - throw err; -}; -pp$4.raiseRecoverable = pp$4.raise; -pp$4.curPosition = function() { - if (this.options.locations) { - return new Position(this.curLine, this.pos - this.lineStart); - } -}; -var pp$3 = Parser.prototype; -var Scope = function Scope2(flags) { - this.flags = flags; - this.var = []; - this.lexical = []; - this.functions = []; - this.inClassFieldInit = false; -}; -pp$3.enterScope = function(flags) { - this.scopeStack.push(new Scope(flags)); -}; -pp$3.exitScope = function() { - this.scopeStack.pop(); -}; -pp$3.treatFunctionsAsVarInScope = function(scope) { - return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP; -}; -pp$3.declareName = function(name, bindingType, pos) { - var redeclared = false; - if (bindingType === BIND_LEXICAL) { - var scope = this.currentScope(); - redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; - scope.lexical.push(name); - if (this.inModule && scope.flags & SCOPE_TOP) { - delete this.undefinedExports[name]; - } - } else if (bindingType === BIND_SIMPLE_CATCH) { - var scope$1 = this.currentScope(); - scope$1.lexical.push(name); - } else if (bindingType === BIND_FUNCTION) { - var scope$2 = this.currentScope(); - if (this.treatFunctionsAsVar) { - redeclared = scope$2.lexical.indexOf(name) > -1; - } else { - redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; - } - scope$2.functions.push(name); - } else { - for (var i4 = this.scopeStack.length - 1; i4 >= 0; --i4) { - var scope$3 = this.scopeStack[i4]; - if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { - redeclared = true; - break; - } - scope$3.var.push(name); - if (this.inModule && scope$3.flags & SCOPE_TOP) { - delete this.undefinedExports[name]; - } - if (scope$3.flags & SCOPE_VAR) { - break; - } - } - } - if (redeclared) { - this.raiseRecoverable(pos, "Identifier '" + name + "' has already been declared"); - } -}; -pp$3.checkLocalExport = function(id2) { - if (this.scopeStack[0].lexical.indexOf(id2.name) === -1 && this.scopeStack[0].var.indexOf(id2.name) === -1) { - this.undefinedExports[id2.name] = id2; - } -}; -pp$3.currentScope = function() { - return this.scopeStack[this.scopeStack.length - 1]; -}; -pp$3.currentVarScope = function() { - for (var i4 = this.scopeStack.length - 1; ; i4--) { - var scope = this.scopeStack[i4]; - if (scope.flags & SCOPE_VAR) { - return scope; - } - } -}; -pp$3.currentThisScope = function() { - for (var i4 = this.scopeStack.length - 1; ; i4--) { - var scope = this.scopeStack[i4]; - if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { - return scope; - } - } -}; -var Node = function Node2(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - if (parser.options.locations) { - this.loc = new SourceLocation(parser, loc); - } - if (parser.options.directSourceFile) { - this.sourceFile = parser.options.directSourceFile; - } - if (parser.options.ranges) { - this.range = [pos, 0]; - } -}; -var pp$2 = Parser.prototype; -pp$2.startNode = function() { - return new Node(this, this.start, this.startLoc); -}; -pp$2.startNodeAt = function(pos, loc) { - return new Node(this, pos, loc); -}; -function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - if (this.options.locations) { - node.loc.end = loc; - } - if (this.options.ranges) { - node.range[1] = pos; - } - return node; -} -pp$2.finishNode = function(node, type) { - return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); -}; -pp$2.finishNodeAt = function(node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc); -}; -pp$2.copyNode = function(node) { - var newNode = new Node(this, node.start, this.startLoc); - for (var prop in node) { - newNode[prop] = node[prop]; - } - return newNode; -}; -var ecma9BinaryProperties = "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"; -var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; -var ecma11BinaryProperties = ecma10BinaryProperties; -var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; -var ecma13BinaryProperties = ecma12BinaryProperties; -var ecma14BinaryProperties = ecma13BinaryProperties; -var unicodeBinaryProperties = { - 9: ecma9BinaryProperties, - 10: ecma10BinaryProperties, - 11: ecma11BinaryProperties, - 12: ecma12BinaryProperties, - 13: ecma13BinaryProperties, - 14: ecma14BinaryProperties -}; -var unicodeGeneralCategoryValues = "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"; -var ecma9ScriptValues = "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"; -var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; -var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; -var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; -var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; -var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm"; -var unicodeScriptValues = { - 9: ecma9ScriptValues, - 10: ecma10ScriptValues, - 11: ecma11ScriptValues, - 12: ecma12ScriptValues, - 13: ecma13ScriptValues, - 14: ecma14ScriptValues -}; -var data = {}; -function buildUnicodeData(ecmaVersion) { - var d5 = data[ecmaVersion] = { - binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), - nonBinary: { - General_Category: wordsRegexp(unicodeGeneralCategoryValues), - Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) - } - }; - d5.nonBinary.Script_Extensions = d5.nonBinary.Script; - d5.nonBinary.gc = d5.nonBinary.General_Category; - d5.nonBinary.sc = d5.nonBinary.Script; - d5.nonBinary.scx = d5.nonBinary.Script_Extensions; -} -for (i4 = 0, list = [9, 10, 11, 12, 13, 14]; i4 < list.length; i4 += 1) { - ecmaVersion = list[i4]; - buildUnicodeData(ecmaVersion); -} -var ecmaVersion; -var i4; -var list; -var pp$1 = Parser.prototype; -var RegExpValidationState = function RegExpValidationState2(parser) { - this.parser = parser; - this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; - this.source = ""; - this.flags = ""; - this.start = 0; - this.switchU = false; - this.switchN = false; - this.pos = 0; - this.lastIntValue = 0; - this.lastStringValue = ""; - this.lastAssertionIsQuantifiable = false; - this.numCapturingParens = 0; - this.maxBackReference = 0; - this.groupNames = []; - this.backReferenceNames = []; -}; -RegExpValidationState.prototype.reset = function reset(start, pattern, flags) { - var unicode = flags.indexOf("u") !== -1; - this.start = start | 0; - this.source = pattern + ""; - this.flags = flags; - this.switchU = unicode && this.parser.options.ecmaVersion >= 6; - this.switchN = unicode && this.parser.options.ecmaVersion >= 9; -}; -RegExpValidationState.prototype.raise = function raise(message) { - this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); -}; -RegExpValidationState.prototype.at = function at(i4, forceU) { - if (forceU === void 0) - forceU = false; - var s5 = this.source; - var l3 = s5.length; - if (i4 >= l3) { - return -1; - } - var c4 = s5.charCodeAt(i4); - if (!(forceU || this.switchU) || c4 <= 55295 || c4 >= 57344 || i4 + 1 >= l3) { - return c4; - } - var next = s5.charCodeAt(i4 + 1); - return next >= 56320 && next <= 57343 ? (c4 << 10) + next - 56613888 : c4; -}; -RegExpValidationState.prototype.nextIndex = function nextIndex(i4, forceU) { - if (forceU === void 0) - forceU = false; - var s5 = this.source; - var l3 = s5.length; - if (i4 >= l3) { - return l3; - } - var c4 = s5.charCodeAt(i4), next; - if (!(forceU || this.switchU) || c4 <= 55295 || c4 >= 57344 || i4 + 1 >= l3 || (next = s5.charCodeAt(i4 + 1)) < 56320 || next > 57343) { - return i4 + 1; - } - return i4 + 2; -}; -RegExpValidationState.prototype.current = function current(forceU) { - if (forceU === void 0) - forceU = false; - return this.at(this.pos, forceU); -}; -RegExpValidationState.prototype.lookahead = function lookahead(forceU) { - if (forceU === void 0) - forceU = false; - return this.at(this.nextIndex(this.pos, forceU), forceU); -}; -RegExpValidationState.prototype.advance = function advance(forceU) { - if (forceU === void 0) - forceU = false; - this.pos = this.nextIndex(this.pos, forceU); -}; -RegExpValidationState.prototype.eat = function eat(ch, forceU) { - if (forceU === void 0) - forceU = false; - if (this.current(forceU) === ch) { - this.advance(forceU); - return true; - } - return false; -}; -pp$1.validateRegExpFlags = function(state) { - var validFlags = state.validFlags; - var flags = state.flags; - for (var i4 = 0; i4 < flags.length; i4++) { - var flag = flags.charAt(i4); - if (validFlags.indexOf(flag) === -1) { - this.raise(state.start, "Invalid regular expression flag"); - } - if (flags.indexOf(flag, i4 + 1) > -1) { - this.raise(state.start, "Duplicate regular expression flag"); - } - } -}; -pp$1.validateRegExpPattern = function(state) { - this.regexp_pattern(state); - if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { - state.switchN = true; - this.regexp_pattern(state); - } -}; -pp$1.regexp_pattern = function(state) { - state.pos = 0; - state.lastIntValue = 0; - state.lastStringValue = ""; - state.lastAssertionIsQuantifiable = false; - state.numCapturingParens = 0; - state.maxBackReference = 0; - state.groupNames.length = 0; - state.backReferenceNames.length = 0; - this.regexp_disjunction(state); - if (state.pos !== state.source.length) { - if (state.eat(41)) { - state.raise("Unmatched ')'"); - } - if (state.eat(93) || state.eat(125)) { - state.raise("Lone quantifier brackets"); - } - } - if (state.maxBackReference > state.numCapturingParens) { - state.raise("Invalid escape"); - } - for (var i4 = 0, list = state.backReferenceNames; i4 < list.length; i4 += 1) { - var name = list[i4]; - if (state.groupNames.indexOf(name) === -1) { - state.raise("Invalid named capture referenced"); - } - } -}; -pp$1.regexp_disjunction = function(state) { - this.regexp_alternative(state); - while (state.eat(124)) { - this.regexp_alternative(state); - } - if (this.regexp_eatQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } - if (state.eat(123)) { - state.raise("Lone quantifier brackets"); - } -}; -pp$1.regexp_alternative = function(state) { - while (state.pos < state.source.length && this.regexp_eatTerm(state)) { - } -}; -pp$1.regexp_eatTerm = function(state) { - if (this.regexp_eatAssertion(state)) { - if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { - if (state.switchU) { - state.raise("Invalid quantifier"); - } - } - return true; - } - if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { - this.regexp_eatQuantifier(state); - return true; - } - return false; -}; -pp$1.regexp_eatAssertion = function(state) { - var start = state.pos; - state.lastAssertionIsQuantifiable = false; - if (state.eat(94) || state.eat(36)) { - return true; - } - if (state.eat(92)) { - if (state.eat(66) || state.eat(98)) { - return true; - } - state.pos = start; - } - if (state.eat(40) && state.eat(63)) { - var lookbehind = false; - if (this.options.ecmaVersion >= 9) { - lookbehind = state.eat(60); - } - if (state.eat(61) || state.eat(33)) { - this.regexp_disjunction(state); - if (!state.eat(41)) { - state.raise("Unterminated group"); - } - state.lastAssertionIsQuantifiable = !lookbehind; - return true; - } - } - state.pos = start; - return false; -}; -pp$1.regexp_eatQuantifier = function(state, noError) { - if (noError === void 0) - noError = false; - if (this.regexp_eatQuantifierPrefix(state, noError)) { - state.eat(63); - return true; - } - return false; -}; -pp$1.regexp_eatQuantifierPrefix = function(state, noError) { - return state.eat(42) || state.eat(43) || state.eat(63) || this.regexp_eatBracedQuantifier(state, noError); -}; -pp$1.regexp_eatBracedQuantifier = function(state, noError) { - var start = state.pos; - if (state.eat(123)) { - var min3 = 0, max3 = -1; - if (this.regexp_eatDecimalDigits(state)) { - min3 = state.lastIntValue; - if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { - max3 = state.lastIntValue; - } - if (state.eat(125)) { - if (max3 !== -1 && max3 < min3 && !noError) { - state.raise("numbers out of order in {} quantifier"); - } - return true; - } - } - if (state.switchU && !noError) { - state.raise("Incomplete quantifier"); - } - state.pos = start; - } - return false; -}; -pp$1.regexp_eatAtom = function(state) { - return this.regexp_eatPatternCharacters(state) || state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); -}; -pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { - var start = state.pos; - if (state.eat(92)) { - if (this.regexp_eatAtomEscape(state)) { - return true; - } - state.pos = start; - } - return false; -}; -pp$1.regexp_eatUncapturingGroup = function(state) { - var start = state.pos; - if (state.eat(40)) { - if (state.eat(63) && state.eat(58)) { - this.regexp_disjunction(state); - if (state.eat(41)) { - return true; - } - state.raise("Unterminated group"); - } - state.pos = start; - } - return false; -}; -pp$1.regexp_eatCapturingGroup = function(state) { - if (state.eat(40)) { - if (this.options.ecmaVersion >= 9) { - this.regexp_groupSpecifier(state); - } else if (state.current() === 63) { - state.raise("Invalid group"); - } - this.regexp_disjunction(state); - if (state.eat(41)) { - state.numCapturingParens += 1; - return true; - } - state.raise("Unterminated group"); - } - return false; -}; -pp$1.regexp_eatExtendedAtom = function(state) { - return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); -}; -pp$1.regexp_eatInvalidBracedQuantifier = function(state) { - if (this.regexp_eatBracedQuantifier(state, true)) { - state.raise("Nothing to repeat"); - } - return false; -}; -pp$1.regexp_eatSyntaxCharacter = function(state) { - var ch = state.current(); - if (isSyntaxCharacter(ch)) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; -}; -function isSyntaxCharacter(ch) { - return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; -} -pp$1.regexp_eatPatternCharacters = function(state) { - var start = state.pos; - var ch = 0; - while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { - state.advance(); - } - return state.pos !== start; -}; -pp$1.regexp_eatExtendedPatternCharacter = function(state) { - var ch = state.current(); - if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_groupSpecifier = function(state) { - if (state.eat(63)) { - if (this.regexp_eatGroupName(state)) { - if (state.groupNames.indexOf(state.lastStringValue) !== -1) { - state.raise("Duplicate capture group name"); - } - state.groupNames.push(state.lastStringValue); - return; - } - state.raise("Invalid group"); - } -}; -pp$1.regexp_eatGroupName = function(state) { - state.lastStringValue = ""; - if (state.eat(60)) { - if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { - return true; - } - state.raise("Invalid capture group name"); - } - return false; -}; -pp$1.regexp_eatRegExpIdentifierName = function(state) { - state.lastStringValue = ""; - if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - } - return true; - } - return false; -}; -pp$1.regexp_eatRegExpIdentifierStart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierStart(ch)) { - state.lastIntValue = ch; - return true; - } - state.pos = start; - return false; -}; -function isRegExpIdentifierStart(ch) { - return isIdentifierStart(ch, true) || ch === 36 || ch === 95; -} -pp$1.regexp_eatRegExpIdentifierPart = function(state) { - var start = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierPart(ch)) { - state.lastIntValue = ch; - return true; - } - state.pos = start; - return false; -}; -function isRegExpIdentifierPart(ch) { - return isIdentifierChar(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205; -} -pp$1.regexp_eatAtomEscape = function(state) { - if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { - return true; - } - if (state.switchU) { - if (state.current() === 99) { - state.raise("Invalid unicode escape"); - } - state.raise("Invalid escape"); - } - return false; -}; -pp$1.regexp_eatBackReference = function(state) { - var start = state.pos; - if (this.regexp_eatDecimalEscape(state)) { - var n2 = state.lastIntValue; - if (state.switchU) { - if (n2 > state.maxBackReference) { - state.maxBackReference = n2; - } - return true; - } - if (n2 <= state.numCapturingParens) { - return true; - } - state.pos = start; - } - return false; -}; -pp$1.regexp_eatKGroupName = function(state) { - if (state.eat(107)) { - if (this.regexp_eatGroupName(state)) { - state.backReferenceNames.push(state.lastStringValue); - return true; - } - state.raise("Invalid named reference"); - } - return false; -}; -pp$1.regexp_eatCharacterEscape = function(state) { - return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); -}; -pp$1.regexp_eatCControlLetter = function(state) { - var start = state.pos; - if (state.eat(99)) { - if (this.regexp_eatControlLetter(state)) { - return true; - } - state.pos = start; - } - return false; -}; -pp$1.regexp_eatZero = function(state) { - if (state.current() === 48 && !isDecimalDigit(state.lookahead())) { - state.lastIntValue = 0; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatControlEscape = function(state) { - var ch = state.current(); - if (ch === 116) { - state.lastIntValue = 9; - state.advance(); - return true; - } - if (ch === 110) { - state.lastIntValue = 10; - state.advance(); - return true; - } - if (ch === 118) { - state.lastIntValue = 11; - state.advance(); - return true; - } - if (ch === 102) { - state.lastIntValue = 12; - state.advance(); - return true; - } - if (ch === 114) { - state.lastIntValue = 13; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatControlLetter = function(state) { - var ch = state.current(); - if (isControlLetter(ch)) { - state.lastIntValue = ch % 32; - state.advance(); - return true; - } - return false; -}; -function isControlLetter(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; -} -pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { - if (forceU === void 0) - forceU = false; - var start = state.pos; - var switchU = forceU || state.switchU; - if (state.eat(117)) { - if (this.regexp_eatFixedHexDigits(state, 4)) { - var lead = state.lastIntValue; - if (switchU && lead >= 55296 && lead <= 56319) { - var leadSurrogateEnd = state.pos; - if (state.eat(92) && state.eat(117) && this.regexp_eatFixedHexDigits(state, 4)) { - var trail = state.lastIntValue; - if (trail >= 56320 && trail <= 57343) { - state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; - return true; - } - } - state.pos = leadSurrogateEnd; - state.lastIntValue = lead; - } - return true; - } - if (switchU && state.eat(123) && this.regexp_eatHexDigits(state) && state.eat(125) && isValidUnicode(state.lastIntValue)) { - return true; - } - if (switchU) { - state.raise("Invalid unicode escape"); - } - state.pos = start; - } - return false; -}; -function isValidUnicode(ch) { - return ch >= 0 && ch <= 1114111; -} -pp$1.regexp_eatIdentityEscape = function(state) { - if (state.switchU) { - if (this.regexp_eatSyntaxCharacter(state)) { - return true; - } - if (state.eat(47)) { - state.lastIntValue = 47; - return true; - } - return false; - } - var ch = state.current(); - if (ch !== 99 && (!state.switchN || ch !== 107)) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatDecimalEscape = function(state) { - state.lastIntValue = 0; - var ch = state.current(); - if (ch >= 49 && ch <= 57) { - do { - state.lastIntValue = 10 * state.lastIntValue + (ch - 48); - state.advance(); - } while ((ch = state.current()) >= 48 && ch <= 57); - return true; - } - return false; -}; -pp$1.regexp_eatCharacterClassEscape = function(state) { - var ch = state.current(); - if (isCharacterClassEscape(ch)) { - state.lastIntValue = -1; - state.advance(); - return true; - } - if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 80 || ch === 112)) { - state.lastIntValue = -1; - state.advance(); - if (state.eat(123) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(125)) { - return true; - } - state.raise("Invalid property name"); - } - return false; -}; -function isCharacterClassEscape(ch) { - return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; -} -pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { - var start = state.pos; - if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { - var name = state.lastStringValue; - if (this.regexp_eatUnicodePropertyValue(state)) { - var value = state.lastStringValue; - this.regexp_validateUnicodePropertyNameAndValue(state, name, value); - return true; - } - } - state.pos = start; - if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { - var nameOrValue = state.lastStringValue; - this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); - return true; - } - return false; -}; -pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { - if (!hasOwn(state.unicodeProperties.nonBinary, name)) { - state.raise("Invalid property name"); - } - if (!state.unicodeProperties.nonBinary[name].test(value)) { - state.raise("Invalid property value"); - } -}; -pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { - if (!state.unicodeProperties.binary.test(nameOrValue)) { - state.raise("Invalid property name"); - } -}; -pp$1.regexp_eatUnicodePropertyName = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyNameCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== ""; -}; -function isUnicodePropertyNameCharacter(ch) { - return isControlLetter(ch) || ch === 95; -} -pp$1.regexp_eatUnicodePropertyValue = function(state) { - var ch = 0; - state.lastStringValue = ""; - while (isUnicodePropertyValueCharacter(ch = state.current())) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== ""; -}; -function isUnicodePropertyValueCharacter(ch) { - return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch); -} -pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { - return this.regexp_eatUnicodePropertyValue(state); -}; -pp$1.regexp_eatCharacterClass = function(state) { - if (state.eat(91)) { - state.eat(94); - this.regexp_classRanges(state); - if (state.eat(93)) { - return true; - } - state.raise("Unterminated character class"); - } - return false; -}; -pp$1.regexp_classRanges = function(state) { - while (this.regexp_eatClassAtom(state)) { - var left = state.lastIntValue; - if (state.eat(45) && this.regexp_eatClassAtom(state)) { - var right = state.lastIntValue; - if (state.switchU && (left === -1 || right === -1)) { - state.raise("Invalid character class"); - } - if (left !== -1 && right !== -1 && left > right) { - state.raise("Range out of order in character class"); - } - } - } -}; -pp$1.regexp_eatClassAtom = function(state) { - var start = state.pos; - if (state.eat(92)) { - if (this.regexp_eatClassEscape(state)) { - return true; - } - if (state.switchU) { - var ch$1 = state.current(); - if (ch$1 === 99 || isOctalDigit(ch$1)) { - state.raise("Invalid class escape"); - } - state.raise("Invalid escape"); - } - state.pos = start; - } - var ch = state.current(); - if (ch !== 93) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatClassEscape = function(state) { - var start = state.pos; - if (state.eat(98)) { - state.lastIntValue = 8; - return true; - } - if (state.switchU && state.eat(45)) { - state.lastIntValue = 45; - return true; - } - if (!state.switchU && state.eat(99)) { - if (this.regexp_eatClassControlLetter(state)) { - return true; - } - state.pos = start; - } - return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); -}; -pp$1.regexp_eatClassControlLetter = function(state) { - var ch = state.current(); - if (isDecimalDigit(ch) || ch === 95) { - state.lastIntValue = ch % 32; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatHexEscapeSequence = function(state) { - var start = state.pos; - if (state.eat(120)) { - if (this.regexp_eatFixedHexDigits(state, 2)) { - return true; - } - if (state.switchU) { - state.raise("Invalid escape"); - } - state.pos = start; - } - return false; -}; -pp$1.regexp_eatDecimalDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isDecimalDigit(ch = state.current())) { - state.lastIntValue = 10 * state.lastIntValue + (ch - 48); - state.advance(); - } - return state.pos !== start; -}; -function isDecimalDigit(ch) { - return ch >= 48 && ch <= 57; -} -pp$1.regexp_eatHexDigits = function(state) { - var start = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isHexDigit(ch = state.current())) { - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return state.pos !== start; -}; -function isHexDigit(ch) { - return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; -} -function hexToInt(ch) { - if (ch >= 65 && ch <= 70) { - return 10 + (ch - 65); - } - if (ch >= 97 && ch <= 102) { - return 10 + (ch - 97); - } - return ch - 48; -} -pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { - if (this.regexp_eatOctalDigit(state)) { - var n1 = state.lastIntValue; - if (this.regexp_eatOctalDigit(state)) { - var n2 = state.lastIntValue; - if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { - state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; - } else { - state.lastIntValue = n1 * 8 + n2; - } - } else { - state.lastIntValue = n1; - } - return true; - } - return false; -}; -pp$1.regexp_eatOctalDigit = function(state) { - var ch = state.current(); - if (isOctalDigit(ch)) { - state.lastIntValue = ch - 48; - state.advance(); - return true; - } - state.lastIntValue = 0; - return false; -}; -function isOctalDigit(ch) { - return ch >= 48 && ch <= 55; -} -pp$1.regexp_eatFixedHexDigits = function(state, length) { - var start = state.pos; - state.lastIntValue = 0; - for (var i4 = 0; i4 < length; ++i4) { - var ch = state.current(); - if (!isHexDigit(ch)) { - state.pos = start; - return false; - } - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return true; -}; -var Token = function Token2(p3) { - this.type = p3.type; - this.value = p3.value; - this.start = p3.start; - this.end = p3.end; - if (p3.options.locations) { - this.loc = new SourceLocation(p3, p3.startLoc, p3.endLoc); - } - if (p3.options.ranges) { - this.range = [p3.start, p3.end]; - } -}; -var pp = Parser.prototype; -pp.next = function(ignoreEscapeSequenceInKeyword) { - if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { - this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); - } - if (this.options.onToken) { - this.options.onToken(new Token(this)); - } - this.lastTokEnd = this.end; - this.lastTokStart = this.start; - this.lastTokEndLoc = this.endLoc; - this.lastTokStartLoc = this.startLoc; - this.nextToken(); -}; -pp.getToken = function() { - this.next(); - return new Token(this); -}; -if (typeof Symbol !== "undefined") { - pp[Symbol.iterator] = function() { - var this$1$1 = this; - return { - next: function() { - var token = this$1$1.getToken(); - return { - done: token.type === types$1.eof, - value: token - }; - } - }; - }; -} -pp.nextToken = function() { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) { - this.skipSpace(); - } - this.start = this.pos; - if (this.options.locations) { - this.startLoc = this.curPosition(); - } - if (this.pos >= this.input.length) { - return this.finishToken(types$1.eof); - } - if (curContext.override) { - return curContext.override(this); - } else { - this.readToken(this.fullCharCodeAtPos()); - } -}; -pp.readToken = function(code) { - if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92) { - return this.readWord(); - } - return this.getTokenFromCode(code); -}; -pp.fullCharCodeAtPos = function() { - var code = this.input.charCodeAt(this.pos); - if (code <= 55295 || code >= 56320) { - return code; - } - var next = this.input.charCodeAt(this.pos + 1); - return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888; -}; -pp.skipBlockComment = function() { - var startLoc = this.options.onComment && this.curPosition(); - var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); - if (end === -1) { - this.raise(this.pos - 2, "Unterminated comment"); - } - this.pos = end + 2; - if (this.options.locations) { - for (var nextBreak = void 0, pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) { - ++this.curLine; - pos = this.lineStart = nextBreak; - } - } - if (this.options.onComment) { - this.options.onComment( - true, - this.input.slice(start + 2, end), - start, - this.pos, - startLoc, - this.curPosition() - ); - } -}; -pp.skipLineComment = function(startSkip) { - var start = this.pos; - var startLoc = this.options.onComment && this.curPosition(); - var ch = this.input.charCodeAt(this.pos += startSkip); - while (this.pos < this.input.length && !isNewLine(ch)) { - ch = this.input.charCodeAt(++this.pos); - } - if (this.options.onComment) { - this.options.onComment( - false, - this.input.slice(start + startSkip, this.pos), - start, - this.pos, - startLoc, - this.curPosition() - ); - } -}; -pp.skipSpace = function() { - loop: - while (this.pos < this.input.length) { - var ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 32: - case 160: - ++this.pos; - break; - case 13: - if (this.input.charCodeAt(this.pos + 1) === 10) { - ++this.pos; - } - case 10: - case 8232: - case 8233: - ++this.pos; - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - break; - case 47: - switch (this.input.charCodeAt(this.pos + 1)) { - case 42: - this.skipBlockComment(); - break; - case 47: - this.skipLineComment(2); - break; - default: - break loop; - } - break; - default: - if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this.pos; - } else { - break loop; - } - } - } -}; -pp.finishToken = function(type, val) { - this.end = this.pos; - if (this.options.locations) { - this.endLoc = this.curPosition(); - } - var prevType = this.type; - this.type = type; - this.value = val; - this.updateContext(prevType); -}; -pp.readToken_dot = function() { - var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) { - return this.readNumber(true); - } - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { - this.pos += 3; - return this.finishToken(types$1.ellipsis); - } else { - ++this.pos; - return this.finishToken(types$1.dot); - } -}; -pp.readToken_slash = function() { - var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { - ++this.pos; - return this.readRegexp(); - } - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp(types$1.slash, 1); -}; -pp.readToken_mult_modulo_exp = function(code) { - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - var tokentype = code === 42 ? types$1.star : types$1.modulo; - if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { - ++size; - tokentype = types$1.starstar; - next = this.input.charCodeAt(this.pos + 2); - } - if (next === 61) { - return this.finishOp(types$1.assign, size + 1); - } - return this.finishOp(tokentype, size); -}; -pp.readToken_pipe_amp = function(code) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (this.options.ecmaVersion >= 12) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { - return this.finishOp(types$1.assign, 3); - } - } - return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2); - } - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1); -}; -pp.readToken_caret = function() { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp(types$1.bitwiseXOR, 1); -}; -pp.readToken_plus_min = function(code) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(types$1.incDec, 2); - } - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp(types$1.plusMin, 1); -}; -pp.readToken_lt_gt = function(code) { - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { - return this.finishOp(types$1.assign, size + 1); - } - return this.finishOp(types$1.bitShift, size); - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { - this.skipLineComment(4); - this.skipSpace(); - return this.nextToken(); - } - if (next === 61) { - size = 2; - } - return this.finishOp(types$1.relational, size); -}; -pp.readToken_eq_excl = function(code) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { - return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2); - } - if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { - this.pos += 2; - return this.finishToken(types$1.arrow); - } - return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1); -}; -pp.readToken_question = function() { - var ecmaVersion = this.options.ecmaVersion; - if (ecmaVersion >= 11) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 46) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 < 48 || next2 > 57) { - return this.finishOp(types$1.questionDot, 2); - } - } - if (next === 63) { - if (ecmaVersion >= 12) { - var next2$1 = this.input.charCodeAt(this.pos + 2); - if (next2$1 === 61) { - return this.finishOp(types$1.assign, 3); - } - } - return this.finishOp(types$1.coalesce, 2); - } - } - return this.finishOp(types$1.question, 1); -}; -pp.readToken_numberSign = function() { - var ecmaVersion = this.options.ecmaVersion; - var code = 35; - if (ecmaVersion >= 13) { - ++this.pos; - code = this.fullCharCodeAtPos(); - if (isIdentifierStart(code, true) || code === 92) { - return this.finishToken(types$1.privateId, this.readWord1()); - } - } - this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); -}; -pp.getTokenFromCode = function(code) { - switch (code) { - case 46: - return this.readToken_dot(); - case 40: - ++this.pos; - return this.finishToken(types$1.parenL); - case 41: - ++this.pos; - return this.finishToken(types$1.parenR); - case 59: - ++this.pos; - return this.finishToken(types$1.semi); - case 44: - ++this.pos; - return this.finishToken(types$1.comma); - case 91: - ++this.pos; - return this.finishToken(types$1.bracketL); - case 93: - ++this.pos; - return this.finishToken(types$1.bracketR); - case 123: - ++this.pos; - return this.finishToken(types$1.braceL); - case 125: - ++this.pos; - return this.finishToken(types$1.braceR); - case 58: - ++this.pos; - return this.finishToken(types$1.colon); - case 96: - if (this.options.ecmaVersion < 6) { - break; - } - ++this.pos; - return this.finishToken(types$1.backQuote); - case 48: - var next = this.input.charCodeAt(this.pos + 1); - if (next === 120 || next === 88) { - return this.readRadixNumber(16); - } - if (this.options.ecmaVersion >= 6) { - if (next === 111 || next === 79) { - return this.readRadixNumber(8); - } - if (next === 98 || next === 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(false); - case 34: - case 39: - return this.readString(code); - case 47: - return this.readToken_slash(); - case 37: - case 42: - return this.readToken_mult_modulo_exp(code); - case 124: - case 38: - return this.readToken_pipe_amp(code); - case 94: - return this.readToken_caret(); - case 43: - case 45: - return this.readToken_plus_min(code); - case 60: - case 62: - return this.readToken_lt_gt(code); - case 61: - case 33: - return this.readToken_eq_excl(code); - case 63: - return this.readToken_question(); - case 126: - return this.finishOp(types$1.prefix, 1); - case 35: - return this.readToken_numberSign(); - } - this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); -}; -pp.finishOp = function(type, size) { - var str = this.input.slice(this.pos, this.pos + size); - this.pos += size; - return this.finishToken(type, str); -}; -pp.readRegexp = function() { - var escaped, inClass, start = this.pos; - for (; ; ) { - if (this.pos >= this.input.length) { - this.raise(start, "Unterminated regular expression"); - } - var ch = this.input.charAt(this.pos); - if (lineBreak.test(ch)) { - this.raise(start, "Unterminated regular expression"); - } - if (!escaped) { - if (ch === "[") { - inClass = true; - } else if (ch === "]" && inClass) { - inClass = false; - } else if (ch === "/" && !inClass) { - break; - } - escaped = ch === "\\"; - } else { - escaped = false; - } - ++this.pos; - } - var pattern = this.input.slice(start, this.pos); - ++this.pos; - var flagsStart = this.pos; - var flags = this.readWord1(); - if (this.containsEsc) { - this.unexpected(flagsStart); - } - var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); - state.reset(start, pattern, flags); - this.validateRegExpFlags(state); - this.validateRegExpPattern(state); - var value = null; - try { - value = new RegExp(pattern, flags); - } catch (e4) { - } - return this.finishToken(types$1.regexp, { pattern, flags, value }); -}; -pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { - var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; - var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; - var start = this.pos, total = 0, lastCode = 0; - for (var i4 = 0, e4 = len == null ? Infinity : len; i4 < e4; ++i4, ++this.pos) { - var code = this.input.charCodeAt(this.pos), val = void 0; - if (allowSeparators && code === 95) { - if (isLegacyOctalNumericLiteral) { - this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); - } - if (lastCode === 95) { - this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); - } - if (i4 === 0) { - this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); - } - lastCode = code; - continue; - } - if (code >= 97) { - val = code - 97 + 10; - } else if (code >= 65) { - val = code - 65 + 10; - } else if (code >= 48 && code <= 57) { - val = code - 48; - } else { - val = Infinity; - } - if (val >= radix) { - break; - } - lastCode = code; - total = total * radix + val; - } - if (allowSeparators && lastCode === 95) { - this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); - } - if (this.pos === start || len != null && this.pos - start !== len) { - return null; - } - return total; -}; -function stringToNumber(str, isLegacyOctalNumericLiteral) { - if (isLegacyOctalNumericLiteral) { - return parseInt(str, 8); - } - return parseFloat(str.replace(/_/g, "")); -} -function stringToBigInt(str) { - if (typeof BigInt !== "function") { - return null; - } - return BigInt(str.replace(/_/g, "")); -} -pp.readRadixNumber = function(radix) { - var start = this.pos; - this.pos += 2; - var val = this.readInt(radix); - if (val == null) { - this.raise(this.start + 2, "Expected number in radix " + radix); - } - if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { - val = stringToBigInt(this.input.slice(start, this.pos)); - ++this.pos; - } else if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, "Identifier directly after number"); - } - return this.finishToken(types$1.num, val); -}; -pp.readNumber = function(startsWithDot) { - var start = this.pos; - if (!startsWithDot && this.readInt(10, void 0, true) === null) { - this.raise(start, "Invalid number"); - } - var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; - if (octal && this.strict) { - this.raise(start, "Invalid number"); - } - var next = this.input.charCodeAt(this.pos); - if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { - var val$1 = stringToBigInt(this.input.slice(start, this.pos)); - ++this.pos; - if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, "Identifier directly after number"); - } - return this.finishToken(types$1.num, val$1); - } - if (octal && /[89]/.test(this.input.slice(start, this.pos))) { - octal = false; - } - if (next === 46 && !octal) { - ++this.pos; - this.readInt(10); - next = this.input.charCodeAt(this.pos); - } - if ((next === 69 || next === 101) && !octal) { - next = this.input.charCodeAt(++this.pos); - if (next === 43 || next === 45) { - ++this.pos; - } - if (this.readInt(10) === null) { - this.raise(start, "Invalid number"); - } - } - if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, "Identifier directly after number"); - } - var val = stringToNumber(this.input.slice(start, this.pos), octal); - return this.finishToken(types$1.num, val); -}; -pp.readCodePoint = function() { - var ch = this.input.charCodeAt(this.pos), code; - if (ch === 123) { - if (this.options.ecmaVersion < 6) { - this.unexpected(); - } - var codePos = ++this.pos; - code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); - ++this.pos; - if (code > 1114111) { - this.invalidStringToken(codePos, "Code point out of bounds"); - } - } else { - code = this.readHexChar(4); - } - return code; -}; -pp.readString = function(quote) { - var out = "", chunkStart = ++this.pos; - for (; ; ) { - if (this.pos >= this.input.length) { - this.raise(this.start, "Unterminated string constant"); - } - var ch = this.input.charCodeAt(this.pos); - if (ch === quote) { - break; - } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(false); - chunkStart = this.pos; - } else if (ch === 8232 || ch === 8233) { - if (this.options.ecmaVersion < 10) { - this.raise(this.start, "Unterminated string constant"); - } - ++this.pos; - if (this.options.locations) { - this.curLine++; - this.lineStart = this.pos; - } - } else { - if (isNewLine(ch)) { - this.raise(this.start, "Unterminated string constant"); - } - ++this.pos; - } - } - out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types$1.string, out); -}; -var INVALID_TEMPLATE_ESCAPE_ERROR = {}; -pp.tryReadTemplateToken = function() { - this.inTemplateElement = true; - try { - this.readTmplToken(); - } catch (err) { - if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { - this.readInvalidTemplateToken(); - } else { - throw err; - } - } - this.inTemplateElement = false; -}; -pp.invalidStringToken = function(position, message) { - if (this.inTemplateElement && this.options.ecmaVersion >= 9) { - throw INVALID_TEMPLATE_ESCAPE_ERROR; - } else { - this.raise(position, message); - } -}; -pp.readTmplToken = function() { - var out = "", chunkStart = this.pos; - for (; ; ) { - if (this.pos >= this.input.length) { - this.raise(this.start, "Unterminated template"); - } - var ch = this.input.charCodeAt(this.pos); - if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { - if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { - if (ch === 36) { - this.pos += 2; - return this.finishToken(types$1.dollarBraceL); - } else { - ++this.pos; - return this.finishToken(types$1.backQuote); - } - } - out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types$1.template, out); - } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(true); - chunkStart = this.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.pos); - ++this.pos; - switch (ch) { - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - out += "\n"; - break; - default: - out += String.fromCharCode(ch); - break; - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - chunkStart = this.pos; - } else { - ++this.pos; - } - } -}; -pp.readInvalidTemplateToken = function() { - for (; this.pos < this.input.length; this.pos++) { - switch (this.input[this.pos]) { - case "\\": - ++this.pos; - break; - case "$": - if (this.input[this.pos + 1] !== "{") { - break; - } - case "`": - return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); - } - } - this.raise(this.start, "Unterminated template"); -}; -pp.readEscapedChar = function(inTemplate) { - var ch = this.input.charCodeAt(++this.pos); - ++this.pos; - switch (ch) { - case 110: - return "\n"; - case 114: - return "\r"; - case 120: - return String.fromCharCode(this.readHexChar(2)); - case 117: - return codePointToString(this.readCodePoint()); - case 116: - return " "; - case 98: - return "\b"; - case 118: - return "\v"; - case 102: - return "\f"; - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - if (this.options.locations) { - this.lineStart = this.pos; - ++this.curLine; - } - return ""; - case 56: - case 57: - if (this.strict) { - this.invalidStringToken( - this.pos - 1, - "Invalid escape sequence" - ); - } - if (inTemplate) { - var codePos = this.pos - 1; - this.invalidStringToken( - codePos, - "Invalid escape sequence in template string" - ); - } - default: - if (ch >= 48 && ch <= 55) { - var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; - var octal = parseInt(octalStr, 8); - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - this.pos += octalStr.length - 1; - ch = this.input.charCodeAt(this.pos); - if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { - this.invalidStringToken( - this.pos - 1 - octalStr.length, - inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" - ); - } - return String.fromCharCode(octal); - } - if (isNewLine(ch)) { - return ""; - } - return String.fromCharCode(ch); - } -}; -pp.readHexChar = function(len) { - var codePos = this.pos; - var n2 = this.readInt(16, len); - if (n2 === null) { - this.invalidStringToken(codePos, "Bad character escape sequence"); - } - return n2; -}; -pp.readWord1 = function() { - this.containsEsc = false; - var word = "", first = true, chunkStart = this.pos; - var astral = this.options.ecmaVersion >= 6; - while (this.pos < this.input.length) { - var ch = this.fullCharCodeAtPos(); - if (isIdentifierChar(ch, astral)) { - this.pos += ch <= 65535 ? 1 : 2; - } else if (ch === 92) { - this.containsEsc = true; - word += this.input.slice(chunkStart, this.pos); - var escStart = this.pos; - if (this.input.charCodeAt(++this.pos) !== 117) { - this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); - } - ++this.pos; - var esc = this.readCodePoint(); - if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { - this.invalidStringToken(escStart, "Invalid Unicode escape"); - } - word += codePointToString(esc); - chunkStart = this.pos; - } else { - break; - } - first = false; - } - return word + this.input.slice(chunkStart, this.pos); -}; -pp.readWord = function() { - var word = this.readWord1(); - var type = types$1.name; - if (this.keywords.test(word)) { - type = keywords[word]; - } - return this.finishToken(type, word); -}; -var version = "8.8.2"; -Parser.acorn = { - Parser, - version, - defaultOptions, - Position, - SourceLocation, - getLineInfo, - Node, - TokenType, - tokTypes: types$1, - keywordTypes: keywords, - TokContext, - tokContexts: types, - isIdentifierChar, - isIdentifierStart, - Token, - isNewLine, - lineBreak, - lineBreakG, - nonASCIIwhitespace -}; -function parse3(input, options) { - return Parser.parse(input, options); -} - -// node_modules/acorn-walk/dist/walk.mjs -function ancestor(node, visitors, baseVisitor, state, override) { - var ancestors = []; - if (!baseVisitor) { - baseVisitor = base; - } - (function c4(node2, st, override2) { - var type = override2 || node2.type, found = visitors[type]; - var isNew = node2 !== ancestors[ancestors.length - 1]; - if (isNew) { - ancestors.push(node2); - } - baseVisitor[type](node2, st, c4); - if (found) { - found(node2, st || ancestors, ancestors); - } - if (isNew) { - ancestors.pop(); - } - })(node, state, override); -} -function skipThrough(node, st, c4) { - c4(node, st); -} -function ignore(_node, _st, _c2) { -} -var base = {}; -base.Program = base.BlockStatement = base.StaticBlock = function(node, st, c4) { - for (var i4 = 0, list = node.body; i4 < list.length; i4 += 1) { - var stmt = list[i4]; - c4(stmt, st, "Statement"); - } -}; -base.Statement = skipThrough; -base.EmptyStatement = ignore; -base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression = function(node, st, c4) { - return c4(node.expression, st, "Expression"); -}; -base.IfStatement = function(node, st, c4) { - c4(node.test, st, "Expression"); - c4(node.consequent, st, "Statement"); - if (node.alternate) { - c4(node.alternate, st, "Statement"); - } -}; -base.LabeledStatement = function(node, st, c4) { - return c4(node.body, st, "Statement"); -}; -base.BreakStatement = base.ContinueStatement = ignore; -base.WithStatement = function(node, st, c4) { - c4(node.object, st, "Expression"); - c4(node.body, st, "Statement"); -}; -base.SwitchStatement = function(node, st, c4) { - c4(node.discriminant, st, "Expression"); - for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) { - var cs = list$1[i$1]; - if (cs.test) { - c4(cs.test, st, "Expression"); - } - for (var i4 = 0, list = cs.consequent; i4 < list.length; i4 += 1) { - var cons = list[i4]; - c4(cons, st, "Statement"); - } - } -}; -base.SwitchCase = function(node, st, c4) { - if (node.test) { - c4(node.test, st, "Expression"); - } - for (var i4 = 0, list = node.consequent; i4 < list.length; i4 += 1) { - var cons = list[i4]; - c4(cons, st, "Statement"); - } -}; -base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function(node, st, c4) { - if (node.argument) { - c4(node.argument, st, "Expression"); - } -}; -base.ThrowStatement = base.SpreadElement = function(node, st, c4) { - return c4(node.argument, st, "Expression"); -}; -base.TryStatement = function(node, st, c4) { - c4(node.block, st, "Statement"); - if (node.handler) { - c4(node.handler, st); - } - if (node.finalizer) { - c4(node.finalizer, st, "Statement"); - } -}; -base.CatchClause = function(node, st, c4) { - if (node.param) { - c4(node.param, st, "Pattern"); - } - c4(node.body, st, "Statement"); -}; -base.WhileStatement = base.DoWhileStatement = function(node, st, c4) { - c4(node.test, st, "Expression"); - c4(node.body, st, "Statement"); -}; -base.ForStatement = function(node, st, c4) { - if (node.init) { - c4(node.init, st, "ForInit"); - } - if (node.test) { - c4(node.test, st, "Expression"); - } - if (node.update) { - c4(node.update, st, "Expression"); - } - c4(node.body, st, "Statement"); -}; -base.ForInStatement = base.ForOfStatement = function(node, st, c4) { - c4(node.left, st, "ForInit"); - c4(node.right, st, "Expression"); - c4(node.body, st, "Statement"); -}; -base.ForInit = function(node, st, c4) { - if (node.type === "VariableDeclaration") { - c4(node, st); - } else { - c4(node, st, "Expression"); - } -}; -base.DebuggerStatement = ignore; -base.FunctionDeclaration = function(node, st, c4) { - return c4(node, st, "Function"); -}; -base.VariableDeclaration = function(node, st, c4) { - for (var i4 = 0, list = node.declarations; i4 < list.length; i4 += 1) { - var decl = list[i4]; - c4(decl, st); - } -}; -base.VariableDeclarator = function(node, st, c4) { - c4(node.id, st, "Pattern"); - if (node.init) { - c4(node.init, st, "Expression"); - } -}; -base.Function = function(node, st, c4) { - if (node.id) { - c4(node.id, st, "Pattern"); - } - for (var i4 = 0, list = node.params; i4 < list.length; i4 += 1) { - var param = list[i4]; - c4(param, st, "Pattern"); - } - c4(node.body, st, node.expression ? "Expression" : "Statement"); -}; -base.Pattern = function(node, st, c4) { - if (node.type === "Identifier") { - c4(node, st, "VariablePattern"); - } else if (node.type === "MemberExpression") { - c4(node, st, "MemberPattern"); - } else { - c4(node, st); - } -}; -base.VariablePattern = ignore; -base.MemberPattern = skipThrough; -base.RestElement = function(node, st, c4) { - return c4(node.argument, st, "Pattern"); -}; -base.ArrayPattern = function(node, st, c4) { - for (var i4 = 0, list = node.elements; i4 < list.length; i4 += 1) { - var elt = list[i4]; - if (elt) { - c4(elt, st, "Pattern"); - } - } -}; -base.ObjectPattern = function(node, st, c4) { - for (var i4 = 0, list = node.properties; i4 < list.length; i4 += 1) { - var prop = list[i4]; - if (prop.type === "Property") { - if (prop.computed) { - c4(prop.key, st, "Expression"); - } - c4(prop.value, st, "Pattern"); - } else if (prop.type === "RestElement") { - c4(prop.argument, st, "Pattern"); - } - } -}; -base.Expression = skipThrough; -base.ThisExpression = base.Super = base.MetaProperty = ignore; -base.ArrayExpression = function(node, st, c4) { - for (var i4 = 0, list = node.elements; i4 < list.length; i4 += 1) { - var elt = list[i4]; - if (elt) { - c4(elt, st, "Expression"); - } - } -}; -base.ObjectExpression = function(node, st, c4) { - for (var i4 = 0, list = node.properties; i4 < list.length; i4 += 1) { - var prop = list[i4]; - c4(prop, st); - } -}; -base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration; -base.SequenceExpression = function(node, st, c4) { - for (var i4 = 0, list = node.expressions; i4 < list.length; i4 += 1) { - var expr = list[i4]; - c4(expr, st, "Expression"); - } -}; -base.TemplateLiteral = function(node, st, c4) { - for (var i4 = 0, list = node.quasis; i4 < list.length; i4 += 1) { - var quasi = list[i4]; - c4(quasi, st); - } - for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) { - var expr = list$1[i$1]; - c4(expr, st, "Expression"); - } -}; -base.TemplateElement = ignore; -base.UnaryExpression = base.UpdateExpression = function(node, st, c4) { - c4(node.argument, st, "Expression"); -}; -base.BinaryExpression = base.LogicalExpression = function(node, st, c4) { - c4(node.left, st, "Expression"); - c4(node.right, st, "Expression"); -}; -base.AssignmentExpression = base.AssignmentPattern = function(node, st, c4) { - c4(node.left, st, "Pattern"); - c4(node.right, st, "Expression"); -}; -base.ConditionalExpression = function(node, st, c4) { - c4(node.test, st, "Expression"); - c4(node.consequent, st, "Expression"); - c4(node.alternate, st, "Expression"); -}; -base.NewExpression = base.CallExpression = function(node, st, c4) { - c4(node.callee, st, "Expression"); - if (node.arguments) { - for (var i4 = 0, list = node.arguments; i4 < list.length; i4 += 1) { - var arg = list[i4]; - c4(arg, st, "Expression"); - } - } -}; -base.MemberExpression = function(node, st, c4) { - c4(node.object, st, "Expression"); - if (node.computed) { - c4(node.property, st, "Expression"); - } -}; -base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function(node, st, c4) { - if (node.declaration) { - c4(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); - } - if (node.source) { - c4(node.source, st, "Expression"); - } -}; -base.ExportAllDeclaration = function(node, st, c4) { - if (node.exported) { - c4(node.exported, st); - } - c4(node.source, st, "Expression"); -}; -base.ImportDeclaration = function(node, st, c4) { - for (var i4 = 0, list = node.specifiers; i4 < list.length; i4 += 1) { - var spec = list[i4]; - c4(spec, st); - } - c4(node.source, st, "Expression"); -}; -base.ImportExpression = function(node, st, c4) { - c4(node.source, st, "Expression"); -}; -base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore; -base.TaggedTemplateExpression = function(node, st, c4) { - c4(node.tag, st, "Expression"); - c4(node.quasi, st, "Expression"); -}; -base.ClassDeclaration = base.ClassExpression = function(node, st, c4) { - return c4(node, st, "Class"); -}; -base.Class = function(node, st, c4) { - if (node.id) { - c4(node.id, st, "Pattern"); - } - if (node.superClass) { - c4(node.superClass, st, "Expression"); - } - c4(node.body, st); -}; -base.ClassBody = function(node, st, c4) { - for (var i4 = 0, list = node.body; i4 < list.length; i4 += 1) { - var elt = list[i4]; - c4(elt, st); - } -}; -base.MethodDefinition = base.PropertyDefinition = base.Property = function(node, st, c4) { - if (node.computed) { - c4(node.key, st, "Expression"); - } - if (node.value) { - c4(node.value, st, "Expression"); - } -}; - -// node_modules/astring/dist/astring.mjs -var { stringify } = JSON; -if (!String.prototype.repeat) { - throw new Error( - "String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation" - ); -} -if (!String.prototype.endsWith) { - throw new Error( - "String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation" - ); -} -var OPERATOR_PRECEDENCE = { - "||": 3, - "&&": 4, - "|": 5, - "??": 5, - "^": 6, - "&": 7, - "==": 8, - "!=": 8, - "===": 8, - "!==": 8, - "<": 9, - ">": 9, - "<=": 9, - ">=": 9, - in: 9, - instanceof: 9, - "<<": 10, - ">>": 10, - ">>>": 10, - "+": 11, - "-": 11, - "*": 12, - "%": 12, - "/": 12, - "**": 13 -}; -var NEEDS_PARENTHESES = 17; -var EXPRESSIONS_PRECEDENCE = { - 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: NEEDS_PARENTHESES, - ClassExpression: NEEDS_PARENTHESES, - FunctionExpression: NEEDS_PARENTHESES, - ObjectExpression: NEEDS_PARENTHESES, - UpdateExpression: 16, - UnaryExpression: 15, - AwaitExpression: 15, - BinaryExpression: 14, - LogicalExpression: 13, - ConditionalExpression: 4, - AssignmentExpression: 3, - YieldExpression: 2, - RestElement: 1 -}; -function formatSequence(state, nodes) { - const { generator } = state; - state.write("("); - if (nodes != null && nodes.length > 0) { - generator[nodes[0].type](nodes[0], state); - const { length } = nodes; - for (let i4 = 1; i4 < length; i4++) { - const param = nodes[i4]; - state.write(", "); - generator[param.type](param, state); - } - } - state.write(")"); -} -function expressionNeedsParenthesis(state, node, parentNode, isRightHand) { - const nodePrecedence = state.expressionsPrecedence[node.type]; - if (nodePrecedence === NEEDS_PARENTHESES) { - return true; - } - const parentNodePrecedence = state.expressionsPrecedence[parentNode.type]; - if (nodePrecedence !== parentNodePrecedence) { - return !isRightHand && nodePrecedence === 15 && parentNodePrecedence === 14 && parentNode.operator === "**" || nodePrecedence < parentNodePrecedence; - } - if (nodePrecedence !== 13 && nodePrecedence !== 14) { - return false; - } - if (node.operator === "**" && parentNode.operator === "**") { - return !isRightHand; - } - if (isRightHand) { - return OPERATOR_PRECEDENCE[node.operator] <= OPERATOR_PRECEDENCE[parentNode.operator]; - } - return OPERATOR_PRECEDENCE[node.operator] < OPERATOR_PRECEDENCE[parentNode.operator]; -} -function formatExpression(state, node, parentNode, isRightHand) { - const { generator } = state; - if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) { - state.write("("); - generator[node.type](node, state); - state.write(")"); - } else { - generator[node.type](node, state); - } -} -function reindent(state, text2, indent, lineEnd) { - const lines = text2.split("\n"); - const end = lines.length - 1; - state.write(lines[0].trim()); - if (end > 0) { - state.write(lineEnd); - for (let i4 = 1; i4 < end; i4++) { - state.write(indent + lines[i4].trim() + lineEnd); - } - state.write(indent + lines[end].trim()); - } -} -function formatComments(state, comments, indent, lineEnd) { - const { length } = comments; - for (let i4 = 0; i4 < length; i4++) { - const comment = comments[i4]; - state.write(indent); - if (comment.type[0] === "L") { - state.write("// " + comment.value.trim() + "\n", comment); - } else { - state.write("/*"); - reindent(state, comment.value, indent, lineEnd); - state.write("*/" + lineEnd); - } - } -} -function hasCallExpression(node) { - let currentNode = node; - while (currentNode != null) { - const { type } = currentNode; - if (type[0] === "C" && type[1] === "a") { - return true; - } else if (type[0] === "M" && type[1] === "e" && type[2] === "m") { - currentNode = currentNode.object; - } else { - return false; - } - } -} -function formatVariableDeclaration(state, node) { - const { generator } = state; - const { declarations } = node; - state.write(node.kind + " "); - const { length } = declarations; - if (length > 0) { - generator.VariableDeclarator(declarations[0], state); - for (let i4 = 1; i4 < length; i4++) { - state.write(", "); - generator.VariableDeclarator(declarations[i4], state); - } - } -} -var ForInStatement; -var FunctionDeclaration; -var RestElement; -var BinaryExpression; -var ArrayExpression; -var BlockStatement; -var GENERATOR = { - Program(node, state) { - const indent = state.indent.repeat(state.indentLevel); - const { lineEnd, writeComments } = state; - if (writeComments && node.comments != null) { - formatComments(state, node.comments, indent, lineEnd); - } - const statements = node.body; - const { length } = statements; - for (let i4 = 0; i4 < length; i4++) { - const statement = statements[i4]; - if (writeComments && statement.comments != null) { - formatComments(state, statement.comments, indent, lineEnd); - } - state.write(indent); - this[statement.type](statement, state); - state.write(lineEnd); - } - if (writeComments && node.trailingComments != null) { - formatComments(state, node.trailingComments, indent, lineEnd); - } - }, - BlockStatement: BlockStatement = function(node, state) { - const indent = state.indent.repeat(state.indentLevel++); - const { lineEnd, writeComments } = state; - const statementIndent = indent + state.indent; - state.write("{"); - const statements = node.body; - if (statements != null && statements.length > 0) { - state.write(lineEnd); - if (writeComments && node.comments != null) { - formatComments(state, node.comments, statementIndent, lineEnd); - } - const { length } = statements; - for (let i4 = 0; i4 < length; i4++) { - const statement = statements[i4]; - if (writeComments && statement.comments != null) { - formatComments(state, statement.comments, statementIndent, lineEnd); - } - state.write(statementIndent); - this[statement.type](statement, state); - state.write(lineEnd); - } - state.write(indent); - } else { - if (writeComments && node.comments != null) { - state.write(lineEnd); - formatComments(state, node.comments, statementIndent, lineEnd); - state.write(indent); - } - } - if (writeComments && node.trailingComments != null) { - formatComments(state, node.trailingComments, statementIndent, lineEnd); - } - state.write("}"); - state.indentLevel--; - }, - ClassBody: BlockStatement, - StaticBlock(node, state) { - state.write("static "); - this.BlockStatement(node, state); - }, - EmptyStatement(node, state) { - state.write(";"); - }, - ExpressionStatement(node, state) { - const precedence = state.expressionsPrecedence[node.expression.type]; - if (precedence === NEEDS_PARENTHESES || precedence === 3 && node.expression.left.type[0] === "O") { - state.write("("); - this[node.expression.type](node.expression, state); - state.write(")"); - } else { - this[node.expression.type](node.expression, state); - } - state.write(";"); - }, - IfStatement(node, state) { - state.write("if ("); - this[node.test.type](node.test, state); - state.write(") "); - this[node.consequent.type](node.consequent, state); - if (node.alternate != null) { - state.write(" else "); - this[node.alternate.type](node.alternate, state); - } - }, - LabeledStatement(node, state) { - this[node.label.type](node.label, state); - state.write(": "); - this[node.body.type](node.body, state); - }, - BreakStatement(node, state) { - state.write("break"); - if (node.label != null) { - state.write(" "); - this[node.label.type](node.label, state); - } - state.write(";"); - }, - ContinueStatement(node, state) { - state.write("continue"); - if (node.label != null) { - state.write(" "); - this[node.label.type](node.label, state); - } - state.write(";"); - }, - WithStatement(node, state) { - state.write("with ("); - this[node.object.type](node.object, state); - state.write(") "); - this[node.body.type](node.body, state); - }, - SwitchStatement(node, state) { - const indent = state.indent.repeat(state.indentLevel++); - const { lineEnd, writeComments } = state; - state.indentLevel++; - const caseIndent = indent + state.indent; - const statementIndent = caseIndent + state.indent; - state.write("switch ("); - this[node.discriminant.type](node.discriminant, state); - state.write(") {" + lineEnd); - const { cases: occurences } = node; - const { length: occurencesCount } = occurences; - for (let i4 = 0; i4 < occurencesCount; i4++) { - const occurence = occurences[i4]; - if (writeComments && occurence.comments != null) { - formatComments(state, occurence.comments, caseIndent, lineEnd); - } - if (occurence.test) { - state.write(caseIndent + "case "); - this[occurence.test.type](occurence.test, state); - state.write(":" + lineEnd); - } else { - state.write(caseIndent + "default:" + lineEnd); - } - const { consequent } = occurence; - const { length: consequentCount } = consequent; - for (let i5 = 0; i5 < consequentCount; i5++) { - const statement = consequent[i5]; - if (writeComments && statement.comments != null) { - formatComments(state, statement.comments, statementIndent, lineEnd); - } - state.write(statementIndent); - this[statement.type](statement, state); - state.write(lineEnd); - } - } - state.indentLevel -= 2; - state.write(indent + "}"); - }, - ReturnStatement(node, state) { - state.write("return"); - if (node.argument) { - state.write(" "); - this[node.argument.type](node.argument, state); - } - state.write(";"); - }, - ThrowStatement(node, state) { - state.write("throw "); - this[node.argument.type](node.argument, state); - state.write(";"); - }, - TryStatement(node, state) { - state.write("try "); - this[node.block.type](node.block, state); - if (node.handler) { - const { handler } = node; - if (handler.param == null) { - state.write(" catch "); - } else { - state.write(" catch ("); - this[handler.param.type](handler.param, state); - state.write(") "); - } - this[handler.body.type](handler.body, state); - } - if (node.finalizer) { - state.write(" finally "); - this[node.finalizer.type](node.finalizer, state); - } - }, - WhileStatement(node, state) { - state.write("while ("); - this[node.test.type](node.test, state); - state.write(") "); - this[node.body.type](node.body, state); - }, - DoWhileStatement(node, state) { - state.write("do "); - this[node.body.type](node.body, state); - state.write(" while ("); - this[node.test.type](node.test, state); - state.write(");"); - }, - ForStatement(node, state) { - state.write("for ("); - if (node.init != null) { - const { init } = node; - if (init.type[0] === "V") { - formatVariableDeclaration(state, init); - } else { - this[init.type](init, state); - } - } - state.write("; "); - if (node.test) { - this[node.test.type](node.test, state); - } - state.write("; "); - if (node.update) { - this[node.update.type](node.update, state); - } - state.write(") "); - this[node.body.type](node.body, state); - }, - ForInStatement: ForInStatement = function(node, state) { - state.write(`for ${node.await ? "await " : ""}(`); - const { left } = node; - if (left.type[0] === "V") { - formatVariableDeclaration(state, left); - } else { - this[left.type](left, state); - } - state.write(node.type[3] === "I" ? " in " : " of "); - this[node.right.type](node.right, state); - state.write(") "); - this[node.body.type](node.body, state); - }, - ForOfStatement: ForInStatement, - DebuggerStatement(node, state) { - state.write("debugger;", node); - }, - FunctionDeclaration: FunctionDeclaration = function(node, state) { - state.write( - (node.async ? "async " : "") + (node.generator ? "function* " : "function ") + (node.id ? node.id.name : ""), - node - ); - formatSequence(state, node.params); - state.write(" "); - this[node.body.type](node.body, state); - }, - FunctionExpression: FunctionDeclaration, - VariableDeclaration(node, state) { - formatVariableDeclaration(state, node); - state.write(";"); - }, - VariableDeclarator(node, state) { - this[node.id.type](node.id, state); - if (node.init != null) { - state.write(" = "); - this[node.init.type](node.init, state); - } - }, - ClassDeclaration(node, state) { - state.write("class " + (node.id ? `${node.id.name} ` : ""), node); - if (node.superClass) { - state.write("extends "); - const { superClass } = node; - const { type } = superClass; - const precedence = state.expressionsPrecedence[type]; - if ((type[0] !== "C" || type[1] !== "l" || type[5] !== "E") && (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.ClassExpression)) { - state.write("("); - this[node.superClass.type](superClass, state); - state.write(")"); - } else { - this[superClass.type](superClass, state); - } - state.write(" "); - } - this.ClassBody(node.body, state); - }, - ImportDeclaration(node, state) { - state.write("import "); - const { specifiers } = node; - const { length } = specifiers; - let i4 = 0; - if (length > 0) { - for (; i4 < length; ) { - if (i4 > 0) { - state.write(", "); - } - const specifier = specifiers[i4]; - const type = specifier.type[6]; - if (type === "D") { - state.write(specifier.local.name, specifier); - i4++; - } else if (type === "N") { - state.write("* as " + specifier.local.name, specifier); - i4++; - } else { - break; - } - } - if (i4 < length) { - state.write("{"); - for (; ; ) { - const specifier = specifiers[i4]; - const { name } = specifier.imported; - state.write(name, specifier); - if (name !== specifier.local.name) { - state.write(" as " + specifier.local.name); - } - if (++i4 < length) { - state.write(", "); - } else { - break; - } - } - state.write("}"); - } - state.write(" from "); - } - this.Literal(node.source, state); - state.write(";"); - }, - ImportExpression(node, state) { - state.write("import("); - this[node.source.type](node.source, state); - state.write(")"); - }, - ExportDefaultDeclaration(node, state) { - state.write("export default "); - this[node.declaration.type](node.declaration, state); - if (state.expressionsPrecedence[node.declaration.type] != null && node.declaration.type[0] !== "F") { - state.write(";"); - } - }, - ExportNamedDeclaration(node, state) { - state.write("export "); - if (node.declaration) { - this[node.declaration.type](node.declaration, state); - } else { - state.write("{"); - const { specifiers } = node, { length } = specifiers; - if (length > 0) { - for (let i4 = 0; ; ) { - const specifier = specifiers[i4]; - const { name } = specifier.local; - state.write(name, specifier); - if (name !== specifier.exported.name) { - state.write(" as " + specifier.exported.name); - } - if (++i4 < length) { - state.write(", "); - } else { - break; - } - } - } - state.write("}"); - if (node.source) { - state.write(" from "); - this.Literal(node.source, state); - } - state.write(";"); - } - }, - ExportAllDeclaration(node, state) { - if (node.exported != null) { - state.write("export * as " + node.exported.name + " from "); - } else { - state.write("export * from "); - } - this.Literal(node.source, state); - state.write(";"); - }, - MethodDefinition(node, state) { - if (node.static) { - state.write("static "); - } - const kind = node.kind[0]; - if (kind === "g" || kind === "s") { - state.write(node.kind + " "); - } - if (node.value.async) { - state.write("async "); - } - if (node.value.generator) { - state.write("*"); - } - if (node.computed) { - state.write("["); - this[node.key.type](node.key, state); - state.write("]"); - } else { - this[node.key.type](node.key, state); - } - formatSequence(state, node.value.params); - state.write(" "); - this[node.value.body.type](node.value.body, state); - }, - ClassExpression(node, state) { - this.ClassDeclaration(node, state); - }, - ArrowFunctionExpression(node, state) { - state.write(node.async ? "async " : "", node); - const { params } = node; - if (params != null) { - if (params.length === 1 && params[0].type[0] === "I") { - state.write(params[0].name, params[0]); - } else { - formatSequence(state, node.params); - } - } - state.write(" => "); - if (node.body.type[0] === "O") { - state.write("("); - this.ObjectExpression(node.body, state); - state.write(")"); - } else { - this[node.body.type](node.body, state); - } - }, - ThisExpression(node, state) { - state.write("this", node); - }, - Super(node, state) { - state.write("super", node); - }, - RestElement: RestElement = function(node, state) { - state.write("..."); - this[node.argument.type](node.argument, state); - }, - SpreadElement: RestElement, - YieldExpression(node, state) { - state.write(node.delegate ? "yield*" : "yield"); - if (node.argument) { - state.write(" "); - this[node.argument.type](node.argument, state); - } - }, - AwaitExpression(node, state) { - state.write("await ", node); - formatExpression(state, node.argument, node); - }, - TemplateLiteral(node, state) { - const { quasis, expressions } = node; - state.write("`"); - const { length } = expressions; - for (let i4 = 0; i4 < length; i4++) { - const expression = expressions[i4]; - const quasi2 = quasis[i4]; - state.write(quasi2.value.raw, quasi2); - state.write("${"); - this[expression.type](expression, state); - state.write("}"); - } - const quasi = quasis[quasis.length - 1]; - state.write(quasi.value.raw, quasi); - state.write("`"); - }, - TemplateElement(node, state) { - state.write(node.value.raw, node); - }, - TaggedTemplateExpression(node, state) { - formatExpression(state, node.tag, node); - this[node.quasi.type](node.quasi, state); - }, - ArrayExpression: ArrayExpression = function(node, state) { - state.write("["); - if (node.elements.length > 0) { - const { elements } = node, { length } = elements; - for (let i4 = 0; ; ) { - const element = elements[i4]; - if (element != null) { - this[element.type](element, state); - } - if (++i4 < length) { - state.write(", "); - } else { - if (element == null) { - state.write(", "); - } - break; - } - } - } - state.write("]"); - }, - ArrayPattern: ArrayExpression, - ObjectExpression(node, state) { - const indent = state.indent.repeat(state.indentLevel++); - const { lineEnd, writeComments } = state; - const propertyIndent = indent + state.indent; - state.write("{"); - if (node.properties.length > 0) { - state.write(lineEnd); - if (writeComments && node.comments != null) { - formatComments(state, node.comments, propertyIndent, lineEnd); - } - const comma = "," + lineEnd; - const { properties: properties2 } = node, { length } = properties2; - for (let i4 = 0; ; ) { - const property = properties2[i4]; - if (writeComments && property.comments != null) { - formatComments(state, property.comments, propertyIndent, lineEnd); - } - state.write(propertyIndent); - this[property.type](property, state); - if (++i4 < length) { - state.write(comma); - } else { - break; - } - } - state.write(lineEnd); - if (writeComments && node.trailingComments != null) { - formatComments(state, node.trailingComments, propertyIndent, lineEnd); - } - state.write(indent + "}"); - } else if (writeComments) { - if (node.comments != null) { - state.write(lineEnd); - formatComments(state, node.comments, propertyIndent, lineEnd); - if (node.trailingComments != null) { - formatComments(state, node.trailingComments, propertyIndent, lineEnd); - } - state.write(indent + "}"); - } else if (node.trailingComments != null) { - state.write(lineEnd); - formatComments(state, node.trailingComments, propertyIndent, lineEnd); - state.write(indent + "}"); - } else { - state.write("}"); - } - } else { - state.write("}"); - } - state.indentLevel--; - }, - Property(node, state) { - if (node.method || node.kind[0] !== "i") { - this.MethodDefinition(node, state); - } else { - if (!node.shorthand) { - if (node.computed) { - state.write("["); - this[node.key.type](node.key, state); - state.write("]"); - } else { - this[node.key.type](node.key, state); - } - state.write(": "); - } - this[node.value.type](node.value, state); - } - }, - PropertyDefinition(node, state) { - if (node.static) { - state.write("static "); - } - if (node.computed) { - state.write("["); - } - this[node.key.type](node.key, state); - if (node.computed) { - state.write("]"); - } - if (node.value == null) { - if (node.key.type[0] !== "F") { - state.write(";"); - } - return; - } - state.write(" = "); - this[node.value.type](node.value, state); - state.write(";"); - }, - ObjectPattern(node, state) { - state.write("{"); - if (node.properties.length > 0) { - const { properties: properties2 } = node, { length } = properties2; - for (let i4 = 0; ; ) { - this[properties2[i4].type](properties2[i4], state); - if (++i4 < length) { - state.write(", "); - } else { - break; - } - } - } - state.write("}"); - }, - SequenceExpression(node, state) { - formatSequence(state, node.expressions); - }, - UnaryExpression(node, state) { - if (node.prefix) { - const { - operator, - argument, - argument: { type } - } = node; - state.write(operator); - const needsParentheses = expressionNeedsParenthesis(state, argument, node); - if (!needsParentheses && (operator.length > 1 || type[0] === "U" && (type[1] === "n" || type[1] === "p") && argument.prefix && argument.operator[0] === operator && (operator === "+" || operator === "-"))) { - state.write(" "); - } - if (needsParentheses) { - state.write(operator.length > 1 ? " (" : "("); - this[type](argument, state); - state.write(")"); - } else { - this[type](argument, state); - } - } else { - this[node.argument.type](node.argument, state); - state.write(node.operator); - } - }, - UpdateExpression(node, state) { - if (node.prefix) { - state.write(node.operator); - this[node.argument.type](node.argument, state); - } else { - this[node.argument.type](node.argument, state); - state.write(node.operator); - } - }, - AssignmentExpression(node, state) { - this[node.left.type](node.left, state); - state.write(" " + node.operator + " "); - this[node.right.type](node.right, state); - }, - AssignmentPattern(node, state) { - this[node.left.type](node.left, state); - state.write(" = "); - this[node.right.type](node.right, state); - }, - BinaryExpression: BinaryExpression = function(node, state) { - const isIn = node.operator === "in"; - if (isIn) { - state.write("("); - } - formatExpression(state, node.left, node, false); - state.write(" " + node.operator + " "); - formatExpression(state, node.right, node, true); - if (isIn) { - state.write(")"); - } - }, - LogicalExpression: BinaryExpression, - ConditionalExpression(node, state) { - const { test } = node; - const precedence = state.expressionsPrecedence[test.type]; - if (precedence === NEEDS_PARENTHESES || precedence <= state.expressionsPrecedence.ConditionalExpression) { - state.write("("); - this[test.type](test, state); - state.write(")"); - } else { - this[test.type](test, state); - } - state.write(" ? "); - this[node.consequent.type](node.consequent, state); - state.write(" : "); - this[node.alternate.type](node.alternate, state); - }, - NewExpression(node, state) { - state.write("new "); - const precedence = state.expressionsPrecedence[node.callee.type]; - if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression || hasCallExpression(node.callee)) { - state.write("("); - this[node.callee.type](node.callee, state); - state.write(")"); - } else { - this[node.callee.type](node.callee, state); - } - formatSequence(state, node["arguments"]); - }, - CallExpression(node, state) { - const precedence = state.expressionsPrecedence[node.callee.type]; - if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression) { - state.write("("); - this[node.callee.type](node.callee, state); - state.write(")"); - } else { - this[node.callee.type](node.callee, state); - } - if (node.optional) { - state.write("?."); - } - formatSequence(state, node["arguments"]); - }, - ChainExpression(node, state) { - this[node.expression.type](node.expression, state); - }, - MemberExpression(node, state) { - const precedence = state.expressionsPrecedence[node.object.type]; - if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.MemberExpression) { - state.write("("); - this[node.object.type](node.object, state); - state.write(")"); - } else { - this[node.object.type](node.object, state); - } - if (node.computed) { - if (node.optional) { - state.write("?."); - } - state.write("["); - this[node.property.type](node.property, state); - state.write("]"); - } else { - if (node.optional) { - state.write("?."); - } else { - state.write("."); - } - this[node.property.type](node.property, state); - } - }, - MetaProperty(node, state) { - state.write(node.meta.name + "." + node.property.name, node); - }, - Identifier(node, state) { - state.write(node.name, node); - }, - PrivateIdentifier(node, state) { - state.write(`#${node.name}`, node); - }, - Literal(node, state) { - if (node.raw != null) { - state.write(node.raw, node); - } else if (node.regex != null) { - this.RegExpLiteral(node, state); - } else if (node.bigint != null) { - state.write(node.bigint + "n", node); - } else { - state.write(stringify(node.value), node); - } - }, - RegExpLiteral(node, state) { - const { regex } = node; - state.write(`/${regex.pattern}/${regex.flags}`, node); - } -}; -var EMPTY_OBJECT = {}; -var State = class { - constructor(options) { - const setup = options == null ? EMPTY_OBJECT : options; - this.output = ""; - if (setup.output != null) { - this.output = setup.output; - this.write = this.writeToStream; - } else { - this.output = ""; - } - this.generator = setup.generator != null ? setup.generator : GENERATOR; - this.expressionsPrecedence = setup.expressionsPrecedence != null ? setup.expressionsPrecedence : EXPRESSIONS_PRECEDENCE; - this.indent = setup.indent != null ? setup.indent : " "; - this.lineEnd = setup.lineEnd != null ? setup.lineEnd : "\n"; - this.indentLevel = setup.startingIndentLevel != null ? setup.startingIndentLevel : 0; - this.writeComments = setup.comments ? setup.comments : false; - if (setup.sourceMap != null) { - this.write = setup.output == null ? this.writeAndMap : this.writeToStreamAndMap; - this.sourceMap = setup.sourceMap; - this.line = 1; - this.column = 0; - this.lineEndSize = this.lineEnd.split("\n").length - 1; - this.mapping = { - original: null, - generated: this, - name: void 0, - source: setup.sourceMap.file || setup.sourceMap._file - }; - } - } - write(code) { - this.output += code; - } - writeToStream(code) { - this.output.write(code); - } - writeAndMap(code, node) { - this.output += code; - this.map(code, node); - } - writeToStreamAndMap(code, node) { - this.output.write(code); - this.map(code, node); - } - map(code, node) { - if (node != null) { - const { type } = node; - if (type[0] === "L" && type[2] === "n") { - this.column = 0; - this.line++; - return; - } - if (node.loc != null) { - const { mapping } = this; - mapping.original = node.loc.start; - mapping.name = node.name; - this.sourceMap.addMapping(mapping); - } - if (type[0] === "T" && type[8] === "E" || type[0] === "L" && type[1] === "i" && typeof node.value === "string") { - const { length: length2 } = code; - let { column, line } = this; - for (let i4 = 0; i4 < length2; i4++) { - if (code[i4] === "\n") { - column = 0; - line++; - } else { - column++; - } - } - this.column = column; - this.line = line; - return; - } - } - const { length } = code; - const { lineEnd } = this; - if (length > 0) { - if (this.lineEndSize > 0 && (lineEnd.length === 1 ? code[length - 1] === lineEnd : code.endsWith(lineEnd))) { - this.line += this.lineEndSize; - this.column = 0; - } else { - this.column += length; - } - } - } - toString() { - return this.output; - } -}; -function generate(node, options) { - const state = new State(options); - state.generator[node.type](node, state); - return state.output; -} - -// src/utils/frames/linker.ts -var preprocessCode = (code, oldName, newName) => { - let string; - let codeBlock = ensureString(code); - const isMultiLine = codeBlock.includes("\n"); - if (isMultiLine) { - const lines = codeBlock.split("\n").filter((line) => line.trim() !== ""); - lines[lines.length - 1] = `${lines[lines.length - 1].replace("return ", "")}`; - codeBlock = lines.join("\n"); - } - try { - const ast = parse3(codeBlock, { ecmaVersion: 2020, locations: true }); - ancestor(ast, { - Identifier(node, ancestors) { - const parent = ancestors[ancestors.length - 2]; - if (parent.type !== "MemberExpression" || parent.object === node) { - if (node.name == oldName) { - node.name = newName; - } - } - } - }); - string = generate(ast).trimEnd(); - } catch (e4) { - console.log(e4); - string = `"error"`; - } - if (isMultiLine) { - const lines = string.split("\n").filter((line) => line.trim() !== ""); - lines[lines.length - 1] = `return ${lines[lines.length - 1]}`; - string = lines.join("\n"); - } - return string; -}; -var linkNodes = (parent, schemaId, props2, flattenedTree, uniqueID) => { - const relinkProps = (oldParent, newParent2, props3, node) => { - var _a2, _b2, _c2; - return { - ...node, - parentId: node.parentId == oldParent ? newParent2 : node.parentId, - props: Object.keys((_a2 = node == null ? void 0 : node.props) != null ? _a2 : {}).reduce( - (p3, c4) => { - return { - ...p3, - [c4]: preprocessCode(node.props[c4], oldParent, newParent2) - }; - }, - node.props - ), - actions: Object.keys((_b2 = node == null ? void 0 : node.actions) != null ? _b2 : {}).reduce( - (p3, c4) => { - return { - ...p3, - [c4]: preprocessCode(node.actions[c4], oldParent, newParent2) - }; - }, - node.actions - ), - styles: Object.keys((_c2 = node == null ? void 0 : node.styles) != null ? _c2 : {}).reduce( - (p3, c4) => { - return { - ...p3, - [c4]: preprocessCode(node.styles[c4], oldParent, newParent2) - }; - }, - node.styles - ) - }; - }; - const assignIDs = (parent2, nodes) => { - const [newNodes, newID] = nodes.reduce((p3, c4, i4) => { - const [oldNodes, id2] = p3; - const newNodeID = c4.parentId ? c4.id + id2 : parent2.id; - const newNode = { - ...c4.parentId == "" ? parent2 : oldNodes[i4], - type: oldNodes[i4].type, - id: newNodeID - }; - const returnNodes = oldNodes.map((f4) => f4.id != c4.id ? relinkProps(c4.id, newNodeID, props2, f4) : relinkProps(c4.id, newNodeID, props2, newNode)); - return [returnNodes, id2 + 1]; - }, [nodes, uniqueID]); - return [newNodes, newID]; - }; - const newParent = schemaId != parent.id ? relinkProps(schemaId, parent.id, props2, parent) : parent; - return assignIDs(newParent, flattenedTree); -}; -var linkTreeNodes = (parent, uniqueID) => { - const relinkProps = (oldParent, newParent, treenode) => { - var _a2, _b2, _c2; - let children; - const node = treenode.node; - if (treenode.children) { - children = treenode.children.map((child) => relinkProps(oldParent, newParent, child)); - } - return { - ...treenode, - children, - node: { - ...treenode.node, - parentId: node.parentId == oldParent ? newParent : node.parentId, - props: Object.keys((_a2 = node == null ? void 0 : node.props) != null ? _a2 : {}).reduce( - (p3, c4) => { - return { - ...p3, - [c4]: preprocessCode(node.props[c4], oldParent, newParent) - }; - }, - node.props - ), - actions: Object.keys((_b2 = node == null ? void 0 : node.actions) != null ? _b2 : {}).reduce( - (p3, c4) => { - return { - ...p3, - [c4]: preprocessCode(node.actions[c4], oldParent, newParent) - }; - }, - node.actions - ), - styles: Object.keys((_c2 = node == null ? void 0 : node.styles) != null ? _c2 : {}).reduce( - (p3, c4) => { - return { - ...p3, - [c4]: preprocessCode(node.styles[c4], oldParent, newParent) - }; - }, - node.styles - ) - } - }; - }; - const assignIDs = (parent2, node, uniqueID2) => { - const assignIDToTree = (parent3, node2, id2) => { - const newNodeID = node2.node.parentId ? node2.id + id2 : parent3.id; - let newNode = { ...node2, node: { ...node2.node, id: newNodeID }, id: newNodeID }; - newNode = relinkProps(node2.id, newNodeID, newNode); - if (newNode.children) { - const [newChildren, newID] = newNode.children.reduce( - (acc, child, i4) => { - const [newChild, nextID] = assignIDToTree(newNode, child, id2 + i4 + 1); - acc[0].push(newChild); - return [acc[0], nextID]; - }, - [[], id2] - ); - newNode.children = newChildren; - id2 = newID; - } - return [newNode, id2 + 1]; - }; - return assignIDToTree(parent2, node, uniqueID2); - }; - return assignIDs(parent, parent, uniqueID); -}; - -// src/utils/json.ts -var safelyParseJSON = (json) => { - var parsed; - try { - parsed = JSON.parse(json); - } catch (e4) { - } - return parsed; -}; - -// src/utils/frames/nodes.ts -var mdbSchemaToFrameSchema = (schema) => { - if (!schema) - return null; - return { - ...schema, - def: safelyParseJSON(schema.def) - }; -}; -var frameSchemaToMDBSchema = (frameSchema) => { - return { - ...frameSchema, - def: JSON.stringify(frameSchema.def) - }; -}; -var frameToNode = (frame) => { - return { - ...frame, - rank: parseInt(frame.rank), - contexts: safelyParseJSON(frame.contexts), - styles: safelyParseJSON(frame.styles), - actions: safelyParseJSON(frame.actions), - props: safelyParseJSON(frame.props), - types: nodeToTypes(frame.type) - }; -}; -var nodeToFrame = (node) => { - var _a2, _b2; - const { contexts, styles: styles2, props: props2, actions, ...otherProps } = node; - return { - ...otherProps, - rank: (_b2 = (_a2 = node.rank) == null ? void 0 : _a2.toString()) != null ? _b2 : "0", - contexts: JSON.stringify(contexts), - styles: JSON.stringify(styles2), - actions: JSON.stringify(actions), - props: JSON.stringify(props2) - }; -}; - -// src/utils/frames/ast.ts -var calculateEditorProps = (props2, treeNode) => { - if (props2.editMode == 0 || !props2.rootId) - return props2; - if (treeNode.node.id == props2.rootId) - return props2; - if (treeNode.isRef) - return { ...props2, dropMode: 0, dragMode: 0, resizeMode: 0, selectMode: 0 }; - if (props2.editMode == 2) { - return { - ...props2, - resizeMode: 1 /* ResizeSelected */, - dragMode: 2 /* DragSelected */ - }; - } - const firstLevelNode = treeNode.node.parentId == props2.rootId; - const columnChild = treeNode.editorProps.parentType == "column"; - const isColumn = treeNode.node.type == "column"; - const resizeMode = treeNode.node.type == "image" || isColumn ? 2 /* ResizeAlways */ : 0 /* ResizeNever */; - const dragMode = firstLevelNode && treeNode.node.type != "container" || columnChild && !isColumn || isColumn && treeNode.children.length == 0 ? 1 /* DragHandle */ : 0 /* DragNever */; - const dropMode = isColumn ? 3 /* DropModeColumnOnly */ : columnChild ? 2 /* DropModeRowOnly */ : firstLevelNode ? 1 /* DropModeRowColumn */ : 0; - return { - ...props2, - dragMode, - resizeMode, - dropMode - }; -}; -function replaceSubtree(tree, subtree) { - if (tree.id === subtree.id) { - return subtree; - } - if (tree.children) { - for (let i4 = 0; i4 < tree.children.length; i4++) { - const replacedChild = replaceSubtree(tree.children[i4], subtree); - if (replacedChild !== tree.children[i4]) { - tree.children[i4] = replacedChild; - } - } - } - return tree; -} -var getFrameNodesByPath = (plugin, ref2) => { - const path = uriByString(plugin, ref2); - if (!path) - return; - if (path.space == "$kit") { - return kit.find((f4) => f4.schema.id == path.ref); - } - const context = plugin.index.framesIndex.get(path.basePath); - return context == null ? void 0 : context.frames[path.ref]; -}; -function flattenToFrameNodes(root) { - const flattenedTree = []; - function traverseAndFlatten(node, parent) { - var _a2; - flattenedTree.push({ ...node.node, parentId: parent, schemaId: root.node.schemaId }); - ((_a2 = node.children) != null ? _a2 : []).forEach((child) => { - traverseAndFlatten(child, node.node.id); - }); - } - traverseAndFlatten(root, ""); - return flattenedTree; -} -function insertFrameChildren(root, newChildren) { - function traverseAndInsert(node) { - return { - ...node, - children: node.node.type === "content" && newChildren.length > 0 ? newChildren.map((f4) => ({ ...f4, node: { ...f4.node, parentId: node.id } })) : node.children.map((child) => { - return traverseAndInsert(child); - }) - }; - } - const newRoot = traverseAndInsert(root); - return newRoot; -} -var expandNode = (treeNode, id2, plugin) => { - if (treeNode.node.type == "frame") { - const mdbFrame = getFrameNodesByPath(plugin, treeNode.node.ref); - if (treeNode.node.schemaId == (mdbFrame == null ? void 0 : mdbFrame.schema.id)) - return [treeNode, id2]; - if (!mdbFrame || mdbFrame.rows.length == 0) { - return [treeNode, id2]; - } - const linkedNode = linkProps(mdbFrame.cols, treeNode); - const [linkedNodes, newUniqueID] = linkNodes( - linkedNode.node, - mdbFrame.schema.id, - linkedNode.node.props, - mdbFrame.rows.map((f4) => frameToNode(f4)), - id2 - ); - const [newTreeNode, newID] = buildFrameTree( - linkedNode.node, - linkedNodes, - plugin, - newUniqueID, - true, - treeNode.editorProps - ); - if (!newTreeNode) { - return [linkedNode, newID]; - } - return [insertFrameChildren({ ...newTreeNode, isRef: false, node: { ...newTreeNode.node, schemaId: linkedNode.node.schemaId, ref: linkedNode.node.ref, types: linkedNode.node.types, propsAttrs: linkedNode.node.propsAttrs, propsValue: linkedNode.node.propsValue, parentId: linkedNode.node.parentId, type: "frame", id: newTreeNode.id } }, treeNode.children), newID]; - } - return [treeNode, id2]; -}; -var expandFrame = (node, plugin, uniqueID = 0, editorProps) => { - const [children, lastID] = node.children.reduce((f4, c4) => { - const [nodes, id2] = f4; - const _editorProps = calculateEditorProps({ ...editorProps, parentType: node.node.type }, c4); - const [newNode2, fid] = expandFrame(c4, plugin, id2 + 1, _editorProps); - return [[...nodes, newNode2], fid + 1]; - }, [[], uniqueID]); - const [newNode, newID] = expandNode({ ...node, children, editorProps }, lastID, plugin); - return [{ - ...newNode, - editorProps: calculateEditorProps(newNode.editorProps, newNode) - }, newID]; -}; -var linkProps = (fields, root) => { - const props2 = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: "" }), {}); - const types2 = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: c4.type }), {}); - const propsValue = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: c4.value }), {}); - const propsAttrs = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: c4.attrs }), {}); - return { ...root, node: { - ...root.node, - props: { ...props2, ...root.node.props }, - types: { ...types2, ...root.node.types }, - propsValue: { ...propsValue, ...root.node.propsValue }, - propsAttrs: { ...propsAttrs, ...root.node.propsAttrs } - } }; -}; -var applyPropsToRoot = (root, props2) => ({ - ...root, - node: { - ...root.node, - props: { - ...root.node.props, - ...applyFunctionToObject(props2, (e4) => wrapQuotes(e4)) - } - } -}); -var schemaToRoot = (schema) => { - return { - schemaId: schema.id, - id: schema.id, - type: "group", - rank: 0, - name: schema.id - }; -}; -var schemaToFrame = (schema) => { - return { - schemaId: schema.id, - id: schema.id, - type: "frame", - rank: 0, - name: schema.id - }; -}; -var buildRootFromMDBFrame = (plugin, frame, editorProps = defaultFrameEditorProps) => { - return buildRoot(mdbSchemaToFrameSchema(frame.schema), frame.cols, frame.rows.map((f4) => frameToNode(f4)), plugin, editorProps); -}; -var buildRoot = (schema, fields, nodes, plugin, editorProps = defaultFrameEditorProps) => { - var _a2; - const rootNode = (_a2 = nodes.find((f4) => f4.id == schema.id)) != null ? _a2 : schemaToRoot(schema); - const root = buildFrameTree(rootNode, nodes, plugin, nodes.length, false, { ...editorProps, rootId: schema.id })[0]; - return root && linkProps(fields, root); -}; -var propertiesForNode = (node) => Object.keys(node.types).map((f4) => { - var _a2, _b2; - return { - type: node.types[f4], - name: f4, - schemaId: f4, - value: (_a2 = node.propsValue) == null ? void 0 : _a2[f4], - attrs: (_b2 = node.propsAttrs) == null ? void 0 : _b2[f4] - }; -}); -var buildFrameTree = (root, nodes, plugin, uniqueID = 0, isRef, editorProps = defaultFrameEditorProps) => { - const rootNode = { node: root, id: root.id, children: [], isRef, editorProps }; - const idToNodeMap = { [root.id]: rootNode }; - nodes.forEach((node) => { - idToNodeMap[node.id] = { id: node.id, node, children: [], isRef, editorProps }; - }); - nodes.forEach((node) => { - if (node.parentId) { - const parentNode = idToNodeMap[node.parentId]; - if (parentNode) { - parentNode.children.push({ ...idToNodeMap[node.id], editorProps: { ...editorProps, parentType: parentNode.node.type } }); - parentNode.children.sort((a5, b4) => a5.node.rank - b4.node.rank); - } - } else { - if (node.id == root.id) - rootNode.node = idToNodeMap[node.id].node; - } - }); - const [treeNode, newID] = expandFrame(idToNodeMap[root.id], plugin, uniqueID, editorProps); - return [treeNode, newID]; -}; -var findParent = (tree, targetId, parentId = null) => { - for (const child of tree.children) { - if (child.id === targetId) { - return tree; - } - } - for (const child of tree.children) { - const foundParent = findParent(child, targetId, tree.id); - if (foundParent) { - return foundParent; - } - } - return null; -}; - -// src/schemas/frames.ts -var defaultFrameSchema = { - uniques: ["id,schemaId"], - cols: [ - "id", - "schemaId", - "type", - "parentId", - "name", - "rank", - "icon", - "props", - "actions", - "ref", - "styles", - "contexts" - ] -}; -var nodeToTypes = (type) => { - return type == "flow" ? { value: "link" } : type == "container" || type == "group" || type == "content" || type == "frame" ? {} : { - value: type - }; -}; -var groupNode = { - def: { - icon: "lucide//box-select" - }, - node: { - id: "group", - schemaId: "group", - name: "Group", - rank: 0, - parentId: "", - styles: { - flexDirection: `"column"`, - display: `"flex"` - }, - type: "group" - } -}; -var columnsNode = { - def: { - icon: "lucide//columns" - }, - node: { - id: "container", - schemaId: "container", - name: "Columns", - rank: 0, - parentId: "", - styles: { - layout: `"row"`, - width: `'100%'`, - gap: `'24px'` - }, - type: "container" - } -}; -var columnNode = { - def: { - icon: "lucide//columns" - }, - node: { - icon: "lucide//columns", - id: "column", - schemaId: "column", - name: "Column", - rank: 0, - parentId: "", - styles: { - layout: `"column"`, - alignItems: `'flex-start'`, - flex: `1`, - gap: `'16px'`, - width: "0" - }, - type: "column" - } -}; -var groupableTypes = ["content", "group", "container", "column", "list"]; -var flowNode = { - def: { - icon: "lucide//file-text" - }, - node: { - icon: "lucide//file-text", - schemaId: "flow", - parentId: "", - name: "Existing Note", - rank: 0, - id: "flow", - type: "flow", - props: { - value: "" - }, - styles: { - width: `'100%'` - }, - types: { - value: "link" - } - } -}; -var iconNode = { - def: { - icon: "lucide//gem" - }, - node: { - icon: "lucide//gem", - schemaId: "icon", - parentId: "", - name: "Icon", - rank: 0, - id: "icon", - styles: {}, - type: "icon", - props: { - value: "" - }, - types: { - value: "icon" - } - } -}; -var spaceNode = { - def: { - icon: "lucide//layout-grid" - }, - node: { - icon: "lucide//layout-grid", - schemaId: "space", - parentId: "", - name: "Space", - rank: 0, - id: "space", - styles: { width: `'100%'` }, - type: "space", - props: { - value: "" - }, - types: { - value: "view" - } - } -}; -var imageNode = { - def: { - icon: "lucide//image" - }, - node: { - icon: "lucide//image", - schemaId: "image", - parentId: "", - name: "Image", - rank: 0, - id: "image", - type: "image", - props: { - value: "" - }, - types: { - value: "image" - } - } -}; -var textNode = { - def: { - icon: "lucide//type", - description: "Insert a text labels to decorate your Space" - }, - node: { - icon: "lucide//type", - schemaId: "text", - parentId: "", - name: "Label", - rank: 0, - id: "text", - type: "text", - props: { - value: "" - }, - types: { - value: "text" - } - } -}; -var dividerNode = { - def: { - icon: "lucide//type" - }, - node: { - icon: "lucide//type", - schemaId: "hr", - parentId: "", - name: "Divider", - rank: 0, - id: "hr", - type: "hr", - styles: { - as: `'hr'` - } - } -}; -var buttonNode = { - id: "button", - def: { - icon: "lucide//mouse-pointer-click" - }, - node: { - icon: "lucide//mouse-pointer-click", - schemaId: "button", - parentId: "", - name: "Button", - rank: 0, - id: "button", - type: "group", - props: { - icon: "", - label: "", - action: "", - actionValue: "" - }, - types: { - icon: "icon", - label: "text", - action: "option", - actionValue: "super" - }, - propsAttrs: { - action: JSON.stringify({ - name: "When Clicked", - icon: "lucide//mouse-pointer-click" - }), - actionValue: JSON.stringify({ - name: "Perform Action" - }) - }, - propsValue: { - action: JSON.stringify({ - options: [{ name: "Run Command", value: "$commands" }, { name: "Open Link", value: "$links" }] - }), - actionValue: JSON.stringify({ - dynamic: true, - field: "action" - }) - }, - actions: { - onClick: `(a,b,c,api) => api.buttonCommand(button.props.action, button.props.actionValue)` - }, - styles: { - class: `'mk-button'`, - gap: `'4px'` - } - }, - children: [ - { ...iconNode, node: { ...iconNode.node, props: { - value: `button.props.icon` - } } }, - { ...textNode, node: { ...textNode.node, props: { value: `button.props.label` } } } - ] -}; -var progressNode = { - id: "progress", - def: { - icon: "lucide//pie-chart" - }, - node: { - icon: "lucide//pie-chart", - schemaId: "progress", - parentId: "", - name: "Progress", - rank: 0, - id: "progress", - type: "group", - props: { - value: "50", - total: "100" - }, - types: { - total: "number", - value: "number" - }, - styles: { - background: `'var(--background-modifier-form-field)'`, - height: `'10px'`, - width: `'100px'`, - borderRadius: `'5px'` - } - }, - children: [ - { ...groupNode, node: { ...groupNode.node, styles: { - width: `progress.props.value/progress.props.total*100+'%'`, - height: `'100%'`, - borderRadius: `'5px'`, - background: `'var(--color-orange)'`, - display: `'block'` - } } } - ] -}; -var cardNode = { - id: "card", - def: { - icon: "lucide//mouse-pointer-click" - }, - node: { - icon: "lucide//mouse-pointer-click", - schemaId: "card", - parentId: "", - name: "Card", - rank: 0, - id: "card", - type: "group", - props: { - icon: "", - label: "" - }, - types: { - icon: "icon", - label: "text" - }, - actions: {}, - styles: { - borderRadius: `'10px'`, - background: `'var(--background-primary-alt)'`, - width: `'160px'`, - height: `'80px'`, - padding: `'16px'`, - border: `'thin solid var(--divider-color)'` - } - }, - children: [ - { ...iconNode, node: { ...iconNode.node, props: { - value: `card.props.icon` - } } }, - { ...textNode, node: { ...textNode.node, props: { value: `card.props.label` } } } - ] -}; -var linkNode = { - id: "link", - def: { - icon: "lucide//link" - }, - node: { - icon: "lucide//link", - schemaId: "link", - parentId: "", - name: "Link", - rank: 0, - id: "link", - type: "group", - props: { - label: `"Link"`, - link: "" - }, - styles: { - class: `'mk-a'` - }, - actions: { - onClick: "(e,v,k,api) => { api.openLink(link.props.link, false) }" - }, - types: { - label: "text", - link: "link" - } - }, - children: [ - { ...textNode, node: { ...textNode.node, props: { value: `link.props.label` } } } - ] -}; -var rootToFrame = (root) => { - var _a2; - return { - schema: { id: root.id, name: root.node.name, type: "frame" }, - cols: Object.keys((_a2 = root.node.types) != null ? _a2 : {}).map((f4) => { - var _a3, _b2; - return { - name: f4, - schemaId: root.id, - type: root.node.types[f4], - value: (_a3 = root.node.propsValue) == null ? void 0 : _a3[f4], - attrs: (_b2 = root.node.propsAttrs) == null ? void 0 : _b2[f4] - }; - }), - rows: flattenToFrameNodes(root).map((f4) => nodeToFrame(f4)) - }; -}; -var kit = [rootToFrame(buttonNode), rootToFrame(dividerNode), rootToFrame(progressNode), rootToFrame(cardNode), rootToFrame(linkNode)]; - -// src/types/context.ts -var FilePropertyName = "File"; - -// src/utils/contexts/parsers.ts -var parsePropString = (str) => { - var _a2; - const [p1, p22] = (_a2 = str == null ? void 0 : str.match(/(\\.|[^.])+/g)) != null ? _a2 : []; - if (p22) - return { - field: p1, - property: p22 - }; - return { field: "File", property: p1 }; -}; - -// src/schemas/mdb.ts -var parseFieldValue = (value, type) => { - let valueProp = safelyParseJSON(value); - if (!type) - return {}; - if (!valueProp) { - if (type == "context") { - if ((value == null ? void 0 : value.length) > 0) { - valueProp = { - space: value - }; - } else { - valueProp = {}; - } - } else if (type.startsWith("date")) { - if ((value == null ? void 0 : value.length) > 0) { - valueProp = { - format: value - }; - } else { - valueProp = {}; - } - } else if (type.startsWith("fileprop")) { - if ((value == null ? void 0 : value.length) > 0) { - const [field, val] = value.split("."); - valueProp = { - field, - value: val - }; - } else { - valueProp = {}; - } - } else if (type.startsWith("option")) { - if ((value == null ? void 0 : value.length) > 0) { - const options = parseMultiString(value).map((f4) => ({ name: f4, value: f4 })); - valueProp = { - options - }; - } else { - valueProp = {}; - } - } - } - return valueProp != null ? valueProp : {}; -}; -var stickerForField = (f4) => { - var _a2, _b2, _c2, _d2, _e2; - return ((_a2 = f4.attrs) == null ? void 0 : _a2.length) > 0 ? (_d2 = (_b2 = safelyParseJSON(f4.attrs)) == null ? void 0 : _b2.icon) != null ? _d2 : (_c2 = fieldTypeForType(f4.type)) == null ? void 0 : _c2.icon : (_e2 = fieldTypeForType(f4.type)) == null ? void 0 : _e2.icon; -}; -var fieldTypeForType = (type) => fieldTypes.find((t4) => type == t4.type) || fieldTypes.find((t4) => type == t4.multiType); -var fieldTypes = [ - { - type: "unknown", - label: "", - restricted: true, - icon: "lucide//file-question" - }, - { - type: "text", - label: i18n_default.properties.text.label, - metadata: true, - icon: "lucide//text" - }, - { - type: "number", - label: i18n_default.properties.number.label, - metadata: true, - icon: "lucide//binary" - }, - { - type: "boolean", - label: i18n_default.properties.boolean.label, - metadata: true, - icon: "lucide//check-square" - }, - { - type: "date", - label: i18n_default.properties.date.label, - metadata: true, - icon: "lucide//calendar" - }, - { - type: "option", - label: i18n_default.properties.option.label, - multi: true, - multiType: "option-multi", - icon: "lucide//list" - }, - { - type: "file", - label: i18n_default.properties.file.label, - restricted: true, - icon: "ui//mk-make-h3" - }, - { - type: "fileprop", - label: i18n_default.properties.fileProperty.label, - icon: "lucide//list" - }, - { - type: "link", - label: i18n_default.properties.link.label, - multi: true, - multiType: "link-multi", - metadata: true, - icon: "lucide//file-text" - }, - { - type: "context", - label: i18n_default.properties.context.label, - icon: "ui//mk-make-note", - multi: true, - multiType: "context-multi" - }, - { - type: "object", - label: i18n_default.properties.object.label, - multi: true, - multiType: "object-multi", - metadata: true, - icon: "lucide//list-tree" - }, - { - type: "icon", - label: i18n_default.properties.icon.label, - multi: true, - multiType: "icon-multi", - icon: "lucide//gem", - restricted: true - }, - { - type: "image", - label: i18n_default.properties.image.label, - multi: true, - multiType: "image-multi", - metadata: true, - icon: "ui//mk-make-image" - }, - { - type: "color", - label: i18n_default.properties.color.label, - icon: "ui//mk-make-image", - restricted: true - }, - { - type: "space", - label: i18n_default.properties.space.label, - icon: "lucide//layout-grid", - restricted: true - }, - { - type: "super", - label: "Super Property", - icon: "lucide//zap", - restricted: true - } -]; -var defaultFileDBSchema = { - id: "files", - name: "Files", - type: "db", - primary: "true" -}; -var defaultFileListSchema = { - id: "filesView", - name: "Files", - type: "view", - def: { db: "files" } -}; -var mainFrameID = "main"; -var defaultMainFrameSchema = (id2) => ({ id: id2, name: id2, type: "frame", def: "", predicate: "", primary: "true" }); -var defaultFramesSchema = { - uniques: [], - cols: ["id", "name", "type", "def", "predicate", "primary"], - rows: [defaultMainFrameSchema(mainFrameID), frameSchemaToMDBSchema(defaultFileListSchema)] -}; -var defaultFolderSchema = { - uniques: [], - cols: ["id", "name", "type", "def", "predicate", "primary"], - rows: [defaultFileDBSchema] -}; -var fieldSchema = { - uniques: ["name,schemaId"], - cols: [ - "name", - "schemaId", - "type", - "value", - "attrs", - "hidden", - "unique", - "primary" - ] -}; -var defaultFolderFields = { - ...fieldSchema, - rows: [ - { - name: FilePropertyName, - schemaId: "files", - type: "file", - primary: "true", - hidden: "", - unique: "", - attrs: "", - value: "" - }, - { - name: i18n_default.properties.fileProperty.createdTime, - schemaId: "files", - type: "fileprop", - value: "File.ctime", - hidden: "", - unique: "", - attrs: "", - primary: "true" - } - ] -}; -var defaultFieldsForContext = (space) => { - if (space.uri.type == "tag") { - return defaultTagFields; - } else if (space.uri.type == "folder") { - return defaultFolderFields; - } - return defaultFolderFields; -}; -var defaultTableFields = [ - { - name: i18n_default.properties.defaultField, - schemaId: "", - type: "text" - } -]; -var defaultTagFields = { - ...fieldSchema, - rows: [ - { - name: FilePropertyName, - schemaId: "files", - type: "file", - primary: "true", - hidden: "", - unique: "", - attrs: "", - value: "" - } - ] -}; -var defaultMDBTableForContext = (space) => { - return defaultFolderMDBTable; -}; -var defaultFolderMDBTable = { - schema: defaultFileDBSchema, - cols: defaultFolderFields.rows, - rows: [] -}; -var defaultQueryMDBTable = { - schema: defaultFileDBSchema, - cols: defaultFolderFields.rows, - rows: [] -}; -var defaultTagMDBTable = { - schema: defaultFileDBSchema, - cols: defaultTagFields.rows, - rows: [] -}; -var fieldsToTable = (fields, schemas) => { - return fields.filter((s5) => schemas.find((g4) => g4.id == s5.schemaId && g4.type == "db")).reduce((p3, c4) => { - return { - ...p3, - ...p3[c4.schemaId] ? { - [c4.schemaId]: { - uniques: c4.unique == "true" ? [...p3[c4.schemaId].uniques, c4.name] : p3[c4.schemaId].uniques, - cols: [...p3[c4.schemaId].cols, c4.name], - rows: [] - } - } : { - [c4.schemaId]: { - uniques: c4.unique == "true" ? [c4.name] : [], - cols: [c4.name], - rows: [] - } - } - }; - }, {}); -}; -var defaultTablesForContext = (space) => { - if (space.uri.type == "tag") { - return defaultTagTables; - } else if (space.uri.type == "folder") { - return defaultFolderTables; - } - return defaultFolderTables; -}; -var defaultFolderTables = { - m_schema: defaultFolderSchema, - m_fields: defaultFolderFields, - ...fieldsToTable( - defaultFolderFields.rows, - defaultFolderSchema.rows - ) -}; -var defaultTagTables = { - m_schema: defaultFolderSchema, - m_fields: defaultTagFields, - ...fieldsToTable( - defaultTagFields.rows, - defaultFolderSchema.rows - ) -}; - -// src/components/SpaceView/Frames/DefaultFrames/DefaultFrames.ts -var defaultMainFrame = [ - { - ...groupNode.node, - id: "main", - type: "group", - rank: 0, - schemaId: "main", - props: { - note: "", - space: "" - }, - types: { - note: "link", - space: "space" - }, - propsValue: { - note: JSON.stringify({ - alias: "Space Note" - }), - space: JSON.stringify({ - alias: "Space Files" - }) - }, - styles: { - layout: `"column"`, - class: `'mk-f-main'` - } - }, - { - ...flowNode.node, - rank: 0, - props: { - value: `main.props.note` - }, - styles: { width: `'100%'` }, - parentId: "main", - schemaId: "main" - }, - { - ...spaceNode.node, - id: "context", - rank: 1, - props: { - value: `main.props.space` - }, - styles: { width: `'100%'` }, - parentId: "main", - schemaId: "main" - } -]; -var DefaultMDBTables = { - main: { - schema: defaultMainFrameSchema(mainFrameID), - cols: [{ name: "space", type: "space", schemaId: "main", value: JSON.stringify({ - alias: "Space Files" - }) }, { name: "note", type: "link", schemaId: "main", value: JSON.stringify({ - alias: "Space Note" - }) }], - rows: defaultMainFrame.map((f4) => nodeToFrame(f4)) - }, - filesView: { - schema: frameSchemaToMDBSchema(defaultFileListSchema), - cols: defaultFolderFields.rows, - rows: [] - } -}; - -// src/context/FramesMDBContext.tsx -var import_obsidian5 = require("obsidian"); - -// src/utils/sanitize.ts -var sanitizeTableName = (name) => { - return name == null ? void 0 : name.replace(/[^a-z0-9+]+/gi, ""); -}; -var sanitizeColumnName = (name) => { - if ((name == null ? void 0 : name.charAt(0)) == "_") { - return sanitizeColumnName(name.substring(1)); - } - return name == null ? void 0 : name.replace(/"/g, ``); -}; -var folderReservedRe = /^[+\$#^]+/; -var illegalRe = /[\/\?<>\\:\*\|":]/g; -var controlRe = /[\x00-\x1f\x80-\x9f]/g; -var reservedRe = /^\.+$/; -var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; -var sanitizeFolderName = (name) => { - const replacement = ""; - return name.replace(folderReservedRe, replacement).replace(illegalRe, replacement).replace(controlRe, replacement).replace(reservedRe, replacement).replace(windowsReservedRe, replacement); -}; -var sanitizeFileName = (name) => { - const replacement = ""; - return name.replace(illegalRe, replacement).replace(controlRe, replacement).replace(reservedRe, replacement).replace(windowsReservedRe, replacement); -}; -var sanitizeSQLStatement = (name) => { - return name == null ? void 0 : name.replace(/'/g, `''`); -}; - -// src/utils/db/db.ts -var import_obsidian4 = require("obsidian"); -var getDBFile = async (plugin, path, isRemote) => { - if (isRemote) { - return fetch(path).then((res) => res.arrayBuffer()); - } - if (!await plugin.app.vault.adapter.exists((0, import_obsidian4.normalizePath)(path))) { - return null; - } - const file = await plugin.app.vault.adapter.readBinary( - (0, import_obsidian4.normalizePath)(path) - ); - return file; -}; -var getDB = async (plugin, sqlJS, path, isRemote) => { - const buf = await getDBFile(plugin, path, isRemote); - if (buf) { - return new sqlJS.Database(new Uint8Array(buf)); - } - return new sqlJS.Database(); -}; -var saveDBFile = async (plugin, path, binary) => { - if (!await plugin.app.vault.adapter.exists( - removeTrailingSlashFromFolder(getParentPathFromString(path)) - )) { - await plugin.app.vault.createFolder(getParentPathFromString(path)); - } - const file = plugin.app.vault.adapter.writeBinary( - (0, import_obsidian4.normalizePath)(path), - binary - ); - return file; -}; -var mdbFrameToDBTables = (tables, uniques) => { - return Object.keys(tables).reduce((p3, c4) => { - return { - ...p3, - [c4]: { - uniques: defaultFrameSchema.uniques, - cols: defaultFrameSchema.cols, - rows: tables[c4].rows - } - }; - }, {}); -}; -var schemasAndFields = (tables) => { - return { - m_fields: { - uniques: fieldSchema.uniques, - cols: fieldSchema.cols, - rows: Object.values(tables).flatMap((f4) => f4.cols) - }, - m_schema: defaultFramesSchema - }; -}; -var dbResultsToDBTables = (res) => { - return res.reduce( - (p3, c4, i4) => [ - ...p3, - { - cols: c4.columns, - rows: c4 ? c4.values.map( - (r3) => c4.columns.reduce( - (prev, curr, index) => ({ ...prev, [curr]: r3[index] }), - {} - ) - ) : [] - } - ], - [] - ); -}; -var selectDB = (db, table, condition, fields) => { - const fieldsStr = fields != null ? fields : "*"; - const sqlstr = condition ? `SELECT ${fieldsStr} FROM "${table}" WHERE ${condition};` : `SELECT ${fieldsStr} FROM ${table};`; - let tables; - try { - tables = dbResultsToDBTables(db.exec(sqlstr)); - } catch (e4) { - return null; - } - if (tables.length == 1) - return tables[0]; - return null; -}; -var deleteFromDB = (db, table, condition) => { - const sqlstr = `DELETE FROM "${table}" WHERE ${condition};`; - try { - db.exec(sqlstr); - } catch (e4) { - console.log(e4); - } -}; -var dropTable = (db, table) => { - const sqlstr = `DROP TABLE IF EXISTS "${table}";`; - try { - db.exec(sqlstr); - } catch (e4) { - console.log(e4); - } -}; -var replaceDB = (db, tables) => { - const sqlstr = serializeSQLStatements(Object.keys(tables).map((t4) => { - const tableFields = tables[t4].cols; - const fieldQuery = serializeSQLFieldNames(uniq(tableFields).filter((f4) => f4).map((f4) => `'${sanitizeSQLStatement(f4)}' char`)); - const rowsQuery = tables[t4].rows.reduce((prev, curr) => { - return `${prev} REPLACE INTO "${t4}" VALUES (${serializeSQLValues(tableFields.map((c4) => { - var _a2; - return `'${sanitizeSQLStatement((_a2 = curr == null ? void 0 : curr[c4]) != null ? _a2 : "")}'`; - }))});`; - }, ""); - const idxQuery = tables[t4].uniques.filter((f4) => f4).reduce((p3, c4) => { - return `${p3} CREATE UNIQUE INDEX IF NOT EXISTS "idx_${t4}_${c4.replace( - /,/g, - "_" - )}" ON "${t4}"(${c4});`; - }, ""); - const insertQuery = `CREATE TABLE IF NOT EXISTS "${t4}" (${fieldQuery}); ${idxQuery} BEGIN TRANSACTION; ${rowsQuery} COMMIT;`; - return `DROP INDEX IF EXISTS "idx_${t4}__id"; DROP TABLE IF EXISTS "${t4}"; ${fieldQuery.length > 0 ? insertQuery : ""}`; - })); - try { - db.exec(sqlstr); - } catch (e4) { - console.log(sqlstr); - console.log(e4); - } -}; -var saveSpaceDBToPath = async (plugin, space, type, tables) => { - let returnValue = false; - if (type == "context") { - returnValue = await saveDBToPath(plugin, space.dbPath, tables); - plugin.index.reloadContext(space); - } else if (type == "frames") { - returnValue = await saveDBToPath(plugin, space.framePath, tables); - plugin.index.reloadFrames(space); - } - return returnValue; -}; -var saveDBToPath = async (plugin, path, tables) => { - const sqlJS = await plugin.sqlJS(); - const db = await getDB(plugin, sqlJS, path); - if (!db) { - db.close(); - return false; - } - replaceDB(db, tables); - await saveDBFile(plugin, path, db.export().buffer); - db.close(); - return true; -}; - -// src/utils/contexts/mdb.ts -var dbTableToMDBTable = (table, schema, fields) => { - var _a2; - return { - schema, - cols: fields, - rows: (_a2 = table == null ? void 0 : table.rows) != null ? _a2 : [] - }; -}; -var updateFieldsToSchema = (fields, space) => { - const defaultFields = defaultFieldsForContext(space); - return [ - ...fields, - ...defaultFields.rows.filter( - (f4) => !fields.some((g4) => g4.name == f4.name && g4.schemaId == f4.schemaId) - ) - ]; -}; -var getContextMDB = async (plugin, space) => { - if (!space) - return null; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, space.dbPath, space.isRemote); - if (!buf) { - return null; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - await sanitizeTableSchema(plugin, db, space, "context"); - let fields; - let schemas; - try { - fields = dbResultsToDBTables( - db.exec(`SELECT * FROM m_fields`) - )[0].rows; - schemas = dbResultsToDBTables( - db.exec(`SELECT * FROM m_schema`) - )[0].rows; - } catch (e4) { - db.close(); - return null; - } - let dbTable; - try { - dbTable = schemas.filter((f4) => f4.type == "db").map((f4) => ({ [f4.id]: dbResultsToDBTables( - db.exec( - `SELECT * FROM "${f4.id}"` - ) - )[0] })).reduce((p3, c4) => ({ ...p3, ...c4 }), {}); - } catch (e4) { - db.close(); - return null; - } - db.close(); - return { - schemas, - fields, - tables: dbTable - }; -}; -var getFramesMDB = async (plugin, space) => { - var _a2, _b2, _c2, _d2; - if (!space) - return null; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, space.framePath, space.isRemote); - if (!buf) { - return null; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - let fields; - let schemas; - try { - fields = (_b2 = (_a2 = dbResultsToDBTables( - db.exec(`SELECT * FROM m_fields`) - )[0]) == null ? void 0 : _a2.rows) != null ? _b2 : []; - schemas = (_d2 = (_c2 = dbResultsToDBTables( - db.exec(`SELECT * FROM m_schema`) - )[0]) == null ? void 0 : _c2.rows) != null ? _d2 : []; - } catch (e4) { - console.log(e4); - db.close(); - return null; - } - const dbTable = schemas.filter((f4) => f4.type == "frame" || f4.type == "listitem").map((f4) => { - try { - const table = dbResultsToDBTables( - db.exec( - `SELECT * FROM "${f4.id}"` - ) - )[0]; - return { [f4.id]: table }; - } catch (e4) { - return {}; - } - }).reduce((p3, c4) => ({ ...p3, ...c4 }), {}); - db.close(); - return { - schemas, - fields, - tables: dbTable - }; -}; -var dbPathForSpaceInfo = (spaceInfo, type) => type == "context" ? spaceInfo.dbPath : type == "frames" ? spaceInfo.framePath : null; -var getMDBTable = async (plugin, space, table, dbType) => { - if (!space) - return null; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, space.dbPath, space.isRemote); - if (!buf) { - return null; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - await sanitizeTableSchema(plugin, db, space, dbType); - let fieldsTables; - let schema; - try { - fieldsTables = dbResultsToDBTables( - db.exec(`SELECT * FROM m_fields WHERE schemaId = '${table}'`) - ); - schema = dbResultsToDBTables( - db.exec(`SELECT * FROM m_schema WHERE id = '${table}'`) - )[0].rows[0]; - } catch (e4) { - db.close(); - return null; - } - if (fieldsTables.length == 0) { - db.close(); - return { - schema, - cols: [], - rows: [] - }; - } - const fields = fieldsTables[0].rows.filter( - (f4) => f4.name.length > 0 - ); - const dbTable = dbResultsToDBTables( - db.exec( - `SELECT ${serializeSQLFieldNames( - fields.reduce((p3, c4) => [...p3, `"${c4.name}"`], []) - )} FROM "${table}"` - ) - ); - db.close(); - return dbTableToMDBTable( - dbTable[0], - schema, - schema.primary ? updateFieldsToSchema(fields, space) : fields - ); -}; -var deleteMDBTable = async (plugin, space, table, dbPath) => { - if (space.readOnly) - return false; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, dbPath, space.isRemote); - if (!buf) { - return false; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - deleteFromDB(db, "m_schema", `id = '${sanitizeSQLStatement(table)}'`); - deleteFromDB(db, "m_schema", `def = '${sanitizeSQLStatement(table)}'`); - deleteFromDB(db, "m_fields", `schemaId = '${sanitizeSQLStatement(table)}'`); - dropTable(db, table); - await saveDBFile(plugin, dbPath, db.export().buffer); - db.close(); - return true; -}; -var getMDBTableSchemas = async (plugin, space, dbType) => { - var _a2, _b2; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, dbPathForSpaceInfo(space, dbType), space.isRemote); - if (!buf) { - return null; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - await sanitizeTableSchema(plugin, db, space, dbType); - const tables = db.exec(`SELECT * FROM m_schema`); - db.close(); - return ((_b2 = (_a2 = tables[0]) == null ? void 0 : _a2.values) != null ? _b2 : []).map((f4) => { - const [id2, name, type, def, predicate, primary] = f4; - return { id: id2, name, type, def, predicate, primary }; - }); -}; -var saveMDBToPath = async (plugin, context, mdb) => { - var _a2, _b2; - if (context.readOnly) - return; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, context.dbPath, context.isRemote); - if (!buf) { - return null; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - const fieldsTables = dbResultsToDBTables( - db.exec(`SELECT * FROM m_fields WHERE schemaId != '${mdb.schema.id}'`) - ); - const schemaTables = dbResultsToDBTables( - db.exec(`SELECT * FROM m_schema`) - ); - const newSchemas = schemaTables.length > 0 ? { ...schemaTables[0], uniques: [], rows: [...schemaTables[0].rows.filter((f4) => f4.id != mdb.schema.id), mdb.schema] } : { ...defaultFolderSchema, rows: [...defaultFolderSchema.rows, mdb.schema] }; - const tables = { - m_schema: newSchemas, - m_fields: { - uniques: fieldSchema.uniques, - cols: fieldSchema.cols, - rows: [...(_b2 = (_a2 = fieldsTables[0]) == null ? void 0 : _a2.rows) != null ? _b2 : [], ...mdb.cols] - }, - [mdb.schema.id]: { - uniques: [], - cols: mdb.cols.map((c4) => c4.name), - rows: mdb.rows - } - }; - db.close(); - return saveSpaceDBToPath(plugin, context, "context", tables); -}; -var optionValuesForColumn = (column, table) => { - var _a2; - return uniq( - (_a2 = table == null ? void 0 : table.rows.reduce((p3, c4) => { - return [...p3, ...parseMultiString(c4[column])]; - }, [])) != null ? _a2 : [] - ); -}; -var defaultTableDataForContext = (plugin, space) => { - const files = [...plugin.index.getSpaceItems(space.path, true)]; - return { - ...defaultMDBTableForContext(space), - rows: files.map((f4) => ({ File: f4.path })) - }; -}; -var createFramesMDB = async (plugin, space) => { - const dbField = { - m_schema: defaultFramesSchema, - m_fields: { - uniques: fieldSchema.uniques, - cols: fieldSchema.cols, - rows: [] - } - }; - const result = await saveSpaceDBToPath(plugin, space, "frames", dbField); - if (result) { - await plugin.index.reloadFrames(space); - return true; - } - return false; -}; -var createContextMDB = async (plugin, space) => { - var _a2; - const table = defaultTableDataForContext(plugin, space); - if (table) { - const defaultFields = defaultFieldsForContext(space); - const defaultTable = defaultTablesForContext(space); - const dbField = { - ...defaultTable, - m_fields: { - uniques: defaultFields.uniques, - cols: defaultFields.cols, - rows: [...(_a2 = defaultFields.rows) != null ? _a2 : [], ...table.cols] - }, - [table.schema.id]: { - uniques: table.cols.filter((c4) => c4.unique == "true").map((c4) => c4.name), - cols: table.cols.map((c4) => c4.name), - rows: table.rows - } - }; - const result = await saveSpaceDBToPath(plugin, space, "context", dbField); - if (result) { - await plugin.index.reloadContext(space); - table.rows.map((f4) => getAbstractFileAtPath(plugin, f4.File)).forEach((f4) => f4 && plugin.index.reloadFile(f4, true)); - return true; - } - return false; - } - return false; -}; -var sanitizeTableSchema = async (plugin, db, space, dbType) => { - const tableRes = db.exec( - `SELECT name FROM sqlite_master WHERE type='table';` - ); - if (dbType == "context") { - if (!tableRes[0] || !tableRes[0].values.some((f4) => f4[0] == "m_schema") || !tableRes[0].values.some((f4) => f4[0] == "m_fields") || !tableRes[0].values.some((f4) => f4[0] == "files")) { - await createContextMDB(plugin, space); - } - } else { - if (!tableRes[0] || !tableRes[0].values.some((f4) => f4[0] == "m_schema") || !tableRes[0].values.some((f4) => f4[0] == "m_fields")) { - await createFramesMDB(plugin, space); - } - } -}; -var createNewRow = (mdb, row, index) => { - if (index) { - return { - ...mdb, - rows: insert(mdb.rows, index, row) - }; - } - return { - ...mdb, - rows: [...mdb.rows, row] - }; -}; -var deleteSpaceFolder = async (plugin, space) => { - const spacePath = folderForSpace(space, plugin); - if (getAbstractFileAtPath(plugin, spacePath)) { - await deleteFile(plugin, getAbstractFileAtPath(plugin, spacePath)); - } -}; -var spaceFolderDelete = (space) => { - app.workspace.iterateLeaves((leaf) => { - if (leaf.view.getViewType() == SPACE_VIEW_TYPE && leaf.view.getState().path == space) { - leaf.setViewState({ type: "empty" }); - } - }, app.workspace["rootSplit"]); -}; -var renameSpaceFolder = async (plugin, space, newSpace) => { - const spacePath = folderForSpace(space, plugin); - if (getAbstractFileAtPath(plugin, spacePath)) { - if (!getAbstractFileAtPath( - plugin, - folderForSpace(newSpace, plugin) - )) { - await renameFile( - plugin, - getAbstractFileAtPath(plugin, spacePath), - newSpace - ); - } else { - await deleteFile(plugin, getAbstractFileAtPath(plugin, spacePath)); - } - } -}; - -// src/utils/frames/mdb.ts -var getMFrameTables = async (plugin, space) => { - if (!frames) - return null; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, space.framePath, space.isRemote); - if (!buf) { - return null; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - const schemas = dbResultsToDBTables( - db.exec(`SELECT * FROM m_schema`) - )[0].rows; - const mdbTables = {}; - schemas.forEach((schema) => { - var _a2, _b2; - let fieldsTables; - try { - fieldsTables = dbResultsToDBTables( - db.exec(`SELECT * FROM m_fields WHERE schemaId = '${schema.id}'`) - ); - } catch (e4) { - return; - } - const fields = ((_b2 = (_a2 = fieldsTables == null ? void 0 : fieldsTables[0]) == null ? void 0 : _a2.rows) != null ? _b2 : []).filter( - (f4) => f4.name.length > 0 - ); - let dbTable; - try { - dbTable = dbResultsToDBTables(db.exec(`SELECT * FROM "${schema.id}"`)); - mdbTables[schema.id] = dbTableToMDBTable( - dbTable[0], - schema, - fields - ); - } catch (e4) { - mdbTables[schema.id] = { - schema, - cols: fields, - rows: [] - }; - return; - } - }); - db.close(); - return mdbTables; -}; -var saveMFramesToPath = async (plugin, space, mdb) => { - var _a2, _b2, _c2; - if (space.readOnly) - return; - const sqlJS = await plugin.sqlJS(); - const buf = await getDBFile(plugin, space.framePath, space.isRemote); - if (!buf) { - return null; - } - const db = new sqlJS.Database(new Uint8Array(buf)); - const fieldsTables = dbResultsToDBTables( - db.exec(`SELECT * FROM m_fields WHERE schemaId != '${mdb.schema.id}'`) - ); - const schemaTables = dbResultsToDBTables( - db.exec(`SELECT * FROM m_schema`) - ); - const newSchemas = ((_a2 = schemaTables[0]) == null ? void 0 : _a2.rows) ? { ...schemaTables[0], uniques: [], rows: [...schemaTables[0].rows.filter((f4) => f4.id != mdb.schema.id), mdb.schema] } : { ...defaultFramesSchema, rows: [...defaultFramesSchema.rows, mdb.schema] }; - const tables = { - m_schema: newSchemas, - m_fields: { - uniques: fieldSchema.uniques, - cols: fieldSchema.cols, - rows: [...(_c2 = (_b2 = fieldsTables[0]) == null ? void 0 : _b2.rows) != null ? _c2 : [], ...mdb.cols] - }, - [mdb.schema.id]: { - uniques: defaultFrameSchema.uniques, - cols: defaultFrameSchema.cols, - rows: mdb.rows - } - }; - db.close(); - return saveSpaceDBToPath(plugin, space, "frames", tables); -}; - -// src/context/SpaceContext.tsx -var SpaceContext = F({ - spaceInfo: null, - readMode: false, - spaceCache: null -}); -var SpaceContextProvider = (props2) => { - var _a2; - const readMode = (_a2 = props2.space) == null ? void 0 : _a2.readOnly; - const spaceInfo = F2(() => { - return props2.space; - }, [props2.space]); - const [spaceCache, setSpaceCache] = h2(null); - const reloadSpace = () => { - const spaceCache2 = props2.plugin.index.spacesIndex.get(spaceInfo.path); - if (spaceCache2) { - setSpaceCache(spaceCache2); - } - }; - p2(() => { - reloadSpace(); - }, [spaceInfo]); - const refreshSpace = T2( - async (evt) => { - if (evt.detail.type == "space") { - if (evt.detail.name == spaceInfo.path) { - reloadSpace(); - } - } - }, - [props2.plugin, spaceInfo] - ); - p2(() => { - window.addEventListener(eventTypes.spacesChange, refreshSpace); - return () => { - window.removeEventListener(eventTypes.spacesChange, refreshSpace); - }; - }, [refreshSpace]); - return /* @__PURE__ */ Cn.createElement(SpaceContext.Provider, { - value: { - spaceCache, - readMode, - spaceInfo - } - }, props2.children); -}; - -// src/context/FramesMDBContext.tsx -var FramesMDBContext = F({ - frameSchemas: [], - frames: [], - tableData: null, - saveFrame: () => null, - frameSchema: null, - setFrameSchema: () => null, - saveSchema: () => null, - deleteSchema: () => null, - dbFileExists: false, - getMDBData: () => null -}); -var FramesMDBProvider = (props2) => { - const [dbFileExists, setDBFileExists] = h2(false); - const [schemaTable, setSchemaTable] = h2(null); - const schemas = F2( - () => { - var _a2, _b2; - return (_b2 = ((_a2 = schemaTable == null ? void 0 : schemaTable.rows) != null ? _a2 : []).map( - (f4) => mdbSchemaToFrameSchema(f4) - )) != null ? _b2 : []; - }, - [schemaTable] - ); - const frames2 = schemas.filter((f4) => f4.type == "frame"); - const [frameData, setFrameData] = h2(null); - const [frameSchema, setFrameSchema] = h2(null); - const tableData = F2(() => { - return frameData == null ? void 0 : frameData[frameSchema == null ? void 0 : frameSchema.id]; - }, [frameData, frameSchema]); - const defaultSchema = defaultFramesSchema; - const { spaceInfo, readMode } = q2(SpaceContext); - const deleteSchema = async (table) => { - if (table.primary) - return; - const deleteResult = await deleteMDBTable( - props2.plugin, - spaceInfo, - table.id, - spaceInfo.framePath - ); - if (deleteResult) { - const newSchemaTable = { - ...schemaTable, - rows: schemaTable.rows.filter( - (f4) => f4.id != table.id && f4.def != table.id - ) - }; - setSchemaTable(newSchemaTable); - } - }; - const saveSchema = async (table) => { - const newSchema = schemaTable.rows.find((f4) => f4.id == table.id) ? true : false; - const newSchemaTable = newSchema ? { - ...schemaTable, - rows: schemaTable.rows.map( - (f4) => f4.id == table.id ? frameSchemaToMDBSchema(table) : f4 - ) - } : { - ...schemaTable, - rows: [...schemaTable.rows, frameSchemaToMDBSchema(table)] - }; - if (!spaceInfo.readOnly) { - if (!dbFileExists) { - const dbTables = { - ...mdbFrameToDBTables(DefaultMDBTables, { - m_fields: fieldSchema.uniques, - main: defaultFrameSchema.uniques - }), - ...schemasAndFields(DefaultMDBTables), - m_schema: newSchemaTable - }; - await saveSpaceDBToPath( - props2.plugin, - spaceInfo, - "frames", - dbTables - ).then((f4) => { - setDBFileExists(true); - f4 ? getMDBData() : new import_obsidian5.Notice("DB ERROR"); - }); - setDBFileExists(true); - } else { - await saveSpaceDBToPath(props2.plugin, spaceInfo, "frames", { - m_schema: newSchemaTable - }); - } - } - if (table.id == (frameSchema == null ? void 0 : frameSchema.id)) { - setFrameSchema(table); - setFrameData((f4) => ({ - ...f4, - [table.id]: { - ...f4[table.id], - schema: frameSchemaToMDBSchema(table) - } - })); - } - setSchemaTable(newSchemaTable); - }; - p2(() => { - if (schemaTable) - getMDBData().then((f4) => { - if (f4 && Object.keys(f4).length > 0) { - setFrameData(f4); - } - }); - }, [schemaTable]); - p2(() => { - var _a2, _b2; - if (schemaTable) { - if (props2.schema) { - if ((frameSchema == null ? void 0 : frameSchema.id) != props2.schema) { - const preselectSchema = schemaTable.rows.find( - (g4) => g4.id == props2.schema - ); - if (preselectSchema) { - if (preselectSchema.type == "frame" || preselectSchema.type == "listitem") { - setFrameSchema(mdbSchemaToFrameSchema(preselectSchema)); - return; - } else { - const preselectDBSchema = schemaTable.rows.find( - (g4) => g4.id == preselectSchema.def - ); - if (preselectDBSchema) { - setFrameSchema(mdbSchemaToFrameSchema(preselectDBSchema)); - return; - } - } - } else { - const newSchema = { - id: uniqueNameFromString( - sanitizeTableName(props2.schema), - schemaTable.rows.map((g4) => g4.id) - ), - name: props2.schema, - type: "frame" - }; - setFrameSchema(newSchema); - } - } - } else { - if (!frameSchema) { - setFrameSchema( - mdbSchemaToFrameSchema( - (_a2 = schemaTable.rows) == null ? void 0 : _a2.find((g4) => g4.type == "frame") - ) - ); - } else { - setFrameSchema( - mdbSchemaToFrameSchema( - (_b2 = schemaTable.rows) == null ? void 0 : _b2.find((g4) => g4.id == frameSchema.id) - ) - ); - } - } - } - }, [schemaTable]); - const loadTables = T2(async () => { - if (!spaceInfo) - return; - const mdbExists = await props2.plugin.app.vault.adapter.exists( - spaceInfo.framePath - ); - if (mdbExists || spaceInfo.isRemote) { - setDBFileExists(true); - getMDBTableSchemas(props2.plugin, spaceInfo, "frames").then((f4) => { - if (f4) - setSchemaTable((prev) => ({ - ...defaultSchema, - rows: f4 - })); - }); - } else { - if (props2.schema) { - setSchemaTable((prev) => defaultSchema); - } else { - setSchemaTable((prev) => defaultSchema); - } - } - }, [defaultSchema, props2.plugin, props2.schema, spaceInfo]); - const refreshSpace = T2( - async (evt) => { - if (evt.detail.type == "frames" && evt.detail.name == spaceInfo.path) { - loadTables(); - return; - } - }, - [spaceInfo, loadTables] - ); - p2(() => { - window.addEventListener(eventTypes.spacesChange, refreshSpace); - return () => { - window.removeEventListener(eventTypes.spacesChange, refreshSpace); - }; - }, [refreshSpace]); - const getMDBData = async () => { - if (dbFileExists) { - return await getMFrameTables(props2.plugin, spaceInfo); - } else { - return DefaultMDBTables; - } - }; - p2(() => { - loadTables(); - }, [spaceInfo]); - const saveFrame = async (newTable) => { - if (spaceInfo.readOnly) - return; - if (!dbFileExists) { - const dbTables = { - ...mdbFrameToDBTables(DefaultMDBTables, { - m_fields: fieldSchema.uniques, - main: defaultFrameSchema.uniques - }), - ...schemasAndFields(DefaultMDBTables), - [newTable.schema.id]: { - uniques: defaultFrameSchema.uniques, - cols: defaultFrameSchema.cols, - rows: newTable.rows - } - }; - await saveSpaceDBToPath(props2.plugin, spaceInfo, "frames", dbTables).then( - (f4) => { - setDBFileExists(true); - f4 ? getMDBData() : new import_obsidian5.Notice("DB ERROR"); - } - ); - } else { - await saveMFramesToPath( - props2.plugin, - spaceInfo, - newTable - ).then((f4) => { - f4 ? setFrameData((p3) => ({ - ...p3, - [newTable.schema.id]: newTable - })) : new import_obsidian5.Notice("DB ERROR"); - }); - } - }; - return /* @__PURE__ */ Cn.createElement(FramesMDBContext.Provider, { - value: { - frames: frames2, - tableData, - saveFrame, - frameSchemas: schemas, - saveSchema, - deleteSchema, - dbFileExists, - frameSchema, - setFrameSchema, - getMDBData - } - }, props2.children); -}; - -// src/components/SpaceView/Contexts/SpaceView.tsx -var import_obsidian47 = require("obsidian"); - -// node_modules/@dnd-kit/utilities/dist/utilities.esm.js -function useCombinedRefs() { - for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { - refs[_key] = arguments[_key]; - } - return F2( - () => (node) => { - refs.forEach((ref2) => ref2(node)); - }, - refs - ); -} -var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; -function isWindow(element) { - const elementString = Object.prototype.toString.call(element); - return elementString === "[object Window]" || elementString === "[object global]"; -} -function isNode(node) { - return "nodeType" in node; -} -function getWindow(target) { - var _target$ownerDocument, _target$ownerDocument2; - if (!target) { - return window; - } - if (isWindow(target)) { - return target; - } - if (!isNode(target)) { - return window; - } - return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; -} -function isDocument(node) { - const { - Document - } = getWindow(node); - return node instanceof Document; -} -function isHTMLElement(node) { - if (isWindow(node)) { - return false; - } - return node instanceof getWindow(node).HTMLElement; -} -function isSVGElement(node) { - return node instanceof getWindow(node).SVGElement; -} -function getOwnerDocument(target) { - if (!target) { - return document; - } - if (isWindow(target)) { - return target.document; - } - if (!isNode(target)) { - return document; - } - if (isDocument(target)) { - return target; - } - if (isHTMLElement(target)) { - return target.ownerDocument; - } - return document; -} -var useIsomorphicLayoutEffect = canUseDOM ? y2 : p2; -function useEvent(handler) { - const handlerRef = _2(handler); - useIsomorphicLayoutEffect(() => { - handlerRef.current = handler; - }); - return T2(function() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return handlerRef.current == null ? void 0 : handlerRef.current(...args); - }, []); -} -function useInterval() { - const intervalRef = _2(null); - const set = T2((listener, duration) => { - intervalRef.current = setInterval(listener, duration); - }, []); - const clear = T2(() => { - if (intervalRef.current !== null) { - clearInterval(intervalRef.current); - intervalRef.current = null; - } - }, []); - return [set, clear]; -} -function useLatestValue(value, dependencies) { - if (dependencies === void 0) { - dependencies = [value]; - } - const valueRef = _2(value); - useIsomorphicLayoutEffect(() => { - if (valueRef.current !== value) { - valueRef.current = value; - } - }, dependencies); - return valueRef; -} -function useLazyMemo(callback, dependencies) { - const valueRef = _2(); - return F2( - () => { - const newValue = callback(valueRef.current); - valueRef.current = newValue; - return newValue; - }, - [...dependencies] - ); -} -function useNodeRef(onChange) { - const onChangeHandler = useEvent(onChange); - const node = _2(null); - const setNodeRef = T2( - (element) => { - if (element !== node.current) { - onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); - } - node.current = element; - }, - [] - ); - return [node, setNodeRef]; -} -function usePrevious(value) { - const ref2 = _2(); - p2(() => { - ref2.current = value; - }, [value]); - return ref2.current; -} -var ids = {}; -function useUniqueId(prefix, value) { - return F2(() => { - if (value) { - return value; - } - const id2 = ids[prefix] == null ? 0 : ids[prefix] + 1; - ids[prefix] = id2; - return prefix + "-" + id2; - }, [prefix, value]); -} -function createAdjustmentFn(modifier) { - return function(object) { - for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - adjustments[_key - 1] = arguments[_key]; - } - return adjustments.reduce((accumulator, adjustment) => { - const entries = Object.entries(adjustment); - for (const [key2, valueAdjustment] of entries) { - const value = accumulator[key2]; - if (value != null) { - accumulator[key2] = value + modifier * valueAdjustment; - } - } - return accumulator; - }, { - ...object - }); - }; -} -var add = /* @__PURE__ */ createAdjustmentFn(1); -var subtract = /* @__PURE__ */ createAdjustmentFn(-1); -function hasViewportRelativeCoordinates(event) { - return "clientX" in event && "clientY" in event; -} -function isKeyboardEvent(event) { - if (!event) { - return false; - } - const { - KeyboardEvent - } = getWindow(event.target); - return KeyboardEvent && event instanceof KeyboardEvent; -} -function isTouchEvent(event) { - if (!event) { - return false; - } - const { - TouchEvent - } = getWindow(event.target); - return TouchEvent && event instanceof TouchEvent; -} -function getEventCoordinates(event) { - if (isTouchEvent(event)) { - if (event.touches && event.touches.length) { - const { - clientX: x5, - clientY: y5 - } = event.touches[0]; - return { - x: x5, - y: y5 - }; - } else if (event.changedTouches && event.changedTouches.length) { - const { - clientX: x5, - clientY: y5 - } = event.changedTouches[0]; - return { - x: x5, - y: y5 - }; - } - } - if (hasViewportRelativeCoordinates(event)) { - return { - x: event.clientX, - y: event.clientY - }; - } - return null; -} -var CSS = /* @__PURE__ */ Object.freeze({ - Translate: { - toString(transform) { - if (!transform) { - return; - } - const { - x: x5, - y: y5 - } = transform; - return "translate3d(" + (x5 ? Math.round(x5) : 0) + "px, " + (y5 ? Math.round(y5) : 0) + "px, 0)"; - } - }, - Scale: { - toString(transform) { - if (!transform) { - return; - } - const { - scaleX, - scaleY - } = transform; - return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; - } - }, - Transform: { - toString(transform) { - if (!transform) { - return; - } - return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" "); - } - }, - Transition: { - toString(_ref) { - let { - property, - duration, - easing - } = _ref; - return property + " " + duration + "ms " + easing; - } - } -}); -var SELECTOR = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]"; -function findFirstFocusableNode(element) { - if (element.matches(SELECTOR)) { - return element; - } - return element.querySelector(SELECTOR); -} - -// node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js -var hiddenStyles = { - display: "none" -}; -function HiddenText(_ref) { - let { - id: id2, - value - } = _ref; - return Cn.createElement("div", { - id: id2, - style: hiddenStyles - }, value); -} -var visuallyHidden = { - position: "fixed", - width: 1, - height: 1, - margin: -1, - border: 0, - padding: 0, - overflow: "hidden", - clip: "rect(0 0 0 0)", - clipPath: "inset(100%)", - whiteSpace: "nowrap" -}; -function LiveRegion(_ref) { - let { - id: id2, - announcement - } = _ref; - return Cn.createElement("div", { - id: id2, - style: visuallyHidden, - role: "status", - "aria-live": "assertive", - "aria-atomic": true - }, announcement); -} -function useAnnouncement() { - const [announcement, setAnnouncement] = h2(""); - const announce = T2((value) => { - if (value != null) { - setAnnouncement(value); - } - }, []); - return { - announce, - announcement - }; -} - -// node_modules/@dnd-kit/core/dist/core.esm.js -var DndMonitorContext = /* @__PURE__ */ F(null); -function useDndMonitor(listener) { - const registerListener = q2(DndMonitorContext); - p2(() => { - if (!registerListener) { - throw new Error("useDndMonitor must be used within a children of "); - } - const unsubscribe = registerListener(listener); - return unsubscribe; - }, [listener, registerListener]); -} -function useDndMonitorProvider() { - const [listeners] = h2(() => /* @__PURE__ */ new Set()); - const registerListener = T2((listener) => { - listeners.add(listener); - return () => listeners.delete(listener); - }, [listeners]); - const dispatch = T2((_ref) => { - let { - type, - event - } = _ref; - listeners.forEach((listener) => { - var _listener$type; - return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); - }); - }, [listeners]); - return [dispatch, registerListener]; -} -var defaultScreenReaderInstructions = { - draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " -}; -var defaultAnnouncements = { - onDragStart(_ref) { - let { - active - } = _ref; - return "Picked up draggable item " + active.id + "."; - }, - onDragOver(_ref2) { - let { - active, - over - } = _ref2; - if (over) { - return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; - } - return "Draggable item " + active.id + " is no longer over a droppable area."; - }, - onDragEnd(_ref3) { - let { - active, - over - } = _ref3; - if (over) { - return "Draggable item " + active.id + " was dropped over droppable area " + over.id; - } - return "Draggable item " + active.id + " was dropped."; - }, - onDragCancel(_ref4) { - let { - active - } = _ref4; - return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; - } -}; -function Accessibility(_ref) { - let { - announcements = defaultAnnouncements, - container, - hiddenTextDescribedById, - screenReaderInstructions = defaultScreenReaderInstructions - } = _ref; - const { - announce, - announcement - } = useAnnouncement(); - const liveRegionId = useUniqueId("DndLiveRegion"); - const [mounted, setMounted] = h2(false); - p2(() => { - setMounted(true); - }, []); - useDndMonitor(F2(() => ({ - onDragStart(_ref2) { - let { - active - } = _ref2; - announce(announcements.onDragStart({ - active - })); - }, - onDragMove(_ref3) { - let { - active, - over - } = _ref3; - if (announcements.onDragMove) { - announce(announcements.onDragMove({ - active, - over - })); - } - }, - onDragOver(_ref4) { - let { - active, - over - } = _ref4; - announce(announcements.onDragOver({ - active, - over - })); - }, - onDragEnd(_ref5) { - let { - active, - over - } = _ref5; - announce(announcements.onDragEnd({ - active, - over - })); - }, - onDragCancel(_ref6) { - let { - active, - over - } = _ref6; - announce(announcements.onDragCancel({ - active, - over - })); - } - }), [announce, announcements])); - if (!mounted) { - return null; - } - const markup = Cn.createElement(Cn.Fragment, null, Cn.createElement(HiddenText, { - id: hiddenTextDescribedById, - value: screenReaderInstructions.draggable - }), Cn.createElement(LiveRegion, { - id: liveRegionId, - announcement - })); - return container ? z3(markup, container) : markup; -} -var Action; -(function(Action2) { - Action2["DragStart"] = "dragStart"; - Action2["DragMove"] = "dragMove"; - Action2["DragEnd"] = "dragEnd"; - Action2["DragCancel"] = "dragCancel"; - Action2["DragOver"] = "dragOver"; - Action2["RegisterDroppable"] = "registerDroppable"; - Action2["SetDroppableDisabled"] = "setDroppableDisabled"; - Action2["UnregisterDroppable"] = "unregisterDroppable"; -})(Action || (Action = {})); -function noop() { -} -function useSensor(sensor, options) { - return F2( - () => ({ - sensor, - options: options != null ? options : {} - }), - [sensor, options] - ); -} -function useSensors() { - for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { - sensors[_key] = arguments[_key]; - } - return F2( - () => [...sensors].filter((sensor) => sensor != null), - [...sensors] - ); -} -var defaultCoordinates = /* @__PURE__ */ Object.freeze({ - x: 0, - y: 0 -}); -function distanceBetween(p1, p22) { - return Math.sqrt(Math.pow(p1.x - p22.x, 2) + Math.pow(p1.y - p22.y, 2)); -} -function getRelativeTransformOrigin(event, rect) { - const eventCoordinates = getEventCoordinates(event); - if (!eventCoordinates) { - return "0 0"; - } - const transformOrigin = { - x: (eventCoordinates.x - rect.left) / rect.width * 100, - y: (eventCoordinates.y - rect.top) / rect.height * 100 - }; - return transformOrigin.x + "% " + transformOrigin.y + "%"; -} -function sortCollisionsAsc(_ref, _ref2) { - let { - data: { - value: a5 - } - } = _ref; - let { - data: { - value: b4 - } - } = _ref2; - return a5 - b4; -} -function sortCollisionsDesc(_ref3, _ref4) { - let { - data: { - value: a5 - } - } = _ref3; - let { - data: { - value: b4 - } - } = _ref4; - return b4 - a5; -} -function cornersOfRectangle(_ref5) { - let { - left, - top, - height, - width - } = _ref5; - return [{ - x: left, - y: top - }, { - x: left + width, - y: top - }, { - x: left, - y: top + height - }, { - x: left + width, - y: top + height - }]; -} -function getFirstCollision(collisions, property) { - if (!collisions || collisions.length === 0) { - return null; - } - const [firstCollision] = collisions; - return property ? firstCollision[property] : firstCollision; -} -function centerOfRectangle(rect, left, top) { - if (left === void 0) { - left = rect.left; - } - if (top === void 0) { - top = rect.top; - } - return { - x: left + rect.width * 0.5, - y: top + rect.height * 0.5 - }; -} -var closestCenter = (_ref) => { - let { - collisionRect, - droppableRects, - droppableContainers - } = _ref; - const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); - const collisions = []; - for (const droppableContainer of droppableContainers) { - const { - id: id2 - } = droppableContainer; - const rect = droppableRects.get(id2); - if (rect) { - const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); - collisions.push({ - id: id2, - data: { - droppableContainer, - value: distBetween - } - }); - } - } - return collisions.sort(sortCollisionsAsc); -}; -var closestCorners = (_ref) => { - let { - collisionRect, - droppableRects, - droppableContainers - } = _ref; - const corners = cornersOfRectangle(collisionRect); - const collisions = []; - for (const droppableContainer of droppableContainers) { - const { - id: id2 - } = droppableContainer; - const rect = droppableRects.get(id2); - if (rect) { - const rectCorners = cornersOfRectangle(rect); - const distances = corners.reduce((accumulator, corner, index) => { - return accumulator + distanceBetween(rectCorners[index], corner); - }, 0); - const effectiveDistance = Number((distances / 4).toFixed(4)); - collisions.push({ - id: id2, - data: { - droppableContainer, - value: effectiveDistance - } - }); - } - } - return collisions.sort(sortCollisionsAsc); -}; -function getIntersectionRatio(entry, target) { - const top = Math.max(target.top, entry.top); - const left = Math.max(target.left, entry.left); - const right = Math.min(target.left + target.width, entry.left + entry.width); - const bottom = Math.min(target.top + target.height, entry.top + entry.height); - const width = right - left; - const height = bottom - top; - if (left < right && top < bottom) { - const targetArea = target.width * target.height; - const entryArea = entry.width * entry.height; - const intersectionArea = width * height; - const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); - return Number(intersectionRatio.toFixed(4)); - } - return 0; -} -var rectIntersection = (_ref) => { - let { - collisionRect, - droppableRects, - droppableContainers - } = _ref; - const collisions = []; - for (const droppableContainer of droppableContainers) { - const { - id: id2 - } = droppableContainer; - const rect = droppableRects.get(id2); - if (rect) { - const intersectionRatio = getIntersectionRatio(rect, collisionRect); - if (intersectionRatio > 0) { - collisions.push({ - id: id2, - data: { - droppableContainer, - value: intersectionRatio - } - }); - } - } - } - return collisions.sort(sortCollisionsDesc); -}; -function adjustScale(transform, rect1, rect2) { - return { - ...transform, - scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, - scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 - }; -} -function getRectDelta(rect1, rect2) { - return rect1 && rect2 ? { - x: rect1.left - rect2.left, - y: rect1.top - rect2.top - } : defaultCoordinates; -} -function createRectAdjustmentFn(modifier) { - return function adjustClientRect(rect) { - for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - adjustments[_key - 1] = arguments[_key]; - } - return adjustments.reduce((acc, adjustment) => ({ - ...acc, - top: acc.top + modifier * adjustment.y, - bottom: acc.bottom + modifier * adjustment.y, - left: acc.left + modifier * adjustment.x, - right: acc.right + modifier * adjustment.x - }), { - ...rect - }); - }; -} -var getAdjustedRect = /* @__PURE__ */ createRectAdjustmentFn(1); -function parseTransform(transform) { - if (transform.startsWith("matrix3d(")) { - const transformArray = transform.slice(9, -1).split(/, /); - return { - x: +transformArray[12], - y: +transformArray[13], - scaleX: +transformArray[0], - scaleY: +transformArray[5] - }; - } else if (transform.startsWith("matrix(")) { - const transformArray = transform.slice(7, -1).split(/, /); - return { - x: +transformArray[4], - y: +transformArray[5], - scaleX: +transformArray[0], - scaleY: +transformArray[3] - }; - } - return null; -} -function inverseTransform(rect, transform, transformOrigin) { - const parsedTransform = parseTransform(transform); - if (!parsedTransform) { - return rect; - } - const { - scaleX, - scaleY, - x: translateX, - y: translateY - } = parsedTransform; - const x5 = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); - const y5 = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(" ") + 1)); - const w5 = scaleX ? rect.width / scaleX : rect.width; - const h5 = scaleY ? rect.height / scaleY : rect.height; - return { - width: w5, - height: h5, - top: y5, - right: x5 + w5, - bottom: y5 + h5, - left: x5 - }; -} -var defaultOptions2 = { - ignoreTransform: false -}; -function getClientRect(element, options) { - if (options === void 0) { - options = defaultOptions2; - } - let rect = element.getBoundingClientRect(); - if (options.ignoreTransform) { - const { - transform, - transformOrigin - } = getWindow(element).getComputedStyle(element); - if (transform) { - rect = inverseTransform(rect, transform, transformOrigin); - } - } - const { - top, - left, - width, - height, - bottom, - right - } = rect; - return { - top, - left, - width, - height, - bottom, - right - }; -} -function getTransformAgnosticClientRect(element) { - return getClientRect(element, { - ignoreTransform: true - }); -} -function getWindowClientRect(element) { - const width = element.innerWidth; - const height = element.innerHeight; - return { - top: 0, - left: 0, - right: width, - bottom: height, - width, - height - }; -} -function isFixed(node, computedStyle) { - if (computedStyle === void 0) { - computedStyle = getWindow(node).getComputedStyle(node); - } - return computedStyle.position === "fixed"; -} -function isScrollable(element, computedStyle) { - if (computedStyle === void 0) { - computedStyle = getWindow(element).getComputedStyle(element); - } - const overflowRegex = /(auto|scroll|overlay)/; - const properties2 = ["overflow", "overflowX", "overflowY"]; - return properties2.some((property) => { - const value = computedStyle[property]; - return typeof value === "string" ? overflowRegex.test(value) : false; - }); -} -function getScrollableAncestors(element, limit) { - const scrollParents = []; - function findScrollableAncestors(node) { - if (limit != null && scrollParents.length >= limit) { - return scrollParents; - } - if (!node) { - return scrollParents; - } - if (isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { - scrollParents.push(node.scrollingElement); - return scrollParents; - } - if (!isHTMLElement(node) || isSVGElement(node)) { - return scrollParents; - } - if (scrollParents.includes(node)) { - return scrollParents; - } - const computedStyle = getWindow(element).getComputedStyle(node); - if (node !== element) { - if (isScrollable(node, computedStyle)) { - scrollParents.push(node); - } - } - if (isFixed(node, computedStyle)) { - return scrollParents; - } - return findScrollableAncestors(node.parentNode); - } - if (!element) { - return scrollParents; - } - return findScrollableAncestors(element); -} -function getFirstScrollableAncestor(node) { - const [firstScrollableAncestor] = getScrollableAncestors(node, 1); - return firstScrollableAncestor != null ? firstScrollableAncestor : null; -} -function getScrollableElement(element) { - if (!canUseDOM || !element) { - return null; - } - if (isWindow(element)) { - return element; - } - if (!isNode(element)) { - return null; - } - if (isDocument(element) || element === getOwnerDocument(element).scrollingElement) { - return window; - } - if (isHTMLElement(element)) { - return element; - } - return null; -} -function getScrollXCoordinate(element) { - if (isWindow(element)) { - return element.scrollX; - } - return element.scrollLeft; -} -function getScrollYCoordinate(element) { - if (isWindow(element)) { - return element.scrollY; - } - return element.scrollTop; -} -function getScrollCoordinates(element) { - return { - x: getScrollXCoordinate(element), - y: getScrollYCoordinate(element) - }; -} -var Direction2; -(function(Direction3) { - Direction3[Direction3["Forward"] = 1] = "Forward"; - Direction3[Direction3["Backward"] = -1] = "Backward"; -})(Direction2 || (Direction2 = {})); -function isDocumentScrollingElement(element) { - if (!canUseDOM || !element) { - return false; - } - return element === document.scrollingElement; -} -function getScrollPosition(scrollingContainer) { - const minScroll = { - x: 0, - y: 0 - }; - const dimensions = isDocumentScrollingElement(scrollingContainer) ? { - height: window.innerHeight, - width: window.innerWidth - } : { - height: scrollingContainer.clientHeight, - width: scrollingContainer.clientWidth - }; - const maxScroll = { - x: scrollingContainer.scrollWidth - dimensions.width, - y: scrollingContainer.scrollHeight - dimensions.height - }; - const isTop = scrollingContainer.scrollTop <= minScroll.y; - const isLeft = scrollingContainer.scrollLeft <= minScroll.x; - const isBottom = scrollingContainer.scrollTop >= maxScroll.y; - const isRight = scrollingContainer.scrollLeft >= maxScroll.x; - return { - isTop, - isLeft, - isBottom, - isRight, - maxScroll, - minScroll - }; -} -var defaultThreshold = { - x: 0.2, - y: 0.2 -}; -function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { - let { - top, - left, - right, - bottom - } = _ref; - if (acceleration === void 0) { - acceleration = 10; - } - if (thresholdPercentage === void 0) { - thresholdPercentage = defaultThreshold; - } - const { - isTop, - isBottom, - isLeft, - isRight - } = getScrollPosition(scrollContainer); - const direction = { - x: 0, - y: 0 - }; - const speed = { - x: 0, - y: 0 - }; - const threshold = { - height: scrollContainerRect.height * thresholdPercentage.y, - width: scrollContainerRect.width * thresholdPercentage.x - }; - if (!isTop && top <= scrollContainerRect.top + threshold.height) { - direction.y = Direction2.Backward; - speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); - } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { - direction.y = Direction2.Forward; - speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); - } - if (!isRight && right >= scrollContainerRect.right - threshold.width) { - direction.x = Direction2.Forward; - speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); - } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { - direction.x = Direction2.Backward; - speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); - } - return { - direction, - speed - }; -} -function getScrollElementRect(element) { - if (element === document.scrollingElement) { - const { - innerWidth: innerWidth2, - innerHeight: innerHeight2 - } = window; - return { - top: 0, - left: 0, - right: innerWidth2, - bottom: innerHeight2, - width: innerWidth2, - height: innerHeight2 - }; - } - const { - top, - left, - right, - bottom - } = element.getBoundingClientRect(); - return { - top, - left, - right, - bottom, - width: element.clientWidth, - height: element.clientHeight - }; -} -function getScrollOffsets(scrollableAncestors) { - return scrollableAncestors.reduce((acc, node) => { - return add(acc, getScrollCoordinates(node)); - }, defaultCoordinates); -} -function getScrollXOffset(scrollableAncestors) { - return scrollableAncestors.reduce((acc, node) => { - return acc + getScrollXCoordinate(node); - }, 0); -} -function getScrollYOffset(scrollableAncestors) { - return scrollableAncestors.reduce((acc, node) => { - return acc + getScrollYCoordinate(node); - }, 0); -} -function scrollIntoViewIfNeeded(element, measure) { - if (measure === void 0) { - measure = getClientRect; - } - if (!element) { - return; - } - const { - top, - left, - bottom, - right - } = measure(element); - const firstScrollableAncestor = getFirstScrollableAncestor(element); - if (!firstScrollableAncestor) { - return; - } - if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { - element.scrollIntoView({ - block: "center", - inline: "center" - }); - } -} -var properties = [["x", ["left", "right"], getScrollXOffset], ["y", ["top", "bottom"], getScrollYOffset]]; -var Rect = class { - constructor(rect, element) { - this.rect = void 0; - this.width = void 0; - this.height = void 0; - this.top = void 0; - this.bottom = void 0; - this.right = void 0; - this.left = void 0; - const scrollableAncestors = getScrollableAncestors(element); - const scrollOffsets = getScrollOffsets(scrollableAncestors); - this.rect = { - ...rect - }; - this.width = rect.width; - this.height = rect.height; - for (const [axis, keys, getScrollOffset] of properties) { - for (const key2 of keys) { - Object.defineProperty(this, key2, { - get: () => { - const currentOffsets = getScrollOffset(scrollableAncestors); - const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; - return this.rect[key2] + scrollOffsetsDeltla; - }, - enumerable: true - }); - } - } - Object.defineProperty(this, "rect", { - enumerable: false - }); - } -}; -var Listeners = class { - constructor(target) { - this.target = void 0; - this.listeners = []; - this.removeAll = () => { - this.listeners.forEach((listener) => { - var _this$target; - return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); - }); - }; - this.target = target; - } - add(eventName, handler, options) { - var _this$target2; - (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); - this.listeners.push([eventName, handler, options]); - } -}; -function getEventListenerTarget(target) { - const { - EventTarget - } = getWindow(target); - return target instanceof EventTarget ? target : getOwnerDocument(target); -} -function hasExceededDistance(delta, measurement) { - const dx = Math.abs(delta.x); - const dy = Math.abs(delta.y); - if (typeof measurement === "number") { - return Math.sqrt(dx ** 2 + dy ** 2) > measurement; - } - if ("x" in measurement && "y" in measurement) { - return dx > measurement.x && dy > measurement.y; - } - if ("x" in measurement) { - return dx > measurement.x; - } - if ("y" in measurement) { - return dy > measurement.y; - } - return false; -} -var EventName; -(function(EventName2) { - EventName2["Click"] = "click"; - EventName2["DragStart"] = "dragstart"; - EventName2["Keydown"] = "keydown"; - EventName2["ContextMenu"] = "contextmenu"; - EventName2["Resize"] = "resize"; - EventName2["SelectionChange"] = "selectionchange"; - EventName2["VisibilityChange"] = "visibilitychange"; -})(EventName || (EventName = {})); -function preventDefault(event) { - event.preventDefault(); -} -function stopPropagation(event) { - event.stopPropagation(); -} -var KeyboardCode; -(function(KeyboardCode2) { - KeyboardCode2["Space"] = "Space"; - KeyboardCode2["Down"] = "ArrowDown"; - KeyboardCode2["Right"] = "ArrowRight"; - KeyboardCode2["Left"] = "ArrowLeft"; - KeyboardCode2["Up"] = "ArrowUp"; - KeyboardCode2["Esc"] = "Escape"; - KeyboardCode2["Enter"] = "Enter"; -})(KeyboardCode || (KeyboardCode = {})); -var defaultKeyboardCodes = { - start: [KeyboardCode.Space, KeyboardCode.Enter], - cancel: [KeyboardCode.Esc], - end: [KeyboardCode.Space, KeyboardCode.Enter] -}; -var defaultKeyboardCoordinateGetter = (event, _ref) => { - let { - currentCoordinates - } = _ref; - switch (event.code) { - case KeyboardCode.Right: - return { - ...currentCoordinates, - x: currentCoordinates.x + 25 - }; - case KeyboardCode.Left: - return { - ...currentCoordinates, - x: currentCoordinates.x - 25 - }; - case KeyboardCode.Down: - return { - ...currentCoordinates, - y: currentCoordinates.y + 25 - }; - case KeyboardCode.Up: - return { - ...currentCoordinates, - y: currentCoordinates.y - 25 - }; - } - return void 0; -}; -var KeyboardSensor = class { - constructor(props2) { - this.props = void 0; - this.autoScrollEnabled = false; - this.referenceCoordinates = void 0; - this.listeners = void 0; - this.windowListeners = void 0; - this.props = props2; - const { - event: { - target - } - } = props2; - this.props = props2; - this.listeners = new Listeners(getOwnerDocument(target)); - this.windowListeners = new Listeners(getWindow(target)); - this.handleKeyDown = this.handleKeyDown.bind(this); - this.handleCancel = this.handleCancel.bind(this); - this.attach(); - } - attach() { - this.handleStart(); - this.windowListeners.add(EventName.Resize, this.handleCancel); - this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); - setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); - } - handleStart() { - const { - activeNode, - onStart - } = this.props; - const node = activeNode.node.current; - if (node) { - scrollIntoViewIfNeeded(node); - } - onStart(defaultCoordinates); - } - handleKeyDown(event) { - if (isKeyboardEvent(event)) { - const { - active, - context, - options - } = this.props; - const { - keyboardCodes = defaultKeyboardCodes, - coordinateGetter = defaultKeyboardCoordinateGetter, - scrollBehavior = "smooth" - } = options; - const { - code - } = event; - if (keyboardCodes.end.includes(code)) { - this.handleEnd(event); - return; - } - if (keyboardCodes.cancel.includes(code)) { - this.handleCancel(event); - return; - } - const { - collisionRect - } = context.current; - const currentCoordinates = collisionRect ? { - x: collisionRect.left, - y: collisionRect.top - } : defaultCoordinates; - if (!this.referenceCoordinates) { - this.referenceCoordinates = currentCoordinates; - } - const newCoordinates = coordinateGetter(event, { - active, - context: context.current, - currentCoordinates - }); - if (newCoordinates) { - const coordinatesDelta = subtract(newCoordinates, currentCoordinates); - const scrollDelta = { - x: 0, - y: 0 - }; - const { - scrollableAncestors - } = context.current; - for (const scrollContainer of scrollableAncestors) { - const direction = event.code; - const { - isTop, - isRight, - isLeft, - isBottom, - maxScroll, - minScroll - } = getScrollPosition(scrollContainer); - const scrollElementRect = getScrollElementRect(scrollContainer); - const clampedCoordinates = { - x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), - y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) - }; - const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; - const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; - if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { - const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; - const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; - if (canScrollToNewCoordinates && !coordinatesDelta.y) { - scrollContainer.scrollTo({ - left: newScrollCoordinates, - behavior: scrollBehavior - }); - return; - } - if (canScrollToNewCoordinates) { - scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; - } else { - scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; - } - if (scrollDelta.x) { - scrollContainer.scrollBy({ - left: -scrollDelta.x, - behavior: scrollBehavior - }); - } - break; - } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { - const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; - const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; - if (canScrollToNewCoordinates && !coordinatesDelta.x) { - scrollContainer.scrollTo({ - top: newScrollCoordinates, - behavior: scrollBehavior - }); - return; - } - if (canScrollToNewCoordinates) { - scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; - } else { - scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; - } - if (scrollDelta.y) { - scrollContainer.scrollBy({ - top: -scrollDelta.y, - behavior: scrollBehavior - }); - } - break; - } - } - this.handleMove(event, add(subtract(newCoordinates, this.referenceCoordinates), scrollDelta)); - } - } - } - handleMove(event, coordinates) { - const { - onMove - } = this.props; - event.preventDefault(); - onMove(coordinates); - } - handleEnd(event) { - const { - onEnd - } = this.props; - event.preventDefault(); - this.detach(); - onEnd(); - } - handleCancel(event) { - const { - onCancel - } = this.props; - event.preventDefault(); - this.detach(); - onCancel(); - } - detach() { - this.listeners.removeAll(); - this.windowListeners.removeAll(); - } -}; -KeyboardSensor.activators = [{ - eventName: "onKeyDown", - handler: (event, _ref, _ref2) => { - let { - keyboardCodes = defaultKeyboardCodes, - onActivation - } = _ref; - let { - active - } = _ref2; - const { - code - } = event.nativeEvent; - if (keyboardCodes.start.includes(code)) { - const activator = active.activatorNode.current; - if (activator && event.target !== activator) { - return false; - } - event.preventDefault(); - onActivation == null ? void 0 : onActivation({ - event: event.nativeEvent - }); - return true; - } - return false; - } -}]; -function isDistanceConstraint(constraint) { - return Boolean(constraint && "distance" in constraint); -} -function isDelayConstraint(constraint) { - return Boolean(constraint && "delay" in constraint); -} -var AbstractPointerSensor = class { - constructor(props2, events2, listenerTarget) { - var _getEventCoordinates; - if (listenerTarget === void 0) { - listenerTarget = getEventListenerTarget(props2.event.target); - } - this.props = void 0; - this.events = void 0; - this.autoScrollEnabled = true; - this.document = void 0; - this.activated = false; - this.initialCoordinates = void 0; - this.timeoutId = null; - this.listeners = void 0; - this.documentListeners = void 0; - this.windowListeners = void 0; - this.props = props2; - this.events = events2; - const { - event - } = props2; - const { - target - } = event; - this.props = props2; - this.events = events2; - this.document = getOwnerDocument(target); - this.documentListeners = new Listeners(this.document); - this.listeners = new Listeners(listenerTarget); - this.windowListeners = new Listeners(getWindow(target)); - this.initialCoordinates = (_getEventCoordinates = getEventCoordinates(event)) != null ? _getEventCoordinates : defaultCoordinates; - this.handleStart = this.handleStart.bind(this); - this.handleMove = this.handleMove.bind(this); - this.handleEnd = this.handleEnd.bind(this); - this.handleCancel = this.handleCancel.bind(this); - this.handleKeydown = this.handleKeydown.bind(this); - this.removeTextSelection = this.removeTextSelection.bind(this); - this.attach(); - } - attach() { - const { - events: events2, - props: { - options: { - activationConstraint - } - } - } = this; - this.listeners.add(events2.move.name, this.handleMove, { - passive: false - }); - this.listeners.add(events2.end.name, this.handleEnd); - this.windowListeners.add(EventName.Resize, this.handleCancel); - this.windowListeners.add(EventName.DragStart, preventDefault); - this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); - this.windowListeners.add(EventName.ContextMenu, preventDefault); - this.documentListeners.add(EventName.Keydown, this.handleKeydown); - if (activationConstraint) { - if (isDistanceConstraint(activationConstraint)) { - return; - } - if (isDelayConstraint(activationConstraint)) { - this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); - return; - } - } - this.handleStart(); - } - detach() { - this.listeners.removeAll(); - this.windowListeners.removeAll(); - setTimeout(this.documentListeners.removeAll, 50); - if (this.timeoutId !== null) { - clearTimeout(this.timeoutId); - this.timeoutId = null; - } - } - handleStart() { - const { - initialCoordinates - } = this; - const { - onStart - } = this.props; - if (initialCoordinates) { - this.activated = true; - this.documentListeners.add(EventName.Click, stopPropagation, { - capture: true - }); - this.removeTextSelection(); - this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); - onStart(initialCoordinates); - } - } - handleMove(event) { - var _getEventCoordinates2; - const { - activated, - initialCoordinates, - props: props2 - } = this; - const { - onMove, - options: { - activationConstraint - } - } = props2; - if (!initialCoordinates) { - return; - } - const coordinates = (_getEventCoordinates2 = getEventCoordinates(event)) != null ? _getEventCoordinates2 : defaultCoordinates; - const delta = subtract(initialCoordinates, coordinates); - if (!activated && activationConstraint) { - if (isDelayConstraint(activationConstraint)) { - if (hasExceededDistance(delta, activationConstraint.tolerance)) { - return this.handleCancel(); - } - return; - } - if (isDistanceConstraint(activationConstraint)) { - if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { - return this.handleCancel(); - } - if (hasExceededDistance(delta, activationConstraint.distance)) { - return this.handleStart(); - } - return; - } - } - if (event.cancelable) { - event.preventDefault(); - } - onMove(coordinates); - } - handleEnd() { - const { - onEnd - } = this.props; - this.detach(); - onEnd(); - } - handleCancel() { - const { - onCancel - } = this.props; - this.detach(); - onCancel(); - } - handleKeydown(event) { - if (event.code === KeyboardCode.Esc) { - this.handleCancel(); - } - } - removeTextSelection() { - var _this$document$getSel; - (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); - } -}; -var events = { - move: { - name: "pointermove" - }, - end: { - name: "pointerup" - } -}; -var PointerSensor = class extends AbstractPointerSensor { - constructor(props2) { - const { - event - } = props2; - const listenerTarget = getOwnerDocument(event.target); - super(props2, events, listenerTarget); - } -}; -PointerSensor.activators = [{ - eventName: "onPointerDown", - handler: (_ref, _ref2) => { - let { - nativeEvent: event - } = _ref; - let { - onActivation - } = _ref2; - if (!event.isPrimary || event.button !== 0) { - return false; - } - onActivation == null ? void 0 : onActivation({ - event - }); - return true; - } -}]; -var events$1 = { - move: { - name: "mousemove" - }, - end: { - name: "mouseup" - } -}; -var MouseButton; -(function(MouseButton2) { - MouseButton2[MouseButton2["RightClick"] = 2] = "RightClick"; -})(MouseButton || (MouseButton = {})); -var MouseSensor = class extends AbstractPointerSensor { - constructor(props2) { - super(props2, events$1, getOwnerDocument(props2.event.target)); - } -}; -MouseSensor.activators = [{ - eventName: "onMouseDown", - handler: (_ref, _ref2) => { - let { - nativeEvent: event - } = _ref; - let { - onActivation - } = _ref2; - if (event.button === MouseButton.RightClick) { - return false; - } - onActivation == null ? void 0 : onActivation({ - event - }); - return true; - } -}]; -var events$2 = { - move: { - name: "touchmove" - }, - end: { - name: "touchend" - } -}; -var TouchSensor = class extends AbstractPointerSensor { - constructor(props2) { - super(props2, events$2); - } - static setup() { - window.addEventListener(events$2.move.name, noop3, { - capture: false, - passive: false - }); - return function teardown() { - window.removeEventListener(events$2.move.name, noop3); - }; - function noop3() { - } - } -}; -TouchSensor.activators = [{ - eventName: "onTouchStart", - handler: (_ref, _ref2) => { - let { - nativeEvent: event - } = _ref; - let { - onActivation - } = _ref2; - const { - touches - } = event; - if (touches.length > 1) { - return false; - } - onActivation == null ? void 0 : onActivation({ - event - }); - return true; - } -}]; -var AutoScrollActivator; -(function(AutoScrollActivator2) { - AutoScrollActivator2[AutoScrollActivator2["Pointer"] = 0] = "Pointer"; - AutoScrollActivator2[AutoScrollActivator2["DraggableRect"] = 1] = "DraggableRect"; -})(AutoScrollActivator || (AutoScrollActivator = {})); -var TraversalOrder; -(function(TraversalOrder2) { - TraversalOrder2[TraversalOrder2["TreeOrder"] = 0] = "TreeOrder"; - TraversalOrder2[TraversalOrder2["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; -})(TraversalOrder || (TraversalOrder = {})); -function useAutoScroller(_ref) { - let { - acceleration, - activator = AutoScrollActivator.Pointer, - canScroll, - draggingRect, - enabled, - interval = 5, - order = TraversalOrder.TreeOrder, - pointerCoordinates, - scrollableAncestors, - scrollableAncestorRects, - delta, - threshold - } = _ref; - const scrollIntent = useScrollIntent({ - delta, - disabled: !enabled - }); - const [setAutoScrollInterval, clearAutoScrollInterval] = useInterval(); - const scrollSpeed = _2({ - x: 0, - y: 0 - }); - const scrollDirection = _2({ - x: 0, - y: 0 - }); - const rect = F2(() => { - switch (activator) { - case AutoScrollActivator.Pointer: - return pointerCoordinates ? { - top: pointerCoordinates.y, - bottom: pointerCoordinates.y, - left: pointerCoordinates.x, - right: pointerCoordinates.x - } : null; - case AutoScrollActivator.DraggableRect: - return draggingRect; - } - }, [activator, draggingRect, pointerCoordinates]); - const scrollContainerRef = _2(null); - const autoScroll = T2(() => { - const scrollContainer = scrollContainerRef.current; - if (!scrollContainer) { - return; - } - const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; - const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; - scrollContainer.scrollBy(scrollLeft, scrollTop); - }, []); - const sortedScrollableAncestors = F2(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); - p2( - () => { - if (!enabled || !scrollableAncestors.length || !rect) { - clearAutoScrollInterval(); - return; - } - for (const scrollContainer of sortedScrollableAncestors) { - if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { - continue; - } - const index = scrollableAncestors.indexOf(scrollContainer); - const scrollContainerRect = scrollableAncestorRects[index]; - if (!scrollContainerRect) { - continue; - } - const { - direction, - speed - } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); - for (const axis of ["x", "y"]) { - if (!scrollIntent[axis][direction[axis]]) { - speed[axis] = 0; - direction[axis] = 0; - } - } - if (speed.x > 0 || speed.y > 0) { - clearAutoScrollInterval(); - scrollContainerRef.current = scrollContainer; - setAutoScrollInterval(autoScroll, interval); - scrollSpeed.current = speed; - scrollDirection.current = direction; - return; - } - } - scrollSpeed.current = { - x: 0, - y: 0 - }; - scrollDirection.current = { - x: 0, - y: 0 - }; - clearAutoScrollInterval(); - }, - [ - acceleration, - autoScroll, - canScroll, - clearAutoScrollInterval, - enabled, - interval, - JSON.stringify(rect), - JSON.stringify(scrollIntent), - setAutoScrollInterval, - scrollableAncestors, - sortedScrollableAncestors, - scrollableAncestorRects, - JSON.stringify(threshold) - ] - ); -} -var defaultScrollIntent = { - x: { - [Direction2.Backward]: false, - [Direction2.Forward]: false - }, - y: { - [Direction2.Backward]: false, - [Direction2.Forward]: false - } -}; -function useScrollIntent(_ref2) { - let { - delta, - disabled - } = _ref2; - const previousDelta = usePrevious(delta); - return useLazyMemo((previousIntent) => { - if (disabled || !previousDelta || !previousIntent) { - return defaultScrollIntent; - } - const direction = { - x: Math.sign(delta.x - previousDelta.x), - y: Math.sign(delta.y - previousDelta.y) - }; - return { - x: { - [Direction2.Backward]: previousIntent.x[Direction2.Backward] || direction.x === -1, - [Direction2.Forward]: previousIntent.x[Direction2.Forward] || direction.x === 1 - }, - y: { - [Direction2.Backward]: previousIntent.y[Direction2.Backward] || direction.y === -1, - [Direction2.Forward]: previousIntent.y[Direction2.Forward] || direction.y === 1 - } - }; - }, [disabled, delta, previousDelta]); -} -function useCachedNode(draggableNodes, id2) { - const draggableNode = id2 !== null ? draggableNodes.get(id2) : void 0; - const node = draggableNode ? draggableNode.node.current : null; - return useLazyMemo((cachedNode) => { - var _ref; - if (id2 === null) { - return null; - } - return (_ref = node != null ? node : cachedNode) != null ? _ref : null; - }, [node, id2]); -} -function useCombineActivators(sensors, getSyntheticHandler) { - return F2(() => sensors.reduce((accumulator, sensor) => { - const { - sensor: Sensor - } = sensor; - const sensorActivators = Sensor.activators.map((activator) => ({ - eventName: activator.eventName, - handler: getSyntheticHandler(activator.handler, sensor) - })); - return [...accumulator, ...sensorActivators]; - }, []), [sensors, getSyntheticHandler]); -} -var MeasuringStrategy; -(function(MeasuringStrategy2) { - MeasuringStrategy2[MeasuringStrategy2["Always"] = 0] = "Always"; - MeasuringStrategy2[MeasuringStrategy2["BeforeDragging"] = 1] = "BeforeDragging"; - MeasuringStrategy2[MeasuringStrategy2["WhileDragging"] = 2] = "WhileDragging"; -})(MeasuringStrategy || (MeasuringStrategy = {})); -var MeasuringFrequency; -(function(MeasuringFrequency2) { - MeasuringFrequency2["Optimized"] = "optimized"; -})(MeasuringFrequency || (MeasuringFrequency = {})); -var defaultValue = /* @__PURE__ */ new Map(); -function useDroppableMeasuring(containers, _ref) { - let { - dragging, - dependencies, - config - } = _ref; - const [queue, setQueue] = h2(null); - const { - frequency, - measure, - strategy - } = config; - const containersRef = _2(containers); - const disabled = isDisabled(); - const disabledRef = useLatestValue(disabled); - const measureDroppableContainers = T2(function(ids2) { - if (ids2 === void 0) { - ids2 = []; - } - if (disabledRef.current) { - return; - } - setQueue((value) => { - if (value === null) { - return ids2; - } - return value.concat(ids2.filter((id2) => !value.includes(id2))); - }); - }, [disabledRef]); - const timeoutId = _2(null); - const droppableRects = useLazyMemo((previousValue) => { - if (disabled && !dragging) { - return defaultValue; - } - if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { - const map = /* @__PURE__ */ new Map(); - for (let container of containers) { - if (!container) { - continue; - } - if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { - map.set(container.id, container.rect.current); - continue; - } - const node = container.node.current; - const rect = node ? new Rect(measure(node), node) : null; - container.rect.current = rect; - if (rect) { - map.set(container.id, rect); - } - } - return map; - } - return previousValue; - }, [containers, queue, dragging, disabled, measure]); - p2(() => { - containersRef.current = containers; - }, [containers]); - p2( - () => { - if (disabled) { - return; - } - measureDroppableContainers(); - }, - [dragging, disabled] - ); - p2( - () => { - if (queue && queue.length > 0) { - setQueue(null); - } - }, - [JSON.stringify(queue)] - ); - p2( - () => { - if (disabled || typeof frequency !== "number" || timeoutId.current !== null) { - return; - } - timeoutId.current = setTimeout(() => { - measureDroppableContainers(); - timeoutId.current = null; - }, frequency); - }, - [frequency, disabled, measureDroppableContainers, ...dependencies] - ); - return { - droppableRects, - measureDroppableContainers, - measuringScheduled: queue != null - }; - function isDisabled() { - switch (strategy) { - case MeasuringStrategy.Always: - return false; - case MeasuringStrategy.BeforeDragging: - return dragging; - default: - return !dragging; - } - } -} -function useInitialValue(value, computeFn) { - return useLazyMemo((previousValue) => { - if (!value) { - return null; - } - if (previousValue) { - return previousValue; - } - return typeof computeFn === "function" ? computeFn(value) : value; - }, [computeFn, value]); -} -function useInitialRect(node, measure) { - return useInitialValue(node, measure); -} -function useMutationObserver(_ref) { - let { - callback, - disabled - } = _ref; - const handleMutations = useEvent(callback); - const mutationObserver = F2(() => { - if (disabled || typeof window === "undefined" || typeof window.MutationObserver === "undefined") { - return void 0; - } - const { - MutationObserver - } = window; - return new MutationObserver(handleMutations); - }, [handleMutations, disabled]); - p2(() => { - return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); - }, [mutationObserver]); - return mutationObserver; -} -function useResizeObserver(_ref) { - let { - callback, - disabled - } = _ref; - const handleResize = useEvent(callback); - const resizeObserver = F2( - () => { - if (disabled || typeof window === "undefined" || typeof window.ResizeObserver === "undefined") { - return void 0; - } - const { - ResizeObserver - } = window; - return new ResizeObserver(handleResize); - }, - [disabled] - ); - p2(() => { - return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); - }, [resizeObserver]); - return resizeObserver; -} -function defaultMeasure(element) { - return new Rect(getClientRect(element), element); -} -function useRect(element, measure, fallbackRect) { - if (measure === void 0) { - measure = defaultMeasure; - } - const [rect, measureRect] = s2(reducer3, null); - const mutationObserver = useMutationObserver({ - callback(records) { - if (!element) { - return; - } - for (const record of records) { - const { - type, - target - } = record; - if (type === "childList" && target instanceof HTMLElement && target.contains(element)) { - measureRect(); - break; - } - } - } - }); - const resizeObserver = useResizeObserver({ - callback: measureRect - }); - useIsomorphicLayoutEffect(() => { - measureRect(); - if (element) { - resizeObserver == null ? void 0 : resizeObserver.observe(element); - mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { - childList: true, - subtree: true - }); - } else { - resizeObserver == null ? void 0 : resizeObserver.disconnect(); - mutationObserver == null ? void 0 : mutationObserver.disconnect(); - } - }, [element]); - return rect; - function reducer3(currentRect) { - if (!element) { - return null; - } - if (element.isConnected === false) { - var _ref; - return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; - } - const newRect = measure(element); - if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { - return currentRect; - } - return newRect; - } -} -function useRectDelta(rect) { - const initialRect = useInitialValue(rect); - return getRectDelta(rect, initialRect); -} -var defaultValue$1 = []; -function useScrollableAncestors(node) { - const previousNode = _2(node); - const ancestors = useLazyMemo((previousValue) => { - if (!node) { - return defaultValue$1; - } - if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { - return previousValue; - } - return getScrollableAncestors(node); - }, [node]); - p2(() => { - previousNode.current = node; - }, [node]); - return ancestors; -} -function useScrollOffsets(elements) { - const [scrollCoordinates, setScrollCoordinates] = h2(null); - const prevElements = _2(elements); - const handleScroll = T2((event) => { - const scrollingElement = getScrollableElement(event.target); - if (!scrollingElement) { - return; - } - setScrollCoordinates((scrollCoordinates2) => { - if (!scrollCoordinates2) { - return null; - } - scrollCoordinates2.set(scrollingElement, getScrollCoordinates(scrollingElement)); - return new Map(scrollCoordinates2); - }); - }, []); - p2(() => { - const previousElements = prevElements.current; - if (elements !== previousElements) { - cleanup(previousElements); - const entries = elements.map((element) => { - const scrollableElement = getScrollableElement(element); - if (scrollableElement) { - scrollableElement.addEventListener("scroll", handleScroll, { - passive: true - }); - return [scrollableElement, getScrollCoordinates(scrollableElement)]; - } - return null; - }).filter((entry) => entry != null); - setScrollCoordinates(entries.length ? new Map(entries) : null); - prevElements.current = elements; - } - return () => { - cleanup(elements); - cleanup(previousElements); - }; - function cleanup(elements2) { - elements2.forEach((element) => { - const scrollableElement = getScrollableElement(element); - scrollableElement == null ? void 0 : scrollableElement.removeEventListener("scroll", handleScroll); - }); - } - }, [handleScroll, elements]); - return F2(() => { - if (elements.length) { - return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => add(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); - } - return defaultCoordinates; - }, [elements, scrollCoordinates]); -} -function useScrollOffsetsDelta(scrollOffsets, dependencies) { - if (dependencies === void 0) { - dependencies = []; - } - const initialScrollOffsets = _2(null); - p2( - () => { - initialScrollOffsets.current = null; - }, - dependencies - ); - p2(() => { - const hasScrollOffsets = scrollOffsets !== defaultCoordinates; - if (hasScrollOffsets && !initialScrollOffsets.current) { - initialScrollOffsets.current = scrollOffsets; - } - if (!hasScrollOffsets && initialScrollOffsets.current) { - initialScrollOffsets.current = null; - } - }, [scrollOffsets]); - return initialScrollOffsets.current ? subtract(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; -} -function useSensorSetup(sensors) { - p2( - () => { - if (!canUseDOM) { - return; - } - const teardownFns = sensors.map((_ref) => { - let { - sensor - } = _ref; - return sensor.setup == null ? void 0 : sensor.setup(); - }); - return () => { - for (const teardown of teardownFns) { - teardown == null ? void 0 : teardown(); - } - }; - }, - sensors.map((_ref2) => { - let { - sensor - } = _ref2; - return sensor; - }) - ); -} -function useSyntheticListeners(listeners, id2) { - return F2(() => { - return listeners.reduce((acc, _ref) => { - let { - eventName, - handler - } = _ref; - acc[eventName] = (event) => { - handler(event, id2); - }; - return acc; - }, {}); - }, [listeners, id2]); -} -function useWindowRect(element) { - return F2(() => element ? getWindowClientRect(element) : null, [element]); -} -var defaultValue$2 = []; -function useRects(elements, measure) { - if (measure === void 0) { - measure = getClientRect; - } - const [firstElement] = elements; - const windowRect = useWindowRect(firstElement ? getWindow(firstElement) : null); - const [rects, measureRects] = s2(reducer3, defaultValue$2); - const resizeObserver = useResizeObserver({ - callback: measureRects - }); - if (elements.length > 0 && rects === defaultValue$2) { - measureRects(); - } - useIsomorphicLayoutEffect(() => { - if (elements.length) { - elements.forEach((element) => resizeObserver == null ? void 0 : resizeObserver.observe(element)); - } else { - resizeObserver == null ? void 0 : resizeObserver.disconnect(); - measureRects(); - } - }, [elements]); - return rects; - function reducer3() { - if (!elements.length) { - return defaultValue$2; - } - return elements.map((element) => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); - } -} -function getMeasurableNode(node) { - if (!node) { - return null; - } - if (node.children.length > 1) { - return node; - } - const firstChild = node.children[0]; - return isHTMLElement(firstChild) ? firstChild : node; -} -function useDragOverlayMeasuring(_ref) { - let { - measure - } = _ref; - const [rect, setRect] = h2(null); - const handleResize = T2((entries) => { - for (const { - target - } of entries) { - if (isHTMLElement(target)) { - setRect((rect2) => { - const newRect = measure(target); - return rect2 ? { - ...rect2, - width: newRect.width, - height: newRect.height - } : newRect; - }); - break; - } - } - }, [measure]); - const resizeObserver = useResizeObserver({ - callback: handleResize - }); - const handleNodeChange = T2((element) => { - const node = getMeasurableNode(element); - resizeObserver == null ? void 0 : resizeObserver.disconnect(); - if (node) { - resizeObserver == null ? void 0 : resizeObserver.observe(node); - } - setRect(node ? measure(node) : null); - }, [measure, resizeObserver]); - const [nodeRef, setRef] = useNodeRef(handleNodeChange); - return F2(() => ({ - nodeRef, - rect, - setRef - }), [rect, nodeRef, setRef]); -} -var defaultSensors = [{ - sensor: PointerSensor, - options: {} -}, { - sensor: KeyboardSensor, - options: {} -}]; -var defaultData = { - current: {} -}; -var defaultMeasuringConfiguration = { - draggable: { - measure: getTransformAgnosticClientRect - }, - droppable: { - measure: getTransformAgnosticClientRect, - strategy: MeasuringStrategy.WhileDragging, - frequency: MeasuringFrequency.Optimized - }, - dragOverlay: { - measure: getClientRect - } -}; -var DroppableContainersMap = class extends Map { - get(id2) { - var _super$get; - return id2 != null ? (_super$get = super.get(id2)) != null ? _super$get : void 0 : void 0; - } - toArray() { - return Array.from(this.values()); - } - getEnabled() { - return this.toArray().filter((_ref) => { - let { - disabled - } = _ref; - return !disabled; - }); - } - getNodeFor(id2) { - var _this$get$node$curren, _this$get; - return (_this$get$node$curren = (_this$get = this.get(id2)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : void 0; - } -}; -var defaultPublicContext = { - activatorEvent: null, - active: null, - activeNode: null, - activeNodeRect: null, - collisions: null, - containerNodeRect: null, - draggableNodes: /* @__PURE__ */ new Map(), - droppableRects: /* @__PURE__ */ new Map(), - droppableContainers: /* @__PURE__ */ new DroppableContainersMap(), - over: null, - dragOverlay: { - nodeRef: { - current: null - }, - rect: null, - setRef: noop - }, - scrollableAncestors: [], - scrollableAncestorRects: [], - measuringConfiguration: defaultMeasuringConfiguration, - measureDroppableContainers: noop, - windowRect: null, - measuringScheduled: false -}; -var defaultInternalContext = { - activatorEvent: null, - activators: [], - active: null, - activeNodeRect: null, - ariaDescribedById: { - draggable: "" - }, - dispatch: noop, - draggableNodes: /* @__PURE__ */ new Map(), - over: null, - measureDroppableContainers: noop -}; -var InternalContext = /* @__PURE__ */ F(defaultInternalContext); -var PublicContext = /* @__PURE__ */ F(defaultPublicContext); -function getInitialState() { - return { - draggable: { - active: null, - initialCoordinates: { - x: 0, - y: 0 - }, - nodes: /* @__PURE__ */ new Map(), - translate: { - x: 0, - y: 0 - } - }, - droppable: { - containers: new DroppableContainersMap() - } - }; -} -function reducer(state, action) { - switch (action.type) { - case Action.DragStart: - return { - ...state, - draggable: { - ...state.draggable, - initialCoordinates: action.initialCoordinates, - active: action.active - } - }; - case Action.DragMove: - if (!state.draggable.active) { - return state; - } - return { - ...state, - draggable: { - ...state.draggable, - translate: { - x: action.coordinates.x - state.draggable.initialCoordinates.x, - y: action.coordinates.y - state.draggable.initialCoordinates.y - } - } - }; - case Action.DragEnd: - case Action.DragCancel: - return { - ...state, - draggable: { - ...state.draggable, - active: null, - initialCoordinates: { - x: 0, - y: 0 - }, - translate: { - x: 0, - y: 0 - } - } - }; - case Action.RegisterDroppable: { - const { - element - } = action; - const { - id: id2 - } = element; - const containers = new DroppableContainersMap(state.droppable.containers); - containers.set(id2, element); - return { - ...state, - droppable: { - ...state.droppable, - containers - } - }; - } - case Action.SetDroppableDisabled: { - const { - id: id2, - key: key2, - disabled - } = action; - const element = state.droppable.containers.get(id2); - if (!element || key2 !== element.key) { - return state; - } - const containers = new DroppableContainersMap(state.droppable.containers); - containers.set(id2, { - ...element, - disabled - }); - return { - ...state, - droppable: { - ...state.droppable, - containers - } - }; - } - case Action.UnregisterDroppable: { - const { - id: id2, - key: key2 - } = action; - const element = state.droppable.containers.get(id2); - if (!element || key2 !== element.key) { - return state; - } - const containers = new DroppableContainersMap(state.droppable.containers); - containers.delete(id2); - return { - ...state, - droppable: { - ...state.droppable, - containers - } - }; - } - default: { - return state; - } - } -} -function RestoreFocus(_ref) { - let { - disabled - } = _ref; - const { - active, - activatorEvent, - draggableNodes - } = q2(InternalContext); - const previousActivatorEvent = usePrevious(activatorEvent); - const previousActiveId = usePrevious(active == null ? void 0 : active.id); - p2(() => { - if (disabled) { - return; - } - if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { - if (!isKeyboardEvent(previousActivatorEvent)) { - return; - } - if (document.activeElement === previousActivatorEvent.target) { - return; - } - const draggableNode = draggableNodes.get(previousActiveId); - if (!draggableNode) { - return; - } - const { - activatorNode, - node - } = draggableNode; - if (!activatorNode.current && !node.current) { - return; - } - requestAnimationFrame(() => { - for (const element of [activatorNode.current, node.current]) { - if (!element) { - continue; - } - const focusableNode = findFirstFocusableNode(element); - if (focusableNode) { - focusableNode.focus(); - break; - } - } - }); - } - }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); - return null; -} -function applyModifiers(modifiers, _ref) { - let { - transform, - ...args - } = _ref; - return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { - return modifier({ - transform: accumulator, - ...args - }); - }, transform) : transform; -} -function useMeasuringConfiguration(config) { - return F2( - () => ({ - draggable: { - ...defaultMeasuringConfiguration.draggable, - ...config == null ? void 0 : config.draggable - }, - droppable: { - ...defaultMeasuringConfiguration.droppable, - ...config == null ? void 0 : config.droppable - }, - dragOverlay: { - ...defaultMeasuringConfiguration.dragOverlay, - ...config == null ? void 0 : config.dragOverlay - } - }), - [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay] - ); -} -function useLayoutShiftScrollCompensation(_ref) { - let { - activeNode, - measure, - initialRect, - config = true - } = _ref; - const initialized = _2(false); - const { - x: x5, - y: y5 - } = typeof config === "boolean" ? { - x: config, - y: config - } : config; - useIsomorphicLayoutEffect(() => { - const disabled = !x5 && !y5; - if (disabled || !activeNode) { - initialized.current = false; - return; - } - if (initialized.current || !initialRect) { - return; - } - const node = activeNode == null ? void 0 : activeNode.node.current; - if (!node || node.isConnected === false) { - return; - } - const rect = measure(node); - const rectDelta = getRectDelta(rect, initialRect); - if (!x5) { - rectDelta.x = 0; - } - if (!y5) { - rectDelta.y = 0; - } - initialized.current = true; - if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { - const firstScrollableAncestor = getFirstScrollableAncestor(node); - if (firstScrollableAncestor) { - firstScrollableAncestor.scrollBy({ - top: rectDelta.y, - left: rectDelta.x - }); - } - } - }, [activeNode, x5, y5, initialRect, measure]); -} -var ActiveDraggableContext = /* @__PURE__ */ F({ - ...defaultCoordinates, - scaleX: 1, - scaleY: 1 -}); -var Status; -(function(Status2) { - Status2[Status2["Uninitialized"] = 0] = "Uninitialized"; - Status2[Status2["Initializing"] = 1] = "Initializing"; - Status2[Status2["Initialized"] = 2] = "Initialized"; -})(Status || (Status = {})); -var DndContext = /* @__PURE__ */ x3(function DndContext2(_ref) { - var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; - let { - id: id2, - accessibility, - autoScroll = true, - children, - sensors = defaultSensors, - collisionDetection = rectIntersection, - measuring, - modifiers, - ...props2 - } = _ref; - const store = s2(reducer, void 0, getInitialState); - const [state, dispatch] = store; - const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); - const [status, setStatus] = h2(Status.Uninitialized); - const isInitialized = status === Status.Initialized; - const { - draggable: { - active: activeId, - nodes: draggableNodes, - translate - }, - droppable: { - containers: droppableContainers - } - } = state; - const node = activeId ? draggableNodes.get(activeId) : null; - const activeRects = _2({ - initial: null, - translated: null - }); - const active = F2(() => { - var _node$data; - return activeId != null ? { - id: activeId, - data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, - rect: activeRects - } : null; - }, [activeId, node]); - const activeRef = _2(null); - const [activeSensor, setActiveSensor] = h2(null); - const [activatorEvent, setActivatorEvent] = h2(null); - const latestProps = useLatestValue(props2, Object.values(props2)); - const draggableDescribedById = useUniqueId("DndDescribedBy", id2); - const enabledDroppableContainers = F2(() => droppableContainers.getEnabled(), [droppableContainers]); - const measuringConfiguration = useMeasuringConfiguration(measuring); - const { - droppableRects, - measureDroppableContainers, - measuringScheduled - } = useDroppableMeasuring(enabledDroppableContainers, { - dragging: isInitialized, - dependencies: [translate.x, translate.y], - config: measuringConfiguration.droppable - }); - const activeNode = useCachedNode(draggableNodes, activeId); - const activationCoordinates = F2(() => activatorEvent ? getEventCoordinates(activatorEvent) : null, [activatorEvent]); - const autoScrollOptions = getAutoScrollerOptions(); - const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); - useLayoutShiftScrollCompensation({ - activeNode: activeId ? draggableNodes.get(activeId) : null, - config: autoScrollOptions.layoutShiftCompensation, - initialRect: initialActiveNodeRect, - measure: measuringConfiguration.draggable.measure - }); - const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); - const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); - const sensorContext = _2({ - activatorEvent: null, - active: null, - activeNode, - collisionRect: null, - collisions: null, - droppableRects, - draggableNodes, - draggingNode: null, - draggingNodeRect: null, - droppableContainers, - over: null, - scrollableAncestors: [], - scrollAdjustedTranslate: null - }); - const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); - const dragOverlay = useDragOverlayMeasuring({ - measure: measuringConfiguration.dragOverlay.measure - }); - const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; - const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; - const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); - const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); - const windowRect = useWindowRect(draggingNode ? getWindow(draggingNode) : null); - const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); - const scrollableAncestorRects = useRects(scrollableAncestors); - const modifiedTranslate = applyModifiers(modifiers, { - transform: { - x: translate.x - nodeRectDelta.x, - y: translate.y - nodeRectDelta.y, - scaleX: 1, - scaleY: 1 - }, - activatorEvent, - active, - activeNodeRect, - containerNodeRect, - draggingNodeRect, - over: sensorContext.current.over, - overlayNodeRect: dragOverlay.rect, - scrollableAncestors, - scrollableAncestorRects, - windowRect - }); - const pointerCoordinates = activationCoordinates ? add(activationCoordinates, translate) : null; - const scrollOffsets = useScrollOffsets(scrollableAncestors); - const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); - const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); - const scrollAdjustedTranslate = add(modifiedTranslate, scrollAdjustment); - const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; - const collisions = active && collisionRect ? collisionDetection({ - active, - collisionRect, - droppableRects, - droppableContainers: enabledDroppableContainers, - pointerCoordinates - }) : null; - const overId = getFirstCollision(collisions, "id"); - const [over, setOver] = h2(null); - const appliedTranslate = usesDragOverlay ? modifiedTranslate : add(modifiedTranslate, activeNodeScrollDelta); - const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); - const instantiateSensor = T2( - (event, _ref2) => { - let { - sensor: Sensor, - options - } = _ref2; - if (activeRef.current == null) { - return; - } - const activeNode2 = draggableNodes.get(activeRef.current); - if (!activeNode2) { - return; - } - const activatorEvent2 = event.nativeEvent; - const sensorInstance = new Sensor({ - active: activeRef.current, - activeNode: activeNode2, - event: activatorEvent2, - options, - context: sensorContext, - onStart(initialCoordinates) { - const id3 = activeRef.current; - if (id3 == null) { - return; - } - const draggableNode = draggableNodes.get(id3); - if (!draggableNode) { - return; - } - const { - onDragStart - } = latestProps.current; - const event2 = { - active: { - id: id3, - data: draggableNode.data, - rect: activeRects - } - }; - dn(() => { - onDragStart == null ? void 0 : onDragStart(event2); - setStatus(Status.Initializing); - dispatch({ - type: Action.DragStart, - initialCoordinates, - active: id3 - }); - dispatchMonitorEvent({ - type: "onDragStart", - event: event2 - }); - }); - }, - onMove(coordinates) { - dispatch({ - type: Action.DragMove, - coordinates - }); - }, - onEnd: createHandler(Action.DragEnd), - onCancel: createHandler(Action.DragCancel) - }); - dn(() => { - setActiveSensor(sensorInstance); - setActivatorEvent(event.nativeEvent); - }); - function createHandler(type) { - return async function handler() { - const { - active: active2, - collisions: collisions2, - over: over2, - scrollAdjustedTranslate: scrollAdjustedTranslate2 - } = sensorContext.current; - let event2 = null; - if (active2 && scrollAdjustedTranslate2) { - const { - cancelDrop - } = latestProps.current; - event2 = { - activatorEvent: activatorEvent2, - active: active2, - collisions: collisions2, - delta: scrollAdjustedTranslate2, - over: over2 - }; - if (type === Action.DragEnd && typeof cancelDrop === "function") { - const shouldCancel = await Promise.resolve(cancelDrop(event2)); - if (shouldCancel) { - type = Action.DragCancel; - } - } - } - activeRef.current = null; - dn(() => { - dispatch({ - type - }); - setStatus(Status.Uninitialized); - setOver(null); - setActiveSensor(null); - setActivatorEvent(null); - const eventName = type === Action.DragEnd ? "onDragEnd" : "onDragCancel"; - if (event2) { - const handler2 = latestProps.current[eventName]; - handler2 == null ? void 0 : handler2(event2); - dispatchMonitorEvent({ - type: eventName, - event: event2 - }); - } - }); - }; - } - }, - [draggableNodes] - ); - const bindActivatorToSensorInstantiator = T2((handler, sensor) => { - return (event, active2) => { - const nativeEvent = event.nativeEvent; - const activeDraggableNode = draggableNodes.get(active2); - if (activeRef.current !== null || !activeDraggableNode || nativeEvent.dndKit || nativeEvent.defaultPrevented) { - return; - } - const activationContext = { - active: activeDraggableNode - }; - const shouldActivate = handler(event, sensor.options, activationContext); - if (shouldActivate === true) { - nativeEvent.dndKit = { - capturedBy: sensor.sensor - }; - activeRef.current = active2; - instantiateSensor(event, sensor); - } - }; - }, [draggableNodes, instantiateSensor]); - const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); - useSensorSetup(sensors); - useIsomorphicLayoutEffect(() => { - if (activeNodeRect && status === Status.Initializing) { - setStatus(Status.Initialized); - } - }, [activeNodeRect, status]); - p2( - () => { - const { - onDragMove - } = latestProps.current; - const { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - over: over2 - } = sensorContext.current; - if (!active2 || !activatorEvent2) { - return; - } - const event = { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - delta: { - x: scrollAdjustedTranslate.x, - y: scrollAdjustedTranslate.y - }, - over: over2 - }; - dn(() => { - onDragMove == null ? void 0 : onDragMove(event); - dispatchMonitorEvent({ - type: "onDragMove", - event - }); - }); - }, - [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y] - ); - p2( - () => { - const { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - droppableContainers: droppableContainers2, - scrollAdjustedTranslate: scrollAdjustedTranslate2 - } = sensorContext.current; - if (!active2 || activeRef.current == null || !activatorEvent2 || !scrollAdjustedTranslate2) { - return; - } - const { - onDragOver - } = latestProps.current; - const overContainer = droppableContainers2.get(overId); - const over2 = overContainer && overContainer.rect.current ? { - id: overContainer.id, - rect: overContainer.rect.current, - data: overContainer.data, - disabled: overContainer.disabled - } : null; - const event = { - active: active2, - activatorEvent: activatorEvent2, - collisions: collisions2, - delta: { - x: scrollAdjustedTranslate2.x, - y: scrollAdjustedTranslate2.y - }, - over: over2 - }; - dn(() => { - setOver(over2); - onDragOver == null ? void 0 : onDragOver(event); - dispatchMonitorEvent({ - type: "onDragOver", - event - }); - }); - }, - [overId] - ); - useIsomorphicLayoutEffect(() => { - sensorContext.current = { - activatorEvent, - active, - activeNode, - collisionRect, - collisions, - droppableRects, - draggableNodes, - draggingNode, - draggingNodeRect, - droppableContainers, - over, - scrollableAncestors, - scrollAdjustedTranslate - }; - activeRects.current = { - initial: draggingNodeRect, - translated: collisionRect - }; - }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); - useAutoScroller({ - ...autoScrollOptions, - delta: translate, - draggingRect: collisionRect, - pointerCoordinates, - scrollableAncestors, - scrollableAncestorRects - }); - const publicContext = F2(() => { - const context = { - active, - activeNode, - activeNodeRect, - activatorEvent, - collisions, - containerNodeRect, - dragOverlay, - draggableNodes, - droppableContainers, - droppableRects, - over, - measureDroppableContainers, - scrollableAncestors, - scrollableAncestorRects, - measuringConfiguration, - measuringScheduled, - windowRect - }; - return context; - }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); - const internalContext = F2(() => { - const context = { - activatorEvent, - activators, - active, - activeNodeRect, - ariaDescribedById: { - draggable: draggableDescribedById - }, - dispatch, - draggableNodes, - over, - measureDroppableContainers - }; - return context; - }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); - return Cn.createElement(DndMonitorContext.Provider, { - value: registerMonitorListener - }, Cn.createElement(InternalContext.Provider, { - value: internalContext - }, Cn.createElement(PublicContext.Provider, { - value: publicContext - }, Cn.createElement(ActiveDraggableContext.Provider, { - value: transform - }, children)), Cn.createElement(RestoreFocus, { - disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false - })), Cn.createElement(Accessibility, { - ...accessibility, - hiddenTextDescribedById: draggableDescribedById - })); - function getAutoScrollerOptions() { - const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; - const autoScrollGloballyDisabled = typeof autoScroll === "object" ? autoScroll.enabled === false : autoScroll === false; - const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; - if (typeof autoScroll === "object") { - return { - ...autoScroll, - enabled - }; - } - return { - enabled - }; - } -}); -var NullContext = /* @__PURE__ */ F(null); -var defaultRole = "button"; -var ID_PREFIX = "Droppable"; -function useDraggable(_ref) { - let { - id: id2, - data: data2, - disabled = false, - attributes - } = _ref; - const key2 = useUniqueId(ID_PREFIX); - const { - activators, - activatorEvent, - active, - activeNodeRect, - ariaDescribedById, - draggableNodes, - over - } = q2(InternalContext); - const { - role = defaultRole, - roleDescription = "draggable", - tabIndex = 0 - } = attributes != null ? attributes : {}; - const isDragging = (active == null ? void 0 : active.id) === id2; - const transform = q2(isDragging ? ActiveDraggableContext : NullContext); - const [node, setNodeRef] = useNodeRef(); - const [activatorNode, setActivatorNodeRef] = useNodeRef(); - const listeners = useSyntheticListeners(activators, id2); - const dataRef = useLatestValue(data2); - useIsomorphicLayoutEffect( - () => { - draggableNodes.set(id2, { - id: id2, - key: key2, - node, - activatorNode, - data: dataRef - }); - return () => { - const node2 = draggableNodes.get(id2); - if (node2 && node2.key === key2) { - draggableNodes.delete(id2); - } - }; - }, - [draggableNodes, id2] - ); - const memoizedAttributes = F2(() => ({ - role, - tabIndex, - "aria-disabled": disabled, - "aria-pressed": isDragging && role === defaultRole ? true : void 0, - "aria-roledescription": roleDescription, - "aria-describedby": ariaDescribedById.draggable - }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); - return { - active, - activatorEvent, - activeNodeRect, - attributes: memoizedAttributes, - isDragging, - listeners: disabled ? void 0 : listeners, - node, - over, - setNodeRef, - setActivatorNodeRef, - transform - }; -} -function useDndContext() { - return q2(PublicContext); -} -var ID_PREFIX$1 = "Droppable"; -var defaultResizeObserverConfig = { - timeout: 25 -}; -function useDroppable(_ref) { - let { - data: data2, - disabled = false, - id: id2, - resizeObserverConfig - } = _ref; - const key2 = useUniqueId(ID_PREFIX$1); - const { - active, - dispatch, - over, - measureDroppableContainers - } = q2(InternalContext); - const previous = _2({ - disabled - }); - const resizeObserverConnected = _2(false); - const rect = _2(null); - const callbackId = _2(null); - const { - disabled: resizeObserverDisabled, - updateMeasurementsFor, - timeout: resizeObserverTimeout - } = { - ...defaultResizeObserverConfig, - ...resizeObserverConfig - }; - const ids2 = useLatestValue(updateMeasurementsFor != null ? updateMeasurementsFor : id2); - const handleResize = T2( - () => { - if (!resizeObserverConnected.current) { - resizeObserverConnected.current = true; - return; - } - if (callbackId.current != null) { - clearTimeout(callbackId.current); - } - callbackId.current = setTimeout(() => { - measureDroppableContainers(Array.isArray(ids2.current) ? ids2.current : [ids2.current]); - callbackId.current = null; - }, resizeObserverTimeout); - }, - [resizeObserverTimeout] - ); - const resizeObserver = useResizeObserver({ - callback: handleResize, - disabled: resizeObserverDisabled || !active - }); - const handleNodeChange = T2((newElement, previousElement) => { - if (!resizeObserver) { - return; - } - if (previousElement) { - resizeObserver.unobserve(previousElement); - resizeObserverConnected.current = false; - } - if (newElement) { - resizeObserver.observe(newElement); - } - }, [resizeObserver]); - const [nodeRef, setNodeRef] = useNodeRef(handleNodeChange); - const dataRef = useLatestValue(data2); - p2(() => { - if (!resizeObserver || !nodeRef.current) { - return; - } - resizeObserver.disconnect(); - resizeObserverConnected.current = false; - resizeObserver.observe(nodeRef.current); - }, [nodeRef, resizeObserver]); - useIsomorphicLayoutEffect( - () => { - dispatch({ - type: Action.RegisterDroppable, - element: { - id: id2, - key: key2, - disabled, - node: nodeRef, - rect, - data: dataRef - } - }); - return () => dispatch({ - type: Action.UnregisterDroppable, - key: key2, - id: id2 - }); - }, - [id2] - ); - p2(() => { - if (disabled !== previous.current.disabled) { - dispatch({ - type: Action.SetDroppableDisabled, - id: id2, - key: key2, - disabled - }); - previous.current.disabled = disabled; - } - }, [id2, key2, disabled, dispatch]); - return { - active, - rect, - isOver: (over == null ? void 0 : over.id) === id2, - node: nodeRef, - over, - setNodeRef - }; -} -function AnimationManager(_ref) { - let { - animation, - children - } = _ref; - const [clonedChildren, setClonedChildren] = h2(null); - const [element, setElement] = h2(null); - const previousChildren = usePrevious(children); - if (!children && !clonedChildren && previousChildren) { - setClonedChildren(previousChildren); - } - useIsomorphicLayoutEffect(() => { - if (!element) { - return; - } - const key2 = clonedChildren == null ? void 0 : clonedChildren.key; - const id2 = clonedChildren == null ? void 0 : clonedChildren.props.id; - if (key2 == null || id2 == null) { - setClonedChildren(null); - return; - } - Promise.resolve(animation(id2, element)).then(() => { - setClonedChildren(null); - }); - }, [animation, clonedChildren, element]); - return Cn.createElement(Cn.Fragment, null, children, clonedChildren ? sn(clonedChildren, { - ref: setElement - }) : null); -} -var defaultTransform = { - x: 0, - y: 0, - scaleX: 1, - scaleY: 1 -}; -function NullifiedContextProvider(_ref) { - let { - children - } = _ref; - return Cn.createElement(InternalContext.Provider, { - value: defaultInternalContext - }, Cn.createElement(ActiveDraggableContext.Provider, { - value: defaultTransform - }, children)); -} -var baseStyles = { - position: "fixed", - touchAction: "none" -}; -var defaultTransition = (activatorEvent) => { - const isKeyboardActivator = isKeyboardEvent(activatorEvent); - return isKeyboardActivator ? "transform 250ms ease" : void 0; -}; -var PositionedOverlay = /* @__PURE__ */ k3((_ref, ref2) => { - let { - as, - activatorEvent, - adjustScale: adjustScale2, - children, - className, - rect, - style, - transform, - transition = defaultTransition - } = _ref; - if (!rect) { - return null; - } - const scaleAdjustedTransform = adjustScale2 ? transform : { - ...transform, - scaleX: 1, - scaleY: 1 - }; - const styles2 = { - ...baseStyles, - width: rect.width, - height: rect.height, - top: rect.top, - left: rect.left, - transform: CSS.Transform.toString(scaleAdjustedTransform), - transformOrigin: adjustScale2 && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : void 0, - transition: typeof transition === "function" ? transition(activatorEvent) : transition, - ...style - }; - return Cn.createElement(as, { - className, - style: styles2, - ref: ref2 - }, children); -}); -var defaultDropAnimationSideEffects = (options) => (_ref) => { - let { - active, - dragOverlay - } = _ref; - const originalStyles = {}; - const { - styles: styles2, - className - } = options; - if (styles2 != null && styles2.active) { - for (const [key2, value] of Object.entries(styles2.active)) { - if (value === void 0) { - continue; - } - originalStyles[key2] = active.node.style.getPropertyValue(key2); - active.node.style.setProperty(key2, value); - } - } - if (styles2 != null && styles2.dragOverlay) { - for (const [key2, value] of Object.entries(styles2.dragOverlay)) { - if (value === void 0) { - continue; - } - dragOverlay.node.style.setProperty(key2, value); - } - } - if (className != null && className.active) { - active.node.classList.add(className.active); - } - if (className != null && className.dragOverlay) { - dragOverlay.node.classList.add(className.dragOverlay); - } - return function cleanup() { - for (const [key2, value] of Object.entries(originalStyles)) { - active.node.style.setProperty(key2, value); - } - if (className != null && className.active) { - active.node.classList.remove(className.active); - } - }; -}; -var defaultKeyframeResolver = (_ref2) => { - let { - transform: { - initial, - final - } - } = _ref2; - return [{ - transform: CSS.Transform.toString(initial) - }, { - transform: CSS.Transform.toString(final) - }]; -}; -var defaultDropAnimationConfiguration = { - duration: 250, - easing: "ease", - keyframes: defaultKeyframeResolver, - sideEffects: /* @__PURE__ */ defaultDropAnimationSideEffects({ - styles: { - active: { - opacity: "0" - } - } - }) -}; -function useDropAnimation(_ref3) { - let { - config, - draggableNodes, - droppableContainers, - measuringConfiguration - } = _ref3; - return useEvent((id2, node) => { - if (config === null) { - return; - } - const activeDraggable = draggableNodes.get(id2); - if (!activeDraggable) { - return; - } - const activeNode = activeDraggable.node.current; - if (!activeNode) { - return; - } - const measurableNode = getMeasurableNode(node); - if (!measurableNode) { - return; - } - const { - transform - } = getWindow(node).getComputedStyle(node); - const parsedTransform = parseTransform(transform); - if (!parsedTransform) { - return; - } - const animation = typeof config === "function" ? config : createDefaultDropAnimation(config); - scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); - return animation({ - active: { - id: id2, - data: activeDraggable.data, - node: activeNode, - rect: measuringConfiguration.draggable.measure(activeNode) - }, - draggableNodes, - dragOverlay: { - node, - rect: measuringConfiguration.dragOverlay.measure(measurableNode) - }, - droppableContainers, - measuringConfiguration, - transform: parsedTransform - }); - }); -} -function createDefaultDropAnimation(options) { - const { - duration, - easing, - sideEffects, - keyframes - } = { - ...defaultDropAnimationConfiguration, - ...options - }; - return (_ref4) => { - let { - active, - dragOverlay, - transform, - ...rest - } = _ref4; - if (!duration) { - return; - } - const delta = { - x: dragOverlay.rect.left - active.rect.left, - y: dragOverlay.rect.top - active.rect.top - }; - const scale = { - scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, - scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 - }; - const finalTransform = { - x: transform.x - delta.x, - y: transform.y - delta.y, - ...scale - }; - const animationKeyframes = keyframes({ - ...rest, - active, - dragOverlay, - transform: { - initial: transform, - final: finalTransform - } - }); - const [firstKeyframe] = animationKeyframes; - const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; - if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { - return; - } - const cleanup = sideEffects == null ? void 0 : sideEffects({ - active, - dragOverlay, - ...rest - }); - const animation = dragOverlay.node.animate(animationKeyframes, { - duration, - easing, - fill: "forwards" - }); - return new Promise((resolve) => { - animation.onfinish = () => { - cleanup == null ? void 0 : cleanup(); - resolve(); - }; - }); - }; -} -var key = 0; -function useKey(id2) { - return F2(() => { - if (id2 == null) { - return; - } - key++; - return key; - }, [id2]); -} -var DragOverlay = /* @__PURE__ */ Cn.memo((_ref) => { - let { - adjustScale: adjustScale2 = false, - children, - dropAnimation: dropAnimationConfig, - style, - transition, - modifiers, - wrapperElement = "div", - className, - zIndex = 999 - } = _ref; - const { - activatorEvent, - active, - activeNodeRect, - containerNodeRect, - draggableNodes, - droppableContainers, - dragOverlay, - over, - measuringConfiguration, - scrollableAncestors, - scrollableAncestorRects, - windowRect - } = useDndContext(); - const transform = q2(ActiveDraggableContext); - const key2 = useKey(active == null ? void 0 : active.id); - const modifiedTransform = applyModifiers(modifiers, { - activatorEvent, - active, - activeNodeRect, - containerNodeRect, - draggingNodeRect: dragOverlay.rect, - over, - overlayNodeRect: dragOverlay.rect, - scrollableAncestors, - scrollableAncestorRects, - transform, - windowRect - }); - const initialRect = useInitialValue(activeNodeRect); - const dropAnimation = useDropAnimation({ - config: dropAnimationConfig, - draggableNodes, - droppableContainers, - measuringConfiguration - }); - const ref2 = initialRect ? dragOverlay.setRef : void 0; - return Cn.createElement(NullifiedContextProvider, null, Cn.createElement(AnimationManager, { - animation: dropAnimation - }, active && key2 ? Cn.createElement(PositionedOverlay, { - key: key2, - id: active.id, - ref: ref2, - as: wrapperElement, - activatorEvent, - adjustScale: adjustScale2, - className, - transition, - rect: initialRect, - style: { - zIndex, - ...style - }, - transform: modifiedTransform - }, children) : null)); -}); - -// node_modules/@dnd-kit/sortable/dist/sortable.esm.js -function arrayMove(array, from, to) { - const newArray = array.slice(); - newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]); - return newArray; -} -function getSortedRects(items, rects) { - return items.reduce((accumulator, id2, index) => { - const rect = rects.get(id2); - if (rect) { - accumulator[index] = rect; - } - return accumulator; - }, Array(items.length)); -} -function isValidIndex(index) { - return index !== null && index >= 0; -} -function itemsEqual(a5, b4) { - if (a5 === b4) { - return true; - } - if (a5.length !== b4.length) { - return false; - } - for (let i4 = 0; i4 < a5.length; i4++) { - if (a5[i4] !== b4[i4]) { - return false; - } - } - return true; -} -function normalizeDisabled(disabled) { - if (typeof disabled === "boolean") { - return { - draggable: disabled, - droppable: disabled - }; - } - return disabled; -} -var defaultScale = { - scaleX: 1, - scaleY: 1 -}; -var horizontalListSortingStrategy = (_ref) => { - var _rects$activeIndex; - let { - rects, - activeNodeRect: fallbackActiveRect, - activeIndex, - overIndex, - index - } = _ref; - const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; - if (!activeNodeRect) { - return null; - } - const itemGap = getItemGap(rects, index, activeIndex); - if (index === activeIndex) { - const newIndexRect = rects[overIndex]; - if (!newIndexRect) { - return null; - } - return { - x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left, - y: 0, - ...defaultScale - }; - } - if (index > activeIndex && index <= overIndex) { - return { - x: -activeNodeRect.width - itemGap, - y: 0, - ...defaultScale - }; - } - if (index < activeIndex && index >= overIndex) { - return { - x: activeNodeRect.width + itemGap, - y: 0, - ...defaultScale - }; - } - return { - x: 0, - y: 0, - ...defaultScale - }; -}; -function getItemGap(rects, index, activeIndex) { - const currentRect = rects[index]; - const previousRect = rects[index - 1]; - const nextRect = rects[index + 1]; - if (!currentRect || !previousRect && !nextRect) { - return 0; - } - if (activeIndex < index) { - return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width); - } - return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width); -} -var rectSortingStrategy = (_ref) => { - let { - rects, - activeIndex, - overIndex, - index - } = _ref; - const newRects = arrayMove(rects, overIndex, activeIndex); - const oldRect = rects[index]; - const newRect = newRects[index]; - if (!newRect || !oldRect) { - return null; - } - return { - x: newRect.left - oldRect.left, - y: newRect.top - oldRect.top, - scaleX: newRect.width / oldRect.width, - scaleY: newRect.height / oldRect.height - }; -}; -var defaultScale$1 = { - scaleX: 1, - scaleY: 1 -}; -var verticalListSortingStrategy = (_ref) => { - var _rects$activeIndex; - let { - activeIndex, - activeNodeRect: fallbackActiveRect, - index, - rects, - overIndex - } = _ref; - const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; - if (!activeNodeRect) { - return null; - } - if (index === activeIndex) { - const overIndexRect = rects[overIndex]; - if (!overIndexRect) { - return null; - } - return { - x: 0, - y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top, - ...defaultScale$1 - }; - } - const itemGap = getItemGap$1(rects, index, activeIndex); - if (index > activeIndex && index <= overIndex) { - return { - x: 0, - y: -activeNodeRect.height - itemGap, - ...defaultScale$1 - }; - } - if (index < activeIndex && index >= overIndex) { - return { - x: 0, - y: activeNodeRect.height + itemGap, - ...defaultScale$1 - }; - } - return { - x: 0, - y: 0, - ...defaultScale$1 - }; -}; -function getItemGap$1(clientRects, index, activeIndex) { - const currentRect = clientRects[index]; - const previousRect = clientRects[index - 1]; - const nextRect = clientRects[index + 1]; - if (!currentRect) { - return 0; - } - if (activeIndex < index) { - return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0; - } - return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0; -} -var ID_PREFIX2 = "Sortable"; -var Context = /* @__PURE__ */ Cn.createContext({ - activeIndex: -1, - containerId: ID_PREFIX2, - disableTransforms: false, - items: [], - overIndex: -1, - useDragOverlay: false, - sortedRects: [], - strategy: rectSortingStrategy, - disabled: { - draggable: false, - droppable: false - } -}); -function SortableContext(_ref) { - let { - children, - id: id2, - items: userDefinedItems, - strategy = rectSortingStrategy, - disabled: disabledProp = false - } = _ref; - const { - active, - dragOverlay, - droppableRects, - over, - measureDroppableContainers - } = useDndContext(); - const containerId = useUniqueId(ID_PREFIX2, id2); - const useDragOverlay = Boolean(dragOverlay.rect !== null); - const items = F2(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]); - const isDragging = active != null; - const activeIndex = active ? items.indexOf(active.id) : -1; - const overIndex = over ? items.indexOf(over.id) : -1; - const previousItemsRef = _2(items); - const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current); - const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged; - const disabled = normalizeDisabled(disabledProp); - useIsomorphicLayoutEffect(() => { - if (itemsHaveChanged && isDragging) { - measureDroppableContainers(items); - } - }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]); - p2(() => { - previousItemsRef.current = items; - }, [items]); - const contextValue = F2( - () => ({ - activeIndex, - containerId, - disabled, - disableTransforms, - items, - overIndex, - useDragOverlay, - sortedRects: getSortedRects(items, droppableRects), - strategy - }), - [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy] - ); - return Cn.createElement(Context.Provider, { - value: contextValue - }, children); -} -var defaultNewIndexGetter = (_ref) => { - let { - id: id2, - items, - activeIndex, - overIndex - } = _ref; - return arrayMove(items, activeIndex, overIndex).indexOf(id2); -}; -var defaultAnimateLayoutChanges = (_ref2) => { - let { - containerId, - isSorting, - wasDragging, - index, - items, - newIndex, - previousItems, - previousContainerId, - transition - } = _ref2; - if (!transition || !wasDragging) { - return false; - } - if (previousItems !== items && index === newIndex) { - return false; - } - if (isSorting) { - return true; - } - return newIndex !== index && containerId === previousContainerId; -}; -var defaultTransition2 = { - duration: 200, - easing: "ease" -}; -var transitionProperty = "transform"; -var disabledTransition = /* @__PURE__ */ CSS.Transition.toString({ - property: transitionProperty, - duration: 0, - easing: "linear" -}); -var defaultAttributes = { - roleDescription: "sortable" -}; -function useDerivedTransform(_ref) { - let { - disabled, - index, - node, - rect - } = _ref; - const [derivedTransform, setDerivedtransform] = h2(null); - const previousIndex = _2(index); - useIsomorphicLayoutEffect(() => { - if (!disabled && index !== previousIndex.current && node.current) { - const initial = rect.current; - if (initial) { - const current2 = getClientRect(node.current, { - ignoreTransform: true - }); - const delta = { - x: initial.left - current2.left, - y: initial.top - current2.top, - scaleX: initial.width / current2.width, - scaleY: initial.height / current2.height - }; - if (delta.x || delta.y) { - setDerivedtransform(delta); - } - } - } - if (index !== previousIndex.current) { - previousIndex.current = index; - } - }, [disabled, index, node, rect]); - p2(() => { - if (derivedTransform) { - setDerivedtransform(null); - } - }, [derivedTransform]); - return derivedTransform; -} -function useSortable(_ref) { - let { - animateLayoutChanges: animateLayoutChanges4 = defaultAnimateLayoutChanges, - attributes: userDefinedAttributes, - disabled: localDisabled, - data: customData, - getNewIndex = defaultNewIndexGetter, - id: id2, - strategy: localStrategy, - resizeObserverConfig, - transition = defaultTransition2 - } = _ref; - const { - items, - containerId, - activeIndex, - disabled: globalDisabled, - disableTransforms, - sortedRects, - overIndex, - useDragOverlay, - strategy: globalStrategy - } = q2(Context); - const disabled = normalizeLocalDisabled(localDisabled, globalDisabled); - const index = items.indexOf(id2); - const data2 = F2(() => ({ - sortable: { - containerId, - index, - items - }, - ...customData - }), [containerId, customData, index, items]); - const itemsAfterCurrentSortable = F2(() => items.slice(items.indexOf(id2)), [items, id2]); - const { - rect, - node, - isOver, - setNodeRef: setDroppableNodeRef - } = useDroppable({ - id: id2, - data: data2, - disabled: disabled.droppable, - resizeObserverConfig: { - updateMeasurementsFor: itemsAfterCurrentSortable, - ...resizeObserverConfig - } - }); - const { - active, - activatorEvent, - activeNodeRect, - attributes, - setNodeRef: setDraggableNodeRef, - listeners, - isDragging, - over, - setActivatorNodeRef, - transform - } = useDraggable({ - id: id2, - data: data2, - attributes: { - ...defaultAttributes, - ...userDefinedAttributes - }, - disabled: disabled.draggable - }); - const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef); - const isSorting = Boolean(active); - const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex); - const shouldDisplaceDragSource = !useDragOverlay && isDragging; - const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null; - const strategy = localStrategy != null ? localStrategy : globalStrategy; - const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ - rects: sortedRects, - activeNodeRect, - activeIndex, - overIndex, - index - }) : null; - const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ - id: id2, - items, - activeIndex, - overIndex - }) : index; - const activeId = active == null ? void 0 : active.id; - const previous = _2({ - activeId, - items, - newIndex, - containerId - }); - const itemsHaveChanged = items !== previous.current.items; - const shouldAnimateLayoutChanges = animateLayoutChanges4({ - active, - containerId, - isDragging, - isSorting, - id: id2, - index, - items, - newIndex: previous.current.newIndex, - previousItems: previous.current.items, - previousContainerId: previous.current.containerId, - transition, - wasDragging: previous.current.activeId != null - }); - const derivedTransform = useDerivedTransform({ - disabled: !shouldAnimateLayoutChanges, - index, - node, - rect - }); - p2(() => { - if (isSorting && previous.current.newIndex !== newIndex) { - previous.current.newIndex = newIndex; - } - if (containerId !== previous.current.containerId) { - previous.current.containerId = containerId; - } - if (items !== previous.current.items) { - previous.current.items = items; - } - }, [isSorting, newIndex, containerId, items]); - p2(() => { - if (activeId === previous.current.activeId) { - return; - } - if (activeId && !previous.current.activeId) { - previous.current.activeId = activeId; - return; - } - const timeoutId = setTimeout(() => { - previous.current.activeId = activeId; - }, 50); - return () => clearTimeout(timeoutId); - }, [activeId]); - return { - active, - activeIndex, - attributes, - data: data2, - rect, - index, - newIndex, - items, - isOver, - isSorting, - isDragging, - listeners, - node, - overIndex, - over, - setNodeRef, - setActivatorNodeRef, - setDroppableNodeRef, - setDraggableNodeRef, - transform: derivedTransform != null ? derivedTransform : finalTransform, - transition: getTransition() - }; - function getTransition() { - if (derivedTransform || itemsHaveChanged && previous.current.newIndex === index) { - return disabledTransition; - } - if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) { - return void 0; - } - if (isSorting || shouldAnimateLayoutChanges) { - return CSS.Transition.toString({ - ...transition, - property: transitionProperty - }); - } - return void 0; - } -} -function normalizeLocalDisabled(localDisabled, globalDisabled) { - var _localDisabled$dragga, _localDisabled$droppa; - if (typeof localDisabled === "boolean") { - return { - draggable: localDisabled, - droppable: false - }; - } - return { - draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, - droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable - }; -} -function hasSortableData(entry) { - if (!entry) { - return false; - } - const data2 = entry.data.current; - if (data2 && "sortable" in data2 && typeof data2.sortable === "object" && "containerId" in data2.sortable && "items" in data2.sortable && "index" in data2.sortable) { - return true; - } - return false; -} -var directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left]; -var sortableKeyboardCoordinates = (event, _ref) => { - let { - context: { - active, - collisionRect, - droppableRects, - droppableContainers, - over, - scrollableAncestors - } - } = _ref; - if (directions.includes(event.code)) { - event.preventDefault(); - if (!active || !collisionRect) { - return; - } - const filteredContainers = []; - droppableContainers.getEnabled().forEach((entry) => { - if (!entry || entry != null && entry.disabled) { - return; - } - const rect = droppableRects.get(entry.id); - if (!rect) { - return; - } - switch (event.code) { - case KeyboardCode.Down: - if (collisionRect.top < rect.top) { - filteredContainers.push(entry); - } - break; - case KeyboardCode.Up: - if (collisionRect.top > rect.top) { - filteredContainers.push(entry); - } - break; - case KeyboardCode.Left: - if (collisionRect.left > rect.left) { - filteredContainers.push(entry); - } - break; - case KeyboardCode.Right: - if (collisionRect.left < rect.left) { - filteredContainers.push(entry); - } - break; - } - }); - const collisions = closestCorners({ - active, - collisionRect, - droppableRects, - droppableContainers: filteredContainers, - pointerCoordinates: null - }); - let closestId = getFirstCollision(collisions, "id"); - if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) { - closestId = collisions[1].id; - } - if (closestId != null) { - const activeDroppable = droppableContainers.get(active.id); - const newDroppable = droppableContainers.get(closestId); - const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null; - const newNode = newDroppable == null ? void 0 : newDroppable.node.current; - if (newNode && newRect && activeDroppable && newDroppable) { - const newScrollAncestors = getScrollableAncestors(newNode); - const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element); - const hasSameContainer = isSameContainer(activeDroppable, newDroppable); - const isAfterActive = isAfter(activeDroppable, newDroppable); - const offset2 = hasDifferentScrollAncestors || !hasSameContainer ? { - x: 0, - y: 0 - } : { - x: isAfterActive ? collisionRect.width - newRect.width : 0, - y: isAfterActive ? collisionRect.height - newRect.height : 0 - }; - const rectCoordinates = { - x: newRect.left, - y: newRect.top - }; - const newCoordinates = offset2.x && offset2.y ? rectCoordinates : subtract(rectCoordinates, offset2); - return newCoordinates; - } - } - } - return void 0; -}; -function isSameContainer(a5, b4) { - if (!hasSortableData(a5) || !hasSortableData(b4)) { - return false; - } - return a5.data.current.sortable.containerId === b4.data.current.sortable.containerId; -} -function isAfter(a5, b4) { - if (!hasSortableData(a5) || !hasSortableData(b4)) { - return false; - } - if (!isSameContainer(a5, b4)) { - return false; - } - return a5.data.current.sortable.index < b4.data.current.sortable.index; -} - -// src/components/UI/menus/propertyMenu/newPropertyMenu.tsx -var import_obsidian16 = require("obsidian"); - -// src/components/UI/menus/menuItems.tsx -var import_obsidian8 = require("obsidian"); - -// src/components/UI/menus/selectMenu/SelectMenuComponent.tsx -var import_fuzzysort = __toESM(require_fuzzysort()); -var import_lodash = __toESM(require_lodash()); - -// src/components/UI/menus/selectMenu/SelectMenuInput.tsx -var SIZER_STYLES = { - position: "absolute", - width: 0, - height: 0, - visibility: "hidden", - overflow: "scroll", - whiteSpace: "pre" -}; -var STYLE_PROPS = [ - "fontSize", - "fontFamily", - "fontWeight", - "fontStyle", - "letterSpacing", - "textTransform" -]; -var SelectMenuInput = k3( - (props2, input) => { - const { classNames: classNames9, inputAttributes, inputEventHandlers, index } = props2; - const sizer = _2(null); - const [inputWidth, setInputWidth] = h2(null); - const [query, setQuery] = h2(""); - const [placeholderText, setPlaceholderText] = h2(""); - p2(() => { - copyInputStyles(); - updateInputWidth(); - setTimeout(() => { - input.current.focus(); - }, 50); - }, []); - p2(() => { - if (query !== props2.query || placeholderText !== props2.placeholderText) { - setQuery(props2.query); - setPlaceholderText(props2.placeholderText); - updateInputWidth(); - } - }, [props2.query, props2.placeholderText]); - const copyInputStyles = () => { - const inputStyle = window.getComputedStyle(input.current); - STYLE_PROPS.forEach((prop) => { - sizer.current.style[prop] = inputStyle[prop]; - }); - }; - const updateInputWidth = () => { - let _inputWidth; - _inputWidth = Math.ceil(sizer.current.scrollWidth) + 2; - if (_inputWidth !== inputWidth) { - setInputWidth(_inputWidth); - } - }; - return /* @__PURE__ */ Cn.createElement("div", { - className: classNames9.searchWrapper - }, /* @__PURE__ */ Cn.createElement("input", { - ...inputAttributes, - ...inputEventHandlers, - ref: input, - value: query, - placeholder: placeholderText, - className: classNames9.searchInput, - role: "combobox", - style: { width: "100%" } - }), /* @__PURE__ */ Cn.createElement("div", { - ref: sizer, - style: SIZER_STYLES - }, query || placeholderText)); - } -); -var SelectMenuInput_default = SelectMenuInput; - -// src/components/UI/menus/selectMenu/SelectMenuPill.tsx -var SelectMenuPillComponent = (props2) => { - return /* @__PURE__ */ Cn.createElement("button", { - type: "button", - className: props2.classNames.selectedTag, - onClick: props2.onDelete - }, /* @__PURE__ */ Cn.createElement("span", { - className: props2.classNames.selectedTagName - }, props2.tag.name)); -}; -var SelectMenuPill_default = SelectMenuPillComponent; - -// src/utils/sticker.ts -var import_obsidian7 = require("obsidian"); - -// src/utils/icons.ts -var import_obsidian6 = require("obsidian"); -var iconForSpaceType = (type, path, force) => { - return type == "folder" ? "ui//mk-ui-folder" : type == "tag" ? force ? "lucide//tags" : "" : type == "vault" ? "lucide//vault" : "lucide//layout-grid"; -}; -var lucideIcon = (value) => { - var _a2; - return (_a2 = (0, import_obsidian6.getIcon)(value)) == null ? void 0 : _a2.outerHTML; -}; -var uiIconSet = { - "mk-ui-rows": ``, - "mk-ui-close": ` - - `, - "mk-ui-flow-hover": ` - - `, - "mk-ui-folder": ` - - `, - "mk-ui-open-link": ` - - `, - "mk-ui-file": ` - -`, - "mk-ui-expand": ` - -`, - "mk-ui-new-folder": ``, - "mk-ui-new-note": ``, - "mk-ui-collapse": ` - -`, - "mk-ui-options": ` - -`, - "mk-ui-plus": ` - -`, - "mk-ui-collapse-sm": ` - -`, - "mk-ui-search": ` - - -`, - "mk-ui-view-options": ` - - -`, - "mk-ui-clear": ` - - -`, - "mk-ui-new-file": ` - - -`, - "mk-ui-blink": ` - - - - -`, - "mk-ui-spaces": ` - -`, - "mk-ui-home": ` - -`, - "mk-ui-tags": ` - -`, - "mk-ui-handle": ` - - - - - - - -`, - "mk-ui-new-space": ` - - -`, - "mk-ui-file-solid": ` - - - -`, - "mk-ui-folder-solid": ` - - -`, - "mk-ui-sync": ` - - -`, - "mk-ui-stack": ` - - -`, - "mk-ui-cut": ` - - -`, - "mk-ui-backlink": ` - - -`, - "mk-ui-canvas": ` - - - - - -`, - "mk-ui-video": ` - - -`, - "mk-ui-edit": ` - - -`, - "mk-ui-list": ` - - - -`, - "mk-ui-build": ` - - -`, - "mk-ui-check": ` - - -`, - "mk-ui-layout": ` - - -`, - "mk-ui-colors": ` - - -`, - "mk-make-todo": ` - - - -`, - "mk-make-list": ` - - - - - - - -`, - "mk-make-ordered": ` - - - - - - - -`, - "mk-make-h1": ` - - - -`, - "mk-make-h2": ` - - - -`, - "mk-make-h3": ` - - - -`, - "mk-make-quote": ` - - - - - -`, - "mk-make-hr": ` - - -`, - "mk-make-link": ` - - -`, - "mk-make-image": ` - - - - - -`, - "mk-make-codeblock": ` - - - - -`, - "mk-make-callout": ` - - - -`, - "mk-make-note": ` - - - - - -`, - "mk-make-flow": ` - - -`, - "mk-make-tag": ` - - -`, - "mk-make-table": ` - - - - -`, - "mk-make-date": ` - - -`, - "mk-make-indent": ` - - - - - - -`, - "mk-make-unindent": ` - - - - - -`, - "mk-mark-strong": ` - - -`, - "mk-mark-em": ` - -`, - "mk-mark-strikethrough": ` - - - -`, - "mk-mark-code": ` - - - - -`, - "mk-mark-link": ` - -`, - "mk-mark-blocklink": ` - - - - -`, - "mk-mark-highlight": ` - - - - - -`, - "mk-make-attach": ` - - - - -`, - "mk-make-keyboard": ` - - - -`, - "mk-make-slash": ` - - - -`, - "mk-make-style": ` - -`, - "mk-mark-color": ` - - -`, - "mk-ui-any": ` - - -`, - "mk-ui-all": ` - - - -`, - "mk-ui-context": ` - - - - - -`, - "mk-ui-full-width": `` -}; -var mkLogo = ` - - -`; -var lucideIcons = [ - "accessibility", - "activity", - "air-vent", - "airplay", - "alarm-check", - "alarm-clock-off", - "alarm-clock", - "alarm-minus", - "alarm-plus", - "album", - "alert-circle", - "alert-octagon", - "alert-triangle", - "align-center-horizontal", - "align-center-vertical", - "align-center", - "align-end-horizontal", - "align-end-vertical", - "align-horizontal-distribute-center", - "align-horizontal-distribute-end", - "align-horizontal-distribute-start", - "align-horizontal-justify-center", - "align-horizontal-justify-end", - "align-horizontal-justify-start", - "align-horizontal-space-around", - "align-horizontal-space-between", - "align-justify", - "align-left", - "align-right", - "align-start-horizontal", - "align-start-vertical", - "align-vertical-distribute-center", - "align-vertical-distribute-end", - "align-vertical-distribute-start", - "align-vertical-justify-center", - "align-vertical-justify-end", - "align-vertical-justify-start", - "align-vertical-space-around", - "align-vertical-space-between", - "anchor", - "angry", - "annoyed", - "aperture", - "apple", - "archive-restore", - "archive", - "armchair", - "arrow-big-down", - "arrow-big-left", - "arrow-big-right", - "arrow-big-up", - "arrow-down-circle", - "arrow-down-left-from-circle", - "arrow-down-left", - "arrow-down-right-from-circle", - "arrow-down-right", - "arrow-down", - "arrow-left-circle", - "arrow-left-right", - "arrow-left", - "arrow-right-circle", - "arrow-right", - "arrow-up-circle", - "arrow-up-down", - "arrow-up-left-from-circle", - "arrow-up-left", - "arrow-up-right-from-circle", - "arrow-up-right", - "arrow-up", - "asterisk", - "at-sign", - "atom", - "award", - "axe", - "axis-3d", - "baby", - "backpack", - "baggage-claim", - "ban", - "banana", - "banknote", - "bar-chart-2", - "bar-chart-3", - "bar-chart-4", - "bar-chart-horizontal", - "bar-chart", - "baseline", - "bath", - "battery-charging", - "battery-full", - "battery-low", - "battery-medium", - "battery-warning", - "battery", - "beaker", - "bean-off", - "bean", - "bed-double", - "bed-single", - "bed", - "beef", - "beer", - "bell-minus", - "bell-off", - "bell-plus", - "bell-ring", - "bell", - "bike", - "binary", - "bird", - "bitcoin", - "blinds", - "bluetooth-connected", - "bluetooth-off", - "bluetooth-searching", - "bluetooth", - "bold", - "bomb", - "bone", - "book-copy", - "book-down", - "book-key", - "book-lock", - "book-marked", - "book-minus", - "book-open-check", - "book-open", - "book-plus", - "book-template", - "book-up", - "book-x", - "book", - "bookmark-minus", - "bookmark-plus", - "bookmark", - "bot", - "box-select", - "box", - "boxes", - "brain-circuit", - "brain-cog", - "brain", - "briefcase", - "brush", - "bug", - "building-2", - "building", - "bus", - "cake", - "calculator", - "calendar-check-2", - "calendar-check", - "calendar-clock", - "calendar-days", - "calendar-heart", - "calendar-minus", - "calendar-off", - "calendar-plus", - "calendar-range", - "calendar-search", - "calendar-x2", - "calendar-x", - "calendar", - "camera-off", - "camera", - "candy-off", - "candy", - "car", - "carrot", - "case-lower", - "case-sensitive", - "case-upper", - "cast", - "castle", - "cat", - "check-check", - "check-circle-2", - "check-circle", - "check-square", - "check", - "chef-hat", - "cherry", - "chevron-down-square", - "chevron-down", - "chevron-first", - "chevron-last", - "chevron-left-square", - "chevron-left", - "chevron-right-square", - "chevron-right", - "chevron-up-square", - "chevron-up", - "chevrons-down-up", - "chevrons-down", - "chevrons-left-right", - "chevrons-left", - "chevrons-right-left", - "chevrons-right", - "chevrons-up-down", - "chevrons-up", - "chrome", - "church", - "cigarette-off", - "cigarette", - "circle-dot", - "circle-ellipsis", - "circle-equal", - "circle-off", - "circle-slash-2", - "circle-slash", - "circle", - "circuit-board", - "citrus", - "clapperboard", - "clipboard-check", - "clipboard-copy", - "clipboard-edit", - "clipboard-list", - "clipboard-paste", - "clipboard-signature", - "clipboard-type", - "clipboard-x", - "clipboard", - "clock-1", - "clock-10", - "clock-11", - "clock-12", - "clock-2", - "clock-3", - "clock-4", - "clock-5", - "clock-6", - "clock-7", - "clock-8", - "clock-9", - "clock", - "cloud-cog", - "cloud-drizzle", - "cloud-fog", - "cloud-hail", - "cloud-lightning", - "cloud-moon-rain", - "cloud-moon", - "cloud-off", - "cloud-rain-wind", - "cloud-rain", - "cloud-snow", - "cloud-sun-rain", - "cloud-sun", - "cloud", - "cloudy", - "clover", - "code-2", - "code", - "codepen", - "codesandbox", - "coffee", - "cog", - "coins", - "columns", - "command", - "compass", - "component", - "concierge-bell", - "construction", - "contact", - "contrast", - "cookie", - "copy-check", - "copy-minus", - "copy-plus", - "copy-slash", - "copy-x", - "copy", - "copyleft", - "copyright", - "corner-down-left", - "corner-down-right", - "corner-left-down", - "corner-left-up", - "corner-right-down", - "corner-right-up", - "corner-up-left", - "corner-up-right", - "cpu", - "creative-commons", - "credit-card", - "croissant", - "crop", - "cross", - "crosshair", - "crown", - "cup-soda", - "curly-braces", - "currency", - "database-backup", - "database", - "delete", - "diamond", - "dice-1", - "dice-2", - "dice-3", - "dice-4", - "dice-5", - "dice-6", - "dices", - "diff", - "disc-2", - "disc", - "divide-circle", - "divide-square", - "divide", - "dna-off", - "dna", - "dog", - "dollar-sign", - "door-closed", - "door-open", - "download-cloud", - "download", - "dribbble", - "droplet", - "droplets", - "drumstick", - "dumbbell", - "ear-off", - "ear", - "edit-2", - "edit-3", - "edit", - "egg-fried", - "egg-off", - "egg", - "equal-not", - "equal", - "eraser", - "euro", - "expand", - "external-link", - "eye-off", - "eye", - "facebook", - "factory", - "fan", - "fast-forward", - "feather", - "figma", - "file-archive", - "file-audio-2", - "file-audio", - "file-axis-3d", - "file-badge-2", - "file-badge", - "file-bar-chart-2", - "file-bar-chart", - "file-box", - "file-check-2", - "file-check", - "file-clock", - "file-code", - "file-cog-2", - "file-cog", - "file-diff", - "file-digit", - "file-down", - "file-edit", - "file-heart", - "file-image", - "file-input", - "file-json-2", - "file-json", - "file-key-2", - "file-key", - "file-line-chart", - "file-lock-2", - "file-lock", - "file-minus-2", - "file-minus", - "file-output", - "file-pie-chart", - "file-plus-2", - "file-plus", - "file-question", - "file-scan", - "file-search-2", - "file-search", - "file-signature", - "file-spreadsheet", - "file-symlink", - "file-terminal", - "file-text", - "file-type-2", - "file-type", - "file-up", - "file-video-2", - "file-video", - "file-volume-2", - "file-volume", - "file-warning", - "file-x2", - "file-x", - "file", - "files", - "film", - "filter-x", - "filter", - "fingerprint", - "fish-off", - "fish", - "flag-off", - "flag-triangle-left", - "flag-triangle-right", - "flag", - "flame", - "flashlight-off", - "flashlight", - "flask-conical-off", - "flask-conical", - "flask-round", - "flip-horizontal-2", - "flip-horizontal", - "flip-vertical-2", - "flip-vertical", - "flower-2", - "flower", - "focus", - "folder-archive", - "folder-check", - "folder-clock", - "folder-closed", - "folder-cog-2", - "folder-cog", - "folder-down", - "folder-edit", - "folder-git-2", - "folder-git", - "folder-heart", - "folder-input", - "folder-key", - "folder-lock", - "folder-minus", - "folder-open", - "folder-output", - "folder-plus", - "folder-search-2", - "folder-search", - "folder-symlink", - "folder-tree", - "folder-up", - "folder-x", - "folder", - "folders", - "footprints", - "forklift", - "form-input", - "forward", - "frame", - "framer", - "frown", - "fuel", - "function-square", - "gamepad-2", - "gamepad", - "gauge", - "gavel", - "gem", - "ghost", - "gift", - "git-branch-plus", - "git-branch", - "git-commit", - "git-compare", - "git-fork", - "git-merge", - "git-pull-request-closed", - "git-pull-request-draft", - "git-pull-request", - "github", - "gitlab", - "glass-water", - "glasses", - "globe-2", - "globe", - "grab", - "graduation-cap", - "grape", - "grid", - "grip-horizontal", - "grip-vertical", - "grip", - "hammer", - "hand-metal", - "hand", - "hard-drive", - "hard-hat", - "hash", - "haze", - "heading-1", - "heading-2", - "heading-3", - "heading-4", - "heading-5", - "heading-6", - "heading", - "headphones", - "heart-crack", - "heart-handshake", - "heart-off", - "heart-pulse", - "heart", - "help-circle", - "helping-hand", - "hexagon", - "highlighter", - "history", - "home", - "hop-off", - "hop", - "hotel", - "hourglass", - "ice-cream-2", - "ice-cream", - "image-minus", - "image-off", - "image-plus", - "image", - "import", - "inbox", - "indent", - "indian-rupee", - "infinity", - "info", - "inspect", - "instagram", - "italic", - "japanese-yen", - "joystick", - "key", - "keyboard", - "lamp-ceiling", - "lamp-desk", - "lamp-floor", - "lamp-wall-down", - "lamp-wall-up", - "lamp", - "landmark", - "languages", - "laptop-2", - "laptop", - "lasso-select", - "lasso", - "laugh", - "layers", - "layout-dashboard", - "layout-grid", - "layout-list", - "layout-template", - "layout", - "leaf", - "library", - "life-buoy", - "lightbulb-off", - "lightbulb", - "line-chart", - "link-2off", - "link-2", - "link", - "linkedin", - "list-checks", - "list-end", - "list-minus", - "list-music", - "list-ordered", - "list-plus", - "list-start", - "list-tree", - "list-video", - "list-x", - "list", - "loader-2", - "loader", - "locate-fixed", - "locate-off", - "locate", - "lock", - "log-in", - "log-out", - "luggage", - "magnet", - "mail-check", - "mail-minus", - "mail-open", - "mail-plus", - "mail-question", - "mail-search", - "mail-warning", - "mail-x", - "mail", - "mailbox", - "mails", - "map-pin-off", - "map-pin", - "map", - "martini", - "maximize-2", - "maximize", - "medal", - "megaphone-off", - "megaphone", - "meh", - "menu", - "message-circle", - "message-square-dashed", - "message-square-plus", - "message-square", - "messages-square", - "mic-2", - "mic-off", - "mic", - "microscope", - "microwave", - "milestone", - "milk-off", - "milk", - "minimize-2", - "minimize", - "minus-circle", - "minus-square", - "minus", - "monitor-off", - "monitor-smartphone", - "monitor-speaker", - "monitor", - "moon", - "more-horizontal", - "more-vertical", - "mountain-snow", - "mountain", - "mouse-pointer-2", - "mouse-pointer-click", - "mouse-pointer", - "mouse", - "move-3d", - "move-diagonal-2", - "move-diagonal", - "move-horizontal", - "move-vertical", - "move", - "music-2", - "music-3", - "music-4", - "music", - "navigation-2off", - "navigation-2", - "navigation-off", - "navigation", - "network", - "newspaper", - "nfc", - "nut-off", - "nut", - "octagon", - "option", - "orbit", - "outdent", - "package-2", - "package-check", - "package-minus", - "package-open", - "package-plus", - "package-search", - "package-x", - "package", - "paint-bucket", - "paintbrush-2", - "paintbrush", - "palette", - "palmtree", - "paperclip", - "parking-circle-off", - "parking-circle", - "parking-square-off", - "parking-square", - "party-popper", - "pause-circle", - "pause-octagon", - "pause", - "pen-tool", - "pencil", - "percent", - "person-standing", - "phone-call", - "phone-forwarded", - "phone-incoming", - "phone-missed", - "phone-off", - "phone-outgoing", - "phone", - "picture-in-picture-2", - "picture-in-picture", - "pie-chart", - "piggy-bank", - "pilcrow", - "pill", - "pin-off", - "pin", - "pipette", - "pizza", - "plane-landing", - "plane-takeoff", - "plane", - "play-circle", - "play", - "plug-2", - "plug-zap", - "plug", - "plus-circle", - "plus-square", - "plus", - "pocket", - "podcast", - "pointer", - "pound-sterling", - "power-off", - "power", - "printer", - "puzzle", - "qr-code", - "quote", - "radio-receiver", - "radio-tower", - "radio", - "rat", - "receipt", - "rectangle-horizontal", - "rectangle-vertical", - "recycle", - "redo-2", - "redo", - "refresh-ccw", - "refresh-cw", - "refrigerator", - "regex", - "remove-formatting", - "repeat-1", - "repeat", - "replace-all", - "replace", - "reply-all", - "reply", - "rewind", - "rocket", - "rocking-chair", - "rotate-3d", - "rotate-ccw", - "rotate-cw", - "router", - "rss", - "ruler", - "russian-ruble", - "sailboat", - "salad", - "sandwich", - "save", - "scale-3d", - "scale", - "scaling", - "scan-face", - "scan-line", - "scan", - "school-2", - "school", - "scissors", - "screen-share-off", - "screen-share", - "scroll", - "search", - "send", - "separator-horizontal", - "separator-vertical", - "server-cog", - "server-crash", - "server-off", - "server", - "settings-2", - "settings", - "share-2", - "share", - "sheet", - "shield-alert", - "shield-check", - "shield-close", - "shield-off", - "shield-question", - "shield", - "ship", - "shirt", - "shopping-bag", - "shopping-cart", - "shovel", - "shower-head", - "shrink", - "shrub", - "shuffle", - "sidebar-close", - "sidebar-open", - "sidebar", - "sigma", - "signal-high", - "signal-low", - "signal-medium", - "signal-zero", - "signal", - "siren", - "skip-back", - "skip-forward", - "skull", - "slack", - "slice", - "sliders-horizontal", - "sliders", - "smartphone-charging", - "smartphone-nfc", - "smartphone", - "smile-plus", - "smile", - "snowflake", - "sofa", - "sort-asc", - "sort-desc", - "soup", - "space", - "speaker", - "spline", - "split-square-horizontal", - "split-square-vertical", - "sprout", - "square", - "stamp", - "star-half", - "star-off", - "star", - "step-back", - "step-forward", - "stethoscope", - "sticker", - "sticky-note", - "stop-circle", - "store", - "stretch-horizontal", - "stretch-vertical", - "strikethrough", - "subscript", - "subtitles", - "sun-dim", - "sun-medium", - "sun-moon", - "sun-snow", - "sun", - "sunrise", - "sunset", - "superscript", - "swiss-franc", - "switch-camera", - "sword", - "swords", - "syringe", - "table-2", - "table", - "tablet", - "tablets", - "tag", - "tags", - "target", - "tent", - "terminal-square", - "terminal", - "test-tube-2", - "test-tube", - "test-tubes", - "text-cursor-input", - "text-cursor", - "text-selection", - "text", - "thermometer-snowflake", - "thermometer-sun", - "thermometer", - "thumbs-down", - "thumbs-up", - "ticket", - "timer-off", - "timer-reset", - "timer", - "toggle-left", - "toggle-right", - "tornado", - "tower-control", - "toy-brick", - "train", - "trash-2", - "trash", - "tree-deciduous", - "tree-pine", - "trees", - "trello", - "trending-down", - "trending-up", - "triangle", - "trophy", - "truck", - "tv-2", - "tv", - "twitch", - "twitter", - "type", - "umbrella", - "underline", - "undo-2", - "undo", - "unlink-2", - "unlink", - "unlock", - "upload-cloud", - "upload", - "usb", - "user-check", - "user-cog", - "user-minus", - "user-plus", - "user-x", - "user", - "users", - "utensils-crossed", - "utensils", - "utility-pole", - "vault", - "vegan", - "venetian-mask", - "verified", - "vibrate-off", - "vibrate", - "video-off", - "video", - "view", - "voicemail", - "volume-1", - "volume-2", - "volume-x", - "volume", - "vote", - "wallet", - "wand-2", - "wand", - "warehouse", - "watch", - "waves", - "webcam", - "webhook", - "wheat-off", - "wheat", - "whole-word", - "wifi-off", - "wifi", - "wind", - "wine-off", - "wine", - "wrap-text", - "wrench", - "x-circle", - "x-octagon", - "x-square", - "x", - "youtube", - "zap-off", - "zap", - "zoom-in", - "zoom-out" -]; - -// src/utils/sticker.ts -var stickerFromString = (sticker, plugin) => { - var _a2; - if (!sticker || typeof sticker != "string") - return ""; - const [type, value] = parseStickerString(sticker); - if (type == "" || type == "emoji") { - return emojiFromString(value); - } else if (type == "ui") { - return uiIconSet[value]; - } else if (type == "lucide") { - return (_a2 = (0, import_obsidian7.getIcon)(value)) == null ? void 0 : _a2.outerHTML; - } else { - return plugin.index.iconsCache.get(value); - } -}; - -// src/components/UI/Sticker.tsx -var Sticker = (props2) => { - return /* @__PURE__ */ Cn.createElement("div", { - className: "mk-sticker", - dangerouslySetInnerHTML: { - __html: stickerFromString(props2.sticker, props2.plugin) - } - }); -}; - -// src/components/UI/menus/selectMenu/concerns/matchers.js -function escapeForRegExp(string) { - return string.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); -} -function matchAny(string) { - return new RegExp(escapeForRegExp(string), "gi"); -} -function matchExact(string) { - return new RegExp(`^${escapeForRegExp(string)}$`, "i"); -} - -// src/components/UI/menus/selectMenu/SelectMenuSuggestions.tsx -function markIt(name, query) { - const regexp = matchAny(query); - return name.replace(regexp, "$&"); -} -var SelectMenuSuggestionsComponent = (props2) => { - const ref2 = _2(null); - p2(() => { - var _a2; - if (props2.active) { - (_a2 = ref2 == null ? void 0 : ref2.current) == null ? void 0 : _a2.scrollIntoViewIfNeeded(); - } - }, [props2.active]); - return /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, props2.item.icon && /* @__PURE__ */ Cn.createElement(Sticker, { - plugin: props2.plugin, - sticker: props2.item.icon - }), /* @__PURE__ */ Cn.createElement("div", { - className: "mk-options-menu-inner" - }, props2.item.onToggle && /* @__PURE__ */ Cn.createElement("div", null, "Toggle"), /* @__PURE__ */ Cn.createElement("span", { - ref: ref2, - dangerouslySetInnerHTML: { - __html: markIt(props2.item.name, props2.query) - } - }), props2.item.description && /* @__PURE__ */ Cn.createElement("span", { - className: "mk-description", - ref: ref2, - dangerouslySetInnerHTML: { - __html: markIt(props2.item.description, props2.query) - } - })), props2.item.removeable && /* @__PURE__ */ Cn.createElement("div", { - onClick: (e4) => { - e4.stopPropagation(); - e4.preventDefault(); - props2.onDeleteOption(props2.item.value); - }, - className: "mk-icon-small", - dangerouslySetInnerHTML: { __html: uiIconSet["mk-ui-close"] } - })); -}; -var SelectMenuSuggestions = (props2) => { - const timer = _2(null); - const mouseOver = (e4, index) => { - if (!props2.hoverSelect) { - return; - } - timer.current && clearTimeout(timer.current); - timer.current = setTimeout(() => props2.setIndex(index), 300); - }; - const options = props2.options.map((item, index) => { - const key2 = `${props2.id}-${index}`; - const classNames9 = []; - if (props2.index === index) { - classNames9.push(props2.classNames.suggestionActive); - } - if (item.disabled) { - classNames9.push(props2.classNames.suggestionDisabled); - } - return /* @__PURE__ */ Cn.createElement("li", { - id: key2, - key: key2, - role: "option", - className: classNames9.join(" "), - "aria-disabled": Boolean(item.disabled), - onMouseDown: (e4) => e4.preventDefault(), - onClick: (e4) => props2.addTag(item, { - ctrlKey: e4.ctrlKey, - metaKey: e4.metaKey, - altKey: e4.altKey, - shiftKey: e4.shiftKey - }), - onMouseOver: (e4) => mouseOver(e4, index), - onMouseOut: (e4) => props2.hoverSelect && clearTimeout(timer.current) - }, /* @__PURE__ */ Cn.createElement(SelectMenuSuggestionsComponent, { - plugin: props2.plugin, - item, - query: props2.query, - active: index == props2.index, - onDeleteOption: props2.deleteOption - })); - }); - return /* @__PURE__ */ Cn.createElement("div", { - className: props2.classNames.suggestions - }, /* @__PURE__ */ Cn.createElement("ul", { - role: "listbox", - id: props2.id - }, options, props2.query && props2.allowNew && /* @__PURE__ */ Cn.createElement("li", { - onMouseDown: (e4) => e4.preventDefault(), - onClick: (e4) => props2.addTag( - { name: props2.query, value: props2.query }, - { - ctrlKey: e4.ctrlKey, - metaKey: e4.metaKey, - altKey: e4.altKey, - shiftKey: e4.shiftKey - } - ) - }, "Add ", props2.query))); -}; -var SelectMenuSuggestions_default = SelectMenuSuggestions; - -// src/components/UI/menus/selectMenu/concerns/focusNextElement.js -function focusNextElement(scope, currentTarget) { - const interactiveEls = scope.querySelectorAll("a,button,input"); - const currentEl = Array.prototype.findIndex.call( - interactiveEls, - (element) => element === currentTarget - ); - const nextEl = interactiveEls[currentEl - 1] || interactiveEls[currentEl + 1]; - if (nextEl) { - nextEl.focus(); - } -} - -// src/components/UI/menus/selectMenu/SelectMenuComponent.tsx -var KEYS = { - ENTER: "Enter", - TAB: "Tab", - BACKSPACE: "Backspace", - UP_ARROW: "ArrowUp", - UP_ARROW_COMPAT: "Up", - DOWN_ARROW: "ArrowDown", - DOWN_ARROW_COMPAT: "Down" -}; -var CLASS_NAMES = { - root: "mk-options-menu", - rootFocused: "is-focused", - selected: "mk-options-menu__selected", - selectedTag: "mk-options-menu__selected-tag", - selectedTagName: "mk-options-menu__selected-tag-name", - search: "mk-options-menu__search", - searchWrapper: "mk-options-menu__search-wrapper", - searchInput: "mk-options-menu__search-input", - suggestions: "mk-options-menu__suggestions", - suggestionActive: "is-active", - suggestionDisabled: "is-disabled" -}; -var defaultProps = { - plugin: null, - id: "SelectMenu", - tags: [], - suggestionsOnly: false, - placeholderText: i18n_default.labels.optionItemSelectPlaceholder, - noSuggestionsText: null, - newTagText: null, - suggestions: [], - suggestionsFilter: defaultSuggestionsFilter, - suggestionsTransform: null, - classNames: CLASS_NAMES, - delimiters: [KEYS.ENTER], - minQueryLength: 2, - maxSuggestionsLength: 8, - inputAttributes: {}, - hoverSelect: false -}; -var findMatchIndex = (options, query) => { - return options.findIndex((option) => matchExact(query).test(option.name)); -}; -var pressDelimiter = (props2, query, index, options, addTag, modifiers) => { - if (query.length >= props2.minQueryLength) { - const match2 = findMatchIndex(options, query); - const _index = index === -1 ? match2 : index; - const tag = _index > -1 ? options[_index] : null; - if (tag) { - addTag(tag, modifiers); - } else { - addTag({ name: query, value: query }, modifiers); - } - } -}; -function defaultSuggestionsFilter(item, query) { - const regexp = matchAny(query); - return regexp.test(item.name); -} -function getOptions2(props2, query, section) { - let options; - let suggestions = props2.suggestions; - if (section.length > 0) { - suggestions = props2.suggestions.filter((f4) => f4.section == section); - } - options = query.length == 0 ? suggestions : import_fuzzysort.default.go(query, suggestions, { - keys: ["name", "value"] - }).map((result) => result.obj); - options = options.slice(0, props2.maxSuggestionsLength); - if (props2.newTagText && findMatchIndex(options, query) === -1) { - options.push({ id: 0, name: query, value: query }); - } else if (props2.noSuggestionsText && options.length === 0) { - options.push({ - id: 0, - name: props2.noSuggestionsText, - value: "", - disabled: true - }); - } - return options; -} -var SelectMenuComponent = Cn.forwardRef( - (_props, ref2) => { - const props2 = { ...defaultProps, ..._props }; - const [options, setOptions] = h2([]); - const sections = F2(() => { - var _a2; - if (!props2.showSections) - return []; - return [ - "", - ...(_a2 = props2.sections) != null ? _a2 : uniq(props2.suggestions.map((f4) => f4.section)).filter((f4) => f4) - ]; - }, [props2.showSections, props2.sections, props2.suggestions]); - const inputRef = _2(null); - const [section, setSection] = h2(""); - const [query, setQuery] = h2(""); - const [focused, setFocused] = h2(false); - const [index, setIndex] = h2(0); - const onComposition = _2(false); - p2(() => { - if (ref2) { - ref2.current = () => { - var _a2; - if (!focused) { - (_a2 = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a2.focus(); - setFocused(true); - return false; - } - return true; - }; - } - }, [focused]); - p2(() => { - var _a2; - if (index != -1 && props2.onHover && props2.hoverSelect) { - debounceFn((_a2 = options[index]) == null ? void 0 : _a2.value); - } - }, [index, options]); - const debounceFn = T2( - (0, import_lodash.debounce)(handleDebounceFn, 300, { - leading: false - }), - [] - ); - function handleDebounceFn(inputValue) { - props2.onHover(inputValue); - } - p2(() => { - if (query.length == 0 && props2.defaultSuggestions) { - setOptions(props2.defaultSuggestions); - return; - } - setOptions(getOptions2(props2, query, section)); - }, [query, props2.suggestions, section, props2]); - const container = _2(null); - const onInput = (e4) => { - if (e4.type === "compositionstart") { - onComposition.current = true; - return; - } - if (e4.type === "compositionend") { - onComposition.current = false; - } - if (onComposition.current) { - return; - } - const _query = e4.target.value; - if (props2.onInput) { - props2.onInput(_query); - } - if (_query.length === query.length + 1 && props2.delimiters.indexOf(query.slice(-1)) > -1) { - pressDelimiter(props2, query, index, options, addTag, {}); - } else if (_query !== query) { - setQuery(_query); - } - }; - const onKeyDown = (e4) => { - if (props2.delimiters.indexOf(e4.key) > -1) { - if (query || index > -1) { - e4.preventDefault(); - } - pressDelimiter(props2, query, index, options, addTag, { - ctrlKey: e4.ctrlKey, - metaKey: e4.metaKey, - altKey: e4.altKey, - shiftKey: e4.shiftKey - }); - } - if (e4.key === KEYS.TAB) { - pressTabKey(e4); - } - if (e4.key === KEYS.BACKSPACE) { - pressBackspaceKey(); - } - if (e4.key === KEYS.UP_ARROW || e4.key === KEYS.UP_ARROW_COMPAT) { - pressUpKey(e4); - } - if (e4.key === KEYS.DOWN_ARROW || e4.key === KEYS.DOWN_ARROW_COMPAT) { - pressDownKey(e4); - } - }; - const onBlur = () => { - setFocused(false); - if (props2.onBlur) { - props2.onBlur(); - } - }; - const onFocus = () => { - setFocused(true); - if (props2.onFocus) { - props2.onFocus(); - } - }; - const onDeleteTag = (index2, event) => { - if (container.current) { - focusNextElement(container.current, event.currentTarget); - } - deleteTag(index2); - }; - const addTag = (tag, modifiers) => { - if (tag.disabled) { - return; - } - if (props2.onValidate && !props2.onValidate(tag)) { - return; - } - props2.onAddition(tag, modifiers); - clearInput(); - }; - const deleteTag = (i4) => { - props2.onDelete(i4); - }; - const clearInput = () => { - setQuery(""); - setIndex(-1); - }; - const clearSelectedIndex = () => { - setIndex(-1); - }; - const pressUpKey = (e4) => { - e4.preventDefault(); - const size = options.length - 1; - setIndex(index <= 0 ? size : index - 1); - }; - const pressDownKey = (e4) => { - e4.preventDefault(); - const size = options.length - 1; - setIndex((i4) => i4 >= size ? 0 : i4 + 1); - }; - function pressBackspaceKey() { - if (!query.length) { - deleteTag(props2.tags.length - 1); - } - } - function pressTabKey(e4) { - if (props2.showSections) { - e4.preventDefault(); - e4.stopPropagation(); - setSection((p3) => { - const sectionIndex = sections.findIndex((g4) => g4 == p3); - if (e4.shiftKey) { - if (sectionIndex == 0) { - return p3; - } - return sections[sectionIndex - 1]; - } - if (sectionIndex == sections.length - 1) { - return p3; - } - return sections[sectionIndex + 1]; - }); - } - } - const focusInput = () => { - inputRef.current.focus(); - }; - const inputEventHandlers = { - onChange: onInput, - onBlur, - onFocus, - onInput: () => { - }, - onKeyDown, - onCompositionEnd: onInput, - onCompositionStart: onInput - }; - const expanded = focused && query.length >= props2.minQueryLength; - const classNames9 = Object.assign({}, CLASS_NAMES, props2.classNames); - const rootClassNames = [classNames9.root]; - focused && rootClassNames.push(classNames9.rootFocused); - return /* @__PURE__ */ Cn.createElement("div", { - ref: container, - className: rootClassNames.join(" ") - }, !props2.suggestionsOnly ? /* @__PURE__ */ Cn.createElement("div", { - className: classNames9.selected, - "aria-relevant": "additions removals", - "aria-live": "polite" - }, /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, props2.tags.map((tag, i4) => /* @__PURE__ */ Cn.createElement(SelectMenuPill_default, { - key: i4, - tag, - classNames: classNames9, - onDelete: (e4) => onDeleteTag(i4, e4) - }))), /* @__PURE__ */ Cn.createElement("div", { - className: classNames9.search - }, /* @__PURE__ */ Cn.createElement(SelectMenuInput_default, { - ref: inputRef, - query, - index, - id: props2.id, - classNames: classNames9, - inputAttributes: props2.inputAttributes, - inputEventHandlers, - expanded, - placeholderText: props2.placeholderText - }))) : null, props2.showSections ? /* @__PURE__ */ Cn.createElement("div", { - className: "mk-options-menu-sections" - }, sections.map((f4, i4) => /* @__PURE__ */ Cn.createElement("div", { - key: i4, - onClick: () => setSection(f4), - className: `${section == f4 ? "is-active" : ""} mk-options-menu-section` - }, f4 == "" ? "All" : f4))) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), options.length || props2.allowNew ? /* @__PURE__ */ Cn.createElement(SelectMenuSuggestions_default, { - plugin: props2.plugin, - options, - hoverSelect: props2.hoverSelect, - query, - setIndex, - index, - id: props2.id, - classNames: classNames9, - expanded, - addTag, - allowNew: props2.allowNew, - deleteOption: props2.onDeleteOption - }) : null, props2.previewComponent); - } -); -SelectMenuComponent.displayName = "SelectMenuComponent"; -var SelectMenuComponent_default = SelectMenuComponent; - -// src/components/UI/menus/selectMenu.tsx -var SelectMenu = Cn.forwardRef( - (props2, ref2) => { - var _a2; - const initialOptions = props2.options.map((o3, i4) => { - return { - ...o3, - id: i4 + 1 - }; - }); - p2(() => { - setSuggestions( - props2.options.map((o3, i4) => { - return { - ...o3, - id: i4 + 1 - }; - }) - ); - }, [props2.options]); - const [suggestions, setSuggestions] = h2(initialOptions); - const [tags, setTags] = h2( - props2.value.map( - (v3) => { - var _a3; - return (_a3 = initialOptions.find((f4) => f4.value == v3)) != null ? _a3 : { - id: 0, - name: v3, - value: v3 - }; - } - ) - ); - const onDelete = T2( - (tagIndex) => { - const newTags = tags.filter((_12, i4) => i4 !== tagIndex); - setTags(newTags); - props2.saveOptions( - suggestions.map((f4) => f4.value), - newTags.map((f4) => f4.value), - false - ); - }, - [suggestions, tags, props2] - ); - const onDeleteOption = T2( - (removeTag) => { - const newSuggestions = suggestions.filter((f4) => f4.value != removeTag); - const newTags = tags.filter((f4) => f4.value != removeTag); - setSuggestions(newSuggestions); - setTags(newTags); - if (props2.removeOption) - props2.removeOption(removeTag); - props2.hide(); - }, - [tags, suggestions, props2] - ); - const onAddition = T2( - (newTag, modifiers) => { - var _a3; - let tag = newTag; - let newSuggestions = suggestions; - let newTags = tags; - if (!suggestions.find((s5) => s5.value == newTag.value)) { - tag = { - id: suggestions.length + 1, - name: newTag.name, - value: (_a3 = newTag.value) != null ? _a3 : newTag.name - }; - newSuggestions = [...suggestions, tag]; - setSuggestions(newSuggestions); - } - if (props2.multi) { - if (!tags.find((t4) => t4.value == tag.value)) { - newTags = [...tags, tag]; - setTags(newTags); - } - } else { - newTags = [tag]; - setTags(newTags); - } - props2.saveOptions( - newSuggestions.map((f4) => f4.value), - newTags.map((f4) => f4.value), - true - ); - if (!props2.multi) { - props2.hide(); - } - }, - [tags, suggestions] - ); - const onValidation = T2( - (newTag) => { - if (!props2.editable && !suggestions.find((s5) => s5.value == newTag.value)) { - return false; - } - if (newTag.name.length == 0) { - return false; - } - return true; - }, - [suggestions] - ); - return /* @__PURE__ */ Cn.createElement(SelectMenuComponent_default, { - tags: props2.multi ? tags : [], - suggestions, - plugin: props2.plugin, - ref: ref2, - onDelete, - onDeleteOption, - onAddition, - onValidate: onValidation, - defaultSuggestions: props2.defaultOptions, - placeholderText: (_a2 = props2.placeholder) != null ? _a2 : "", - minQueryLength: 0, - onHover: props2.onHover, - hoverSelect: props2.onHover ? true : false, - showSections: props2.showSections, - sections: props2.sections, - maxSuggestionsLength: props2.showAll ? Math.min(50, props2.options.length) : 25, - suggestionsOnly: !props2.searchable && !props2.editable, - allowNew: props2.editable, - previewComponent: props2.previewComponent - }); - } -); -SelectMenu.displayName = "SelectMenu"; -var selectMenu_default = SelectMenu; - -// src/components/UI/menus/menuItems.tsx -var inputMenuItem = (menuItem, value, setValue) => { - const frag = document.createDocumentFragment(); - const spanEl = frag.createEl("span"); - const inputEl = frag.createEl("input"); - inputEl.type = "text"; - inputEl.value = value; - inputEl.addEventListener("click", (e4) => { - e4.stopImmediatePropagation(); - }); - inputEl.addEventListener("mousedown", (e4) => { - e4.stopImmediatePropagation(); - }); - inputEl.addEventListener("mouseup", (e4) => { - e4.stopImmediatePropagation(); - }); - inputEl.addEventListener("blur", (e4) => { - setValue(inputEl.value); - }); - menuItem.dom.toggleClass("mk-menu-input", true); - menuItem.setTitle(frag); - return menuItem; -}; -var showSelectMenu = (point, optionProps) => { - const menu = new import_obsidian8.Menu(); - menu.dom.toggleClass("mk-menu", true); - menu.setUseNativeMenu(false); - const frag = document.createDocumentFragment(); - const div = frag.createDiv("mk-options-container"); - div.style.minHeight = Math.min( - 200, - (optionProps.options.length + (optionProps.searchable ? 1 : 0)) * 28 - ).toString() + "px"; - div.addEventListener("click", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("mousedown", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("mouseup", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("keydown", (e4) => { - }); - menu.onHide(() => optionProps.onHide && optionProps.onHide()); - const root = createRoot(div); - root.render( - /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(selectMenu_default, { - hide: () => { - menu.hide(); - optionProps.onHide && optionProps.onHide(); - }, - ...optionProps - })) - ); - menu.addItem((item) => { - item.setTitle(frag); - }); - const keys = [...menu.scope.keys]; - for (let i4 = 0; i4 < keys.length; i4++) { - if (keys[i4].key != "Escape") { - menu.scope.unregister(keys[i4]); - } - } - menu.showAtPosition(point); - return menu; -}; -var disclosureMenuItem = (plugin, menuItem, multi, editable, title, value, options, saveOptions) => { - const frag = document.createDocumentFragment(); - const div = frag.createDiv("title"); - div.textContent = title; - const div2 = frag.createDiv("disclosure"); - div2.textContent = value; - menuItem.setTitle(frag); - menuItem.onClick((ev) => { - var _a2; - ev.stopPropagation(); - const offset2 = menuItem.dom.getBoundingClientRect(); - showSelectMenu( - { x: offset2.right + 10, y: offset2.top }, - { - plugin, - multi, - editable, - value: (_a2 = parseMultiString(value)) != null ? _a2 : [], - options, - saveOptions, - searchable: true, - showAll: true - } - ); - }); - return menuItem; -}; - -// src/components/UI/menus/propertyMenu/propertyMenu.tsx -var import_obsidian10 = require("obsidian"); - -// src/utils/contexts/predicate/sort.ts -var simpleSort = (a5, b4) => { - if (a5 < b4) - return -1; - if (a5 > b4) - return 1; - return 0; -}; -var stringSort = (value, filterValue) => simpleSort(value, filterValue); -var numSort = (value, filterValue) => simpleSort(parseFloat(value), parseFloat(filterValue)); -var boolSort = (value, filterValue) => simpleSort(value == "true" ? 1 : 0, filterValue == "true" ? 1 : 0); -var countSort = (value, filterValue) => simpleSort(parseMultiString(value).length, parseMultiString(filterValue).length); -var normalizedSortForType = (type, desc) => { - return Object.keys(sortFnTypes).find( - (f4) => sortFnTypes[f4].type.some((g4) => g4 == type) && sortFnTypes[f4].desc == desc - ); -}; -var sortFnTypes = { - alphabetical: { - type: ["text", "file", "link", "context", "fileprop"], - fn: stringSort, - label: i18n_default.sortTypes.alphaAsc, - desc: false - }, - reverseAlphabetical: { - type: ["text", "file", "link", "context", "fileprop"], - fn: (v3, f4) => stringSort(v3, f4) * -1, - label: i18n_default.sortTypes.alphaDesc, - desc: true - }, - earliest: { - type: ["date", "fileprop"], - fn: stringSort, - label: i18n_default.sortTypes.earliest, - desc: false - }, - latest: { - type: ["date", "fileprop"], - fn: (v3, f4) => stringSort(v3, f4) * -1, - label: i18n_default.sortTypes.latest, - desc: true - }, - boolean: { - type: ["boolean"], - fn: boolSort, - label: i18n_default.sortTypes.checkAsc, - desc: false - }, - booleanReverse: { - type: ["boolean"], - fn: (v3, f4) => boolSort(v3, f4) * -1, - label: i18n_default.sortTypes.checkDesc, - desc: true - }, - number: { - type: ["number", "fileprop"], - fn: numSort, - label: "1 \u2192 9", - desc: false - }, - reverseNumber: { - type: ["number", "fileprop"], - fn: (v3, f4) => numSort(v3, f4) * -1, - label: "9 \u2192 1", - desc: true - }, - count: { - type: ["option-multi", "context-multi", "link-multi"], - fn: countSort, - label: i18n_default.sortTypes.itemsDesc, - desc: true - }, - reverseCount: { - type: ["option-multi", "context-multi", "link-multi"], - fn: (v3, f4) => countSort(v3, f4) * -1, - label: i18n_default.sortTypes.itemsAsc, - desc: false - } -}; -var sortReturnForCol = (col, sort, row, row2) => { - if (!col) - return 0; - const sortType = sortFnTypes[sort.fn]; - if (sortType) { - return sortType.fn(row[sort.field], row2[sort.field]); - } - return 0; -}; - -// src/components/SpaceView/Editor/StickerMenu/emojis/default.ts -var emojis = { - smileys_people: [ - { n: ["grinning", "grinning face"], u: "1f600" }, - { n: ["smiley", "smiling face with open mouth"], u: "1f603" }, - { - n: ["smile", "smiling face with open mouth and smiling eyes"], - u: "1f604" - }, - { n: ["grin", "grinning face with smiling eyes"], u: "1f601" }, - { - n: [ - "laughing", - "satisfied", - "smiling face with open mouth and tightly-closed eyes" - ], - u: "1f606" - }, - { - n: ["sweat smile", "smiling face with open mouth and cold sweat"], - u: "1f605" - }, - { n: ["rolling on the floor laughing"], u: "1f923" }, - { n: ["joy", "face with tears of joy"], u: "1f602" }, - { n: ["slightly smiling face"], u: "1f642" }, - { n: ["upside-down face", "upside down face"], u: "1f643" }, - { n: ["melting face"], u: "1fae0" }, - { n: ["wink", "winking face"], u: "1f609" }, - { n: ["blush", "smiling face with smiling eyes"], u: "1f60a" }, - { n: ["innocent", "smiling face with halo"], u: "1f607" }, - { - n: [ - "smiling face with 3 hearts", - "smiling face with smiling eyes and three hearts" - ], - u: "1f970" - }, - { n: ["heart eyes", "smiling face with heart-shaped eyes"], u: "1f60d" }, - { n: ["star-struck", "grinning face with star eyes"], u: "1f929" }, - { n: ["kissing heart", "face throwing a kiss"], u: "1f618" }, - { n: ["kissing", "kissing face"], u: "1f617" }, - { n: ["relaxed", "white smiling face"], u: "263a-fe0f" }, - { n: ["kissing closed eyes", "kissing face with closed eyes"], u: "1f61a" }, - { - n: ["kissing smiling eyes", "kissing face with smiling eyes"], - u: "1f619" - }, - { n: ["smiling face with tear"], u: "1f972" }, - { n: ["yum", "face savouring delicious food"], u: "1f60b" }, - { n: ["stuck out tongue", "face with stuck-out tongue"], u: "1f61b" }, - { - n: [ - "stuck out tongue winking eye", - "face with stuck-out tongue and winking eye" - ], - u: "1f61c" - }, - { - n: ["zany face", "grinning face with one large and one small eye"], - u: "1f92a" - }, - { - n: [ - "stuck out tongue closed eyes", - "face with stuck-out tongue and tightly-closed eyes" - ], - u: "1f61d" - }, - { n: ["money-mouth face", "money mouth face"], u: "1f911" }, - { n: ["hugging face"], u: "1f917" }, - { - n: [ - "face with hand over mouth", - "smiling face with smiling eyes and hand covering mouth" - ], - u: "1f92d" - }, - { n: ["face with open eyes and hand over mouth"], u: "1fae2" }, - { n: ["face with peeking eye"], u: "1fae3" }, - { - n: ["shushing face", "face with finger covering closed lips"], - u: "1f92b" - }, - { n: ["thinking face"], u: "1f914" }, - { n: ["saluting face"], u: "1fae1" }, - { n: ["zipper-mouth face", "zipper mouth face"], u: "1f910" }, - { - n: ["face with raised eyebrow", "face with one eyebrow raised"], - u: "1f928" - }, - { n: ["neutral face"], u: "1f610" }, - { n: ["expressionless", "expressionless face"], u: "1f611" }, - { n: ["no mouth", "face without mouth"], u: "1f636" }, - { n: ["dotted line face"], u: "1fae5" }, - { n: ["face in clouds"], u: "1f636-200d-1f32b-fe0f" }, - { n: ["smirk", "smirking face"], u: "1f60f" }, - { n: ["unamused", "unamused face"], u: "1f612" }, - { n: ["face with rolling eyes"], u: "1f644" }, - { n: ["grimacing", "grimacing face"], u: "1f62c" }, - { n: ["face exhaling"], u: "1f62e-200d-1f4a8" }, - { n: ["lying face"], u: "1f925" }, - { n: ["relieved", "relieved face"], u: "1f60c" }, - { n: ["pensive", "pensive face"], u: "1f614" }, - { n: ["sleepy", "sleepy face"], u: "1f62a" }, - { n: ["drooling face"], u: "1f924" }, - { n: ["sleeping", "sleeping face"], u: "1f634" }, - { n: ["mask", "face with medical mask"], u: "1f637" }, - { n: ["face with thermometer"], u: "1f912" }, - { n: ["face with head-bandage", "face with head bandage"], u: "1f915" }, - { n: ["nauseated face"], u: "1f922" }, - { n: ["face vomiting", "face with open mouth vomiting"], u: "1f92e" }, - { n: ["sneezing face"], u: "1f927" }, - { n: ["hot face", "overheated face"], u: "1f975" }, - { n: ["cold face", "freezing face"], u: "1f976" }, - { n: ["woozy face", "face with uneven eyes and wavy mouth"], u: "1f974" }, - { n: ["dizzy face"], u: "1f635" }, - { n: ["face with spiral eyes"], u: "1f635-200d-1f4ab" }, - { n: ["exploding head", "shocked face with exploding head"], u: "1f92f" }, - { n: ["face with cowboy hat"], u: "1f920" }, - { n: ["partying face", "face with party horn and party hat"], u: "1f973" }, - { n: ["disguised face"], u: "1f978" }, - { n: ["sunglasses", "smiling face with sunglasses"], u: "1f60e" }, - { n: ["nerd face"], u: "1f913" }, - { n: ["face with monocle"], u: "1f9d0" }, - { n: ["confused", "confused face"], u: "1f615" }, - { n: ["face with diagonal mouth"], u: "1fae4" }, - { n: ["worried", "worried face"], u: "1f61f" }, - { n: ["slightly frowning face"], u: "1f641" }, - { n: ["frowning face", "white frowning face"], u: "2639-fe0f" }, - { n: ["open mouth", "face with open mouth"], u: "1f62e" }, - { n: ["hushed", "hushed face"], u: "1f62f" }, - { n: ["astonished", "astonished face"], u: "1f632" }, - { n: ["flushed", "flushed face"], u: "1f633" }, - { n: ["pleading face", "face with pleading eyes"], u: "1f97a" }, - { n: ["face holding back tears"], u: "1f979" }, - { n: ["frowning", "frowning face with open mouth"], u: "1f626" }, - { n: ["anguished", "anguished face"], u: "1f627" }, - { n: ["fearful", "fearful face"], u: "1f628" }, - { n: ["cold sweat", "face with open mouth and cold sweat"], u: "1f630" }, - { - n: ["disappointed relieved", "disappointed but relieved face"], - u: "1f625" - }, - { n: ["cry", "crying face"], u: "1f622" }, - { n: ["sob", "loudly crying face"], u: "1f62d" }, - { n: ["scream", "face screaming in fear"], u: "1f631" }, - { n: ["confounded", "confounded face"], u: "1f616" }, - { n: ["persevere", "persevering face"], u: "1f623" }, - { n: ["disappointed", "disappointed face"], u: "1f61e" }, - { n: ["sweat", "face with cold sweat"], u: "1f613" }, - { n: ["weary", "weary face"], u: "1f629" }, - { n: ["tired face"], u: "1f62b" }, - { n: ["yawning face"], u: "1f971" }, - { n: ["triumph", "face with look of triumph"], u: "1f624" }, - { n: ["rage", "pouting face"], u: "1f621" }, - { n: ["angry", "angry face"], u: "1f620" }, - { - n: [ - "face with symbols on mouth", - "serious face with symbols covering mouth" - ], - u: "1f92c" - }, - { n: ["smiling imp", "smiling face with horns"], u: "1f608" }, - { n: ["imp"], u: "1f47f" }, - { n: ["skull"], u: "1f480" }, - { n: ["skull and crossbones"], u: "2620-fe0f" }, - { n: ["poop", "shit", "hankey", "pile of poo"], u: "1f4a9" }, - { n: ["clown face"], u: "1f921" }, - { n: ["japanese ogre"], u: "1f479" }, - { n: ["japanese goblin"], u: "1f47a" }, - { n: ["ghost"], u: "1f47b" }, - { n: ["alien", "extraterrestrial alien"], u: "1f47d" }, - { n: ["alien monster", "space invader"], u: "1f47e" }, - { n: ["robot face"], u: "1f916" }, - { n: ["smiley cat", "smiling cat face with open mouth"], u: "1f63a" }, - { n: ["smile cat", "grinning cat face with smiling eyes"], u: "1f638" }, - { n: ["joy cat", "cat face with tears of joy"], u: "1f639" }, - { - n: ["heart eyes cat", "smiling cat face with heart-shaped eyes"], - u: "1f63b" - }, - { n: ["smirk cat", "cat face with wry smile"], u: "1f63c" }, - { n: ["kissing cat", "kissing cat face with closed eyes"], u: "1f63d" }, - { n: ["scream cat", "weary cat face"], u: "1f640" }, - { n: ["crying cat face"], u: "1f63f" }, - { n: ["pouting cat", "pouting cat face"], u: "1f63e" }, - { n: ["see no evil", "see-no-evil monkey"], u: "1f648" }, - { n: ["hear no evil", "hear-no-evil monkey"], u: "1f649" }, - { n: ["speak no evil", "speak-no-evil monkey"], u: "1f64a" }, - { n: ["kiss", "kiss mark"], u: "1f48b" }, - { n: ["love letter"], u: "1f48c" }, - { n: ["cupid", "heart with arrow"], u: "1f498" }, - { n: ["gift heart", "heart with ribbon"], u: "1f49d" }, - { n: ["sparkling heart"], u: "1f496" }, - { n: ["heartpulse", "growing heart"], u: "1f497" }, - { n: ["heartbeat", "beating heart"], u: "1f493" }, - { n: ["revolving hearts"], u: "1f49e" }, - { n: ["two hearts"], u: "1f495" }, - { n: ["heart decoration"], u: "1f49f" }, - { - n: ["heart exclamation", "heavy heart exclamation mark ornament"], - u: "2763-fe0f" - }, - { n: ["broken heart"], u: "1f494" }, - { n: ["heart on fire"], u: "2764-fe0f-200d-1f525" }, - { n: ["mending heart"], u: "2764-fe0f-200d-1fa79" }, - { n: ["heart", "heavy black heart"], u: "2764-fe0f" }, - { n: ["orange heart"], u: "1f9e1" }, - { n: ["yellow heart"], u: "1f49b" }, - { n: ["green heart"], u: "1f49a" }, - { n: ["blue heart"], u: "1f499" }, - { n: ["purple heart"], u: "1f49c" }, - { n: ["brown heart"], u: "1f90e" }, - { n: ["black heart"], u: "1f5a4" }, - { n: ["white heart"], u: "1f90d" }, - { n: ["100", "hundred points symbol"], u: "1f4af" }, - { n: ["anger", "anger symbol"], u: "1f4a2" }, - { n: ["boom", "collision", "collision symbol"], u: "1f4a5" }, - { n: ["dizzy", "dizzy symbol"], u: "1f4ab" }, - { n: ["sweat drops", "splashing sweat symbol"], u: "1f4a6" }, - { n: ["dash", "dash symbol"], u: "1f4a8" }, - { n: ["hole"], u: "1f573-fe0f" }, - { n: ["bomb"], u: "1f4a3" }, - { n: ["speech balloon"], u: "1f4ac" }, - { - n: ["eye in speech bubble", "eye-in-speech-bubble"], - u: "1f441-fe0f-200d-1f5e8-fe0f" - }, - { n: ["left speech bubble"], u: "1f5e8-fe0f" }, - { n: ["right anger bubble"], u: "1f5ef-fe0f" }, - { n: ["thought balloon"], u: "1f4ad" }, - { n: ["zzz", "sleeping symbol"], u: "1f4a4" }, - { - n: ["wave", "waving hand sign"], - u: "1f44b", - v: [ - "1f44b-1f3fb", - "1f44b-1f3fc", - "1f44b-1f3fd", - "1f44b-1f3fe", - "1f44b-1f3ff" - ] - }, - { - n: ["raised back of hand"], - u: "1f91a", - v: [ - "1f91a-1f3fb", - "1f91a-1f3fc", - "1f91a-1f3fd", - "1f91a-1f3fe", - "1f91a-1f3ff" - ] - }, - { - n: ["hand with fingers splayed", "raised hand with fingers splayed"], - u: "1f590-fe0f", - v: [ - "1f590-1f3fb", - "1f590-1f3fc", - "1f590-1f3fd", - "1f590-1f3fe", - "1f590-1f3ff" - ] - }, - { - n: ["hand", "raised hand"], - u: "270b", - v: ["270b-1f3fb", "270b-1f3fc", "270b-1f3fd", "270b-1f3fe", "270b-1f3ff"] - }, - { - n: [ - "spock-hand", - "raised hand with part between middle and ring fingers" - ], - u: "1f596", - v: [ - "1f596-1f3fb", - "1f596-1f3fc", - "1f596-1f3fd", - "1f596-1f3fe", - "1f596-1f3ff" - ] - }, - { - n: ["rightwards hand"], - u: "1faf1", - v: [ - "1faf1-1f3fb", - "1faf1-1f3fc", - "1faf1-1f3fd", - "1faf1-1f3fe", - "1faf1-1f3ff" - ] - }, - { - n: ["leftwards hand"], - u: "1faf2", - v: [ - "1faf2-1f3fb", - "1faf2-1f3fc", - "1faf2-1f3fd", - "1faf2-1f3fe", - "1faf2-1f3ff" - ] - }, - { - n: ["palm down hand"], - u: "1faf3", - v: [ - "1faf3-1f3fb", - "1faf3-1f3fc", - "1faf3-1f3fd", - "1faf3-1f3fe", - "1faf3-1f3ff" - ] - }, - { - n: ["palm up hand"], - u: "1faf4", - v: [ - "1faf4-1f3fb", - "1faf4-1f3fc", - "1faf4-1f3fd", - "1faf4-1f3fe", - "1faf4-1f3ff" - ] - }, - { - n: ["ok hand", "ok hand sign"], - u: "1f44c", - v: [ - "1f44c-1f3fb", - "1f44c-1f3fc", - "1f44c-1f3fd", - "1f44c-1f3fe", - "1f44c-1f3ff" - ] - }, - { - n: ["pinched fingers"], - u: "1f90c", - v: [ - "1f90c-1f3fb", - "1f90c-1f3fc", - "1f90c-1f3fd", - "1f90c-1f3fe", - "1f90c-1f3ff" - ] - }, - { - n: ["pinching hand"], - u: "1f90f", - v: [ - "1f90f-1f3fb", - "1f90f-1f3fc", - "1f90f-1f3fd", - "1f90f-1f3fe", - "1f90f-1f3ff" - ] - }, - { - n: ["v", "victory hand"], - u: "270c-fe0f", - v: ["270c-1f3fb", "270c-1f3fc", "270c-1f3fd", "270c-1f3fe", "270c-1f3ff"] - }, - { - n: ["crossed fingers", "hand with index and middle fingers crossed"], - u: "1f91e", - v: [ - "1f91e-1f3fb", - "1f91e-1f3fc", - "1f91e-1f3fd", - "1f91e-1f3fe", - "1f91e-1f3ff" - ] - }, - { - n: ["hand with index finger and thumb crossed"], - u: "1faf0", - v: [ - "1faf0-1f3fb", - "1faf0-1f3fc", - "1faf0-1f3fd", - "1faf0-1f3fe", - "1faf0-1f3ff" - ] - }, - { - n: ["i love you hand sign"], - u: "1f91f", - v: [ - "1f91f-1f3fb", - "1f91f-1f3fc", - "1f91f-1f3fd", - "1f91f-1f3fe", - "1f91f-1f3ff" - ] - }, - { - n: ["the horns", "sign of the horns"], - u: "1f918", - v: [ - "1f918-1f3fb", - "1f918-1f3fc", - "1f918-1f3fd", - "1f918-1f3fe", - "1f918-1f3ff" - ] - }, - { - n: ["call me hand"], - u: "1f919", - v: [ - "1f919-1f3fb", - "1f919-1f3fc", - "1f919-1f3fd", - "1f919-1f3fe", - "1f919-1f3ff" - ] - }, - { - n: ["point left", "white left pointing backhand index"], - u: "1f448", - v: [ - "1f448-1f3fb", - "1f448-1f3fc", - "1f448-1f3fd", - "1f448-1f3fe", - "1f448-1f3ff" - ] - }, - { - n: ["point right", "white right pointing backhand index"], - u: "1f449", - v: [ - "1f449-1f3fb", - "1f449-1f3fc", - "1f449-1f3fd", - "1f449-1f3fe", - "1f449-1f3ff" - ] - }, - { - n: ["point up 2", "white up pointing backhand index"], - u: "1f446", - v: [ - "1f446-1f3fb", - "1f446-1f3fc", - "1f446-1f3fd", - "1f446-1f3fe", - "1f446-1f3ff" - ] - }, - { - n: ["middle finger", "reversed hand with middle finger extended"], - u: "1f595", - v: [ - "1f595-1f3fb", - "1f595-1f3fc", - "1f595-1f3fd", - "1f595-1f3fe", - "1f595-1f3ff" - ] - }, - { - n: ["point down", "white down pointing backhand index"], - u: "1f447", - v: [ - "1f447-1f3fb", - "1f447-1f3fc", - "1f447-1f3fd", - "1f447-1f3fe", - "1f447-1f3ff" - ] - }, - { - n: ["point up", "white up pointing index"], - u: "261d-fe0f", - v: ["261d-1f3fb", "261d-1f3fc", "261d-1f3fd", "261d-1f3fe", "261d-1f3ff"] - }, - { - n: ["index pointing at the viewer"], - u: "1faf5", - v: [ - "1faf5-1f3fb", - "1faf5-1f3fc", - "1faf5-1f3fd", - "1faf5-1f3fe", - "1faf5-1f3ff" - ] - }, - { - n: ["+1", "thumbsup", "thumbs up sign"], - u: "1f44d", - v: [ - "1f44d-1f3fb", - "1f44d-1f3fc", - "1f44d-1f3fd", - "1f44d-1f3fe", - "1f44d-1f3ff" - ] - }, - { - n: ["-1", "thumbsdown", "thumbs down sign"], - u: "1f44e", - v: [ - "1f44e-1f3fb", - "1f44e-1f3fc", - "1f44e-1f3fd", - "1f44e-1f3fe", - "1f44e-1f3ff" - ] - }, - { - n: ["fist", "raised fist"], - u: "270a", - v: ["270a-1f3fb", "270a-1f3fc", "270a-1f3fd", "270a-1f3fe", "270a-1f3ff"] - }, - { - n: ["punch", "facepunch", "fisted hand sign"], - u: "1f44a", - v: [ - "1f44a-1f3fb", - "1f44a-1f3fc", - "1f44a-1f3fd", - "1f44a-1f3fe", - "1f44a-1f3ff" - ] - }, - { - n: ["left-facing fist"], - u: "1f91b", - v: [ - "1f91b-1f3fb", - "1f91b-1f3fc", - "1f91b-1f3fd", - "1f91b-1f3fe", - "1f91b-1f3ff" - ] - }, - { - n: ["right-facing fist"], - u: "1f91c", - v: [ - "1f91c-1f3fb", - "1f91c-1f3fc", - "1f91c-1f3fd", - "1f91c-1f3fe", - "1f91c-1f3ff" - ] - }, - { - n: ["clap", "clapping hands sign"], - u: "1f44f", - v: [ - "1f44f-1f3fb", - "1f44f-1f3fc", - "1f44f-1f3fd", - "1f44f-1f3fe", - "1f44f-1f3ff" - ] - }, - { - n: ["raised hands", "person raising both hands in celebration"], - u: "1f64c", - v: [ - "1f64c-1f3fb", - "1f64c-1f3fc", - "1f64c-1f3fd", - "1f64c-1f3fe", - "1f64c-1f3ff" - ] - }, - { - n: ["heart hands"], - u: "1faf6", - v: [ - "1faf6-1f3fb", - "1faf6-1f3fc", - "1faf6-1f3fd", - "1faf6-1f3fe", - "1faf6-1f3ff" - ] - }, - { - n: ["open hands", "open hands sign"], - u: "1f450", - v: [ - "1f450-1f3fb", - "1f450-1f3fc", - "1f450-1f3fd", - "1f450-1f3fe", - "1f450-1f3ff" - ] - }, - { - n: ["palms up together"], - u: "1f932", - v: [ - "1f932-1f3fb", - "1f932-1f3fc", - "1f932-1f3fd", - "1f932-1f3fe", - "1f932-1f3ff" - ] - }, - { - n: ["handshake"], - u: "1f91d", - v: [ - "1f91d-1f3fb", - "1f91d-1f3fc", - "1f91d-1f3fd", - "1f91d-1f3fe", - "1f91d-1f3ff", - "1faf1-1f3fb-200d-1faf2-1f3fc", - "1faf1-1f3fb-200d-1faf2-1f3fd", - "1faf1-1f3fb-200d-1faf2-1f3fe", - "1faf1-1f3fb-200d-1faf2-1f3ff", - "1faf1-1f3fc-200d-1faf2-1f3fb", - "1faf1-1f3fc-200d-1faf2-1f3fd", - "1faf1-1f3fc-200d-1faf2-1f3fe", - "1faf1-1f3fc-200d-1faf2-1f3ff", - "1faf1-1f3fd-200d-1faf2-1f3fb", - "1faf1-1f3fd-200d-1faf2-1f3fc", - "1faf1-1f3fd-200d-1faf2-1f3fe", - "1faf1-1f3fd-200d-1faf2-1f3ff", - "1faf1-1f3fe-200d-1faf2-1f3fb", - "1faf1-1f3fe-200d-1faf2-1f3fc", - "1faf1-1f3fe-200d-1faf2-1f3fd", - "1faf1-1f3fe-200d-1faf2-1f3ff", - "1faf1-1f3ff-200d-1faf2-1f3fb", - "1faf1-1f3ff-200d-1faf2-1f3fc", - "1faf1-1f3ff-200d-1faf2-1f3fd", - "1faf1-1f3ff-200d-1faf2-1f3fe" - ] - }, - { - n: ["pray", "person with folded hands"], - u: "1f64f", - v: [ - "1f64f-1f3fb", - "1f64f-1f3fc", - "1f64f-1f3fd", - "1f64f-1f3fe", - "1f64f-1f3ff" - ] - }, - { - n: ["writing hand"], - u: "270d-fe0f", - v: ["270d-1f3fb", "270d-1f3fc", "270d-1f3fd", "270d-1f3fe", "270d-1f3ff"] - }, - { - n: ["nail care", "nail polish"], - u: "1f485", - v: [ - "1f485-1f3fb", - "1f485-1f3fc", - "1f485-1f3fd", - "1f485-1f3fe", - "1f485-1f3ff" - ] - }, - { - n: ["selfie"], - u: "1f933", - v: [ - "1f933-1f3fb", - "1f933-1f3fc", - "1f933-1f3fd", - "1f933-1f3fe", - "1f933-1f3ff" - ] - }, - { - n: ["muscle", "flexed biceps"], - u: "1f4aa", - v: [ - "1f4aa-1f3fb", - "1f4aa-1f3fc", - "1f4aa-1f3fd", - "1f4aa-1f3fe", - "1f4aa-1f3ff" - ] - }, - { n: ["mechanical arm"], u: "1f9be" }, - { n: ["mechanical leg"], u: "1f9bf" }, - { - n: ["leg"], - u: "1f9b5", - v: [ - "1f9b5-1f3fb", - "1f9b5-1f3fc", - "1f9b5-1f3fd", - "1f9b5-1f3fe", - "1f9b5-1f3ff" - ] - }, - { - n: ["foot"], - u: "1f9b6", - v: [ - "1f9b6-1f3fb", - "1f9b6-1f3fc", - "1f9b6-1f3fd", - "1f9b6-1f3fe", - "1f9b6-1f3ff" - ] - }, - { - n: ["ear"], - u: "1f442", - v: [ - "1f442-1f3fb", - "1f442-1f3fc", - "1f442-1f3fd", - "1f442-1f3fe", - "1f442-1f3ff" - ] - }, - { - n: ["ear with hearing aid"], - u: "1f9bb", - v: [ - "1f9bb-1f3fb", - "1f9bb-1f3fc", - "1f9bb-1f3fd", - "1f9bb-1f3fe", - "1f9bb-1f3ff" - ] - }, - { - n: ["nose"], - u: "1f443", - v: [ - "1f443-1f3fb", - "1f443-1f3fc", - "1f443-1f3fd", - "1f443-1f3fe", - "1f443-1f3ff" - ] - }, - { n: ["brain"], u: "1f9e0" }, - { n: ["anatomical heart"], u: "1fac0" }, - { n: ["lungs"], u: "1fac1" }, - { n: ["tooth"], u: "1f9b7" }, - { n: ["bone"], u: "1f9b4" }, - { n: ["eyes"], u: "1f440" }, - { n: ["eye"], u: "1f441-fe0f" }, - { n: ["tongue"], u: "1f445" }, - { n: ["lips", "mouth"], u: "1f444" }, - { n: ["biting lip"], u: "1fae6" }, - { - n: ["baby"], - u: "1f476", - v: [ - "1f476-1f3fb", - "1f476-1f3fc", - "1f476-1f3fd", - "1f476-1f3fe", - "1f476-1f3ff" - ] - }, - { - n: ["child"], - u: "1f9d2", - v: [ - "1f9d2-1f3fb", - "1f9d2-1f3fc", - "1f9d2-1f3fd", - "1f9d2-1f3fe", - "1f9d2-1f3ff" - ] - }, - { - n: ["boy"], - u: "1f466", - v: [ - "1f466-1f3fb", - "1f466-1f3fc", - "1f466-1f3fd", - "1f466-1f3fe", - "1f466-1f3ff" - ] - }, - { - n: ["girl"], - u: "1f467", - v: [ - "1f467-1f3fb", - "1f467-1f3fc", - "1f467-1f3fd", - "1f467-1f3fe", - "1f467-1f3ff" - ] - }, - { - n: ["adult"], - u: "1f9d1", - v: [ - "1f9d1-1f3fb", - "1f9d1-1f3fc", - "1f9d1-1f3fd", - "1f9d1-1f3fe", - "1f9d1-1f3ff" - ] - }, - { - n: ["person with blond hair"], - u: "1f471", - v: [ - "1f471-1f3fb", - "1f471-1f3fc", - "1f471-1f3fd", - "1f471-1f3fe", - "1f471-1f3ff" - ] - }, - { - n: ["man"], - u: "1f468", - v: [ - "1f468-1f3fb", - "1f468-1f3fc", - "1f468-1f3fd", - "1f468-1f3fe", - "1f468-1f3ff" - ] - }, - { - n: ["bearded person"], - u: "1f9d4", - v: [ - "1f9d4-1f3fb", - "1f9d4-1f3fc", - "1f9d4-1f3fd", - "1f9d4-1f3fe", - "1f9d4-1f3ff" - ] - }, - { - n: ["man: beard", "man with beard"], - u: "1f9d4-200d-2642-fe0f", - v: [ - "1f9d4-1f3fb-200d-2642-fe0f", - "1f9d4-1f3fc-200d-2642-fe0f", - "1f9d4-1f3fd-200d-2642-fe0f", - "1f9d4-1f3fe-200d-2642-fe0f", - "1f9d4-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman: beard", "woman with beard"], - u: "1f9d4-200d-2640-fe0f", - v: [ - "1f9d4-1f3fb-200d-2640-fe0f", - "1f9d4-1f3fc-200d-2640-fe0f", - "1f9d4-1f3fd-200d-2640-fe0f", - "1f9d4-1f3fe-200d-2640-fe0f", - "1f9d4-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["man: red hair", "red haired man"], - u: "1f468-200d-1f9b0", - v: [ - "1f468-1f3fb-200d-1f9b0", - "1f468-1f3fc-200d-1f9b0", - "1f468-1f3fd-200d-1f9b0", - "1f468-1f3fe-200d-1f9b0", - "1f468-1f3ff-200d-1f9b0" - ] - }, - { - n: ["man: curly hair", "curly haired man"], - u: "1f468-200d-1f9b1", - v: [ - "1f468-1f3fb-200d-1f9b1", - "1f468-1f3fc-200d-1f9b1", - "1f468-1f3fd-200d-1f9b1", - "1f468-1f3fe-200d-1f9b1", - "1f468-1f3ff-200d-1f9b1" - ] - }, - { - n: ["man: white hair", "white haired man"], - u: "1f468-200d-1f9b3", - v: [ - "1f468-1f3fb-200d-1f9b3", - "1f468-1f3fc-200d-1f9b3", - "1f468-1f3fd-200d-1f9b3", - "1f468-1f3fe-200d-1f9b3", - "1f468-1f3ff-200d-1f9b3" - ] - }, - { - n: ["bald man", "man: bald"], - u: "1f468-200d-1f9b2", - v: [ - "1f468-1f3fb-200d-1f9b2", - "1f468-1f3fc-200d-1f9b2", - "1f468-1f3fd-200d-1f9b2", - "1f468-1f3fe-200d-1f9b2", - "1f468-1f3ff-200d-1f9b2" - ] - }, - { - n: ["woman"], - u: "1f469", - v: [ - "1f469-1f3fb", - "1f469-1f3fc", - "1f469-1f3fd", - "1f469-1f3fe", - "1f469-1f3ff" - ] - }, - { - n: ["woman: red hair", "red haired woman"], - u: "1f469-200d-1f9b0", - v: [ - "1f469-1f3fb-200d-1f9b0", - "1f469-1f3fc-200d-1f9b0", - "1f469-1f3fd-200d-1f9b0", - "1f469-1f3fe-200d-1f9b0", - "1f469-1f3ff-200d-1f9b0" - ] - }, - { - n: ["person: red hair", "red haired person"], - u: "1f9d1-200d-1f9b0", - v: [ - "1f9d1-1f3fb-200d-1f9b0", - "1f9d1-1f3fc-200d-1f9b0", - "1f9d1-1f3fd-200d-1f9b0", - "1f9d1-1f3fe-200d-1f9b0", - "1f9d1-1f3ff-200d-1f9b0" - ] - }, - { - n: ["woman: curly hair", "curly haired woman"], - u: "1f469-200d-1f9b1", - v: [ - "1f469-1f3fb-200d-1f9b1", - "1f469-1f3fc-200d-1f9b1", - "1f469-1f3fd-200d-1f9b1", - "1f469-1f3fe-200d-1f9b1", - "1f469-1f3ff-200d-1f9b1" - ] - }, - { - n: ["person: curly hair", "curly haired person"], - u: "1f9d1-200d-1f9b1", - v: [ - "1f9d1-1f3fb-200d-1f9b1", - "1f9d1-1f3fc-200d-1f9b1", - "1f9d1-1f3fd-200d-1f9b1", - "1f9d1-1f3fe-200d-1f9b1", - "1f9d1-1f3ff-200d-1f9b1" - ] - }, - { - n: ["woman: white hair", "white haired woman"], - u: "1f469-200d-1f9b3", - v: [ - "1f469-1f3fb-200d-1f9b3", - "1f469-1f3fc-200d-1f9b3", - "1f469-1f3fd-200d-1f9b3", - "1f469-1f3fe-200d-1f9b3", - "1f469-1f3ff-200d-1f9b3" - ] - }, - { - n: ["person: white hair", "white haired person"], - u: "1f9d1-200d-1f9b3", - v: [ - "1f9d1-1f3fb-200d-1f9b3", - "1f9d1-1f3fc-200d-1f9b3", - "1f9d1-1f3fd-200d-1f9b3", - "1f9d1-1f3fe-200d-1f9b3", - "1f9d1-1f3ff-200d-1f9b3" - ] - }, - { - n: ["bald woman", "woman: bald"], - u: "1f469-200d-1f9b2", - v: [ - "1f469-1f3fb-200d-1f9b2", - "1f469-1f3fc-200d-1f9b2", - "1f469-1f3fd-200d-1f9b2", - "1f469-1f3fe-200d-1f9b2", - "1f469-1f3ff-200d-1f9b2" - ] - }, - { - n: ["bald person", "person: bald"], - u: "1f9d1-200d-1f9b2", - v: [ - "1f9d1-1f3fb-200d-1f9b2", - "1f9d1-1f3fc-200d-1f9b2", - "1f9d1-1f3fd-200d-1f9b2", - "1f9d1-1f3fe-200d-1f9b2", - "1f9d1-1f3ff-200d-1f9b2" - ] - }, - { - n: ["woman: blond hair", "blond-haired-woman"], - u: "1f471-200d-2640-fe0f", - v: [ - "1f471-1f3fb-200d-2640-fe0f", - "1f471-1f3fc-200d-2640-fe0f", - "1f471-1f3fd-200d-2640-fe0f", - "1f471-1f3fe-200d-2640-fe0f", - "1f471-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["man: blond hair", "blond-haired-man"], - u: "1f471-200d-2642-fe0f", - v: [ - "1f471-1f3fb-200d-2642-fe0f", - "1f471-1f3fc-200d-2642-fe0f", - "1f471-1f3fd-200d-2642-fe0f", - "1f471-1f3fe-200d-2642-fe0f", - "1f471-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["older adult"], - u: "1f9d3", - v: [ - "1f9d3-1f3fb", - "1f9d3-1f3fc", - "1f9d3-1f3fd", - "1f9d3-1f3fe", - "1f9d3-1f3ff" - ] - }, - { - n: ["older man"], - u: "1f474", - v: [ - "1f474-1f3fb", - "1f474-1f3fc", - "1f474-1f3fd", - "1f474-1f3fe", - "1f474-1f3ff" - ] - }, - { - n: ["older woman"], - u: "1f475", - v: [ - "1f475-1f3fb", - "1f475-1f3fc", - "1f475-1f3fd", - "1f475-1f3fe", - "1f475-1f3ff" - ] - }, - { - n: ["person frowning"], - u: "1f64d", - v: [ - "1f64d-1f3fb", - "1f64d-1f3fc", - "1f64d-1f3fd", - "1f64d-1f3fe", - "1f64d-1f3ff" - ] - }, - { - n: ["man frowning", "man-frowning"], - u: "1f64d-200d-2642-fe0f", - v: [ - "1f64d-1f3fb-200d-2642-fe0f", - "1f64d-1f3fc-200d-2642-fe0f", - "1f64d-1f3fd-200d-2642-fe0f", - "1f64d-1f3fe-200d-2642-fe0f", - "1f64d-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman frowning", "woman-frowning"], - u: "1f64d-200d-2640-fe0f", - v: [ - "1f64d-1f3fb-200d-2640-fe0f", - "1f64d-1f3fc-200d-2640-fe0f", - "1f64d-1f3fd-200d-2640-fe0f", - "1f64d-1f3fe-200d-2640-fe0f", - "1f64d-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["person with pouting face"], - u: "1f64e", - v: [ - "1f64e-1f3fb", - "1f64e-1f3fc", - "1f64e-1f3fd", - "1f64e-1f3fe", - "1f64e-1f3ff" - ] - }, - { - n: ["man pouting", "man-pouting"], - u: "1f64e-200d-2642-fe0f", - v: [ - "1f64e-1f3fb-200d-2642-fe0f", - "1f64e-1f3fc-200d-2642-fe0f", - "1f64e-1f3fd-200d-2642-fe0f", - "1f64e-1f3fe-200d-2642-fe0f", - "1f64e-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman pouting", "woman-pouting"], - u: "1f64e-200d-2640-fe0f", - v: [ - "1f64e-1f3fb-200d-2640-fe0f", - "1f64e-1f3fc-200d-2640-fe0f", - "1f64e-1f3fd-200d-2640-fe0f", - "1f64e-1f3fe-200d-2640-fe0f", - "1f64e-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["no good", "face with no good gesture"], - u: "1f645", - v: [ - "1f645-1f3fb", - "1f645-1f3fc", - "1f645-1f3fd", - "1f645-1f3fe", - "1f645-1f3ff" - ] - }, - { - n: ["man gesturing no", "man-gesturing-no"], - u: "1f645-200d-2642-fe0f", - v: [ - "1f645-1f3fb-200d-2642-fe0f", - "1f645-1f3fc-200d-2642-fe0f", - "1f645-1f3fd-200d-2642-fe0f", - "1f645-1f3fe-200d-2642-fe0f", - "1f645-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman gesturing no", "woman-gesturing-no"], - u: "1f645-200d-2640-fe0f", - v: [ - "1f645-1f3fb-200d-2640-fe0f", - "1f645-1f3fc-200d-2640-fe0f", - "1f645-1f3fd-200d-2640-fe0f", - "1f645-1f3fe-200d-2640-fe0f", - "1f645-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["ok woman", "face with ok gesture"], - u: "1f646", - v: [ - "1f646-1f3fb", - "1f646-1f3fc", - "1f646-1f3fd", - "1f646-1f3fe", - "1f646-1f3ff" - ] - }, - { - n: ["man gesturing ok", "man-gesturing-ok"], - u: "1f646-200d-2642-fe0f", - v: [ - "1f646-1f3fb-200d-2642-fe0f", - "1f646-1f3fc-200d-2642-fe0f", - "1f646-1f3fd-200d-2642-fe0f", - "1f646-1f3fe-200d-2642-fe0f", - "1f646-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman gesturing ok", "woman-gesturing-ok"], - u: "1f646-200d-2640-fe0f", - v: [ - "1f646-1f3fb-200d-2640-fe0f", - "1f646-1f3fc-200d-2640-fe0f", - "1f646-1f3fd-200d-2640-fe0f", - "1f646-1f3fe-200d-2640-fe0f", - "1f646-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["information desk person"], - u: "1f481", - v: [ - "1f481-1f3fb", - "1f481-1f3fc", - "1f481-1f3fd", - "1f481-1f3fe", - "1f481-1f3ff" - ] - }, - { - n: ["man tipping hand", "man-tipping-hand"], - u: "1f481-200d-2642-fe0f", - v: [ - "1f481-1f3fb-200d-2642-fe0f", - "1f481-1f3fc-200d-2642-fe0f", - "1f481-1f3fd-200d-2642-fe0f", - "1f481-1f3fe-200d-2642-fe0f", - "1f481-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman tipping hand", "woman-tipping-hand"], - u: "1f481-200d-2640-fe0f", - v: [ - "1f481-1f3fb-200d-2640-fe0f", - "1f481-1f3fc-200d-2640-fe0f", - "1f481-1f3fd-200d-2640-fe0f", - "1f481-1f3fe-200d-2640-fe0f", - "1f481-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["raising hand", "happy person raising one hand"], - u: "1f64b", - v: [ - "1f64b-1f3fb", - "1f64b-1f3fc", - "1f64b-1f3fd", - "1f64b-1f3fe", - "1f64b-1f3ff" - ] - }, - { - n: ["man raising hand", "man-raising-hand"], - u: "1f64b-200d-2642-fe0f", - v: [ - "1f64b-1f3fb-200d-2642-fe0f", - "1f64b-1f3fc-200d-2642-fe0f", - "1f64b-1f3fd-200d-2642-fe0f", - "1f64b-1f3fe-200d-2642-fe0f", - "1f64b-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman raising hand", "woman-raising-hand"], - u: "1f64b-200d-2640-fe0f", - v: [ - "1f64b-1f3fb-200d-2640-fe0f", - "1f64b-1f3fc-200d-2640-fe0f", - "1f64b-1f3fd-200d-2640-fe0f", - "1f64b-1f3fe-200d-2640-fe0f", - "1f64b-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["deaf person"], - u: "1f9cf", - v: [ - "1f9cf-1f3fb", - "1f9cf-1f3fc", - "1f9cf-1f3fd", - "1f9cf-1f3fe", - "1f9cf-1f3ff" - ] - }, - { - n: ["deaf man"], - u: "1f9cf-200d-2642-fe0f", - v: [ - "1f9cf-1f3fb-200d-2642-fe0f", - "1f9cf-1f3fc-200d-2642-fe0f", - "1f9cf-1f3fd-200d-2642-fe0f", - "1f9cf-1f3fe-200d-2642-fe0f", - "1f9cf-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["deaf woman"], - u: "1f9cf-200d-2640-fe0f", - v: [ - "1f9cf-1f3fb-200d-2640-fe0f", - "1f9cf-1f3fc-200d-2640-fe0f", - "1f9cf-1f3fd-200d-2640-fe0f", - "1f9cf-1f3fe-200d-2640-fe0f", - "1f9cf-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["bow", "person bowing deeply"], - u: "1f647", - v: [ - "1f647-1f3fb", - "1f647-1f3fc", - "1f647-1f3fd", - "1f647-1f3fe", - "1f647-1f3ff" - ] - }, - { - n: ["man bowing", "man-bowing"], - u: "1f647-200d-2642-fe0f", - v: [ - "1f647-1f3fb-200d-2642-fe0f", - "1f647-1f3fc-200d-2642-fe0f", - "1f647-1f3fd-200d-2642-fe0f", - "1f647-1f3fe-200d-2642-fe0f", - "1f647-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman bowing", "woman-bowing"], - u: "1f647-200d-2640-fe0f", - v: [ - "1f647-1f3fb-200d-2640-fe0f", - "1f647-1f3fc-200d-2640-fe0f", - "1f647-1f3fd-200d-2640-fe0f", - "1f647-1f3fe-200d-2640-fe0f", - "1f647-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["face palm"], - u: "1f926", - v: [ - "1f926-1f3fb", - "1f926-1f3fc", - "1f926-1f3fd", - "1f926-1f3fe", - "1f926-1f3ff" - ] - }, - { - n: ["man facepalming", "man-facepalming"], - u: "1f926-200d-2642-fe0f", - v: [ - "1f926-1f3fb-200d-2642-fe0f", - "1f926-1f3fc-200d-2642-fe0f", - "1f926-1f3fd-200d-2642-fe0f", - "1f926-1f3fe-200d-2642-fe0f", - "1f926-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman facepalming", "woman-facepalming"], - u: "1f926-200d-2640-fe0f", - v: [ - "1f926-1f3fb-200d-2640-fe0f", - "1f926-1f3fc-200d-2640-fe0f", - "1f926-1f3fd-200d-2640-fe0f", - "1f926-1f3fe-200d-2640-fe0f", - "1f926-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["shrug"], - u: "1f937", - v: [ - "1f937-1f3fb", - "1f937-1f3fc", - "1f937-1f3fd", - "1f937-1f3fe", - "1f937-1f3ff" - ] - }, - { - n: ["man shrugging", "man-shrugging"], - u: "1f937-200d-2642-fe0f", - v: [ - "1f937-1f3fb-200d-2642-fe0f", - "1f937-1f3fc-200d-2642-fe0f", - "1f937-1f3fd-200d-2642-fe0f", - "1f937-1f3fe-200d-2642-fe0f", - "1f937-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman shrugging", "woman-shrugging"], - u: "1f937-200d-2640-fe0f", - v: [ - "1f937-1f3fb-200d-2640-fe0f", - "1f937-1f3fc-200d-2640-fe0f", - "1f937-1f3fd-200d-2640-fe0f", - "1f937-1f3fe-200d-2640-fe0f", - "1f937-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["health worker"], - u: "1f9d1-200d-2695-fe0f", - v: [ - "1f9d1-1f3fb-200d-2695-fe0f", - "1f9d1-1f3fc-200d-2695-fe0f", - "1f9d1-1f3fd-200d-2695-fe0f", - "1f9d1-1f3fe-200d-2695-fe0f", - "1f9d1-1f3ff-200d-2695-fe0f" - ] - }, - { - n: ["male-doctor", "man health worker"], - u: "1f468-200d-2695-fe0f", - v: [ - "1f468-1f3fb-200d-2695-fe0f", - "1f468-1f3fc-200d-2695-fe0f", - "1f468-1f3fd-200d-2695-fe0f", - "1f468-1f3fe-200d-2695-fe0f", - "1f468-1f3ff-200d-2695-fe0f" - ] - }, - { - n: ["female-doctor", "woman health worker"], - u: "1f469-200d-2695-fe0f", - v: [ - "1f469-1f3fb-200d-2695-fe0f", - "1f469-1f3fc-200d-2695-fe0f", - "1f469-1f3fd-200d-2695-fe0f", - "1f469-1f3fe-200d-2695-fe0f", - "1f469-1f3ff-200d-2695-fe0f" - ] - }, - { - n: ["student"], - u: "1f9d1-200d-1f393", - v: [ - "1f9d1-1f3fb-200d-1f393", - "1f9d1-1f3fc-200d-1f393", - "1f9d1-1f3fd-200d-1f393", - "1f9d1-1f3fe-200d-1f393", - "1f9d1-1f3ff-200d-1f393" - ] - }, - { - n: ["man student", "male-student"], - u: "1f468-200d-1f393", - v: [ - "1f468-1f3fb-200d-1f393", - "1f468-1f3fc-200d-1f393", - "1f468-1f3fd-200d-1f393", - "1f468-1f3fe-200d-1f393", - "1f468-1f3ff-200d-1f393" - ] - }, - { - n: ["woman student", "female-student"], - u: "1f469-200d-1f393", - v: [ - "1f469-1f3fb-200d-1f393", - "1f469-1f3fc-200d-1f393", - "1f469-1f3fd-200d-1f393", - "1f469-1f3fe-200d-1f393", - "1f469-1f3ff-200d-1f393" - ] - }, - { - n: ["teacher"], - u: "1f9d1-200d-1f3eb", - v: [ - "1f9d1-1f3fb-200d-1f3eb", - "1f9d1-1f3fc-200d-1f3eb", - "1f9d1-1f3fd-200d-1f3eb", - "1f9d1-1f3fe-200d-1f3eb", - "1f9d1-1f3ff-200d-1f3eb" - ] - }, - { - n: ["man teacher", "male-teacher"], - u: "1f468-200d-1f3eb", - v: [ - "1f468-1f3fb-200d-1f3eb", - "1f468-1f3fc-200d-1f3eb", - "1f468-1f3fd-200d-1f3eb", - "1f468-1f3fe-200d-1f3eb", - "1f468-1f3ff-200d-1f3eb" - ] - }, - { - n: ["woman teacher", "female-teacher"], - u: "1f469-200d-1f3eb", - v: [ - "1f469-1f3fb-200d-1f3eb", - "1f469-1f3fc-200d-1f3eb", - "1f469-1f3fd-200d-1f3eb", - "1f469-1f3fe-200d-1f3eb", - "1f469-1f3ff-200d-1f3eb" - ] - }, - { - n: ["judge"], - u: "1f9d1-200d-2696-fe0f", - v: [ - "1f9d1-1f3fb-200d-2696-fe0f", - "1f9d1-1f3fc-200d-2696-fe0f", - "1f9d1-1f3fd-200d-2696-fe0f", - "1f9d1-1f3fe-200d-2696-fe0f", - "1f9d1-1f3ff-200d-2696-fe0f" - ] - }, - { - n: ["man judge", "male-judge"], - u: "1f468-200d-2696-fe0f", - v: [ - "1f468-1f3fb-200d-2696-fe0f", - "1f468-1f3fc-200d-2696-fe0f", - "1f468-1f3fd-200d-2696-fe0f", - "1f468-1f3fe-200d-2696-fe0f", - "1f468-1f3ff-200d-2696-fe0f" - ] - }, - { - n: ["woman judge", "female-judge"], - u: "1f469-200d-2696-fe0f", - v: [ - "1f469-1f3fb-200d-2696-fe0f", - "1f469-1f3fc-200d-2696-fe0f", - "1f469-1f3fd-200d-2696-fe0f", - "1f469-1f3fe-200d-2696-fe0f", - "1f469-1f3ff-200d-2696-fe0f" - ] - }, - { - n: ["farmer"], - u: "1f9d1-200d-1f33e", - v: [ - "1f9d1-1f3fb-200d-1f33e", - "1f9d1-1f3fc-200d-1f33e", - "1f9d1-1f3fd-200d-1f33e", - "1f9d1-1f3fe-200d-1f33e", - "1f9d1-1f3ff-200d-1f33e" - ] - }, - { - n: ["man farmer", "male-farmer"], - u: "1f468-200d-1f33e", - v: [ - "1f468-1f3fb-200d-1f33e", - "1f468-1f3fc-200d-1f33e", - "1f468-1f3fd-200d-1f33e", - "1f468-1f3fe-200d-1f33e", - "1f468-1f3ff-200d-1f33e" - ] - }, - { - n: ["woman farmer", "female-farmer"], - u: "1f469-200d-1f33e", - v: [ - "1f469-1f3fb-200d-1f33e", - "1f469-1f3fc-200d-1f33e", - "1f469-1f3fd-200d-1f33e", - "1f469-1f3fe-200d-1f33e", - "1f469-1f3ff-200d-1f33e" - ] - }, - { - n: ["cook"], - u: "1f9d1-200d-1f373", - v: [ - "1f9d1-1f3fb-200d-1f373", - "1f9d1-1f3fc-200d-1f373", - "1f9d1-1f3fd-200d-1f373", - "1f9d1-1f3fe-200d-1f373", - "1f9d1-1f3ff-200d-1f373" - ] - }, - { - n: ["man cook", "male-cook"], - u: "1f468-200d-1f373", - v: [ - "1f468-1f3fb-200d-1f373", - "1f468-1f3fc-200d-1f373", - "1f468-1f3fd-200d-1f373", - "1f468-1f3fe-200d-1f373", - "1f468-1f3ff-200d-1f373" - ] - }, - { - n: ["woman cook", "female-cook"], - u: "1f469-200d-1f373", - v: [ - "1f469-1f3fb-200d-1f373", - "1f469-1f3fc-200d-1f373", - "1f469-1f3fd-200d-1f373", - "1f469-1f3fe-200d-1f373", - "1f469-1f3ff-200d-1f373" - ] - }, - { - n: ["mechanic"], - u: "1f9d1-200d-1f527", - v: [ - "1f9d1-1f3fb-200d-1f527", - "1f9d1-1f3fc-200d-1f527", - "1f9d1-1f3fd-200d-1f527", - "1f9d1-1f3fe-200d-1f527", - "1f9d1-1f3ff-200d-1f527" - ] - }, - { - n: ["man mechanic", "male-mechanic"], - u: "1f468-200d-1f527", - v: [ - "1f468-1f3fb-200d-1f527", - "1f468-1f3fc-200d-1f527", - "1f468-1f3fd-200d-1f527", - "1f468-1f3fe-200d-1f527", - "1f468-1f3ff-200d-1f527" - ] - }, - { - n: ["woman mechanic", "female-mechanic"], - u: "1f469-200d-1f527", - v: [ - "1f469-1f3fb-200d-1f527", - "1f469-1f3fc-200d-1f527", - "1f469-1f3fd-200d-1f527", - "1f469-1f3fe-200d-1f527", - "1f469-1f3ff-200d-1f527" - ] - }, - { - n: ["factory worker"], - u: "1f9d1-200d-1f3ed", - v: [ - "1f9d1-1f3fb-200d-1f3ed", - "1f9d1-1f3fc-200d-1f3ed", - "1f9d1-1f3fd-200d-1f3ed", - "1f9d1-1f3fe-200d-1f3ed", - "1f9d1-1f3ff-200d-1f3ed" - ] - }, - { - n: ["man factory worker", "male-factory-worker"], - u: "1f468-200d-1f3ed", - v: [ - "1f468-1f3fb-200d-1f3ed", - "1f468-1f3fc-200d-1f3ed", - "1f468-1f3fd-200d-1f3ed", - "1f468-1f3fe-200d-1f3ed", - "1f468-1f3ff-200d-1f3ed" - ] - }, - { - n: ["woman factory worker", "female-factory-worker"], - u: "1f469-200d-1f3ed", - v: [ - "1f469-1f3fb-200d-1f3ed", - "1f469-1f3fc-200d-1f3ed", - "1f469-1f3fd-200d-1f3ed", - "1f469-1f3fe-200d-1f3ed", - "1f469-1f3ff-200d-1f3ed" - ] - }, - { - n: ["office worker"], - u: "1f9d1-200d-1f4bc", - v: [ - "1f9d1-1f3fb-200d-1f4bc", - "1f9d1-1f3fc-200d-1f4bc", - "1f9d1-1f3fd-200d-1f4bc", - "1f9d1-1f3fe-200d-1f4bc", - "1f9d1-1f3ff-200d-1f4bc" - ] - }, - { - n: ["man office worker", "male-office-worker"], - u: "1f468-200d-1f4bc", - v: [ - "1f468-1f3fb-200d-1f4bc", - "1f468-1f3fc-200d-1f4bc", - "1f468-1f3fd-200d-1f4bc", - "1f468-1f3fe-200d-1f4bc", - "1f468-1f3ff-200d-1f4bc" - ] - }, - { - n: ["woman office worker", "female-office-worker"], - u: "1f469-200d-1f4bc", - v: [ - "1f469-1f3fb-200d-1f4bc", - "1f469-1f3fc-200d-1f4bc", - "1f469-1f3fd-200d-1f4bc", - "1f469-1f3fe-200d-1f4bc", - "1f469-1f3ff-200d-1f4bc" - ] - }, - { - n: ["scientist"], - u: "1f9d1-200d-1f52c", - v: [ - "1f9d1-1f3fb-200d-1f52c", - "1f9d1-1f3fc-200d-1f52c", - "1f9d1-1f3fd-200d-1f52c", - "1f9d1-1f3fe-200d-1f52c", - "1f9d1-1f3ff-200d-1f52c" - ] - }, - { - n: ["man scientist", "male-scientist"], - u: "1f468-200d-1f52c", - v: [ - "1f468-1f3fb-200d-1f52c", - "1f468-1f3fc-200d-1f52c", - "1f468-1f3fd-200d-1f52c", - "1f468-1f3fe-200d-1f52c", - "1f468-1f3ff-200d-1f52c" - ] - }, - { - n: ["woman scientist", "female-scientist"], - u: "1f469-200d-1f52c", - v: [ - "1f469-1f3fb-200d-1f52c", - "1f469-1f3fc-200d-1f52c", - "1f469-1f3fd-200d-1f52c", - "1f469-1f3fe-200d-1f52c", - "1f469-1f3ff-200d-1f52c" - ] - }, - { - n: ["technologist"], - u: "1f9d1-200d-1f4bb", - v: [ - "1f9d1-1f3fb-200d-1f4bb", - "1f9d1-1f3fc-200d-1f4bb", - "1f9d1-1f3fd-200d-1f4bb", - "1f9d1-1f3fe-200d-1f4bb", - "1f9d1-1f3ff-200d-1f4bb" - ] - }, - { - n: ["man technologist", "male-technologist"], - u: "1f468-200d-1f4bb", - v: [ - "1f468-1f3fb-200d-1f4bb", - "1f468-1f3fc-200d-1f4bb", - "1f468-1f3fd-200d-1f4bb", - "1f468-1f3fe-200d-1f4bb", - "1f468-1f3ff-200d-1f4bb" - ] - }, - { - n: ["woman technologist", "female-technologist"], - u: "1f469-200d-1f4bb", - v: [ - "1f469-1f3fb-200d-1f4bb", - "1f469-1f3fc-200d-1f4bb", - "1f469-1f3fd-200d-1f4bb", - "1f469-1f3fe-200d-1f4bb", - "1f469-1f3ff-200d-1f4bb" - ] - }, - { - n: ["singer"], - u: "1f9d1-200d-1f3a4", - v: [ - "1f9d1-1f3fb-200d-1f3a4", - "1f9d1-1f3fc-200d-1f3a4", - "1f9d1-1f3fd-200d-1f3a4", - "1f9d1-1f3fe-200d-1f3a4", - "1f9d1-1f3ff-200d-1f3a4" - ] - }, - { - n: ["man singer", "male-singer"], - u: "1f468-200d-1f3a4", - v: [ - "1f468-1f3fb-200d-1f3a4", - "1f468-1f3fc-200d-1f3a4", - "1f468-1f3fd-200d-1f3a4", - "1f468-1f3fe-200d-1f3a4", - "1f468-1f3ff-200d-1f3a4" - ] - }, - { - n: ["woman singer", "female-singer"], - u: "1f469-200d-1f3a4", - v: [ - "1f469-1f3fb-200d-1f3a4", - "1f469-1f3fc-200d-1f3a4", - "1f469-1f3fd-200d-1f3a4", - "1f469-1f3fe-200d-1f3a4", - "1f469-1f3ff-200d-1f3a4" - ] - }, - { - n: ["artist"], - u: "1f9d1-200d-1f3a8", - v: [ - "1f9d1-1f3fb-200d-1f3a8", - "1f9d1-1f3fc-200d-1f3a8", - "1f9d1-1f3fd-200d-1f3a8", - "1f9d1-1f3fe-200d-1f3a8", - "1f9d1-1f3ff-200d-1f3a8" - ] - }, - { - n: ["man artist", "male-artist"], - u: "1f468-200d-1f3a8", - v: [ - "1f468-1f3fb-200d-1f3a8", - "1f468-1f3fc-200d-1f3a8", - "1f468-1f3fd-200d-1f3a8", - "1f468-1f3fe-200d-1f3a8", - "1f468-1f3ff-200d-1f3a8" - ] - }, - { - n: ["woman artist", "female-artist"], - u: "1f469-200d-1f3a8", - v: [ - "1f469-1f3fb-200d-1f3a8", - "1f469-1f3fc-200d-1f3a8", - "1f469-1f3fd-200d-1f3a8", - "1f469-1f3fe-200d-1f3a8", - "1f469-1f3ff-200d-1f3a8" - ] - }, - { - n: ["pilot"], - u: "1f9d1-200d-2708-fe0f", - v: [ - "1f9d1-1f3fb-200d-2708-fe0f", - "1f9d1-1f3fc-200d-2708-fe0f", - "1f9d1-1f3fd-200d-2708-fe0f", - "1f9d1-1f3fe-200d-2708-fe0f", - "1f9d1-1f3ff-200d-2708-fe0f" - ] - }, - { - n: ["man pilot", "male-pilot"], - u: "1f468-200d-2708-fe0f", - v: [ - "1f468-1f3fb-200d-2708-fe0f", - "1f468-1f3fc-200d-2708-fe0f", - "1f468-1f3fd-200d-2708-fe0f", - "1f468-1f3fe-200d-2708-fe0f", - "1f468-1f3ff-200d-2708-fe0f" - ] - }, - { - n: ["woman pilot", "female-pilot"], - u: "1f469-200d-2708-fe0f", - v: [ - "1f469-1f3fb-200d-2708-fe0f", - "1f469-1f3fc-200d-2708-fe0f", - "1f469-1f3fd-200d-2708-fe0f", - "1f469-1f3fe-200d-2708-fe0f", - "1f469-1f3ff-200d-2708-fe0f" - ] - }, - { - n: ["astronaut"], - u: "1f9d1-200d-1f680", - v: [ - "1f9d1-1f3fb-200d-1f680", - "1f9d1-1f3fc-200d-1f680", - "1f9d1-1f3fd-200d-1f680", - "1f9d1-1f3fe-200d-1f680", - "1f9d1-1f3ff-200d-1f680" - ] - }, - { - n: ["man astronaut", "male-astronaut"], - u: "1f468-200d-1f680", - v: [ - "1f468-1f3fb-200d-1f680", - "1f468-1f3fc-200d-1f680", - "1f468-1f3fd-200d-1f680", - "1f468-1f3fe-200d-1f680", - "1f468-1f3ff-200d-1f680" - ] - }, - { - n: ["woman astronaut", "female-astronaut"], - u: "1f469-200d-1f680", - v: [ - "1f469-1f3fb-200d-1f680", - "1f469-1f3fc-200d-1f680", - "1f469-1f3fd-200d-1f680", - "1f469-1f3fe-200d-1f680", - "1f469-1f3ff-200d-1f680" - ] - }, - { - n: ["firefighter"], - u: "1f9d1-200d-1f692", - v: [ - "1f9d1-1f3fb-200d-1f692", - "1f9d1-1f3fc-200d-1f692", - "1f9d1-1f3fd-200d-1f692", - "1f9d1-1f3fe-200d-1f692", - "1f9d1-1f3ff-200d-1f692" - ] - }, - { - n: ["man firefighter", "male-firefighter"], - u: "1f468-200d-1f692", - v: [ - "1f468-1f3fb-200d-1f692", - "1f468-1f3fc-200d-1f692", - "1f468-1f3fd-200d-1f692", - "1f468-1f3fe-200d-1f692", - "1f468-1f3ff-200d-1f692" - ] - }, - { - n: ["woman firefighter", "female-firefighter"], - u: "1f469-200d-1f692", - v: [ - "1f469-1f3fb-200d-1f692", - "1f469-1f3fc-200d-1f692", - "1f469-1f3fd-200d-1f692", - "1f469-1f3fe-200d-1f692", - "1f469-1f3ff-200d-1f692" - ] - }, - { - n: ["cop", "police officer"], - u: "1f46e", - v: [ - "1f46e-1f3fb", - "1f46e-1f3fc", - "1f46e-1f3fd", - "1f46e-1f3fe", - "1f46e-1f3ff" - ] - }, - { - n: ["man police officer", "male-police-officer"], - u: "1f46e-200d-2642-fe0f", - v: [ - "1f46e-1f3fb-200d-2642-fe0f", - "1f46e-1f3fc-200d-2642-fe0f", - "1f46e-1f3fd-200d-2642-fe0f", - "1f46e-1f3fe-200d-2642-fe0f", - "1f46e-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman police officer", "female-police-officer"], - u: "1f46e-200d-2640-fe0f", - v: [ - "1f46e-1f3fb-200d-2640-fe0f", - "1f46e-1f3fc-200d-2640-fe0f", - "1f46e-1f3fd-200d-2640-fe0f", - "1f46e-1f3fe-200d-2640-fe0f", - "1f46e-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["detective", "sleuth or spy"], - u: "1f575-fe0f", - v: [ - "1f575-1f3fb", - "1f575-1f3fc", - "1f575-1f3fd", - "1f575-1f3fe", - "1f575-1f3ff" - ] - }, - { - n: ["man detective", "male-detective"], - u: "1f575-fe0f-200d-2642-fe0f", - v: [ - "1f575-1f3fb-200d-2642-fe0f", - "1f575-1f3fc-200d-2642-fe0f", - "1f575-1f3fd-200d-2642-fe0f", - "1f575-1f3fe-200d-2642-fe0f", - "1f575-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman detective", "female-detective"], - u: "1f575-fe0f-200d-2640-fe0f", - v: [ - "1f575-1f3fb-200d-2640-fe0f", - "1f575-1f3fc-200d-2640-fe0f", - "1f575-1f3fd-200d-2640-fe0f", - "1f575-1f3fe-200d-2640-fe0f", - "1f575-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["guardsman"], - u: "1f482", - v: [ - "1f482-1f3fb", - "1f482-1f3fc", - "1f482-1f3fd", - "1f482-1f3fe", - "1f482-1f3ff" - ] - }, - { - n: ["man guard", "male-guard"], - u: "1f482-200d-2642-fe0f", - v: [ - "1f482-1f3fb-200d-2642-fe0f", - "1f482-1f3fc-200d-2642-fe0f", - "1f482-1f3fd-200d-2642-fe0f", - "1f482-1f3fe-200d-2642-fe0f", - "1f482-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman guard", "female-guard"], - u: "1f482-200d-2640-fe0f", - v: [ - "1f482-1f3fb-200d-2640-fe0f", - "1f482-1f3fc-200d-2640-fe0f", - "1f482-1f3fd-200d-2640-fe0f", - "1f482-1f3fe-200d-2640-fe0f", - "1f482-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["ninja"], - u: "1f977", - v: [ - "1f977-1f3fb", - "1f977-1f3fc", - "1f977-1f3fd", - "1f977-1f3fe", - "1f977-1f3ff" - ] - }, - { - n: ["construction worker"], - u: "1f477", - v: [ - "1f477-1f3fb", - "1f477-1f3fc", - "1f477-1f3fd", - "1f477-1f3fe", - "1f477-1f3ff" - ] - }, - { - n: ["man construction worker", "male-construction-worker"], - u: "1f477-200d-2642-fe0f", - v: [ - "1f477-1f3fb-200d-2642-fe0f", - "1f477-1f3fc-200d-2642-fe0f", - "1f477-1f3fd-200d-2642-fe0f", - "1f477-1f3fe-200d-2642-fe0f", - "1f477-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman construction worker", "female-construction-worker"], - u: "1f477-200d-2640-fe0f", - v: [ - "1f477-1f3fb-200d-2640-fe0f", - "1f477-1f3fc-200d-2640-fe0f", - "1f477-1f3fd-200d-2640-fe0f", - "1f477-1f3fe-200d-2640-fe0f", - "1f477-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["person with crown"], - u: "1fac5", - v: [ - "1fac5-1f3fb", - "1fac5-1f3fc", - "1fac5-1f3fd", - "1fac5-1f3fe", - "1fac5-1f3ff" - ] - }, - { - n: ["prince"], - u: "1f934", - v: [ - "1f934-1f3fb", - "1f934-1f3fc", - "1f934-1f3fd", - "1f934-1f3fe", - "1f934-1f3ff" - ] - }, - { - n: ["princess"], - u: "1f478", - v: [ - "1f478-1f3fb", - "1f478-1f3fc", - "1f478-1f3fd", - "1f478-1f3fe", - "1f478-1f3ff" - ] - }, - { - n: ["man with turban"], - u: "1f473", - v: [ - "1f473-1f3fb", - "1f473-1f3fc", - "1f473-1f3fd", - "1f473-1f3fe", - "1f473-1f3ff" - ] - }, - { - n: ["man wearing turban", "man-wearing-turban"], - u: "1f473-200d-2642-fe0f", - v: [ - "1f473-1f3fb-200d-2642-fe0f", - "1f473-1f3fc-200d-2642-fe0f", - "1f473-1f3fd-200d-2642-fe0f", - "1f473-1f3fe-200d-2642-fe0f", - "1f473-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman wearing turban", "woman-wearing-turban"], - u: "1f473-200d-2640-fe0f", - v: [ - "1f473-1f3fb-200d-2640-fe0f", - "1f473-1f3fc-200d-2640-fe0f", - "1f473-1f3fd-200d-2640-fe0f", - "1f473-1f3fe-200d-2640-fe0f", - "1f473-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["man with gua pi mao"], - u: "1f472", - v: [ - "1f472-1f3fb", - "1f472-1f3fc", - "1f472-1f3fd", - "1f472-1f3fe", - "1f472-1f3ff" - ] - }, - { - n: ["person with headscarf"], - u: "1f9d5", - v: [ - "1f9d5-1f3fb", - "1f9d5-1f3fc", - "1f9d5-1f3fd", - "1f9d5-1f3fe", - "1f9d5-1f3ff" - ] - }, - { - n: ["man in tuxedo", "person in tuxedo"], - u: "1f935", - v: [ - "1f935-1f3fb", - "1f935-1f3fc", - "1f935-1f3fd", - "1f935-1f3fe", - "1f935-1f3ff" - ] - }, - { - n: ["man in tuxedo"], - u: "1f935-200d-2642-fe0f", - v: [ - "1f935-1f3fb-200d-2642-fe0f", - "1f935-1f3fc-200d-2642-fe0f", - "1f935-1f3fd-200d-2642-fe0f", - "1f935-1f3fe-200d-2642-fe0f", - "1f935-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman in tuxedo"], - u: "1f935-200d-2640-fe0f", - v: [ - "1f935-1f3fb-200d-2640-fe0f", - "1f935-1f3fc-200d-2640-fe0f", - "1f935-1f3fd-200d-2640-fe0f", - "1f935-1f3fe-200d-2640-fe0f", - "1f935-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["bride with veil"], - u: "1f470", - v: [ - "1f470-1f3fb", - "1f470-1f3fc", - "1f470-1f3fd", - "1f470-1f3fe", - "1f470-1f3ff" - ] - }, - { - n: ["man with veil"], - u: "1f470-200d-2642-fe0f", - v: [ - "1f470-1f3fb-200d-2642-fe0f", - "1f470-1f3fc-200d-2642-fe0f", - "1f470-1f3fd-200d-2642-fe0f", - "1f470-1f3fe-200d-2642-fe0f", - "1f470-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman with veil"], - u: "1f470-200d-2640-fe0f", - v: [ - "1f470-1f3fb-200d-2640-fe0f", - "1f470-1f3fc-200d-2640-fe0f", - "1f470-1f3fd-200d-2640-fe0f", - "1f470-1f3fe-200d-2640-fe0f", - "1f470-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["pregnant woman"], - u: "1f930", - v: [ - "1f930-1f3fb", - "1f930-1f3fc", - "1f930-1f3fd", - "1f930-1f3fe", - "1f930-1f3ff" - ] - }, - { - n: ["pregnant man"], - u: "1fac3", - v: [ - "1fac3-1f3fb", - "1fac3-1f3fc", - "1fac3-1f3fd", - "1fac3-1f3fe", - "1fac3-1f3ff" - ] - }, - { - n: ["pregnant person"], - u: "1fac4", - v: [ - "1fac4-1f3fb", - "1fac4-1f3fc", - "1fac4-1f3fd", - "1fac4-1f3fe", - "1fac4-1f3ff" - ] - }, - { - n: ["breast-feeding"], - u: "1f931", - v: [ - "1f931-1f3fb", - "1f931-1f3fc", - "1f931-1f3fd", - "1f931-1f3fe", - "1f931-1f3ff" - ] - }, - { - n: ["woman feeding baby"], - u: "1f469-200d-1f37c", - v: [ - "1f469-1f3fb-200d-1f37c", - "1f469-1f3fc-200d-1f37c", - "1f469-1f3fd-200d-1f37c", - "1f469-1f3fe-200d-1f37c", - "1f469-1f3ff-200d-1f37c" - ] - }, - { - n: ["man feeding baby"], - u: "1f468-200d-1f37c", - v: [ - "1f468-1f3fb-200d-1f37c", - "1f468-1f3fc-200d-1f37c", - "1f468-1f3fd-200d-1f37c", - "1f468-1f3fe-200d-1f37c", - "1f468-1f3ff-200d-1f37c" - ] - }, - { - n: ["person feeding baby"], - u: "1f9d1-200d-1f37c", - v: [ - "1f9d1-1f3fb-200d-1f37c", - "1f9d1-1f3fc-200d-1f37c", - "1f9d1-1f3fd-200d-1f37c", - "1f9d1-1f3fe-200d-1f37c", - "1f9d1-1f3ff-200d-1f37c" - ] - }, - { - n: ["angel", "baby angel"], - u: "1f47c", - v: [ - "1f47c-1f3fb", - "1f47c-1f3fc", - "1f47c-1f3fd", - "1f47c-1f3fe", - "1f47c-1f3ff" - ] - }, - { - n: ["santa", "father christmas"], - u: "1f385", - v: [ - "1f385-1f3fb", - "1f385-1f3fc", - "1f385-1f3fd", - "1f385-1f3fe", - "1f385-1f3ff" - ] - }, - { - n: ["mrs claus", "mother christmas"], - u: "1f936", - v: [ - "1f936-1f3fb", - "1f936-1f3fc", - "1f936-1f3fd", - "1f936-1f3fe", - "1f936-1f3ff" - ] - }, - { - n: ["mx claus"], - u: "1f9d1-200d-1f384", - v: [ - "1f9d1-1f3fb-200d-1f384", - "1f9d1-1f3fc-200d-1f384", - "1f9d1-1f3fd-200d-1f384", - "1f9d1-1f3fe-200d-1f384", - "1f9d1-1f3ff-200d-1f384" - ] - }, - { - n: ["superhero"], - u: "1f9b8", - v: [ - "1f9b8-1f3fb", - "1f9b8-1f3fc", - "1f9b8-1f3fd", - "1f9b8-1f3fe", - "1f9b8-1f3ff" - ] - }, - { - n: ["man superhero", "male superhero"], - u: "1f9b8-200d-2642-fe0f", - v: [ - "1f9b8-1f3fb-200d-2642-fe0f", - "1f9b8-1f3fc-200d-2642-fe0f", - "1f9b8-1f3fd-200d-2642-fe0f", - "1f9b8-1f3fe-200d-2642-fe0f", - "1f9b8-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman superhero", "female superhero"], - u: "1f9b8-200d-2640-fe0f", - v: [ - "1f9b8-1f3fb-200d-2640-fe0f", - "1f9b8-1f3fc-200d-2640-fe0f", - "1f9b8-1f3fd-200d-2640-fe0f", - "1f9b8-1f3fe-200d-2640-fe0f", - "1f9b8-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["supervillain"], - u: "1f9b9", - v: [ - "1f9b9-1f3fb", - "1f9b9-1f3fc", - "1f9b9-1f3fd", - "1f9b9-1f3fe", - "1f9b9-1f3ff" - ] - }, - { - n: ["man supervillain", "male supervillain"], - u: "1f9b9-200d-2642-fe0f", - v: [ - "1f9b9-1f3fb-200d-2642-fe0f", - "1f9b9-1f3fc-200d-2642-fe0f", - "1f9b9-1f3fd-200d-2642-fe0f", - "1f9b9-1f3fe-200d-2642-fe0f", - "1f9b9-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman supervillain", "female supervillain"], - u: "1f9b9-200d-2640-fe0f", - v: [ - "1f9b9-1f3fb-200d-2640-fe0f", - "1f9b9-1f3fc-200d-2640-fe0f", - "1f9b9-1f3fd-200d-2640-fe0f", - "1f9b9-1f3fe-200d-2640-fe0f", - "1f9b9-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["mage"], - u: "1f9d9", - v: [ - "1f9d9-1f3fb", - "1f9d9-1f3fc", - "1f9d9-1f3fd", - "1f9d9-1f3fe", - "1f9d9-1f3ff" - ] - }, - { - n: ["man mage", "male mage"], - u: "1f9d9-200d-2642-fe0f", - v: [ - "1f9d9-1f3fb-200d-2642-fe0f", - "1f9d9-1f3fc-200d-2642-fe0f", - "1f9d9-1f3fd-200d-2642-fe0f", - "1f9d9-1f3fe-200d-2642-fe0f", - "1f9d9-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman mage", "female mage"], - u: "1f9d9-200d-2640-fe0f", - v: [ - "1f9d9-1f3fb-200d-2640-fe0f", - "1f9d9-1f3fc-200d-2640-fe0f", - "1f9d9-1f3fd-200d-2640-fe0f", - "1f9d9-1f3fe-200d-2640-fe0f", - "1f9d9-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["fairy"], - u: "1f9da", - v: [ - "1f9da-1f3fb", - "1f9da-1f3fc", - "1f9da-1f3fd", - "1f9da-1f3fe", - "1f9da-1f3ff" - ] - }, - { - n: ["man fairy", "male fairy"], - u: "1f9da-200d-2642-fe0f", - v: [ - "1f9da-1f3fb-200d-2642-fe0f", - "1f9da-1f3fc-200d-2642-fe0f", - "1f9da-1f3fd-200d-2642-fe0f", - "1f9da-1f3fe-200d-2642-fe0f", - "1f9da-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman fairy", "female fairy"], - u: "1f9da-200d-2640-fe0f", - v: [ - "1f9da-1f3fb-200d-2640-fe0f", - "1f9da-1f3fc-200d-2640-fe0f", - "1f9da-1f3fd-200d-2640-fe0f", - "1f9da-1f3fe-200d-2640-fe0f", - "1f9da-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["vampire"], - u: "1f9db", - v: [ - "1f9db-1f3fb", - "1f9db-1f3fc", - "1f9db-1f3fd", - "1f9db-1f3fe", - "1f9db-1f3ff" - ] - }, - { - n: ["man vampire", "male vampire"], - u: "1f9db-200d-2642-fe0f", - v: [ - "1f9db-1f3fb-200d-2642-fe0f", - "1f9db-1f3fc-200d-2642-fe0f", - "1f9db-1f3fd-200d-2642-fe0f", - "1f9db-1f3fe-200d-2642-fe0f", - "1f9db-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman vampire", "female vampire"], - u: "1f9db-200d-2640-fe0f", - v: [ - "1f9db-1f3fb-200d-2640-fe0f", - "1f9db-1f3fc-200d-2640-fe0f", - "1f9db-1f3fd-200d-2640-fe0f", - "1f9db-1f3fe-200d-2640-fe0f", - "1f9db-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["merperson"], - u: "1f9dc", - v: [ - "1f9dc-1f3fb", - "1f9dc-1f3fc", - "1f9dc-1f3fd", - "1f9dc-1f3fe", - "1f9dc-1f3ff" - ] - }, - { - n: ["merman"], - u: "1f9dc-200d-2642-fe0f", - v: [ - "1f9dc-1f3fb-200d-2642-fe0f", - "1f9dc-1f3fc-200d-2642-fe0f", - "1f9dc-1f3fd-200d-2642-fe0f", - "1f9dc-1f3fe-200d-2642-fe0f", - "1f9dc-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["mermaid"], - u: "1f9dc-200d-2640-fe0f", - v: [ - "1f9dc-1f3fb-200d-2640-fe0f", - "1f9dc-1f3fc-200d-2640-fe0f", - "1f9dc-1f3fd-200d-2640-fe0f", - "1f9dc-1f3fe-200d-2640-fe0f", - "1f9dc-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["elf"], - u: "1f9dd", - v: [ - "1f9dd-1f3fb", - "1f9dd-1f3fc", - "1f9dd-1f3fd", - "1f9dd-1f3fe", - "1f9dd-1f3ff" - ] - }, - { - n: ["man elf", "male elf"], - u: "1f9dd-200d-2642-fe0f", - v: [ - "1f9dd-1f3fb-200d-2642-fe0f", - "1f9dd-1f3fc-200d-2642-fe0f", - "1f9dd-1f3fd-200d-2642-fe0f", - "1f9dd-1f3fe-200d-2642-fe0f", - "1f9dd-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman elf", "female elf"], - u: "1f9dd-200d-2640-fe0f", - v: [ - "1f9dd-1f3fb-200d-2640-fe0f", - "1f9dd-1f3fc-200d-2640-fe0f", - "1f9dd-1f3fd-200d-2640-fe0f", - "1f9dd-1f3fe-200d-2640-fe0f", - "1f9dd-1f3ff-200d-2640-fe0f" - ] - }, - { n: ["genie"], u: "1f9de" }, - { n: ["man genie", "male genie"], u: "1f9de-200d-2642-fe0f" }, - { n: ["woman genie", "female genie"], u: "1f9de-200d-2640-fe0f" }, - { n: ["zombie"], u: "1f9df" }, - { n: ["man zombie", "male zombie"], u: "1f9df-200d-2642-fe0f" }, - { n: ["woman zombie", "female zombie"], u: "1f9df-200d-2640-fe0f" }, - { n: ["troll"], u: "1f9cc" }, - { - n: ["massage", "face massage"], - u: "1f486", - v: [ - "1f486-1f3fb", - "1f486-1f3fc", - "1f486-1f3fd", - "1f486-1f3fe", - "1f486-1f3ff" - ] - }, - { - n: ["man getting massage", "man-getting-massage"], - u: "1f486-200d-2642-fe0f", - v: [ - "1f486-1f3fb-200d-2642-fe0f", - "1f486-1f3fc-200d-2642-fe0f", - "1f486-1f3fd-200d-2642-fe0f", - "1f486-1f3fe-200d-2642-fe0f", - "1f486-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman getting massage", "woman-getting-massage"], - u: "1f486-200d-2640-fe0f", - v: [ - "1f486-1f3fb-200d-2640-fe0f", - "1f486-1f3fc-200d-2640-fe0f", - "1f486-1f3fd-200d-2640-fe0f", - "1f486-1f3fe-200d-2640-fe0f", - "1f486-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["haircut"], - u: "1f487", - v: [ - "1f487-1f3fb", - "1f487-1f3fc", - "1f487-1f3fd", - "1f487-1f3fe", - "1f487-1f3ff" - ] - }, - { - n: ["man getting haircut", "man-getting-haircut"], - u: "1f487-200d-2642-fe0f", - v: [ - "1f487-1f3fb-200d-2642-fe0f", - "1f487-1f3fc-200d-2642-fe0f", - "1f487-1f3fd-200d-2642-fe0f", - "1f487-1f3fe-200d-2642-fe0f", - "1f487-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman getting haircut", "woman-getting-haircut"], - u: "1f487-200d-2640-fe0f", - v: [ - "1f487-1f3fb-200d-2640-fe0f", - "1f487-1f3fc-200d-2640-fe0f", - "1f487-1f3fd-200d-2640-fe0f", - "1f487-1f3fe-200d-2640-fe0f", - "1f487-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["walking", "pedestrian"], - u: "1f6b6", - v: [ - "1f6b6-1f3fb", - "1f6b6-1f3fc", - "1f6b6-1f3fd", - "1f6b6-1f3fe", - "1f6b6-1f3ff" - ] - }, - { - n: ["man walking", "man-walking"], - u: "1f6b6-200d-2642-fe0f", - v: [ - "1f6b6-1f3fb-200d-2642-fe0f", - "1f6b6-1f3fc-200d-2642-fe0f", - "1f6b6-1f3fd-200d-2642-fe0f", - "1f6b6-1f3fe-200d-2642-fe0f", - "1f6b6-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman walking", "woman-walking"], - u: "1f6b6-200d-2640-fe0f", - v: [ - "1f6b6-1f3fb-200d-2640-fe0f", - "1f6b6-1f3fc-200d-2640-fe0f", - "1f6b6-1f3fd-200d-2640-fe0f", - "1f6b6-1f3fe-200d-2640-fe0f", - "1f6b6-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["standing person"], - u: "1f9cd", - v: [ - "1f9cd-1f3fb", - "1f9cd-1f3fc", - "1f9cd-1f3fd", - "1f9cd-1f3fe", - "1f9cd-1f3ff" - ] - }, - { - n: ["man standing"], - u: "1f9cd-200d-2642-fe0f", - v: [ - "1f9cd-1f3fb-200d-2642-fe0f", - "1f9cd-1f3fc-200d-2642-fe0f", - "1f9cd-1f3fd-200d-2642-fe0f", - "1f9cd-1f3fe-200d-2642-fe0f", - "1f9cd-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman standing"], - u: "1f9cd-200d-2640-fe0f", - v: [ - "1f9cd-1f3fb-200d-2640-fe0f", - "1f9cd-1f3fc-200d-2640-fe0f", - "1f9cd-1f3fd-200d-2640-fe0f", - "1f9cd-1f3fe-200d-2640-fe0f", - "1f9cd-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["kneeling person"], - u: "1f9ce", - v: [ - "1f9ce-1f3fb", - "1f9ce-1f3fc", - "1f9ce-1f3fd", - "1f9ce-1f3fe", - "1f9ce-1f3ff" - ] - }, - { - n: ["man kneeling"], - u: "1f9ce-200d-2642-fe0f", - v: [ - "1f9ce-1f3fb-200d-2642-fe0f", - "1f9ce-1f3fc-200d-2642-fe0f", - "1f9ce-1f3fd-200d-2642-fe0f", - "1f9ce-1f3fe-200d-2642-fe0f", - "1f9ce-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman kneeling"], - u: "1f9ce-200d-2640-fe0f", - v: [ - "1f9ce-1f3fb-200d-2640-fe0f", - "1f9ce-1f3fc-200d-2640-fe0f", - "1f9ce-1f3fd-200d-2640-fe0f", - "1f9ce-1f3fe-200d-2640-fe0f", - "1f9ce-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["person with white cane", "person with probing cane"], - u: "1f9d1-200d-1f9af", - v: [ - "1f9d1-1f3fb-200d-1f9af", - "1f9d1-1f3fc-200d-1f9af", - "1f9d1-1f3fd-200d-1f9af", - "1f9d1-1f3fe-200d-1f9af", - "1f9d1-1f3ff-200d-1f9af" - ] - }, - { - n: ["man with white cane", "man with probing cane"], - u: "1f468-200d-1f9af", - v: [ - "1f468-1f3fb-200d-1f9af", - "1f468-1f3fc-200d-1f9af", - "1f468-1f3fd-200d-1f9af", - "1f468-1f3fe-200d-1f9af", - "1f468-1f3ff-200d-1f9af" - ] - }, - { - n: ["woman with white cane", "woman with probing cane"], - u: "1f469-200d-1f9af", - v: [ - "1f469-1f3fb-200d-1f9af", - "1f469-1f3fc-200d-1f9af", - "1f469-1f3fd-200d-1f9af", - "1f469-1f3fe-200d-1f9af", - "1f469-1f3ff-200d-1f9af" - ] - }, - { - n: ["person in motorized wheelchair"], - u: "1f9d1-200d-1f9bc", - v: [ - "1f9d1-1f3fb-200d-1f9bc", - "1f9d1-1f3fc-200d-1f9bc", - "1f9d1-1f3fd-200d-1f9bc", - "1f9d1-1f3fe-200d-1f9bc", - "1f9d1-1f3ff-200d-1f9bc" - ] - }, - { - n: ["man in motorized wheelchair"], - u: "1f468-200d-1f9bc", - v: [ - "1f468-1f3fb-200d-1f9bc", - "1f468-1f3fc-200d-1f9bc", - "1f468-1f3fd-200d-1f9bc", - "1f468-1f3fe-200d-1f9bc", - "1f468-1f3ff-200d-1f9bc" - ] - }, - { - n: ["woman in motorized wheelchair"], - u: "1f469-200d-1f9bc", - v: [ - "1f469-1f3fb-200d-1f9bc", - "1f469-1f3fc-200d-1f9bc", - "1f469-1f3fd-200d-1f9bc", - "1f469-1f3fe-200d-1f9bc", - "1f469-1f3ff-200d-1f9bc" - ] - }, - { - n: ["person in manual wheelchair"], - u: "1f9d1-200d-1f9bd", - v: [ - "1f9d1-1f3fb-200d-1f9bd", - "1f9d1-1f3fc-200d-1f9bd", - "1f9d1-1f3fd-200d-1f9bd", - "1f9d1-1f3fe-200d-1f9bd", - "1f9d1-1f3ff-200d-1f9bd" - ] - }, - { - n: ["man in manual wheelchair"], - u: "1f468-200d-1f9bd", - v: [ - "1f468-1f3fb-200d-1f9bd", - "1f468-1f3fc-200d-1f9bd", - "1f468-1f3fd-200d-1f9bd", - "1f468-1f3fe-200d-1f9bd", - "1f468-1f3ff-200d-1f9bd" - ] - }, - { - n: ["woman in manual wheelchair"], - u: "1f469-200d-1f9bd", - v: [ - "1f469-1f3fb-200d-1f9bd", - "1f469-1f3fc-200d-1f9bd", - "1f469-1f3fd-200d-1f9bd", - "1f469-1f3fe-200d-1f9bd", - "1f469-1f3ff-200d-1f9bd" - ] - }, - { - n: ["runner", "running"], - u: "1f3c3", - v: [ - "1f3c3-1f3fb", - "1f3c3-1f3fc", - "1f3c3-1f3fd", - "1f3c3-1f3fe", - "1f3c3-1f3ff" - ] - }, - { - n: ["man running", "man-running"], - u: "1f3c3-200d-2642-fe0f", - v: [ - "1f3c3-1f3fb-200d-2642-fe0f", - "1f3c3-1f3fc-200d-2642-fe0f", - "1f3c3-1f3fd-200d-2642-fe0f", - "1f3c3-1f3fe-200d-2642-fe0f", - "1f3c3-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman running", "woman-running"], - u: "1f3c3-200d-2640-fe0f", - v: [ - "1f3c3-1f3fb-200d-2640-fe0f", - "1f3c3-1f3fc-200d-2640-fe0f", - "1f3c3-1f3fd-200d-2640-fe0f", - "1f3c3-1f3fe-200d-2640-fe0f", - "1f3c3-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["dancer"], - u: "1f483", - v: [ - "1f483-1f3fb", - "1f483-1f3fc", - "1f483-1f3fd", - "1f483-1f3fe", - "1f483-1f3ff" - ] - }, - { - n: ["man dancing"], - u: "1f57a", - v: [ - "1f57a-1f3fb", - "1f57a-1f3fc", - "1f57a-1f3fd", - "1f57a-1f3fe", - "1f57a-1f3ff" - ] - }, - { - n: ["person in suit levitating", "man in business suit levitating"], - u: "1f574-fe0f", - v: [ - "1f574-1f3fb", - "1f574-1f3fc", - "1f574-1f3fd", - "1f574-1f3fe", - "1f574-1f3ff" - ] - }, - { n: ["dancers", "woman with bunny ears"], u: "1f46f" }, - { - n: [ - "men with bunny ears", - "men-with-bunny-ears-partying", - "man-with-bunny-ears-partying" - ], - u: "1f46f-200d-2642-fe0f" - }, - { - n: [ - "women with bunny ears", - "women-with-bunny-ears-partying", - "woman-with-bunny-ears-partying" - ], - u: "1f46f-200d-2640-fe0f" - }, - { - n: ["person in steamy room"], - u: "1f9d6", - v: [ - "1f9d6-1f3fb", - "1f9d6-1f3fc", - "1f9d6-1f3fd", - "1f9d6-1f3fe", - "1f9d6-1f3ff" - ] - }, - { - n: ["man in steamy room"], - u: "1f9d6-200d-2642-fe0f", - v: [ - "1f9d6-1f3fb-200d-2642-fe0f", - "1f9d6-1f3fc-200d-2642-fe0f", - "1f9d6-1f3fd-200d-2642-fe0f", - "1f9d6-1f3fe-200d-2642-fe0f", - "1f9d6-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman in steamy room"], - u: "1f9d6-200d-2640-fe0f", - v: [ - "1f9d6-1f3fb-200d-2640-fe0f", - "1f9d6-1f3fc-200d-2640-fe0f", - "1f9d6-1f3fd-200d-2640-fe0f", - "1f9d6-1f3fe-200d-2640-fe0f", - "1f9d6-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["person climbing"], - u: "1f9d7", - v: [ - "1f9d7-1f3fb", - "1f9d7-1f3fc", - "1f9d7-1f3fd", - "1f9d7-1f3fe", - "1f9d7-1f3ff" - ] - }, - { - n: ["man climbing"], - u: "1f9d7-200d-2642-fe0f", - v: [ - "1f9d7-1f3fb-200d-2642-fe0f", - "1f9d7-1f3fc-200d-2642-fe0f", - "1f9d7-1f3fd-200d-2642-fe0f", - "1f9d7-1f3fe-200d-2642-fe0f", - "1f9d7-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman climbing"], - u: "1f9d7-200d-2640-fe0f", - v: [ - "1f9d7-1f3fb-200d-2640-fe0f", - "1f9d7-1f3fc-200d-2640-fe0f", - "1f9d7-1f3fd-200d-2640-fe0f", - "1f9d7-1f3fe-200d-2640-fe0f", - "1f9d7-1f3ff-200d-2640-fe0f" - ] - }, - { n: ["fencer"], u: "1f93a" }, - { - n: ["horse racing"], - u: "1f3c7", - v: [ - "1f3c7-1f3fb", - "1f3c7-1f3fc", - "1f3c7-1f3fd", - "1f3c7-1f3fe", - "1f3c7-1f3ff" - ] - }, - { n: ["skier"], u: "26f7-fe0f" }, - { - n: ["snowboarder"], - u: "1f3c2", - v: [ - "1f3c2-1f3fb", - "1f3c2-1f3fc", - "1f3c2-1f3fd", - "1f3c2-1f3fe", - "1f3c2-1f3ff" - ] - }, - { - n: ["golfer", "person golfing"], - u: "1f3cc-fe0f", - v: [ - "1f3cc-1f3fb", - "1f3cc-1f3fc", - "1f3cc-1f3fd", - "1f3cc-1f3fe", - "1f3cc-1f3ff" - ] - }, - { - n: ["man golfing", "man-golfing"], - u: "1f3cc-fe0f-200d-2642-fe0f", - v: [ - "1f3cc-1f3fb-200d-2642-fe0f", - "1f3cc-1f3fc-200d-2642-fe0f", - "1f3cc-1f3fd-200d-2642-fe0f", - "1f3cc-1f3fe-200d-2642-fe0f", - "1f3cc-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman golfing", "woman-golfing"], - u: "1f3cc-fe0f-200d-2640-fe0f", - v: [ - "1f3cc-1f3fb-200d-2640-fe0f", - "1f3cc-1f3fc-200d-2640-fe0f", - "1f3cc-1f3fd-200d-2640-fe0f", - "1f3cc-1f3fe-200d-2640-fe0f", - "1f3cc-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["surfer"], - u: "1f3c4", - v: [ - "1f3c4-1f3fb", - "1f3c4-1f3fc", - "1f3c4-1f3fd", - "1f3c4-1f3fe", - "1f3c4-1f3ff" - ] - }, - { - n: ["man surfing", "man-surfing"], - u: "1f3c4-200d-2642-fe0f", - v: [ - "1f3c4-1f3fb-200d-2642-fe0f", - "1f3c4-1f3fc-200d-2642-fe0f", - "1f3c4-1f3fd-200d-2642-fe0f", - "1f3c4-1f3fe-200d-2642-fe0f", - "1f3c4-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman surfing", "woman-surfing"], - u: "1f3c4-200d-2640-fe0f", - v: [ - "1f3c4-1f3fb-200d-2640-fe0f", - "1f3c4-1f3fc-200d-2640-fe0f", - "1f3c4-1f3fd-200d-2640-fe0f", - "1f3c4-1f3fe-200d-2640-fe0f", - "1f3c4-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["rowboat"], - u: "1f6a3", - v: [ - "1f6a3-1f3fb", - "1f6a3-1f3fc", - "1f6a3-1f3fd", - "1f6a3-1f3fe", - "1f6a3-1f3ff" - ] - }, - { - n: ["man rowing boat", "man-rowing-boat"], - u: "1f6a3-200d-2642-fe0f", - v: [ - "1f6a3-1f3fb-200d-2642-fe0f", - "1f6a3-1f3fc-200d-2642-fe0f", - "1f6a3-1f3fd-200d-2642-fe0f", - "1f6a3-1f3fe-200d-2642-fe0f", - "1f6a3-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman rowing boat", "woman-rowing-boat"], - u: "1f6a3-200d-2640-fe0f", - v: [ - "1f6a3-1f3fb-200d-2640-fe0f", - "1f6a3-1f3fc-200d-2640-fe0f", - "1f6a3-1f3fd-200d-2640-fe0f", - "1f6a3-1f3fe-200d-2640-fe0f", - "1f6a3-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["swimmer"], - u: "1f3ca", - v: [ - "1f3ca-1f3fb", - "1f3ca-1f3fc", - "1f3ca-1f3fd", - "1f3ca-1f3fe", - "1f3ca-1f3ff" - ] - }, - { - n: ["man swimming", "man-swimming"], - u: "1f3ca-200d-2642-fe0f", - v: [ - "1f3ca-1f3fb-200d-2642-fe0f", - "1f3ca-1f3fc-200d-2642-fe0f", - "1f3ca-1f3fd-200d-2642-fe0f", - "1f3ca-1f3fe-200d-2642-fe0f", - "1f3ca-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman swimming", "woman-swimming"], - u: "1f3ca-200d-2640-fe0f", - v: [ - "1f3ca-1f3fb-200d-2640-fe0f", - "1f3ca-1f3fc-200d-2640-fe0f", - "1f3ca-1f3fd-200d-2640-fe0f", - "1f3ca-1f3fe-200d-2640-fe0f", - "1f3ca-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["person with ball", "person bouncing ball"], - u: "26f9-fe0f", - v: ["26f9-1f3fb", "26f9-1f3fc", "26f9-1f3fd", "26f9-1f3fe", "26f9-1f3ff"] - }, - { - n: ["man bouncing ball", "man-bouncing-ball"], - u: "26f9-fe0f-200d-2642-fe0f", - v: [ - "26f9-1f3fb-200d-2642-fe0f", - "26f9-1f3fc-200d-2642-fe0f", - "26f9-1f3fd-200d-2642-fe0f", - "26f9-1f3fe-200d-2642-fe0f", - "26f9-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman bouncing ball", "woman-bouncing-ball"], - u: "26f9-fe0f-200d-2640-fe0f", - v: [ - "26f9-1f3fb-200d-2640-fe0f", - "26f9-1f3fc-200d-2640-fe0f", - "26f9-1f3fd-200d-2640-fe0f", - "26f9-1f3fe-200d-2640-fe0f", - "26f9-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["weight lifter", "person lifting weights"], - u: "1f3cb-fe0f", - v: [ - "1f3cb-1f3fb", - "1f3cb-1f3fc", - "1f3cb-1f3fd", - "1f3cb-1f3fe", - "1f3cb-1f3ff" - ] - }, - { - n: ["man lifting weights", "man-lifting-weights"], - u: "1f3cb-fe0f-200d-2642-fe0f", - v: [ - "1f3cb-1f3fb-200d-2642-fe0f", - "1f3cb-1f3fc-200d-2642-fe0f", - "1f3cb-1f3fd-200d-2642-fe0f", - "1f3cb-1f3fe-200d-2642-fe0f", - "1f3cb-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman lifting weights", "woman-lifting-weights"], - u: "1f3cb-fe0f-200d-2640-fe0f", - v: [ - "1f3cb-1f3fb-200d-2640-fe0f", - "1f3cb-1f3fc-200d-2640-fe0f", - "1f3cb-1f3fd-200d-2640-fe0f", - "1f3cb-1f3fe-200d-2640-fe0f", - "1f3cb-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["bicyclist"], - u: "1f6b4", - v: [ - "1f6b4-1f3fb", - "1f6b4-1f3fc", - "1f6b4-1f3fd", - "1f6b4-1f3fe", - "1f6b4-1f3ff" - ] - }, - { - n: ["man biking", "man-biking"], - u: "1f6b4-200d-2642-fe0f", - v: [ - "1f6b4-1f3fb-200d-2642-fe0f", - "1f6b4-1f3fc-200d-2642-fe0f", - "1f6b4-1f3fd-200d-2642-fe0f", - "1f6b4-1f3fe-200d-2642-fe0f", - "1f6b4-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman biking", "woman-biking"], - u: "1f6b4-200d-2640-fe0f", - v: [ - "1f6b4-1f3fb-200d-2640-fe0f", - "1f6b4-1f3fc-200d-2640-fe0f", - "1f6b4-1f3fd-200d-2640-fe0f", - "1f6b4-1f3fe-200d-2640-fe0f", - "1f6b4-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["mountain bicyclist"], - u: "1f6b5", - v: [ - "1f6b5-1f3fb", - "1f6b5-1f3fc", - "1f6b5-1f3fd", - "1f6b5-1f3fe", - "1f6b5-1f3ff" - ] - }, - { - n: ["man mountain biking", "man-mountain-biking"], - u: "1f6b5-200d-2642-fe0f", - v: [ - "1f6b5-1f3fb-200d-2642-fe0f", - "1f6b5-1f3fc-200d-2642-fe0f", - "1f6b5-1f3fd-200d-2642-fe0f", - "1f6b5-1f3fe-200d-2642-fe0f", - "1f6b5-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman mountain biking", "woman-mountain-biking"], - u: "1f6b5-200d-2640-fe0f", - v: [ - "1f6b5-1f3fb-200d-2640-fe0f", - "1f6b5-1f3fc-200d-2640-fe0f", - "1f6b5-1f3fd-200d-2640-fe0f", - "1f6b5-1f3fe-200d-2640-fe0f", - "1f6b5-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["person doing cartwheel"], - u: "1f938", - v: [ - "1f938-1f3fb", - "1f938-1f3fc", - "1f938-1f3fd", - "1f938-1f3fe", - "1f938-1f3ff" - ] - }, - { - n: ["man cartwheeling", "man-cartwheeling"], - u: "1f938-200d-2642-fe0f", - v: [ - "1f938-1f3fb-200d-2642-fe0f", - "1f938-1f3fc-200d-2642-fe0f", - "1f938-1f3fd-200d-2642-fe0f", - "1f938-1f3fe-200d-2642-fe0f", - "1f938-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman cartwheeling", "woman-cartwheeling"], - u: "1f938-200d-2640-fe0f", - v: [ - "1f938-1f3fb-200d-2640-fe0f", - "1f938-1f3fc-200d-2640-fe0f", - "1f938-1f3fd-200d-2640-fe0f", - "1f938-1f3fe-200d-2640-fe0f", - "1f938-1f3ff-200d-2640-fe0f" - ] - }, - { n: ["wrestlers"], u: "1f93c" }, - { n: ["men wrestling", "man-wrestling"], u: "1f93c-200d-2642-fe0f" }, - { n: ["women wrestling", "woman-wrestling"], u: "1f93c-200d-2640-fe0f" }, - { - n: ["water polo"], - u: "1f93d", - v: [ - "1f93d-1f3fb", - "1f93d-1f3fc", - "1f93d-1f3fd", - "1f93d-1f3fe", - "1f93d-1f3ff" - ] - }, - { - n: ["man playing water polo", "man-playing-water-polo"], - u: "1f93d-200d-2642-fe0f", - v: [ - "1f93d-1f3fb-200d-2642-fe0f", - "1f93d-1f3fc-200d-2642-fe0f", - "1f93d-1f3fd-200d-2642-fe0f", - "1f93d-1f3fe-200d-2642-fe0f", - "1f93d-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman playing water polo", "woman-playing-water-polo"], - u: "1f93d-200d-2640-fe0f", - v: [ - "1f93d-1f3fb-200d-2640-fe0f", - "1f93d-1f3fc-200d-2640-fe0f", - "1f93d-1f3fd-200d-2640-fe0f", - "1f93d-1f3fe-200d-2640-fe0f", - "1f93d-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["handball"], - u: "1f93e", - v: [ - "1f93e-1f3fb", - "1f93e-1f3fc", - "1f93e-1f3fd", - "1f93e-1f3fe", - "1f93e-1f3ff" - ] - }, - { - n: ["man playing handball", "man-playing-handball"], - u: "1f93e-200d-2642-fe0f", - v: [ - "1f93e-1f3fb-200d-2642-fe0f", - "1f93e-1f3fc-200d-2642-fe0f", - "1f93e-1f3fd-200d-2642-fe0f", - "1f93e-1f3fe-200d-2642-fe0f", - "1f93e-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman playing handball", "woman-playing-handball"], - u: "1f93e-200d-2640-fe0f", - v: [ - "1f93e-1f3fb-200d-2640-fe0f", - "1f93e-1f3fc-200d-2640-fe0f", - "1f93e-1f3fd-200d-2640-fe0f", - "1f93e-1f3fe-200d-2640-fe0f", - "1f93e-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["juggling"], - u: "1f939", - v: [ - "1f939-1f3fb", - "1f939-1f3fc", - "1f939-1f3fd", - "1f939-1f3fe", - "1f939-1f3ff" - ] - }, - { - n: ["man juggling", "man-juggling"], - u: "1f939-200d-2642-fe0f", - v: [ - "1f939-1f3fb-200d-2642-fe0f", - "1f939-1f3fc-200d-2642-fe0f", - "1f939-1f3fd-200d-2642-fe0f", - "1f939-1f3fe-200d-2642-fe0f", - "1f939-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman juggling", "woman-juggling"], - u: "1f939-200d-2640-fe0f", - v: [ - "1f939-1f3fb-200d-2640-fe0f", - "1f939-1f3fc-200d-2640-fe0f", - "1f939-1f3fd-200d-2640-fe0f", - "1f939-1f3fe-200d-2640-fe0f", - "1f939-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["person in lotus position"], - u: "1f9d8", - v: [ - "1f9d8-1f3fb", - "1f9d8-1f3fc", - "1f9d8-1f3fd", - "1f9d8-1f3fe", - "1f9d8-1f3ff" - ] - }, - { - n: ["man in lotus position"], - u: "1f9d8-200d-2642-fe0f", - v: [ - "1f9d8-1f3fb-200d-2642-fe0f", - "1f9d8-1f3fc-200d-2642-fe0f", - "1f9d8-1f3fd-200d-2642-fe0f", - "1f9d8-1f3fe-200d-2642-fe0f", - "1f9d8-1f3ff-200d-2642-fe0f" - ] - }, - { - n: ["woman in lotus position"], - u: "1f9d8-200d-2640-fe0f", - v: [ - "1f9d8-1f3fb-200d-2640-fe0f", - "1f9d8-1f3fc-200d-2640-fe0f", - "1f9d8-1f3fd-200d-2640-fe0f", - "1f9d8-1f3fe-200d-2640-fe0f", - "1f9d8-1f3ff-200d-2640-fe0f" - ] - }, - { - n: ["bath"], - u: "1f6c0", - v: [ - "1f6c0-1f3fb", - "1f6c0-1f3fc", - "1f6c0-1f3fd", - "1f6c0-1f3fe", - "1f6c0-1f3ff" - ] - }, - { - n: ["sleeping accommodation"], - u: "1f6cc", - v: [ - "1f6cc-1f3fb", - "1f6cc-1f3fc", - "1f6cc-1f3fd", - "1f6cc-1f3fe", - "1f6cc-1f3ff" - ] - }, - { - n: ["people holding hands"], - u: "1f9d1-200d-1f91d-200d-1f9d1", - v: [ - "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb", - "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc", - "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd", - "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe", - "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff", - "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb", - "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc", - "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd", - "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe", - "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff", - "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb", - "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc", - "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd", - "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe", - "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff", - "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb", - "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc", - "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd", - "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe", - "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff", - "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb", - "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc", - "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd", - "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe", - "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff" - ] - }, - { - n: ["women holding hands", "two women holding hands"], - u: "1f46d", - v: [ - "1f46d-1f3fb", - "1f46d-1f3fc", - "1f46d-1f3fd", - "1f46d-1f3fe", - "1f46d-1f3ff", - "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc", - "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd", - "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe", - "1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff", - "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb", - "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd", - "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe", - "1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff", - "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb", - "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc", - "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe", - "1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff", - "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb", - "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc", - "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd", - "1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff", - "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb", - "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc", - "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd", - "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe" - ] - }, - { - n: [ - "couple", - "man and woman holding hands", - "woman and man holding hands" - ], - u: "1f46b", - v: [ - "1f46b-1f3fb", - "1f46b-1f3fc", - "1f46b-1f3fd", - "1f46b-1f3fe", - "1f46b-1f3ff", - "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc", - "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd", - "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe", - "1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff", - "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb", - "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd", - "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe", - "1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff", - "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb", - "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc", - "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe", - "1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff", - "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb", - "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc", - "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd", - "1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff", - "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb", - "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc", - "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd", - "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe" - ] - }, - { - n: ["men holding hands", "two men holding hands"], - u: "1f46c", - v: [ - "1f46c-1f3fb", - "1f46c-1f3fc", - "1f46c-1f3fd", - "1f46c-1f3fe", - "1f46c-1f3ff", - "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc", - "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd", - "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe", - "1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff", - "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb", - "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd", - "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe", - "1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff", - "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb", - "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc", - "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe", - "1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff", - "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb", - "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc", - "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd", - "1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff", - "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb", - "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc", - "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd", - "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe" - ] - }, - { - n: ["kiss", "couplekiss"], - u: "1f48f", - v: [ - "1f48f-1f3fb", - "1f48f-1f3fc", - "1f48f-1f3fd", - "1f48f-1f3fe", - "1f48f-1f3ff", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe" - ] - }, - { - n: ["woman-kiss-man", "kiss: woman, man"], - u: "1f469-200d-2764-fe0f-200d-1f48b-200d-1f468", - v: [ - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" - ] - }, - { - n: ["man-kiss-man", "kiss: man, man"], - u: "1f468-200d-2764-fe0f-200d-1f48b-200d-1f468", - v: [ - "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", - "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", - "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", - "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", - "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", - "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" - ] - }, - { - n: ["woman-kiss-woman", "kiss: woman, woman"], - u: "1f469-200d-2764-fe0f-200d-1f48b-200d-1f469", - v: [ - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", - "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", - "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", - "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", - "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", - "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff" - ] - }, - { - n: ["couple with heart"], - u: "1f491", - v: [ - "1f491-1f3fb", - "1f491-1f3fc", - "1f491-1f3fd", - "1f491-1f3fe", - "1f491-1f3ff", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fc", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fd", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fe", - "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3ff", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fb", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fd", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fe", - "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3ff", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fb", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fc", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fe", - "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3ff", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fb", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fc", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fd", - "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3ff", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fb", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fc", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fd", - "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fe" - ] - }, - { - n: ["woman-heart-man", "couple with heart: woman, man"], - u: "1f469-200d-2764-fe0f-200d-1f468", - v: [ - "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb", - "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc", - "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd", - "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe", - "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff", - "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb", - "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc", - "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd", - "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe", - "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff", - "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb", - "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc", - "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd", - "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe", - "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff", - "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb", - "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc", - "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd", - "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe", - "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff", - "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb", - "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc", - "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd", - "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe", - "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff" - ] - }, - { - n: ["man-heart-man", "couple with heart: man, man"], - u: "1f468-200d-2764-fe0f-200d-1f468", - v: [ - "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb", - "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc", - "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd", - "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe", - "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff", - "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb", - "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc", - "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd", - "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe", - "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff", - "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb", - "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc", - "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd", - "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe", - "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff", - "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb", - "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc", - "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd", - "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe", - "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff", - "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb", - "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc", - "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd", - "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe", - "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff" - ] - }, - { - n: ["woman-heart-woman", "couple with heart: woman, woman"], - u: "1f469-200d-2764-fe0f-200d-1f469", - v: [ - "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fb", - "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fc", - "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fd", - "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fe", - "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3ff", - "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fb", - "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fc", - "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fd", - "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fe", - "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3ff", - "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fb", - "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fc", - "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fd", - "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fe", - "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3ff", - "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fb", - "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fc", - "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fd", - "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fe", - "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3ff", - "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fb", - "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fc", - "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fd", - "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fe", - "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3ff" - ] - }, - { n: ["family"], u: "1f46a" }, - { - n: ["man-woman-boy", "family: man, woman, boy"], - u: "1f468-200d-1f469-200d-1f466" - }, - { - n: ["man-woman-girl", "family: man, woman, girl"], - u: "1f468-200d-1f469-200d-1f467" - }, - { - n: ["man-woman-girl-boy", "family: man, woman, girl, boy"], - u: "1f468-200d-1f469-200d-1f467-200d-1f466" - }, - { - n: ["man-woman-boy-boy", "family: man, woman, boy, boy"], - u: "1f468-200d-1f469-200d-1f466-200d-1f466" - }, - { - n: ["man-woman-girl-girl", "family: man, woman, girl, girl"], - u: "1f468-200d-1f469-200d-1f467-200d-1f467" - }, - { - n: ["man-man-boy", "family: man, man, boy"], - u: "1f468-200d-1f468-200d-1f466" - }, - { - n: ["man-man-girl", "family: man, man, girl"], - u: "1f468-200d-1f468-200d-1f467" - }, - { - n: ["man-man-girl-boy", "family: man, man, girl, boy"], - u: "1f468-200d-1f468-200d-1f467-200d-1f466" + function hb() { + for (var a5 = "", b4 = false, c4 = arguments.length - 1; -1 <= c4 && !b4; c4--) { + b4 = 0 <= c4 ? arguments[c4] : "/"; + if ("string" != typeof b4) + throw new TypeError("Arguments to path.resolve must be strings"); + if (!b4) + return ""; + a5 = b4 + "/" + a5; + b4 = "/" === b4.charAt(0); + } + a5 = db(a5.split("/").filter((d5) => !!d5), !b4).join("/"); + return (b4 ? "/" : "") + a5 || "."; + } + function ma(a5, b4) { + var c4 = Array(ca(a5) + 1); + a5 = t4(a5, c4, 0, c4.length); + b4 && (c4.length = a5); + return c4; + } + var ib = []; + function jb(a5, b4) { + ib[a5] = { input: [], output: [], Xa: b4 }; + lb(a5, mb); + } + var mb = { open: function(a5) { + var b4 = ib[a5.node.rdev]; + if (!b4) + throw new P4(43); + a5.tty = b4; + a5.seekable = false; + }, close: function(a5) { + a5.tty.Xa.fsync(a5.tty); + }, fsync: function(a5) { + a5.tty.Xa.fsync(a5.tty); + }, read: function(a5, b4, c4, d5) { + if (!a5.tty || !a5.tty.Xa.tb) + throw new P4(60); + for (var f4 = 0, h5 = 0; h5 < d5; h5++) { + try { + var k5 = a5.tty.Xa.tb(a5.tty); + } catch (q5) { + throw new P4(29); + } + if (void 0 === k5 && 0 === f4) + throw new P4(6); + if (null === k5 || void 0 === k5) + break; + f4++; + b4[c4 + h5] = k5; + } + f4 && (a5.node.timestamp = Date.now()); + return f4; + }, write: function(a5, b4, c4, d5) { + if (!a5.tty || !a5.tty.Xa.jb) + throw new P4(60); + try { + for (var f4 = 0; f4 < d5; f4++) + a5.tty.Xa.jb(a5.tty, b4[c4 + f4]); + } catch (h5) { + throw new P4(29); + } + d5 && (a5.node.timestamp = Date.now()); + return f4; + } }, tb = { tb: function(a5) { + if (!a5.input.length) { + var b4 = null; + if (Aa) { + var c4 = Buffer.alloc(256), d5 = 0; + try { + d5 = fs.readSync(process.stdin.fd, c4, 0, 256, -1); + } catch (f4) { + if (f4.toString().includes("EOF")) + d5 = 0; + else + throw f4; + } + 0 < d5 ? b4 = c4.slice(0, d5).toString("utf-8") : b4 = null; + } else + "undefined" != typeof window && "function" == typeof window.prompt ? (b4 = window.prompt("Input: "), null !== b4 && (b4 += "\n")) : "function" == typeof readline && (b4 = readline(), null !== b4 && (b4 += "\n")); + if (!b4) + return null; + a5.input = ma(b4, true); + } + return a5.input.shift(); + }, jb: function(a5, b4) { + null === b4 || 10 === b4 ? (Ga(Ma(a5.output, 0)), a5.output = []) : 0 != b4 && a5.output.push(b4); + }, fsync: function(a5) { + a5.output && 0 < a5.output.length && (Ga(Ma(a5.output, 0)), a5.output = []); + } }, ub = { jb: function(a5, b4) { + null === b4 || 10 === b4 ? (Ha(Ma(a5.output, 0)), a5.output = []) : 0 != b4 && a5.output.push(b4); + }, fsync: function(a5) { + a5.output && 0 < a5.output.length && (Ha(Ma(a5.output, 0)), a5.output = []); + } }, Q3 = { Qa: null, Ra: function() { + return Q3.createNode( + null, + "/", + 16895, + 0 + ); + }, createNode: function(a5, b4, c4, d5) { + if (24576 === (c4 & 61440) || 4096 === (c4 & 61440)) + throw new P4(63); + Q3.Qa || (Q3.Qa = { dir: { node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa, lookup: Q3.Ga.lookup, ab: Q3.Ga.ab, rename: Q3.Ga.rename, unlink: Q3.Ga.unlink, rmdir: Q3.Ga.rmdir, readdir: Q3.Ga.readdir, symlink: Q3.Ga.symlink }, stream: { Ta: Q3.Ha.Ta } }, file: { node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa }, stream: { Ta: Q3.Ha.Ta, read: Q3.Ha.read, write: Q3.Ha.write, lb: Q3.Ha.lb, bb: Q3.Ha.bb, cb: Q3.Ha.cb } }, link: { node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa, readlink: Q3.Ga.readlink }, stream: {} }, pb: { + node: { Pa: Q3.Ga.Pa, Oa: Q3.Ga.Oa }, + stream: vb + } }); + c4 = wb(a5, b4, c4, d5); + 16384 === (c4.mode & 61440) ? (c4.Ga = Q3.Qa.dir.node, c4.Ha = Q3.Qa.dir.stream, c4.Ia = {}) : 32768 === (c4.mode & 61440) ? (c4.Ga = Q3.Qa.file.node, c4.Ha = Q3.Qa.file.stream, c4.Ma = 0, c4.Ia = null) : 40960 === (c4.mode & 61440) ? (c4.Ga = Q3.Qa.link.node, c4.Ha = Q3.Qa.link.stream) : 8192 === (c4.mode & 61440) && (c4.Ga = Q3.Qa.pb.node, c4.Ha = Q3.Qa.pb.stream); + c4.timestamp = Date.now(); + a5 && (a5.Ia[b4] = c4, a5.timestamp = c4.timestamp); + return c4; + }, Jb: function(a5) { + return a5.Ia ? a5.Ia.subarray ? a5.Ia.subarray(0, a5.Ma) : new Uint8Array(a5.Ia) : new Uint8Array(0); + }, qb: function(a5, b4) { + var c4 = a5.Ia ? a5.Ia.length : 0; + c4 >= b4 || (b4 = Math.max(b4, c4 * (1048576 > c4 ? 2 : 1.125) >>> 0), 0 != c4 && (b4 = Math.max(b4, 256)), c4 = a5.Ia, a5.Ia = new Uint8Array(b4), 0 < a5.Ma && a5.Ia.set(c4.subarray(0, a5.Ma), 0)); + }, Gb: function(a5, b4) { + if (a5.Ma != b4) + if (0 == b4) + a5.Ia = null, a5.Ma = 0; + else { + var c4 = a5.Ia; + a5.Ia = new Uint8Array(b4); + c4 && a5.Ia.set(c4.subarray(0, Math.min(b4, a5.Ma))); + a5.Ma = b4; + } + }, Ga: { Pa: function(a5) { + var b4 = {}; + b4.dev = 8192 === (a5.mode & 61440) ? a5.id : 1; + b4.ino = a5.id; + b4.mode = a5.mode; + b4.nlink = 1; + b4.uid = 0; + b4.gid = 0; + b4.rdev = a5.rdev; + 16384 === (a5.mode & 61440) ? b4.size = 4096 : 32768 === (a5.mode & 61440) ? b4.size = a5.Ma : 40960 === (a5.mode & 61440) ? b4.size = a5.link.length : b4.size = 0; + b4.atime = new Date(a5.timestamp); + b4.mtime = new Date(a5.timestamp); + b4.ctime = new Date(a5.timestamp); + b4.Ab = 4096; + b4.blocks = Math.ceil(b4.size / b4.Ab); + return b4; + }, Oa: function(a5, b4) { + void 0 !== b4.mode && (a5.mode = b4.mode); + void 0 !== b4.timestamp && (a5.timestamp = b4.timestamp); + void 0 !== b4.size && Q3.Gb(a5, b4.size); + }, lookup: function() { + throw xb[44]; + }, ab: function(a5, b4, c4, d5) { + return Q3.createNode(a5, b4, c4, d5); + }, rename: function(a5, b4, c4) { + if (16384 === (a5.mode & 61440)) { + try { + var d5 = yb(b4, c4); + } catch (h5) { + } + if (d5) + for (var f4 in d5.Ia) + throw new P4(55); + } + delete a5.parent.Ia[a5.name]; + a5.parent.timestamp = Date.now(); + a5.name = c4; + b4.Ia[c4] = a5; + b4.timestamp = a5.parent.timestamp; + a5.parent = b4; + }, unlink: function(a5, b4) { + delete a5.Ia[b4]; + a5.timestamp = Date.now(); + }, rmdir: function(a5, b4) { + var c4 = yb(a5, b4), d5; + for (d5 in c4.Ia) + throw new P4(55); + delete a5.Ia[b4]; + a5.timestamp = Date.now(); + }, readdir: function(a5) { + var b4 = [".", ".."], c4; + for (c4 in a5.Ia) + a5.Ia.hasOwnProperty(c4) && b4.push(c4); + return b4; + }, symlink: function(a5, b4, c4) { + a5 = Q3.createNode(a5, b4, 41471, 0); + a5.link = c4; + return a5; + }, readlink: function(a5) { + if (40960 !== (a5.mode & 61440)) + throw new P4(28); + return a5.link; + } }, Ha: { read: function(a5, b4, c4, d5, f4) { + var h5 = a5.node.Ia; + if (f4 >= a5.node.Ma) + return 0; + a5 = Math.min(a5.node.Ma - f4, d5); + if (8 < a5 && h5.subarray) + b4.set(h5.subarray(f4, f4 + a5), c4); + else + for (d5 = 0; d5 < a5; d5++) + b4[c4 + d5] = h5[f4 + d5]; + return a5; + }, write: function(a5, b4, c4, d5, f4, h5) { + b4.buffer === r3.buffer && (h5 = false); + if (!d5) + return 0; + a5 = a5.node; + a5.timestamp = Date.now(); + if (b4.subarray && (!a5.Ia || a5.Ia.subarray)) { + if (h5) + return a5.Ia = b4.subarray(c4, c4 + d5), a5.Ma = d5; + if (0 === a5.Ma && 0 === f4) + return a5.Ia = b4.slice(c4, c4 + d5), a5.Ma = d5; + if (f4 + d5 <= a5.Ma) + return a5.Ia.set(b4.subarray(c4, c4 + d5), f4), d5; + } + Q3.qb(a5, f4 + d5); + if (a5.Ia.subarray && b4.subarray) + a5.Ia.set(b4.subarray(c4, c4 + d5), f4); + else + for (h5 = 0; h5 < d5; h5++) + a5.Ia[f4 + h5] = b4[c4 + h5]; + a5.Ma = Math.max(a5.Ma, f4 + d5); + return d5; + }, Ta: function(a5, b4, c4) { + 1 === c4 ? b4 += a5.position : 2 === c4 && 32768 === (a5.node.mode & 61440) && (b4 += a5.node.Ma); + if (0 > b4) + throw new P4(28); + return b4; + }, lb: function(a5, b4, c4) { + Q3.qb(a5.node, b4 + c4); + a5.node.Ma = Math.max(a5.node.Ma, b4 + c4); + }, bb: function(a5, b4, c4, d5, f4) { + if (32768 !== (a5.node.mode & 61440)) + throw new P4(43); + a5 = a5.node.Ia; + if (f4 & 2 || a5.buffer !== Na) { + if (0 < c4 || c4 + b4 < a5.length) + a5.subarray ? a5 = a5.subarray(c4, c4 + b4) : a5 = Array.prototype.slice.call( + a5, + c4, + c4 + b4 + ); + c4 = true; + b4 = 65536 * Math.ceil(b4 / 65536); + (f4 = zb(65536, b4)) ? (u4.fill(0, f4, f4 + b4), b4 = f4) : b4 = 0; + if (!b4) + throw new P4(48); + r3.set(a5, b4); + } else + c4 = false, b4 = a5.byteOffset; + return { Fb: b4, vb: c4 }; + }, cb: function(a5, b4, c4, d5, f4) { + if (32768 !== (a5.node.mode & 61440)) + throw new P4(43); + if (f4 & 2) + return 0; + Q3.Ha.write(a5, b4, 0, d5, c4, false); + return 0; + } } }, Ab = null, Bb = {}, R3 = [], Cb = 1, T6 = null, Db = true, P4 = null, xb = {}, U2 = (a5, b4 = {}) => { + a5 = hb("/", a5); + if (!a5) + return { path: "", node: null }; + b4 = Object.assign({ rb: true, kb: 0 }, b4); + if (8 < b4.kb) + throw new P4(32); + a5 = db(a5.split("/").filter((k5) => !!k5), false); + for (var c4 = Ab, d5 = "/", f4 = 0; f4 < a5.length; f4++) { + var h5 = f4 === a5.length - 1; + if (h5 && b4.parent) + break; + c4 = yb(c4, a5[f4]); + d5 = z5(d5 + "/" + a5[f4]); + c4.Va && (!h5 || h5 && b4.rb) && (c4 = c4.Va.root); + if (!h5 || b4.Sa) { + for (h5 = 0; 40960 === (c4.mode & 61440); ) + if (c4 = Eb(d5), d5 = hb(eb(d5), c4), c4 = U2(d5, { kb: b4.kb + 1 }).node, 40 < h5++) + throw new P4(32); + } + } + return { path: d5, node: c4 }; + }, ea = (a5) => { + for (var b4; ; ) { + if (a5 === a5.parent) + return a5 = a5.Ra.ub, b4 ? "/" !== a5[a5.length - 1] ? a5 + "/" + b4 : a5 + b4 : a5; + b4 = b4 ? a5.name + "/" + b4 : a5.name; + a5 = a5.parent; + } + }, Fb = (a5, b4) => { + for (var c4 = 0, d5 = 0; d5 < b4.length; d5++) + c4 = (c4 << 5) - c4 + b4.charCodeAt(d5) | 0; + return (a5 + c4 >>> 0) % T6.length; + }, Gb = (a5) => { + var b4 = Fb(a5.parent.id, a5.name); + if (T6[b4] === a5) + T6[b4] = a5.Wa; + else + for (b4 = T6[b4]; b4; ) { + if (b4.Wa === a5) { + b4.Wa = a5.Wa; + break; + } + b4 = b4.Wa; + } + }, yb = (a5, b4) => { + var c4; + if (c4 = (c4 = Hb(a5, "x")) ? c4 : a5.Ga.lookup ? 0 : 2) + throw new P4(c4, a5); + for (c4 = T6[Fb(a5.id, b4)]; c4; c4 = c4.Wa) { + var d5 = c4.name; + if (c4.parent.id === a5.id && d5 === b4) + return c4; + } + return a5.Ga.lookup(a5, b4); + }, wb = (a5, b4, c4, d5) => { + a5 = new Ib(a5, b4, c4, d5); + b4 = Fb(a5.parent.id, a5.name); + a5.Wa = T6[b4]; + return T6[b4] = a5; + }, Jb = { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }, Kb = (a5) => { + var b4 = ["r", "w", "rw"][a5 & 3]; + a5 & 512 && (b4 += "w"); + return b4; + }, Hb = (a5, b4) => { + if (Db) + return 0; + if (!b4.includes("r") || a5.mode & 292) { + if (b4.includes("w") && !(a5.mode & 146) || b4.includes("x") && !(a5.mode & 73)) + return 2; + } else + return 2; + return 0; + }, Lb = (a5, b4) => { + try { + return yb(a5, b4), 20; + } catch (c4) { + } + return Hb(a5, "wx"); + }, Mb = (a5, b4, c4) => { + try { + var d5 = yb(a5, b4); + } catch (f4) { + return f4.Ka; + } + if (a5 = Hb(a5, "wx")) + return a5; + if (c4) { + if (16384 !== (d5.mode & 61440)) + return 54; + if (d5 === d5.parent || "/" === ea(d5)) + return 10; + } else if (16384 === (d5.mode & 61440)) + return 31; + return 0; + }, Nb = (a5 = 0) => { + for (; 4096 >= a5; a5++) + if (!R3[a5]) + return a5; + throw new P4(33); + }, Pb = (a5, b4) => { + Ob || (Ob = function() { + this.$a = {}; + }, Ob.prototype = {}, Object.defineProperties(Ob.prototype, { object: { get: function() { + return this.node; + }, set: function(c4) { + this.node = c4; + } }, flags: { get: function() { + return this.$a.flags; + }, set: function(c4) { + this.$a.flags = c4; + } }, position: { get: function() { + return this.$a.position; + }, set: function(c4) { + this.$a.position = c4; + } } })); + a5 = Object.assign(new Ob(), a5); + b4 = Nb(b4); + a5.fd = b4; + return R3[b4] = a5; + }, vb = { open: (a5) => { + a5.Ha = Bb[a5.node.rdev].Ha; + a5.Ha.open && a5.Ha.open(a5); + }, Ta: () => { + throw new P4(70); + } }, lb = (a5, b4) => { + Bb[a5] = { Ha: b4 }; + }, Qb = (a5, b4) => { + var c4 = "/" === b4, d5 = !b4; + if (c4 && Ab) + throw new P4(10); + if (!c4 && !d5) { + var f4 = U2(b4, { rb: false }); + b4 = f4.path; + f4 = f4.node; + if (f4.Va) + throw new P4(10); + if (16384 !== (f4.mode & 61440)) + throw new P4(54); + } + b4 = { type: a5, Kb: {}, ub: b4, Eb: [] }; + a5 = a5.Ra(b4); + a5.Ra = b4; + b4.root = a5; + c4 ? Ab = a5 : f4 && (f4.Va = b4, f4.Ra && f4.Ra.Eb.push(b4)); + }, ha = (a5, b4, c4) => { + var d5 = U2(a5, { parent: true }).node; + a5 = fb(a5); + if (!a5 || "." === a5 || ".." === a5) + throw new P4(28); + var f4 = Lb(d5, a5); + if (f4) + throw new P4(f4); + if (!d5.Ga.ab) + throw new P4(63); + return d5.Ga.ab(d5, a5, b4, c4); + }, V3 = (a5, b4) => ha(a5, (void 0 !== b4 ? b4 : 511) & 1023 | 16384, 0), Rb = (a5, b4, c4) => { + "undefined" == typeof c4 && (c4 = b4, b4 = 438); + ha(a5, b4 | 8192, c4); + }, Sb = (a5, b4) => { + if (!hb(a5)) + throw new P4(44); + var c4 = U2(b4, { parent: true }).node; + if (!c4) + throw new P4(44); + b4 = fb(b4); + var d5 = Lb(c4, b4); + if (d5) + throw new P4(d5); + if (!c4.Ga.symlink) + throw new P4(63); + c4.Ga.symlink(c4, b4, a5); + }, Tb = (a5) => { + var b4 = U2(a5, { parent: true }).node; + a5 = fb(a5); + var c4 = yb(b4, a5), d5 = Mb(b4, a5, true); + if (d5) + throw new P4(d5); + if (!b4.Ga.rmdir) + throw new P4(63); + if (c4.Va) + throw new P4(10); + b4.Ga.rmdir(b4, a5); + Gb(c4); + }, ta = (a5) => { + var b4 = U2(a5, { parent: true }).node; + if (!b4) + throw new P4(44); + a5 = fb(a5); + var c4 = yb(b4, a5), d5 = Mb(b4, a5, false); + if (d5) + throw new P4(d5); + if (!b4.Ga.unlink) + throw new P4(63); + if (c4.Va) + throw new P4(10); + b4.Ga.unlink(b4, a5); + Gb(c4); + }, Eb = (a5) => { + a5 = U2(a5).node; + if (!a5) + throw new P4(44); + if (!a5.Ga.readlink) + throw new P4(28); + return hb(ea(a5.parent), a5.Ga.readlink(a5)); + }, Ub = (a5, b4) => { + a5 = U2(a5, { Sa: !b4 }).node; + if (!a5) + throw new P4(44); + if (!a5.Ga.Pa) + throw new P4(63); + return a5.Ga.Pa(a5); + }, Vb = (a5) => Ub(a5, true), ia = (a5, b4) => { + a5 = "string" == typeof a5 ? U2(a5, { Sa: true }).node : a5; + if (!a5.Ga.Oa) + throw new P4(63); + a5.Ga.Oa(a5, { mode: b4 & 4095 | a5.mode & -4096, timestamp: Date.now() }); + }, Wb = (a5, b4) => { + if (0 > b4) + throw new P4(28); + a5 = "string" == typeof a5 ? U2(a5, { Sa: true }).node : a5; + if (!a5.Ga.Oa) + throw new P4(63); + if (16384 === (a5.mode & 61440)) + throw new P4(31); + if (32768 !== (a5.mode & 61440)) + throw new P4(28); + var c4 = Hb(a5, "w"); + if (c4) + throw new P4(c4); + a5.Ga.Oa(a5, { size: b4, timestamp: Date.now() }); + }, ja = (a5, b4, c4) => { + if ("" === a5) + throw new P4(44); + if ("string" == typeof b4) { + var d5 = Jb[b4]; + if ("undefined" == typeof d5) + throw Error("Unknown file open mode: " + b4); + b4 = d5; + } + c4 = b4 & 64 ? ("undefined" == typeof c4 ? 438 : c4) & 4095 | 32768 : 0; + if ("object" == typeof a5) + var f4 = a5; + else { + a5 = z5(a5); + try { + f4 = U2(a5, { Sa: !(b4 & 131072) }).node; + } catch (h5) { + } + } + d5 = false; + if (b4 & 64) + if (f4) { + if (b4 & 128) + throw new P4(20); + } else + f4 = ha(a5, c4, 0), d5 = true; + if (!f4) + throw new P4(44); + 8192 === (f4.mode & 61440) && (b4 &= -513); + if (b4 & 65536 && 16384 !== (f4.mode & 61440)) + throw new P4(54); + if (!d5 && (c4 = f4 ? 40960 === (f4.mode & 61440) ? 32 : 16384 === (f4.mode & 61440) && ("r" !== Kb(b4) || b4 & 512) ? 31 : Hb(f4, Kb(b4)) : 44)) + throw new P4(c4); + b4 & 512 && !d5 && Wb(f4, 0); + b4 &= -131713; + f4 = Pb({ node: f4, path: ea(f4), flags: b4, seekable: true, position: 0, Ha: f4.Ha, Ib: [], error: false }); + f4.Ha.open && f4.Ha.open(f4); + !e4.logReadFiles || b4 & 1 || (Xb || (Xb = {}), a5 in Xb || (Xb[a5] = 1)); + return f4; + }, la = (a5) => { + if (null === a5.fd) + throw new P4(8); + a5.hb && (a5.hb = null); + try { + a5.Ha.close && a5.Ha.close(a5); + } catch (b4) { + throw b4; + } finally { + R3[a5.fd] = null; + } + a5.fd = null; + }, Yb = (a5, b4, c4) => { + if (null === a5.fd) + throw new P4(8); + if (!a5.seekable || !a5.Ha.Ta) + throw new P4(70); + if (0 != c4 && 1 != c4 && 2 != c4) + throw new P4(28); + a5.position = a5.Ha.Ta(a5, b4, c4); + a5.Ib = []; + }, Zb = (a5, b4, c4, d5, f4) => { + if (0 > d5 || 0 > f4) + throw new P4(28); + if (null === a5.fd) + throw new P4(8); + if (1 === (a5.flags & 2097155)) + throw new P4(8); + if (16384 === (a5.node.mode & 61440)) + throw new P4(31); + if (!a5.Ha.read) + throw new P4(28); + var h5 = "undefined" != typeof f4; + if (!h5) + f4 = a5.position; + else if (!a5.seekable) + throw new P4(70); + b4 = a5.Ha.read(a5, b4, c4, d5, f4); + h5 || (a5.position += b4); + return b4; + }, ka = (a5, b4, c4, d5, f4) => { + if (0 > d5 || 0 > f4) + throw new P4(28); + if (null === a5.fd) + throw new P4(8); + if (0 === (a5.flags & 2097155)) + throw new P4(8); + if (16384 === (a5.node.mode & 61440)) + throw new P4(31); + if (!a5.Ha.write) + throw new P4(28); + a5.seekable && a5.flags & 1024 && Yb(a5, 0, 2); + var h5 = "undefined" != typeof f4; + if (!h5) + f4 = a5.position; + else if (!a5.seekable) + throw new P4(70); + b4 = a5.Ha.write(a5, b4, c4, d5, f4, void 0); + h5 || (a5.position += b4); + return b4; + }, sa = (a5) => { + var b4 = "binary"; + if ("utf8" !== b4 && "binary" !== b4) + throw Error('Invalid encoding type "' + b4 + '"'); + var c4; + var d5 = ja(a5, d5 || 0); + a5 = Ub(a5).size; + var f4 = new Uint8Array(a5); + Zb(d5, f4, 0, a5, 0); + "utf8" === b4 ? c4 = Ma(f4, 0) : "binary" === b4 && (c4 = f4); + la(d5); + return c4; + }, $b = () => { + P4 || (P4 = function(a5, b4) { + this.node = b4; + this.Hb = function(c4) { + this.Ka = c4; + }; + this.Hb(a5); + this.message = "FS error"; + }, P4.prototype = Error(), P4.prototype.constructor = P4, [44].forEach((a5) => { + xb[a5] = new P4(a5); + xb[a5].stack = ""; + })); + }, ac, fa = (a5, b4) => { + var c4 = 0; + a5 && (c4 |= 365); + b4 && (c4 |= 146); + return c4; + }, cc = (a5, b4, c4) => { + a5 = z5("/dev/" + a5); + var d5 = fa(!!b4, !!c4); + bc || (bc = 64); + var f4 = bc++ << 8 | 0; + lb(f4, { open: (h5) => { + h5.seekable = false; + }, close: () => { + c4 && c4.buffer && c4.buffer.length && c4(10); + }, read: (h5, k5, q5, x5) => { + for (var w5 = 0, A4 = 0; A4 < x5; A4++) { + try { + var S4 = b4(); + } catch (nb) { + throw new P4(29); + } + if (void 0 === S4 && 0 === w5) + throw new P4(6); + if (null === S4 || void 0 === S4) + break; + w5++; + k5[q5 + A4] = S4; + } + w5 && (h5.node.timestamp = Date.now()); + return w5; + }, write: (h5, k5, q5, x5) => { + for (var w5 = 0; w5 < x5; w5++) + try { + c4(k5[q5 + w5]); + } catch (A4) { + throw new P4(29); + } + x5 && (h5.node.timestamp = Date.now()); + return w5; + } }); + Rb(a5, d5, f4); + }, bc, W2 = {}, Ob, Xb; + function dc(a5, b4, c4) { + if ("/" === b4.charAt(0)) + return b4; + a5 = -100 === a5 ? "/" : X3(a5).path; + if (0 == b4.length) { + if (!c4) + throw new P4(44); + return a5; + } + return z5(a5 + "/" + b4); + } + function ec(a5, b4, c4) { + try { + var d5 = a5(b4); + } catch (f4) { + if (f4 && f4.node && z5(b4) !== z5(ea(f4.node))) + return -54; + throw f4; + } + F4[c4 >> 2] = d5.dev; + F4[c4 + 8 >> 2] = d5.ino; + F4[c4 + 12 >> 2] = d5.mode; + J2[c4 + 16 >> 2] = d5.nlink; + F4[c4 + 20 >> 2] = d5.uid; + F4[c4 + 24 >> 2] = d5.gid; + F4[c4 + 28 >> 2] = d5.rdev; + O4 = [d5.size >>> 0, (N3 = d5.size, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; + F4[c4 + 40 >> 2] = O4[0]; + F4[c4 + 44 >> 2] = O4[1]; + F4[c4 + 48 >> 2] = 4096; + F4[c4 + 52 >> 2] = d5.blocks; + O4 = [Math.floor(d5.atime.getTime() / 1e3) >>> 0, (N3 = Math.floor(d5.atime.getTime() / 1e3), 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; + F4[c4 + 56 >> 2] = O4[0]; + F4[c4 + 60 >> 2] = O4[1]; + J2[c4 + 64 >> 2] = 0; + O4 = [Math.floor(d5.mtime.getTime() / 1e3) >>> 0, (N3 = Math.floor(d5.mtime.getTime() / 1e3), 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; + F4[c4 + 72 >> 2] = O4[0]; + F4[c4 + 76 >> 2] = O4[1]; + J2[c4 + 80 >> 2] = 0; + O4 = [Math.floor(d5.ctime.getTime() / 1e3) >>> 0, (N3 = Math.floor(d5.ctime.getTime() / 1e3), 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; + F4[c4 + 88 >> 2] = O4[0]; + F4[c4 + 92 >> 2] = O4[1]; + J2[c4 + 96 >> 2] = 0; + O4 = [d5.ino >>> 0, (N3 = d5.ino, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; + F4[c4 + 104 >> 2] = O4[0]; + F4[c4 + 108 >> 2] = O4[1]; + return 0; + } + var fc = void 0; + function Hc() { + fc += 4; + return F4[fc - 4 >> 2]; + } + function X3(a5) { + a5 = R3[a5]; + if (!a5) + throw new P4(8); + return a5; + } + function Jc(a5) { + return J2[a5 >> 2] + 4294967296 * F4[a5 + 4 >> 2]; + } + function Kc(a5) { + var b4 = ca(a5) + 1, c4 = da(b4); + c4 && t4(a5, r3, c4, b4); + return c4; + } + function Lc(a5, b4, c4) { + function d5(x5) { + return (x5 = x5.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? x5[1] : "GMT"; + } + var f4 = new Date().getFullYear(), h5 = new Date(f4, 0, 1), k5 = new Date(f4, 6, 1); + f4 = h5.getTimezoneOffset(); + var q5 = k5.getTimezoneOffset(); + F4[a5 >> 2] = 60 * Math.max(f4, q5); + F4[b4 >> 2] = Number(f4 != q5); + a5 = d5(h5); + b4 = d5(k5); + a5 = Kc(a5); + b4 = Kc(b4); + q5 < f4 ? (J2[c4 >> 2] = a5, J2[c4 + 4 >> 2] = b4) : (J2[c4 >> 2] = b4, J2[c4 + 4 >> 2] = a5); + } + function Mc(a5, b4, c4) { + Mc.Bb || (Mc.Bb = true, Lc(a5, b4, c4)); + } + var Nc; + Nc = Aa ? () => { + var a5 = process.hrtime(); + return 1e3 * a5[0] + a5[1] / 1e6; + } : () => performance.now(); + var Oc = {}; + function Pc() { + if (!Qc) { + var a5 = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: wa || "./this.program" }, b4; + for (b4 in Oc) + void 0 === Oc[b4] ? delete a5[b4] : a5[b4] = Oc[b4]; + var c4 = []; + for (b4 in a5) + c4.push(b4 + "=" + a5[b4]); + Qc = c4; + } + return Qc; + } + var Qc, Y3 = void 0, Rc = []; + function ua(a5, b4) { + if (!Y3) { + Y3 = /* @__PURE__ */ new WeakMap(); + var c4 = K3.length; + if (Y3) + for (var d5 = 0; d5 < 0 + c4; d5++) { + var f4 = K3.get(d5); + f4 && Y3.set(f4, d5); + } + } + if (Y3.has(a5)) + return Y3.get(a5); + if (Rc.length) + c4 = Rc.pop(); + else { + try { + K3.grow(1); + } catch (q5) { + if (!(q5 instanceof RangeError)) + throw q5; + throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."; + } + c4 = K3.length - 1; + } + try { + K3.set(c4, a5); + } catch (q5) { + if (!(q5 instanceof TypeError)) + throw q5; + if ("function" == typeof WebAssembly.Function) { + d5 = WebAssembly.Function; + f4 = { i: "i32", j: "i64", f: "f32", d: "f64", p: "i32" }; + for (var h5 = { parameters: [], results: "v" == b4[0] ? [] : [f4[b4[0]]] }, k5 = 1; k5 < b4.length; ++k5) + h5.parameters.push(f4[b4[k5]]); + b4 = new d5(h5, a5); + } else { + d5 = [1, 96]; + f4 = b4.slice(0, 1); + b4 = b4.slice(1); + h5 = { i: 127, p: 127, j: 126, f: 125, d: 124 }; + k5 = b4.length; + 128 > k5 ? d5.push(k5) : d5.push(k5 % 128 | 128, k5 >> 7); + for (k5 = 0; k5 < b4.length; ++k5) + d5.push(h5[b4[k5]]); + "v" == f4 ? d5.push(0) : d5.push(1, h5[f4]); + b4 = [0, 97, 115, 109, 1, 0, 0, 0, 1]; + f4 = d5.length; + 128 > f4 ? b4.push(f4) : b4.push(f4 % 128 | 128, f4 >> 7); + b4.push.apply(b4, d5); + b4.push(2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0); + b4 = new WebAssembly.Module(new Uint8Array(b4)); + b4 = new WebAssembly.Instance(b4, { e: { f: a5 } }).exports.f; + } + K3.set( + c4, + b4 + ); + } + Y3.set(a5, c4); + return c4; + } + function ra(a5) { + Y3.delete(K3.get(a5)); + Rc.push(a5); + } + var Sc = 0, Tc = 1; + function aa(a5) { + var b4 = Sc == Tc ? B5(a5.length) : da(a5.length); + a5.subarray || a5.slice || (a5 = new Uint8Array(a5)); + u4.set(a5, b4); + return b4; + } + function Uc(a5, b4, c4, d5) { + var f4 = { string: (w5) => { + var A4 = 0; + if (null !== w5 && void 0 !== w5 && 0 !== w5) { + var S4 = (w5.length << 2) + 1; + A4 = B5(S4); + t4(w5, u4, A4, S4); + } + return A4; + }, array: (w5) => { + var A4 = B5(w5.length); + r3.set(w5, A4); + return A4; + } }; + a5 = e4["_" + a5]; + var h5 = [], k5 = 0; + if (d5) + for (var q5 = 0; q5 < d5.length; q5++) { + var x5 = f4[c4[q5]]; + x5 ? (0 === k5 && (k5 = oa()), h5[q5] = x5(d5[q5])) : h5[q5] = d5[q5]; + } + c4 = a5.apply(null, h5); + return c4 = function(w5) { + 0 !== k5 && qa(k5); + return "string" === b4 ? C3(w5) : "boolean" === b4 ? !!w5 : w5; + }(c4); + } + function Ib(a5, b4, c4, d5) { + a5 || (a5 = this); + this.parent = a5; + this.Ra = a5.Ra; + this.Va = null; + this.id = Cb++; + this.name = b4; + this.mode = c4; + this.Ga = {}; + this.Ha = {}; + this.rdev = d5; + } + Object.defineProperties(Ib.prototype, { read: { get: function() { + return 365 === (this.mode & 365); + }, set: function(a5) { + a5 ? this.mode |= 365 : this.mode &= -366; + } }, write: { get: function() { + return 146 === (this.mode & 146); + }, set: function(a5) { + a5 ? this.mode |= 146 : this.mode &= -147; + } } }); + $b(); + T6 = Array(4096); + Qb(Q3, "/"); + V3("/tmp"); + V3("/home"); + V3("/home/web_user"); + (() => { + V3("/dev"); + lb(259, { read: () => 0, write: (b4, c4, d5, f4) => f4 }); + Rb("/dev/null", 259); + jb(1280, tb); + jb(1536, ub); + Rb("/dev/tty", 1280); + Rb("/dev/tty1", 1536); + var a5 = gb(); + cc("random", a5); + cc("urandom", a5); + V3("/dev/shm"); + V3("/dev/shm/tmp"); + })(); + (() => { + V3("/proc"); + var a5 = V3("/proc/self"); + V3("/proc/self/fd"); + Qb({ Ra: () => { + var b4 = wb(a5, "fd", 16895, 73); + b4.Ga = { lookup: (c4, d5) => { + var f4 = R3[+d5]; + if (!f4) + throw new P4(8); + c4 = { parent: null, Ra: { ub: "fake" }, Ga: { readlink: () => f4.path } }; + return c4.parent = c4; + } }; + return b4; + } }, "/proc/self/fd"); + })(); + var Wc = { a: function(a5, b4, c4, d5) { + E4("Assertion failed: " + C3(a5) + ", at: " + [b4 ? C3(b4) : "unknown filename", c4, d5 ? C3(d5) : "unknown function"]); + }, h: function(a5, b4) { + try { + return a5 = C3(a5), ia(a5, b4), 0; + } catch (c4) { + if ("undefined" == typeof W2 || !(c4 instanceof P4)) + throw c4; + return -c4.Ka; + } + }, H: function(a5, b4, c4) { + try { + b4 = C3(b4); + b4 = dc(a5, b4); + if (c4 & -8) + return -28; + var d5 = U2(b4, { Sa: true }).node; + if (!d5) + return -44; + a5 = ""; + c4 & 4 && (a5 += "r"); + c4 & 2 && (a5 += "w"); + c4 & 1 && (a5 += "x"); + return a5 && Hb(d5, a5) ? -2 : 0; + } catch (f4) { + if ("undefined" == typeof W2 || !(f4 instanceof P4)) + throw f4; + return -f4.Ka; + } + }, i: function(a5, b4) { + try { + var c4 = R3[a5]; + if (!c4) + throw new P4(8); + ia(c4.node, b4); + return 0; + } catch (d5) { + if ("undefined" == typeof W2 || !(d5 instanceof P4)) + throw d5; + return -d5.Ka; + } + }, g: function(a5) { + try { + var b4 = R3[a5]; + if (!b4) + throw new P4(8); + var c4 = b4.node; + var d5 = "string" == typeof c4 ? U2(c4, { Sa: true }).node : c4; + if (!d5.Ga.Oa) + throw new P4(63); + d5.Ga.Oa(d5, { timestamp: Date.now() }); + return 0; + } catch (f4) { + if ("undefined" == typeof W2 || !(f4 instanceof P4)) + throw f4; + return -f4.Ka; + } + }, b: function(a5, b4, c4) { + fc = c4; + try { + var d5 = X3(a5); + switch (b4) { + case 0: + var f4 = Hc(); + return 0 > f4 ? -28 : Pb(d5, f4).fd; + case 1: + case 2: + return 0; + case 3: + return d5.flags; + case 4: + return f4 = Hc(), d5.flags |= f4, 0; + case 5: + return f4 = Hc(), Oa[f4 + 0 >> 1] = 2, 0; + case 6: + case 7: + return 0; + case 16: + case 8: + return -28; + case 9: + return F4[Vc() >> 2] = 28, -1; + default: + return -28; + } + } catch (h5) { + if ("undefined" == typeof W2 || !(h5 instanceof P4)) + throw h5; + return -h5.Ka; + } + }, G: function(a5, b4) { + try { + var c4 = X3(a5); + return ec(Ub, c4.path, b4); + } catch (d5) { + if ("undefined" == typeof W2 || !(d5 instanceof P4)) + throw d5; + return -d5.Ka; + } + }, l: function(a5, b4, c4) { + try { + b4 = c4 + 2097152 >>> 0 < 4194305 - !!b4 ? (b4 >>> 0) + 4294967296 * c4 : NaN; + if (isNaN(b4)) + return -61; + var d5 = R3[a5]; + if (!d5) + throw new P4(8); + if (0 === (d5.flags & 2097155)) + throw new P4(28); + Wb(d5.node, b4); + return 0; + } catch (f4) { + if ("undefined" == typeof W2 || !(f4 instanceof P4)) + throw f4; + return -f4.Ka; + } + }, B: function(a5, b4) { + try { + if (0 === b4) + return -28; + var c4 = ca("/") + 1; + if (b4 < c4) + return -68; + t4("/", u4, a5, b4); + return c4; + } catch (d5) { + if ("undefined" == typeof W2 || !(d5 instanceof P4)) + throw d5; + return -d5.Ka; + } + }, E: function(a5, b4) { + try { + return a5 = C3(a5), ec(Vb, a5, b4); + } catch (c4) { + if ("undefined" == typeof W2 || !(c4 instanceof P4)) + throw c4; + return -c4.Ka; + } + }, y: function(a5, b4, c4) { + try { + return b4 = C3(b4), b4 = dc(a5, b4), b4 = z5(b4), "/" === b4[b4.length - 1] && (b4 = b4.substr(0, b4.length - 1)), V3(b4, c4), 0; + } catch (d5) { + if ("undefined" == typeof W2 || !(d5 instanceof P4)) + throw d5; + return -d5.Ka; + } + }, D: function(a5, b4, c4, d5) { + try { + b4 = C3(b4); + var f4 = d5 & 256; + b4 = dc(a5, b4, d5 & 4096); + return ec(f4 ? Vb : Ub, b4, c4); + } catch (h5) { + if ("undefined" == typeof W2 || !(h5 instanceof P4)) + throw h5; + return -h5.Ka; + } + }, v: function(a5, b4, c4, d5) { + fc = d5; + try { + b4 = C3(b4); + b4 = dc(a5, b4); + var f4 = d5 ? Hc() : 0; + return ja(b4, c4, f4).fd; + } catch (h5) { + if ("undefined" == typeof W2 || !(h5 instanceof P4)) + throw h5; + return -h5.Ka; + } + }, t: function(a5, b4, c4, d5) { + try { + b4 = C3(b4); + b4 = dc(a5, b4); + if (0 >= d5) + return -28; + var f4 = Eb(b4), h5 = Math.min( + d5, + ca(f4) + ), k5 = r3[c4 + h5]; + t4(f4, u4, c4, d5 + 1); + r3[c4 + h5] = k5; + return h5; + } catch (q5) { + if ("undefined" == typeof W2 || !(q5 instanceof P4)) + throw q5; + return -q5.Ka; + } + }, s: function(a5) { + try { + return a5 = C3(a5), Tb(a5), 0; + } catch (b4) { + if ("undefined" == typeof W2 || !(b4 instanceof P4)) + throw b4; + return -b4.Ka; + } + }, F: function(a5, b4) { + try { + return a5 = C3(a5), ec(Ub, a5, b4); + } catch (c4) { + if ("undefined" == typeof W2 || !(c4 instanceof P4)) + throw c4; + return -c4.Ka; + } + }, p: function(a5, b4, c4) { + try { + return b4 = C3(b4), b4 = dc(a5, b4), 0 === c4 ? ta(b4) : 512 === c4 ? Tb(b4) : E4("Invalid flags passed to unlinkat"), 0; + } catch (d5) { + if ("undefined" == typeof W2 || !(d5 instanceof P4)) + throw d5; + return -d5.Ka; + } + }, o: function(a5, b4, c4) { + try { + b4 = C3(b4); + b4 = dc(a5, b4, true); + if (c4) { + var d5 = Jc(c4), f4 = F4[c4 + 8 >> 2]; + h5 = 1e3 * d5 + f4 / 1e6; + c4 += 16; + d5 = Jc(c4); + f4 = F4[c4 + 8 >> 2]; + k5 = 1e3 * d5 + f4 / 1e6; + } else + var h5 = Date.now(), k5 = h5; + a5 = h5; + var q5 = U2(b4, { Sa: true }).node; + q5.Ga.Oa(q5, { timestamp: Math.max(a5, k5) }); + return 0; + } catch (x5) { + if ("undefined" == typeof W2 || !(x5 instanceof P4)) + throw x5; + return -x5.Ka; + } + }, e: function() { + return Date.now(); + }, j: function(a5, b4) { + a5 = new Date(1e3 * Jc(a5)); + F4[b4 >> 2] = a5.getSeconds(); + F4[b4 + 4 >> 2] = a5.getMinutes(); + F4[b4 + 8 >> 2] = a5.getHours(); + F4[b4 + 12 >> 2] = a5.getDate(); + F4[b4 + 16 >> 2] = a5.getMonth(); + F4[b4 + 20 >> 2] = a5.getFullYear() - 1900; + F4[b4 + 24 >> 2] = a5.getDay(); + var c4 = new Date(a5.getFullYear(), 0, 1); + F4[b4 + 28 >> 2] = (a5.getTime() - c4.getTime()) / 864e5 | 0; + F4[b4 + 36 >> 2] = -(60 * a5.getTimezoneOffset()); + var d5 = new Date(a5.getFullYear(), 6, 1).getTimezoneOffset(); + c4 = c4.getTimezoneOffset(); + F4[b4 + 32 >> 2] = (d5 != c4 && a5.getTimezoneOffset() == Math.min(c4, d5)) | 0; + }, w: function(a5, b4, c4, d5, f4, h5) { + try { + var k5 = X3(d5); + if (0 !== (b4 & 2) && 0 === (c4 & 2) && 2 !== (k5.flags & 2097155)) + throw new P4(2); + if (1 === (k5.flags & 2097155)) + throw new P4(2); + if (!k5.Ha.bb) + throw new P4(43); + var q5 = k5.Ha.bb(k5, a5, f4, b4, c4); + var x5 = q5.Fb; + F4[h5 >> 2] = q5.vb; + return x5; + } catch (w5) { + if ("undefined" == typeof W2 || !(w5 instanceof P4)) + throw w5; + return -w5.Ka; + } + }, x: function(a5, b4, c4, d5, f4, h5) { + try { + var k5 = X3(f4); + if (c4 & 2) { + var q5 = u4.slice(a5, a5 + b4); + k5 && k5.Ha.cb && k5.Ha.cb(k5, q5, h5, b4, d5); + } + } catch (x5) { + if ("undefined" == typeof W2 || !(x5 instanceof P4)) + throw x5; + return -x5.Ka; + } + }, n: Mc, q: function() { + return 2147483648; + }, d: Nc, c: function(a5) { + var b4 = u4.length; + a5 >>>= 0; + if (2147483648 < a5) + return false; + for (var c4 = 1; 4 >= c4; c4 *= 2) { + var d5 = b4 * (1 + 0.2 / c4); + d5 = Math.min(d5, a5 + 100663296); + var f4 = Math; + d5 = Math.max( + a5, + d5 + ); + f4 = f4.min.call(f4, 2147483648, d5 + (65536 - d5 % 65536) % 65536); + a: { + try { + Ja.grow(f4 - Na.byteLength + 65535 >>> 16); + Ra(); + var h5 = 1; + break a; + } catch (k5) { + } + h5 = void 0; + } + if (h5) + return true; + } + return false; + }, z: function(a5, b4) { + var c4 = 0; + Pc().forEach(function(d5, f4) { + var h5 = b4 + c4; + f4 = J2[a5 + 4 * f4 >> 2] = h5; + for (h5 = 0; h5 < d5.length; ++h5) + r3[f4++ >> 0] = d5.charCodeAt(h5); + r3[f4 >> 0] = 0; + c4 += d5.length + 1; + }); + return 0; + }, A: function(a5, b4) { + var c4 = Pc(); + J2[a5 >> 2] = c4.length; + var d5 = 0; + c4.forEach(function(f4) { + d5 += f4.length + 1; + }); + J2[b4 >> 2] = d5; + return 0; + }, f: function(a5) { + try { + var b4 = X3(a5); + la(b4); + return 0; + } catch (c4) { + if ("undefined" == typeof W2 || !(c4 instanceof P4)) + throw c4; + return c4.Ka; + } + }, m: function(a5, b4) { + try { + var c4 = X3(a5); + r3[b4 >> 0] = c4.tty ? 2 : 16384 === (c4.mode & 61440) ? 3 : 40960 === (c4.mode & 61440) ? 7 : 4; + return 0; + } catch (d5) { + if ("undefined" == typeof W2 || !(d5 instanceof P4)) + throw d5; + return d5.Ka; + } + }, u: function(a5, b4, c4, d5) { + try { + a: { + var f4 = X3(a5); + a5 = b4; + for (var h5 = b4 = 0; h5 < c4; h5++) { + var k5 = J2[a5 >> 2], q5 = J2[a5 + 4 >> 2]; + a5 += 8; + var x5 = Zb(f4, r3, k5, q5); + if (0 > x5) { + var w5 = -1; + break a; + } + b4 += x5; + if (x5 < q5) + break; + } + w5 = b4; + } + J2[d5 >> 2] = w5; + return 0; + } catch (A4) { + if ("undefined" == typeof W2 || !(A4 instanceof P4)) + throw A4; + return A4.Ka; + } + }, k: function(a5, b4, c4, d5, f4) { + try { + b4 = c4 + 2097152 >>> 0 < 4194305 - !!b4 ? (b4 >>> 0) + 4294967296 * c4 : NaN; + if (isNaN(b4)) + return 61; + var h5 = X3(a5); + Yb(h5, b4, d5); + O4 = [h5.position >>> 0, (N3 = h5.position, 1 <= +Math.abs(N3) ? 0 < N3 ? (Math.min(+Math.floor(N3 / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((N3 - +(~~N3 >>> 0)) / 4294967296) >>> 0 : 0)]; + F4[f4 >> 2] = O4[0]; + F4[f4 + 4 >> 2] = O4[1]; + h5.hb && 0 === b4 && 0 === d5 && (h5.hb = null); + return 0; + } catch (k5) { + if ("undefined" == typeof W2 || !(k5 instanceof P4)) + throw k5; + return k5.Ka; + } + }, C: function(a5) { + try { + var b4 = X3(a5); + return b4.Ha && b4.Ha.fsync ? b4.Ha.fsync(b4) : 0; + } catch (c4) { + if ("undefined" == typeof W2 || !(c4 instanceof P4)) + throw c4; + return c4.Ka; + } + }, r: function(a5, b4, c4, d5) { + try { + a: { + var f4 = X3(a5); + a5 = b4; + for (var h5 = b4 = 0; h5 < c4; h5++) { + var k5 = J2[a5 >> 2], q5 = J2[a5 + 4 >> 2]; + a5 += 8; + var x5 = ka(f4, r3, k5, q5); + if (0 > x5) { + var w5 = -1; + break a; + } + b4 += x5; + } + w5 = b4; + } + J2[d5 >> 2] = w5; + return 0; + } catch (A4) { + if ("undefined" == typeof W2 || !(A4 instanceof P4)) + throw A4; + return A4.Ka; + } + } }; + (function() { + function a5(f4) { + e4.asm = f4.exports; + Ja = e4.asm.I; + Ra(); + K3 = e4.asm.Aa; + Ta.unshift(e4.asm.J); + Wa--; + e4.monitorRunDependencies && e4.monitorRunDependencies(Wa); + 0 == Wa && (null !== Xa && (clearInterval(Xa), Xa = null), Ya && (f4 = Ya, Ya = null, f4())); + } + function b4(f4) { + a5(f4.instance); + } + function c4(f4) { + return bb().then(function(h5) { + return WebAssembly.instantiate(h5, d5); + }).then(function(h5) { + return h5; + }).then(f4, function(h5) { + Ha("failed to asynchronously prepare wasm: " + h5); + E4(h5); + }); + } + var d5 = { a: Wc }; + Wa++; + e4.monitorRunDependencies && e4.monitorRunDependencies(Wa); + if (e4.instantiateWasm) + try { + return e4.instantiateWasm(d5, a5); + } catch (f4) { + return Ha("Module.instantiateWasm callback failed with error: " + f4), false; + } + (function() { + return Ia || "function" != typeof WebAssembly.instantiateStreaming || Za() || M5.startsWith("file://") || Aa || "function" != typeof fetch ? c4(b4) : fetch(M5, { credentials: "same-origin" }).then(function(f4) { + return WebAssembly.instantiateStreaming(f4, d5).then(b4, function(h5) { + Ha("wasm streaming compile failed: " + h5); + Ha("falling back to ArrayBuffer instantiation"); + return c4(b4); + }); + }); + })(); + return {}; + })(); + e4.___wasm_call_ctors = function() { + return (e4.___wasm_call_ctors = e4.asm.J).apply(null, arguments); + }; + e4._sqlite3_free = function() { + return (e4._sqlite3_free = e4.asm.K).apply(null, arguments); + }; + e4._sqlite3_value_double = function() { + return (e4._sqlite3_value_double = e4.asm.L).apply(null, arguments); + }; + e4._sqlite3_value_text = function() { + return (e4._sqlite3_value_text = e4.asm.M).apply(null, arguments); + }; + var Vc = e4.___errno_location = function() { + return (Vc = e4.___errno_location = e4.asm.N).apply(null, arguments); + }; + e4._sqlite3_prepare_v2 = function() { + return (e4._sqlite3_prepare_v2 = e4.asm.O).apply(null, arguments); + }; + e4._sqlite3_step = function() { + return (e4._sqlite3_step = e4.asm.P).apply(null, arguments); + }; + e4._sqlite3_finalize = function() { + return (e4._sqlite3_finalize = e4.asm.Q).apply(null, arguments); + }; + e4._sqlite3_reset = function() { + return (e4._sqlite3_reset = e4.asm.R).apply(null, arguments); + }; + e4._sqlite3_value_int = function() { + return (e4._sqlite3_value_int = e4.asm.S).apply(null, arguments); + }; + e4._sqlite3_clear_bindings = function() { + return (e4._sqlite3_clear_bindings = e4.asm.T).apply(null, arguments); + }; + e4._sqlite3_value_blob = function() { + return (e4._sqlite3_value_blob = e4.asm.U).apply(null, arguments); + }; + e4._sqlite3_value_bytes = function() { + return (e4._sqlite3_value_bytes = e4.asm.V).apply(null, arguments); + }; + e4._sqlite3_value_type = function() { + return (e4._sqlite3_value_type = e4.asm.W).apply(null, arguments); + }; + e4._sqlite3_result_blob = function() { + return (e4._sqlite3_result_blob = e4.asm.X).apply(null, arguments); + }; + e4._sqlite3_result_double = function() { + return (e4._sqlite3_result_double = e4.asm.Y).apply(null, arguments); + }; + e4._sqlite3_result_error = function() { + return (e4._sqlite3_result_error = e4.asm.Z).apply(null, arguments); + }; + e4._sqlite3_result_int = function() { + return (e4._sqlite3_result_int = e4.asm._).apply(null, arguments); + }; + e4._sqlite3_result_int64 = function() { + return (e4._sqlite3_result_int64 = e4.asm.$).apply(null, arguments); + }; + e4._sqlite3_result_null = function() { + return (e4._sqlite3_result_null = e4.asm.aa).apply(null, arguments); + }; + e4._sqlite3_result_text = function() { + return (e4._sqlite3_result_text = e4.asm.ba).apply(null, arguments); + }; + e4._sqlite3_sql = function() { + return (e4._sqlite3_sql = e4.asm.ca).apply(null, arguments); + }; + e4._sqlite3_aggregate_context = function() { + return (e4._sqlite3_aggregate_context = e4.asm.da).apply(null, arguments); + }; + e4._sqlite3_column_count = function() { + return (e4._sqlite3_column_count = e4.asm.ea).apply(null, arguments); + }; + e4._sqlite3_data_count = function() { + return (e4._sqlite3_data_count = e4.asm.fa).apply(null, arguments); + }; + e4._sqlite3_column_blob = function() { + return (e4._sqlite3_column_blob = e4.asm.ga).apply(null, arguments); + }; + e4._sqlite3_column_bytes = function() { + return (e4._sqlite3_column_bytes = e4.asm.ha).apply(null, arguments); + }; + e4._sqlite3_column_double = function() { + return (e4._sqlite3_column_double = e4.asm.ia).apply(null, arguments); + }; + e4._sqlite3_column_text = function() { + return (e4._sqlite3_column_text = e4.asm.ja).apply(null, arguments); + }; + e4._sqlite3_column_type = function() { + return (e4._sqlite3_column_type = e4.asm.ka).apply(null, arguments); + }; + e4._sqlite3_column_name = function() { + return (e4._sqlite3_column_name = e4.asm.la).apply(null, arguments); + }; + e4._sqlite3_bind_blob = function() { + return (e4._sqlite3_bind_blob = e4.asm.ma).apply(null, arguments); + }; + e4._sqlite3_bind_double = function() { + return (e4._sqlite3_bind_double = e4.asm.na).apply(null, arguments); + }; + e4._sqlite3_bind_int = function() { + return (e4._sqlite3_bind_int = e4.asm.oa).apply(null, arguments); + }; + e4._sqlite3_bind_text = function() { + return (e4._sqlite3_bind_text = e4.asm.pa).apply(null, arguments); + }; + e4._sqlite3_bind_parameter_index = function() { + return (e4._sqlite3_bind_parameter_index = e4.asm.qa).apply(null, arguments); + }; + e4._sqlite3_normalized_sql = function() { + return (e4._sqlite3_normalized_sql = e4.asm.ra).apply(null, arguments); + }; + e4._sqlite3_errmsg = function() { + return (e4._sqlite3_errmsg = e4.asm.sa).apply(null, arguments); + }; + e4._sqlite3_exec = function() { + return (e4._sqlite3_exec = e4.asm.ta).apply(null, arguments); + }; + e4._sqlite3_changes = function() { + return (e4._sqlite3_changes = e4.asm.ua).apply(null, arguments); + }; + e4._sqlite3_close_v2 = function() { + return (e4._sqlite3_close_v2 = e4.asm.va).apply(null, arguments); + }; + e4._sqlite3_create_function_v2 = function() { + return (e4._sqlite3_create_function_v2 = e4.asm.wa).apply(null, arguments); + }; + e4._sqlite3_open = function() { + return (e4._sqlite3_open = e4.asm.xa).apply(null, arguments); + }; + var da = e4._malloc = function() { + return (da = e4._malloc = e4.asm.ya).apply(null, arguments); + }, ba = e4._free = function() { + return (ba = e4._free = e4.asm.za).apply(null, arguments); + }; + e4._RegisterExtensionFunctions = function() { + return (e4._RegisterExtensionFunctions = e4.asm.Ba).apply(null, arguments); + }; + var zb = e4._emscripten_builtin_memalign = function() { + return (zb = e4._emscripten_builtin_memalign = e4.asm.Ca).apply(null, arguments); + }, oa = e4.stackSave = function() { + return (oa = e4.stackSave = e4.asm.Da).apply(null, arguments); + }, qa = e4.stackRestore = function() { + return (qa = e4.stackRestore = e4.asm.Ea).apply(null, arguments); + }, B5 = e4.stackAlloc = function() { + return (B5 = e4.stackAlloc = e4.asm.Fa).apply(null, arguments); + }; + e4.UTF8ToString = C3; + e4.stackAlloc = B5; + e4.stackSave = oa; + e4.stackRestore = qa; + e4.cwrap = function(a5, b4, c4, d5) { + c4 = c4 || []; + var f4 = c4.every((h5) => "number" === h5 || "boolean" === h5); + return "string" !== b4 && f4 && !d5 ? e4["_" + a5] : function() { + return Uc(a5, b4, c4, arguments); + }; + }; + var Xc; + Ya = function Yc() { + Xc || Zc(); + Xc || (Ya = Yc); + }; + function Zc() { + function a5() { + if (!Xc && (Xc = true, e4.calledRun = true, !Ka)) { + e4.noFSInit || ac || (ac = true, $b(), e4.stdin = e4.stdin, e4.stdout = e4.stdout, e4.stderr = e4.stderr, e4.stdin ? cc("stdin", e4.stdin) : Sb("/dev/tty", "/dev/stdin"), e4.stdout ? cc("stdout", null, e4.stdout) : Sb("/dev/tty", "/dev/stdout"), e4.stderr ? cc("stderr", null, e4.stderr) : Sb("/dev/tty1", "/dev/stderr"), ja("/dev/stdin", 0), ja("/dev/stdout", 1), ja("/dev/stderr", 1)); + Db = false; + cb(Ta); + if (e4.onRuntimeInitialized) + e4.onRuntimeInitialized(); + if (e4.postRun) + for ("function" == typeof e4.postRun && (e4.postRun = [e4.postRun]); e4.postRun.length; ) { + var b4 = e4.postRun.shift(); + Ua.unshift(b4); + } + cb(Ua); + } + } + if (!(0 < Wa)) { + if (e4.preRun) + for ("function" == typeof e4.preRun && (e4.preRun = [e4.preRun]); e4.preRun.length; ) + Va(); + cb(Sa); + 0 < Wa || (e4.setStatus ? (e4.setStatus("Running..."), setTimeout(function() { + setTimeout(function() { + e4.setStatus(""); + }, 1); + a5(); + }, 1)) : a5()); + } + } + if (e4.preInit) + for ("function" == typeof e4.preInit && (e4.preInit = [e4.preInit]); 0 < e4.preInit.length; ) + e4.preInit.pop()(); + Zc(); + return Module; + }); + return initSqlJsPromise; + }; + if (typeof exports === "object" && typeof module2 === "object") { + module2.exports = initSqlJs2; + module2.exports.default = initSqlJs2; + } else if (typeof define === "function" && define["amd"]) { + define([], function() { + return initSqlJs2; + }); + } else if (typeof exports === "object") { + exports["Module"] = initSqlJs2; + } + } +}); + +// src/main.ts +var main_exports = {}; +__export(main_exports, { + default: () => MakeMDPlugin +}); +module.exports = __toCommonJS(main_exports); + +// src/codemirror/extensions/flowEditor/flowEditor.tsx +var import_state6 = require("@codemirror/state"); +var import_view4 = require("@codemirror/view"); + +// src/codemirror/extensions/tooltip.ts +var import_state = require("@codemirror/state"); +var import_view = require("@codemirror/view"); +var ios = typeof navigator != "undefined" && !/Edge\/(\d+)/.exec(navigator.userAgent) && /Apple Computer/.test(navigator.vendor) && (/Mobile\/\w+/.test(navigator.userAgent) || navigator.maxTouchPoints > 2); +var Outside = "-10000px"; +var TooltipViewManager = class { + constructor(view, facet, createTooltipView) { + this.facet = facet; + this.createTooltipView = createTooltipView; + this.input = view.state.facet(facet); + this.tooltips = this.input.filter((t4) => t4); + this.tooltipViews = this.tooltips.map(createTooltipView); + } + update(update) { + if (update.focusChanged && !update.view.hasFocus) { + const input2 = update.state.facet(this.facet); + for (const t4 of this.tooltipViews) + t4.dom.remove(); + this.input = input2; + this.tooltips = []; + this.tooltipViews = []; + return true; + } + const input = update.state.facet(this.facet); + const tooltips2 = input.filter((x5) => x5); + if (input === this.input) { + for (const t4 of this.tooltipViews) + if (t4.update) + t4.update(update); + return false; + } + const tooltipViews = []; + for (let i4 = 0; i4 < tooltips2.length; i4++) { + const tip = tooltips2[i4]; + let known = -1; + if (!tip) + continue; + for (let i5 = 0; i5 < this.tooltips.length; i5++) { + const other = this.tooltips[i5]; + if (other && other.create == tip.create) + known = i5; + } + if (known < 0) { + tooltipViews[i4] = this.createTooltipView(tip); + } else { + const tooltipView = tooltipViews[i4] = this.tooltipViews[known]; + if (tooltipView.update) + tooltipView.update(update); + } + } + for (const t4 of this.tooltipViews) + if (tooltipViews.indexOf(t4) < 0) + t4.dom.remove(); + this.input = input; + this.tooltips = tooltips2; + this.tooltipViews = tooltipViews; + return true; + } +}; +function tooltips(config = {}) { + return tooltipConfig.of(config); +} +function windowSpace() { + return { top: 0, left: 0, bottom: innerHeight, right: innerWidth }; +} +var tooltipConfig = import_state.Facet.define({ + combine: (values) => { + var _a2, _b2, _c2; + return { + position: ios ? "absolute" : ((_a2 = values.find((conf) => conf.position)) == null ? void 0 : _a2.position) || "fixed", + parent: ((_b2 = values.find((conf) => conf.parent)) == null ? void 0 : _b2.parent) || null, + tooltipSpace: ((_c2 = values.find((conf) => conf.tooltipSpace)) == null ? void 0 : _c2.tooltipSpace) || windowSpace + }; + } +}); +var tooltipPlugin = import_view.ViewPlugin.fromClass( + class { + constructor(view) { + this.view = view; + this.inView = true; + this.lastTransaction = 0; + this.measureTimeout = -1; + var _a2; + const config = view.state.facet(tooltipConfig); + this.position = config.position; + this.parent = config.parent; + this.classes = view.themeClasses; + this.createContainer(); + this.measureReq = { + read: this.readMeasure.bind(this), + write: this.writeMeasure.bind(this), + key: this + }; + this.manager = new TooltipViewManager( + view, + showTooltip, + (t4) => this.createTooltip(t4) + ); + this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver( + (entries) => { + if (Date.now() > this.lastTransaction - 50 && entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1) + this.measureSoon(); + }, + { threshold: [1] } + ) : null; + this.observeIntersection(); + (_a2 = view.dom.ownerDocument.defaultView) == null ? void 0 : _a2.addEventListener( + "resize", + this.measureSoon = this.measureSoon.bind(this) + ); + this.maybeMeasure(); + } + createContainer() { + if (this.parent) { + this.container = document.createElement("div"); + this.container.style.position = "relative"; + this.container.className = this.view.themeClasses; + this.parent.appendChild(this.container); + } else { + this.container = this.view.dom; + } + } + observeIntersection() { + if (this.intersectionObserver) { + this.intersectionObserver.disconnect(); + for (const tooltip of this.manager.tooltipViews) + this.intersectionObserver.observe(tooltip.dom); + } + } + measureSoon() { + if (this.measureTimeout < 0) + this.measureTimeout = setTimeout(() => { + this.measureTimeout = -1; + this.maybeMeasure(); + }, 50); + } + update(update) { + if (update.transactions.length) + this.lastTransaction = Date.now(); + const updated = this.manager.update(update); + if (updated) + this.observeIntersection(); + let shouldMeasure = updated || update.geometryChanged; + const newConfig = update.state.facet(tooltipConfig); + if (newConfig.position != this.position) { + this.position = newConfig.position; + for (const t4 of this.manager.tooltipViews) + t4.dom.style.position = this.position; + shouldMeasure = true; + } + if (newConfig.parent != this.parent) { + if (this.parent) + this.container.remove(); + this.parent = newConfig.parent; + this.createContainer(); + for (const t4 of this.manager.tooltipViews) + this.container.appendChild(t4.dom); + shouldMeasure = true; + } else if (this.parent && this.view.themeClasses != this.classes) { + this.classes = this.container.className = this.view.themeClasses; + } + if (shouldMeasure) + this.maybeMeasure(); + } + createTooltip(tooltip) { + const tooltipView = tooltip.create(this.view); + tooltipView.dom.classList.add("cm-tooltip"); + if (tooltip.arrow && !tooltipView.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) { + const arrow = document.createElement("div"); + arrow.className = "cm-tooltip-arrow"; + tooltipView.dom.appendChild(arrow); + } + tooltipView.dom.style.position = this.position; + tooltipView.dom.style.top = Outside; + this.container.appendChild(tooltipView.dom); + if (tooltipView.mount) + tooltipView.mount(this.view); + return tooltipView; + } + destroy() { + var _a2, _b2; + (_a2 = this.view.dom.ownerDocument.defaultView) == null ? void 0 : _a2.removeEventListener( + "resize", + this.measureSoon + ); + for (const { dom } of this.manager.tooltipViews) + dom.remove(); + (_b2 = this.intersectionObserver) == null ? void 0 : _b2.disconnect(); + clearTimeout(this.measureTimeout); + } + readMeasure() { + const editor = this.view.dom.getBoundingClientRect(); + return { + editor, + parent: this.parent ? this.container.getBoundingClientRect() : editor, + pos: this.manager.tooltips.map((t4, i4) => { + const tv = this.manager.tooltipViews[i4]; + return tv.getCoords ? tv.getCoords(t4.pos) : this.view.coordsAtPos(t4.pos); + }), + size: this.manager.tooltipViews.map( + ({ dom }) => { + const size = dom.getBoundingClientRect(); + return size; + } + ), + space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view) + }; + } + writeMeasure(measured) { + const { editor, space } = measured; + const others = []; + for (let i4 = 0; i4 < this.manager.tooltips.length; i4++) { + const tooltip = this.manager.tooltips[i4], tView = this.manager.tooltipViews[i4], { dom } = tView; + const pos = measured.pos[i4], size = measured.size[i4]; + if (!pos || pos.bottom <= Math.max(editor.top, space.top) || pos.top >= Math.min(editor.bottom, space.bottom) || pos.right < Math.max(editor.left, space.left) - 0.1 || pos.left > Math.min(editor.right, space.right) + 0.1) { + dom.style.top = Outside; + continue; + } + const arrow = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null; + const arrowHeight = arrow ? 7 /* Size */ : 0; + const width = size.right - size.left, height = size.bottom - size.top; + const offset2 = tView.offset || noOffset, ltr = this.view.textDirection == import_view.Direction.LTR; + const left = size.width > space.right - space.left ? ltr ? space.left : space.right - size.width : ltr ? Math.min( + pos.left - (arrow ? 14 /* Offset */ : 0) + offset2.x, + space.right - width + ) : Math.max( + space.left, + pos.left - width + (arrow ? 14 /* Offset */ : 0) - offset2.x + ); + let above = !!tooltip.above; + if (!tooltip.strictSide && (above ? pos.top - (size.bottom - size.top) - offset2.y < space.top : pos.bottom + (size.bottom - size.top) + offset2.y > space.bottom) && above == space.bottom - pos.bottom > pos.top - space.top) + above = !above; + let top = above ? pos.top - height - arrowHeight - offset2.y : pos.bottom + arrowHeight + offset2.y; + const right = left + width; + if (tView.overlap !== true) { + for (const r3 of others) + if (r3.left < right && r3.right > left && r3.top < top + height && r3.bottom > top) + top = above ? r3.top - height - 2 - arrowHeight : r3.bottom + arrowHeight + 2; + } + const computeFrameOffset = (win, rect) => { + const { top: top2, right: right2, bottom, left: left2, width: width2, height: height2, x: x5, y: y5 } = rect; + const dims = { top: top2, right: right2, bottom, left: left2 }; + if (typeof dims === "undefined") { + const dims2 = { top: 0, left: 0 }; + } + const frames2 = win.parent.document.getElementsByTagName("iframe"); + let frame; + let found = false; + for (let i5 = 0, len = frames2.length; i5 < len; i5++) { + frame = frames2[i5]; + if (frame.contentWindow == win) { + found = true; + break; + } + } + if (found) { + const rect2 = frame.getBoundingClientRect(); + dims.left += rect2.left; + dims.top += rect2.top; + if (win !== top2) { + computeFrameOffset(win.parent, rect2); + } + } else { + return { top: 0, left: 0 }; + } + return dims; + }; + const viewCoords = computeFrameOffset(this.view.dom.ownerDocument.defaultView, editor); + if (this.position == "absolute") { + dom.style.top = viewCoords.top + top - measured.parent.top + "px"; + dom.style.left = viewCoords.left + left - measured.parent.left + "px"; + } else { + dom.style.top = viewCoords.top + top + "px"; + dom.style.left = viewCoords.left + left + "px"; + } + if (arrow) + arrow.style.left = `${pos.left + (ltr ? offset2.x : -offset2.x) - (left + 14 /* Offset */ - 7 /* Size */)}px`; + if (tView.overlap !== true) + others.push({ left, top, right, bottom: top + height }); + dom.classList.toggle("cm-tooltip-above", above); + dom.classList.toggle("cm-tooltip-below", !above); + if (tView.positioned) + tView.positioned(); + } + } + maybeMeasure() { + if (this.manager.tooltips.length) { + if (this.view.inView) + this.view.requestMeasure(this.measureReq); + if (this.inView != this.view.inView) { + this.inView = this.view.inView; + if (!this.inView) + for (const tv of this.manager.tooltipViews) + tv.dom.style.top = Outside; + } + } + } + }, + { + eventHandlers: { + scroll() { + this.maybeMeasure(); + } + } + } +); +var baseTheme = import_view.EditorView.baseTheme({ + ".cm-tooltip": { + zIndex: 100 + }, + "&light .cm-tooltip": { + border: "1px solid #bbb", + backgroundColor: "#f5f5f5" + }, + "&light .cm-tooltip-section:not(:first-child)": { + borderTop: "1px solid #bbb" + }, + "&dark .cm-tooltip": { + backgroundColor: "#333338", + color: "white" + }, + ".cm-tooltip-arrow": { + height: `${7 /* Size */}px`, + width: `${7 /* Size */ * 2}px`, + position: "absolute", + zIndex: -1, + overflow: "hidden", + "&:before, &:after": { + content: "''", + position: "absolute", + width: 0, + height: 0, + borderLeft: `${7 /* Size */}px solid transparent`, + borderRight: `${7 /* Size */}px solid transparent` }, - { - n: ["man-man-boy-boy", "family: man, man, boy, boy"], - u: "1f468-200d-1f468-200d-1f466-200d-1f466" + ".cm-tooltip-above &": { + bottom: `-${7 /* Size */}px`, + "&:before": { + borderTop: `${7 /* Size */}px solid #bbb` + }, + "&:after": { + borderTop: `${7 /* Size */}px solid #f5f5f5`, + bottom: "1px" + } }, - { - n: ["man-man-girl-girl", "family: man, man, girl, girl"], - u: "1f468-200d-1f468-200d-1f467-200d-1f467" + ".cm-tooltip-below &": { + top: `-${7 /* Size */}px`, + "&:before": { + borderBottom: `${7 /* Size */}px solid #bbb` + }, + "&:after": { + borderBottom: `${7 /* Size */}px solid #f5f5f5`, + top: "1px" + } + } + }, + "&dark .cm-tooltip .cm-tooltip-arrow": { + "&:before": { + borderTopColor: "#333338", + borderBottomColor: "#333338" }, - { - n: ["woman-woman-boy", "family: woman, woman, boy"], - u: "1f469-200d-1f469-200d-1f466" + "&:after": { + borderTopColor: "transparent", + borderBottomColor: "transparent" + } + } +}); +var noOffset = { x: 0, y: 0 }; +var showTooltip = import_state.Facet.define({ + enables: [tooltipPlugin, baseTheme] +}); +var showHoverTooltip = import_state.Facet.define(); +var HoverTooltipHost = class { + constructor(view) { + this.view = view; + this.mounted = false; + this.dom = document.createElement("div"); + this.dom.classList.add("cm-tooltip-hover"); + this.manager = new TooltipViewManager( + view, + showHoverTooltip, + (t4) => this.createHostedView(t4) + ); + } + static create(view) { + return new HoverTooltipHost(view); + } + createHostedView(tooltip) { + const hostedView = tooltip.create(this.view); + hostedView.dom.classList.add("cm-tooltip-section"); + this.dom.appendChild(hostedView.dom); + if (this.mounted && hostedView.mount) + hostedView.mount(this.view); + return hostedView; + } + mount(view) { + for (const hostedView of this.manager.tooltipViews) { + if (hostedView.mount) + hostedView.mount(view); + } + this.mounted = true; + } + positioned() { + for (const hostedView of this.manager.tooltipViews) { + if (hostedView.positioned) + hostedView.positioned(); + } + } + update(update) { + this.manager.update(update); + } +}; +var showHoverTooltipHost = showTooltip.compute( + [showHoverTooltip], + (state) => { + const tooltips2 = state.facet(showHoverTooltip).filter((t4) => t4); + if (tooltips2.length === 0) + return null; + return { + pos: Math.min(...tooltips2.map((t4) => t4.pos)), + end: Math.max( + ...tooltips2.filter((t4) => t4.end != null).map((t4) => t4.end) + ), + create: HoverTooltipHost.create, + above: tooltips2[0].above, + arrow: tooltips2.some((t4) => t4.arrow) + }; + } +); +var HoverPlugin = class { + constructor(view, source, field, setHover, hoverTime) { + this.view = view; + this.source = source; + this.field = field; + this.setHover = setHover; + this.hoverTime = hoverTime; + this.hoverTimeout = -1; + this.restartTimeout = -1; + this.pending = null; + this.lastMove = { x: 0, y: 0, target: view.dom, time: 0 }; + this.checkHover = this.checkHover.bind(this); + view.dom.addEventListener( + "mouseleave", + this.mouseleave = this.mouseleave.bind(this) + ); + view.dom.addEventListener( + "mousemove", + this.mousemove = this.mousemove.bind(this) + ); + } + update() { + if (this.pending) { + this.pending = null; + clearTimeout(this.restartTimeout); + this.restartTimeout = setTimeout(() => this.startHover(), 20); + } + } + get active() { + return this.view.state.field(this.field); + } + checkHover() { + this.hoverTimeout = -1; + if (this.active) + return; + const hovered = Date.now() - this.lastMove.time; + if (hovered < this.hoverTime) + this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime - hovered); + else + this.startHover(); + } + startHover() { + clearTimeout(this.restartTimeout); + const { lastMove } = this; + const pos = this.view.contentDOM.contains(lastMove.target) ? this.view.posAtCoords(lastMove) : null; + if (pos == null) + return; + const posCoords = this.view.coordsAtPos(pos); + if (posCoords == null || lastMove.y < posCoords.top || lastMove.y > posCoords.bottom || lastMove.x < posCoords.left - this.view.defaultCharacterWidth || lastMove.x > posCoords.right + this.view.defaultCharacterWidth) + return; + const bidi = this.view.bidiSpans(this.view.state.doc.lineAt(pos)).find((s5) => s5.from <= pos && s5.to >= pos); + const rtl = bidi && bidi.dir == import_view.Direction.RTL ? -1 : 1; + const open = this.source( + this.view, + pos, + lastMove.x < posCoords.left ? -rtl : rtl + ); + if (open == null ? void 0 : open.then) { + const pending = this.pending = { pos }; + open.then( + (result) => { + if (this.pending == pending) { + this.pending = null; + if (result) + this.view.dispatch({ effects: this.setHover.of(result) }); + } + }, + (e4) => (0, import_view.logException)(this.view.state, e4, "hover tooltip") + ); + } else if (open) { + this.view.dispatch({ effects: this.setHover.of(open) }); + } + } + mousemove(event) { + var _a2; + this.lastMove = { + x: event.clientX, + y: event.clientY, + target: event.target, + time: Date.now() + }; + if (this.hoverTimeout < 0) + this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime); + const tooltip = this.active; + if (tooltip && !isInTooltip(this.lastMove.target) || this.pending) { + const { pos } = tooltip || this.pending, end = (_a2 = tooltip == null ? void 0 : tooltip.end) != null ? _a2 : pos; + if (pos == end ? this.view.posAtCoords(this.lastMove) != pos : !isOverRange( + this.view, + pos, + end, + event.clientX, + event.clientY, + 6 /* MaxDist */ + )) { + this.view.dispatch({ effects: this.setHover.of(null) }); + this.pending = null; + } + } + } + mouseleave(e4) { + clearTimeout(this.hoverTimeout); + this.hoverTimeout = -1; + if (this.active && !isInTooltip(e4.relatedTarget)) + this.view.dispatch({ effects: this.setHover.of(null) }); + } + destroy() { + clearTimeout(this.hoverTimeout); + this.view.dom.removeEventListener("mouseleave", this.mouseleave); + this.view.dom.removeEventListener("mousemove", this.mousemove); + } +}; +function isInTooltip(elt) { + for (let cur = elt; cur; cur = cur.parentNode) + if (cur.nodeType == 1 && cur.classList.contains("cm-tooltip")) + return true; + return false; +} +function isOverRange(view, from, to, x5, y5, margin) { + const range = document.createRange(); + const fromDOM = view.domAtPos(from), toDOM = view.domAtPos(to); + range.setEnd(toDOM.node, toDOM.offset); + range.setStart(fromDOM.node, fromDOM.offset); + const rects = range.getClientRects(); + range.detach(); + for (let i4 = 0; i4 < rects.length; i4++) { + const rect = rects[i4]; + const dist = Math.max( + rect.top - y5, + y5 - rect.bottom, + rect.left - x5, + x5 - rect.right + ); + if (dist <= margin) + return true; + } + return false; +} +function hoverTooltip(source, options = {}) { + const setHover = import_state.StateEffect.define(); + const hoverState = import_state.StateField.define({ + create() { + return null; }, - { - n: ["woman-woman-girl", "family: woman, woman, girl"], - u: "1f469-200d-1f469-200d-1f467" + update(value, tr) { + if (value && options.hideOnChange && (tr.docChanged || tr.selection)) + return null; + for (const effect of tr.effects) { + if (effect.is(setHover)) { + return effect.value; + } + if (effect.is(closeHoverTooltipEffect)) + return null; + } + if (value && tr.docChanged) { + const newPos = tr.changes.mapPos(value.pos, -1, import_state.MapMode.TrackDel); + if (newPos == null) + return null; + const copy = Object.assign(/* @__PURE__ */ Object.create(null), value); + copy.pos = newPos; + if (value.end != null) + copy.end = tr.changes.mapPos(value.end); + return copy; + } + return value; }, - { - n: ["woman-woman-girl-boy", "family: woman, woman, girl, boy"], - u: "1f469-200d-1f469-200d-1f467-200d-1f466" + provide: (f4) => showHoverTooltip.from(f4) + }); + return [ + hoverState, + import_view.ViewPlugin.define( + (view) => new HoverPlugin( + view, + source, + hoverState, + setHover, + options.hoverTime || 300 /* Time */ + ) + ), + showHoverTooltipHost + ]; +} +var closeHoverTooltipEffect = import_state.StateEffect.define(); +var closeHoverTooltips = closeHoverTooltipEffect.of(null); + +// node_modules/preact/dist/preact.module.js +var n; +var l; +var u; +var i; +var t; +var r; +var o; +var f; +var e; +var c = {}; +var s = []; +var a = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i; +function h(n2, l3) { + for (var u4 in l3) + n2[u4] = l3[u4]; + return n2; +} +function v(n2) { + var l3 = n2.parentNode; + l3 && l3.removeChild(n2); +} +function y(l3, u4, i4) { + var t4, r3, o3, f4 = {}; + for (o3 in u4) + "key" == o3 ? t4 = u4[o3] : "ref" == o3 ? r3 = u4[o3] : f4[o3] = u4[o3]; + if (arguments.length > 2 && (f4.children = arguments.length > 3 ? n.call(arguments, 2) : i4), "function" == typeof l3 && null != l3.defaultProps) + for (o3 in l3.defaultProps) + void 0 === f4[o3] && (f4[o3] = l3.defaultProps[o3]); + return p(l3, f4, t4, r3, null); +} +function p(n2, i4, t4, r3, o3) { + var f4 = { type: n2, props: i4, key: t4, ref: r3, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: null == o3 ? ++u : o3 }; + return null == o3 && null != l.vnode && l.vnode(f4), f4; +} +function d() { + return { current: null }; +} +function _(n2) { + return n2.children; +} +function k(n2, l3) { + this.props = n2, this.context = l3; +} +function b(n2, l3) { + if (null == l3) + return n2.__ ? b(n2.__, n2.__.__k.indexOf(n2) + 1) : null; + for (var u4; l3 < n2.__k.length; l3++) + if (null != (u4 = n2.__k[l3]) && null != u4.__e) + return u4.__e; + return "function" == typeof n2.type ? b(n2) : null; +} +function g(n2) { + var l3, u4; + if (null != (n2 = n2.__) && null != n2.__c) { + for (n2.__e = n2.__c.base = null, l3 = 0; l3 < n2.__k.length; l3++) + if (null != (u4 = n2.__k[l3]) && null != u4.__e) { + n2.__e = n2.__c.base = u4.__e; + break; + } + return g(n2); + } +} +function m(n2) { + (!n2.__d && (n2.__d = true) && t.push(n2) && !w.__r++ || r !== l.debounceRendering) && ((r = l.debounceRendering) || o)(w); +} +function w() { + var n2, l3, u4, i4, r3, o3, e4, c4; + for (t.sort(f); n2 = t.shift(); ) + n2.__d && (l3 = t.length, i4 = void 0, r3 = void 0, e4 = (o3 = (u4 = n2).__v).__e, (c4 = u4.__P) && (i4 = [], (r3 = h({}, o3)).__v = o3.__v + 1, L(c4, o3, r3, u4.__n, void 0 !== c4.ownerSVGElement, null != o3.__h ? [e4] : null, i4, null == e4 ? b(o3) : e4, o3.__h), M(i4, o3), o3.__e != e4 && g(o3)), t.length > l3 && t.sort(f)); + w.__r = 0; +} +function x(n2, l3, u4, i4, t4, r3, o3, f4, e4, a5) { + var h5, v3, y5, d5, k5, g4, m5, w5 = i4 && i4.__k || s, x5 = w5.length; + for (u4.__k = [], h5 = 0; h5 < l3.length; h5++) + if (null != (d5 = u4.__k[h5] = null == (d5 = l3[h5]) || "boolean" == typeof d5 || "function" == typeof d5 ? null : "string" == typeof d5 || "number" == typeof d5 || "bigint" == typeof d5 ? p(null, d5, null, null, d5) : Array.isArray(d5) ? p(_, { children: d5 }, null, null, null) : d5.__b > 0 ? p(d5.type, d5.props, d5.key, d5.ref ? d5.ref : null, d5.__v) : d5)) { + if (d5.__ = u4, d5.__b = u4.__b + 1, null === (y5 = w5[h5]) || y5 && d5.key == y5.key && d5.type === y5.type) + w5[h5] = void 0; + else + for (v3 = 0; v3 < x5; v3++) { + if ((y5 = w5[v3]) && d5.key == y5.key && d5.type === y5.type) { + w5[v3] = void 0; + break; + } + y5 = null; + } + L(n2, d5, y5 = y5 || c, t4, r3, o3, f4, e4, a5), k5 = d5.__e, (v3 = d5.ref) && y5.ref != v3 && (m5 || (m5 = []), y5.ref && m5.push(y5.ref, null, d5), m5.push(v3, d5.__c || k5, d5)), null != k5 ? (null == g4 && (g4 = k5), "function" == typeof d5.type && d5.__k === y5.__k ? d5.__d = e4 = A(d5, e4, n2) : e4 = C(n2, d5, y5, w5, k5, e4), "function" == typeof u4.type && (u4.__d = e4)) : e4 && y5.__e == e4 && e4.parentNode != n2 && (e4 = b(y5)); + } + for (u4.__e = g4, h5 = x5; h5--; ) + null != w5[h5] && ("function" == typeof u4.type && null != w5[h5].__e && w5[h5].__e == u4.__d && (u4.__d = $(i4).nextSibling), S(w5[h5], w5[h5])); + if (m5) + for (h5 = 0; h5 < m5.length; h5++) + O(m5[h5], m5[++h5], m5[++h5]); +} +function A(n2, l3, u4) { + for (var i4, t4 = n2.__k, r3 = 0; t4 && r3 < t4.length; r3++) + (i4 = t4[r3]) && (i4.__ = n2, l3 = "function" == typeof i4.type ? A(i4, l3, u4) : C(u4, i4, i4, t4, i4.__e, l3)); + return l3; +} +function P(n2, l3) { + return l3 = l3 || [], null == n2 || "boolean" == typeof n2 || (Array.isArray(n2) ? n2.some(function(n3) { + P(n3, l3); + }) : l3.push(n2)), l3; +} +function C(n2, l3, u4, i4, t4, r3) { + var o3, f4, e4; + if (void 0 !== l3.__d) + o3 = l3.__d, l3.__d = void 0; + else if (null == u4 || t4 != r3 || null == t4.parentNode) + n: + if (null == r3 || r3.parentNode !== n2) + n2.appendChild(t4), o3 = null; + else { + for (f4 = r3, e4 = 0; (f4 = f4.nextSibling) && e4 < i4.length; e4 += 1) + if (f4 == t4) + break n; + n2.insertBefore(t4, r3), o3 = r3; + } + return void 0 !== o3 ? o3 : t4.nextSibling; +} +function $(n2) { + var l3, u4, i4; + if (null == n2.type || "string" == typeof n2.type) + return n2.__e; + if (n2.__k) { + for (l3 = n2.__k.length - 1; l3 >= 0; l3--) + if ((u4 = n2.__k[l3]) && (i4 = $(u4))) + return i4; + } + return null; +} +function H(n2, l3, u4, i4, t4) { + var r3; + for (r3 in u4) + "children" === r3 || "key" === r3 || r3 in l3 || T(n2, r3, null, u4[r3], i4); + for (r3 in l3) + t4 && "function" != typeof l3[r3] || "children" === r3 || "key" === r3 || "value" === r3 || "checked" === r3 || u4[r3] === l3[r3] || T(n2, r3, l3[r3], u4[r3], i4); +} +function I(n2, l3, u4) { + "-" === l3[0] ? n2.setProperty(l3, null == u4 ? "" : u4) : n2[l3] = null == u4 ? "" : "number" != typeof u4 || a.test(l3) ? u4 : u4 + "px"; +} +function T(n2, l3, u4, i4, t4) { + var r3; + n: + if ("style" === l3) + if ("string" == typeof u4) + n2.style.cssText = u4; + else { + if ("string" == typeof i4 && (n2.style.cssText = i4 = ""), i4) + for (l3 in i4) + u4 && l3 in u4 || I(n2.style, l3, ""); + if (u4) + for (l3 in u4) + i4 && u4[l3] === i4[l3] || I(n2.style, l3, u4[l3]); + } + else if ("o" === l3[0] && "n" === l3[1]) + r3 = l3 !== (l3 = l3.replace(/Capture$/, "")), l3 = l3.toLowerCase() in n2 ? l3.toLowerCase().slice(2) : l3.slice(2), n2.l || (n2.l = {}), n2.l[l3 + r3] = u4, u4 ? i4 || n2.addEventListener(l3, r3 ? z : j, r3) : n2.removeEventListener(l3, r3 ? z : j, r3); + else if ("dangerouslySetInnerHTML" !== l3) { + if (t4) + l3 = l3.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); + else if ("width" !== l3 && "height" !== l3 && "href" !== l3 && "list" !== l3 && "form" !== l3 && "tabIndex" !== l3 && "download" !== l3 && l3 in n2) + try { + n2[l3] = null == u4 ? "" : u4; + break n; + } catch (n3) { + } + "function" == typeof u4 || (null == u4 || false === u4 && -1 == l3.indexOf("-") ? n2.removeAttribute(l3) : n2.setAttribute(l3, u4)); + } +} +function j(n2) { + return this.l[n2.type + false](l.event ? l.event(n2) : n2); +} +function z(n2) { + return this.l[n2.type + true](l.event ? l.event(n2) : n2); +} +function L(n2, u4, i4, t4, r3, o3, f4, e4, c4) { + var s5, a5, v3, y5, p3, d5, b4, g4, m5, w5, A4, P4, C3, $3, H5, I4 = u4.type; + if (void 0 !== u4.constructor) + return null; + null != i4.__h && (c4 = i4.__h, e4 = u4.__e = i4.__e, u4.__h = null, o3 = [e4]), (s5 = l.__b) && s5(u4); + try { + n: + if ("function" == typeof I4) { + if (g4 = u4.props, m5 = (s5 = I4.contextType) && t4[s5.__c], w5 = s5 ? m5 ? m5.props.value : s5.__ : t4, i4.__c ? b4 = (a5 = u4.__c = i4.__c).__ = a5.__E : ("prototype" in I4 && I4.prototype.render ? u4.__c = a5 = new I4(g4, w5) : (u4.__c = a5 = new k(g4, w5), a5.constructor = I4, a5.render = q), m5 && m5.sub(a5), a5.props = g4, a5.state || (a5.state = {}), a5.context = w5, a5.__n = t4, v3 = a5.__d = true, a5.__h = [], a5._sb = []), null == a5.__s && (a5.__s = a5.state), null != I4.getDerivedStateFromProps && (a5.__s == a5.state && (a5.__s = h({}, a5.__s)), h(a5.__s, I4.getDerivedStateFromProps(g4, a5.__s))), y5 = a5.props, p3 = a5.state, a5.__v = u4, v3) + null == I4.getDerivedStateFromProps && null != a5.componentWillMount && a5.componentWillMount(), null != a5.componentDidMount && a5.__h.push(a5.componentDidMount); + else { + if (null == I4.getDerivedStateFromProps && g4 !== y5 && null != a5.componentWillReceiveProps && a5.componentWillReceiveProps(g4, w5), !a5.__e && null != a5.shouldComponentUpdate && false === a5.shouldComponentUpdate(g4, a5.__s, w5) || u4.__v === i4.__v) { + for (u4.__v !== i4.__v && (a5.props = g4, a5.state = a5.__s, a5.__d = false), a5.__e = false, u4.__e = i4.__e, u4.__k = i4.__k, u4.__k.forEach(function(n3) { + n3 && (n3.__ = u4); + }), A4 = 0; A4 < a5._sb.length; A4++) + a5.__h.push(a5._sb[A4]); + a5._sb = [], a5.__h.length && f4.push(a5); + break n; + } + null != a5.componentWillUpdate && a5.componentWillUpdate(g4, a5.__s, w5), null != a5.componentDidUpdate && a5.__h.push(function() { + a5.componentDidUpdate(y5, p3, d5); + }); + } + if (a5.context = w5, a5.props = g4, a5.__P = n2, P4 = l.__r, C3 = 0, "prototype" in I4 && I4.prototype.render) { + for (a5.state = a5.__s, a5.__d = false, P4 && P4(u4), s5 = a5.render(a5.props, a5.state, a5.context), $3 = 0; $3 < a5._sb.length; $3++) + a5.__h.push(a5._sb[$3]); + a5._sb = []; + } else + do { + a5.__d = false, P4 && P4(u4), s5 = a5.render(a5.props, a5.state, a5.context), a5.state = a5.__s; + } while (a5.__d && ++C3 < 25); + a5.state = a5.__s, null != a5.getChildContext && (t4 = h(h({}, t4), a5.getChildContext())), v3 || null == a5.getSnapshotBeforeUpdate || (d5 = a5.getSnapshotBeforeUpdate(y5, p3)), H5 = null != s5 && s5.type === _ && null == s5.key ? s5.props.children : s5, x(n2, Array.isArray(H5) ? H5 : [H5], u4, i4, t4, r3, o3, f4, e4, c4), a5.base = u4.__e, u4.__h = null, a5.__h.length && f4.push(a5), b4 && (a5.__E = a5.__ = null), a5.__e = false; + } else + null == o3 && u4.__v === i4.__v ? (u4.__k = i4.__k, u4.__e = i4.__e) : u4.__e = N(i4.__e, u4, i4, t4, r3, o3, f4, c4); + (s5 = l.diffed) && s5(u4); + } catch (n3) { + u4.__v = null, (c4 || null != o3) && (u4.__e = e4, u4.__h = !!c4, o3[o3.indexOf(e4)] = null), l.__e(n3, u4, i4); + } +} +function M(n2, u4) { + l.__c && l.__c(u4, n2), n2.some(function(u5) { + try { + n2 = u5.__h, u5.__h = [], n2.some(function(n3) { + n3.call(u5); + }); + } catch (n3) { + l.__e(n3, u5.__v); + } + }); +} +function N(l3, u4, i4, t4, r3, o3, f4, e4) { + var s5, a5, h5, y5 = i4.props, p3 = u4.props, d5 = u4.type, _12 = 0; + if ("svg" === d5 && (r3 = true), null != o3) { + for (; _12 < o3.length; _12++) + if ((s5 = o3[_12]) && "setAttribute" in s5 == !!d5 && (d5 ? s5.localName === d5 : 3 === s5.nodeType)) { + l3 = s5, o3[_12] = null; + break; + } + } + if (null == l3) { + if (null === d5) + return document.createTextNode(p3); + l3 = r3 ? document.createElementNS("http://www.w3.org/2000/svg", d5) : document.createElement(d5, p3.is && p3), o3 = null, e4 = false; + } + if (null === d5) + y5 === p3 || e4 && l3.data === p3 || (l3.data = p3); + else { + if (o3 = o3 && n.call(l3.childNodes), a5 = (y5 = i4.props || c).dangerouslySetInnerHTML, h5 = p3.dangerouslySetInnerHTML, !e4) { + if (null != o3) + for (y5 = {}, _12 = 0; _12 < l3.attributes.length; _12++) + y5[l3.attributes[_12].name] = l3.attributes[_12].value; + (h5 || a5) && (h5 && (a5 && h5.__html == a5.__html || h5.__html === l3.innerHTML) || (l3.innerHTML = h5 && h5.__html || "")); + } + if (H(l3, p3, y5, r3, e4), h5) + u4.__k = []; + else if (_12 = u4.props.children, x(l3, Array.isArray(_12) ? _12 : [_12], u4, i4, t4, r3 && "foreignObject" !== d5, o3, f4, o3 ? o3[0] : i4.__k && b(i4, 0), e4), null != o3) + for (_12 = o3.length; _12--; ) + null != o3[_12] && v(o3[_12]); + e4 || ("value" in p3 && void 0 !== (_12 = p3.value) && (_12 !== l3.value || "progress" === d5 && !_12 || "option" === d5 && _12 !== y5.value) && T(l3, "value", _12, y5.value, false), "checked" in p3 && void 0 !== (_12 = p3.checked) && _12 !== l3.checked && T(l3, "checked", _12, y5.checked, false)); + } + return l3; +} +function O(n2, u4, i4) { + try { + "function" == typeof n2 ? n2(u4) : n2.current = u4; + } catch (n3) { + l.__e(n3, i4); + } +} +function S(n2, u4, i4) { + var t4, r3; + if (l.unmount && l.unmount(n2), (t4 = n2.ref) && (t4.current && t4.current !== n2.__e || O(t4, null, u4)), null != (t4 = n2.__c)) { + if (t4.componentWillUnmount) + try { + t4.componentWillUnmount(); + } catch (n3) { + l.__e(n3, u4); + } + t4.base = t4.__P = null, n2.__c = void 0; + } + if (t4 = n2.__k) + for (r3 = 0; r3 < t4.length; r3++) + t4[r3] && S(t4[r3], u4, i4 || "function" != typeof n2.type); + i4 || null == n2.__e || v(n2.__e), n2.__ = n2.__e = n2.__d = void 0; +} +function q(n2, l3, u4) { + return this.constructor(n2, u4); +} +function B(u4, i4, t4) { + var r3, o3, f4; + l.__ && l.__(u4, i4), o3 = (r3 = "function" == typeof t4) ? null : t4 && t4.__k || i4.__k, f4 = [], L(i4, u4 = (!r3 && t4 || i4).__k = y(_, null, [u4]), o3 || c, c, void 0 !== i4.ownerSVGElement, !r3 && t4 ? [t4] : o3 ? null : i4.firstChild ? n.call(i4.childNodes) : null, f4, !r3 && t4 ? t4 : o3 ? o3.__e : i4.firstChild, r3), M(f4, u4); +} +function D(n2, l3) { + B(n2, l3, D); +} +function E(l3, u4, i4) { + var t4, r3, o3, f4 = h({}, l3.props); + for (o3 in u4) + "key" == o3 ? t4 = u4[o3] : "ref" == o3 ? r3 = u4[o3] : f4[o3] = u4[o3]; + return arguments.length > 2 && (f4.children = arguments.length > 3 ? n.call(arguments, 2) : i4), p(l3.type, f4, t4 || l3.key, r3 || l3.ref, null); +} +function F(n2, l3) { + var u4 = { __c: l3 = "__cC" + e++, __: n2, Consumer: function(n3, l4) { + return n3.children(l4); + }, Provider: function(n3) { + var u5, i4; + return this.getChildContext || (u5 = [], (i4 = {})[l3] = this, this.getChildContext = function() { + return i4; + }, this.shouldComponentUpdate = function(n4) { + this.props.value !== n4.value && u5.some(function(n5) { + n5.__e = true, m(n5); + }); + }, this.sub = function(n4) { + u5.push(n4); + var l4 = n4.componentWillUnmount; + n4.componentWillUnmount = function() { + u5.splice(u5.indexOf(n4), 1), l4 && l4.call(n4); + }; + }), n3.children; + } }; + return u4.Provider.__ = u4.Consumer.contextType = u4; +} +n = s.slice, l = { __e: function(n2, l3, u4, i4) { + for (var t4, r3, o3; l3 = l3.__; ) + if ((t4 = l3.__c) && !t4.__) + try { + if ((r3 = t4.constructor) && null != r3.getDerivedStateFromError && (t4.setState(r3.getDerivedStateFromError(n2)), o3 = t4.__d), null != t4.componentDidCatch && (t4.componentDidCatch(n2, i4 || {}), o3 = t4.__d), o3) + return t4.__E = t4; + } catch (l4) { + n2 = l4; + } + throw n2; +} }, u = 0, i = function(n2) { + return null != n2 && void 0 === n2.constructor; +}, k.prototype.setState = function(n2, l3) { + var u4; + u4 = null != this.__s && this.__s !== this.state ? this.__s : this.__s = h({}, this.state), "function" == typeof n2 && (n2 = n2(h({}, u4), this.props)), n2 && h(u4, n2), null != n2 && this.__v && (l3 && this._sb.push(l3), m(this)); +}, k.prototype.forceUpdate = function(n2) { + this.__v && (this.__e = true, n2 && this.__h.push(n2), m(this)); +}, k.prototype.render = _, t = [], o = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, f = function(n2, l3) { + return n2.__v.__b - l3.__v.__b; +}, w.__r = 0, e = 0; + +// node_modules/preact/hooks/dist/hooks.module.js +var t2; +var r2; +var u2; +var i2; +var o2 = 0; +var f2 = []; +var c2 = []; +var e2 = l.__b; +var a2 = l.__r; +var v2 = l.diffed; +var l2 = l.__c; +var m2 = l.unmount; +function d2(t4, u4) { + l.__h && l.__h(r2, t4, o2 || u4), o2 = 0; + var i4 = r2.__H || (r2.__H = { __: [], __h: [] }); + return t4 >= i4.__.length && i4.__.push({ __V: c2 }), i4.__[t4]; +} +function h2(n2) { + return o2 = 1, s2(B2, n2); +} +function s2(n2, u4, i4) { + var o3 = d2(t2++, 2); + if (o3.t = n2, !o3.__c && (o3.__ = [i4 ? i4(u4) : B2(void 0, u4), function(n3) { + var t4 = o3.__N ? o3.__N[0] : o3.__[0], r3 = o3.t(t4, n3); + t4 !== r3 && (o3.__N = [r3, o3.__[1]], o3.__c.setState({})); + }], o3.__c = r2, !r2.u)) { + var f4 = function(n3, t4, r3) { + if (!o3.__c.__H) + return true; + var u5 = o3.__c.__H.__.filter(function(n4) { + return n4.__c; + }); + if (u5.every(function(n4) { + return !n4.__N; + })) + return !c4 || c4.call(this, n3, t4, r3); + var i5 = false; + return u5.forEach(function(n4) { + if (n4.__N) { + var t5 = n4.__[0]; + n4.__ = n4.__N, n4.__N = void 0, t5 !== n4.__[0] && (i5 = true); + } + }), !(!i5 && o3.__c.props === n3) && (!c4 || c4.call(this, n3, t4, r3)); + }; + r2.u = true; + var c4 = r2.shouldComponentUpdate, e4 = r2.componentWillUpdate; + r2.componentWillUpdate = function(n3, t4, r3) { + if (this.__e) { + var u5 = c4; + c4 = void 0, f4(n3, t4, r3), c4 = u5; + } + e4 && e4.call(this, n3, t4, r3); + }, r2.shouldComponentUpdate = f4; + } + return o3.__N || o3.__; +} +function p2(u4, i4) { + var o3 = d2(t2++, 3); + !l.__s && z2(o3.__H, i4) && (o3.__ = u4, o3.i = i4, r2.__H.__h.push(o3)); +} +function y2(u4, i4) { + var o3 = d2(t2++, 4); + !l.__s && z2(o3.__H, i4) && (o3.__ = u4, o3.i = i4, r2.__h.push(o3)); +} +function _2(n2) { + return o2 = 5, F2(function() { + return { current: n2 }; + }, []); +} +function A2(n2, t4, r3) { + o2 = 6, y2(function() { + return "function" == typeof n2 ? (n2(t4()), function() { + return n2(null); + }) : n2 ? (n2.current = t4(), function() { + return n2.current = null; + }) : void 0; + }, null == r3 ? r3 : r3.concat(n2)); +} +function F2(n2, r3) { + var u4 = d2(t2++, 7); + return z2(u4.__H, r3) ? (u4.__V = n2(), u4.i = r3, u4.__h = n2, u4.__V) : u4.__; +} +function T2(n2, t4) { + return o2 = 8, F2(function() { + return n2; + }, t4); +} +function q2(n2) { + var u4 = r2.context[n2.__c], i4 = d2(t2++, 9); + return i4.c = n2, u4 ? (null == i4.__ && (i4.__ = true, u4.sub(r2)), u4.props.value) : n2.__; +} +function x2(t4, r3) { + l.useDebugValue && l.useDebugValue(r3 ? r3(t4) : t4); +} +function P2(n2) { + var u4 = d2(t2++, 10), i4 = h2(); + return u4.__ = n2, r2.componentDidCatch || (r2.componentDidCatch = function(n3, t4) { + u4.__ && u4.__(n3, t4), i4[1](n3); + }), [i4[0], function() { + i4[1](void 0); + }]; +} +function V() { + var n2 = d2(t2++, 11); + if (!n2.__) { + for (var u4 = r2.__v; null !== u4 && !u4.__m && null !== u4.__; ) + u4 = u4.__; + var i4 = u4.__m || (u4.__m = [0, 0]); + n2.__ = "P" + i4[0] + "-" + i4[1]++; + } + return n2.__; +} +function b2() { + for (var t4; t4 = f2.shift(); ) + if (t4.__P && t4.__H) + try { + t4.__H.__h.forEach(k2), t4.__H.__h.forEach(w2), t4.__H.__h = []; + } catch (r3) { + t4.__H.__h = [], l.__e(r3, t4.__v); + } +} +l.__b = function(n2) { + r2 = null, e2 && e2(n2); +}, l.__r = function(n2) { + a2 && a2(n2), t2 = 0; + var i4 = (r2 = n2.__c).__H; + i4 && (u2 === r2 ? (i4.__h = [], r2.__h = [], i4.__.forEach(function(n3) { + n3.__N && (n3.__ = n3.__N), n3.__V = c2, n3.__N = n3.i = void 0; + })) : (i4.__h.forEach(k2), i4.__h.forEach(w2), i4.__h = [])), u2 = r2; +}, l.diffed = function(t4) { + v2 && v2(t4); + var o3 = t4.__c; + o3 && o3.__H && (o3.__H.__h.length && (1 !== f2.push(o3) && i2 === l.requestAnimationFrame || ((i2 = l.requestAnimationFrame) || j2)(b2)), o3.__H.__.forEach(function(n2) { + n2.i && (n2.__H = n2.i), n2.__V !== c2 && (n2.__ = n2.__V), n2.i = void 0, n2.__V = c2; + })), u2 = r2 = null; +}, l.__c = function(t4, r3) { + r3.some(function(t5) { + try { + t5.__h.forEach(k2), t5.__h = t5.__h.filter(function(n2) { + return !n2.__ || w2(n2); + }); + } catch (u4) { + r3.some(function(n2) { + n2.__h && (n2.__h = []); + }), r3 = [], l.__e(u4, t5.__v); + } + }), l2 && l2(t4, r3); +}, l.unmount = function(t4) { + m2 && m2(t4); + var r3, u4 = t4.__c; + u4 && u4.__H && (u4.__H.__.forEach(function(n2) { + try { + k2(n2); + } catch (n3) { + r3 = n3; + } + }), u4.__H = void 0, r3 && l.__e(r3, u4.__v)); +}; +var g2 = "function" == typeof requestAnimationFrame; +function j2(n2) { + var t4, r3 = function() { + clearTimeout(u4), g2 && cancelAnimationFrame(t4), setTimeout(n2); + }, u4 = setTimeout(r3, 100); + g2 && (t4 = requestAnimationFrame(r3)); +} +function k2(n2) { + var t4 = r2, u4 = n2.__c; + "function" == typeof u4 && (n2.__c = void 0, u4()), r2 = t4; +} +function w2(n2) { + var t4 = r2; + n2.__c = n2.__(), r2 = t4; +} +function z2(n2, t4) { + return !n2 || n2.length !== t4.length || t4.some(function(t5, r3) { + return t5 !== n2[r3]; + }); +} +function B2(n2, t4) { + return "function" == typeof t4 ? t4(n2) : t4; +} + +// node_modules/preact/compat/dist/compat.module.js +function g3(n2, t4) { + for (var e4 in t4) + n2[e4] = t4[e4]; + return n2; +} +function C2(n2, t4) { + for (var e4 in n2) + if ("__source" !== e4 && !(e4 in t4)) + return true; + for (var r3 in t4) + if ("__source" !== r3 && n2[r3] !== t4[r3]) + return true; + return false; +} +function E2(n2, t4) { + return n2 === t4 && (0 !== n2 || 1 / n2 == 1 / t4) || n2 != n2 && t4 != t4; +} +function w3(n2) { + this.props = n2; +} +function x3(n2, e4) { + function r3(n3) { + var t4 = this.props.ref, r4 = t4 == n3.ref; + return !r4 && t4 && (t4.call ? t4(null) : t4.current = null), e4 ? !e4(this.props, n3) || !r4 : C2(this.props, n3); + } + function u4(e5) { + return this.shouldComponentUpdate = r3, y(n2, e5); + } + return u4.displayName = "Memo(" + (n2.displayName || n2.name) + ")", u4.prototype.isReactComponent = true, u4.__f = true, u4; +} +(w3.prototype = new k()).isPureReactComponent = true, w3.prototype.shouldComponentUpdate = function(n2, t4) { + return C2(this.props, n2) || C2(this.state, t4); +}; +var R = l.__b; +l.__b = function(n2) { + n2.type && n2.type.__f && n2.ref && (n2.props.ref = n2.ref, n2.ref = null), R && R(n2); +}; +var N2 = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.forward_ref") || 3911; +function k3(n2) { + function t4(t5) { + var e4 = g3({}, t5); + return delete e4.ref, n2(e4, t5.ref || null); + } + return t4.$$typeof = N2, t4.render = t4, t4.prototype.isReactComponent = t4.__f = true, t4.displayName = "ForwardRef(" + (n2.displayName || n2.name) + ")", t4; +} +var A3 = function(n2, t4) { + return null == n2 ? null : P(P(n2).map(t4)); +}; +var O2 = { map: A3, forEach: A3, count: function(n2) { + return n2 ? P(n2).length : 0; +}, only: function(n2) { + var t4 = P(n2); + if (1 !== t4.length) + throw "Children.only"; + return t4[0]; +}, toArray: P }; +var T3 = l.__e; +l.__e = function(n2, t4, e4, r3) { + if (n2.then) { + for (var u4, o3 = t4; o3 = o3.__; ) + if ((u4 = o3.__c) && u4.__c) + return null == t4.__e && (t4.__e = e4.__e, t4.__k = e4.__k), u4.__c(n2, t4); + } + T3(n2, t4, e4, r3); +}; +var I2 = l.unmount; +function L2(n2, t4, e4) { + return n2 && (n2.__c && n2.__c.__H && (n2.__c.__H.__.forEach(function(n3) { + "function" == typeof n3.__c && n3.__c(); + }), n2.__c.__H = null), null != (n2 = g3({}, n2)).__c && (n2.__c.__P === e4 && (n2.__c.__P = t4), n2.__c = null), n2.__k = n2.__k && n2.__k.map(function(n3) { + return L2(n3, t4, e4); + })), n2; +} +function U(n2, t4, e4) { + return n2 && (n2.__v = null, n2.__k = n2.__k && n2.__k.map(function(n3) { + return U(n3, t4, e4); + }), n2.__c && n2.__c.__P === t4 && (n2.__e && e4.insertBefore(n2.__e, n2.__d), n2.__c.__e = true, n2.__c.__P = e4)), n2; +} +function D2() { + this.__u = 0, this.t = null, this.__b = null; +} +function F3(n2) { + var t4 = n2.__.__c; + return t4 && t4.__a && t4.__a(n2); +} +function M2(n2) { + var e4, r3, u4; + function o3(o4) { + if (e4 || (e4 = n2()).then(function(n3) { + r3 = n3.default || n3; + }, function(n3) { + u4 = n3; + }), u4) + throw u4; + if (!r3) + throw e4; + return y(r3, o4); + } + return o3.displayName = "Lazy", o3.__f = true, o3; +} +function V2() { + this.u = null, this.o = null; +} +l.unmount = function(n2) { + var t4 = n2.__c; + t4 && t4.__R && t4.__R(), t4 && true === n2.__h && (n2.type = null), I2 && I2(n2); +}, (D2.prototype = new k()).__c = function(n2, t4) { + var e4 = t4.__c, r3 = this; + null == r3.t && (r3.t = []), r3.t.push(e4); + var u4 = F3(r3.__v), o3 = false, i4 = function() { + o3 || (o3 = true, e4.__R = null, u4 ? u4(l3) : l3()); + }; + e4.__R = i4; + var l3 = function() { + if (!--r3.__u) { + if (r3.state.__a) { + var n3 = r3.state.__a; + r3.__v.__k[0] = U(n3, n3.__c.__P, n3.__c.__O); + } + var t5; + for (r3.setState({ __a: r3.__b = null }); t5 = r3.t.pop(); ) + t5.forceUpdate(); + } + }, c4 = true === t4.__h; + r3.__u++ || c4 || r3.setState({ __a: r3.__b = r3.__v.__k[0] }), n2.then(i4, i4); +}, D2.prototype.componentWillUnmount = function() { + this.t = []; +}, D2.prototype.render = function(n2, e4) { + if (this.__b) { + if (this.__v.__k) { + var r3 = document.createElement("div"), o3 = this.__v.__k[0].__c; + this.__v.__k[0] = L2(this.__b, r3, o3.__O = o3.__P); + } + this.__b = null; + } + var i4 = e4.__a && y(_, null, n2.fallback); + return i4 && (i4.__h = null), [y(_, null, e4.__a ? null : n2.children), i4]; +}; +var W = function(n2, t4, e4) { + if (++e4[1] === e4[0] && n2.o.delete(t4), n2.props.revealOrder && ("t" !== n2.props.revealOrder[0] || !n2.o.size)) + for (e4 = n2.u; e4; ) { + for (; e4.length > 3; ) + e4.pop()(); + if (e4[1] < e4[0]) + break; + n2.u = e4 = e4[2]; + } +}; +function P3(n2) { + return this.getChildContext = function() { + return n2.context; + }, n2.children; +} +function j3(n2) { + var e4 = this, r3 = n2.i; + e4.componentWillUnmount = function() { + B(null, e4.l), e4.l = null, e4.i = null; + }, e4.i && e4.i !== r3 && e4.componentWillUnmount(), n2.__v ? (e4.l || (e4.i = r3, e4.l = { nodeType: 1, parentNode: r3, childNodes: [], appendChild: function(n3) { + this.childNodes.push(n3), e4.i.appendChild(n3); + }, insertBefore: function(n3, t4) { + this.childNodes.push(n3), e4.i.appendChild(n3); + }, removeChild: function(n3) { + this.childNodes.splice(this.childNodes.indexOf(n3) >>> 1, 1), e4.i.removeChild(n3); + } }), B(y(P3, { context: e4.context }, n2.__v), e4.l)) : e4.l && e4.componentWillUnmount(); +} +function z3(n2, e4) { + var r3 = y(j3, { __v: n2, i: e4 }); + return r3.containerInfo = e4, r3; +} +(V2.prototype = new k()).__a = function(n2) { + var t4 = this, e4 = F3(t4.__v), r3 = t4.o.get(n2); + return r3[0]++, function(u4) { + var o3 = function() { + t4.props.revealOrder ? (r3.push(u4), W(t4, n2, r3)) : u4(); + }; + e4 ? e4(o3) : o3(); + }; +}, V2.prototype.render = function(n2) { + this.u = null, this.o = /* @__PURE__ */ new Map(); + var t4 = P(n2.children); + n2.revealOrder && "b" === n2.revealOrder[0] && t4.reverse(); + for (var e4 = t4.length; e4--; ) + this.o.set(t4[e4], this.u = [1, 0, this.u]); + return n2.children; +}, V2.prototype.componentDidUpdate = V2.prototype.componentDidMount = function() { + var n2 = this; + this.o.forEach(function(t4, e4) { + W(n2, e4, t4); + }); +}; +var B3 = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103; +var H2 = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/; +var Z = /^on(Ani|Tra|Tou|BeforeInp|Compo)/; +var Y = /[A-Z0-9]/g; +var $2 = "undefined" != typeof document; +var q3 = function(n2) { + return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/ : /fil|che|ra/).test(n2); +}; +function G(n2, t4, e4) { + return null == t4.__k && (t4.textContent = ""), B(n2, t4), "function" == typeof e4 && e4(), n2 ? n2.__c : null; +} +function J(n2, t4, e4) { + return D(n2, t4), "function" == typeof e4 && e4(), n2 ? n2.__c : null; +} +k.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t4) { + Object.defineProperty(k.prototype, t4, { configurable: true, get: function() { + return this["UNSAFE_" + t4]; + }, set: function(n2) { + Object.defineProperty(this, t4, { configurable: true, writable: true, value: n2 }); + } }); +}); +var K = l.event; +function Q() { +} +function X() { + return this.cancelBubble; +} +function nn() { + return this.defaultPrevented; +} +l.event = function(n2) { + return K && (n2 = K(n2)), n2.persist = Q, n2.isPropagationStopped = X, n2.isDefaultPrevented = nn, n2.nativeEvent = n2; +}; +var tn; +var en = { configurable: true, get: function() { + return this.class; +} }; +var rn = l.vnode; +l.vnode = function(n2) { + var t4 = n2.type, e4 = n2.props, u4 = e4; + if ("string" == typeof t4) { + for (var o3 in u4 = {}, e4) { + var i4 = e4[o3]; + if (!("value" === o3 && "defaultValue" in e4 && null == i4 || $2 && "children" === o3 && "noscript" === t4)) { + var l3 = o3.toLowerCase(); + "defaultValue" === o3 && "value" in e4 && null == e4.value ? o3 = "value" : "download" === o3 && true === i4 ? i4 = "" : "ondoubleclick" === l3 ? o3 = "ondblclick" : "onchange" !== l3 || "input" !== t4 && "textarea" !== t4 || q3(e4.type) ? "onfocus" === l3 ? o3 = "onfocusin" : "onblur" === l3 ? o3 = "onfocusout" : Z.test(o3) ? o3 = l3 : -1 === t4.indexOf("-") && H2.test(o3) ? o3 = o3.replace(Y, "-$&").toLowerCase() : null === i4 && (i4 = void 0) : l3 = o3 = "oninput", "oninput" === l3 && u4[o3 = l3] && (o3 = "oninputCapture"), u4[o3] = i4; + } + } + "select" == t4 && u4.multiple && Array.isArray(u4.value) && (u4.value = P(e4.children).forEach(function(n3) { + n3.props.selected = -1 != u4.value.indexOf(n3.props.value); + })), "select" == t4 && null != u4.defaultValue && (u4.value = P(e4.children).forEach(function(n3) { + n3.props.selected = u4.multiple ? -1 != u4.defaultValue.indexOf(n3.props.value) : u4.defaultValue == n3.props.value; + })), n2.props = u4, e4.class != e4.className && (en.enumerable = "className" in e4, null != e4.className && (u4.class = e4.className), Object.defineProperty(u4, "className", en)); + } + n2.$$typeof = B3, rn && rn(n2); +}; +var un = l.__r; +l.__r = function(n2) { + un && un(n2), tn = n2.__c; +}; +var on = l.diffed; +l.diffed = function(n2) { + on && on(n2); + var t4 = n2.props, e4 = n2.__e; + null != e4 && "textarea" === n2.type && "value" in t4 && t4.value !== e4.value && (e4.value = null == t4.value ? "" : t4.value), tn = null; +}; +var ln = { ReactCurrentDispatcher: { current: { readContext: function(n2) { + return tn.__n[n2.__c].props.value; +} } } }; +function fn(n2) { + return y.bind(null, n2); +} +function an(n2) { + return !!n2 && n2.$$typeof === B3; +} +function sn(n2) { + return an(n2) ? E.apply(null, arguments) : n2; +} +function hn(n2) { + return !!n2.__k && (B(null, n2), true); +} +function vn(n2) { + return n2 && (n2.base || 1 === n2.nodeType && n2) || null; +} +var dn = function(n2, t4) { + return n2(t4); +}; +var pn = function(n2, t4) { + return n2(t4); +}; +var mn = _; +function yn(n2) { + n2(); +} +function _n(n2) { + return n2; +} +function bn() { + return [false, yn]; +} +var Sn = y2; +function gn(n2, t4) { + var e4 = t4(), r3 = h2({ h: { __: e4, v: t4 } }), u4 = r3[0].h, o3 = r3[1]; + return y2(function() { + u4.__ = e4, u4.v = t4, E2(u4.__, t4()) || o3({ h: u4 }); + }, [n2, e4, t4]), p2(function() { + return E2(u4.__, u4.v()) || o3({ h: u4 }), n2(function() { + E2(u4.__, u4.v()) || o3({ h: u4 }); + }); + }, [n2]), e4; +} +var Cn = { useState: h2, useId: V, useReducer: s2, useEffect: p2, useLayoutEffect: y2, useInsertionEffect: Sn, useTransition: bn, useDeferredValue: _n, useSyncExternalStore: gn, startTransition: yn, useRef: _2, useImperativeHandle: A2, useMemo: F2, useCallback: T2, useContext: q2, useDebugValue: x2, version: "17.0.2", Children: O2, render: G, hydrate: J, unmountComponentAtNode: hn, createPortal: z3, createElement: y, createContext: F, createFactory: fn, cloneElement: sn, createRef: d, Fragment: _, isValidElement: an, findDOMNode: vn, Component: k, PureComponent: w3, memo: x3, forwardRef: k3, flushSync: pn, unstable_batchedUpdates: dn, StrictMode: mn, Suspense: D2, SuspenseList: V2, lazy: M2, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ln }; + +// node_modules/preact/compat/client.mjs +function createRoot(container) { + return { + render(children) { + G(children, container); }, - { - n: ["woman-woman-boy-boy", "family: woman, woman, boy, boy"], - u: "1f469-200d-1f469-200d-1f466-200d-1f466" + unmount() { + hn(container); + } + }; +} + +// src/utils/codemirror.ts +var import_language = require("@codemirror/language"); +var getActiveCM = (plugin) => { + let rcm; + plugin.app.workspace.iterateLeaves((leaf) => { + var _a2; + const cm = (_a2 = leaf.view.editor) == null ? void 0 : _a2.cm; + if (cm == null ? void 0 : cm.hasFocus) { + rcm = cm; + return true; + } + }, plugin.app.workspace["rootSplit"]); + return rcm; +}; +var getActiveMarkdownView = (plugin) => { + let rv; + plugin.app.workspace.iterateLeaves((leaf) => { + var _a2; + const cm = (_a2 = leaf.view.editor) == null ? void 0 : _a2.cm; + if (cm == null ? void 0 : cm.hasFocus) { + rv = leaf.view; + return true; + } + }, plugin.app.workspace["rootSplit"]); + return rv; +}; +function iterateTreeAtPos(pos, state, iterateFns) { + (0, import_language.syntaxTree)(state).iterate({ ...iterateFns, from: pos, to: pos }); +} +function iterateTreeInSelection(selection, state, iterateFns) { + (0, import_language.syntaxTree)(state).iterate({ + ...iterateFns, + from: selection.from, + to: selection.to + }); +} +function iterateTreeInDocument(state, iterateFns) { + (0, import_language.syntaxTree)(state).iterate({ ...iterateFns }); +} + +// src/codemirror/extensions/markSans/callout.tsx +var import_language2 = require("@codemirror/language"); +var import_state2 = require("@codemirror/state"); +var import_view2 = require("@codemirror/view"); + +// src/utils/uuid.js +function genId() { + return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace( + /[018]/g, + (c4) => (c4 ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c4 / 4).toString(16) + ); +} + +// src/codemirror/extensions/markSans/callout.tsx +var portalTypeAnnotation = import_state2.Annotation.define(); +var flowIDAnnotation = import_state2.Annotation.define(); +var flowIDStateField = import_state2.StateField.define({ + create: () => void 0, + update(value, tr) { + if (tr.annotation(flowIDAnnotation)) + return tr.annotation(flowIDAnnotation); + return value; + } +}); +var flowTypeStateField = import_state2.StateField.define({ + create: (state) => "none", + update(value, tr) { + if (tr.annotation(portalTypeAnnotation)) + return tr.annotation(portalTypeAnnotation); + return value; + } +}); +var calloutField = import_state2.StateField.define({ + create() { + return import_view2.Decoration.none; + }, + update(value, tr) { + if (tr.state.field(flowTypeStateField, false) != "doc") { + return value; + } + const builder = new import_state2.RangeSetBuilder(); + const nodes = []; + (0, import_language2.syntaxTree)(tr.state).iterate({ + enter: ({ name, from, to }) => { + nodes.push({ name, from, to }); + } + }); + const nextQuote = (ns, to) => { + const nq = ns.find( + (f4) => f4.from == to + 1 && f4.name.contains("HyperMD-quote") + ); + if (nq) { + return nextQuote(ns, nq.to); + } + return to; + }; + const previous = value.iter(); + const previousSpecs = []; + while (previous.value !== null) { + previousSpecs.push(previous.value.spec.widget.info); + previous.next(); + } + let index = 0; + nodes.map(({ name, from, to }) => { + if (name.contains("HyperMD-callout")) { + const existingCallout = previousSpecs[index]; + const endQuote = nextQuote(nodes, to); + const lineStart = tr.state.doc.lineAt(from).number; + const lineEnd = tr.state.doc.lineAt(endQuote).number; + if (existingCallout) { + builder.add( + from, + endQuote + 1, + calloutBlock( + { from: lineStart, to: lineEnd }, + tr.state.sliceDoc(from, endQuote), + existingCallout.id + ) + ); + } else { + builder.add( + from, + endQuote + 1, + calloutBlock( + { from: lineStart, to: lineEnd }, + tr.state.sliceDoc(from, endQuote), + genId() + ) + ); + } + index++; + } + }); + const dec = builder.finish(); + return dec; + }, + provide: (f4) => import_view2.EditorView.decorations.from(f4) +}); +var CalloutWidget = class extends import_view2.WidgetType { + constructor(info) { + super(); + this.info = info; + } + eq(other) { + return other.info.id === this.info.id; + } + toDOM() { + const parseTextToCallout = (text2) => { + if (!this.info.text) { + return { icon: "", title: "" }; + } + const stringArray = text2.split("\n"); + const titleRegex = RegExp(/.*\[!(\w*)\]\s(.*)/); + const title = titleRegex.exec(stringArray[0]); + if (!title || title.length < 3) { + return { icon: "", title: "" }; + } + return { + icon: title[1], + title: title[2] + }; + }; + const callOutData = parseTextToCallout(this.info.text); + const div = document.createElement("div"); + div.toggleClass("callout", true); + const divTitle = div.createDiv("div"); + divTitle.toggleClass("callout-title", true); + const div2 = div.createDiv("div"); + div2.toggleClass("callout-content", true); + div2.setAttribute("id", "mk-callout-" + this.info.id); + return div; + } +}; +var calloutBlock = (range, text2, id2) => import_view2.Decoration.widget({ + widget: new CalloutWidget({ range, text: text2, id: id2 }), + block: true +}); + +// src/types/types.ts +var eventTypes = { + activePathChange: "mkmd-active-path", + frameSelected: "mkmd-active-frame", + frameLayerSelected: "mkmd-frame-layer", + refreshView: "mkmd-refresh-view", + revealFile: "mkmd-reveal-file", + collapseFolders: "mkmd-collapse-folders", + toggleBacklinks: "mkmd-toggle-backlinks", + metadataChange: "mkmd-tags-change", + vaultChange: "mkmd-vault-change", + mdbChange: "mkmd-mdb-change", + spacesChange: "mkmd-spaces-change", + frameChange: "mkmd-frame-change", + updateSections: "mkmd-update-sections", + settingsChanged: "mkmd-settings-changed", + spawnPortal: "mkmd-portal-spawn", + loadPortal: "mkmd-portal-load", + openFilePortal: "mkmd-portal-file", + focusPortal: "mkmd-portal-focus" +}; + +// src/dispatch/flowEditor.ts +var createFlowEditorInElement = (id2, leaf, source, el, type, path, from, to) => { + const evt = new CustomEvent(eventTypes.spawnPortal, { + detail: { id: id2, leaf, source, el, path, from, to, type } + }); + activeWindow.dispatchEvent(evt); +}; +var loadFlowEditorByDOM = (el, view, id2) => { + const evt = new CustomEvent(eventTypes.loadPortal, { + detail: { id: id2, el, view } + }); + activeWindow.dispatchEvent(evt); +}; +var focusFlowEditor = (id2, top) => { + const evt = new CustomEvent(eventTypes.focusPortal, { + detail: { id: id2, parent: false, top } + }); + activeWindow.dispatchEvent(evt); +}; +var focusFlowEditorParent = (id2, top) => { + const evt = new CustomEvent(eventTypes.focusPortal, { + detail: { id: id2, parent: true, top } + }); + activeWindow.dispatchEvent(evt); +}; +var openFileFlowEditor = (file, source) => { + const evt = new CustomEvent(eventTypes.openFilePortal, { + detail: { file, source } + }); + activeWindow.dispatchEvent(evt); +}; + +// src/i18n.ts +var T4 = class { + constructor() { + this.all = { + en: { + hintText: { + dragDropModifierKeys: "Hold ${1} to Pin and ${2} to Copy" + }, + commands: { + h1: "Heading 1", + h2: "Heading 2", + h3: "Heading 3", + list: "Bullet List", + "ordered-list": "Numbered List", + todo: "To-do List", + quote: "Quote", + divider: "Divider", + note: "Link to Note", + link: "Web Link", + callout: "Callout", + table: "Table", + codeblock: "Code Block", + emoji: "Emoji", + image: "Image", + flow: "Flow Block", + tag: "Tag", + makeMenu: "Flow Menu", + selectStyle: "Style", + toggleKeyboard: "Toggle Keyboard" + }, + 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", + reloadSpaces: "Migrate Spaces From 0.7", + blink: "Blink", + openFileContext: "Open Explorer", + convertFolderNote: "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" + }, + menu: { + 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...", + 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", + none: "None", + tableView: "Table View", + cardView: "Card View", + listView: "List View", + flowView: "Flow View", + groupBy: "Group By", + sortBy: "Sort By", + newFilter: "New Filter", + clearFilters: "Clear Filters", + unhideFields: "Unhide All Properties", + importDataview: "Import All Dataview Properties", + saveAllProperties: "Save All Properties to Files", + mergeProperties: "Merge Properties", + openSpace: "Open", + removeFromSpace: "Unpin from Space", + 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)", + spaces: "Spaces", + tags: "Tags", + manageHiddenFiles: "Manage Hidden Files", + deleteSpace: "Delete", + changeColor: "Change Color", + changePropertyType: "Change Type", + deleteFiles: "Delete Files", + createFolderSpace: "Create Space from Folder", + folder: "Folder", + syncToContext: "Add Property to Context" + }, + buttons: { + moreOptions: "More Options", + newNote: "New Note", + changeIcon: "Change Sticker", + removeIcon: "Remove Sticker", + changeBanner: "Change Cover", + changeBannerShort: "Cover", + removeBanner: "Remove Cover", + rename: "Change Name", + saveSpace: "Save Space", + createSpace: "New Space", + createFolder: "New Folder/Space", + createNote: "New Note", + createCanvas: "New Canvas", + addIntoSpace: "New Pin", + cancel: "Cancel", + search: "Search", + delete: "Delete", + toggleFlow: "Toggle Flow", + openFlow: "Open Flow", + hideFlow: "Hide Flow", + openLink: "Open Link", + addToSpace: "Pin to Space", + addToSpaceShort: "Pin", + 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", + renameTable: "Rename Table", + currentFolder: "Current Folder", + sync: "Sync" + }, + 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" + }, + 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" + }, + number: { + label: "Number" + }, + preview: { + label: "Preview" + }, + boolean: { + label: "Yes/No" + }, + date: { + label: "Date" + }, + option: { + label: "Option" + }, + file: { + label: "File" + }, + link: { + label: "Link" + }, + tag: { + label: "Tag" + }, + object: { + label: "Object" + }, + context: { + label: "Relation" + }, + image: { + label: "Image" + }, + color: { + label: "Color" + }, + space: { + label: "Space" + }, + icon: { + label: "Icon" + }, + fileProperty: { + label: "Look Up", + createdTime: "Created", + modifiedTime: "Last Edited", + extension: "Extension", + size: "Size", + preview: "Note Preview", + parentFolder: "Folder" + } + }, + labels: { + createFolder: "New Folder Name", + rename: "Rename", + selectDateFormat: "Select/Type Date Format", + renameSectionSmart: "Edit Smart Space", + renameSection: "Edit Space", + createSectionSmart: "New Smart Space", + createSection: "New Space", + createNote: "New Note Name", + contextMaker: "Context Maker", + select: "Select", + collapse: "Collapse", + expand: "Expand", + findStickers: "Find Sticker", + mergeProperties: "Merge Properties", + placeholder: "Type '${1}' for commands", + noFile: "is not created yet. Click to create.", + blinkPlaceholder: "Quickly Search a File, Folder, Tag... Press Tab to Edit", + searchPlaceholder: "Type to search...", + contextItemSelectPlaceholder: "Find Item", + linkItemSelectPlaceholder: "Find or Create Note", + optionItemSelectPlaceholder: "Select Option", + viewItemSelectPlaceholder: "Select View", + tagItemSelectPlaceholder: "Find Tag", + spaceSelectPlaceholder: "Select Space", + propertyItemSelectPlaceholder: "Select Property", + sortItemSelectPlaceholder: "Select Sort", + filterItemSelectPlaceholder: "Select Filter", + syncFrontmatterProperty: "Sync Frontmatter Property", + newProperty: "New Property", + newPropertyShort: "New Property", + propertyType: "Type", + propertyValueSpace: "Space", + propertyValueProperty: "Property", + 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", + properties: "Properties", + content: "Content", + outgoingLinks: "Outgoing Links", + moveTo: "Move to", + addTo: "Pin to", + copyTo: "Copy to", + reorderIn: "Reorder in" + }, + descriptions: { + 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" + }, + settings: { + layoutVertical: "Vertical", + layoutHorizontal: "Horizontal", + sectionSidebar: "Spaces", + sectionEditor: "Maker Mode", + sectionFlow: "Flow", + sectionAdvanced: "Advanced", + sectionDataview: "Dataview", + sectionAppearance: "Appearance", + sectionDefault: "Default Spaces", + sectionContext: "Context", + 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" + }, + 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)" + }, + 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", + desc: "Hide the frontmatter when inline context is enabled" + }, + 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" + }, + lineNumbers: { + name: "Line Numbers", + desc: "Display line numbers" + }, + contexts: { + name: "Contexts", + desc: `Contexts allows you to have full control over the metadata of your files` + }, + spaces: { + name: "Spaces", + desc: `Spaces gives you control over how you organize your files` + }, + 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` + }, + defaultSpaces: { + name: "Enable 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 = localStorage.getItem("language"); + } + get texts() { + return this.all["en"]; + } +}; +var i18n_default = new T4().texts; + +// src/codemirror/extensions/flowEditor/flowEditor.tsx +var import_obsidian50 = require("obsidian"); + +// src/utils/array.ts +var insert = (arr, index, newItem) => !index || index <= 0 ? [ + newItem, + ...arr +] : [ + ...arr.slice(0, index), + newItem, + ...arr.slice(index) +]; +var insertMulti = (arr, index, newItem) => !index || index <= 0 ? [ + ...newItem, + ...arr +] : [ + ...arr.slice(0, index), + ...newItem, + ...arr.slice(index) +]; +var uniq = (a5) => [...new Set(a5)]; +var uniqCaseInsensitive = (a5) => [ + ...new Map(a5.map((s5) => [s5.toLowerCase(), s5])).values() +]; +var uniqueNameFromString = (name, cols) => { + let newName = name; + if (cols.includes(newName)) { + let append = 1; + while (cols.includes(newName)) { + newName = name + append.toString(); + append += 1; + } + } + return newName; +}; +var onlyUniqueProp = (prop) => (value, index, self2) => { + return self2.findIndex((v3) => value[prop] == v3[prop]) === index; +}; +var orderArrayByArray = (array, order, key2) => { + return array.sort(function(a5, b4) { + const A4 = order.indexOf(a5[key2]), B5 = order.indexOf(b4[key2]); + if (A4 > B5) { + if (A4 != -1 && B5 == -1) { + return -1; + } + return 1; + } else { + if (B5 != -1 && A4 == -1) { + return 1; + } + return -1; + } + }); +}; + +// src/utils/strings.ts +function ensureArray(value) { + if (Array.isArray(value)) { + return value; + } + return []; +} +function ensureStringValueFromSet(value, values, defaultValue2) { + const _v = ensureString(value); + return values.some((f4) => f4 == _v) ? _v : defaultValue2; +} +function ensureString(value) { + if (!value) + return ""; + if (typeof value !== "string") { + return value.toString(); + } + return value; +} +function ensureBoolean(value) { + if (!value) + return false; + return true; +} +function parseStickerString(input) { + if (!input) { + return ["", ""]; + } + const match2 = input.match(/^(.*?)\s*\/\/\s*(.*)$/); + if (match2) { + return [match2[1], match2[2]]; + } else { + return ["", input]; + } +} +var emojiFromString = (emoji) => { + let html; + try { + html = unifiedToNative(emoji); + } catch (e4) { + html = emoji; + } + return html; +}; +var unifiedToNative = (unified) => { + const unicodes = unified.split("-"); + const codePoints = unicodes.map((u4) => `0x${u4}`); + return String.fromCodePoint(...codePoints); +}; +var indexOfCharElseEOS = (char, str) => { + if (str.indexOf(char) > 0) + return str.indexOf(char); + return str.length; +}; +var spaceNameFromSpacePath = (contextPath, plugin) => { + var _a2, _b2; + return (_b2 = (_a2 = plugin.index.spacesIndex.get(contextPath)) == null ? void 0 : _a2.name) != null ? _b2 : contextPath; +}; +var spacePathFromName = (spaceName) => "spaces://" + encodeSpaceName(spaceName); +var encodeSpaceName = (spaceName) => spaceName.replace(/\//g, "+"); +var tagSpacePathFromTag = (tag) => "spaces://" + tag; +var wrapQuotes = (s5) => `"${s5}"`; +var removeQuotes = (s5) => { + if (!s5) + return s5; + const singleQuoteWithSemicolon = s5.startsWith("'") && (s5.endsWith("';") || s5.endsWith("'")); + const doubleQuoteWithSemicolon = s5.startsWith('"') && (s5.endsWith('";') || s5.endsWith('"')); + if (singleQuoteWithSemicolon || doubleQuoteWithSemicolon) { + s5 = s5.substring(1, s5.length - 1); + if (s5.endsWith('"') || s5.endsWith("'")) { + s5 = s5.substring(0, s5.length - 1); + } + return s5; + } else { + return s5; + } +}; +var filePathToString = (filename) => { + if (filename.lastIndexOf("/") != -1) { + if (filename.lastIndexOf(".") != -1) + return removeLeadingSlash( + filename.substring( + filename.lastIndexOf("/") + 1, + filename.lastIndexOf(".") + ) + ); + return filename.substring(filename.lastIndexOf("/") + 1); + } + if (filename.lastIndexOf(".") != -1) { + return filename.substring(0, filename.lastIndexOf(".")); + } + return filename; +}; +var stringFromTag = (string) => { + if (string.charAt(0) == "#") { + if (string.charAt(1) == "#") { + return string.substring(2, string.length); + } + return string.substring(1, string.length); + } + return string; +}; +var fileNameToString = (filename) => filename.substring(0, filename.lastIndexOf(".")) || filename; +var removeLeadingSlash = (path) => path.charAt(0) == "/" ? path.substring(1) : path; +var filePathToFolderPath = (filename) => removeLeadingSlash(filename.substring(0, filename.lastIndexOf("/"))) || filename; +var folderPathToString = (filename) => removeLeadingSlash(filename.substring(filename.lastIndexOf("/"))) || filename; +var pathDisplayName = (path, plugin) => { + if (!path) + return ""; + if (path.type == "vault") + return plugin.app.vault.getName(); + if ((path == null ? void 0 : path.type) == "folder") { + return folderPathToString(path.path); + } + if ((path == null ? void 0 : path.type) == "tag") + return stringFromTag(path.space); + if ((path == null ? void 0 : path.type) == "space") + return spaceNameFromSpacePath(path.space, plugin); + if (path.isRemote) { + return folderPathToString(path.path); + } + return path.path; +}; +var folderNotePathFromAFile = (settings, aFile) => !aFile ? null : settings.folderNoteInsideFolder ? `${aFile.path}/${aFile.name}.md` : aFile.parent == "/" ? `${aFile.name}.md` : `${aFile.parent}/${aFile.name}.md`; +var folderPathFromFolderNoteFile = (settings, aFile) => !aFile ? null : settings.folderNoteInsideFolder ? aFile.parent : `${aFile.parent}/${aFile.name}`; +var spacePathFromSpaceDefFile = (aFile) => !aFile ? null : "spaces://" + aFile.name; + +// src/utils/parser.tsx +var parseSortStrat = (str) => { + const [a5, b4] = str.split("_"); + return { field: a5, asc: b4 == "asc", group: true }; +}; +var parseMultiString = (str) => { + var _a2; + return (_a2 = str == null ? void 0 : str.match(/(\\.|[^,])+/g)) != null ? _a2 : []; +}; +var parseLinkString = (string) => { + if (!string) + return ""; + const match2 = /\[\[(.*?)\]\]/g.exec(string); + const stringValue = (match2 == null ? void 0 : match2.length) > 1 ? match2[1].substring(0, indexOfCharElseEOS("|", match2[1])) : string; + if (stringValue) + return stringValue; + return string; +}; +var parseLinkDisplayString = (string) => { + return filePathToString(parseLinkString(string)); +}; + +// src/utils/serializer.ts +var serializeMultiString = (value) => value.join(","); +var serializeMultiDisplayString = (value) => value.join(", "); +var serializeSQLValues = (value) => value.join(", "); +var serializeSQLStatements = (value) => value.join("; "); +var serializeSQLFieldNames = (value) => value.join(","); + +// src/utils/file.ts +var import_obsidian49 = require("obsidian"); + +// src/react/components/RemoteMarkdownView/FileView.tsx +var import_obsidian2 = require("obsidian"); + +// src/react/components/RemoteMarkdownView/FileLinkViewComponent.tsx +var import_obsidian = require("obsidian"); +var FileLinkViewComponent = (props2) => { + const ref2 = _2(null); + const [markdown, setMarkdown] = h2(""); + p2(() => { + if (ref2.current) + import_obsidian.MarkdownRenderer.render( + props2.plugin.app, + markdown, + ref2.current, + props2.path, + props2.component + ); + }, [markdown]); + p2(() => { + fetch(props2.path).then((res) => res.text()).then((f4) => setMarkdown(f4)); + }, [props2.path]); + return /* @__PURE__ */ Cn.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__ */ Cn.createElement("div", { + className: "markdown-preview-sizer markdown-preview-section", + ref: ref2 + })); +}; + +// src/react/components/RemoteMarkdownView/FileView.tsx +var FILE_VIEW_TYPE = "make-file-view"; +var FileLinkView = class extends import_obsidian2.ItemView { + constructor(leaf, plugin, viewType) { + super(leaf); + this.navigation = true; + this.plugin = plugin; + this.viewType = viewType; + } + getViewType() { + return FILE_VIEW_TYPE; + } + getDisplayText() { + return this.path; + } + async onClose() { + this.destroy(); + } + destroy() { + if (this.root) + this.root.unmount(); + } + async onOpen() { + this.destroy(); + } + async setState(state, result) { + this.path = state.path; + this.constructView(this.path); + const displayName = this.path; + await super.setState(state, result); + this.leaf.tabHeaderInnerTitleEl.innerText = displayName; + this.leaf.view.titleEl = displayName; + const headerEl = this.leaf.view.headerEl; + if (headerEl) { + headerEl.querySelector(".view-header-title").innerText = displayName; + } + result.history = true; + return; + } + getState() { + const state = super.getState(); + state.path = this.path; + return state; + } + constructView(path) { + this.destroy(); + this.root = createRoot(this.contentEl); + this.root.render( + /* @__PURE__ */ Cn.createElement("div", { + className: "markdown-reading-view" + }, /* @__PURE__ */ Cn.createElement(FileLinkViewComponent, { + path, + plugin: this.plugin, + component: this + })) + ); + } +}; + +// src/react/components/SpaceView/Contexts/SpaceView.tsx +var import_obsidian48 = require("obsidian"); + +// src/react/context/FramesMDBContext.tsx +var import_obsidian5 = require("obsidian"); + +// src/types/mframe.ts +var defaultFrameEditorProps = { editMode: 0 }; + +// src/utils/objects.ts +var replaceKeys = (object1, object2) => { + const newObject = {}; + for (const key2 in object1) { + const newKey = Object.prototype.hasOwnProperty.call(object2, key2) ? object2[key2] : key2; + newObject[newKey] = object1[key2]; + } + return newObject; +}; +function applyFunctionToObject(object, func) { + const newObject = {}; + for (const key2 in object) { + if (Object.prototype.hasOwnProperty.call(object, key2)) { + newObject[key2] = func(object[key2]); + } + } + return newObject; +} +var replaceKeysByValue = (object1, object2) => { + const reversedObject2 = {}; + for (const key2 in object2) { + reversedObject2[object2[key2]] = key2; + } + return replaceKeys(object1, reversedObject2); +}; + +// src/utils/uri.ts +var import_obsidian3 = require("obsidian"); + +// src/utils/regex.ts +var relativeURLRegex = /^[a-zA-Z0-9][^\\\\:|<\>"*?]*$/g; +var urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi; + +// src/utils/uri.ts +var openPath = (plugin, _path, location) => { + if (!_path) + return; + const { type, path } = _path; + if (type == "file" || type == "folder") { + const afile = getAbstractFileAtPath(plugin, path); + if (afile) { + openAFile(afile, plugin, location); + } else { + if (type == "file") + createNewMarkdownFile( + plugin, + defaultNoteFolder(plugin, null), + path + ); + } + return; + } + if (type == "tag") { + openTagContext(path, plugin, location); + return; + } + if (type == "url") { + openURL(path, plugin, location); + return; + } +}; +var uriForFolder = (path) => { + if (path == "/") + return { + type: "vault", + basePath: path, + fullPath: path, + space: null, + path, + alias: null, + ref: null, + refStr: null, + refType: null, + query: null + }; + return { + type: "folder", + basePath: path, + fullPath: path, + space: null, + path, + alias: null, + ref: null, + refStr: null, + refType: null, + query: null + }; +}; +function uriByString(plugin, uri, source) { + if (!uri) + return null; + const fullPath = uri; + let refTypeChar = ""; + const parseQuery = (queryString) => { + const query2 = {}; + queryString.split("&").forEach((param) => { + const [key2, value] = param.split("="); + query2[decodeURIComponent(key2)] = decodeURIComponent(value); + }); + return query2; + }; + const mapRefType = (refTypeChar2) => { + if (refTypeChar2 === "^") + return "context"; + if (refTypeChar2 === "*") + return "frame"; + return null; + }; + let space = null; + let path = null; + let alias = null; + let reference = null; + let refType = null; + let query = null; + if (uri.startsWith("spaces://")) { + const spaceStr = uri.slice("spaces://".length); + if (spaceStr.charAt(0) == "#") { + const endIndex = spaceStr.lastIndexOf("/#"); + if (endIndex != -1) { + space = spaceStr.slice(0, endIndex); + uri = spaceStr.slice(endIndex); + } else { + space = spaceStr; + uri = "/"; + } + } else { + const spaceParts = spaceStr.split("/"); + space = spaceParts[0]; + uri = "/" + (spaceParts.slice(1).join("/") || ""); + } + } + const lastSlashIndex = uri.lastIndexOf("/"); + const lastHashIndex = uri.lastIndexOf("#"); + const lastPipeIndex = uri.lastIndexOf("|"); + const queryIndex = uri.lastIndexOf("?"); + if (queryIndex !== -1) { + query = parseQuery(uri.slice(queryIndex + 1)); + uri = uri.slice(0, queryIndex); + } + if (lastHashIndex !== -1 && lastHashIndex > lastSlashIndex) { + const refPart = uri.slice(lastHashIndex + 1); + refType = mapRefType(refPart[0]); + if (refType || lastHashIndex != lastSlashIndex + 1) { + refTypeChar = refPart[0]; + reference = refType ? refPart.slice(1) : refPart; + uri = uri.slice(0, lastHashIndex); + } + } + if (lastPipeIndex !== -1 && lastPipeIndex > lastSlashIndex) { + alias = uri.slice(lastPipeIndex + 1); + uri = uri.slice(0, lastPipeIndex); + } + path = uri; + return { + basePath: `${space ? `spaces://${space}` : path}`, + type: uriTypeByString(plugin, space, path, source), + space, + fullPath, + path: removeTrailingSlashFromFolder(uri), + alias, + ref: reference, + refType, + refStr: refTypeChar ? refTypeChar + reference : null, + query + }; +} +var uriTypeByString = (plugin, space, file, source) => { + if ((space == null ? void 0 : space.charAt(0)) == "#") { + return "tag"; + } + if ((space == null ? void 0 : space.length) > 0) { + return "space"; + } + if (file.charAt(file.length - 1) == "/") { + if (file == "/") + return "vault"; + return "folder"; + } + let portalFile; + if (source) { + portalFile = plugin.app.metadataCache.getFirstLinkpathDest(file, source); + } else { + portalFile = plugin.app.vault.getAbstractFileByPath(file); + } + if (portalFile instanceof import_obsidian3.TFolder) { + return "folder"; + } + if (portalFile instanceof import_obsidian3.TFile || file.match(relativeURLRegex)) { + return "file"; + } + if (file.match(urlRegex)) + return "url"; + return "unknown"; +}; + +// node_modules/acorn/dist/acorn.mjs +var astralIdentifierCodes = [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]; +var astralIdentifierStartCodes = [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, 3104, 541, 1507, 4938, 6, 4191]; +var nonASCIIidentifierChars = "\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\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\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"; +var nonASCIIidentifierStartChars = "\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"; +var reservedWords = { + 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" +}; +var ecma5AndLessKeywords = "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"; +var keywords$1 = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" +}; +var keywordRelationalOperator = /^in(stanceof)?$/; +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +function isInAstralSet(code, set) { + var pos = 65536; + for (var i4 = 0; i4 < set.length; i4 += 2) { + pos += set[i4]; + if (pos > code) { + return false; + } + pos += set[i4 + 1]; + if (pos >= code) { + return true; + } + } + return false; +} +function isIdentifierStart(code, astral) { + if (code < 65) { + return code === 36; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code, astral) { + if (code < 48) { + return code === 36; + } + if (code < 58) { + return true; + } + if (code < 65) { + return false; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +var TokenType = function TokenType2(label, conf) { + if (conf === void 0) + conf = {}; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; +}; +function binop(name, prec) { + return new TokenType(name, { beforeExpr: true, binop: prec }); +} +var beforeExpr = { beforeExpr: true }; +var startsExpr = { startsExpr: true }; +var keywords = {}; +function kw(name, options) { + if (options === void 0) + options = {}; + options.keyword = name; + return keywords[name] = new TokenType(name, options); +} +var types$1 = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + privateId: new TokenType("privateId", startsExpr), + eof: new TokenType("eof"), + bracketL: new TokenType("[", { beforeExpr: true, startsExpr: true }), + bracketR: new TokenType("]"), + braceL: new TokenType("{", { beforeExpr: true, startsExpr: true }), + braceR: new TokenType("}"), + parenL: new TokenType("(", { beforeExpr: true, startsExpr: true }), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", { beforeExpr: true, startsExpr: true }), + eq: new TokenType("=", { beforeExpr: true, isAssign: true }), + assign: new TokenType("_=", { beforeExpr: true, isAssign: true }), + incDec: new TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), + prefix: new TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", { beforeExpr: true }), + coalesce: binop("??", 1), + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", { isLoop: true, beforeExpr: true }), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", { isLoop: true }), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", { isLoop: true }), + _with: kw("with"), + _new: kw("new", { beforeExpr: true, startsExpr: true }), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", { beforeExpr: true, binop: 7 }), + _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), + _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), + _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), + _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) +}; +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code) { + return code === 10 || code === 13 || code === 8232 || code === 8233; +} +function nextLineBreak(code, from, end) { + if (end === void 0) + end = code.length; + for (var i4 = from; i4 < end; i4++) { + var next = code.charCodeAt(i4); + if (isNewLine(next)) { + return i4 < end - 1 && next === 13 && code.charCodeAt(i4 + 1) === 10 ? i4 + 2 : i4 + 1; + } + } + return -1; +} +var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +var ref = Object.prototype; +var hasOwnProperty = ref.hasOwnProperty; +var toString = ref.toString; +var hasOwn = Object.hasOwn || function(obj, propName) { + return hasOwnProperty.call(obj, propName); +}; +var isArray = Array.isArray || function(obj) { + return toString.call(obj) === "[object Array]"; +}; +function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); +} +function codePointToString(code) { + if (code <= 65535) { + return String.fromCharCode(code); + } + code -= 65536; + return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); +} +var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; +var Position = function Position2(line, col) { + this.line = line; + this.column = col; +}; +Position.prototype.offset = function offset(n2) { + return new Position(this.line, this.column + n2); +}; +var SourceLocation = function SourceLocation2(p3, start, end) { + this.start = start; + this.end = end; + if (p3.sourceFile !== null) { + this.source = p3.sourceFile; + } +}; +function getLineInfo(input, offset2) { + for (var line = 1, cur = 0; ; ) { + var nextBreak = nextLineBreak(input, cur, offset2); + if (nextBreak < 0) { + return new Position(line, offset2 - cur); + } + ++line; + cur = nextBreak; + } +} +var defaultOptions = { + ecmaVersion: null, + sourceType: "script", + onInsertedSemicolon: null, + onTrailingComma: null, + allowReserved: null, + allowReturnOutsideFunction: false, + allowImportExportEverywhere: false, + allowAwaitOutsideFunction: null, + allowSuperOutsideMethod: null, + allowHashBang: false, + locations: false, + onToken: null, + onComment: null, + ranges: false, + program: null, + sourceFile: null, + directSourceFile: null, + preserveParens: false +}; +var warnedAboutEcmaVersion = false; +function getOptions(opts) { + var options = {}; + for (var opt in defaultOptions) { + options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; + } + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } + if (options.allowReserved == null) { + options.allowReserved = options.ecmaVersion < 5; + } + if (!opts || opts.allowHashBang == null) { + options.allowHashBang = options.ecmaVersion >= 14; + } + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function(token) { + return tokens.push(token); + }; + } + if (isArray(options.onComment)) { + options.onComment = pushComment(options, options.onComment); + } + return options; +} +function pushComment(options, array) { + return function(block, text2, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text2, + start, + end + }; + if (options.locations) { + comment.loc = new SourceLocation(this, startLoc, endLoc); + } + if (options.ranges) { + comment.range = [start, end]; + } + array.push(comment); + }; +} +var SCOPE_TOP = 1; +var SCOPE_FUNCTION = 2; +var SCOPE_ASYNC = 4; +var SCOPE_GENERATOR = 8; +var SCOPE_ARROW = 16; +var SCOPE_SIMPLE_CATCH = 32; +var SCOPE_SUPER = 64; +var SCOPE_DIRECT_SUPER = 128; +var SCOPE_CLASS_STATIC_BLOCK = 256; +var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; +function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0); +} +var BIND_NONE = 0; +var BIND_VAR = 1; +var BIND_LEXICAL = 2; +var BIND_FUNCTION = 3; +var BIND_SIMPLE_CATCH = 4; +var BIND_OUTSIDE = 5; +var Parser = function Parser2(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; + if (options.sourceType === "module") { + reserved += " await"; + } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + this.containsEsc = false; + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + this.type = types$1.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 = true; + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + this.labels = []; + this.undefinedExports = /* @__PURE__ */ Object.create(null); + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { + this.skipLineComment(2); + } + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + this.regexpState = null; + this.privateNameStack = []; +}; +var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } }; +Parser.prototype.parse = function parse() { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node); +}; +prototypeAccessors.inFunction.get = function() { + return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; +}; +prototypeAccessors.inGenerator.get = function() { + return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit; +}; +prototypeAccessors.inAsync.get = function() { + return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit; +}; +prototypeAccessors.canAwait.get = function() { + for (var i4 = this.scopeStack.length - 1; i4 >= 0; i4--) { + var scope = this.scopeStack[i4]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { + return false; + } + if (scope.flags & SCOPE_FUNCTION) { + return (scope.flags & SCOPE_ASYNC) > 0; + } + } + return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; +}; +prototypeAccessors.allowSuper.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; +}; +prototypeAccessors.allowDirectSuper.get = function() { + return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; +}; +prototypeAccessors.treatFunctionsAsVar.get = function() { + return this.treatFunctionsAsVarInScope(this.currentScope()); +}; +prototypeAccessors.allowNewDotTarget.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit; +}; +prototypeAccessors.inClassStaticBlock.get = function() { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0; +}; +Parser.extend = function extend() { + var plugins = [], len = arguments.length; + while (len--) + plugins[len] = arguments[len]; + var cls = this; + for (var i4 = 0; i4 < plugins.length; i4++) { + cls = plugins[i4](cls); + } + return cls; +}; +Parser.parse = function parse2(input, options) { + return new this(options, input).parse(); +}; +Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression(); +}; +Parser.tokenizer = function tokenizer(input, options) { + return new this(options, input); +}; +Object.defineProperties(Parser.prototype, prototypeAccessors); +var pp$9 = Parser.prototype; +var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; +pp$9.strictDirective = function(start) { + if (this.options.ecmaVersion < 5) { + return false; + } + for (; ; ) { + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + var match2 = literal.exec(this.input.slice(start)); + if (!match2) { + return false; + } + if ((match2[1] || match2[2]) === "use strict") { + skipWhiteSpace.lastIndex = start + match2[0].length; + var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); + } + start += match2[0].length; + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start] === ";") { + start++; + } + } +}; +pp$9.eat = function(type) { + if (this.type === type) { + this.next(); + return true; + } else { + return false; + } +}; +pp$9.isContextual = function(name) { + return this.type === types$1.name && this.value === name && !this.containsEsc; +}; +pp$9.eatContextual = function(name) { + if (!this.isContextual(name)) { + return false; + } + this.next(); + return true; +}; +pp$9.expectContextual = function(name) { + if (!this.eatContextual(name)) { + this.unexpected(); + } +}; +pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); +}; +pp$9.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) { + this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); + } + return true; + } +}; +pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { + this.unexpected(); + } +}; +pp$9.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) { + this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); + } + if (!notNext) { + this.next(); + } + return true; + } +}; +pp$9.expect = function(type) { + this.eat(type) || this.unexpected(); +}; +pp$9.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); +}; +var DestructuringErrors = function DestructuringErrors2() { + this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; +}; +pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { + return; + } + if (refDestructuringErrors.trailingComma > -1) { + this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); + } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { + this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); + } +}; +pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { + return false; + } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { + return shorthandAssign >= 0 || doubleProto >= 0; + } + if (shorthandAssign >= 0) { + this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); + } + if (doubleProto >= 0) { + this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); + } +}; +pp$9.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { + this.raise(this.yieldPos, "Yield expression cannot be a default value"); + } + if (this.awaitPos) { + this.raise(this.awaitPos, "Await expression cannot be a default value"); + } +}; +pp$9.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") { + return this.isSimpleAssignTarget(expr.expression); + } + return expr.type === "Identifier" || expr.type === "MemberExpression"; +}; +var pp$8 = Parser.prototype; +pp$8.parseTopLevel = function(node) { + var exports = /* @__PURE__ */ Object.create(null); + if (!node.body) { + node.body = []; + } + while (this.type !== types$1.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) { + for (var i4 = 0, list = Object.keys(this.undefinedExports); i4 < list.length; i4 += 1) { + var name = list[i4]; + this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined"); + } + } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program"); +}; +var loopLabel = { kind: "loop" }; +var switchLabel = { kind: "switch" }; +pp$8.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh === 92) { + return true; + } + if (context) { + return false; + } + if (nextCh === 123 || nextCh > 55295 && nextCh < 56320) { + return true; + } + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { + ++pos; + } + if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { + return true; + } + } + return false; +}; +pp$8.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, after; + return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320)); +}; +pp$8.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + if (this.isLet(context)) { + starttype = types$1._var; + kind = "let"; + } + switch (starttype) { + case types$1._break: + case types$1._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case types$1._debugger: + return this.parseDebuggerStatement(node); + case types$1._do: + return this.parseDoStatement(node); + case types$1._for: + return this.parseForStatement(node); + case types$1._function: + if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) { + this.unexpected(); + } + return this.parseFunctionStatement(node, false, !context); + case types$1._class: + if (context) { + this.unexpected(); + } + return this.parseClass(node, true); + case types$1._if: + return this.parseIfStatement(node); + case types$1._return: + return this.parseReturnStatement(node); + case types$1._switch: + return this.parseSwitchStatement(node); + case types$1._throw: + return this.parseThrowStatement(node); + case types$1._try: + return this.parseTryStatement(node); + case types$1._const: + case types$1._var: + kind = kind || this.value; + if (context && kind !== "var") { + this.unexpected(); + } + return this.parseVarStatement(node, kind); + case types$1._while: + return this.parseWhileStatement(node); + case types$1._with: + return this.parseWithStatement(node); + case types$1.braceL: + return this.parseBlock(true, node); + case types$1.semi: + return this.parseEmptyStatement(node); + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) { + return this.parseExpressionStatement(node, this.parseExpression()); + } + } + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) { + this.raise(this.start, "'import' and 'export' may only appear at the top level"); + } + if (!this.inModule) { + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + } + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports); + default: + if (this.isAsyncFunction()) { + if (context) { + this.unexpected(); + } + this.next(); + return this.parseFunctionStatement(node, true, !context); + } + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { + return this.parseLabeledStatement(node, maybeName, expr, context); + } else { + return this.parseExpressionStatement(node, expr); + } + } +}; +pp$8.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.label = null; + } else if (this.type !== types$1.name) { + this.unexpected(); + } else { + node.label = this.parseIdent(); + this.semicolon(); + } + var i4 = 0; + for (; i4 < this.labels.length; ++i4) { + var lab = this.labels[i4]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { + break; + } + if (node.label && isBreak) { + break; + } + } + } + if (i4 === this.labels.length) { + this.raise(node.start, "Unsyntactic " + keyword); + } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); +}; +pp$8.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); +}; +pp$8.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types$1._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) { + this.eat(types$1.semi); + } else { + this.semicolon(); + } + return this.finishNode(node, "DoWhileStatement"); +}; +pp$8.parseForStatement = function(node) { + this.next(); + var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types$1.parenL); + if (this.type === types$1.semi) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + var isLet = this.isLet(); + if (this.type === types$1._var || this.type === types$1._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + return this.parseForIn(node, init$1); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init$1); + } + var startsWithLet = this.isContextual("let"), isForOf = false; + var refDestructuringErrors = new DestructuringErrors(); + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + if (startsWithLet && isForOf) { + this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLValPattern(init); + return this.parseForIn(node, init); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); +}; +pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync); +}; +pp$8.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement"); +}; +pp$8.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.start, "'return' outside of function"); + } + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); +}; +pp$8.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types$1.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + var cur; + for (var sawDefault = false; this.type !== types$1.braceR; ) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); + } + sawDefault = true; + cur.test = null; + } + this.expect(types$1.colon); + } else { + if (!cur) { + this.unexpected(); + } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + this.next(); + this.labels.pop(); + return this.finishNode(node, "SwitchStatement"); +}; +pp$8.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { + this.raise(this.lastTokEnd, "Illegal newline after throw"); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); +}; +var empty$1 = []; +pp$8.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types$1._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types$1.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types$1.parenR); + } else { + if (this.options.ecmaVersion < 10) { + this.unexpected(); + } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + return this.finishNode(node, "TryStatement"); +}; +pp$8.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); +}; +pp$8.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement"); +}; +pp$8.parseWithStatement = function(node) { + if (this.strict) { + this.raise(this.start, "'with' in strict mode"); + } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement"); +}; +pp$8.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); +}; +pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { + var label = list[i$1]; + if (label.name === maybeName) { + this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } + } + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; + for (var i4 = this.labels.length - 1; i4 >= 0; i4--) { + var label$1 = this.labels[i4]; + if (label$1.statementStart === node.start) { + label$1.statementStart = this.start; + label$1.kind = kind; + } else { + break; + } + } + this.labels.push({ name: maybeName, kind, statementStart: this.start }); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); +}; +pp$8.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); +}; +pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if (createNewLexicalScope === void 0) + createNewLexicalScope = true; + if (node === void 0) + node = this.startNode(); + node.body = []; + this.expect(types$1.braceL); + if (createNewLexicalScope) { + this.enterScope(0); + } + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { + this.strict = false; + } + this.next(); + if (createNewLexicalScope) { + this.exitScope(); + } + return this.finishNode(node, "BlockStatement"); +}; +pp$8.parseFor = function(node, init) { + node.init = init; + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement"); +}; +pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; + this.next(); + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise( + init.start, + (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" + ); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); +}; +pp$8.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (; ; ) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types$1.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types$1.comma)) { + break; + } + } + return node; +}; +pp$8.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); +}; +var FUNC_STATEMENT = 1; +var FUNC_HANGING_STATEMENT = 2; +var FUNC_NULLABLE_ID = 4; +pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) { + this.unexpected(); + } + node.generator = this.eat(types$1.star); + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + if (statement & FUNC_STATEMENT) { + node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) { + this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); + } + } + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + if (!(statement & FUNC_STATEMENT)) { + node.id = this.type === types$1.name ? this.parseIdent() : null; + } + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression"); +}; +pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); +}; +pp$8.parseClass = function(node, isStatement) { + this.next(); + var oldStrict = this.strict; + this.strict = true; + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { + this.raise(element.start, "Duplicate constructor in the same class"); + } + hadConstructor = true; + } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { + this.raiseRecoverable(element.key.start, "Identifier '#" + element.key.name + "' has already been declared"); + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); +}; +pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { + return null; + } + var ecmaVersion = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + if (this.eatContextual("static")) { + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { + this.parseClassStaticBlock(node); + return node; + } + if (this.isClassElementNameStart() || this.type === types$1.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + if (keyName) { + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + if (isConstructor && kind !== "method") { + this.raise(node.key.start, "Constructor can't have get/set modifier"); + } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } + return node; +}; +pp$8.isClassElementNameStart = function() { + return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword; +}; +pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); + } + element.computed = false; + element.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element); + } +}; +pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + var key2 = method.key; + if (method.kind === "constructor") { + if (isGenerator) { + this.raise(key2.start, "Constructor can't be a generator"); + } + if (isAsync) { + this.raise(key2.start, "Constructor can't be an async method"); + } + } else if (method.static && checkKeyName(method, "prototype")) { + this.raise(key2.start, "Classes may not have a static property named prototype"); + } + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && value.params.length !== 0) { + this.raiseRecoverable(value.start, "getter should have no params"); + } + if (method.kind === "set" && value.params.length !== 1) { + this.raiseRecoverable(value.start, "setter should have exactly one param"); + } + if (method.kind === "set" && value.params[0].type === "RestElement") { + this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); + } + return this.finishNode(method, "MethodDefinition"); +}; +pp$8.parseClassField = function(field) { + if (checkKeyName(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + if (this.eat(types$1.eq)) { + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + return this.finishNode(field, "PropertyDefinition"); +}; +pp$8.parseClassStaticBlock = function(node) { + node.body = []; + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + return this.finishNode(node, "StaticBlock"); +}; +pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { + node.id = this.parseIdent(); + if (isStatement) { + this.checkLValSimple(node.id, BIND_LEXICAL, false); + } + } else { + if (isStatement === true) { + this.unexpected(); + } + node.id = null; + } +}; +pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; +}; +pp$8.enterClassBody = function() { + var element = { declared: /* @__PURE__ */ Object.create(null), used: [] }; + this.privateNameStack.push(element); + return element.declared; +}; +pp$8.exitClassBody = function() { + var ref2 = this.privateNameStack.pop(); + var declared = ref2.declared; + var used = ref2.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i4 = 0; i4 < used.length; ++i4) { + var id2 = used[i4]; + if (!hasOwn(declared, id2.name)) { + if (parent) { + parent.used.push(id2); + } else { + this.raiseRecoverable(id2.start, "Private field '#" + id2.name + "' must be declared in an enclosing class"); + } + } + } +}; +function isPrivateNameConflicted(privateNameMap, element) { + var name = element.key.name; + var curr = privateNameMap[name]; + var next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { + privateNameMap[name] = "true"; + return false; + } else if (!curr) { + privateNameMap[name] = next; + return false; + } else { + return true; + } +} +function checkKeyName(node, name) { + var computed = node.computed; + var key2 = node.key; + return !computed && (key2.type === "Identifier" && key2.name === name || key2.type === "Literal" && key2.value === name); +} +pp$8.parseExport = function(node, exports) { + this.next(); + if (this.eat(types$1.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + } + if (this.eat(types$1._default)) { + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { + this.next(); + } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types$1._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration"); + } + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") { + this.checkVariableExport(exports, node.declaration.declarations); + } else { + this.checkExport(exports, node.declaration.id, node.declaration.id.start); + } + node.specifiers = []; + node.source = null; + } else { + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + } else { + for (var i4 = 0, list = node.specifiers; i4 < list.length; i4 += 1) { + var spec = list[i4]; + this.checkUnreserved(spec.local); + this.checkLocalExport(spec.local); + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } + } + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); +}; +pp$8.checkExport = function(exports, name, pos) { + if (!exports) { + return; + } + if (typeof name !== "string") { + name = name.type === "Identifier" ? name.name : name.value; + } + if (hasOwn(exports, name)) { + this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); + } + exports[name] = true; +}; +pp$8.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") { + this.checkExport(exports, pat, pat.start); + } else if (type === "ObjectPattern") { + for (var i4 = 0, list = pat.properties; i4 < list.length; i4 += 1) { + var prop = list[i4]; + this.checkPatternExport(exports, prop); + } + } else if (type === "ArrayPattern") { + for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + if (elt) { + this.checkPatternExport(exports, elt); + } + } + } else if (type === "Property") { + this.checkPatternExport(exports, pat.value); + } else if (type === "AssignmentPattern") { + this.checkPatternExport(exports, pat.left); + } else if (type === "RestElement") { + this.checkPatternExport(exports, pat.argument); + } else if (type === "ParenthesizedExpression") { + this.checkPatternExport(exports, pat.expression); + } +}; +pp$8.checkVariableExport = function(exports, decls) { + if (!exports) { + return; + } + for (var i4 = 0, list = decls; i4 < list.length; i4 += 1) { + var decl = list[i4]; + this.checkPatternExport(exports, decl.id); + } +}; +pp$8.shouldParseExportStatement = function() { + return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); +}; +pp$8.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var node = this.startNode(); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported, + node.exported.start + ); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes; +}; +pp$8.parseImport = function(node) { + this.next(); + if (this.type === types$1.string) { + node.specifiers = empty$1; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); +}; +pp$8.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$1.name) { + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types$1.comma)) { + return nodes; + } + } + if (this.type === types$1.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLValSimple(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes; + } + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var node$2 = this.startNode(); + node$2.imported = this.parseModuleExportName(); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLValSimple(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes; +}; +pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral; + } + return this.parseIdent(true); +}; +pp$8.adaptDirectivePrologue = function(statements) { + for (var i4 = 0; i4 < statements.length && this.isDirectiveCandidate(statements[i4]); ++i4) { + statements[i4].directive = statements[i4].expression.raw.slice(1, -1); + } +}; +pp$8.isDirectiveCandidate = function(statement) { + return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && (this.input[statement.start] === '"' || this.input[statement.start] === "'"); +}; +var pp$7 = Parser.prototype; +pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") { + this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); + } + break; + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + for (var i4 = 0, list = node.properties; i4 < list.length; i4 += 1) { + var prop = list[i4]; + this.toAssignable(prop, isBinding); + if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break; + case "Property": + if (node.kind !== "init") { + this.raise(node.key.start, "Object pattern can't contain getter or setter"); + } + this.toAssignable(node.value, isBinding); + break; + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + this.toAssignableList(node.elements, isBinding); + break; + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") { + this.raise(node.argument.start, "Rest elements cannot have a default value"); + } + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + break; + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break; + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (!isBinding) { + break; + } + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + return node; +}; +pp$7.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i4 = 0; i4 < end; i4++) { + var elt = exprList[i4]; + if (elt) { + this.toAssignable(elt, isBinding); + } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { + this.unexpected(last.argument.start); + } + } + return exprList; +}; +pp$7.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement"); +}; +pp$7.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { + this.unexpected(); + } + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); +}; +pp$7.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types$1.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types$1.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + case types$1.braceL: + return this.parseObj(true); + } + } + return this.parseIdent(); +}; +pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(types$1.comma); + } + if (allowEmpty && this.type === types$1.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } else if (this.type === types$1.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + this.expect(close); + break; + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts; +}; +pp$7.parseBindingListItem = function(param) { + return param; +}; +pp$7.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { + return left; + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); +}; +pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + var isBind = bindingType !== BIND_NONE; + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { + this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + } + if (isBind) { + if (bindingType === BIND_LEXICAL && expr.name === "let") { + this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); + } + if (checkClashes) { + if (hasOwn(checkClashes, expr.name)) { + this.raiseRecoverable(expr.start, "Argument name clash"); + } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE) { + this.declareName(expr.name, bindingType, expr.start); + } + } + break; + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding member expression"); + } + break; + case "ParenthesizedExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding parenthesized expression"); + } + return this.checkLValSimple(expr.expression, bindingType, checkClashes); + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } +}; +pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "ObjectPattern": + for (var i4 = 0, list = expr.properties; i4 < list.length; i4 += 1) { + var prop = list[i4]; + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break; + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + if (elem) { + this.checkLValInnerPattern(elem, bindingType, checkClashes); + } + } + break; + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } +}; +pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "Property": + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break; + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break; + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break; + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } +}; +var TokContext = function TokContext2(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; +}; +var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function(p3) { + return p3.tryReadTemplateToken(); + }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) +}; +var pp$6 = Parser.prototype; +pp$6.initialContext = function() { + return [types.b_stat]; +}; +pp$6.curContext = function() { + return this.context[this.context.length - 1]; +}; +pp$6.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types.f_expr || parent === types.f_stat) { + return true; + } + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) { + return !parent.isExpr; + } + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { + return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + } + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { + return true; + } + if (prevType === types$1.braceL) { + return parent === types.b_stat; + } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { + return false; + } + return !this.exprAllowed; +}; +pp$6.inGeneratorContext = function() { + for (var i4 = this.context.length - 1; i4 >= 1; i4--) { + var context = this.context[i4]; + if (context.token === "function") { + return context.generator; + } + } + return false; +}; +pp$6.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$1.dot) { + this.exprAllowed = false; + } else if (update = type.updateContext) { + update.call(this, prevType); + } else { + this.exprAllowed = type.beforeExpr; + } +}; +pp$6.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } +}; +types$1.parenR.updateContext = types$1.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return; + } + var out = this.context.pop(); + if (out === types.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; +}; +types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.exprAllowed = true; +}; +types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); + this.exprAllowed = true; +}; +types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); + this.exprAllowed = true; +}; +types$1.incDec.updateContext = function() { +}; +types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) { + this.context.push(types.f_expr); + } else { + this.context.push(types.f_stat); + } + this.exprAllowed = false; +}; +types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) { + this.context.pop(); + } else { + this.context.push(types.q_tmpl); + } + this.exprAllowed = false; +}; +types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { + var index = this.context.length - 1; + if (this.context[index] === types.f_expr) { + this.context[index] = types.f_expr_gen; + } else { + this.context[index] = types.f_gen; + } + } + this.exprAllowed = true; +}; +types$1.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { + if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { + allowed = true; + } + } + this.exprAllowed = allowed; +}; +var pp$5 = Parser.prototype; +pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { + return; + } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { + return; + } + var key2 = prop.key; + var name; + switch (key2.type) { + case "Identifier": + name = key2.name; + break; + case "Literal": + name = String(key2.value); + break; + default: + return; + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key2.start; + } + } else { + this.raiseRecoverable(key2.start, "Redefinition of __proto__ property"); + } + } + propHash.proto = true; + } + return; + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) { + this.raiseRecoverable(key2.start, "Redefinition of property"); + } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; +}; +pp$5.parseExpression = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$1.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types$1.comma)) { + node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); + } + return this.finishNode(node, "SequenceExpression"); + } + return expr; +}; +pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { + return this.parseYield(forInit); + } else { + this.exprAllowed = false; + } + } + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors(); + ownDestructuringErrors = true; + } + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types$1.parenL || this.type === types$1.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === types$1.eq) { + left = this.toAssignable(left, false, refDestructuringErrors); + } + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) { + refDestructuringErrors.shorthandAssign = -1; + } + if (this.type === types$1.eq) { + this.checkLValPattern(left); + } else { + this.checkLValSimple(left); + } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { + refDestructuringErrors.doubleProto = oldDoubleProto; + } + return this.finishNode(node, "AssignmentExpression"); + } else { + if (ownDestructuringErrors) { + this.checkExpressionErrors(refDestructuringErrors, true); + } + } + if (oldParenAssign > -1) { + refDestructuringErrors.parenthesizedAssign = oldParenAssign; + } + if (oldTrailingComma > -1) { + refDestructuringErrors.trailingComma = oldTrailingComma; + } + return left; +}; +pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + if (this.eat(types$1.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types$1.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; +}; +pp$5.parseExprOps = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); +}; +pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + var prec = this.type.binop; + if (prec != null && (!forInit || this.type !== types$1._in)) { + if (prec > minPrec) { + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; + if (coalesce) { + prec = types$1.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); + } + } + return left; +}; +pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { + this.raise(right.start, "Private identifier can only be left side of binary expression"); + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); +}; +pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types$1.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true, update, forInit); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { + this.checkLValSimple(node.argument); + } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); + } else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) { + this.raiseRecoverable(node.start, "Private fields can not be deleted"); + } else { + sawUnary = true; + } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { + this.unexpected(); + } + expr = this.parsePrivateIdent(); + if (this.type !== types$1._in) { + this.unexpected(); + } + } else { + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLValSimple(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + if (!incDec && this.eat(types$1.starstar)) { + if (sawUnary) { + this.unexpected(this.lastTokStart); + } else { + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false); + } + } else { + return expr; + } +}; +function isPrivateFieldAccess(node) { + return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression); +} +pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors, forInit); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { + return expr; + } + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { + refDestructuringErrors.parenthesizedAssign = -1; + } + if (refDestructuringErrors.parenthesizedBind >= result.start) { + refDestructuringErrors.parenthesizedBind = -1; + } + if (refDestructuringErrors.trailingComma >= result.start) { + refDestructuringErrors.trailingComma = -1; + } + } + return result; +}; +pp$5.parseSubscripts = function(base2, startPos, startLoc, noCalls, forInit) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base2.type === "Identifier" && base2.name === "async" && this.lastTokEnd === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && this.potentialArrowAt === base2.start; + var optionalChained = false; + while (true) { + var element = this.parseSubscript(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); + if (element.optional) { + optionalChained = true; + } + if (element === base2 || element.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element; + element = this.finishNode(chainNode, "ChainExpression"); + } + return element; + } + base2 = element; + } +}; +pp$5.parseSubscript = function(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types$1.questionDot); + if (noCalls && optional) { + this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); + } + var computed = this.eat(types$1.bracketL); + if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base2; + if (computed) { + node.property = this.parseExpression(); + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base2.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base2 = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types$1.parenL)) { + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) { + this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); + } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base2; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base2 = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types$1.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base2; + node$2.quasi = this.parseTemplate({ isTagged: true }); + base2 = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base2; +}; +pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { + if (this.type === types$1.slash) { + this.readRegexp(); + } + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types$1._super: + if (!this.allowSuper) { + this.raise(this.start, "'super' keyword outside a method"); + } + node = this.startNode(); + this.next(); + if (this.type === types$1.parenL && !this.allowDirectSuper) { + this.raise(node.start, "super() call outside constructor of a subclass"); + } + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Super"); + case types$1._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case types$1.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id2 = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id2.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types$1.arrow)) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id2], false, forInit); + } + if (this.options.ecmaVersion >= 8 && id2.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id2 = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { + this.unexpected(); + } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id2], true, forInit); + } + } + return id2; + case types$1.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = { pattern: value.pattern, flags: value.flags }; + return node; + case types$1.num: + case types$1.string: + return this.parseLiteral(this.value); + case types$1._null: + case types$1._true: + case types$1._false: + node = this.startNode(); + node.value = this.type === types$1._null ? null : this.type === types$1._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + case types$1.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { + refDestructuringErrors.parenthesizedAssign = start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = start; + } + } + return expr; + case types$1.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression"); + case types$1.braceL: + this.overrideContext(types.b_expr); + return this.parseObj(false, refDestructuringErrors); + case types$1._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0); + case types$1._class: + return this.parseClass(this.startNode(), false); + case types$1._new: + return this.parseNew(); + case types$1.backQuote: + return this.parseTemplate(); + case types$1._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport(); + } else { + return this.unexpected(); + } + default: + this.unexpected(); + } +}; +pp$5.parseExprImport = function() { + var node = this.startNode(); + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword import"); + } + var meta = this.parseIdent(true); + switch (this.type) { + case types$1.parenL: + return this.parseDynamicImport(node); + case types$1.dot: + node.meta = meta; + return this.parseImportMeta(node); + default: + this.unexpected(); + } +}; +pp$5.parseDynamicImport = function(node) { + this.next(); + node.source = this.parseMaybeAssign(); + if (!this.eat(types$1.parenR)) { + var errorPos = this.start; + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + return this.finishNode(node, "ImportExpression"); +}; +pp$5.parseImportMeta = function(node) { + this.next(); + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "meta") { + this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); + } + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { + this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); + } + return this.finishNode(node, "MetaProperty"); +}; +pp$5.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { + node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); + } + this.next(); + return this.finishNode(node, "Literal"); +}; +pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); + var val = this.parseExpression(); + this.expect(types$1.parenR); + return val; +}; +pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { + lastIsComma = true; + break; + } else if (this.type === types$1.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + break; + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$1.parenR); + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit); + } + if (!exprList.length || lastIsComma) { + this.unexpected(this.lastTokStart); + } + if (spreadStart) { + this.unexpected(spreadStart); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } +}; +pp$5.parseParenItem = function(item) { + return item; +}; +pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); +}; +var empty = []; +pp$5.parseNew = function() { + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword new"); + } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") { + this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); + } + if (!this.allowNewDotTarget) { + this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); + } + return this.finishNode(node, "MetaProperty"); + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types$1.parenL)) { + node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); + } else { + node.arguments = empty; + } + return this.finishNode(node, "NewExpression"); +}; +pp$5.parseTemplateElement = function(ref2) { + var isTagged = ref2.isTagged; + var elem = this.startNode(); + if (this.type === types$1.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types$1.backQuote; + return this.finishNode(elem, "TemplateElement"); +}; +pp$5.parseTemplate = function(ref2) { + if (ref2 === void 0) + ref2 = {}; + var isTagged = ref2.isTagged; + if (isTagged === void 0) + isTagged = false; + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({ isTagged }); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types$1.eof) { + this.raise(this.pos, "Unterminated template literal"); + } + this.expect(types$1.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types$1.braceR); + node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); +}; +pp$5.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); +}; +pp$5.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { + this.checkPropClash(prop, propHash, refDestructuringErrors); + } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); +}; +pp$5.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement"); + } + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + return this.finishNode(prop, "SpreadElement"); + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) { + isGenerator = this.eat(types$1.star); + } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); + this.parsePropertyName(prop); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property"); +}; +pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) { + this.unexpected(); + } + if (this.eat(types$1.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { + if (isPattern) { + this.unexpected(); + } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { + if (isGenerator || isAsync) { + this.unexpected(); + } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") { + this.raiseRecoverable(start, "getter should have no params"); + } else { + this.raiseRecoverable(start, "setter should have exactly one param"); + } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); + } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { + this.unexpected(); + } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = startPos; + } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$1.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) { + refDestructuringErrors.shorthandAssign = this.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else { + prop.value = this.copyNode(prop.key); + } + prop.shorthand = true; + } else { + this.unexpected(); + } +}; +pp$5.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types$1.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types$1.bracketR); + return prop.key; + } else { + prop.computed = false; + } + } + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); +}; +pp$5.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = node.expression = false; + } + if (this.options.ecmaVersion >= 8) { + node.async = false; + } +}; +pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.initFunction(node); + if (this.options.ecmaVersion >= 6) { + node.generator = isGenerator; + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression"); +}; +pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression"); +}; +pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; + var oldStrict = this.strict, useStrict = false; + if (isExpression) { + node.body = this.parseMaybeAssign(forInit); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + if (useStrict && nonSimple) { + this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); + } + } + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { + this.strict = true; + } + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + if (this.strict && node.id) { + this.checkLValSimple(node.id, BIND_OUTSIDE); + } + node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); +}; +pp$5.isSimpleParamList = function(params) { + for (var i4 = 0, list = params; i4 < list.length; i4 += 1) { + var param = list[i4]; + if (param.type !== "Identifier") { + return false; + } + } + return true; +}; +pp$5.checkParams = function(node, allowDuplicates) { + var nameHash = /* @__PURE__ */ Object.create(null); + for (var i4 = 0, list = node.params; i4 < list.length; i4 += 1) { + var param = list[i4]; + this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); + } +}; +pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } + } else { + first = false; + } + var elt = void 0; + if (allowEmpty && this.type === types$1.comma) { + elt = null; + } else if (this.type === types$1.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts; +}; +pp$5.checkUnreserved = function(ref2) { + var start = ref2.start; + var end = ref2.end; + var name = ref2.name; + if (this.inGenerator && name === "yield") { + this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); + } + if (this.inAsync && name === "await") { + this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); + } + if (this.currentThisScope().inClassFieldInit && name === "arguments") { + this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); + } + if (this.inClassStaticBlock && (name === "arguments" || name === "await")) { + this.raise(start, "Cannot use " + name + " in class static initialization block"); + } + if (this.keywords.test(name)) { + this.raise(start, "Unexpected keyword '" + name + "'"); + } + if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) { + return; + } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") { + this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); + } + this.raiseRecoverable(start, "The keyword '" + name + "' is reserved"); + } +}; +pp$5.parseIdent = function(liberal) { + var node = this.startNode(); + if (this.type === types$1.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = node.start; + } + } + return node; +}; +pp$5.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$1.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + if (this.privateNameStack.length === 0) { + this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + return node; +}; +pp$5.parseYield = function(forInit) { + if (!this.yieldPos) { + this.yieldPos = this.start; + } + var node = this.startNode(); + this.next(); + if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types$1.star); + node.argument = this.parseMaybeAssign(forInit); + } + return this.finishNode(node, "YieldExpression"); +}; +pp$5.parseAwait = function(forInit) { + if (!this.awaitPos) { + this.awaitPos = this.start; + } + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true, false, forInit); + return this.finishNode(node, "AwaitExpression"); +}; +var pp$4 = Parser.prototype; +pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + err.raisedAt = this.pos; + throw err; +}; +pp$4.raiseRecoverable = pp$4.raise; +pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart); + } +}; +var pp$3 = Parser.prototype; +var Scope = function Scope2(flags) { + this.flags = flags; + this.var = []; + this.lexical = []; + this.functions = []; + this.inClassFieldInit = false; +}; +pp$3.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); +}; +pp$3.exitScope = function() { + this.scopeStack.pop(); +}; +pp$3.treatFunctionsAsVarInScope = function(scope) { + return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP; +}; +pp$3.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && scope.flags & SCOPE_TOP) { + delete this.undefinedExports[name]; + } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) { + redeclared = scope$2.lexical.indexOf(name) > -1; + } else { + redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; + } + scope$2.functions.push(name); + } else { + for (var i4 = this.scopeStack.length - 1; i4 >= 0; --i4) { + var scope$3 = this.scopeStack[i4]; + if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break; + } + scope$3.var.push(name); + if (this.inModule && scope$3.flags & SCOPE_TOP) { + delete this.undefinedExports[name]; + } + if (scope$3.flags & SCOPE_VAR) { + break; + } + } + } + if (redeclared) { + this.raiseRecoverable(pos, "Identifier '" + name + "' has already been declared"); + } +}; +pp$3.checkLocalExport = function(id2) { + if (this.scopeStack[0].lexical.indexOf(id2.name) === -1 && this.scopeStack[0].var.indexOf(id2.name) === -1) { + this.undefinedExports[id2.name] = id2; + } +}; +pp$3.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1]; +}; +pp$3.currentVarScope = function() { + for (var i4 = this.scopeStack.length - 1; ; i4--) { + var scope = this.scopeStack[i4]; + if (scope.flags & SCOPE_VAR) { + return scope; + } + } +}; +pp$3.currentThisScope = function() { + for (var i4 = this.scopeStack.length - 1; ; i4--) { + var scope = this.scopeStack[i4]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { + return scope; + } + } +}; +var Node = function Node2(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) { + this.loc = new SourceLocation(parser, loc); + } + if (parser.options.directSourceFile) { + this.sourceFile = parser.options.directSourceFile; + } + if (parser.options.ranges) { + this.range = [pos, 0]; + } +}; +var pp$2 = Parser.prototype; +pp$2.startNode = function() { + return new Node(this, this.start, this.startLoc); +}; +pp$2.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc); +}; +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) { + node.loc.end = loc; + } + if (this.options.ranges) { + node.range[1] = pos; + } + return node; +} +pp$2.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); +}; +pp$2.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc); +}; +pp$2.copyNode = function(node) { + var newNode = new Node(this, node.start, this.startLoc); + for (var prop in node) { + newNode[prop] = node[prop]; + } + return newNode; +}; +var ecma9BinaryProperties = "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"; +var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; +var ecma11BinaryProperties = ecma10BinaryProperties; +var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; +var ecma13BinaryProperties = ecma12BinaryProperties; +var ecma14BinaryProperties = ecma13BinaryProperties; +var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties +}; +var unicodeGeneralCategoryValues = "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"; +var ecma9ScriptValues = "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"; +var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; +var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; +var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; +var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; +var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm"; +var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues, + 14: ecma14ScriptValues +}; +var data = {}; +function buildUnicodeData(ecmaVersion) { + var d5 = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d5.nonBinary.Script_Extensions = d5.nonBinary.Script; + d5.nonBinary.gc = d5.nonBinary.General_Category; + d5.nonBinary.sc = d5.nonBinary.Script; + d5.nonBinary.scx = d5.nonBinary.Script_Extensions; +} +for (i4 = 0, list = [9, 10, 11, 12, 13, 14]; i4 < list.length; i4 += 1) { + ecmaVersion = list[i4]; + buildUnicodeData(ecmaVersion); +} +var ecmaVersion; +var i4; +var list; +var pp$1 = Parser.prototype; +var RegExpValidationState = function RegExpValidationState2(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; +}; +RegExpValidationState.prototype.reset = function reset(start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; +}; +RegExpValidationState.prototype.raise = function raise(message) { + this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); +}; +RegExpValidationState.prototype.at = function at(i4, forceU) { + if (forceU === void 0) + forceU = false; + var s5 = this.source; + var l3 = s5.length; + if (i4 >= l3) { + return -1; + } + var c4 = s5.charCodeAt(i4); + if (!(forceU || this.switchU) || c4 <= 55295 || c4 >= 57344 || i4 + 1 >= l3) { + return c4; + } + var next = s5.charCodeAt(i4 + 1); + return next >= 56320 && next <= 57343 ? (c4 << 10) + next - 56613888 : c4; +}; +RegExpValidationState.prototype.nextIndex = function nextIndex(i4, forceU) { + if (forceU === void 0) + forceU = false; + var s5 = this.source; + var l3 = s5.length; + if (i4 >= l3) { + return l3; + } + var c4 = s5.charCodeAt(i4), next; + if (!(forceU || this.switchU) || c4 <= 55295 || c4 >= 57344 || i4 + 1 >= l3 || (next = s5.charCodeAt(i4 + 1)) < 56320 || next > 57343) { + return i4 + 1; + } + return i4 + 2; +}; +RegExpValidationState.prototype.current = function current(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.pos, forceU); +}; +RegExpValidationState.prototype.lookahead = function lookahead(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.nextIndex(this.pos, forceU), forceU); +}; +RegExpValidationState.prototype.advance = function advance(forceU) { + if (forceU === void 0) + forceU = false; + this.pos = this.nextIndex(this.pos, forceU); +}; +RegExpValidationState.prototype.eat = function eat(ch, forceU) { + if (forceU === void 0) + forceU = false; + if (this.current(forceU) === ch) { + this.advance(forceU); + return true; + } + return false; +}; +pp$1.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + for (var i4 = 0; i4 < flags.length; i4++) { + var flag = flags.charAt(i4); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i4 + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } +}; +pp$1.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } +}; +pp$1.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + this.regexp_disjunction(state); + if (state.pos !== state.source.length) { + if (state.eat(41)) { + state.raise("Unmatched ')'"); + } + if (state.eat(93) || state.eat(125)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i4 = 0, list = state.backReferenceNames; i4 < list.length; i4 += 1) { + var name = list[i4]; + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } +}; +pp$1.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(124)) { + this.regexp_alternative(state); + } + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(123)) { + state.raise("Lone quantifier brackets"); + } +}; +pp$1.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) { + } +}; +pp$1.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true; + } + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true; + } + return false; +}; +pp$1.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + if (state.eat(94) || state.eat(36)) { + return true; + } + if (state.eat(92)) { + if (state.eat(66) || state.eat(98)) { + return true; + } + state.pos = start; + } + if (state.eat(40) && state.eat(63)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(60); + } + if (state.eat(61) || state.eat(33)) { + this.regexp_disjunction(state); + if (!state.eat(41)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true; + } + } + state.pos = start; + return false; +}; +pp$1.regexp_eatQuantifier = function(state, noError) { + if (noError === void 0) + noError = false; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(63); + return true; + } + return false; +}; +pp$1.regexp_eatQuantifierPrefix = function(state, noError) { + return state.eat(42) || state.eat(43) || state.eat(63) || this.regexp_eatBracedQuantifier(state, noError); +}; +pp$1.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(123)) { + var min3 = 0, max3 = -1; + if (this.regexp_eatDecimalDigits(state)) { + min3 = state.lastIntValue; + if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { + max3 = state.lastIntValue; + } + if (state.eat(125)) { + if (max3 !== -1 && max3 < min3 && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false; +}; +pp$1.regexp_eatAtom = function(state) { + return this.regexp_eatPatternCharacters(state) || state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); +}; +pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(92)) { + if (this.regexp_eatAtomEscape(state)) { + return true; + } + state.pos = start; + } + return false; +}; +pp$1.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(40)) { + if (state.eat(63) && state.eat(58)) { + this.regexp_disjunction(state); + if (state.eat(41)) { + return true; + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false; +}; +pp$1.regexp_eatCapturingGroup = function(state) { + if (state.eat(40)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 63) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(41)) { + state.numCapturingParens += 1; + return true; + } + state.raise("Unterminated group"); + } + return false; +}; +pp$1.regexp_eatExtendedAtom = function(state) { + return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); +}; +pp$1.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false; +}; +pp$1.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +function isSyntaxCharacter(ch) { + return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; +} +pp$1.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start; +}; +pp$1.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_groupSpecifier = function(state) { + if (state.eat(63)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return; + } + state.raise("Invalid group"); + } +}; +pp$1.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(60)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { + return true; + } + state.raise("Invalid capture group name"); + } + return false; +}; +pp$1.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true; + } + return false; +}; +pp$1.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start; + return false; +}; +function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 36 || ch === 95; +} +pp$1.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start; + return false; +}; +function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205; +} +pp$1.regexp_eatAtomEscape = function(state) { + if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { + return true; + } + if (state.switchU) { + if (state.current() === 99) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false; +}; +pp$1.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n2 = state.lastIntValue; + if (state.switchU) { + if (n2 > state.maxBackReference) { + state.maxBackReference = n2; + } + return true; + } + if (n2 <= state.numCapturingParens) { + return true; + } + state.pos = start; + } + return false; +}; +pp$1.regexp_eatKGroupName = function(state) { + if (state.eat(107)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true; + } + state.raise("Invalid named reference"); + } + return false; +}; +pp$1.regexp_eatCharacterEscape = function(state) { + return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); +}; +pp$1.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(99)) { + if (this.regexp_eatControlLetter(state)) { + return true; + } + state.pos = start; + } + return false; +}; +pp$1.regexp_eatZero = function(state) { + if (state.current() === 48 && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 116) { + state.lastIntValue = 9; + state.advance(); + return true; + } + if (ch === 110) { + state.lastIntValue = 10; + state.advance(); + return true; + } + if (ch === 118) { + state.lastIntValue = 11; + state.advance(); + return true; + } + if (ch === 102) { + state.lastIntValue = 12; + state.advance(); + return true; + } + if (ch === 114) { + state.lastIntValue = 13; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; +}; +function isControlLetter(ch) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; +} +pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if (forceU === void 0) + forceU = false; + var start = state.pos; + var switchU = forceU || state.switchU; + if (state.eat(117)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 55296 && lead <= 56319) { + var leadSurrogateEnd = state.pos; + if (state.eat(92) && state.eat(117) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 56320 && trail <= 57343) { + state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; + return true; + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true; + } + if (switchU && state.eat(123) && this.regexp_eatHexDigits(state) && state.eat(125) && isValidUnicode(state.lastIntValue)) { + return true; + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + return false; +}; +function isValidUnicode(ch) { + return ch >= 0 && ch <= 1114111; +} +pp$1.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true; + } + if (state.eat(47)) { + state.lastIntValue = 47; + return true; + } + return false; + } + var ch = state.current(); + if (ch !== 99 && (!state.switchN || ch !== 107)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 49 && ch <= 57) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } while ((ch = state.current()) >= 48 && ch <= 57); + return true; + } + return false; +}; +pp$1.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true; + } + if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 80 || ch === 112)) { + state.lastIntValue = -1; + state.advance(); + if (state.eat(123) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(125)) { + return true; + } + state.raise("Invalid property name"); + } + return false; +}; +function isCharacterClassEscape(ch) { + return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; +} +pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true; + } + } + state.pos = start; + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true; + } + return false; +}; +pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) { + state.raise("Invalid property name"); + } + if (!state.unicodeProperties.nonBinary[name].test(value)) { + state.raise("Invalid property value"); + } +}; +pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) { + state.raise("Invalid property name"); + } +}; +pp$1.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; +}; +function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 95; +} +pp$1.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; +}; +function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch); +} +pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state); +}; +pp$1.regexp_eatCharacterClass = function(state) { + if (state.eat(91)) { + state.eat(94); + this.regexp_classRanges(state); + if (state.eat(93)) { + return true; + } + state.raise("Unterminated character class"); + } + return false; +}; +pp$1.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(45) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } +}; +pp$1.regexp_eatClassAtom = function(state) { + var start = state.pos; + if (state.eat(92)) { + if (this.regexp_eatClassEscape(state)) { + return true; + } + if (state.switchU) { + var ch$1 = state.current(); + if (ch$1 === 99 || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + var ch = state.current(); + if (ch !== 93) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatClassEscape = function(state) { + var start = state.pos; + if (state.eat(98)) { + state.lastIntValue = 8; + return true; + } + if (state.switchU && state.eat(45)) { + state.lastIntValue = 45; + return true; + } + if (!state.switchU && state.eat(99)) { + if (this.regexp_eatClassControlLetter(state)) { + return true; + } + state.pos = start; + } + return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); +}; +pp$1.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 95) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(120)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true; + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false; +}; +pp$1.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } + return state.pos !== start; +}; +function isDecimalDigit(ch) { + return ch >= 48 && ch <= 57; +} +pp$1.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start; +}; +function isHexDigit(ch) { + return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; +} +function hexToInt(ch) { + if (ch >= 65 && ch <= 70) { + return 10 + (ch - 65); + } + if (ch >= 97 && ch <= 102) { + return 10 + (ch - 97); + } + return ch - 48; +} +pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true; + } + return false; +}; +pp$1.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 48; + state.advance(); + return true; + } + state.lastIntValue = 0; + return false; +}; +function isOctalDigit(ch) { + return ch >= 48 && ch <= 55; +} +pp$1.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i4 = 0; i4 < length; ++i4) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false; + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true; +}; +var Token = function Token2(p3) { + this.type = p3.type; + this.value = p3.value; + this.start = p3.start; + this.end = p3.end; + if (p3.options.locations) { + this.loc = new SourceLocation(p3, p3.startLoc, p3.endLoc); + } + if (p3.options.ranges) { + this.range = [p3.start, p3.end]; + } +}; +var pp = Parser.prototype; +pp.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); + } + if (this.options.onToken) { + this.options.onToken(new Token(this)); + } + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); +}; +pp.getToken = function() { + this.next(); + return new Token(this); +}; +if (typeof Symbol !== "undefined") { + pp[Symbol.iterator] = function() { + var this$1$1 = this; + return { + next: function() { + var token = this$1$1.getToken(); + return { + done: token.type === types$1.eof, + value: token + }; + } + }; + }; +} +pp.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { + this.skipSpace(); + } + this.start = this.pos; + if (this.options.locations) { + this.startLoc = this.curPosition(); + } + if (this.pos >= this.input.length) { + return this.finishToken(types$1.eof); + } + if (curContext.override) { + return curContext.override(this); + } else { + this.readToken(this.fullCharCodeAtPos()); + } +}; +pp.readToken = function(code) { + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92) { + return this.readWord(); + } + return this.getTokenFromCode(code); +}; +pp.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 55295 || code >= 56320) { + return code; + } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888; +}; +pp.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { + this.raise(this.pos - 2, "Unterminated comment"); + } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = void 0, pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.options.onComment) { + this.options.onComment( + true, + this.input.slice(start + 2, end), + start, + this.pos, + startLoc, + this.curPosition() + ); + } +}; +pp.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) { + this.options.onComment( + false, + this.input.slice(start + startSkip, this.pos), + start, + this.pos, + startLoc, + this.curPosition() + ); + } +}; +pp.skipSpace = function() { + loop: + while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: + case 160: + ++this.pos; + break; + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: + case 8232: + case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break; + case 47: + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: + this.skipBlockComment(); + break; + case 47: + this.skipLineComment(2); + break; + default: + break loop; + } + break; + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop; + } + } + } +}; +pp.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { + this.endLoc = this.curPosition(); + } + var prevType = this.type; + this.type = type; + this.value = val; + this.updateContext(prevType); +}; +pp.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { + this.pos += 3; + return this.finishToken(types$1.ellipsis); + } else { + ++this.pos; + return this.finishToken(types$1.dot); + } +}; +pp.readToken_slash = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { + ++this.pos; + return this.readRegexp(); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.slash, 1); +}; +pp.readToken_mult_modulo_exp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types$1.star : types$1.modulo; + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types$1.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, size + 1); + } + return this.finishOp(tokentype, size); +}; +pp.readToken_pipe_amp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1); +}; +pp.readToken_caret = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.bitwiseXOR, 1); +}; +pp.readToken_plus_min = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(types$1.incDec, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.plusMin, 1); +}; +pp.readToken_lt_gt = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { + return this.finishOp(types$1.assign, size + 1); + } + return this.finishOp(types$1.bitShift, size); + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { + this.skipLineComment(4); + this.skipSpace(); + return this.nextToken(); + } + if (next === 61) { + size = 2; + } + return this.finishOp(types$1.relational, size); +}; +pp.readToken_eq_excl = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2); + } + if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { + this.pos += 2; + return this.finishToken(types$1.arrow); + } + return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1); +}; +pp.readToken_question = function() { + var ecmaVersion = this.options.ecmaVersion; + if (ecmaVersion >= 11) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 46) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 < 48 || next2 > 57) { + return this.finishOp(types$1.questionDot, 2); + } + } + if (next === 63) { + if (ecmaVersion >= 12) { + var next2$1 = this.input.charCodeAt(this.pos + 2); + if (next2$1 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(types$1.coalesce, 2); + } + } + return this.finishOp(types$1.question, 1); +}; +pp.readToken_numberSign = function() { + var ecmaVersion = this.options.ecmaVersion; + var code = 35; + if (ecmaVersion >= 13) { + ++this.pos; + code = this.fullCharCodeAtPos(); + if (isIdentifierStart(code, true) || code === 92) { + return this.finishToken(types$1.privateId, this.readWord1()); + } + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); +}; +pp.getTokenFromCode = function(code) { + switch (code) { + case 46: + return this.readToken_dot(); + case 40: + ++this.pos; + return this.finishToken(types$1.parenL); + case 41: + ++this.pos; + return this.finishToken(types$1.parenR); + case 59: + ++this.pos; + return this.finishToken(types$1.semi); + case 44: + ++this.pos; + return this.finishToken(types$1.comma); + case 91: + ++this.pos; + return this.finishToken(types$1.bracketL); + case 93: + ++this.pos; + return this.finishToken(types$1.bracketR); + case 123: + ++this.pos; + return this.finishToken(types$1.braceL); + case 125: + ++this.pos; + return this.finishToken(types$1.braceR); + case 58: + ++this.pos; + return this.finishToken(types$1.colon); + case 96: + if (this.options.ecmaVersion < 6) { + break; + } + ++this.pos; + return this.finishToken(types$1.backQuote); + case 48: + var next = this.input.charCodeAt(this.pos + 1); + if (next === 120 || next === 88) { + return this.readRadixNumber(16); + } + if (this.options.ecmaVersion >= 6) { + if (next === 111 || next === 79) { + return this.readRadixNumber(8); + } + if (next === 98 || next === 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(false); + case 34: + case 39: + return this.readString(code); + case 47: + return this.readToken_slash(); + case 37: + case 42: + return this.readToken_mult_modulo_exp(code); + case 124: + case 38: + return this.readToken_pipe_amp(code); + case 94: + return this.readToken_caret(); + case 43: + case 45: + return this.readToken_plus_min(code); + case 60: + case 62: + return this.readToken_lt_gt(code); + case 61: + case 33: + return this.readToken_eq_excl(code); + case 63: + return this.readToken_question(); + case 126: + return this.finishOp(types$1.prefix, 1); + case 35: + return this.readToken_numberSign(); + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); +}; +pp.finishOp = function(type, size) { + var str = this.input.slice(this.pos, this.pos + size); + this.pos += size; + return this.finishToken(type, str); +}; +pp.readRegexp = function() { + var escaped, inClass, start = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(start, "Unterminated regular expression"); + } + var ch = this.input.charAt(this.pos); + if (lineBreak.test(ch)) { + this.raise(start, "Unterminated regular expression"); + } + if (!escaped) { + if (ch === "[") { + inClass = true; + } else if (ch === "]" && inClass) { + inClass = false; + } else if (ch === "/" && !inClass) { + break; + } + escaped = ch === "\\"; + } else { + escaped = false; + } + ++this.pos; + } + var pattern = this.input.slice(start, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { + this.unexpected(flagsStart); + } + var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); + state.reset(start, pattern, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + var value = null; + try { + value = new RegExp(pattern, flags); + } catch (e4) { + } + return this.finishToken(types$1.regexp, { pattern, flags, value }); +}; +pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + var start = this.pos, total = 0, lastCode = 0; + for (var i4 = 0, e4 = len == null ? Infinity : len; i4 < e4; ++i4, ++this.pos) { + var code = this.input.charCodeAt(this.pos), val = void 0; + if (allowSeparators && code === 95) { + if (isLegacyOctalNumericLiteral) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); + } + if (lastCode === 95) { + this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); + } + if (i4 === 0) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + } + lastCode = code; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (code >= 48 && code <= 57) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + break; + } + lastCode = code; + total = total * radix + val; + } + if (allowSeparators && lastCode === 95) { + this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + } + if (this.pos === start || len != null && this.pos - start !== len) { + return null; + } + return total; +}; +function stringToNumber(str, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str, 8); + } + return parseFloat(str.replace(/_/g, "")); +} +function stringToBigInt(str) { + if (typeof BigInt !== "function") { + return null; + } + return BigInt(str.replace(/_/g, "")); +} +pp.readRadixNumber = function(radix) { + var start = this.pos; + this.pos += 2; + var val = this.readInt(radix); + if (val == null) { + this.raise(this.start + 2, "Expected number in radix " + radix); + } + if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { + val = stringToBigInt(this.input.slice(start, this.pos)); + ++this.pos; + } else if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val); +}; +pp.readNumber = function(startsWithDot) { + var start = this.pos; + if (!startsWithDot && this.readInt(10, void 0, true) === null) { + this.raise(start, "Invalid number"); + } + var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; + if (octal && this.strict) { + this.raise(start, "Invalid number"); + } + var next = this.input.charCodeAt(this.pos); + if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { + var val$1 = stringToBigInt(this.input.slice(start, this.pos)); + ++this.pos; + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val$1); + } + if (octal && /[89]/.test(this.input.slice(start, this.pos))) { + octal = false; + } + if (next === 46 && !octal) { + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); + } + if ((next === 69 || next === 101) && !octal) { + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { + ++this.pos; + } + if (this.readInt(10) === null) { + this.raise(start, "Invalid number"); + } + } + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + var val = stringToNumber(this.input.slice(start, this.pos), octal); + return this.finishToken(types$1.num, val); +}; +pp.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code; + if (ch === 123) { + if (this.options.ecmaVersion < 6) { + this.unexpected(); + } + var codePos = ++this.pos; + code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code > 1114111) { + this.invalidStringToken(codePos, "Code point out of bounds"); + } + } else { + code = this.readHexChar(4); + } + return code; +}; +pp.readString = function(quote) { + var out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated string constant"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === quote) { + break; + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(false); + chunkStart = this.pos; + } else if (ch === 8232 || ch === 8233) { + if (this.options.ecmaVersion < 10) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } + } else { + if (isNewLine(ch)) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types$1.string, out); +}; +var INVALID_TEMPLATE_ESCAPE_ERROR = {}; +pp.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { + this.readInvalidTemplateToken(); + } else { + throw err; + } + } + this.inTemplateElement = false; +}; +pp.invalidStringToken = function(position, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR; + } else { + this.raise(position, message); + } +}; +pp.readTmplToken = function() { + var out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated template"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { + if (ch === 36) { + this.pos += 2; + return this.finishToken(types$1.dollarBraceL); + } else { + ++this.pos; + return this.finishToken(types$1.backQuote); + } + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(types$1.template, out); + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(true); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + ++this.pos; + switch (ch) { + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + out += "\n"; + break; + default: + out += String.fromCharCode(ch); + break; + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + chunkStart = this.pos; + } else { + ++this.pos; + } + } +}; +pp.readInvalidTemplateToken = function() { + for (; this.pos < this.input.length; this.pos++) { + switch (this.input[this.pos]) { + case "\\": + ++this.pos; + break; + case "$": + if (this.input[this.pos + 1] !== "{") { + break; + } + case "`": + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); + } + } + this.raise(this.start, "Unterminated template"); +}; +pp.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); + ++this.pos; + switch (ch) { + case 110: + return "\n"; + case 114: + return "\r"; + case 120: + return String.fromCharCode(this.readHexChar(2)); + case 117: + return codePointToString(this.readCodePoint()); + case 116: + return " "; + case 98: + return "\b"; + case 118: + return "\v"; + case 102: + return "\f"; + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + if (this.options.locations) { + this.lineStart = this.pos; + ++this.curLine; + } + return ""; + case 56: + case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } + if (inTemplate) { + var codePos = this.pos - 1; + this.invalidStringToken( + codePos, + "Invalid escape sequence in template string" + ); + } + default: + if (ch >= 48 && ch <= 55) { + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" + ); + } + return String.fromCharCode(octal); + } + if (isNewLine(ch)) { + return ""; + } + return String.fromCharCode(ch); + } +}; +pp.readHexChar = function(len) { + var codePos = this.pos; + var n2 = this.readInt(16, len); + if (n2 === null) { + this.invalidStringToken(codePos, "Bad character escape sequence"); + } + return n2; +}; +pp.readWord1 = function() { + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; + while (this.pos < this.input.length) { + var ch = this.fullCharCodeAtPos(); + if (isIdentifierChar(ch, astral)) { + this.pos += ch <= 65535 ? 1 : 2; + } else if (ch === 92) { + this.containsEsc = true; + word += this.input.slice(chunkStart, this.pos); + var escStart = this.pos; + if (this.input.charCodeAt(++this.pos) !== 117) { + this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); + } + ++this.pos; + var esc = this.readCodePoint(); + if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { + this.invalidStringToken(escStart, "Invalid Unicode escape"); + } + word += codePointToString(esc); + chunkStart = this.pos; + } else { + break; + } + first = false; + } + return word + this.input.slice(chunkStart, this.pos); +}; +pp.readWord = function() { + var word = this.readWord1(); + var type = types$1.name; + if (this.keywords.test(word)) { + type = keywords[word]; + } + return this.finishToken(type, word); +}; +var version = "8.8.2"; +Parser.acorn = { + Parser, + version, + defaultOptions, + Position, + SourceLocation, + getLineInfo, + Node, + TokenType, + tokTypes: types$1, + keywordTypes: keywords, + TokContext, + tokContexts: types, + isIdentifierChar, + isIdentifierStart, + Token, + isNewLine, + lineBreak, + lineBreakG, + nonASCIIwhitespace +}; +function parse3(input, options) { + return Parser.parse(input, options); +} + +// node_modules/acorn-walk/dist/walk.mjs +function ancestor(node, visitors, baseVisitor, state, override) { + var ancestors = []; + if (!baseVisitor) { + baseVisitor = base; + } + (function c4(node2, st, override2) { + var type = override2 || node2.type, found = visitors[type]; + var isNew = node2 !== ancestors[ancestors.length - 1]; + if (isNew) { + ancestors.push(node2); + } + baseVisitor[type](node2, st, c4); + if (found) { + found(node2, st || ancestors, ancestors); + } + if (isNew) { + ancestors.pop(); + } + })(node, state, override); +} +function skipThrough(node, st, c4) { + c4(node, st); +} +function ignore(_node, _st, _c2) { +} +var base = {}; +base.Program = base.BlockStatement = base.StaticBlock = function(node, st, c4) { + for (var i4 = 0, list = node.body; i4 < list.length; i4 += 1) { + var stmt = list[i4]; + c4(stmt, st, "Statement"); + } +}; +base.Statement = skipThrough; +base.EmptyStatement = ignore; +base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression = function(node, st, c4) { + return c4(node.expression, st, "Expression"); +}; +base.IfStatement = function(node, st, c4) { + c4(node.test, st, "Expression"); + c4(node.consequent, st, "Statement"); + if (node.alternate) { + c4(node.alternate, st, "Statement"); + } +}; +base.LabeledStatement = function(node, st, c4) { + return c4(node.body, st, "Statement"); +}; +base.BreakStatement = base.ContinueStatement = ignore; +base.WithStatement = function(node, st, c4) { + c4(node.object, st, "Expression"); + c4(node.body, st, "Statement"); +}; +base.SwitchStatement = function(node, st, c4) { + c4(node.discriminant, st, "Expression"); + for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) { + var cs = list$1[i$1]; + if (cs.test) { + c4(cs.test, st, "Expression"); + } + for (var i4 = 0, list = cs.consequent; i4 < list.length; i4 += 1) { + var cons = list[i4]; + c4(cons, st, "Statement"); + } + } +}; +base.SwitchCase = function(node, st, c4) { + if (node.test) { + c4(node.test, st, "Expression"); + } + for (var i4 = 0, list = node.consequent; i4 < list.length; i4 += 1) { + var cons = list[i4]; + c4(cons, st, "Statement"); + } +}; +base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function(node, st, c4) { + if (node.argument) { + c4(node.argument, st, "Expression"); + } +}; +base.ThrowStatement = base.SpreadElement = function(node, st, c4) { + return c4(node.argument, st, "Expression"); +}; +base.TryStatement = function(node, st, c4) { + c4(node.block, st, "Statement"); + if (node.handler) { + c4(node.handler, st); + } + if (node.finalizer) { + c4(node.finalizer, st, "Statement"); + } +}; +base.CatchClause = function(node, st, c4) { + if (node.param) { + c4(node.param, st, "Pattern"); + } + c4(node.body, st, "Statement"); +}; +base.WhileStatement = base.DoWhileStatement = function(node, st, c4) { + c4(node.test, st, "Expression"); + c4(node.body, st, "Statement"); +}; +base.ForStatement = function(node, st, c4) { + if (node.init) { + c4(node.init, st, "ForInit"); + } + if (node.test) { + c4(node.test, st, "Expression"); + } + if (node.update) { + c4(node.update, st, "Expression"); + } + c4(node.body, st, "Statement"); +}; +base.ForInStatement = base.ForOfStatement = function(node, st, c4) { + c4(node.left, st, "ForInit"); + c4(node.right, st, "Expression"); + c4(node.body, st, "Statement"); +}; +base.ForInit = function(node, st, c4) { + if (node.type === "VariableDeclaration") { + c4(node, st); + } else { + c4(node, st, "Expression"); + } +}; +base.DebuggerStatement = ignore; +base.FunctionDeclaration = function(node, st, c4) { + return c4(node, st, "Function"); +}; +base.VariableDeclaration = function(node, st, c4) { + for (var i4 = 0, list = node.declarations; i4 < list.length; i4 += 1) { + var decl = list[i4]; + c4(decl, st); + } +}; +base.VariableDeclarator = function(node, st, c4) { + c4(node.id, st, "Pattern"); + if (node.init) { + c4(node.init, st, "Expression"); + } +}; +base.Function = function(node, st, c4) { + if (node.id) { + c4(node.id, st, "Pattern"); + } + for (var i4 = 0, list = node.params; i4 < list.length; i4 += 1) { + var param = list[i4]; + c4(param, st, "Pattern"); + } + c4(node.body, st, node.expression ? "Expression" : "Statement"); +}; +base.Pattern = function(node, st, c4) { + if (node.type === "Identifier") { + c4(node, st, "VariablePattern"); + } else if (node.type === "MemberExpression") { + c4(node, st, "MemberPattern"); + } else { + c4(node, st); + } +}; +base.VariablePattern = ignore; +base.MemberPattern = skipThrough; +base.RestElement = function(node, st, c4) { + return c4(node.argument, st, "Pattern"); +}; +base.ArrayPattern = function(node, st, c4) { + for (var i4 = 0, list = node.elements; i4 < list.length; i4 += 1) { + var elt = list[i4]; + if (elt) { + c4(elt, st, "Pattern"); + } + } +}; +base.ObjectPattern = function(node, st, c4) { + for (var i4 = 0, list = node.properties; i4 < list.length; i4 += 1) { + var prop = list[i4]; + if (prop.type === "Property") { + if (prop.computed) { + c4(prop.key, st, "Expression"); + } + c4(prop.value, st, "Pattern"); + } else if (prop.type === "RestElement") { + c4(prop.argument, st, "Pattern"); + } + } +}; +base.Expression = skipThrough; +base.ThisExpression = base.Super = base.MetaProperty = ignore; +base.ArrayExpression = function(node, st, c4) { + for (var i4 = 0, list = node.elements; i4 < list.length; i4 += 1) { + var elt = list[i4]; + if (elt) { + c4(elt, st, "Expression"); + } + } +}; +base.ObjectExpression = function(node, st, c4) { + for (var i4 = 0, list = node.properties; i4 < list.length; i4 += 1) { + var prop = list[i4]; + c4(prop, st); + } +}; +base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration; +base.SequenceExpression = function(node, st, c4) { + for (var i4 = 0, list = node.expressions; i4 < list.length; i4 += 1) { + var expr = list[i4]; + c4(expr, st, "Expression"); + } +}; +base.TemplateLiteral = function(node, st, c4) { + for (var i4 = 0, list = node.quasis; i4 < list.length; i4 += 1) { + var quasi = list[i4]; + c4(quasi, st); + } + for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) { + var expr = list$1[i$1]; + c4(expr, st, "Expression"); + } +}; +base.TemplateElement = ignore; +base.UnaryExpression = base.UpdateExpression = function(node, st, c4) { + c4(node.argument, st, "Expression"); +}; +base.BinaryExpression = base.LogicalExpression = function(node, st, c4) { + c4(node.left, st, "Expression"); + c4(node.right, st, "Expression"); +}; +base.AssignmentExpression = base.AssignmentPattern = function(node, st, c4) { + c4(node.left, st, "Pattern"); + c4(node.right, st, "Expression"); +}; +base.ConditionalExpression = function(node, st, c4) { + c4(node.test, st, "Expression"); + c4(node.consequent, st, "Expression"); + c4(node.alternate, st, "Expression"); +}; +base.NewExpression = base.CallExpression = function(node, st, c4) { + c4(node.callee, st, "Expression"); + if (node.arguments) { + for (var i4 = 0, list = node.arguments; i4 < list.length; i4 += 1) { + var arg = list[i4]; + c4(arg, st, "Expression"); + } + } +}; +base.MemberExpression = function(node, st, c4) { + c4(node.object, st, "Expression"); + if (node.computed) { + c4(node.property, st, "Expression"); + } +}; +base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function(node, st, c4) { + if (node.declaration) { + c4(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); + } + if (node.source) { + c4(node.source, st, "Expression"); + } +}; +base.ExportAllDeclaration = function(node, st, c4) { + if (node.exported) { + c4(node.exported, st); + } + c4(node.source, st, "Expression"); +}; +base.ImportDeclaration = function(node, st, c4) { + for (var i4 = 0, list = node.specifiers; i4 < list.length; i4 += 1) { + var spec = list[i4]; + c4(spec, st); + } + c4(node.source, st, "Expression"); +}; +base.ImportExpression = function(node, st, c4) { + c4(node.source, st, "Expression"); +}; +base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore; +base.TaggedTemplateExpression = function(node, st, c4) { + c4(node.tag, st, "Expression"); + c4(node.quasi, st, "Expression"); +}; +base.ClassDeclaration = base.ClassExpression = function(node, st, c4) { + return c4(node, st, "Class"); +}; +base.Class = function(node, st, c4) { + if (node.id) { + c4(node.id, st, "Pattern"); + } + if (node.superClass) { + c4(node.superClass, st, "Expression"); + } + c4(node.body, st); +}; +base.ClassBody = function(node, st, c4) { + for (var i4 = 0, list = node.body; i4 < list.length; i4 += 1) { + var elt = list[i4]; + c4(elt, st); + } +}; +base.MethodDefinition = base.PropertyDefinition = base.Property = function(node, st, c4) { + if (node.computed) { + c4(node.key, st, "Expression"); + } + if (node.value) { + c4(node.value, st, "Expression"); + } +}; + +// node_modules/astring/dist/astring.mjs +var { stringify } = JSON; +if (!String.prototype.repeat) { + throw new Error( + "String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation" + ); +} +if (!String.prototype.endsWith) { + throw new Error( + "String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation" + ); +} +var OPERATOR_PRECEDENCE = { + "||": 3, + "&&": 4, + "|": 5, + "??": 5, + "^": 6, + "&": 7, + "==": 8, + "!=": 8, + "===": 8, + "!==": 8, + "<": 9, + ">": 9, + "<=": 9, + ">=": 9, + in: 9, + instanceof: 9, + "<<": 10, + ">>": 10, + ">>>": 10, + "+": 11, + "-": 11, + "*": 12, + "%": 12, + "/": 12, + "**": 13 +}; +var NEEDS_PARENTHESES = 17; +var EXPRESSIONS_PRECEDENCE = { + 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: NEEDS_PARENTHESES, + ClassExpression: NEEDS_PARENTHESES, + FunctionExpression: NEEDS_PARENTHESES, + ObjectExpression: NEEDS_PARENTHESES, + UpdateExpression: 16, + UnaryExpression: 15, + AwaitExpression: 15, + BinaryExpression: 14, + LogicalExpression: 13, + ConditionalExpression: 4, + AssignmentExpression: 3, + YieldExpression: 2, + RestElement: 1 +}; +function formatSequence(state, nodes) { + const { generator } = state; + state.write("("); + if (nodes != null && nodes.length > 0) { + generator[nodes[0].type](nodes[0], state); + const { length } = nodes; + for (let i4 = 1; i4 < length; i4++) { + const param = nodes[i4]; + state.write(", "); + generator[param.type](param, state); + } + } + state.write(")"); +} +function expressionNeedsParenthesis(state, node, parentNode, isRightHand) { + const nodePrecedence = state.expressionsPrecedence[node.type]; + if (nodePrecedence === NEEDS_PARENTHESES) { + return true; + } + const parentNodePrecedence = state.expressionsPrecedence[parentNode.type]; + if (nodePrecedence !== parentNodePrecedence) { + return !isRightHand && nodePrecedence === 15 && parentNodePrecedence === 14 && parentNode.operator === "**" || nodePrecedence < parentNodePrecedence; + } + if (nodePrecedence !== 13 && nodePrecedence !== 14) { + return false; + } + if (node.operator === "**" && parentNode.operator === "**") { + return !isRightHand; + } + if (isRightHand) { + return OPERATOR_PRECEDENCE[node.operator] <= OPERATOR_PRECEDENCE[parentNode.operator]; + } + return OPERATOR_PRECEDENCE[node.operator] < OPERATOR_PRECEDENCE[parentNode.operator]; +} +function formatExpression(state, node, parentNode, isRightHand) { + const { generator } = state; + if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) { + state.write("("); + generator[node.type](node, state); + state.write(")"); + } else { + generator[node.type](node, state); + } +} +function reindent(state, text2, indent, lineEnd) { + const lines = text2.split("\n"); + const end = lines.length - 1; + state.write(lines[0].trim()); + if (end > 0) { + state.write(lineEnd); + for (let i4 = 1; i4 < end; i4++) { + state.write(indent + lines[i4].trim() + lineEnd); + } + state.write(indent + lines[end].trim()); + } +} +function formatComments(state, comments, indent, lineEnd) { + const { length } = comments; + for (let i4 = 0; i4 < length; i4++) { + const comment = comments[i4]; + state.write(indent); + if (comment.type[0] === "L") { + state.write("// " + comment.value.trim() + "\n", comment); + } else { + state.write("/*"); + reindent(state, comment.value, indent, lineEnd); + state.write("*/" + lineEnd); + } + } +} +function hasCallExpression(node) { + let currentNode = node; + while (currentNode != null) { + const { type } = currentNode; + if (type[0] === "C" && type[1] === "a") { + return true; + } else if (type[0] === "M" && type[1] === "e" && type[2] === "m") { + currentNode = currentNode.object; + } else { + return false; + } + } +} +function formatVariableDeclaration(state, node) { + const { generator } = state; + const { declarations } = node; + state.write(node.kind + " "); + const { length } = declarations; + if (length > 0) { + generator.VariableDeclarator(declarations[0], state); + for (let i4 = 1; i4 < length; i4++) { + state.write(", "); + generator.VariableDeclarator(declarations[i4], state); + } + } +} +var ForInStatement; +var FunctionDeclaration; +var RestElement; +var BinaryExpression; +var ArrayExpression; +var BlockStatement; +var GENERATOR = { + Program(node, state) { + const indent = state.indent.repeat(state.indentLevel); + const { lineEnd, writeComments } = state; + if (writeComments && node.comments != null) { + formatComments(state, node.comments, indent, lineEnd); + } + const statements = node.body; + const { length } = statements; + for (let i4 = 0; i4 < length; i4++) { + const statement = statements[i4]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, indent, lineEnd); + } + state.write(indent); + this[statement.type](statement, state); + state.write(lineEnd); + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, indent, lineEnd); + } + }, + BlockStatement: BlockStatement = function(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const { lineEnd, writeComments } = state; + const statementIndent = indent + state.indent; + state.write("{"); + const statements = node.body; + if (statements != null && statements.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, statementIndent, lineEnd); + } + const { length } = statements; + for (let i4 = 0; i4 < length; i4++) { + const statement = statements[i4]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + state.write(indent); + } else { + if (writeComments && node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, statementIndent, lineEnd); + state.write(indent); + } + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, statementIndent, lineEnd); + } + state.write("}"); + state.indentLevel--; + }, + ClassBody: BlockStatement, + StaticBlock(node, state) { + state.write("static "); + this.BlockStatement(node, state); + }, + EmptyStatement(node, state) { + state.write(";"); + }, + ExpressionStatement(node, state) { + const precedence = state.expressionsPrecedence[node.expression.type]; + if (precedence === NEEDS_PARENTHESES || precedence === 3 && node.expression.left.type[0] === "O") { + state.write("("); + this[node.expression.type](node.expression, state); + state.write(")"); + } else { + this[node.expression.type](node.expression, state); + } + state.write(";"); + }, + IfStatement(node, state) { + state.write("if ("); + this[node.test.type](node.test, state); + state.write(") "); + this[node.consequent.type](node.consequent, state); + if (node.alternate != null) { + state.write(" else "); + this[node.alternate.type](node.alternate, state); + } + }, + LabeledStatement(node, state) { + this[node.label.type](node.label, state); + state.write(": "); + this[node.body.type](node.body, state); + }, + BreakStatement(node, state) { + state.write("break"); + if (node.label != null) { + state.write(" "); + this[node.label.type](node.label, state); + } + state.write(";"); + }, + ContinueStatement(node, state) { + state.write("continue"); + if (node.label != null) { + state.write(" "); + this[node.label.type](node.label, state); + } + state.write(";"); + }, + WithStatement(node, state) { + state.write("with ("); + this[node.object.type](node.object, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + SwitchStatement(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const { lineEnd, writeComments } = state; + state.indentLevel++; + const caseIndent = indent + state.indent; + const statementIndent = caseIndent + state.indent; + state.write("switch ("); + this[node.discriminant.type](node.discriminant, state); + state.write(") {" + lineEnd); + const { cases: occurences } = node; + const { length: occurencesCount } = occurences; + for (let i4 = 0; i4 < occurencesCount; i4++) { + const occurence = occurences[i4]; + if (writeComments && occurence.comments != null) { + formatComments(state, occurence.comments, caseIndent, lineEnd); + } + if (occurence.test) { + state.write(caseIndent + "case "); + this[occurence.test.type](occurence.test, state); + state.write(":" + lineEnd); + } else { + state.write(caseIndent + "default:" + lineEnd); + } + const { consequent } = occurence; + const { length: consequentCount } = consequent; + for (let i5 = 0; i5 < consequentCount; i5++) { + const statement = consequent[i5]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + } + state.indentLevel -= 2; + state.write(indent + "}"); + }, + ReturnStatement(node, state) { + state.write("return"); + if (node.argument) { + state.write(" "); + this[node.argument.type](node.argument, state); + } + state.write(";"); + }, + ThrowStatement(node, state) { + state.write("throw "); + this[node.argument.type](node.argument, state); + state.write(";"); + }, + TryStatement(node, state) { + state.write("try "); + this[node.block.type](node.block, state); + if (node.handler) { + const { handler } = node; + if (handler.param == null) { + state.write(" catch "); + } else { + state.write(" catch ("); + this[handler.param.type](handler.param, state); + state.write(") "); + } + this[handler.body.type](handler.body, state); + } + if (node.finalizer) { + state.write(" finally "); + this[node.finalizer.type](node.finalizer, state); + } + }, + WhileStatement(node, state) { + state.write("while ("); + this[node.test.type](node.test, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + DoWhileStatement(node, state) { + state.write("do "); + this[node.body.type](node.body, state); + state.write(" while ("); + this[node.test.type](node.test, state); + state.write(");"); + }, + ForStatement(node, state) { + state.write("for ("); + if (node.init != null) { + const { init } = node; + if (init.type[0] === "V") { + formatVariableDeclaration(state, init); + } else { + this[init.type](init, state); + } + } + state.write("; "); + if (node.test) { + this[node.test.type](node.test, state); + } + state.write("; "); + if (node.update) { + this[node.update.type](node.update, state); + } + state.write(") "); + this[node.body.type](node.body, state); + }, + ForInStatement: ForInStatement = function(node, state) { + state.write(`for ${node.await ? "await " : ""}(`); + const { left } = node; + if (left.type[0] === "V") { + formatVariableDeclaration(state, left); + } else { + this[left.type](left, state); + } + state.write(node.type[3] === "I" ? " in " : " of "); + this[node.right.type](node.right, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + ForOfStatement: ForInStatement, + DebuggerStatement(node, state) { + state.write("debugger;", node); + }, + FunctionDeclaration: FunctionDeclaration = function(node, state) { + state.write( + (node.async ? "async " : "") + (node.generator ? "function* " : "function ") + (node.id ? node.id.name : ""), + node + ); + formatSequence(state, node.params); + state.write(" "); + this[node.body.type](node.body, state); + }, + FunctionExpression: FunctionDeclaration, + VariableDeclaration(node, state) { + formatVariableDeclaration(state, node); + state.write(";"); + }, + VariableDeclarator(node, state) { + this[node.id.type](node.id, state); + if (node.init != null) { + state.write(" = "); + this[node.init.type](node.init, state); + } + }, + ClassDeclaration(node, state) { + state.write("class " + (node.id ? `${node.id.name} ` : ""), node); + if (node.superClass) { + state.write("extends "); + const { superClass } = node; + const { type } = superClass; + const precedence = state.expressionsPrecedence[type]; + if ((type[0] !== "C" || type[1] !== "l" || type[5] !== "E") && (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.ClassExpression)) { + state.write("("); + this[node.superClass.type](superClass, state); + state.write(")"); + } else { + this[superClass.type](superClass, state); + } + state.write(" "); + } + this.ClassBody(node.body, state); + }, + ImportDeclaration(node, state) { + state.write("import "); + const { specifiers } = node; + const { length } = specifiers; + let i4 = 0; + if (length > 0) { + for (; i4 < length; ) { + if (i4 > 0) { + state.write(", "); + } + const specifier = specifiers[i4]; + const type = specifier.type[6]; + if (type === "D") { + state.write(specifier.local.name, specifier); + i4++; + } else if (type === "N") { + state.write("* as " + specifier.local.name, specifier); + i4++; + } else { + break; + } + } + if (i4 < length) { + state.write("{"); + for (; ; ) { + const specifier = specifiers[i4]; + const { name } = specifier.imported; + state.write(name, specifier); + if (name !== specifier.local.name) { + state.write(" as " + specifier.local.name); + } + if (++i4 < length) { + state.write(", "); + } else { + break; + } + } + state.write("}"); + } + state.write(" from "); + } + this.Literal(node.source, state); + state.write(";"); + }, + ImportExpression(node, state) { + state.write("import("); + this[node.source.type](node.source, state); + state.write(")"); + }, + ExportDefaultDeclaration(node, state) { + state.write("export default "); + this[node.declaration.type](node.declaration, state); + if (state.expressionsPrecedence[node.declaration.type] != null && node.declaration.type[0] !== "F") { + state.write(";"); + } + }, + ExportNamedDeclaration(node, state) { + state.write("export "); + if (node.declaration) { + this[node.declaration.type](node.declaration, state); + } else { + state.write("{"); + const { specifiers } = node, { length } = specifiers; + if (length > 0) { + for (let i4 = 0; ; ) { + const specifier = specifiers[i4]; + const { name } = specifier.local; + state.write(name, specifier); + if (name !== specifier.exported.name) { + state.write(" as " + specifier.exported.name); + } + if (++i4 < length) { + state.write(", "); + } else { + break; + } + } + } + state.write("}"); + if (node.source) { + state.write(" from "); + this.Literal(node.source, state); + } + state.write(";"); + } + }, + ExportAllDeclaration(node, state) { + if (node.exported != null) { + state.write("export * as " + node.exported.name + " from "); + } else { + state.write("export * from "); + } + this.Literal(node.source, state); + state.write(";"); + }, + MethodDefinition(node, state) { + if (node.static) { + state.write("static "); + } + const kind = node.kind[0]; + if (kind === "g" || kind === "s") { + state.write(node.kind + " "); + } + if (node.value.async) { + state.write("async "); + } + if (node.value.generator) { + state.write("*"); + } + if (node.computed) { + state.write("["); + this[node.key.type](node.key, state); + state.write("]"); + } else { + this[node.key.type](node.key, state); + } + formatSequence(state, node.value.params); + state.write(" "); + this[node.value.body.type](node.value.body, state); + }, + ClassExpression(node, state) { + this.ClassDeclaration(node, state); + }, + ArrowFunctionExpression(node, state) { + state.write(node.async ? "async " : "", node); + const { params } = node; + if (params != null) { + if (params.length === 1 && params[0].type[0] === "I") { + state.write(params[0].name, params[0]); + } else { + formatSequence(state, node.params); + } + } + state.write(" => "); + if (node.body.type[0] === "O") { + state.write("("); + this.ObjectExpression(node.body, state); + state.write(")"); + } else { + this[node.body.type](node.body, state); + } + }, + ThisExpression(node, state) { + state.write("this", node); + }, + Super(node, state) { + state.write("super", node); + }, + RestElement: RestElement = function(node, state) { + state.write("..."); + this[node.argument.type](node.argument, state); + }, + SpreadElement: RestElement, + YieldExpression(node, state) { + state.write(node.delegate ? "yield*" : "yield"); + if (node.argument) { + state.write(" "); + this[node.argument.type](node.argument, state); + } + }, + AwaitExpression(node, state) { + state.write("await ", node); + formatExpression(state, node.argument, node); + }, + TemplateLiteral(node, state) { + const { quasis, expressions } = node; + state.write("`"); + const { length } = expressions; + for (let i4 = 0; i4 < length; i4++) { + const expression = expressions[i4]; + const quasi2 = quasis[i4]; + state.write(quasi2.value.raw, quasi2); + state.write("${"); + this[expression.type](expression, state); + state.write("}"); + } + const quasi = quasis[quasis.length - 1]; + state.write(quasi.value.raw, quasi); + state.write("`"); + }, + TemplateElement(node, state) { + state.write(node.value.raw, node); + }, + TaggedTemplateExpression(node, state) { + formatExpression(state, node.tag, node); + this[node.quasi.type](node.quasi, state); + }, + ArrayExpression: ArrayExpression = function(node, state) { + state.write("["); + if (node.elements.length > 0) { + const { elements } = node, { length } = elements; + for (let i4 = 0; ; ) { + const element = elements[i4]; + if (element != null) { + this[element.type](element, state); + } + if (++i4 < length) { + state.write(", "); + } else { + if (element == null) { + state.write(", "); + } + break; + } + } + } + state.write("]"); + }, + ArrayPattern: ArrayExpression, + ObjectExpression(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const { lineEnd, writeComments } = state; + const propertyIndent = indent + state.indent; + state.write("{"); + if (node.properties.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, propertyIndent, lineEnd); + } + const comma = "," + lineEnd; + const { properties: properties2 } = node, { length } = properties2; + for (let i4 = 0; ; ) { + const property = properties2[i4]; + if (writeComments && property.comments != null) { + formatComments(state, property.comments, propertyIndent, lineEnd); + } + state.write(propertyIndent); + this[property.type](property, state); + if (++i4 < length) { + state.write(comma); + } else { + break; + } + } + state.write(lineEnd); + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + "}"); + } else if (writeComments) { + if (node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, propertyIndent, lineEnd); + if (node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + "}"); + } else if (node.trailingComments != null) { + state.write(lineEnd); + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + state.write(indent + "}"); + } else { + state.write("}"); + } + } else { + state.write("}"); + } + state.indentLevel--; + }, + Property(node, state) { + if (node.method || node.kind[0] !== "i") { + this.MethodDefinition(node, state); + } else { + if (!node.shorthand) { + if (node.computed) { + state.write("["); + this[node.key.type](node.key, state); + state.write("]"); + } else { + this[node.key.type](node.key, state); + } + state.write(": "); + } + this[node.value.type](node.value, state); + } + }, + PropertyDefinition(node, state) { + if (node.static) { + state.write("static "); + } + if (node.computed) { + state.write("["); + } + this[node.key.type](node.key, state); + if (node.computed) { + state.write("]"); + } + if (node.value == null) { + if (node.key.type[0] !== "F") { + state.write(";"); + } + return; + } + state.write(" = "); + this[node.value.type](node.value, state); + state.write(";"); + }, + ObjectPattern(node, state) { + state.write("{"); + if (node.properties.length > 0) { + const { properties: properties2 } = node, { length } = properties2; + for (let i4 = 0; ; ) { + this[properties2[i4].type](properties2[i4], state); + if (++i4 < length) { + state.write(", "); + } else { + break; + } + } + } + state.write("}"); + }, + SequenceExpression(node, state) { + formatSequence(state, node.expressions); + }, + UnaryExpression(node, state) { + if (node.prefix) { + const { + operator, + argument, + argument: { type } + } = node; + state.write(operator); + const needsParentheses = expressionNeedsParenthesis(state, argument, node); + if (!needsParentheses && (operator.length > 1 || type[0] === "U" && (type[1] === "n" || type[1] === "p") && argument.prefix && argument.operator[0] === operator && (operator === "+" || operator === "-"))) { + state.write(" "); + } + if (needsParentheses) { + state.write(operator.length > 1 ? " (" : "("); + this[type](argument, state); + state.write(")"); + } else { + this[type](argument, state); + } + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + UpdateExpression(node, state) { + if (node.prefix) { + state.write(node.operator); + this[node.argument.type](node.argument, state); + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + AssignmentExpression(node, state) { + this[node.left.type](node.left, state); + state.write(" " + node.operator + " "); + this[node.right.type](node.right, state); + }, + AssignmentPattern(node, state) { + this[node.left.type](node.left, state); + state.write(" = "); + this[node.right.type](node.right, state); + }, + BinaryExpression: BinaryExpression = function(node, state) { + const isIn = node.operator === "in"; + if (isIn) { + state.write("("); + } + formatExpression(state, node.left, node, false); + state.write(" " + node.operator + " "); + formatExpression(state, node.right, node, true); + if (isIn) { + state.write(")"); + } + }, + LogicalExpression: BinaryExpression, + ConditionalExpression(node, state) { + const { test } = node; + const precedence = state.expressionsPrecedence[test.type]; + if (precedence === NEEDS_PARENTHESES || precedence <= state.expressionsPrecedence.ConditionalExpression) { + state.write("("); + this[test.type](test, state); + state.write(")"); + } else { + this[test.type](test, state); + } + state.write(" ? "); + this[node.consequent.type](node.consequent, state); + state.write(" : "); + this[node.alternate.type](node.alternate, state); + }, + NewExpression(node, state) { + state.write("new "); + const precedence = state.expressionsPrecedence[node.callee.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression || hasCallExpression(node.callee)) { + state.write("("); + this[node.callee.type](node.callee, state); + state.write(")"); + } else { + this[node.callee.type](node.callee, state); + } + formatSequence(state, node["arguments"]); + }, + CallExpression(node, state) { + const precedence = state.expressionsPrecedence[node.callee.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression) { + state.write("("); + this[node.callee.type](node.callee, state); + state.write(")"); + } else { + this[node.callee.type](node.callee, state); + } + if (node.optional) { + state.write("?."); + } + formatSequence(state, node["arguments"]); + }, + ChainExpression(node, state) { + this[node.expression.type](node.expression, state); + }, + MemberExpression(node, state) { + const precedence = state.expressionsPrecedence[node.object.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.MemberExpression) { + state.write("("); + this[node.object.type](node.object, state); + state.write(")"); + } else { + this[node.object.type](node.object, state); + } + if (node.computed) { + if (node.optional) { + state.write("?."); + } + state.write("["); + this[node.property.type](node.property, state); + state.write("]"); + } else { + if (node.optional) { + state.write("?."); + } else { + state.write("."); + } + this[node.property.type](node.property, state); + } + }, + MetaProperty(node, state) { + state.write(node.meta.name + "." + node.property.name, node); + }, + Identifier(node, state) { + state.write(node.name, node); + }, + PrivateIdentifier(node, state) { + state.write(`#${node.name}`, node); + }, + Literal(node, state) { + if (node.raw != null) { + state.write(node.raw, node); + } else if (node.regex != null) { + this.RegExpLiteral(node, state); + } else if (node.bigint != null) { + state.write(node.bigint + "n", node); + } else { + state.write(stringify(node.value), node); + } + }, + RegExpLiteral(node, state) { + const { regex } = node; + state.write(`/${regex.pattern}/${regex.flags}`, node); + } +}; +var EMPTY_OBJECT = {}; +var State = class { + constructor(options) { + const setup = options == null ? EMPTY_OBJECT : options; + this.output = ""; + if (setup.output != null) { + this.output = setup.output; + this.write = this.writeToStream; + } else { + this.output = ""; + } + this.generator = setup.generator != null ? setup.generator : GENERATOR; + this.expressionsPrecedence = setup.expressionsPrecedence != null ? setup.expressionsPrecedence : EXPRESSIONS_PRECEDENCE; + this.indent = setup.indent != null ? setup.indent : " "; + this.lineEnd = setup.lineEnd != null ? setup.lineEnd : "\n"; + this.indentLevel = setup.startingIndentLevel != null ? setup.startingIndentLevel : 0; + this.writeComments = setup.comments ? setup.comments : false; + if (setup.sourceMap != null) { + this.write = setup.output == null ? this.writeAndMap : this.writeToStreamAndMap; + this.sourceMap = setup.sourceMap; + this.line = 1; + this.column = 0; + this.lineEndSize = this.lineEnd.split("\n").length - 1; + this.mapping = { + original: null, + generated: this, + name: void 0, + source: setup.sourceMap.file || setup.sourceMap._file + }; + } + } + write(code) { + this.output += code; + } + writeToStream(code) { + this.output.write(code); + } + writeAndMap(code, node) { + this.output += code; + this.map(code, node); + } + writeToStreamAndMap(code, node) { + this.output.write(code); + this.map(code, node); + } + map(code, node) { + if (node != null) { + const { type } = node; + if (type[0] === "L" && type[2] === "n") { + this.column = 0; + this.line++; + return; + } + if (node.loc != null) { + const { mapping } = this; + mapping.original = node.loc.start; + mapping.name = node.name; + this.sourceMap.addMapping(mapping); + } + if (type[0] === "T" && type[8] === "E" || type[0] === "L" && type[1] === "i" && typeof node.value === "string") { + const { length: length2 } = code; + let { column, line } = this; + for (let i4 = 0; i4 < length2; i4++) { + if (code[i4] === "\n") { + column = 0; + line++; + } else { + column++; + } + } + this.column = column; + this.line = line; + return; + } + } + const { length } = code; + const { lineEnd } = this; + if (length > 0) { + if (this.lineEndSize > 0 && (lineEnd.length === 1 ? code[length - 1] === lineEnd : code.endsWith(lineEnd))) { + this.line += this.lineEndSize; + this.column = 0; + } else { + this.column += length; + } + } + } + toString() { + return this.output; + } +}; +function generate(node, options) { + const state = new State(options); + state.generator[node.type](node, state); + return state.output; +} + +// src/utils/frames/linker.ts +var preprocessCode = (code, oldName, newName) => { + let string; + let codeBlock = ensureString(code); + const isMultiLine = codeBlock.includes("\n"); + if (isMultiLine) { + const lines = codeBlock.split("\n").filter((line) => line.trim() !== ""); + lines[lines.length - 1] = `${lines[lines.length - 1].replace("return ", "")}`; + codeBlock = lines.join("\n"); + } + try { + const ast = parse3(codeBlock, { ecmaVersion: 2020, locations: true }); + ancestor(ast, { + Identifier(node, ancestors) { + const parent = ancestors[ancestors.length - 2]; + if (parent.type !== "MemberExpression" || parent.object === node) { + if (node.name == oldName) { + node.name = newName; + } + } + } + }); + string = generate(ast).trimEnd(); + } catch (e4) { + console.log(e4); + string = `"error"`; + } + if (isMultiLine) { + const lines = string.split("\n").filter((line) => line.trim() !== ""); + lines[lines.length - 1] = `return ${lines[lines.length - 1]}`; + string = lines.join("\n"); + } + return string; +}; +var linkNodes = (parent, schemaId, props2, flattenedTree, uniqueID) => { + const relinkProps = (oldParent, newParent2, props3, node) => { + var _a2, _b2, _c2; + return { + ...node, + parentId: node.parentId == oldParent ? newParent2 : node.parentId, + props: Object.keys((_a2 = node == null ? void 0 : node.props) != null ? _a2 : {}).reduce( + (p3, c4) => { + return { + ...p3, + [c4]: preprocessCode(node.props[c4], oldParent, newParent2) + }; + }, + node.props + ), + actions: Object.keys((_b2 = node == null ? void 0 : node.actions) != null ? _b2 : {}).reduce( + (p3, c4) => { + return { + ...p3, + [c4]: preprocessCode(node.actions[c4], oldParent, newParent2) + }; + }, + node.actions + ), + styles: Object.keys((_c2 = node == null ? void 0 : node.styles) != null ? _c2 : {}).reduce( + (p3, c4) => { + return { + ...p3, + [c4]: preprocessCode(node.styles[c4], oldParent, newParent2) + }; + }, + node.styles + ) + }; + }; + const assignIDs = (parent2, nodes) => { + const [newNodes, newID] = nodes.reduce((p3, c4, i4) => { + const [oldNodes, id2] = p3; + const newNodeID = c4.parentId ? c4.id + id2 : parent2.id; + const newNode = { + ...c4.parentId == "" ? parent2 : oldNodes[i4], + type: oldNodes[i4].type, + id: newNodeID + }; + const returnNodes = oldNodes.map((f4) => f4.id != c4.id ? relinkProps(c4.id, newNodeID, props2, f4) : relinkProps(c4.id, newNodeID, props2, newNode)); + return [returnNodes, id2 + 1]; + }, [nodes, uniqueID]); + return [newNodes, newID]; + }; + const newParent = schemaId != parent.id ? relinkProps(schemaId, parent.id, props2, parent) : parent; + return assignIDs(newParent, flattenedTree); +}; +var linkTreeNodes = (parent, uniqueID) => { + const relinkProps = (oldParent, newParent, treenode) => { + var _a2, _b2, _c2; + let children; + const node = treenode.node; + if (treenode.children) { + children = treenode.children.map((child) => relinkProps(oldParent, newParent, child)); + } + return { + ...treenode, + children, + node: { + ...treenode.node, + parentId: node.parentId == oldParent ? newParent : node.parentId, + props: Object.keys((_a2 = node == null ? void 0 : node.props) != null ? _a2 : {}).reduce( + (p3, c4) => { + return { + ...p3, + [c4]: preprocessCode(node.props[c4], oldParent, newParent) + }; + }, + node.props + ), + actions: Object.keys((_b2 = node == null ? void 0 : node.actions) != null ? _b2 : {}).reduce( + (p3, c4) => { + return { + ...p3, + [c4]: preprocessCode(node.actions[c4], oldParent, newParent) + }; + }, + node.actions + ), + styles: Object.keys((_c2 = node == null ? void 0 : node.styles) != null ? _c2 : {}).reduce( + (p3, c4) => { + return { + ...p3, + [c4]: preprocessCode(node.styles[c4], oldParent, newParent) + }; + }, + node.styles + ) + } + }; + }; + const assignIDs = (parent2, node, uniqueID2) => { + const assignIDToTree = (parent3, node2, id2) => { + const newNodeID = node2.node.parentId ? node2.id + id2 : parent3.id; + let newNode = { ...node2, node: { ...node2.node, id: newNodeID }, id: newNodeID }; + newNode = relinkProps(node2.id, newNodeID, newNode); + if (newNode.children) { + const [newChildren, newID] = newNode.children.reduce( + (acc, child, i4) => { + const [newChild, nextID] = assignIDToTree(newNode, child, id2 + i4 + 1); + acc[0].push(newChild); + return [acc[0], nextID]; + }, + [[], id2] + ); + newNode.children = newChildren; + id2 = newID; + } + return [newNode, id2 + 1]; + }; + return assignIDToTree(parent2, node, uniqueID2); + }; + return assignIDs(parent, parent, uniqueID); +}; + +// src/utils/json.ts +var safelyParseJSON = (json) => { + var parsed; + try { + parsed = JSON.parse(json); + } catch (e4) { + } + return parsed; +}; + +// src/utils/frames/nodes.ts +var mdbSchemaToFrameSchema = (schema) => { + if (!schema) + return null; + return { + ...schema, + def: safelyParseJSON(schema.def) + }; +}; +var frameSchemaToMDBSchema = (frameSchema) => { + return { + ...frameSchema, + def: JSON.stringify(frameSchema.def) + }; +}; +var frameToNode = (frame) => { + return { + ...frame, + rank: parseInt(frame.rank), + contexts: safelyParseJSON(frame.contexts), + styles: safelyParseJSON(frame.styles), + actions: safelyParseJSON(frame.actions), + props: safelyParseJSON(frame.props), + types: nodeToTypes(frame.type) + }; +}; +var nodeToFrame = (node) => { + var _a2, _b2; + const { contexts, styles: styles2, props: props2, actions, ...otherProps } = node; + return { + ...otherProps, + rank: (_b2 = (_a2 = node.rank) == null ? void 0 : _a2.toString()) != null ? _b2 : "0", + contexts: JSON.stringify(contexts), + styles: JSON.stringify(styles2), + actions: JSON.stringify(actions), + props: JSON.stringify(props2) + }; +}; + +// src/utils/frames/ast.ts +var calculateEditorProps = (props2, treeNode) => { + if (props2.editMode == 0 || !props2.rootId) + return props2; + if (treeNode.node.id == props2.rootId) + return props2; + if (treeNode.isRef) + return { ...props2, dropMode: 0, dragMode: 0, resizeMode: 0, selectMode: 0 }; + if (props2.editMode == 2) { + return { + ...props2, + resizeMode: 1 /* ResizeSelected */, + dragMode: 2 /* DragSelected */ + }; + } + const firstLevelNode = treeNode.node.parentId == props2.rootId; + const columnChild = treeNode.editorProps.parentType == "column"; + const isColumn = treeNode.node.type == "column"; + const resizeMode = treeNode.node.type == "image" || isColumn ? 2 /* ResizeAlways */ : 0 /* ResizeNever */; + const dragMode = firstLevelNode && treeNode.node.type != "container" || columnChild && !isColumn || isColumn && treeNode.children.length == 0 ? 1 /* DragHandle */ : 0 /* DragNever */; + const dropMode = isColumn ? 3 /* DropModeColumnOnly */ : columnChild ? 2 /* DropModeRowOnly */ : firstLevelNode ? 1 /* DropModeRowColumn */ : 0; + return { + ...props2, + dragMode, + resizeMode, + dropMode + }; +}; +function replaceSubtree(tree, subtree) { + if (tree.id === subtree.id) { + return subtree; + } + if (tree.children) { + for (let i4 = 0; i4 < tree.children.length; i4++) { + const replacedChild = replaceSubtree(tree.children[i4], subtree); + if (replacedChild !== tree.children[i4]) { + tree.children[i4] = replacedChild; + } + } + } + return tree; +} +var getFrameNodesByPath = (plugin, ref2) => { + const path = uriByString(plugin, ref2); + if (!path) + return; + if (path.space == "$kit") { + return kit.find((f4) => f4.schema.id == path.ref); + } + const context = plugin.index.framesIndex.get(path.basePath); + return context == null ? void 0 : context.frames[path.ref]; +}; +function flattenToFrameNodes(root) { + const flattenedTree = []; + function traverseAndFlatten(node, parent) { + var _a2; + flattenedTree.push({ ...node.node, parentId: parent, schemaId: root.node.schemaId }); + ((_a2 = node.children) != null ? _a2 : []).forEach((child) => { + traverseAndFlatten(child, node.node.id); + }); + } + traverseAndFlatten(root, ""); + return flattenedTree; +} +function insertFrameChildren(root, newChildren) { + function traverseAndInsert(node) { + return { + ...node, + children: node.node.type === "content" && newChildren.length > 0 ? newChildren.map((f4) => ({ ...f4, node: { ...f4.node, parentId: node.id } })) : node.children.map((child) => { + return traverseAndInsert(child); + }) + }; + } + const newRoot = traverseAndInsert(root); + return newRoot; +} +var expandNode = (treeNode, id2, plugin) => { + if (treeNode.node.type == "frame") { + const mdbFrame = getFrameNodesByPath(plugin, treeNode.node.ref); + if (treeNode.node.schemaId == (mdbFrame == null ? void 0 : mdbFrame.schema.id)) + return [treeNode, id2]; + if (!mdbFrame || mdbFrame.rows.length == 0) { + return [treeNode, id2]; + } + const linkedNode = linkProps(mdbFrame.cols, treeNode); + const [linkedNodes, newUniqueID] = linkNodes( + linkedNode.node, + mdbFrame.schema.id, + linkedNode.node.props, + mdbFrame.rows.map((f4) => frameToNode(f4)), + id2 + ); + const [newTreeNode, newID] = buildFrameTree( + linkedNode.node, + linkedNodes, + plugin, + newUniqueID, + true, + treeNode.editorProps + ); + if (!newTreeNode) { + return [linkedNode, newID]; + } + return [insertFrameChildren({ ...newTreeNode, isRef: false, node: { ...newTreeNode.node, schemaId: linkedNode.node.schemaId, ref: linkedNode.node.ref, types: linkedNode.node.types, propsAttrs: linkedNode.node.propsAttrs, propsValue: linkedNode.node.propsValue, parentId: linkedNode.node.parentId, type: "frame", id: newTreeNode.id } }, treeNode.children), newID]; + } + return [treeNode, id2]; +}; +var expandFrame = (node, plugin, uniqueID = 0, editorProps) => { + const [children, lastID] = node.children.reduce((f4, c4) => { + const [nodes, id2] = f4; + const _editorProps = calculateEditorProps({ ...editorProps, parentType: node.node.type }, c4); + const [newNode2, fid] = expandFrame(c4, plugin, id2 + 1, _editorProps); + return [[...nodes, newNode2], fid + 1]; + }, [[], uniqueID]); + const [newNode, newID] = expandNode({ ...node, children, editorProps }, lastID, plugin); + return [{ + ...newNode, + editorProps: calculateEditorProps(newNode.editorProps, newNode) + }, newID]; +}; +var linkProps = (fields, root) => { + const props2 = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: "" }), {}); + const types2 = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: c4.type }), {}); + const propsValue = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: c4.value }), {}); + const propsAttrs = fields.reduce((p3, c4) => ({ ...p3, [c4.name]: c4.attrs }), {}); + return { ...root, node: { + ...root.node, + props: { ...props2, ...root.node.props }, + types: { ...types2, ...root.node.types }, + propsValue: { ...propsValue, ...root.node.propsValue }, + propsAttrs: { ...propsAttrs, ...root.node.propsAttrs } + } }; +}; +var applyPropsToRoot = (root, props2) => ({ + ...root, + node: { + ...root.node, + props: { + ...root.node.props, + ...applyFunctionToObject(props2, (e4) => wrapQuotes(e4)) + } + } +}); +var schemaToRoot = (schema) => { + return { + schemaId: schema.id, + id: schema.id, + type: "group", + rank: 0, + name: schema.id + }; +}; +var schemaToFrame = (schema) => { + return { + schemaId: schema.id, + id: schema.id, + type: "frame", + rank: 0, + name: schema.id + }; +}; +var buildRootFromMDBFrame = (plugin, frame, editorProps = defaultFrameEditorProps) => { + return buildRoot(mdbSchemaToFrameSchema(frame.schema), frame.cols, frame.rows.map((f4) => frameToNode(f4)), plugin, editorProps); +}; +var buildRoot = (schema, fields, nodes, plugin, editorProps = defaultFrameEditorProps) => { + var _a2; + const rootNode = (_a2 = nodes.find((f4) => f4.id == schema.id)) != null ? _a2 : schemaToRoot(schema); + const root = buildFrameTree(rootNode, nodes, plugin, nodes.length, false, { ...editorProps, rootId: schema.id })[0]; + return root && linkProps(fields, root); +}; +var propertiesForNode = (node) => Object.keys(node.types).map((f4) => { + var _a2, _b2; + return { + type: node.types[f4], + name: f4, + schemaId: f4, + value: (_a2 = node.propsValue) == null ? void 0 : _a2[f4], + attrs: (_b2 = node.propsAttrs) == null ? void 0 : _b2[f4] + }; +}); +var buildFrameTree = (root, nodes, plugin, uniqueID = 0, isRef, editorProps = defaultFrameEditorProps) => { + const rootNode = { node: root, id: root.id, children: [], isRef, editorProps }; + const idToNodeMap = { [root.id]: rootNode }; + nodes.forEach((node) => { + idToNodeMap[node.id] = { id: node.id, node, children: [], isRef, editorProps }; + }); + nodes.forEach((node) => { + if (node.parentId) { + const parentNode = idToNodeMap[node.parentId]; + if (parentNode) { + parentNode.children.push({ ...idToNodeMap[node.id], editorProps: { ...editorProps, parentType: parentNode.node.type } }); + parentNode.children.sort((a5, b4) => a5.node.rank - b4.node.rank); + } + } else { + if (node.id == root.id) + rootNode.node = idToNodeMap[node.id].node; + } + }); + const [treeNode, newID] = expandFrame(idToNodeMap[root.id], plugin, uniqueID, editorProps); + return [treeNode, newID]; +}; +var findParent = (tree, targetId, parentId = null) => { + for (const child of tree.children) { + if (child.id === targetId) { + return tree; + } + } + for (const child of tree.children) { + const foundParent = findParent(child, targetId, tree.id); + if (foundParent) { + return foundParent; + } + } + return null; +}; + +// src/schemas/frames.ts +var defaultFrameSchema = { + uniques: ["id,schemaId"], + cols: [ + "id", + "schemaId", + "type", + "parentId", + "name", + "rank", + "icon", + "props", + "actions", + "ref", + "styles", + "contexts" + ] +}; +var nodeToTypes = (type) => { + return type == "flow" ? { value: "link" } : type == "container" || type == "group" || type == "content" || type == "frame" ? {} : { + value: type + }; +}; +var groupNode = { + def: { + icon: "lucide//box-select" + }, + node: { + id: "group", + schemaId: "group", + name: "Group", + rank: 0, + parentId: "", + styles: { + flexDirection: `"column"`, + display: `"flex"` }, - { - n: ["woman-woman-girl-girl", "family: woman, woman, girl, girl"], - u: "1f469-200d-1f469-200d-1f467-200d-1f467" + type: "group" + } +}; +var columnsNode = { + def: { + icon: "lucide//columns" + }, + node: { + id: "container", + schemaId: "container", + name: "Columns", + rank: 0, + parentId: "", + styles: { + layout: `"row"`, + width: `'100%'`, + gap: `'24px'` }, - { n: ["man-boy", "family: man, boy"], u: "1f468-200d-1f466" }, - { - n: ["man-boy-boy", "family: man, boy, boy"], - u: "1f468-200d-1f466-200d-1f466" + type: "container" + } +}; +var columnNode = { + def: { + icon: "lucide//columns" + }, + node: { + icon: "lucide//columns", + id: "column", + schemaId: "column", + name: "Column", + rank: 0, + parentId: "", + styles: { + layout: `"column"`, + alignItems: `'flex-start'`, + flex: `1`, + gap: `'16px'`, + width: "0" }, - { n: ["man-girl", "family: man, girl"], u: "1f468-200d-1f467" }, - { - n: ["man-girl-boy", "family: man, girl, boy"], - u: "1f468-200d-1f467-200d-1f466" + type: "column" + } +}; +var groupableTypes = ["content", "group", "container", "column", "list"]; +var flowNode = { + def: { + icon: "lucide//file-text" + }, + node: { + icon: "lucide//file-text", + schemaId: "flow", + parentId: "", + name: "Existing Note", + rank: 0, + id: "flow", + type: "flow", + props: { + value: "" }, - { - n: ["man-girl-girl", "family: man, girl, girl"], - u: "1f468-200d-1f467-200d-1f467" + styles: { + width: `'100%'` }, - { n: ["woman-boy", "family: woman, boy"], u: "1f469-200d-1f466" }, - { - n: ["woman-boy-boy", "family: woman, boy, boy"], - u: "1f469-200d-1f466-200d-1f466" + types: { + value: "link" + } + } +}; +var iconNode = { + def: { + icon: "lucide//gem" + }, + node: { + icon: "lucide//gem", + schemaId: "icon", + parentId: "", + name: "Icon", + rank: 0, + id: "icon", + styles: {}, + type: "icon", + props: { + value: "" }, - { n: ["woman-girl", "family: woman, girl"], u: "1f469-200d-1f467" }, - { - n: ["woman-girl-boy", "family: woman, girl, boy"], - u: "1f469-200d-1f467-200d-1f466" + types: { + value: "icon" + } + } +}; +var spaceNode = { + def: { + icon: "lucide//layout-grid" + }, + node: { + icon: "lucide//layout-grid", + schemaId: "space", + parentId: "", + name: "Space", + rank: 0, + id: "space", + styles: { width: `'100%'` }, + type: "space", + props: { + value: "" }, - { - n: ["woman-girl-girl", "family: woman, girl, girl"], - u: "1f469-200d-1f467-200d-1f467" + types: { + value: "view" + } + } +}; +var imageNode = { + def: { + icon: "lucide//image" + }, + node: { + icon: "lucide//image", + schemaId: "image", + parentId: "", + name: "Image", + rank: 0, + id: "image", + type: "image", + props: { + value: "" }, - { n: ["speaking head", "speaking head in silhouette"], u: "1f5e3-fe0f" }, - { n: ["bust in silhouette"], u: "1f464" }, - { n: ["busts in silhouette"], u: "1f465" }, - { n: ["people hugging"], u: "1fac2" }, - { n: ["footprints"], u: "1f463" } - ], - animals_nature: [ - { n: ["monkey face"], u: "1f435" }, - { n: ["monkey"], u: "1f412" }, - { n: ["gorilla"], u: "1f98d" }, - { n: ["orangutan"], u: "1f9a7" }, - { n: ["dog", "dog face"], u: "1f436" }, - { n: ["dog", "dog2"], u: "1f415" }, - { n: ["guide dog"], u: "1f9ae" }, - { n: ["service dog"], u: "1f415-200d-1f9ba" }, - { n: ["poodle"], u: "1f429" }, - { n: ["wolf", "wolf face"], u: "1f43a" }, - { n: ["fox face"], u: "1f98a" }, - { n: ["raccoon"], u: "1f99d" }, - { n: ["cat", "cat face"], u: "1f431" }, - { n: ["cat", "cat2"], u: "1f408" }, - { n: ["black cat"], u: "1f408-200d-2b1b" }, - { n: ["lion face"], u: "1f981" }, - { n: ["tiger", "tiger face"], u: "1f42f" }, - { n: ["tiger", "tiger2"], u: "1f405" }, - { n: ["leopard"], u: "1f406" }, - { n: ["horse", "horse face"], u: "1f434" }, - { n: ["horse", "racehorse"], u: "1f40e" }, - { n: ["unicorn face"], u: "1f984" }, - { n: ["zebra face"], u: "1f993" }, - { n: ["deer"], u: "1f98c" }, - { n: ["bison"], u: "1f9ac" }, - { n: ["cow", "cow face"], u: "1f42e" }, - { n: ["ox"], u: "1f402" }, - { n: ["water buffalo"], u: "1f403" }, - { n: ["cow", "cow2"], u: "1f404" }, - { n: ["pig", "pig face"], u: "1f437" }, - { n: ["pig", "pig2"], u: "1f416" }, - { n: ["boar"], u: "1f417" }, - { n: ["pig nose"], u: "1f43d" }, - { n: ["ram"], u: "1f40f" }, - { n: ["sheep"], u: "1f411" }, - { n: ["goat"], u: "1f410" }, - { n: ["dromedary camel"], u: "1f42a" }, - { n: ["camel", "bactrian camel"], u: "1f42b" }, - { n: ["llama"], u: "1f999" }, - { n: ["giraffe face"], u: "1f992" }, - { n: ["elephant"], u: "1f418" }, - { n: ["mammoth"], u: "1f9a3" }, - { n: ["rhinoceros"], u: "1f98f" }, - { n: ["hippopotamus"], u: "1f99b" }, - { n: ["mouse", "mouse face"], u: "1f42d" }, - { n: ["mouse", "mouse2"], u: "1f401" }, - { n: ["rat"], u: "1f400" }, - { n: ["hamster", "hamster face"], u: "1f439" }, - { n: ["rabbit", "rabbit face"], u: "1f430" }, - { n: ["rabbit", "rabbit2"], u: "1f407" }, - { n: ["chipmunk"], u: "1f43f-fe0f" }, - { n: ["beaver"], u: "1f9ab" }, - { n: ["hedgehog"], u: "1f994" }, - { n: ["bat"], u: "1f987" }, - { n: ["bear", "bear face"], u: "1f43b" }, - { n: ["polar bear"], u: "1f43b-200d-2744-fe0f" }, - { n: ["koala"], u: "1f428" }, - { n: ["panda face"], u: "1f43c" }, - { n: ["sloth"], u: "1f9a5" }, - { n: ["otter"], u: "1f9a6" }, - { n: ["skunk"], u: "1f9a8" }, - { n: ["kangaroo"], u: "1f998" }, - { n: ["badger"], u: "1f9a1" }, - { n: ["feet", "paw prints"], u: "1f43e" }, - { n: ["turkey"], u: "1f983" }, - { n: ["chicken"], u: "1f414" }, - { n: ["rooster"], u: "1f413" }, - { n: ["hatching chick"], u: "1f423" }, - { n: ["baby chick"], u: "1f424" }, - { n: ["hatched chick", "front-facing baby chick"], u: "1f425" }, - { n: ["bird"], u: "1f426" }, - { n: ["penguin"], u: "1f427" }, - { n: ["dove", "dove of peace"], u: "1f54a-fe0f" }, - { n: ["eagle"], u: "1f985" }, - { n: ["duck"], u: "1f986" }, - { n: ["swan"], u: "1f9a2" }, - { n: ["owl"], u: "1f989" }, - { n: ["dodo"], u: "1f9a4" }, - { n: ["feather"], u: "1fab6" }, - { n: ["flamingo"], u: "1f9a9" }, - { n: ["peacock"], u: "1f99a" }, - { n: ["parrot"], u: "1f99c" }, - { n: ["frog", "frog face"], u: "1f438" }, - { n: ["crocodile"], u: "1f40a" }, - { n: ["turtle"], u: "1f422" }, - { n: ["lizard"], u: "1f98e" }, - { n: ["snake"], u: "1f40d" }, - { n: ["dragon face"], u: "1f432" }, - { n: ["dragon"], u: "1f409" }, - { n: ["sauropod"], u: "1f995" }, - { n: ["t-rex"], u: "1f996" }, - { n: ["whale", "spouting whale"], u: "1f433" }, - { n: ["whale", "whale2"], u: "1f40b" }, - { n: ["dolphin", "flipper"], u: "1f42c" }, - { n: ["seal"], u: "1f9ad" }, - { n: ["fish"], u: "1f41f" }, - { n: ["tropical fish"], u: "1f420" }, - { n: ["blowfish"], u: "1f421" }, - { n: ["shark"], u: "1f988" }, - { n: ["octopus"], u: "1f419" }, - { n: ["shell", "spiral shell"], u: "1f41a" }, - { n: ["coral"], u: "1fab8" }, - { n: ["snail"], u: "1f40c" }, - { n: ["butterfly"], u: "1f98b" }, - { n: ["bug"], u: "1f41b" }, - { n: ["ant"], u: "1f41c" }, - { n: ["bee", "honeybee"], u: "1f41d" }, - { n: ["beetle"], u: "1fab2" }, - { n: ["ladybug", "lady beetle"], u: "1f41e" }, - { n: ["cricket"], u: "1f997" }, - { n: ["cockroach"], u: "1fab3" }, - { n: ["spider"], u: "1f577-fe0f" }, - { n: ["spider web"], u: "1f578-fe0f" }, - { n: ["scorpion"], u: "1f982" }, - { n: ["mosquito"], u: "1f99f" }, - { n: ["fly"], u: "1fab0" }, - { n: ["worm"], u: "1fab1" }, - { n: ["microbe"], u: "1f9a0" }, - { n: ["bouquet"], u: "1f490" }, - { n: ["cherry blossom"], u: "1f338" }, - { n: ["white flower"], u: "1f4ae" }, - { n: ["lotus"], u: "1fab7" }, - { n: ["rosette"], u: "1f3f5-fe0f" }, - { n: ["rose"], u: "1f339" }, - { n: ["wilted flower"], u: "1f940" }, - { n: ["hibiscus"], u: "1f33a" }, - { n: ["sunflower"], u: "1f33b" }, - { n: ["blossom"], u: "1f33c" }, - { n: ["tulip"], u: "1f337" }, - { n: ["seedling"], u: "1f331" }, - { n: ["potted plant"], u: "1fab4" }, - { n: ["evergreen tree"], u: "1f332" }, - { n: ["deciduous tree"], u: "1f333" }, - { n: ["palm tree"], u: "1f334" }, - { n: ["cactus"], u: "1f335" }, - { n: ["ear of rice"], u: "1f33e" }, - { n: ["herb"], u: "1f33f" }, - { n: ["shamrock"], u: "2618-fe0f" }, - { n: ["four leaf clover"], u: "1f340" }, - { n: ["maple leaf"], u: "1f341" }, - { n: ["fallen leaf"], u: "1f342" }, - { n: ["leaves", "leaf fluttering in wind"], u: "1f343" }, - { n: ["empty nest"], u: "1fab9" }, - { n: ["nest with eggs"], u: "1faba" } - ], - food_drink: [ - { n: ["grapes"], u: "1f347" }, - { n: ["melon"], u: "1f348" }, - { n: ["watermelon"], u: "1f349" }, - { n: ["tangerine"], u: "1f34a" }, - { n: ["lemon"], u: "1f34b" }, - { n: ["banana"], u: "1f34c" }, - { n: ["pineapple"], u: "1f34d" }, - { n: ["mango"], u: "1f96d" }, - { n: ["apple", "red apple"], u: "1f34e" }, - { n: ["green apple"], u: "1f34f" }, - { n: ["pear"], u: "1f350" }, - { n: ["peach"], u: "1f351" }, - { n: ["cherries"], u: "1f352" }, - { n: ["strawberry"], u: "1f353" }, - { n: ["blueberries"], u: "1fad0" }, - { n: ["kiwifruit"], u: "1f95d" }, - { n: ["tomato"], u: "1f345" }, - { n: ["olive"], u: "1fad2" }, - { n: ["coconut"], u: "1f965" }, - { n: ["avocado"], u: "1f951" }, - { n: ["eggplant", "aubergine"], u: "1f346" }, - { n: ["potato"], u: "1f954" }, - { n: ["carrot"], u: "1f955" }, - { n: ["corn", "ear of maize"], u: "1f33d" }, - { n: ["hot pepper"], u: "1f336-fe0f" }, - { n: ["bell pepper"], u: "1fad1" }, - { n: ["cucumber"], u: "1f952" }, - { n: ["leafy green"], u: "1f96c" }, - { n: ["broccoli"], u: "1f966" }, - { n: ["garlic"], u: "1f9c4" }, - { n: ["onion"], u: "1f9c5" }, - { n: ["mushroom"], u: "1f344" }, - { n: ["peanuts"], u: "1f95c" }, - { n: ["beans"], u: "1fad8" }, - { n: ["chestnut"], u: "1f330" }, - { n: ["bread"], u: "1f35e" }, - { n: ["croissant"], u: "1f950" }, - { n: ["baguette bread"], u: "1f956" }, - { n: ["flatbread"], u: "1fad3" }, - { n: ["pretzel"], u: "1f968" }, - { n: ["bagel"], u: "1f96f" }, - { n: ["pancakes"], u: "1f95e" }, - { n: ["waffle"], u: "1f9c7" }, - { n: ["cheese wedge"], u: "1f9c0" }, - { n: ["meat on bone"], u: "1f356" }, - { n: ["poultry leg"], u: "1f357" }, - { n: ["cut of meat"], u: "1f969" }, - { n: ["bacon"], u: "1f953" }, - { n: ["hamburger"], u: "1f354" }, - { n: ["fries", "french fries"], u: "1f35f" }, - { n: ["pizza", "slice of pizza"], u: "1f355" }, - { n: ["hotdog", "hot dog"], u: "1f32d" }, - { n: ["sandwich"], u: "1f96a" }, - { n: ["taco"], u: "1f32e" }, - { n: ["burrito"], u: "1f32f" }, - { n: ["tamale"], u: "1fad4" }, - { n: ["stuffed flatbread"], u: "1f959" }, - { n: ["falafel"], u: "1f9c6" }, - { n: ["egg"], u: "1f95a" }, - { n: ["cooking", "fried egg"], u: "1f373" }, - { n: ["shallow pan of food"], u: "1f958" }, - { n: ["stew", "pot of food"], u: "1f372" }, - { n: ["fondue"], u: "1fad5" }, - { n: ["bowl with spoon"], u: "1f963" }, - { n: ["green salad"], u: "1f957" }, - { n: ["popcorn"], u: "1f37f" }, - { n: ["butter"], u: "1f9c8" }, - { n: ["salt", "salt shaker"], u: "1f9c2" }, - { n: ["canned food"], u: "1f96b" }, - { n: ["bento", "bento box"], u: "1f371" }, - { n: ["rice cracker"], u: "1f358" }, - { n: ["rice ball"], u: "1f359" }, - { n: ["rice", "cooked rice"], u: "1f35a" }, - { n: ["curry", "curry and rice"], u: "1f35b" }, - { n: ["ramen", "steaming bowl"], u: "1f35c" }, - { n: ["spaghetti"], u: "1f35d" }, - { n: ["sweet potato", "roasted sweet potato"], u: "1f360" }, - { n: ["oden"], u: "1f362" }, - { n: ["sushi"], u: "1f363" }, - { n: ["fried shrimp"], u: "1f364" }, - { n: ["fish cake", "fish cake with swirl design"], u: "1f365" }, - { n: ["moon cake"], u: "1f96e" }, - { n: ["dango"], u: "1f361" }, - { n: ["dumpling"], u: "1f95f" }, - { n: ["fortune cookie"], u: "1f960" }, - { n: ["takeout box"], u: "1f961" }, - { n: ["crab"], u: "1f980" }, - { n: ["lobster"], u: "1f99e" }, - { n: ["shrimp"], u: "1f990" }, - { n: ["squid"], u: "1f991" }, - { n: ["oyster"], u: "1f9aa" }, - { n: ["icecream", "soft ice cream"], u: "1f366" }, - { n: ["shaved ice"], u: "1f367" }, - { n: ["ice cream"], u: "1f368" }, - { n: ["doughnut"], u: "1f369" }, - { n: ["cookie"], u: "1f36a" }, - { n: ["birthday", "birthday cake"], u: "1f382" }, - { n: ["cake", "shortcake"], u: "1f370" }, - { n: ["cupcake"], u: "1f9c1" }, - { n: ["pie"], u: "1f967" }, - { n: ["chocolate bar"], u: "1f36b" }, - { n: ["candy"], u: "1f36c" }, - { n: ["lollipop"], u: "1f36d" }, - { n: ["custard"], u: "1f36e" }, - { n: ["honey pot"], u: "1f36f" }, - { n: ["baby bottle"], u: "1f37c" }, - { n: ["glass of milk"], u: "1f95b" }, - { n: ["coffee", "hot beverage"], u: "2615" }, - { n: ["teapot"], u: "1fad6" }, - { n: ["tea", "teacup without handle"], u: "1f375" }, - { n: ["sake", "sake bottle and cup"], u: "1f376" }, - { n: ["champagne", "bottle with popping cork"], u: "1f37e" }, - { n: ["wine glass"], u: "1f377" }, - { n: ["cocktail", "cocktail glass"], u: "1f378" }, - { n: ["tropical drink"], u: "1f379" }, - { n: ["beer", "beer mug"], u: "1f37a" }, - { n: ["beers", "clinking beer mugs"], u: "1f37b" }, - { n: ["clinking glasses"], u: "1f942" }, - { n: ["tumbler glass"], u: "1f943" }, - { n: ["pouring liquid"], u: "1fad7" }, - { n: ["cup with straw"], u: "1f964" }, - { n: ["bubble tea"], u: "1f9cb" }, - { n: ["beverage box"], u: "1f9c3" }, - { n: ["mate drink"], u: "1f9c9" }, - { n: ["ice cube"], u: "1f9ca" }, - { n: ["chopsticks"], u: "1f962" }, - { n: ["knife fork plate", "fork and knife with plate"], u: "1f37d-fe0f" }, - { n: ["fork and knife"], u: "1f374" }, - { n: ["spoon"], u: "1f944" }, - { n: ["hocho", "knife"], u: "1f52a" }, - { n: ["jar"], u: "1fad9" }, - { n: ["amphora"], u: "1f3fa" } - ], - travel_places: [ - { n: ["earth africa", "earth globe europe-africa"], u: "1f30d" }, - { n: ["earth americas", "earth globe americas"], u: "1f30e" }, - { n: ["earth asia", "earth globe asia-australia"], u: "1f30f" }, - { n: ["globe with meridians"], u: "1f310" }, - { n: ["world map"], u: "1f5fa-fe0f" }, - { n: ["japan", "silhouette of japan"], u: "1f5fe" }, - { n: ["compass"], u: "1f9ed" }, - { n: ["snow-capped mountain", "snow capped mountain"], u: "1f3d4-fe0f" }, - { n: ["mountain"], u: "26f0-fe0f" }, - { n: ["volcano"], u: "1f30b" }, - { n: ["mount fuji"], u: "1f5fb" }, - { n: ["camping"], u: "1f3d5-fe0f" }, - { n: ["beach with umbrella"], u: "1f3d6-fe0f" }, - { n: ["desert"], u: "1f3dc-fe0f" }, - { n: ["desert island"], u: "1f3dd-fe0f" }, - { n: ["national park"], u: "1f3de-fe0f" }, - { n: ["stadium"], u: "1f3df-fe0f" }, - { n: ["classical building"], u: "1f3db-fe0f" }, - { n: ["building construction"], u: "1f3d7-fe0f" }, - { n: ["brick", "bricks"], u: "1f9f1" }, - { n: ["rock"], u: "1faa8" }, - { n: ["wood"], u: "1fab5" }, - { n: ["hut"], u: "1f6d6" }, - { n: ["houses", "house buildings"], u: "1f3d8-fe0f" }, - { n: ["derelict house", "derelict house building"], u: "1f3da-fe0f" }, - { n: ["house", "house building"], u: "1f3e0" }, - { n: ["house with garden"], u: "1f3e1" }, - { n: ["office", "office building"], u: "1f3e2" }, - { n: ["post office", "japanese post office"], u: "1f3e3" }, - { n: ["european post office"], u: "1f3e4" }, - { n: ["hospital"], u: "1f3e5" }, - { n: ["bank"], u: "1f3e6" }, - { n: ["hotel"], u: "1f3e8" }, - { n: ["love hotel"], u: "1f3e9" }, - { n: ["convenience store"], u: "1f3ea" }, - { n: ["school"], u: "1f3eb" }, - { n: ["department store"], u: "1f3ec" }, - { n: ["factory"], u: "1f3ed" }, - { n: ["japanese castle"], u: "1f3ef" }, - { n: ["european castle"], u: "1f3f0" }, - { n: ["wedding"], u: "1f492" }, - { n: ["tokyo tower"], u: "1f5fc" }, - { n: ["statue of liberty"], u: "1f5fd" }, - { n: ["church"], u: "26ea" }, - { n: ["mosque"], u: "1f54c" }, - { n: ["hindu temple"], u: "1f6d5" }, - { n: ["synagogue"], u: "1f54d" }, - { n: ["shinto shrine"], u: "26e9-fe0f" }, - { n: ["kaaba"], u: "1f54b" }, - { n: ["fountain"], u: "26f2" }, - { n: ["tent"], u: "26fa" }, - { n: ["foggy"], u: "1f301" }, - { n: ["night with stars"], u: "1f303" }, - { n: ["cityscape"], u: "1f3d9-fe0f" }, - { n: ["sunrise over mountains"], u: "1f304" }, - { n: ["sunrise"], u: "1f305" }, - { n: ["city sunset", "cityscape at dusk"], u: "1f306" }, - { n: ["city sunrise", "sunset over buildings"], u: "1f307" }, - { n: ["bridge at night"], u: "1f309" }, - { n: ["hotsprings", "hot springs"], u: "2668-fe0f" }, - { n: ["carousel horse"], u: "1f3a0" }, - { n: ["playground slide"], u: "1f6dd" }, - { n: ["ferris wheel"], u: "1f3a1" }, - { n: ["roller coaster"], u: "1f3a2" }, - { n: ["barber", "barber pole"], u: "1f488" }, - { n: ["circus tent"], u: "1f3aa" }, - { n: ["steam locomotive"], u: "1f682" }, - { n: ["railway car"], u: "1f683" }, - { n: ["high-speed train", "bullettrain side"], u: "1f684" }, - { - n: ["bullettrain front", "high-speed train with bullet nose"], - u: "1f685" + types: { + value: "image" + } + } +}; +var textNode = { + def: { + icon: "lucide//type", + description: "Insert a text labels to decorate your Space" + }, + node: { + icon: "lucide//type", + schemaId: "text", + parentId: "", + name: "Label", + rank: 0, + id: "text", + type: "text", + props: { + value: "" }, - { n: ["train", "train2"], u: "1f686" }, - { n: ["metro"], u: "1f687" }, - { n: ["light rail"], u: "1f688" }, - { n: ["station"], u: "1f689" }, - { n: ["tram"], u: "1f68a" }, - { n: ["monorail"], u: "1f69d" }, - { n: ["mountain railway"], u: "1f69e" }, - { n: ["train", "tram car"], u: "1f68b" }, - { n: ["bus"], u: "1f68c" }, - { n: ["oncoming bus"], u: "1f68d" }, - { n: ["trolleybus"], u: "1f68e" }, - { n: ["minibus"], u: "1f690" }, - { n: ["ambulance"], u: "1f691" }, - { n: ["fire engine"], u: "1f692" }, - { n: ["police car"], u: "1f693" }, - { n: ["oncoming police car"], u: "1f694" }, - { n: ["taxi"], u: "1f695" }, - { n: ["oncoming taxi"], u: "1f696" }, - { n: ["car", "red car", "automobile"], u: "1f697" }, - { n: ["oncoming automobile"], u: "1f698" }, - { n: ["blue car", "recreational vehicle"], u: "1f699" }, - { n: ["pickup truck"], u: "1f6fb" }, - { n: ["truck", "delivery truck"], u: "1f69a" }, - { n: ["articulated lorry"], u: "1f69b" }, - { n: ["tractor"], u: "1f69c" }, - { n: ["racing car"], u: "1f3ce-fe0f" }, - { n: ["motorcycle", "racing motorcycle"], u: "1f3cd-fe0f" }, - { n: ["motor scooter"], u: "1f6f5" }, - { n: ["manual wheelchair"], u: "1f9bd" }, - { n: ["motorized wheelchair"], u: "1f9bc" }, - { n: ["auto rickshaw"], u: "1f6fa" }, - { n: ["bike", "bicycle"], u: "1f6b2" }, - { n: ["scooter"], u: "1f6f4" }, - { n: ["skateboard"], u: "1f6f9" }, - { n: ["roller skate"], u: "1f6fc" }, - { n: ["busstop", "bus stop"], u: "1f68f" }, - { n: ["motorway"], u: "1f6e3-fe0f" }, - { n: ["railway track"], u: "1f6e4-fe0f" }, - { n: ["oil drum"], u: "1f6e2-fe0f" }, - { n: ["fuelpump", "fuel pump"], u: "26fd" }, - { n: ["wheel"], u: "1f6de" }, - { n: ["rotating light", "police cars revolving light"], u: "1f6a8" }, - { n: ["traffic light", "horizontal traffic light"], u: "1f6a5" }, - { n: ["vertical traffic light"], u: "1f6a6" }, - { n: ["octagonal sign"], u: "1f6d1" }, - { n: ["construction", "construction sign"], u: "1f6a7" }, - { n: ["anchor"], u: "2693" }, - { n: ["ring buoy"], u: "1f6df" }, - { n: ["boat", "sailboat"], u: "26f5" }, - { n: ["canoe"], u: "1f6f6" }, - { n: ["speedboat"], u: "1f6a4" }, - { n: ["passenger ship"], u: "1f6f3-fe0f" }, - { n: ["ferry"], u: "26f4-fe0f" }, - { n: ["motor boat"], u: "1f6e5-fe0f" }, - { n: ["ship"], u: "1f6a2" }, - { n: ["airplane"], u: "2708-fe0f" }, - { n: ["small airplane"], u: "1f6e9-fe0f" }, - { n: ["airplane departure"], u: "1f6eb" }, - { n: ["airplane arriving"], u: "1f6ec" }, - { n: ["parachute"], u: "1fa82" }, - { n: ["seat"], u: "1f4ba" }, - { n: ["helicopter"], u: "1f681" }, - { n: ["suspension railway"], u: "1f69f" }, - { n: ["mountain cableway"], u: "1f6a0" }, - { n: ["aerial tramway"], u: "1f6a1" }, - { n: ["satellite"], u: "1f6f0-fe0f" }, - { n: ["rocket"], u: "1f680" }, - { n: ["flying saucer"], u: "1f6f8" }, - { n: ["bellhop bell"], u: "1f6ce-fe0f" }, - { n: ["luggage"], u: "1f9f3" }, - { n: ["hourglass"], u: "231b" }, - { n: ["hourglass flowing sand", "hourglass with flowing sand"], u: "23f3" }, - { n: ["watch"], u: "231a" }, - { n: ["alarm clock"], u: "23f0" }, - { n: ["stopwatch"], u: "23f1-fe0f" }, - { n: ["timer clock"], u: "23f2-fe0f" }, - { n: ["mantelpiece clock"], u: "1f570-fe0f" }, - { n: ["clock12", "clock face twelve oclock"], u: "1f55b" }, - { n: ["clock1230", "clock face twelve-thirty"], u: "1f567" }, - { n: ["clock1", "clock face one oclock"], u: "1f550" }, - { n: ["clock130", "clock face one-thirty"], u: "1f55c" }, - { n: ["clock2", "clock face two oclock"], u: "1f551" }, - { n: ["clock230", "clock face two-thirty"], u: "1f55d" }, - { n: ["clock3", "clock face three oclock"], u: "1f552" }, - { n: ["clock330", "clock face three-thirty"], u: "1f55e" }, - { n: ["clock4", "clock face four oclock"], u: "1f553" }, - { n: ["clock430", "clock face four-thirty"], u: "1f55f" }, - { n: ["clock5", "clock face five oclock"], u: "1f554" }, - { n: ["clock530", "clock face five-thirty"], u: "1f560" }, - { n: ["clock6", "clock face six oclock"], u: "1f555" }, - { n: ["clock630", "clock face six-thirty"], u: "1f561" }, - { n: ["clock7", "clock face seven oclock"], u: "1f556" }, - { n: ["clock730", "clock face seven-thirty"], u: "1f562" }, - { n: ["clock8", "clock face eight oclock"], u: "1f557" }, - { n: ["clock830", "clock face eight-thirty"], u: "1f563" }, - { n: ["clock9", "clock face nine oclock"], u: "1f558" }, - { n: ["clock930", "clock face nine-thirty"], u: "1f564" }, - { n: ["clock10", "clock face ten oclock"], u: "1f559" }, - { n: ["clock1030", "clock face ten-thirty"], u: "1f565" }, - { n: ["clock11", "clock face eleven oclock"], u: "1f55a" }, - { n: ["clock1130", "clock face eleven-thirty"], u: "1f566" }, - { n: ["new moon", "new moon symbol"], u: "1f311" }, - { n: ["waxing crescent moon", "waxing crescent moon symbol"], u: "1f312" }, - { n: ["first quarter moon", "first quarter moon symbol"], u: "1f313" }, + types: { + value: "text" + } + } +}; +var dividerNode = { + def: { + icon: "lucide//type" + }, + node: { + icon: "lucide//type", + schemaId: "hr", + parentId: "", + name: "Divider", + rank: 0, + id: "hr", + type: "hr", + styles: { + as: `'hr'` + } + } +}; +var buttonNode = { + id: "button", + def: { + icon: "lucide//mouse-pointer-click" + }, + node: { + icon: "lucide//mouse-pointer-click", + schemaId: "button", + parentId: "", + name: "Button", + rank: 0, + id: "button", + type: "group", + props: { + icon: "", + label: "", + action: "", + actionValue: "" + }, + types: { + icon: "icon", + label: "text", + action: "option", + actionValue: "super" + }, + propsAttrs: { + action: JSON.stringify({ + name: "When Clicked", + icon: "lucide//mouse-pointer-click" + }), + actionValue: JSON.stringify({ + name: "Perform Action" + }) + }, + propsValue: { + action: JSON.stringify({ + options: [{ name: "Run Command", value: "$commands" }, { name: "Open Link", value: "$links" }] + }), + actionValue: JSON.stringify({ + dynamic: true, + field: "action" + }) + }, + actions: { + onClick: `(a,b,c,api) => api.buttonCommand(button.props.action, button.props.actionValue)` + }, + styles: { + class: `'mk-button'`, + gap: `'4px'` + } + }, + children: [ + { ...iconNode, node: { ...iconNode.node, props: { + value: `button.props.icon` + } } }, + { ...textNode, node: { ...textNode.node, props: { value: `button.props.label` } } } + ] +}; +var progressNode = { + id: "progress", + def: { + icon: "lucide//pie-chart" + }, + node: { + icon: "lucide//pie-chart", + schemaId: "progress", + parentId: "", + name: "Progress", + rank: 0, + id: "progress", + type: "group", + props: { + value: "50", + total: "100" + }, + types: { + total: "number", + value: "number" + }, + styles: { + background: `'var(--background-modifier-form-field)'`, + height: `'10px'`, + width: `'100px'`, + borderRadius: `'5px'` + } + }, + children: [ + { ...groupNode, node: { ...groupNode.node, styles: { + width: `progress.props.value/progress.props.total*100+'%'`, + height: `'100%'`, + borderRadius: `'5px'`, + background: `'var(--color-orange)'`, + display: `'block'` + } } } + ] +}; +var cardNode = { + id: "card", + def: { + icon: "lucide//mouse-pointer-click" + }, + node: { + icon: "lucide//mouse-pointer-click", + schemaId: "card", + parentId: "", + name: "Card", + rank: 0, + id: "card", + type: "group", + props: { + icon: "", + label: "" + }, + types: { + icon: "icon", + label: "text" + }, + actions: {}, + styles: { + borderRadius: `'10px'`, + background: `'var(--background-primary-alt)'`, + width: `'160px'`, + height: `'80px'`, + padding: `'16px'`, + border: `'thin solid var(--divider-color)'` + } + }, + children: [ + { ...iconNode, node: { ...iconNode.node, props: { + value: `card.props.icon` + } } }, + { ...textNode, node: { ...textNode.node, props: { value: `card.props.label` } } } + ] +}; +var linkNode = { + id: "link", + def: { + icon: "lucide//link" + }, + node: { + icon: "lucide//link", + schemaId: "link", + parentId: "", + name: "Link", + rank: 0, + id: "link", + type: "group", + props: { + label: `"Link"`, + link: "" + }, + styles: { + class: `'mk-a'` + }, + actions: { + onClick: "(e,v,k,api) => { api.openLink(link.props.link, false) }" + }, + types: { + label: "text", + link: "link" + } + }, + children: [ + { ...textNode, node: { ...textNode.node, props: { value: `link.props.label` } } } + ] +}; +var rootToFrame = (root) => { + var _a2; + return { + schema: { id: root.id, name: root.node.name, type: "frame" }, + cols: Object.keys((_a2 = root.node.types) != null ? _a2 : {}).map((f4) => { + var _a3, _b2; + return { + name: f4, + schemaId: root.id, + type: root.node.types[f4], + value: (_a3 = root.node.propsValue) == null ? void 0 : _a3[f4], + attrs: (_b2 = root.node.propsAttrs) == null ? void 0 : _b2[f4] + }; + }), + rows: flattenToFrameNodes(root).map((f4) => nodeToFrame(f4)) + }; +}; +var kit = [rootToFrame(buttonNode), rootToFrame(dividerNode), rootToFrame(progressNode), rootToFrame(cardNode), rootToFrame(linkNode)]; + +// src/types/context.ts +var FilePropertyName = "File"; + +// src/utils/contexts/parsers.ts +var parsePropString = (str) => { + var _a2; + const [p1, p22] = (_a2 = str == null ? void 0 : str.match(/(\\.|[^.])+/g)) != null ? _a2 : []; + if (p22) + return { + field: p1, + property: p22 + }; + return { field: "File", property: p1 }; +}; + +// src/schemas/mdb.ts +var parseFieldValue = (value, type) => { + let valueProp = safelyParseJSON(value); + if (!type) + return {}; + if (!valueProp) { + if (type == "context") { + if ((value == null ? void 0 : value.length) > 0) { + valueProp = { + space: value + }; + } else { + valueProp = {}; + } + } else if (type.startsWith("date")) { + if ((value == null ? void 0 : value.length) > 0) { + valueProp = { + format: value + }; + } else { + valueProp = {}; + } + } else if (type.startsWith("fileprop")) { + if ((value == null ? void 0 : value.length) > 0) { + const [field, val] = value.split("."); + valueProp = { + field, + value: val + }; + } else { + valueProp = {}; + } + } else if (type.startsWith("option")) { + if ((value == null ? void 0 : value.length) > 0) { + const options = parseMultiString(value).map((f4) => ({ name: f4, value: f4 })); + valueProp = { + options + }; + } else { + valueProp = {}; + } + } + } + return valueProp != null ? valueProp : {}; +}; +var stickerForField = (f4) => { + var _a2, _b2, _c2, _d2, _e2; + return ((_a2 = f4.attrs) == null ? void 0 : _a2.length) > 0 ? (_d2 = (_b2 = safelyParseJSON(f4.attrs)) == null ? void 0 : _b2.icon) != null ? _d2 : (_c2 = fieldTypeForType(f4.type)) == null ? void 0 : _c2.icon : (_e2 = fieldTypeForType(f4.type)) == null ? void 0 : _e2.icon; +}; +var fieldTypeForType = (type) => fieldTypes.find((t4) => type == t4.type) || fieldTypes.find((t4) => type == t4.multiType); +var fieldTypes = [ + { + type: "unknown", + label: "", + restricted: true, + icon: "lucide//file-question" + }, + { + type: "text", + label: i18n_default.properties.text.label, + metadata: true, + icon: "lucide//text" + }, + { + type: "number", + label: i18n_default.properties.number.label, + metadata: true, + icon: "lucide//binary" + }, + { + type: "boolean", + label: i18n_default.properties.boolean.label, + metadata: true, + icon: "lucide//check-square" + }, + { + type: "date", + label: i18n_default.properties.date.label, + metadata: true, + icon: "lucide//calendar" + }, + { + type: "option", + label: i18n_default.properties.option.label, + multi: true, + multiType: "option-multi", + icon: "lucide//list" + }, + { + type: "file", + label: i18n_default.properties.file.label, + restricted: true, + icon: "ui//mk-make-h3" + }, + { + type: "fileprop", + label: i18n_default.properties.fileProperty.label, + icon: "lucide//list" + }, + { + type: "link", + label: i18n_default.properties.link.label, + multi: true, + multiType: "link-multi", + metadata: true, + icon: "lucide//file-text" + }, + { + type: "context", + label: i18n_default.properties.context.label, + icon: "ui//mk-make-note", + multi: true, + multiType: "context-multi" + }, + { + type: "object", + label: i18n_default.properties.object.label, + multi: true, + multiType: "object-multi", + metadata: true, + icon: "lucide//list-tree" + }, + { + type: "icon", + label: i18n_default.properties.icon.label, + multi: true, + multiType: "icon-multi", + icon: "lucide//gem", + restricted: true + }, + { + type: "image", + label: i18n_default.properties.image.label, + multi: true, + multiType: "image-multi", + metadata: true, + icon: "ui//mk-make-image" + }, + { + type: "color", + label: i18n_default.properties.color.label, + icon: "ui//mk-make-image", + restricted: true + }, + { + type: "space", + label: i18n_default.properties.space.label, + icon: "lucide//layout-grid", + restricted: true + }, + { + type: "super", + label: "Super Property", + icon: "lucide//zap", + restricted: true + } +]; +var defaultFileDBSchema = { + id: "files", + name: "Files", + type: "db", + primary: "true" +}; +var defaultFileListSchema = { + id: "filesView", + name: "Files", + type: "view", + def: { db: "files" } +}; +var mainFrameID = "main"; +var defaultMainFrameSchema = (id2) => ({ id: id2, name: id2, type: "frame", def: "", predicate: "", primary: "true" }); +var defaultFramesSchema = { + uniques: [], + cols: ["id", "name", "type", "def", "predicate", "primary"], + rows: [defaultMainFrameSchema(mainFrameID), frameSchemaToMDBSchema(defaultFileListSchema)] +}; +var defaultFolderSchema = { + uniques: [], + cols: ["id", "name", "type", "def", "predicate", "primary"], + rows: [defaultFileDBSchema] +}; +var fieldSchema = { + uniques: ["name,schemaId"], + cols: [ + "name", + "schemaId", + "type", + "value", + "attrs", + "hidden", + "unique", + "primary" + ] +}; +var defaultFolderFields = { + ...fieldSchema, + rows: [ { - n: ["moon", "waxing gibbous moon", "waxing gibbous moon symbol"], - u: "1f314" + name: FilePropertyName, + schemaId: "files", + type: "file", + primary: "true", + hidden: "", + unique: "", + attrs: "", + value: "" + }, + { + name: i18n_default.properties.fileProperty.createdTime, + schemaId: "files", + type: "fileprop", + value: "File.ctime", + hidden: "", + unique: "", + attrs: "", + primary: "true" + } + ] +}; +var defaultFieldsForContext = (space) => { + if (space.uri.type == "tag") { + return defaultTagFields; + } else if (space.uri.type == "folder") { + return defaultFolderFields; + } + return defaultFolderFields; +}; +var defaultTableFields = [ + { + name: i18n_default.properties.defaultField, + schemaId: "", + type: "text" + } +]; +var defaultTagFields = { + ...fieldSchema, + rows: [ + { + name: FilePropertyName, + schemaId: "files", + type: "file", + primary: "true", + hidden: "", + unique: "", + attrs: "", + value: "" + } + ] +}; +var defaultMDBTableForContext = (space) => { + return defaultFolderMDBTable; +}; +var defaultFolderMDBTable = { + schema: defaultFileDBSchema, + cols: defaultFolderFields.rows, + rows: [] +}; +var defaultQueryMDBTable = { + schema: defaultFileDBSchema, + cols: defaultFolderFields.rows, + rows: [] +}; +var defaultTagMDBTable = { + schema: defaultFileDBSchema, + cols: defaultTagFields.rows, + rows: [] +}; +var fieldsToTable = (fields, schemas) => { + return fields.filter((s5) => schemas.find((g4) => g4.id == s5.schemaId && g4.type == "db")).reduce((p3, c4) => { + return { + ...p3, + ...p3[c4.schemaId] ? { + [c4.schemaId]: { + uniques: c4.unique == "true" ? [...p3[c4.schemaId].uniques, c4.name] : p3[c4.schemaId].uniques, + cols: [...p3[c4.schemaId].cols, c4.name], + rows: [] + } + } : { + [c4.schemaId]: { + uniques: c4.unique == "true" ? [c4.name] : [], + cols: [c4.name], + rows: [] + } + } + }; + }, {}); +}; +var defaultTablesForContext = (space) => { + if (space.uri.type == "tag") { + return defaultTagTables; + } else if (space.uri.type == "folder") { + return defaultFolderTables; + } + return defaultFolderTables; +}; +var defaultFolderTables = { + m_schema: defaultFolderSchema, + m_fields: defaultFolderFields, + ...fieldsToTable( + defaultFolderFields.rows, + defaultFolderSchema.rows + ) +}; +var defaultTagTables = { + m_schema: defaultFolderSchema, + m_fields: defaultTagFields, + ...fieldsToTable( + defaultTagFields.rows, + defaultFolderSchema.rows + ) +}; + +// src/react/components/SpaceView/Frames/DefaultFrames/DefaultFrames.ts +var defaultMainFrame = [ + { + ...groupNode.node, + id: "main", + type: "group", + rank: 0, + schemaId: "main", + props: { + note: "", + space: "" + }, + types: { + note: "link", + space: "space" + }, + propsValue: { + note: JSON.stringify({ + alias: "Space Note" + }), + space: JSON.stringify({ + alias: "Space Files" + }) + }, + styles: { + layout: `"column"`, + class: `'mk-f-main'` + } + }, + { + ...flowNode.node, + rank: 0, + props: { + value: `main.props.note` + }, + styles: { width: `'100%'` }, + parentId: "main", + schemaId: "main" + }, + { + ...spaceNode.node, + id: "context", + rank: 1, + props: { + value: `main.props.space` + }, + styles: { width: `'100%'` }, + parentId: "main", + schemaId: "main" + } +]; +var DefaultMDBTables = { + main: { + schema: defaultMainFrameSchema(mainFrameID), + cols: [{ name: "space", type: "space", schemaId: "main", value: JSON.stringify({ + alias: "Space Files" + }) }, { name: "note", type: "link", schemaId: "main", value: JSON.stringify({ + alias: "Space Note" + }) }], + rows: defaultMainFrame.map((f4) => nodeToFrame(f4)) + }, + filesView: { + schema: frameSchemaToMDBSchema(defaultFileListSchema), + cols: defaultFolderFields.rows, + rows: [] + } +}; + +// src/utils/sanitize.ts +var sanitizeTableName = (name) => { + return name == null ? void 0 : name.replace(/[^a-z0-9+]+/gi, ""); +}; +var sanitizeColumnName = (name) => { + if ((name == null ? void 0 : name.charAt(0)) == "_") { + return sanitizeColumnName(name.substring(1)); + } + return name == null ? void 0 : name.replace(/"/g, ``); +}; +var folderReservedRe = /^[+\$#^]+/; +var illegalRe = /[\/\?<>\\:\*\|":]/g; +var controlRe = /[\x00-\x1f\x80-\x9f]/g; +var reservedRe = /^\.+$/; +var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; +var sanitizeFolderName = (name) => { + const replacement = ""; + return name.replace(folderReservedRe, replacement).replace(illegalRe, replacement).replace(controlRe, replacement).replace(reservedRe, replacement).replace(windowsReservedRe, replacement); +}; +var sanitizeFileName = (name) => { + const replacement = ""; + return name.replace(illegalRe, replacement).replace(controlRe, replacement).replace(reservedRe, replacement).replace(windowsReservedRe, replacement); +}; +var sanitizeSQLStatement = (name) => { + return name == null ? void 0 : name.replace(/'/g, `''`); +}; + +// src/utils/db/db.ts +var import_obsidian4 = require("obsidian"); +var getDBFile = async (plugin, path, isRemote) => { + if (isRemote) { + return fetch(path).then((res) => res.arrayBuffer()); + } + if (!await plugin.app.vault.adapter.exists((0, import_obsidian4.normalizePath)(path))) { + return null; + } + const file = await plugin.app.vault.adapter.readBinary( + (0, import_obsidian4.normalizePath)(path) + ); + return file; +}; +var getDB = async (plugin, sqlJS, path, isRemote) => { + const buf = await getDBFile(plugin, path, isRemote); + if (buf) { + const db = await new sqlJS.Database(new Uint8Array(buf)); + try { + db.exec( + "SELECT name FROM sqlite_schema" + ); + } catch (e4) { + return new sqlJS.Database(); + } + return db; + } + return new sqlJS.Database(); +}; +var saveDBFile = async (plugin, path, binary) => { + if (!await plugin.app.vault.adapter.exists( + removeTrailingSlashFromFolder(getParentPathFromString(path)) + )) { + await plugin.files.createFolder(getParentPathFromString(path)); + } + const file = plugin.app.vault.adapter.writeBinary( + (0, import_obsidian4.normalizePath)(path), + binary + ); + return file; +}; +var mdbFrameToDBTables = (tables, uniques) => { + return Object.keys(tables).reduce((p3, c4) => { + return { + ...p3, + [c4]: { + uniques: defaultFrameSchema.uniques, + cols: defaultFrameSchema.cols, + rows: tables[c4].rows + } + }; + }, {}); +}; +var schemasAndFields = (tables) => { + return { + m_fields: { + uniques: fieldSchema.uniques, + cols: fieldSchema.cols, + rows: Object.values(tables).flatMap((f4) => f4.cols) + }, + m_schema: defaultFramesSchema + }; +}; +var dbResultsToDBTables = (res) => { + return res.reduce( + (p3, c4, i4) => [ + ...p3, + { + cols: c4.columns, + rows: c4 ? c4.values.map( + (r3) => c4.columns.reduce( + (prev, curr, index) => ({ ...prev, [curr]: r3[index] }), + {} + ) + ) : [] + } + ], + [] + ); +}; +var selectDB = (db, table, condition, fields) => { + const fieldsStr = fields != null ? fields : "*"; + const sqlstr = condition ? `SELECT ${fieldsStr} FROM "${table}" WHERE ${condition};` : `SELECT ${fieldsStr} FROM ${table};`; + let tables; + try { + tables = dbResultsToDBTables(db.exec(sqlstr)); + } catch (e4) { + return null; + } + if (tables.length == 1) + return tables[0]; + return null; +}; +var deleteFromDB = (db, table, condition) => { + const sqlstr = `DELETE FROM "${table}" WHERE ${condition};`; + try { + db.exec(sqlstr); + } catch (e4) { + console.log(e4); + } +}; +var dropTable = (db, table) => { + const sqlstr = `DROP TABLE IF EXISTS "${table}";`; + try { + db.exec(sqlstr); + } catch (e4) { + console.log(e4); + } +}; +var replaceDB = (db, tables) => { + const sqlstr = serializeSQLStatements(Object.keys(tables).map((t4) => { + const tableFields = tables[t4].cols; + const fieldQuery = serializeSQLFieldNames(uniq(tableFields).filter((f4) => f4).map((f4) => `'${sanitizeSQLStatement(f4)}' char`)); + const rowsQuery = tables[t4].rows.reduce((prev, curr) => { + return `${prev} REPLACE INTO "${t4}" VALUES (${serializeSQLValues(tableFields.map((c4) => { + var _a2; + return `'${sanitizeSQLStatement((_a2 = curr == null ? void 0 : curr[c4]) != null ? _a2 : "")}'`; + }))});`; + }, ""); + const idxQuery = tables[t4].uniques.filter((f4) => f4).reduce((p3, c4) => { + return `${p3} CREATE UNIQUE INDEX IF NOT EXISTS "idx_${t4}_${c4.replace( + /,/g, + "_" + )}" ON "${t4}"(${c4});`; + }, ""); + const insertQuery = `CREATE TABLE IF NOT EXISTS "${t4}" (${fieldQuery}); ${idxQuery} BEGIN TRANSACTION; ${rowsQuery} COMMIT;`; + return `DROP INDEX IF EXISTS "idx_${t4}__id"; DROP TABLE IF EXISTS "${t4}"; ${fieldQuery.length > 0 ? insertQuery : ""}`; + })); + try { + db.exec(sqlstr); + } catch (e4) { + console.log(sqlstr); + console.log(e4); + } +}; +var saveSpaceDBToPath = async (plugin, space, type, tables) => { + let returnValue = false; + if (type == "context") { + returnValue = await saveDBToPath(plugin, space.dbPath, tables); + plugin.index.reloadContext(space); + } else if (type == "frames") { + returnValue = await saveDBToPath(plugin, space.framePath, tables); + plugin.index.reloadFrames(space); + } + return returnValue; +}; +var saveDBToPath = async (plugin, path, tables) => { + const sqlJS = await plugin.sqlJS(); + const db = await getDB(plugin, sqlJS, path); + if (!db) { + db.close(); + return false; + } + replaceDB(db, tables); + await saveDBFile(plugin, path, db.export().buffer); + db.close(); + return true; +}; + +// src/utils/contexts/mdb.ts +var dbTableToMDBTable = (table, schema, fields) => { + var _a2; + return { + schema, + cols: fields, + rows: (_a2 = table == null ? void 0 : table.rows) != null ? _a2 : [] + }; +}; +var updateFieldsToSchema = (fields, space) => { + const defaultFields = defaultFieldsForContext(space); + return [ + ...fields, + ...defaultFields.rows.filter( + (f4) => !fields.some((g4) => g4.name == f4.name && g4.schemaId == f4.schemaId) + ) + ]; +}; +var getContextMDB = async (plugin, space) => { + if (!space) + return null; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, space.dbPath, space.isRemote); + if (!buf) { + return null; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + await sanitizeTableSchema(plugin, db, space, "context"); + let fields; + let schemas; + try { + fields = dbResultsToDBTables( + db.exec(`SELECT * FROM m_fields`) + )[0].rows; + schemas = dbResultsToDBTables( + db.exec(`SELECT * FROM m_schema`) + )[0].rows; + } catch (e4) { + db.close(); + return null; + } + let dbTable; + try { + dbTable = schemas.filter((f4) => f4.type == "db").map((f4) => ({ [f4.id]: dbResultsToDBTables( + db.exec( + `SELECT * FROM "${f4.id}"` + ) + )[0] })).reduce((p3, c4) => ({ ...p3, ...c4 }), {}); + } catch (e4) { + db.close(); + return null; + } + db.close(); + return { + schemas, + fields, + tables: dbTable + }; +}; +var getFramesMDB = async (plugin, space) => { + var _a2, _b2, _c2, _d2; + if (!space) + return null; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, space.framePath, space.isRemote); + if (!buf) { + return null; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + let fields; + let schemas; + try { + fields = (_b2 = (_a2 = dbResultsToDBTables( + db.exec(`SELECT * FROM m_fields`) + )[0]) == null ? void 0 : _a2.rows) != null ? _b2 : []; + schemas = (_d2 = (_c2 = dbResultsToDBTables( + db.exec(`SELECT * FROM m_schema`) + )[0]) == null ? void 0 : _c2.rows) != null ? _d2 : []; + } catch (e4) { + console.log(e4); + db.close(); + return null; + } + const dbTable = schemas.filter((f4) => f4.type == "frame" || f4.type == "listitem").map((f4) => { + try { + const table = dbResultsToDBTables( + db.exec( + `SELECT * FROM "${f4.id}"` + ) + )[0]; + return { [f4.id]: table }; + } catch (e4) { + return {}; + } + }).reduce((p3, c4) => ({ ...p3, ...c4 }), {}); + db.close(); + return { + schemas, + fields, + tables: dbTable + }; +}; +var dbPathForSpaceInfo = (spaceInfo, type) => type == "context" ? spaceInfo.dbPath : type == "frames" ? spaceInfo.framePath : null; +var getMDBTable = async (plugin, space, table, dbType) => { + if (!space) + return null; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, space.dbPath, space.isRemote); + if (!buf) { + return null; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + await sanitizeTableSchema(plugin, db, space, dbType); + let fieldsTables; + let schema; + try { + fieldsTables = dbResultsToDBTables( + db.exec(`SELECT * FROM m_fields WHERE schemaId = '${table}'`) + ); + schema = dbResultsToDBTables( + db.exec(`SELECT * FROM m_schema WHERE id = '${table}'`) + )[0].rows[0]; + } catch (e4) { + db.close(); + return null; + } + if (fieldsTables.length == 0) { + db.close(); + return { + schema, + cols: [], + rows: [] + }; + } + const fields = fieldsTables[0].rows.filter( + (f4) => f4.name.length > 0 + ); + const dbTable = dbResultsToDBTables( + db.exec( + `SELECT ${serializeSQLFieldNames( + fields.reduce((p3, c4) => [...p3, `"${c4.name}"`], []) + )} FROM "${table}"` + ) + ); + db.close(); + return dbTableToMDBTable( + dbTable[0], + schema, + schema.primary ? updateFieldsToSchema(fields, space) : fields + ); +}; +var deleteMDBTable = async (plugin, space, table, dbPath) => { + if (space.readOnly) + return false; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, dbPath, space.isRemote); + if (!buf) { + return false; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + deleteFromDB(db, "m_schema", `id = '${sanitizeSQLStatement(table)}'`); + deleteFromDB(db, "m_schema", `def = '${sanitizeSQLStatement(table)}'`); + deleteFromDB(db, "m_fields", `schemaId = '${sanitizeSQLStatement(table)}'`); + dropTable(db, table); + await saveDBFile(plugin, dbPath, db.export().buffer); + db.close(); + return true; +}; +var getMDBTableSchemas = async (plugin, space, dbType) => { + var _a2, _b2; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, dbPathForSpaceInfo(space, dbType), space.isRemote); + if (!buf) { + return null; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + await sanitizeTableSchema(plugin, db, space, dbType); + const tables = db.exec(`SELECT * FROM m_schema`); + db.close(); + return ((_b2 = (_a2 = tables[0]) == null ? void 0 : _a2.values) != null ? _b2 : []).map((f4) => { + const [id2, name, type, def, predicate, primary] = f4; + return { id: id2, name, type, def, predicate, primary }; + }); +}; +var saveMDBToPath = async (plugin, context, mdb) => { + var _a2, _b2; + if (context.readOnly) + return; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, context.dbPath, context.isRemote); + if (!buf) { + return null; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + const fieldsTables = dbResultsToDBTables( + db.exec(`SELECT * FROM m_fields WHERE schemaId != '${mdb.schema.id}'`) + ); + const schemaTables = dbResultsToDBTables( + db.exec(`SELECT * FROM m_schema`) + ); + const newSchemas = schemaTables.length > 0 ? { ...schemaTables[0], uniques: [], rows: [...schemaTables[0].rows.filter((f4) => f4.id != mdb.schema.id), mdb.schema] } : { ...defaultFolderSchema, rows: [...defaultFolderSchema.rows, mdb.schema] }; + const tables = { + m_schema: newSchemas, + m_fields: { + uniques: fieldSchema.uniques, + cols: fieldSchema.cols, + rows: [...(_b2 = (_a2 = fieldsTables[0]) == null ? void 0 : _a2.rows) != null ? _b2 : [], ...mdb.cols] }, - { n: ["full moon", "full moon symbol"], u: "1f315" }, - { n: ["waning gibbous moon", "waning gibbous moon symbol"], u: "1f316" }, - { n: ["last quarter moon", "last quarter moon symbol"], u: "1f317" }, - { n: ["waning crescent moon", "waning crescent moon symbol"], u: "1f318" }, - { n: ["crescent moon"], u: "1f319" }, - { n: ["new moon with face"], u: "1f31a" }, - { n: ["first quarter moon with face"], u: "1f31b" }, - { n: ["last quarter moon with face"], u: "1f31c" }, - { n: ["thermometer"], u: "1f321-fe0f" }, - { n: ["sunny", "black sun with rays"], u: "2600-fe0f" }, - { n: ["full moon with face"], u: "1f31d" }, - { n: ["sun with face"], u: "1f31e" }, - { n: ["ringed planet"], u: "1fa90" }, - { n: ["star", "white medium star"], u: "2b50" }, - { n: ["star2", "glowing star"], u: "1f31f" }, - { n: ["stars", "shooting star"], u: "1f320" }, - { n: ["milky way"], u: "1f30c" }, - { n: ["cloud"], u: "2601-fe0f" }, - { n: ["partly sunny", "sun behind cloud"], u: "26c5" }, - { - n: ["thunder cloud and rain", "cloud with lightning and rain"], - u: "26c8-fe0f" + [mdb.schema.id]: { + uniques: [], + cols: mdb.cols.map((c4) => c4.name), + rows: mdb.rows + } + }; + db.close(); + return saveSpaceDBToPath(plugin, context, "context", tables); +}; +var optionValuesForColumn = (column, table) => { + var _a2; + return uniq( + (_a2 = table == null ? void 0 : table.rows.reduce((p3, c4) => { + return [...p3, ...parseMultiString(c4[column])]; + }, [])) != null ? _a2 : [] + ); +}; +var defaultTableDataForContext = (plugin, space) => { + const files = [...plugin.index.getSpaceItems(space.path, true)]; + return { + ...defaultMDBTableForContext(space), + rows: files.map((f4) => ({ File: f4.path })) + }; +}; +var createFramesMDB = async (plugin, space) => { + const dbField = { + m_schema: defaultFramesSchema, + m_fields: { + uniques: fieldSchema.uniques, + cols: fieldSchema.cols, + rows: [] + } + }; + const result = await saveSpaceDBToPath(plugin, space, "frames", dbField); + if (result) { + await plugin.index.reloadFrames(space); + return true; + } + return false; +}; +var createContextMDB = async (plugin, space) => { + var _a2; + const table = defaultTableDataForContext(plugin, space); + if (table) { + const defaultFields = defaultFieldsForContext(space); + const defaultTable = defaultTablesForContext(space); + const dbField = { + ...defaultTable, + m_fields: { + uniques: defaultFields.uniques, + cols: defaultFields.cols, + rows: [...(_a2 = defaultFields.rows) != null ? _a2 : [], ...table.cols] + }, + [table.schema.id]: { + uniques: table.cols.filter((c4) => c4.unique == "true").map((c4) => c4.name), + cols: table.cols.map((c4) => c4.name), + rows: table.rows + } + }; + const result = await saveSpaceDBToPath(plugin, space, "context", dbField); + if (result) { + await plugin.index.reloadContext(space); + table.rows.map((f4) => getAbstractFileAtPath(plugin, f4.File)).forEach((f4) => f4 && plugin.index.reloadFile(f4, true)); + return true; + } + return false; + } + return false; +}; +var sanitizeTableSchema = async (plugin, db, space, dbType) => { + const tableRes = db.exec( + `SELECT name FROM sqlite_master WHERE type='table';` + ); + if (dbType == "context") { + if (!tableRes[0] || !tableRes[0].values.some((f4) => f4[0] == "m_schema") || !tableRes[0].values.some((f4) => f4[0] == "m_fields") || !tableRes[0].values.some((f4) => f4[0] == "files")) { + await createContextMDB(plugin, space); + } + } else { + if (!tableRes[0] || !tableRes[0].values.some((f4) => f4[0] == "m_schema") || !tableRes[0].values.some((f4) => f4[0] == "m_fields")) { + await createFramesMDB(plugin, space); + } + } +}; +var createNewRow = (mdb, row, index) => { + if (index) { + return { + ...mdb, + rows: insert(mdb.rows, index, row) + }; + } + return { + ...mdb, + rows: [...mdb.rows, row] + }; +}; +var spaceFolderDelete = (space) => { + app.workspace.iterateLeaves((leaf) => { + if (leaf.view.getViewType() == SPACE_VIEW_TYPE && leaf.view.getState().path == space) { + leaf.setViewState({ type: "empty" }); + } + }, app.workspace["rootSplit"]); +}; +var renameTagSpaceFolder = async (plugin, space, newSpace) => { + const spacePath = folderForTagSpace(space, plugin); + if (getAbstractFileAtPath(plugin, spacePath)) { + if (!getAbstractFileAtPath( + plugin, + folderForTagSpace(newSpace, plugin) + )) { + await renameFile( + plugin, + getAbstractFileAtPath(plugin, spacePath), + newSpace + ); + } else { + await deleteFile(plugin, getAbstractFileAtPath(plugin, spacePath)); + } + } +}; + +// src/utils/frames/mdb.ts +var getMFrameTables = async (plugin, space) => { + if (!frames) + return null; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, space.framePath, space.isRemote); + if (!buf) { + return null; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + const schemas = dbResultsToDBTables( + db.exec(`SELECT * FROM m_schema`) + )[0].rows; + const mdbTables = {}; + schemas.forEach((schema) => { + var _a2, _b2; + let fieldsTables; + try { + fieldsTables = dbResultsToDBTables( + db.exec(`SELECT * FROM m_fields WHERE schemaId = '${schema.id}'`) + ); + } catch (e4) { + return; + } + const fields = ((_b2 = (_a2 = fieldsTables == null ? void 0 : fieldsTables[0]) == null ? void 0 : _a2.rows) != null ? _b2 : []).filter( + (f4) => f4.name.length > 0 + ); + let dbTable; + try { + dbTable = dbResultsToDBTables(db.exec(`SELECT * FROM "${schema.id}"`)); + mdbTables[schema.id] = dbTableToMDBTable( + dbTable[0], + schema, + fields + ); + } catch (e4) { + mdbTables[schema.id] = { + schema, + cols: fields, + rows: [] + }; + return; + } + }); + db.close(); + return mdbTables; +}; +var saveMFramesToPath = async (plugin, space, mdb) => { + var _a2, _b2, _c2; + if (space.readOnly) + return; + const sqlJS = await plugin.sqlJS(); + const buf = await getDBFile(plugin, space.framePath, space.isRemote); + if (!buf) { + return null; + } + const db = new sqlJS.Database(new Uint8Array(buf)); + const fieldsTables = dbResultsToDBTables( + db.exec(`SELECT * FROM m_fields WHERE schemaId != '${mdb.schema.id}'`) + ); + const schemaTables = dbResultsToDBTables( + db.exec(`SELECT * FROM m_schema`) + ); + const newSchemas = ((_a2 = schemaTables[0]) == null ? void 0 : _a2.rows) ? { ...schemaTables[0], uniques: [], rows: [...schemaTables[0].rows.filter((f4) => f4.id != mdb.schema.id), mdb.schema] } : { ...defaultFramesSchema, rows: [...defaultFramesSchema.rows, mdb.schema] }; + const tables = { + m_schema: newSchemas, + m_fields: { + uniques: fieldSchema.uniques, + cols: fieldSchema.cols, + rows: [...(_c2 = (_b2 = fieldsTables[0]) == null ? void 0 : _b2.rows) != null ? _c2 : [], ...mdb.cols] }, - { - n: ["mostly sunny", "sun small cloud", "sun behind small cloud"], - u: "1f324-fe0f" + [mdb.schema.id]: { + uniques: defaultFrameSchema.uniques, + cols: defaultFrameSchema.cols, + rows: mdb.rows + } + }; + db.close(); + return saveSpaceDBToPath(plugin, space, "frames", tables); +}; + +// src/react/context/SpaceContext.tsx +var SpaceContext = F({ + spaceInfo: null, + readMode: false, + spaceCache: null +}); +var SpaceContextProvider = (props2) => { + var _a2; + const readMode = (_a2 = props2.space) == null ? void 0 : _a2.readOnly; + const spaceInfo = F2(() => { + return props2.space; + }, [props2.space]); + const [spaceCache, setSpaceCache] = h2(null); + const reloadSpace = () => { + const spaceCache2 = props2.plugin.index.spacesIndex.get(spaceInfo.path); + if (spaceCache2) { + setSpaceCache(spaceCache2); + } + }; + p2(() => { + reloadSpace(); + }, [spaceInfo]); + const refreshSpace = T2( + async (evt) => { + if (evt.detail.type == "space") { + if (evt.detail.name == spaceInfo.path) { + reloadSpace(); + } + } }, - { - n: ["barely sunny", "sun behind cloud", "sun behind large cloud"], - u: "1f325-fe0f" + [props2.plugin, spaceInfo] + ); + p2(() => { + window.addEventListener(eventTypes.spacesChange, refreshSpace); + return () => { + window.removeEventListener(eventTypes.spacesChange, refreshSpace); + }; + }, [refreshSpace]); + return /* @__PURE__ */ Cn.createElement(SpaceContext.Provider, { + value: { + spaceCache, + readMode, + spaceInfo + } + }, props2.children); +}; + +// src/react/context/FramesMDBContext.tsx +var FramesMDBContext = F({ + frameSchemas: [], + frames: [], + tableData: null, + saveFrame: () => null, + frameSchema: null, + setFrameSchema: () => null, + saveSchema: () => null, + deleteSchema: () => null, + dbFileExists: false, + getMDBData: () => null +}); +var FramesMDBProvider = (props2) => { + const [dbFileExists, setDBFileExists] = h2(false); + const [schemaTable, setSchemaTable] = h2(null); + const schemas = F2( + () => { + var _a2, _b2; + return (_b2 = ((_a2 = schemaTable == null ? void 0 : schemaTable.rows) != null ? _a2 : []).map( + (f4) => mdbSchemaToFrameSchema(f4) + )) != null ? _b2 : []; + }, + [schemaTable] + ); + const frames2 = schemas.filter((f4) => f4.type == "frame"); + const [frameData, setFrameData] = h2(null); + const [frameSchema, setFrameSchema] = h2(null); + const tableData = F2(() => { + return frameData == null ? void 0 : frameData[frameSchema == null ? void 0 : frameSchema.id]; + }, [frameData, frameSchema]); + const defaultSchema = defaultFramesSchema; + const { spaceInfo, readMode } = q2(SpaceContext); + const deleteSchema = async (table) => { + if (table.primary) + return; + const deleteResult = await deleteMDBTable( + props2.plugin, + spaceInfo, + table.id, + spaceInfo.framePath + ); + if (deleteResult) { + const newSchemaTable = { + ...schemaTable, + rows: schemaTable.rows.filter( + (f4) => f4.id != table.id && f4.def != table.id + ) + }; + setSchemaTable(newSchemaTable); + } + }; + const saveSchema = async (table) => { + const newSchema = schemaTable.rows.find((f4) => f4.id == table.id) ? true : false; + const newSchemaTable = newSchema ? { + ...schemaTable, + rows: schemaTable.rows.map( + (f4) => f4.id == table.id ? frameSchemaToMDBSchema(table) : f4 + ) + } : { + ...schemaTable, + rows: [...schemaTable.rows, frameSchemaToMDBSchema(table)] + }; + if (!spaceInfo.readOnly) { + if (!dbFileExists) { + const dbTables = { + ...mdbFrameToDBTables(DefaultMDBTables, { + m_fields: fieldSchema.uniques, + main: defaultFrameSchema.uniques + }), + ...schemasAndFields(DefaultMDBTables), + m_schema: newSchemaTable + }; + await saveSpaceDBToPath( + props2.plugin, + spaceInfo, + "frames", + dbTables + ).then((f4) => { + setDBFileExists(true); + f4 ? getMDBData() : new import_obsidian5.Notice("DB ERROR"); + }); + setDBFileExists(true); + } else { + await saveSpaceDBToPath(props2.plugin, spaceInfo, "frames", { + m_schema: newSchemaTable + }); + } + } + if (table.id == (frameSchema == null ? void 0 : frameSchema.id)) { + setFrameSchema(table); + setFrameData((f4) => ({ + ...f4, + [table.id]: { + ...f4[table.id], + schema: frameSchemaToMDBSchema(table) + } + })); + } + setSchemaTable(newSchemaTable); + }; + p2(() => { + if (schemaTable) + getMDBData().then((f4) => { + if (f4 && Object.keys(f4).length > 0) { + setFrameData(f4); + } + }); + }, [schemaTable]); + p2(() => { + var _a2, _b2; + if (schemaTable) { + if (props2.schema) { + if ((frameSchema == null ? void 0 : frameSchema.id) != props2.schema) { + const preselectSchema = schemaTable.rows.find( + (g4) => g4.id == props2.schema + ); + if (preselectSchema) { + if (preselectSchema.type == "frame" || preselectSchema.type == "listitem") { + setFrameSchema(mdbSchemaToFrameSchema(preselectSchema)); + return; + } else { + const preselectDBSchema = schemaTable.rows.find( + (g4) => g4.id == preselectSchema.def + ); + if (preselectDBSchema) { + setFrameSchema(mdbSchemaToFrameSchema(preselectDBSchema)); + return; + } + } + } else { + const newSchema = { + id: uniqueNameFromString( + sanitizeTableName(props2.schema), + schemaTable.rows.map((g4) => g4.id) + ), + name: props2.schema, + type: "frame" + }; + setFrameSchema(newSchema); + } + } + } else { + if (!frameSchema) { + setFrameSchema( + mdbSchemaToFrameSchema( + (_a2 = schemaTable.rows) == null ? void 0 : _a2.find((g4) => g4.type == "frame") + ) + ); + } else { + setFrameSchema( + mdbSchemaToFrameSchema( + (_b2 = schemaTable.rows) == null ? void 0 : _b2.find((g4) => g4.id == frameSchema.id) + ) + ); + } + } + } + }, [schemaTable]); + const loadTables = T2(async () => { + if (!spaceInfo) + return; + const mdbExists = await props2.plugin.app.vault.adapter.exists( + spaceInfo.framePath + ); + if (mdbExists || spaceInfo.isRemote) { + setDBFileExists(true); + getMDBTableSchemas(props2.plugin, spaceInfo, "frames").then((f4) => { + if (f4) + setSchemaTable((prev) => ({ + ...defaultSchema, + rows: f4 + })); + }); + } else { + if (props2.schema) { + setSchemaTable((prev) => defaultSchema); + } else { + setSchemaTable((prev) => defaultSchema); + } + } + }, [defaultSchema, props2.plugin, props2.schema, spaceInfo]); + const refreshSpace = T2( + async (evt) => { + if (evt.detail.type == "frames" && evt.detail.name == spaceInfo.path) { + loadTables(); + return; + } }, - { n: ["partly sunny rain", "sun behind rain cloud"], u: "1f326-fe0f" }, - { n: ["rain cloud", "cloud with rain"], u: "1f327-fe0f" }, - { n: ["snow cloud", "cloud with snow"], u: "1f328-fe0f" }, - { - n: ["lightning", "lightning cloud", "cloud with lightning"], - u: "1f329-fe0f" + [spaceInfo, loadTables] + ); + p2(() => { + window.addEventListener(eventTypes.spacesChange, refreshSpace); + return () => { + window.removeEventListener(eventTypes.spacesChange, refreshSpace); + }; + }, [refreshSpace]); + const getMDBData = async () => { + if (dbFileExists) { + return await getMFrameTables(props2.plugin, spaceInfo); + } else { + return DefaultMDBTables; + } + }; + p2(() => { + loadTables(); + }, [spaceInfo]); + const saveFrame = async (newTable) => { + if (spaceInfo.readOnly) + return; + if (!dbFileExists) { + const dbTables = { + ...mdbFrameToDBTables(DefaultMDBTables, { + m_fields: fieldSchema.uniques, + main: defaultFrameSchema.uniques + }), + ...schemasAndFields(DefaultMDBTables), + [newTable.schema.id]: { + uniques: defaultFrameSchema.uniques, + cols: defaultFrameSchema.cols, + rows: newTable.rows + } + }; + await saveSpaceDBToPath(props2.plugin, spaceInfo, "frames", dbTables).then( + (f4) => { + setDBFileExists(true); + f4 ? getMDBData() : new import_obsidian5.Notice("DB ERROR"); + } + ); + } else { + await saveMFramesToPath( + props2.plugin, + spaceInfo, + newTable + ).then((f4) => { + f4 ? setFrameData((p3) => ({ + ...p3, + [newTable.schema.id]: newTable + })) : new import_obsidian5.Notice("DB ERROR"); + }); + } + }; + return /* @__PURE__ */ Cn.createElement(FramesMDBContext.Provider, { + value: { + frames: frames2, + tableData, + saveFrame, + frameSchemas: schemas, + saveSchema, + deleteSchema, + dbFileExists, + frameSchema, + setFrameSchema, + getMDBData + } + }, props2.children); +}; + +// node_modules/@dnd-kit/utilities/dist/utilities.esm.js +function useCombinedRefs() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + return F2( + () => (node) => { + refs.forEach((ref2) => ref2(node)); }, - { n: ["tornado", "tornado cloud"], u: "1f32a-fe0f" }, - { n: ["fog"], u: "1f32b-fe0f" }, - { n: ["wind face", "wind blowing face"], u: "1f32c-fe0f" }, - { n: ["cyclone"], u: "1f300" }, - { n: ["rainbow"], u: "1f308" }, - { n: ["closed umbrella"], u: "1f302" }, - { n: ["umbrella"], u: "2602-fe0f" }, - { n: ["umbrella with rain drops"], u: "2614" }, - { n: ["umbrella on ground"], u: "26f1-fe0f" }, - { n: ["zap", "high voltage sign"], u: "26a1" }, - { n: ["snowflake"], u: "2744-fe0f" }, - { n: ["snowman"], u: "2603-fe0f" }, - { n: ["snowman without snow"], u: "26c4" }, - { n: ["comet"], u: "2604-fe0f" }, - { n: ["fire"], u: "1f525" }, - { n: ["droplet"], u: "1f4a7" }, - { n: ["ocean", "water wave"], u: "1f30a" } - ], - activities: [ - { n: ["jack-o-lantern", "jack o lantern"], u: "1f383" }, - { n: ["christmas tree"], u: "1f384" }, - { n: ["fireworks"], u: "1f386" }, - { n: ["sparkler", "firework sparkler"], u: "1f387" }, - { n: ["firecracker"], u: "1f9e8" }, - { n: ["sparkles"], u: "2728" }, - { n: ["balloon"], u: "1f388" }, - { n: ["tada", "party popper"], u: "1f389" }, - { n: ["confetti ball"], u: "1f38a" }, - { n: ["tanabata tree"], u: "1f38b" }, - { n: ["bamboo", "pine decoration"], u: "1f38d" }, - { n: ["dolls", "japanese dolls"], u: "1f38e" }, - { n: ["flags", "carp streamer"], u: "1f38f" }, - { n: ["wind chime"], u: "1f390" }, - { n: ["rice scene", "moon viewing ceremony"], u: "1f391" }, - { n: ["red envelope", "red gift envelope"], u: "1f9e7" }, - { n: ["ribbon"], u: "1f380" }, - { n: ["gift", "wrapped present"], u: "1f381" }, - { n: ["reminder ribbon"], u: "1f397-fe0f" }, - { n: ["admission tickets"], u: "1f39f-fe0f" }, - { n: ["ticket"], u: "1f3ab" }, - { n: ["medal", "military medal"], u: "1f396-fe0f" }, - { n: ["trophy"], u: "1f3c6" }, - { n: ["sports medal"], u: "1f3c5" }, - { n: ["first place medal"], u: "1f947" }, - { n: ["second place medal"], u: "1f948" }, - { n: ["third place medal"], u: "1f949" }, - { n: ["soccer", "soccer ball"], u: "26bd" }, - { n: ["baseball"], u: "26be" }, - { n: ["softball"], u: "1f94e" }, - { n: ["basketball", "basketball and hoop"], u: "1f3c0" }, - { n: ["volleyball"], u: "1f3d0" }, - { n: ["football", "american football"], u: "1f3c8" }, - { n: ["rugby football"], u: "1f3c9" }, - { n: ["tennis", "tennis racquet and ball"], u: "1f3be" }, - { n: ["flying disc"], u: "1f94f" }, - { n: ["bowling"], u: "1f3b3" }, - { n: ["cricket bat and ball"], u: "1f3cf" }, - { n: ["field hockey stick and ball"], u: "1f3d1" }, - { n: ["ice hockey stick and puck"], u: "1f3d2" }, - { n: ["lacrosse", "lacrosse stick and ball"], u: "1f94d" }, - { n: ["table tennis paddle and ball"], u: "1f3d3" }, - { n: ["badminton racquet and shuttlecock"], u: "1f3f8" }, - { n: ["boxing glove"], u: "1f94a" }, - { n: ["martial arts uniform"], u: "1f94b" }, - { n: ["goal net"], u: "1f945" }, - { n: ["golf", "flag in hole"], u: "26f3" }, - { n: ["ice skate"], u: "26f8-fe0f" }, - { n: ["fishing pole and fish"], u: "1f3a3" }, - { n: ["diving mask"], u: "1f93f" }, - { n: ["running shirt with sash"], u: "1f3bd" }, - { n: ["ski", "ski and ski boot"], u: "1f3bf" }, - { n: ["sled"], u: "1f6f7" }, - { n: ["curling stone"], u: "1f94c" }, - { n: ["dart", "direct hit"], u: "1f3af" }, - { n: ["yo-yo"], u: "1fa80" }, - { n: ["kite"], u: "1fa81" }, - { n: ["8ball", "billiards"], u: "1f3b1" }, - { n: ["crystal ball"], u: "1f52e" }, - { n: ["magic wand"], u: "1fa84" }, - { n: ["nazar amulet"], u: "1f9ff" }, - { n: ["hamsa"], u: "1faac" }, - { n: ["video game"], u: "1f3ae" }, - { n: ["joystick"], u: "1f579-fe0f" }, - { n: ["slot machine"], u: "1f3b0" }, - { n: ["game die"], u: "1f3b2" }, - { n: ["jigsaw", "jigsaw puzzle piece"], u: "1f9e9" }, - { n: ["teddy bear"], u: "1f9f8" }, - { n: ["pinata"], u: "1fa85" }, - { n: ["mirror ball"], u: "1faa9" }, - { n: ["nesting dolls"], u: "1fa86" }, - { n: ["spades", "black spade suit"], u: "2660-fe0f" }, - { n: ["hearts", "black heart suit"], u: "2665-fe0f" }, - { n: ["diamonds", "black diamond suit"], u: "2666-fe0f" }, - { n: ["clubs", "black club suit"], u: "2663-fe0f" }, - { n: ["chess pawn"], u: "265f-fe0f" }, - { n: ["black joker", "playing card black joker"], u: "1f0cf" }, - { n: ["mahjong", "mahjong tile red dragon"], u: "1f004" }, - { n: ["flower playing cards"], u: "1f3b4" }, - { n: ["performing arts"], u: "1f3ad" }, - { n: ["framed picture", "frame with picture"], u: "1f5bc-fe0f" }, - { n: ["art", "artist palette"], u: "1f3a8" }, - { n: ["thread", "spool of thread"], u: "1f9f5" }, - { n: ["sewing needle"], u: "1faa1" }, - { n: ["yarn", "ball of yarn"], u: "1f9f6" }, - { n: ["knot"], u: "1faa2" } - ], - objects: [ - { n: ["eyeglasses"], u: "1f453" }, - { n: ["sunglasses", "dark sunglasses"], u: "1f576-fe0f" }, - { n: ["goggles"], u: "1f97d" }, - { n: ["lab coat"], u: "1f97c" }, - { n: ["safety vest"], u: "1f9ba" }, - { n: ["necktie"], u: "1f454" }, - { n: ["shirt", "tshirt", "t-shirt"], u: "1f455" }, - { n: ["jeans"], u: "1f456" }, - { n: ["scarf"], u: "1f9e3" }, - { n: ["gloves"], u: "1f9e4" }, - { n: ["coat"], u: "1f9e5" }, - { n: ["socks"], u: "1f9e6" }, - { n: ["dress"], u: "1f457" }, - { n: ["kimono"], u: "1f458" }, - { n: ["sari"], u: "1f97b" }, - { n: ["one-piece swimsuit"], u: "1fa71" }, - { n: ["briefs"], u: "1fa72" }, - { n: ["shorts"], u: "1fa73" }, - { n: ["bikini"], u: "1f459" }, - { n: ["womans clothes"], u: "1f45a" }, - { n: ["purse"], u: "1f45b" }, - { n: ["handbag"], u: "1f45c" }, - { n: ["pouch"], u: "1f45d" }, - { n: ["shopping bags"], u: "1f6cd-fe0f" }, - { n: ["school satchel"], u: "1f392" }, - { n: ["thong sandal"], u: "1fa74" }, - { n: ["shoe", "mans shoe"], u: "1f45e" }, - { n: ["athletic shoe"], u: "1f45f" }, - { n: ["hiking boot"], u: "1f97e" }, - { n: ["flat shoe", "womans flat shoe"], u: "1f97f" }, - { n: ["high heel", "high-heeled shoe"], u: "1f460" }, - { n: ["sandal", "womans sandal"], u: "1f461" }, - { n: ["ballet shoes"], u: "1fa70" }, - { n: ["boot", "womans boots"], u: "1f462" }, - { n: ["crown"], u: "1f451" }, - { n: ["womans hat"], u: "1f452" }, - { n: ["tophat", "top hat"], u: "1f3a9" }, - { n: ["mortar board", "graduation cap"], u: "1f393" }, - { n: ["billed cap"], u: "1f9e2" }, - { n: ["military helmet"], u: "1fa96" }, - { - n: ["rescue worker\u2019s helmet", "helmet with white cross"], - u: "26d1-fe0f" + refs + ); +} +var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; +function isWindow(element) { + const elementString = Object.prototype.toString.call(element); + return elementString === "[object Window]" || elementString === "[object global]"; +} +function isNode(node) { + return "nodeType" in node; +} +function getWindow(target) { + var _target$ownerDocument, _target$ownerDocument2; + if (!target) { + return window; + } + if (isWindow(target)) { + return target; + } + if (!isNode(target)) { + return window; + } + return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; +} +function isDocument(node) { + const { + Document + } = getWindow(node); + return node instanceof Document; +} +function isHTMLElement(node) { + if (isWindow(node)) { + return false; + } + return node instanceof getWindow(node).HTMLElement; +} +function isSVGElement(node) { + return node instanceof getWindow(node).SVGElement; +} +function getOwnerDocument(target) { + if (!target) { + return document; + } + if (isWindow(target)) { + return target.document; + } + if (!isNode(target)) { + return document; + } + if (isDocument(target)) { + return target; + } + if (isHTMLElement(target)) { + return target.ownerDocument; + } + return document; +} +var useIsomorphicLayoutEffect = canUseDOM ? y2 : p2; +function useEvent(handler) { + const handlerRef = _2(handler); + useIsomorphicLayoutEffect(() => { + handlerRef.current = handler; + }); + return T2(function() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return handlerRef.current == null ? void 0 : handlerRef.current(...args); + }, []); +} +function useInterval() { + const intervalRef = _2(null); + const set = T2((listener, duration) => { + intervalRef.current = setInterval(listener, duration); + }, []); + const clear = T2(() => { + if (intervalRef.current !== null) { + clearInterval(intervalRef.current); + intervalRef.current = null; + } + }, []); + return [set, clear]; +} +function useLatestValue(value, dependencies) { + if (dependencies === void 0) { + dependencies = [value]; + } + const valueRef = _2(value); + useIsomorphicLayoutEffect(() => { + if (valueRef.current !== value) { + valueRef.current = value; + } + }, dependencies); + return valueRef; +} +function useLazyMemo(callback, dependencies) { + const valueRef = _2(); + return F2( + () => { + const newValue = callback(valueRef.current); + valueRef.current = newValue; + return newValue; }, - { n: ["prayer beads"], u: "1f4ff" }, - { n: ["lipstick"], u: "1f484" }, - { n: ["ring"], u: "1f48d" }, - { n: ["gem", "gem stone"], u: "1f48e" }, - { n: ["mute", "speaker with cancellation stroke"], u: "1f507" }, - { n: ["speaker"], u: "1f508" }, - { n: ["sound", "speaker with one sound wave"], u: "1f509" }, - { n: ["loud sound", "speaker with three sound waves"], u: "1f50a" }, - { n: ["loudspeaker", "public address loudspeaker"], u: "1f4e2" }, - { n: ["mega", "cheering megaphone"], u: "1f4e3" }, - { n: ["postal horn"], u: "1f4ef" }, - { n: ["bell"], u: "1f514" }, - { n: ["no bell", "bell with cancellation stroke"], u: "1f515" }, - { n: ["musical score"], u: "1f3bc" }, - { n: ["musical note"], u: "1f3b5" }, - { n: ["notes", "multiple musical notes"], u: "1f3b6" }, - { n: ["studio microphone"], u: "1f399-fe0f" }, - { n: ["level slider"], u: "1f39a-fe0f" }, - { n: ["control knobs"], u: "1f39b-fe0f" }, - { n: ["microphone"], u: "1f3a4" }, - { n: ["headphone", "headphones"], u: "1f3a7" }, - { n: ["radio"], u: "1f4fb" }, - { n: ["saxophone"], u: "1f3b7" }, - { n: ["accordion"], u: "1fa97" }, - { n: ["guitar"], u: "1f3b8" }, - { n: ["musical keyboard"], u: "1f3b9" }, - { n: ["trumpet"], u: "1f3ba" }, - { n: ["violin"], u: "1f3bb" }, - { n: ["banjo"], u: "1fa95" }, - { n: ["drum with drumsticks"], u: "1f941" }, - { n: ["long drum"], u: "1fa98" }, - { n: ["iphone", "mobile phone"], u: "1f4f1" }, - { - n: ["calling", "mobile phone with rightwards arrow at left"], - u: "1f4f2" + [...dependencies] + ); +} +function useNodeRef(onChange) { + const onChangeHandler = useEvent(onChange); + const node = _2(null); + const setNodeRef = T2( + (element) => { + if (element !== node.current) { + onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); + } + node.current = element; }, - { n: ["phone", "telephone", "black telephone"], u: "260e-fe0f" }, - { n: ["telephone receiver"], u: "1f4de" }, - { n: ["pager"], u: "1f4df" }, - { n: ["fax", "fax machine"], u: "1f4e0" }, - { n: ["battery"], u: "1f50b" }, - { n: ["low battery"], u: "1faab" }, - { n: ["electric plug"], u: "1f50c" }, - { n: ["computer", "personal computer"], u: "1f4bb" }, - { n: ["desktop computer"], u: "1f5a5-fe0f" }, - { n: ["printer"], u: "1f5a8-fe0f" }, - { n: ["keyboard"], u: "2328-fe0f" }, - { n: ["computer mouse", "three button mouse"], u: "1f5b1-fe0f" }, - { n: ["trackball"], u: "1f5b2-fe0f" }, - { n: ["minidisc"], u: "1f4bd" }, - { n: ["floppy disk"], u: "1f4be" }, - { n: ["cd", "optical disc"], u: "1f4bf" }, - { n: ["dvd"], u: "1f4c0" }, - { n: ["abacus"], u: "1f9ee" }, - { n: ["movie camera"], u: "1f3a5" }, - { n: ["film frames"], u: "1f39e-fe0f" }, - { n: ["film projector"], u: "1f4fd-fe0f" }, - { n: ["clapper", "clapper board"], u: "1f3ac" }, - { n: ["tv", "television"], u: "1f4fa" }, - { n: ["camera"], u: "1f4f7" }, - { n: ["camera with flash"], u: "1f4f8" }, - { n: ["video camera"], u: "1f4f9" }, - { n: ["vhs", "videocassette"], u: "1f4fc" }, - { n: ["mag", "left-pointing magnifying glass"], u: "1f50d" }, - { n: ["mag right", "right-pointing magnifying glass"], u: "1f50e" }, - { n: ["candle"], u: "1f56f-fe0f" }, - { n: ["bulb", "electric light bulb"], u: "1f4a1" }, - { n: ["flashlight", "electric torch"], u: "1f526" }, - { n: ["lantern", "izakaya lantern"], u: "1f3ee" }, - { n: ["diya lamp"], u: "1fa94" }, - { n: ["notebook with decorative cover"], u: "1f4d4" }, - { n: ["closed book"], u: "1f4d5" }, - { n: ["book", "open book"], u: "1f4d6" }, - { n: ["green book"], u: "1f4d7" }, - { n: ["blue book"], u: "1f4d8" }, - { n: ["orange book"], u: "1f4d9" }, - { n: ["books"], u: "1f4da" }, - { n: ["notebook"], u: "1f4d3" }, - { n: ["ledger"], u: "1f4d2" }, - { n: ["page with curl"], u: "1f4c3" }, - { n: ["scroll"], u: "1f4dc" }, - { n: ["page facing up"], u: "1f4c4" }, - { n: ["newspaper"], u: "1f4f0" }, - { n: ["rolled-up newspaper", "rolled up newspaper"], u: "1f5de-fe0f" }, - { n: ["bookmark tabs"], u: "1f4d1" }, - { n: ["bookmark"], u: "1f516" }, - { n: ["label"], u: "1f3f7-fe0f" }, - { n: ["moneybag", "money bag"], u: "1f4b0" }, - { n: ["coin"], u: "1fa99" }, - { n: ["yen", "banknote with yen sign"], u: "1f4b4" }, - { n: ["dollar", "banknote with dollar sign"], u: "1f4b5" }, - { n: ["euro", "banknote with euro sign"], u: "1f4b6" }, - { n: ["pound", "banknote with pound sign"], u: "1f4b7" }, - { n: ["money with wings"], u: "1f4b8" }, - { n: ["credit card"], u: "1f4b3" }, - { n: ["receipt"], u: "1f9fe" }, - { n: ["chart", "chart with upwards trend and yen sign"], u: "1f4b9" }, - { n: ["email", "envelope"], u: "2709-fe0f" }, - { n: ["e-mail", "e-mail symbol"], u: "1f4e7" }, - { n: ["incoming envelope"], u: "1f4e8" }, - { - n: ["envelope with arrow", "envelope with downwards arrow above"], - u: "1f4e9" + [] + ); + return [node, setNodeRef]; +} +function usePrevious(value) { + const ref2 = _2(); + p2(() => { + ref2.current = value; + }, [value]); + return ref2.current; +} +var ids = {}; +function useUniqueId(prefix, value) { + return F2(() => { + if (value) { + return value; + } + const id2 = ids[prefix] == null ? 0 : ids[prefix] + 1; + ids[prefix] = id2; + return prefix + "-" + id2; + }, [prefix, value]); +} +function createAdjustmentFn(modifier) { + return function(object) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + return adjustments.reduce((accumulator, adjustment) => { + const entries = Object.entries(adjustment); + for (const [key2, valueAdjustment] of entries) { + const value = accumulator[key2]; + if (value != null) { + accumulator[key2] = value + modifier * valueAdjustment; + } + } + return accumulator; + }, { + ...object + }); + }; +} +var add = /* @__PURE__ */ createAdjustmentFn(1); +var subtract = /* @__PURE__ */ createAdjustmentFn(-1); +function hasViewportRelativeCoordinates(event) { + return "clientX" in event && "clientY" in event; +} +function isKeyboardEvent(event) { + if (!event) { + return false; + } + const { + KeyboardEvent + } = getWindow(event.target); + return KeyboardEvent && event instanceof KeyboardEvent; +} +function isTouchEvent(event) { + if (!event) { + return false; + } + const { + TouchEvent + } = getWindow(event.target); + return TouchEvent && event instanceof TouchEvent; +} +function getEventCoordinates(event) { + if (isTouchEvent(event)) { + if (event.touches && event.touches.length) { + const { + clientX: x5, + clientY: y5 + } = event.touches[0]; + return { + x: x5, + y: y5 + }; + } else if (event.changedTouches && event.changedTouches.length) { + const { + clientX: x5, + clientY: y5 + } = event.changedTouches[0]; + return { + x: x5, + y: y5 + }; + } + } + if (hasViewportRelativeCoordinates(event)) { + return { + x: event.clientX, + y: event.clientY + }; + } + return null; +} +var CSS = /* @__PURE__ */ Object.freeze({ + Translate: { + toString(transform) { + if (!transform) { + return; + } + const { + x: x5, + y: y5 + } = transform; + return "translate3d(" + (x5 ? Math.round(x5) : 0) + "px, " + (y5 ? Math.round(y5) : 0) + "px, 0)"; + } + }, + Scale: { + toString(transform) { + if (!transform) { + return; + } + const { + scaleX, + scaleY + } = transform; + return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; + } + }, + Transform: { + toString(transform) { + if (!transform) { + return; + } + return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" "); + } + }, + Transition: { + toString(_ref) { + let { + property, + duration, + easing + } = _ref; + return property + " " + duration + "ms " + easing; + } + } +}); +var SELECTOR = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]"; +function findFirstFocusableNode(element) { + if (element.matches(SELECTOR)) { + return element; + } + return element.querySelector(SELECTOR); +} + +// node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +var hiddenStyles = { + display: "none" +}; +function HiddenText(_ref) { + let { + id: id2, + value + } = _ref; + return Cn.createElement("div", { + id: id2, + style: hiddenStyles + }, value); +} +var visuallyHidden = { + position: "fixed", + width: 1, + height: 1, + margin: -1, + border: 0, + padding: 0, + overflow: "hidden", + clip: "rect(0 0 0 0)", + clipPath: "inset(100%)", + whiteSpace: "nowrap" +}; +function LiveRegion(_ref) { + let { + id: id2, + announcement + } = _ref; + return Cn.createElement("div", { + id: id2, + style: visuallyHidden, + role: "status", + "aria-live": "assertive", + "aria-atomic": true + }, announcement); +} +function useAnnouncement() { + const [announcement, setAnnouncement] = h2(""); + const announce = T2((value) => { + if (value != null) { + setAnnouncement(value); + } + }, []); + return { + announce, + announcement + }; +} + +// node_modules/@dnd-kit/core/dist/core.esm.js +var DndMonitorContext = /* @__PURE__ */ F(null); +function useDndMonitor(listener) { + const registerListener = q2(DndMonitorContext); + p2(() => { + if (!registerListener) { + throw new Error("useDndMonitor must be used within a children of "); + } + const unsubscribe = registerListener(listener); + return unsubscribe; + }, [listener, registerListener]); +} +function useDndMonitorProvider() { + const [listeners] = h2(() => /* @__PURE__ */ new Set()); + const registerListener = T2((listener) => { + listeners.add(listener); + return () => listeners.delete(listener); + }, [listeners]); + const dispatch = T2((_ref) => { + let { + type, + event + } = _ref; + listeners.forEach((listener) => { + var _listener$type; + return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); + }); + }, [listeners]); + return [dispatch, registerListener]; +} +var defaultScreenReaderInstructions = { + draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " +}; +var defaultAnnouncements = { + onDragStart(_ref) { + let { + active + } = _ref; + return "Picked up draggable item " + active.id + "."; + }, + onDragOver(_ref2) { + let { + active, + over + } = _ref2; + if (over) { + return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; + } + return "Draggable item " + active.id + " is no longer over a droppable area."; + }, + onDragEnd(_ref3) { + let { + active, + over + } = _ref3; + if (over) { + return "Draggable item " + active.id + " was dropped over droppable area " + over.id; + } + return "Draggable item " + active.id + " was dropped."; + }, + onDragCancel(_ref4) { + let { + active + } = _ref4; + return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; + } +}; +function Accessibility(_ref) { + let { + announcements = defaultAnnouncements, + container, + hiddenTextDescribedById, + screenReaderInstructions = defaultScreenReaderInstructions + } = _ref; + const { + announce, + announcement + } = useAnnouncement(); + const liveRegionId = useUniqueId("DndLiveRegion"); + const [mounted, setMounted] = h2(false); + p2(() => { + setMounted(true); + }, []); + useDndMonitor(F2(() => ({ + onDragStart(_ref2) { + let { + active + } = _ref2; + announce(announcements.onDragStart({ + active + })); }, - { n: ["outbox tray"], u: "1f4e4" }, - { n: ["inbox tray"], u: "1f4e5" }, - { n: ["package"], u: "1f4e6" }, - { n: ["mailbox", "closed mailbox with raised flag"], u: "1f4eb" }, - { n: ["mailbox closed", "closed mailbox with lowered flag"], u: "1f4ea" }, - { n: ["mailbox with mail", "open mailbox with raised flag"], u: "1f4ec" }, - { - n: ["mailbox with no mail", "open mailbox with lowered flag"], - u: "1f4ed" + onDragMove(_ref3) { + let { + active, + over + } = _ref3; + if (announcements.onDragMove) { + announce(announcements.onDragMove({ + active, + over + })); + } }, - { n: ["postbox"], u: "1f4ee" }, - { n: ["ballot box with ballot"], u: "1f5f3-fe0f" }, - { n: ["pencil", "pencil2"], u: "270f-fe0f" }, - { n: ["black nib"], u: "2712-fe0f" }, - { n: ["fountain pen", "lower left fountain pen"], u: "1f58b-fe0f" }, - { n: ["pen", "lower left ballpoint pen"], u: "1f58a-fe0f" }, - { n: ["paintbrush", "lower left paintbrush"], u: "1f58c-fe0f" }, - { n: ["crayon", "lower left crayon"], u: "1f58d-fe0f" }, - { n: ["memo", "pencil"], u: "1f4dd" }, - { n: ["briefcase"], u: "1f4bc" }, - { n: ["file folder"], u: "1f4c1" }, - { n: ["open file folder"], u: "1f4c2" }, - { n: ["card index dividers"], u: "1f5c2-fe0f" }, - { n: ["date", "calendar"], u: "1f4c5" }, - { n: ["calendar", "tear-off calendar"], u: "1f4c6" }, - { n: ["spiral notepad", "spiral note pad"], u: "1f5d2-fe0f" }, - { n: ["spiral calendar", "spiral calendar pad"], u: "1f5d3-fe0f" }, - { n: ["card index"], u: "1f4c7" }, - { n: ["chart with upwards trend"], u: "1f4c8" }, - { n: ["chart with downwards trend"], u: "1f4c9" }, - { n: ["bar chart"], u: "1f4ca" }, - { n: ["clipboard"], u: "1f4cb" }, - { n: ["pushpin"], u: "1f4cc" }, - { n: ["round pushpin"], u: "1f4cd" }, - { n: ["paperclip"], u: "1f4ce" }, - { n: ["linked paperclips"], u: "1f587-fe0f" }, - { n: ["straight ruler"], u: "1f4cf" }, - { n: ["triangular ruler"], u: "1f4d0" }, - { n: ["scissors", "black scissors"], u: "2702-fe0f" }, - { n: ["card file box"], u: "1f5c3-fe0f" }, - { n: ["file cabinet"], u: "1f5c4-fe0f" }, - { n: ["wastebasket"], u: "1f5d1-fe0f" }, - { n: ["lock"], u: "1f512" }, - { n: ["unlock", "open lock"], u: "1f513" }, - { n: ["lock with ink pen"], u: "1f50f" }, - { n: ["closed lock with key"], u: "1f510" }, - { n: ["key"], u: "1f511" }, - { n: ["old key"], u: "1f5dd-fe0f" }, - { n: ["hammer"], u: "1f528" }, - { n: ["axe"], u: "1fa93" }, - { n: ["pick"], u: "26cf-fe0f" }, - { n: ["hammer and pick"], u: "2692-fe0f" }, - { n: ["hammer and wrench"], u: "1f6e0-fe0f" }, - { n: ["dagger", "dagger knife"], u: "1f5e1-fe0f" }, - { n: ["crossed swords"], u: "2694-fe0f" }, - { n: ["gun", "pistol"], u: "1f52b" }, - { n: ["boomerang"], u: "1fa83" }, - { n: ["bow and arrow"], u: "1f3f9" }, - { n: ["shield"], u: "1f6e1-fe0f" }, - { n: ["carpentry saw"], u: "1fa9a" }, - { n: ["wrench"], u: "1f527" }, - { n: ["screwdriver"], u: "1fa9b" }, - { n: ["nut and bolt"], u: "1f529" }, - { n: ["gear"], u: "2699-fe0f" }, - { n: ["clamp", "compression"], u: "1f5dc-fe0f" }, - { n: ["scales", "balance scale"], u: "2696-fe0f" }, - { n: ["probing cane"], u: "1f9af" }, - { n: ["link", "link symbol"], u: "1f517" }, - { n: ["chains"], u: "26d3-fe0f" }, - { n: ["hook"], u: "1fa9d" }, - { n: ["toolbox"], u: "1f9f0" }, - { n: ["magnet"], u: "1f9f2" }, - { n: ["ladder"], u: "1fa9c" }, - { n: ["alembic"], u: "2697-fe0f" }, - { n: ["test tube"], u: "1f9ea" }, - { n: ["petri dish"], u: "1f9eb" }, - { n: ["dna", "dna double helix"], u: "1f9ec" }, - { n: ["microscope"], u: "1f52c" }, - { n: ["telescope"], u: "1f52d" }, - { n: ["satellite antenna"], u: "1f4e1" }, - { n: ["syringe"], u: "1f489" }, - { n: ["drop of blood"], u: "1fa78" }, - { n: ["pill"], u: "1f48a" }, - { n: ["adhesive bandage"], u: "1fa79" }, - { n: ["crutch"], u: "1fa7c" }, - { n: ["stethoscope"], u: "1fa7a" }, - { n: ["x-ray"], u: "1fa7b" }, - { n: ["door"], u: "1f6aa" }, - { n: ["elevator"], u: "1f6d7" }, - { n: ["mirror"], u: "1fa9e" }, - { n: ["window"], u: "1fa9f" }, - { n: ["bed"], u: "1f6cf-fe0f" }, - { n: ["couch and lamp"], u: "1f6cb-fe0f" }, - { n: ["chair"], u: "1fa91" }, - { n: ["toilet"], u: "1f6bd" }, - { n: ["plunger"], u: "1faa0" }, - { n: ["shower"], u: "1f6bf" }, - { n: ["bathtub"], u: "1f6c1" }, - { n: ["mouse trap"], u: "1faa4" }, - { n: ["razor"], u: "1fa92" }, - { n: ["lotion bottle"], u: "1f9f4" }, - { n: ["safety pin"], u: "1f9f7" }, - { n: ["broom"], u: "1f9f9" }, - { n: ["basket"], u: "1f9fa" }, - { n: ["roll of paper"], u: "1f9fb" }, - { n: ["bucket"], u: "1faa3" }, - { n: ["soap", "bar of soap"], u: "1f9fc" }, - { n: ["bubbles"], u: "1fae7" }, - { n: ["toothbrush"], u: "1faa5" }, - { n: ["sponge"], u: "1f9fd" }, - { n: ["fire extinguisher"], u: "1f9ef" }, - { n: ["shopping trolley"], u: "1f6d2" }, - { n: ["smoking", "smoking symbol"], u: "1f6ac" }, - { n: ["coffin"], u: "26b0-fe0f" }, - { n: ["headstone"], u: "1faa6" }, - { n: ["funeral urn"], u: "26b1-fe0f" }, - { n: ["moyai"], u: "1f5ff" }, - { n: ["placard"], u: "1faa7" }, - { n: ["identification card"], u: "1faaa" } - ], - symbols: [ - { n: ["atm", "automated teller machine"], u: "1f3e7" }, - { - n: ["put litter in its place", "put litter in its place symbol"], - u: "1f6ae" + onDragOver(_ref4) { + let { + active, + over + } = _ref4; + announce(announcements.onDragOver({ + active, + over + })); }, - { n: ["potable water", "potable water symbol"], u: "1f6b0" }, - { n: ["wheelchair", "wheelchair symbol"], u: "267f" }, - { n: ["mens", "mens symbol"], u: "1f6b9" }, - { n: ["womens", "womens symbol"], u: "1f6ba" }, - { n: ["restroom"], u: "1f6bb" }, - { n: ["baby symbol"], u: "1f6bc" }, - { n: ["wc", "water closet"], u: "1f6be" }, - { n: ["passport control"], u: "1f6c2" }, - { n: ["customs"], u: "1f6c3" }, - { n: ["baggage claim"], u: "1f6c4" }, - { n: ["left luggage"], u: "1f6c5" }, - { n: ["warning", "warning sign"], u: "26a0-fe0f" }, - { n: ["children crossing"], u: "1f6b8" }, - { n: ["no entry"], u: "26d4" }, - { n: ["no entry sign"], u: "1f6ab" }, - { n: ["no bicycles"], u: "1f6b3" }, - { n: ["no smoking", "no smoking symbol"], u: "1f6ad" }, - { n: ["do not litter", "do not litter symbol"], u: "1f6af" }, - { n: ["non-potable water", "non-potable water symbol"], u: "1f6b1" }, - { n: ["no pedestrians"], u: "1f6b7" }, - { n: ["no mobile phones"], u: "1f4f5" }, - { n: ["underage", "no one under eighteen symbol"], u: "1f51e" }, - { n: ["radioactive", "radioactive sign"], u: "2622-fe0f" }, - { n: ["biohazard", "biohazard sign"], u: "2623-fe0f" }, - { n: ["arrow up", "upwards black arrow"], u: "2b06-fe0f" }, - { n: ["north east arrow", "arrow upper right"], u: "2197-fe0f" }, - { n: ["arrow right", "black rightwards arrow"], u: "27a1-fe0f" }, - { n: ["south east arrow", "arrow lower right"], u: "2198-fe0f" }, - { n: ["arrow down", "downwards black arrow"], u: "2b07-fe0f" }, - { n: ["south west arrow", "arrow lower left"], u: "2199-fe0f" }, - { n: ["arrow left", "leftwards black arrow"], u: "2b05-fe0f" }, - { n: ["north west arrow", "arrow upper left"], u: "2196-fe0f" }, - { n: ["up down arrow", "arrow up down"], u: "2195-fe0f" }, - { n: ["left right arrow"], u: "2194-fe0f" }, - { n: ["leftwards arrow with hook"], u: "21a9-fe0f" }, - { n: ["arrow right hook", "rightwards arrow with hook"], u: "21aa-fe0f" }, - { - n: ["arrow heading up", "arrow pointing rightwards then curving upwards"], - u: "2934-fe0f" + onDragEnd(_ref5) { + let { + active, + over + } = _ref5; + announce(announcements.onDragEnd({ + active, + over + })); }, - { - n: [ - "arrow heading down", - "arrow pointing rightwards then curving downwards" - ], - u: "2935-fe0f" + onDragCancel(_ref6) { + let { + active, + over + } = _ref6; + announce(announcements.onDragCancel({ + active, + over + })); + } + }), [announce, announcements])); + if (!mounted) { + return null; + } + const markup = Cn.createElement(Cn.Fragment, null, Cn.createElement(HiddenText, { + id: hiddenTextDescribedById, + value: screenReaderInstructions.draggable + }), Cn.createElement(LiveRegion, { + id: liveRegionId, + announcement + })); + return container ? z3(markup, container) : markup; +} +var Action; +(function(Action2) { + Action2["DragStart"] = "dragStart"; + Action2["DragMove"] = "dragMove"; + Action2["DragEnd"] = "dragEnd"; + Action2["DragCancel"] = "dragCancel"; + Action2["DragOver"] = "dragOver"; + Action2["RegisterDroppable"] = "registerDroppable"; + Action2["SetDroppableDisabled"] = "setDroppableDisabled"; + Action2["UnregisterDroppable"] = "unregisterDroppable"; +})(Action || (Action = {})); +function noop() { +} +function useSensor(sensor, options) { + return F2( + () => ({ + sensor, + options: options != null ? options : {} + }), + [sensor, options] + ); +} +function useSensors() { + for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { + sensors[_key] = arguments[_key]; + } + return F2( + () => [...sensors].filter((sensor) => sensor != null), + [...sensors] + ); +} +var defaultCoordinates = /* @__PURE__ */ Object.freeze({ + x: 0, + y: 0 +}); +function distanceBetween(p1, p22) { + return Math.sqrt(Math.pow(p1.x - p22.x, 2) + Math.pow(p1.y - p22.y, 2)); +} +function getRelativeTransformOrigin(event, rect) { + const eventCoordinates = getEventCoordinates(event); + if (!eventCoordinates) { + return "0 0"; + } + const transformOrigin = { + x: (eventCoordinates.x - rect.left) / rect.width * 100, + y: (eventCoordinates.y - rect.top) / rect.height * 100 + }; + return transformOrigin.x + "% " + transformOrigin.y + "%"; +} +function sortCollisionsAsc(_ref, _ref2) { + let { + data: { + value: a5 + } + } = _ref; + let { + data: { + value: b4 + } + } = _ref2; + return a5 - b4; +} +function sortCollisionsDesc(_ref3, _ref4) { + let { + data: { + value: a5 + } + } = _ref3; + let { + data: { + value: b4 + } + } = _ref4; + return b4 - a5; +} +function cornersOfRectangle(_ref5) { + let { + left, + top, + height, + width + } = _ref5; + return [{ + x: left, + y: top + }, { + x: left + width, + y: top + }, { + x: left, + y: top + height + }, { + x: left + width, + y: top + height + }]; +} +function getFirstCollision(collisions, property) { + if (!collisions || collisions.length === 0) { + return null; + } + const [firstCollision] = collisions; + return property ? firstCollision[property] : firstCollision; +} +function centerOfRectangle(rect, left, top) { + if (left === void 0) { + left = rect.left; + } + if (top === void 0) { + top = rect.top; + } + return { + x: left + rect.width * 0.5, + y: top + rect.height * 0.5 + }; +} +var closestCenter = (_ref) => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); + const collisions = []; + for (const droppableContainer of droppableContainers) { + const { + id: id2 + } = droppableContainer; + const rect = droppableRects.get(id2); + if (rect) { + const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); + collisions.push({ + id: id2, + data: { + droppableContainer, + value: distBetween + } + }); + } + } + return collisions.sort(sortCollisionsAsc); +}; +var closestCorners = (_ref) => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const corners = cornersOfRectangle(collisionRect); + const collisions = []; + for (const droppableContainer of droppableContainers) { + const { + id: id2 + } = droppableContainer; + const rect = droppableRects.get(id2); + if (rect) { + const rectCorners = cornersOfRectangle(rect); + const distances = corners.reduce((accumulator, corner, index) => { + return accumulator + distanceBetween(rectCorners[index], corner); + }, 0); + const effectiveDistance = Number((distances / 4).toFixed(4)); + collisions.push({ + id: id2, + data: { + droppableContainer, + value: effectiveDistance + } + }); + } + } + return collisions.sort(sortCollisionsAsc); +}; +function getIntersectionRatio(entry, target) { + const top = Math.max(target.top, entry.top); + const left = Math.max(target.left, entry.left); + const right = Math.min(target.left + target.width, entry.left + entry.width); + const bottom = Math.min(target.top + target.height, entry.top + entry.height); + const width = right - left; + const height = bottom - top; + if (left < right && top < bottom) { + const targetArea = target.width * target.height; + const entryArea = entry.width * entry.height; + const intersectionArea = width * height; + const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); + return Number(intersectionRatio.toFixed(4)); + } + return 0; +} +var rectIntersection = (_ref) => { + let { + collisionRect, + droppableRects, + droppableContainers + } = _ref; + const collisions = []; + for (const droppableContainer of droppableContainers) { + const { + id: id2 + } = droppableContainer; + const rect = droppableRects.get(id2); + if (rect) { + const intersectionRatio = getIntersectionRatio(rect, collisionRect); + if (intersectionRatio > 0) { + collisions.push({ + id: id2, + data: { + droppableContainer, + value: intersectionRatio + } + }); + } + } + } + return collisions.sort(sortCollisionsDesc); +}; +function adjustScale(transform, rect1, rect2) { + return { + ...transform, + scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, + scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 + }; +} +function getRectDelta(rect1, rect2) { + return rect1 && rect2 ? { + x: rect1.left - rect2.left, + y: rect1.top - rect2.top + } : defaultCoordinates; +} +function createRectAdjustmentFn(modifier) { + return function adjustClientRect(rect) { + for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + adjustments[_key - 1] = arguments[_key]; + } + return adjustments.reduce((acc, adjustment) => ({ + ...acc, + top: acc.top + modifier * adjustment.y, + bottom: acc.bottom + modifier * adjustment.y, + left: acc.left + modifier * adjustment.x, + right: acc.right + modifier * adjustment.x + }), { + ...rect + }); + }; +} +var getAdjustedRect = /* @__PURE__ */ createRectAdjustmentFn(1); +function parseTransform(transform) { + if (transform.startsWith("matrix3d(")) { + const transformArray = transform.slice(9, -1).split(/, /); + return { + x: +transformArray[12], + y: +transformArray[13], + scaleX: +transformArray[0], + scaleY: +transformArray[5] + }; + } else if (transform.startsWith("matrix(")) { + const transformArray = transform.slice(7, -1).split(/, /); + return { + x: +transformArray[4], + y: +transformArray[5], + scaleX: +transformArray[0], + scaleY: +transformArray[3] + }; + } + return null; +} +function inverseTransform(rect, transform, transformOrigin) { + const parsedTransform = parseTransform(transform); + if (!parsedTransform) { + return rect; + } + const { + scaleX, + scaleY, + x: translateX, + y: translateY + } = parsedTransform; + const x5 = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); + const y5 = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(" ") + 1)); + const w5 = scaleX ? rect.width / scaleX : rect.width; + const h5 = scaleY ? rect.height / scaleY : rect.height; + return { + width: w5, + height: h5, + top: y5, + right: x5 + w5, + bottom: y5 + h5, + left: x5 + }; +} +var defaultOptions2 = { + ignoreTransform: false +}; +function getClientRect(element, options) { + if (options === void 0) { + options = defaultOptions2; + } + let rect = element.getBoundingClientRect(); + if (options.ignoreTransform) { + const { + transform, + transformOrigin + } = getWindow(element).getComputedStyle(element); + if (transform) { + rect = inverseTransform(rect, transform, transformOrigin); + } + } + const { + top, + left, + width, + height, + bottom, + right + } = rect; + return { + top, + left, + width, + height, + bottom, + right + }; +} +function getTransformAgnosticClientRect(element) { + return getClientRect(element, { + ignoreTransform: true + }); +} +function getWindowClientRect(element) { + const width = element.innerWidth; + const height = element.innerHeight; + return { + top: 0, + left: 0, + right: width, + bottom: height, + width, + height + }; +} +function isFixed(node, computedStyle) { + if (computedStyle === void 0) { + computedStyle = getWindow(node).getComputedStyle(node); + } + return computedStyle.position === "fixed"; +} +function isScrollable(element, computedStyle) { + if (computedStyle === void 0) { + computedStyle = getWindow(element).getComputedStyle(element); + } + const overflowRegex = /(auto|scroll|overlay)/; + const properties2 = ["overflow", "overflowX", "overflowY"]; + return properties2.some((property) => { + const value = computedStyle[property]; + return typeof value === "string" ? overflowRegex.test(value) : false; + }); +} +function getScrollableAncestors(element, limit) { + const scrollParents = []; + function findScrollableAncestors(node) { + if (limit != null && scrollParents.length >= limit) { + return scrollParents; + } + if (!node) { + return scrollParents; + } + if (isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { + scrollParents.push(node.scrollingElement); + return scrollParents; + } + if (!isHTMLElement(node) || isSVGElement(node)) { + return scrollParents; + } + if (scrollParents.includes(node)) { + return scrollParents; + } + const computedStyle = getWindow(element).getComputedStyle(node); + if (node !== element) { + if (isScrollable(node, computedStyle)) { + scrollParents.push(node); + } + } + if (isFixed(node, computedStyle)) { + return scrollParents; + } + return findScrollableAncestors(node.parentNode); + } + if (!element) { + return scrollParents; + } + return findScrollableAncestors(element); +} +function getFirstScrollableAncestor(node) { + const [firstScrollableAncestor] = getScrollableAncestors(node, 1); + return firstScrollableAncestor != null ? firstScrollableAncestor : null; +} +function getScrollableElement(element) { + if (!canUseDOM || !element) { + return null; + } + if (isWindow(element)) { + return element; + } + if (!isNode(element)) { + return null; + } + if (isDocument(element) || element === getOwnerDocument(element).scrollingElement) { + return window; + } + if (isHTMLElement(element)) { + return element; + } + return null; +} +function getScrollXCoordinate(element) { + if (isWindow(element)) { + return element.scrollX; + } + return element.scrollLeft; +} +function getScrollYCoordinate(element) { + if (isWindow(element)) { + return element.scrollY; + } + return element.scrollTop; +} +function getScrollCoordinates(element) { + return { + x: getScrollXCoordinate(element), + y: getScrollYCoordinate(element) + }; +} +var Direction2; +(function(Direction3) { + Direction3[Direction3["Forward"] = 1] = "Forward"; + Direction3[Direction3["Backward"] = -1] = "Backward"; +})(Direction2 || (Direction2 = {})); +function isDocumentScrollingElement(element) { + if (!canUseDOM || !element) { + return false; + } + return element === document.scrollingElement; +} +function getScrollPosition(scrollingContainer) { + const minScroll = { + x: 0, + y: 0 + }; + const dimensions = isDocumentScrollingElement(scrollingContainer) ? { + height: window.innerHeight, + width: window.innerWidth + } : { + height: scrollingContainer.clientHeight, + width: scrollingContainer.clientWidth + }; + const maxScroll = { + x: scrollingContainer.scrollWidth - dimensions.width, + y: scrollingContainer.scrollHeight - dimensions.height + }; + const isTop = scrollingContainer.scrollTop <= minScroll.y; + const isLeft = scrollingContainer.scrollLeft <= minScroll.x; + const isBottom = scrollingContainer.scrollTop >= maxScroll.y; + const isRight = scrollingContainer.scrollLeft >= maxScroll.x; + return { + isTop, + isLeft, + isBottom, + isRight, + maxScroll, + minScroll + }; +} +var defaultThreshold = { + x: 0.2, + y: 0.2 +}; +function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { + let { + top, + left, + right, + bottom + } = _ref; + if (acceleration === void 0) { + acceleration = 10; + } + if (thresholdPercentage === void 0) { + thresholdPercentage = defaultThreshold; + } + const { + isTop, + isBottom, + isLeft, + isRight + } = getScrollPosition(scrollContainer); + const direction = { + x: 0, + y: 0 + }; + const speed = { + x: 0, + y: 0 + }; + const threshold = { + height: scrollContainerRect.height * thresholdPercentage.y, + width: scrollContainerRect.width * thresholdPercentage.x + }; + if (!isTop && top <= scrollContainerRect.top + threshold.height) { + direction.y = Direction2.Backward; + speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); + } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { + direction.y = Direction2.Forward; + speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); + } + if (!isRight && right >= scrollContainerRect.right - threshold.width) { + direction.x = Direction2.Forward; + speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); + } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { + direction.x = Direction2.Backward; + speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); + } + return { + direction, + speed + }; +} +function getScrollElementRect(element) { + if (element === document.scrollingElement) { + const { + innerWidth: innerWidth2, + innerHeight: innerHeight2 + } = window; + return { + top: 0, + left: 0, + right: innerWidth2, + bottom: innerHeight2, + width: innerWidth2, + height: innerHeight2 + }; + } + const { + top, + left, + right, + bottom + } = element.getBoundingClientRect(); + return { + top, + left, + right, + bottom, + width: element.clientWidth, + height: element.clientHeight + }; +} +function getScrollOffsets(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return add(acc, getScrollCoordinates(node)); + }, defaultCoordinates); +} +function getScrollXOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollXCoordinate(node); + }, 0); +} +function getScrollYOffset(scrollableAncestors) { + return scrollableAncestors.reduce((acc, node) => { + return acc + getScrollYCoordinate(node); + }, 0); +} +function scrollIntoViewIfNeeded(element, measure) { + if (measure === void 0) { + measure = getClientRect; + } + if (!element) { + return; + } + const { + top, + left, + bottom, + right + } = measure(element); + const firstScrollableAncestor = getFirstScrollableAncestor(element); + if (!firstScrollableAncestor) { + return; + } + if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { + element.scrollIntoView({ + block: "center", + inline: "center" + }); + } +} +var properties = [["x", ["left", "right"], getScrollXOffset], ["y", ["top", "bottom"], getScrollYOffset]]; +var Rect = class { + constructor(rect, element) { + this.rect = void 0; + this.width = void 0; + this.height = void 0; + this.top = void 0; + this.bottom = void 0; + this.right = void 0; + this.left = void 0; + const scrollableAncestors = getScrollableAncestors(element); + const scrollOffsets = getScrollOffsets(scrollableAncestors); + this.rect = { + ...rect + }; + this.width = rect.width; + this.height = rect.height; + for (const [axis, keys, getScrollOffset] of properties) { + for (const key2 of keys) { + Object.defineProperty(this, key2, { + get: () => { + const currentOffsets = getScrollOffset(scrollableAncestors); + const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; + return this.rect[key2] + scrollOffsetsDeltla; + }, + enumerable: true + }); + } + } + Object.defineProperty(this, "rect", { + enumerable: false + }); + } +}; +var Listeners = class { + constructor(target) { + this.target = void 0; + this.listeners = []; + this.removeAll = () => { + this.listeners.forEach((listener) => { + var _this$target; + return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); + }); + }; + this.target = target; + } + add(eventName, handler, options) { + var _this$target2; + (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); + this.listeners.push([eventName, handler, options]); + } +}; +function getEventListenerTarget(target) { + const { + EventTarget + } = getWindow(target); + return target instanceof EventTarget ? target : getOwnerDocument(target); +} +function hasExceededDistance(delta, measurement) { + const dx = Math.abs(delta.x); + const dy = Math.abs(delta.y); + if (typeof measurement === "number") { + return Math.sqrt(dx ** 2 + dy ** 2) > measurement; + } + if ("x" in measurement && "y" in measurement) { + return dx > measurement.x && dy > measurement.y; + } + if ("x" in measurement) { + return dx > measurement.x; + } + if ("y" in measurement) { + return dy > measurement.y; + } + return false; +} +var EventName; +(function(EventName2) { + EventName2["Click"] = "click"; + EventName2["DragStart"] = "dragstart"; + EventName2["Keydown"] = "keydown"; + EventName2["ContextMenu"] = "contextmenu"; + EventName2["Resize"] = "resize"; + EventName2["SelectionChange"] = "selectionchange"; + EventName2["VisibilityChange"] = "visibilitychange"; +})(EventName || (EventName = {})); +function preventDefault(event) { + event.preventDefault(); +} +function stopPropagation(event) { + event.stopPropagation(); +} +var KeyboardCode; +(function(KeyboardCode2) { + KeyboardCode2["Space"] = "Space"; + KeyboardCode2["Down"] = "ArrowDown"; + KeyboardCode2["Right"] = "ArrowRight"; + KeyboardCode2["Left"] = "ArrowLeft"; + KeyboardCode2["Up"] = "ArrowUp"; + KeyboardCode2["Esc"] = "Escape"; + KeyboardCode2["Enter"] = "Enter"; +})(KeyboardCode || (KeyboardCode = {})); +var defaultKeyboardCodes = { + start: [KeyboardCode.Space, KeyboardCode.Enter], + cancel: [KeyboardCode.Esc], + end: [KeyboardCode.Space, KeyboardCode.Enter] +}; +var defaultKeyboardCoordinateGetter = (event, _ref) => { + let { + currentCoordinates + } = _ref; + switch (event.code) { + case KeyboardCode.Right: + return { + ...currentCoordinates, + x: currentCoordinates.x + 25 + }; + case KeyboardCode.Left: + return { + ...currentCoordinates, + x: currentCoordinates.x - 25 + }; + case KeyboardCode.Down: + return { + ...currentCoordinates, + y: currentCoordinates.y + 25 + }; + case KeyboardCode.Up: + return { + ...currentCoordinates, + y: currentCoordinates.y - 25 + }; + } + return void 0; +}; +var KeyboardSensor = class { + constructor(props2) { + this.props = void 0; + this.autoScrollEnabled = false; + this.referenceCoordinates = void 0; + this.listeners = void 0; + this.windowListeners = void 0; + this.props = props2; + const { + event: { + target + } + } = props2; + this.props = props2; + this.listeners = new Listeners(getOwnerDocument(target)); + this.windowListeners = new Listeners(getWindow(target)); + this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.attach(); + } + attach() { + this.handleStart(); + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); + } + handleStart() { + const { + activeNode, + onStart + } = this.props; + const node = activeNode.node.current; + if (node) { + scrollIntoViewIfNeeded(node); + } + onStart(defaultCoordinates); + } + handleKeyDown(event) { + if (isKeyboardEvent(event)) { + const { + active, + context, + options + } = this.props; + const { + keyboardCodes = defaultKeyboardCodes, + coordinateGetter = defaultKeyboardCoordinateGetter, + scrollBehavior = "smooth" + } = options; + const { + code + } = event; + if (keyboardCodes.end.includes(code)) { + this.handleEnd(event); + return; + } + if (keyboardCodes.cancel.includes(code)) { + this.handleCancel(event); + return; + } + const { + collisionRect + } = context.current; + const currentCoordinates = collisionRect ? { + x: collisionRect.left, + y: collisionRect.top + } : defaultCoordinates; + if (!this.referenceCoordinates) { + this.referenceCoordinates = currentCoordinates; + } + const newCoordinates = coordinateGetter(event, { + active, + context: context.current, + currentCoordinates + }); + if (newCoordinates) { + const coordinatesDelta = subtract(newCoordinates, currentCoordinates); + const scrollDelta = { + x: 0, + y: 0 + }; + const { + scrollableAncestors + } = context.current; + for (const scrollContainer of scrollableAncestors) { + const direction = event.code; + const { + isTop, + isRight, + isLeft, + isBottom, + maxScroll, + minScroll + } = getScrollPosition(scrollContainer); + const scrollElementRect = getScrollElementRect(scrollContainer); + const clampedCoordinates = { + x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), + y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) + }; + const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; + const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; + if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { + const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; + const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; + if (canScrollToNewCoordinates && !coordinatesDelta.y) { + scrollContainer.scrollTo({ + left: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + if (canScrollToNewCoordinates) { + scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; + } else { + scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; + } + if (scrollDelta.x) { + scrollContainer.scrollBy({ + left: -scrollDelta.x, + behavior: scrollBehavior + }); + } + break; + } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { + const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; + const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; + if (canScrollToNewCoordinates && !coordinatesDelta.x) { + scrollContainer.scrollTo({ + top: newScrollCoordinates, + behavior: scrollBehavior + }); + return; + } + if (canScrollToNewCoordinates) { + scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; + } else { + scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; + } + if (scrollDelta.y) { + scrollContainer.scrollBy({ + top: -scrollDelta.y, + behavior: scrollBehavior + }); + } + break; + } + } + this.handleMove(event, add(subtract(newCoordinates, this.referenceCoordinates), scrollDelta)); + } + } + } + handleMove(event, coordinates) { + const { + onMove + } = this.props; + event.preventDefault(); + onMove(coordinates); + } + handleEnd(event) { + const { + onEnd + } = this.props; + event.preventDefault(); + this.detach(); + onEnd(); + } + handleCancel(event) { + const { + onCancel + } = this.props; + event.preventDefault(); + this.detach(); + onCancel(); + } + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); + } +}; +KeyboardSensor.activators = [{ + eventName: "onKeyDown", + handler: (event, _ref, _ref2) => { + let { + keyboardCodes = defaultKeyboardCodes, + onActivation + } = _ref; + let { + active + } = _ref2; + const { + code + } = event.nativeEvent; + if (keyboardCodes.start.includes(code)) { + const activator = active.activatorNode.current; + if (activator && event.target !== activator) { + return false; + } + event.preventDefault(); + onActivation == null ? void 0 : onActivation({ + event: event.nativeEvent + }); + return true; + } + return false; + } +}]; +function isDistanceConstraint(constraint) { + return Boolean(constraint && "distance" in constraint); +} +function isDelayConstraint(constraint) { + return Boolean(constraint && "delay" in constraint); +} +var AbstractPointerSensor = class { + constructor(props2, events2, listenerTarget) { + var _getEventCoordinates; + if (listenerTarget === void 0) { + listenerTarget = getEventListenerTarget(props2.event.target); + } + this.props = void 0; + this.events = void 0; + this.autoScrollEnabled = true; + this.document = void 0; + this.activated = false; + this.initialCoordinates = void 0; + this.timeoutId = null; + this.listeners = void 0; + this.documentListeners = void 0; + this.windowListeners = void 0; + this.props = props2; + this.events = events2; + const { + event + } = props2; + const { + target + } = event; + this.props = props2; + this.events = events2; + this.document = getOwnerDocument(target); + this.documentListeners = new Listeners(this.document); + this.listeners = new Listeners(listenerTarget); + this.windowListeners = new Listeners(getWindow(target)); + this.initialCoordinates = (_getEventCoordinates = getEventCoordinates(event)) != null ? _getEventCoordinates : defaultCoordinates; + this.handleStart = this.handleStart.bind(this); + this.handleMove = this.handleMove.bind(this); + this.handleEnd = this.handleEnd.bind(this); + this.handleCancel = this.handleCancel.bind(this); + this.handleKeydown = this.handleKeydown.bind(this); + this.removeTextSelection = this.removeTextSelection.bind(this); + this.attach(); + } + attach() { + const { + events: events2, + props: { + options: { + activationConstraint + } + } + } = this; + this.listeners.add(events2.move.name, this.handleMove, { + passive: false + }); + this.listeners.add(events2.end.name, this.handleEnd); + this.windowListeners.add(EventName.Resize, this.handleCancel); + this.windowListeners.add(EventName.DragStart, preventDefault); + this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); + this.windowListeners.add(EventName.ContextMenu, preventDefault); + this.documentListeners.add(EventName.Keydown, this.handleKeydown); + if (activationConstraint) { + if (isDistanceConstraint(activationConstraint)) { + return; + } + if (isDelayConstraint(activationConstraint)) { + this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); + return; + } + } + this.handleStart(); + } + detach() { + this.listeners.removeAll(); + this.windowListeners.removeAll(); + setTimeout(this.documentListeners.removeAll, 50); + if (this.timeoutId !== null) { + clearTimeout(this.timeoutId); + this.timeoutId = null; + } + } + handleStart() { + const { + initialCoordinates + } = this; + const { + onStart + } = this.props; + if (initialCoordinates) { + this.activated = true; + this.documentListeners.add(EventName.Click, stopPropagation, { + capture: true + }); + this.removeTextSelection(); + this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); + onStart(initialCoordinates); + } + } + handleMove(event) { + var _getEventCoordinates2; + const { + activated, + initialCoordinates, + props: props2 + } = this; + const { + onMove, + options: { + activationConstraint + } + } = props2; + if (!initialCoordinates) { + return; + } + const coordinates = (_getEventCoordinates2 = getEventCoordinates(event)) != null ? _getEventCoordinates2 : defaultCoordinates; + const delta = subtract(initialCoordinates, coordinates); + if (!activated && activationConstraint) { + if (isDelayConstraint(activationConstraint)) { + if (hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + return; + } + if (isDistanceConstraint(activationConstraint)) { + if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { + return this.handleCancel(); + } + if (hasExceededDistance(delta, activationConstraint.distance)) { + return this.handleStart(); + } + return; + } + } + if (event.cancelable) { + event.preventDefault(); + } + onMove(coordinates); + } + handleEnd() { + const { + onEnd + } = this.props; + this.detach(); + onEnd(); + } + handleCancel() { + const { + onCancel + } = this.props; + this.detach(); + onCancel(); + } + handleKeydown(event) { + if (event.code === KeyboardCode.Esc) { + this.handleCancel(); + } + } + removeTextSelection() { + var _this$document$getSel; + (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); + } +}; +var events = { + move: { + name: "pointermove" + }, + end: { + name: "pointerup" + } +}; +var PointerSensor = class extends AbstractPointerSensor { + constructor(props2) { + const { + event + } = props2; + const listenerTarget = getOwnerDocument(event.target); + super(props2, events, listenerTarget); + } +}; +PointerSensor.activators = [{ + eventName: "onPointerDown", + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + if (!event.isPrimary || event.button !== 0) { + return false; + } + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; +var events$1 = { + move: { + name: "mousemove" + }, + end: { + name: "mouseup" + } +}; +var MouseButton; +(function(MouseButton2) { + MouseButton2[MouseButton2["RightClick"] = 2] = "RightClick"; +})(MouseButton || (MouseButton = {})); +var MouseSensor = class extends AbstractPointerSensor { + constructor(props2) { + super(props2, events$1, getOwnerDocument(props2.event.target)); + } +}; +MouseSensor.activators = [{ + eventName: "onMouseDown", + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + if (event.button === MouseButton.RightClick) { + return false; + } + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; +var events$2 = { + move: { + name: "touchmove" + }, + end: { + name: "touchend" + } +}; +var TouchSensor = class extends AbstractPointerSensor { + constructor(props2) { + super(props2, events$2); + } + static setup() { + window.addEventListener(events$2.move.name, noop3, { + capture: false, + passive: false + }); + return function teardown() { + window.removeEventListener(events$2.move.name, noop3); + }; + function noop3() { + } + } +}; +TouchSensor.activators = [{ + eventName: "onTouchStart", + handler: (_ref, _ref2) => { + let { + nativeEvent: event + } = _ref; + let { + onActivation + } = _ref2; + const { + touches + } = event; + if (touches.length > 1) { + return false; + } + onActivation == null ? void 0 : onActivation({ + event + }); + return true; + } +}]; +var AutoScrollActivator; +(function(AutoScrollActivator2) { + AutoScrollActivator2[AutoScrollActivator2["Pointer"] = 0] = "Pointer"; + AutoScrollActivator2[AutoScrollActivator2["DraggableRect"] = 1] = "DraggableRect"; +})(AutoScrollActivator || (AutoScrollActivator = {})); +var TraversalOrder; +(function(TraversalOrder2) { + TraversalOrder2[TraversalOrder2["TreeOrder"] = 0] = "TreeOrder"; + TraversalOrder2[TraversalOrder2["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; +})(TraversalOrder || (TraversalOrder = {})); +function useAutoScroller(_ref) { + let { + acceleration, + activator = AutoScrollActivator.Pointer, + canScroll, + draggingRect, + enabled, + interval = 5, + order = TraversalOrder.TreeOrder, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects, + delta, + threshold + } = _ref; + const scrollIntent = useScrollIntent({ + delta, + disabled: !enabled + }); + const [setAutoScrollInterval, clearAutoScrollInterval] = useInterval(); + const scrollSpeed = _2({ + x: 0, + y: 0 + }); + const scrollDirection = _2({ + x: 0, + y: 0 + }); + const rect = F2(() => { + switch (activator) { + case AutoScrollActivator.Pointer: + return pointerCoordinates ? { + top: pointerCoordinates.y, + bottom: pointerCoordinates.y, + left: pointerCoordinates.x, + right: pointerCoordinates.x + } : null; + case AutoScrollActivator.DraggableRect: + return draggingRect; + } + }, [activator, draggingRect, pointerCoordinates]); + const scrollContainerRef = _2(null); + const autoScroll = T2(() => { + const scrollContainer = scrollContainerRef.current; + if (!scrollContainer) { + return; + } + const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; + const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; + scrollContainer.scrollBy(scrollLeft, scrollTop); + }, []); + const sortedScrollableAncestors = F2(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); + p2( + () => { + if (!enabled || !scrollableAncestors.length || !rect) { + clearAutoScrollInterval(); + return; + } + for (const scrollContainer of sortedScrollableAncestors) { + if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { + continue; + } + const index = scrollableAncestors.indexOf(scrollContainer); + const scrollContainerRect = scrollableAncestorRects[index]; + if (!scrollContainerRect) { + continue; + } + const { + direction, + speed + } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); + for (const axis of ["x", "y"]) { + if (!scrollIntent[axis][direction[axis]]) { + speed[axis] = 0; + direction[axis] = 0; + } + } + if (speed.x > 0 || speed.y > 0) { + clearAutoScrollInterval(); + scrollContainerRef.current = scrollContainer; + setAutoScrollInterval(autoScroll, interval); + scrollSpeed.current = speed; + scrollDirection.current = direction; + return; + } + } + scrollSpeed.current = { + x: 0, + y: 0 + }; + scrollDirection.current = { + x: 0, + y: 0 + }; + clearAutoScrollInterval(); }, - { - n: [ - "arrows clockwise", - "clockwise downwards and upwards open circle arrows" - ], - u: "1f503" + [ + acceleration, + autoScroll, + canScroll, + clearAutoScrollInterval, + enabled, + interval, + JSON.stringify(rect), + JSON.stringify(scrollIntent), + setAutoScrollInterval, + scrollableAncestors, + sortedScrollableAncestors, + scrollableAncestorRects, + JSON.stringify(threshold) + ] + ); +} +var defaultScrollIntent = { + x: { + [Direction2.Backward]: false, + [Direction2.Forward]: false + }, + y: { + [Direction2.Backward]: false, + [Direction2.Forward]: false + } +}; +function useScrollIntent(_ref2) { + let { + delta, + disabled + } = _ref2; + const previousDelta = usePrevious(delta); + return useLazyMemo((previousIntent) => { + if (disabled || !previousDelta || !previousIntent) { + return defaultScrollIntent; + } + const direction = { + x: Math.sign(delta.x - previousDelta.x), + y: Math.sign(delta.y - previousDelta.y) + }; + return { + x: { + [Direction2.Backward]: previousIntent.x[Direction2.Backward] || direction.x === -1, + [Direction2.Forward]: previousIntent.x[Direction2.Forward] || direction.x === 1 + }, + y: { + [Direction2.Backward]: previousIntent.y[Direction2.Backward] || direction.y === -1, + [Direction2.Forward]: previousIntent.y[Direction2.Forward] || direction.y === 1 + } + }; + }, [disabled, delta, previousDelta]); +} +function useCachedNode(draggableNodes, id2) { + const draggableNode = id2 !== null ? draggableNodes.get(id2) : void 0; + const node = draggableNode ? draggableNode.node.current : null; + return useLazyMemo((cachedNode) => { + var _ref; + if (id2 === null) { + return null; + } + return (_ref = node != null ? node : cachedNode) != null ? _ref : null; + }, [node, id2]); +} +function useCombineActivators(sensors, getSyntheticHandler) { + return F2(() => sensors.reduce((accumulator, sensor) => { + const { + sensor: Sensor + } = sensor; + const sensorActivators = Sensor.activators.map((activator) => ({ + eventName: activator.eventName, + handler: getSyntheticHandler(activator.handler, sensor) + })); + return [...accumulator, ...sensorActivators]; + }, []), [sensors, getSyntheticHandler]); +} +var MeasuringStrategy; +(function(MeasuringStrategy2) { + MeasuringStrategy2[MeasuringStrategy2["Always"] = 0] = "Always"; + MeasuringStrategy2[MeasuringStrategy2["BeforeDragging"] = 1] = "BeforeDragging"; + MeasuringStrategy2[MeasuringStrategy2["WhileDragging"] = 2] = "WhileDragging"; +})(MeasuringStrategy || (MeasuringStrategy = {})); +var MeasuringFrequency; +(function(MeasuringFrequency2) { + MeasuringFrequency2["Optimized"] = "optimized"; +})(MeasuringFrequency || (MeasuringFrequency = {})); +var defaultValue = /* @__PURE__ */ new Map(); +function useDroppableMeasuring(containers, _ref) { + let { + dragging, + dependencies, + config + } = _ref; + const [queue, setQueue] = h2(null); + const { + frequency, + measure, + strategy + } = config; + const containersRef = _2(containers); + const disabled = isDisabled(); + const disabledRef = useLatestValue(disabled); + const measureDroppableContainers = T2(function(ids2) { + if (ids2 === void 0) { + ids2 = []; + } + if (disabledRef.current) { + return; + } + setQueue((value) => { + if (value === null) { + return ids2; + } + return value.concat(ids2.filter((id2) => !value.includes(id2))); + }); + }, [disabledRef]); + const timeoutId = _2(null); + const droppableRects = useLazyMemo((previousValue) => { + if (disabled && !dragging) { + return defaultValue; + } + if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { + const map = /* @__PURE__ */ new Map(); + for (let container of containers) { + if (!container) { + continue; + } + if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { + map.set(container.id, container.rect.current); + continue; + } + const node = container.node.current; + const rect = node ? new Rect(measure(node), node) : null; + container.rect.current = rect; + if (rect) { + map.set(container.id, rect); + } + } + return map; + } + return previousValue; + }, [containers, queue, dragging, disabled, measure]); + p2(() => { + containersRef.current = containers; + }, [containers]); + p2( + () => { + if (disabled) { + return; + } + measureDroppableContainers(); }, - { - n: [ - "arrows counterclockwise", - "anticlockwise downwards and upwards open circle arrows" - ], - u: "1f504" + [dragging, disabled] + ); + p2( + () => { + if (queue && queue.length > 0) { + setQueue(null); + } }, - { n: ["back", "back with leftwards arrow above"], u: "1f519" }, - { n: ["end", "end with leftwards arrow above"], u: "1f51a" }, - { - n: ["on", "on with exclamation mark with left right arrow above"], - u: "1f51b" + [JSON.stringify(queue)] + ); + p2( + () => { + if (disabled || typeof frequency !== "number" || timeoutId.current !== null) { + return; + } + timeoutId.current = setTimeout(() => { + measureDroppableContainers(); + timeoutId.current = null; + }, frequency); }, - { n: ["soon", "soon with rightwards arrow above"], u: "1f51c" }, - { n: ["top", "top with upwards arrow above"], u: "1f51d" }, - { n: ["place of worship"], u: "1f6d0" }, - { n: ["atom symbol"], u: "269b-fe0f" }, - { n: ["om", "om symbol"], u: "1f549-fe0f" }, - { n: ["star of david"], u: "2721-fe0f" }, - { n: ["wheel of dharma"], u: "2638-fe0f" }, - { n: ["yin yang"], u: "262f-fe0f" }, - { n: ["latin cross"], u: "271d-fe0f" }, - { n: ["orthodox cross"], u: "2626-fe0f" }, - { n: ["star and crescent"], u: "262a-fe0f" }, - { n: ["peace symbol"], u: "262e-fe0f" }, - { n: ["menorah with nine branches"], u: "1f54e" }, - { n: ["six pointed star", "six pointed star with middle dot"], u: "1f52f" }, - { n: ["aries"], u: "2648" }, - { n: ["taurus"], u: "2649" }, - { n: ["gemini"], u: "264a" }, - { n: ["cancer"], u: "264b" }, - { n: ["leo"], u: "264c" }, - { n: ["virgo"], u: "264d" }, - { n: ["libra"], u: "264e" }, - { n: ["scorpius"], u: "264f" }, - { n: ["sagittarius"], u: "2650" }, - { n: ["capricorn"], u: "2651" }, - { n: ["aquarius"], u: "2652" }, - { n: ["pisces"], u: "2653" }, - { n: ["ophiuchus"], u: "26ce" }, - { n: ["twisted rightwards arrows"], u: "1f500" }, - { - n: ["repeat", "clockwise rightwards and leftwards open circle arrows"], - u: "1f501" + [frequency, disabled, measureDroppableContainers, ...dependencies] + ); + return { + droppableRects, + measureDroppableContainers, + measuringScheduled: queue != null + }; + function isDisabled() { + switch (strategy) { + case MeasuringStrategy.Always: + return false; + case MeasuringStrategy.BeforeDragging: + return dragging; + default: + return !dragging; + } + } +} +function useInitialValue(value, computeFn) { + return useLazyMemo((previousValue) => { + if (!value) { + return null; + } + if (previousValue) { + return previousValue; + } + return typeof computeFn === "function" ? computeFn(value) : value; + }, [computeFn, value]); +} +function useInitialRect(node, measure) { + return useInitialValue(node, measure); +} +function useMutationObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleMutations = useEvent(callback); + const mutationObserver = F2(() => { + if (disabled || typeof window === "undefined" || typeof window.MutationObserver === "undefined") { + return void 0; + } + const { + MutationObserver + } = window; + return new MutationObserver(handleMutations); + }, [handleMutations, disabled]); + p2(() => { + return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); + }, [mutationObserver]); + return mutationObserver; +} +function useResizeObserver(_ref) { + let { + callback, + disabled + } = _ref; + const handleResize = useEvent(callback); + const resizeObserver = F2( + () => { + if (disabled || typeof window === "undefined" || typeof window.ResizeObserver === "undefined") { + return void 0; + } + const { + ResizeObserver + } = window; + return new ResizeObserver(handleResize); }, - { - n: [ - "repeat one", - "clockwise rightwards and leftwards open circle arrows with circled one overlay" - ], - u: "1f502" + [disabled] + ); + p2(() => { + return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); + }, [resizeObserver]); + return resizeObserver; +} +function defaultMeasure(element) { + return new Rect(getClientRect(element), element); +} +function useRect(element, measure, fallbackRect) { + if (measure === void 0) { + measure = defaultMeasure; + } + const [rect, measureRect] = s2(reducer3, null); + const mutationObserver = useMutationObserver({ + callback(records) { + if (!element) { + return; + } + for (const record of records) { + const { + type, + target + } = record; + if (type === "childList" && target instanceof HTMLElement && target.contains(element)) { + measureRect(); + break; + } + } + } + }); + const resizeObserver = useResizeObserver({ + callback: measureRect + }); + useIsomorphicLayoutEffect(() => { + measureRect(); + if (element) { + resizeObserver == null ? void 0 : resizeObserver.observe(element); + mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { + childList: true, + subtree: true + }); + } else { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + mutationObserver == null ? void 0 : mutationObserver.disconnect(); + } + }, [element]); + return rect; + function reducer3(currentRect) { + if (!element) { + return null; + } + if (element.isConnected === false) { + var _ref; + return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; + } + const newRect = measure(element); + if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { + return currentRect; + } + return newRect; + } +} +function useRectDelta(rect) { + const initialRect = useInitialValue(rect); + return getRectDelta(rect, initialRect); +} +var defaultValue$1 = []; +function useScrollableAncestors(node) { + const previousNode = _2(node); + const ancestors = useLazyMemo((previousValue) => { + if (!node) { + return defaultValue$1; + } + if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { + return previousValue; + } + return getScrollableAncestors(node); + }, [node]); + p2(() => { + previousNode.current = node; + }, [node]); + return ancestors; +} +function useScrollOffsets(elements) { + const [scrollCoordinates, setScrollCoordinates] = h2(null); + const prevElements = _2(elements); + const handleScroll = T2((event) => { + const scrollingElement = getScrollableElement(event.target); + if (!scrollingElement) { + return; + } + setScrollCoordinates((scrollCoordinates2) => { + if (!scrollCoordinates2) { + return null; + } + scrollCoordinates2.set(scrollingElement, getScrollCoordinates(scrollingElement)); + return new Map(scrollCoordinates2); + }); + }, []); + p2(() => { + const previousElements = prevElements.current; + if (elements !== previousElements) { + cleanup(previousElements); + const entries = elements.map((element) => { + const scrollableElement = getScrollableElement(element); + if (scrollableElement) { + scrollableElement.addEventListener("scroll", handleScroll, { + passive: true + }); + return [scrollableElement, getScrollCoordinates(scrollableElement)]; + } + return null; + }).filter((entry) => entry != null); + setScrollCoordinates(entries.length ? new Map(entries) : null); + prevElements.current = elements; + } + return () => { + cleanup(elements); + cleanup(previousElements); + }; + function cleanup(elements2) { + elements2.forEach((element) => { + const scrollableElement = getScrollableElement(element); + scrollableElement == null ? void 0 : scrollableElement.removeEventListener("scroll", handleScroll); + }); + } + }, [handleScroll, elements]); + return F2(() => { + if (elements.length) { + return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => add(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); + } + return defaultCoordinates; + }, [elements, scrollCoordinates]); +} +function useScrollOffsetsDelta(scrollOffsets, dependencies) { + if (dependencies === void 0) { + dependencies = []; + } + const initialScrollOffsets = _2(null); + p2( + () => { + initialScrollOffsets.current = null; }, - { n: ["arrow forward", "black right-pointing triangle"], u: "25b6-fe0f" }, - { n: ["fast forward", "black right-pointing double triangle"], u: "23e9" }, - { - n: [ - "next track button", - "black right pointing double triangle with vertical bar" - ], - u: "23ed-fe0f" + dependencies + ); + p2(() => { + const hasScrollOffsets = scrollOffsets !== defaultCoordinates; + if (hasScrollOffsets && !initialScrollOffsets.current) { + initialScrollOffsets.current = scrollOffsets; + } + if (!hasScrollOffsets && initialScrollOffsets.current) { + initialScrollOffsets.current = null; + } + }, [scrollOffsets]); + return initialScrollOffsets.current ? subtract(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; +} +function useSensorSetup(sensors) { + p2( + () => { + if (!canUseDOM) { + return; + } + const teardownFns = sensors.map((_ref) => { + let { + sensor + } = _ref; + return sensor.setup == null ? void 0 : sensor.setup(); + }); + return () => { + for (const teardown of teardownFns) { + teardown == null ? void 0 : teardown(); + } + }; }, - { - n: [ - "play or pause button", - "black right pointing triangle with double vertical bar" - ], - u: "23ef-fe0f" + sensors.map((_ref2) => { + let { + sensor + } = _ref2; + return sensor; + }) + ); +} +function useSyntheticListeners(listeners, id2) { + return F2(() => { + return listeners.reduce((acc, _ref) => { + let { + eventName, + handler + } = _ref; + acc[eventName] = (event) => { + handler(event, id2); + }; + return acc; + }, {}); + }, [listeners, id2]); +} +function useWindowRect(element) { + return F2(() => element ? getWindowClientRect(element) : null, [element]); +} +var defaultValue$2 = []; +function useRects(elements, measure) { + if (measure === void 0) { + measure = getClientRect; + } + const [firstElement] = elements; + const windowRect = useWindowRect(firstElement ? getWindow(firstElement) : null); + const [rects, measureRects] = s2(reducer3, defaultValue$2); + const resizeObserver = useResizeObserver({ + callback: measureRects + }); + if (elements.length > 0 && rects === defaultValue$2) { + measureRects(); + } + useIsomorphicLayoutEffect(() => { + if (elements.length) { + elements.forEach((element) => resizeObserver == null ? void 0 : resizeObserver.observe(element)); + } else { + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + measureRects(); + } + }, [elements]); + return rects; + function reducer3() { + if (!elements.length) { + return defaultValue$2; + } + return elements.map((element) => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); + } +} +function getMeasurableNode(node) { + if (!node) { + return null; + } + if (node.children.length > 1) { + return node; + } + const firstChild = node.children[0]; + return isHTMLElement(firstChild) ? firstChild : node; +} +function useDragOverlayMeasuring(_ref) { + let { + measure + } = _ref; + const [rect, setRect] = h2(null); + const handleResize = T2((entries) => { + for (const { + target + } of entries) { + if (isHTMLElement(target)) { + setRect((rect2) => { + const newRect = measure(target); + return rect2 ? { + ...rect2, + width: newRect.width, + height: newRect.height + } : newRect; + }); + break; + } + } + }, [measure]); + const resizeObserver = useResizeObserver({ + callback: handleResize + }); + const handleNodeChange = T2((element) => { + const node = getMeasurableNode(element); + resizeObserver == null ? void 0 : resizeObserver.disconnect(); + if (node) { + resizeObserver == null ? void 0 : resizeObserver.observe(node); + } + setRect(node ? measure(node) : null); + }, [measure, resizeObserver]); + const [nodeRef, setRef] = useNodeRef(handleNodeChange); + return F2(() => ({ + nodeRef, + rect, + setRef + }), [rect, nodeRef, setRef]); +} +var defaultSensors = [{ + sensor: PointerSensor, + options: {} +}, { + sensor: KeyboardSensor, + options: {} +}]; +var defaultData = { + current: {} +}; +var defaultMeasuringConfiguration = { + draggable: { + measure: getTransformAgnosticClientRect + }, + droppable: { + measure: getTransformAgnosticClientRect, + strategy: MeasuringStrategy.WhileDragging, + frequency: MeasuringFrequency.Optimized + }, + dragOverlay: { + measure: getClientRect + } +}; +var DroppableContainersMap = class extends Map { + get(id2) { + var _super$get; + return id2 != null ? (_super$get = super.get(id2)) != null ? _super$get : void 0 : void 0; + } + toArray() { + return Array.from(this.values()); + } + getEnabled() { + return this.toArray().filter((_ref) => { + let { + disabled + } = _ref; + return !disabled; + }); + } + getNodeFor(id2) { + var _this$get$node$curren, _this$get; + return (_this$get$node$curren = (_this$get = this.get(id2)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : void 0; + } +}; +var defaultPublicContext = { + activatorEvent: null, + active: null, + activeNode: null, + activeNodeRect: null, + collisions: null, + containerNodeRect: null, + draggableNodes: /* @__PURE__ */ new Map(), + droppableRects: /* @__PURE__ */ new Map(), + droppableContainers: /* @__PURE__ */ new DroppableContainersMap(), + over: null, + dragOverlay: { + nodeRef: { + current: null }, - { n: ["arrow backward", "black left-pointing triangle"], u: "25c0-fe0f" }, - { n: ["rewind", "black left-pointing double triangle"], u: "23ea" }, - { - n: [ - "last track button", - "black left pointing double triangle with vertical bar" - ], - u: "23ee-fe0f" + rect: null, + setRef: noop + }, + scrollableAncestors: [], + scrollableAncestorRects: [], + measuringConfiguration: defaultMeasuringConfiguration, + measureDroppableContainers: noop, + windowRect: null, + measuringScheduled: false +}; +var defaultInternalContext = { + activatorEvent: null, + activators: [], + active: null, + activeNodeRect: null, + ariaDescribedById: { + draggable: "" + }, + dispatch: noop, + draggableNodes: /* @__PURE__ */ new Map(), + over: null, + measureDroppableContainers: noop +}; +var InternalContext = /* @__PURE__ */ F(defaultInternalContext); +var PublicContext = /* @__PURE__ */ F(defaultPublicContext); +function getInitialState() { + return { + draggable: { + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + nodes: /* @__PURE__ */ new Map(), + translate: { + x: 0, + y: 0 + } + }, + droppable: { + containers: new DroppableContainersMap() + } + }; +} +function reducer(state, action) { + switch (action.type) { + case Action.DragStart: + return { + ...state, + draggable: { + ...state.draggable, + initialCoordinates: action.initialCoordinates, + active: action.active + } + }; + case Action.DragMove: + if (!state.draggable.active) { + return state; + } + return { + ...state, + draggable: { + ...state.draggable, + translate: { + x: action.coordinates.x - state.draggable.initialCoordinates.x, + y: action.coordinates.y - state.draggable.initialCoordinates.y + } + } + }; + case Action.DragEnd: + case Action.DragCancel: + return { + ...state, + draggable: { + ...state.draggable, + active: null, + initialCoordinates: { + x: 0, + y: 0 + }, + translate: { + x: 0, + y: 0 + } + } + }; + case Action.RegisterDroppable: { + const { + element + } = action; + const { + id: id2 + } = element; + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id2, element); + return { + ...state, + droppable: { + ...state.droppable, + containers + } + }; + } + case Action.SetDroppableDisabled: { + const { + id: id2, + key: key2, + disabled + } = action; + const element = state.droppable.containers.get(id2); + if (!element || key2 !== element.key) { + return state; + } + const containers = new DroppableContainersMap(state.droppable.containers); + containers.set(id2, { + ...element, + disabled + }); + return { + ...state, + droppable: { + ...state.droppable, + containers + } + }; + } + case Action.UnregisterDroppable: { + const { + id: id2, + key: key2 + } = action; + const element = state.droppable.containers.get(id2); + if (!element || key2 !== element.key) { + return state; + } + const containers = new DroppableContainersMap(state.droppable.containers); + containers.delete(id2); + return { + ...state, + droppable: { + ...state.droppable, + containers + } + }; + } + default: { + return state; + } + } +} +function RestoreFocus(_ref) { + let { + disabled + } = _ref; + const { + active, + activatorEvent, + draggableNodes + } = q2(InternalContext); + const previousActivatorEvent = usePrevious(activatorEvent); + const previousActiveId = usePrevious(active == null ? void 0 : active.id); + p2(() => { + if (disabled) { + return; + } + if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { + if (!isKeyboardEvent(previousActivatorEvent)) { + return; + } + if (document.activeElement === previousActivatorEvent.target) { + return; + } + const draggableNode = draggableNodes.get(previousActiveId); + if (!draggableNode) { + return; + } + const { + activatorNode, + node + } = draggableNode; + if (!activatorNode.current && !node.current) { + return; + } + requestAnimationFrame(() => { + for (const element of [activatorNode.current, node.current]) { + if (!element) { + continue; + } + const focusableNode = findFirstFocusableNode(element); + if (focusableNode) { + focusableNode.focus(); + break; + } + } + }); + } + }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); + return null; +} +function applyModifiers(modifiers, _ref) { + let { + transform, + ...args + } = _ref; + return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { + return modifier({ + transform: accumulator, + ...args + }); + }, transform) : transform; +} +function useMeasuringConfiguration(config) { + return F2( + () => ({ + draggable: { + ...defaultMeasuringConfiguration.draggable, + ...config == null ? void 0 : config.draggable + }, + droppable: { + ...defaultMeasuringConfiguration.droppable, + ...config == null ? void 0 : config.droppable + }, + dragOverlay: { + ...defaultMeasuringConfiguration.dragOverlay, + ...config == null ? void 0 : config.dragOverlay + } + }), + [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay] + ); +} +function useLayoutShiftScrollCompensation(_ref) { + let { + activeNode, + measure, + initialRect, + config = true + } = _ref; + const initialized = _2(false); + const { + x: x5, + y: y5 + } = typeof config === "boolean" ? { + x: config, + y: config + } : config; + useIsomorphicLayoutEffect(() => { + const disabled = !x5 && !y5; + if (disabled || !activeNode) { + initialized.current = false; + return; + } + if (initialized.current || !initialRect) { + return; + } + const node = activeNode == null ? void 0 : activeNode.node.current; + if (!node || node.isConnected === false) { + return; + } + const rect = measure(node); + const rectDelta = getRectDelta(rect, initialRect); + if (!x5) { + rectDelta.x = 0; + } + if (!y5) { + rectDelta.y = 0; + } + initialized.current = true; + if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { + const firstScrollableAncestor = getFirstScrollableAncestor(node); + if (firstScrollableAncestor) { + firstScrollableAncestor.scrollBy({ + top: rectDelta.y, + left: rectDelta.x + }); + } + } + }, [activeNode, x5, y5, initialRect, measure]); +} +var ActiveDraggableContext = /* @__PURE__ */ F({ + ...defaultCoordinates, + scaleX: 1, + scaleY: 1 +}); +var Status; +(function(Status2) { + Status2[Status2["Uninitialized"] = 0] = "Uninitialized"; + Status2[Status2["Initializing"] = 1] = "Initializing"; + Status2[Status2["Initialized"] = 2] = "Initialized"; +})(Status || (Status = {})); +var DndContext = /* @__PURE__ */ x3(function DndContext2(_ref) { + var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; + let { + id: id2, + accessibility, + autoScroll = true, + children, + sensors = defaultSensors, + collisionDetection = rectIntersection, + measuring, + modifiers, + ...props2 + } = _ref; + const store = s2(reducer, void 0, getInitialState); + const [state, dispatch] = store; + const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); + const [status, setStatus] = h2(Status.Uninitialized); + const isInitialized = status === Status.Initialized; + const { + draggable: { + active: activeId, + nodes: draggableNodes, + translate }, - { n: ["arrow up small", "up-pointing small red triangle"], u: "1f53c" }, - { n: ["arrow double up", "black up-pointing double triangle"], u: "23eb" }, - { n: ["arrow down small", "down-pointing small red triangle"], u: "1f53d" }, - { - n: ["arrow double down", "black down-pointing double triangle"], - u: "23ec" + droppable: { + containers: droppableContainers + } + } = state; + const node = activeId ? draggableNodes.get(activeId) : null; + const activeRects = _2({ + initial: null, + translated: null + }); + const active = F2(() => { + var _node$data; + return activeId != null ? { + id: activeId, + data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, + rect: activeRects + } : null; + }, [activeId, node]); + const activeRef = _2(null); + const [activeSensor, setActiveSensor] = h2(null); + const [activatorEvent, setActivatorEvent] = h2(null); + const latestProps = useLatestValue(props2, Object.values(props2)); + const draggableDescribedById = useUniqueId("DndDescribedBy", id2); + const enabledDroppableContainers = F2(() => droppableContainers.getEnabled(), [droppableContainers]); + const measuringConfiguration = useMeasuringConfiguration(measuring); + const { + droppableRects, + measureDroppableContainers, + measuringScheduled + } = useDroppableMeasuring(enabledDroppableContainers, { + dragging: isInitialized, + dependencies: [translate.x, translate.y], + config: measuringConfiguration.droppable + }); + const activeNode = useCachedNode(draggableNodes, activeId); + const activationCoordinates = F2(() => activatorEvent ? getEventCoordinates(activatorEvent) : null, [activatorEvent]); + const autoScrollOptions = getAutoScrollerOptions(); + const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); + useLayoutShiftScrollCompensation({ + activeNode: activeId ? draggableNodes.get(activeId) : null, + config: autoScrollOptions.layoutShiftCompensation, + initialRect: initialActiveNodeRect, + measure: measuringConfiguration.draggable.measure + }); + const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); + const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); + const sensorContext = _2({ + activatorEvent: null, + active: null, + activeNode, + collisionRect: null, + collisions: null, + droppableRects, + draggableNodes, + draggingNode: null, + draggingNodeRect: null, + droppableContainers, + over: null, + scrollableAncestors: [], + scrollAdjustedTranslate: null + }); + const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); + const dragOverlay = useDragOverlayMeasuring({ + measure: measuringConfiguration.dragOverlay.measure + }); + const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; + const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; + const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); + const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); + const windowRect = useWindowRect(draggingNode ? getWindow(draggingNode) : null); + const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); + const scrollableAncestorRects = useRects(scrollableAncestors); + const modifiedTranslate = applyModifiers(modifiers, { + transform: { + x: translate.x - nodeRectDelta.x, + y: translate.y - nodeRectDelta.y, + scaleX: 1, + scaleY: 1 }, - { n: ["pause button", "double vertical bar"], u: "23f8-fe0f" }, - { n: ["stop button", "black square for stop"], u: "23f9-fe0f" }, - { n: ["record button", "black circle for record"], u: "23fa-fe0f" }, - { n: ["eject", "eject button"], u: "23cf-fe0f" }, - { n: ["cinema"], u: "1f3a6" }, - { n: ["low brightness", "low brightness symbol"], u: "1f505" }, - { n: ["high brightness", "high brightness symbol"], u: "1f506" }, - { n: ["signal strength", "antenna with bars"], u: "1f4f6" }, - { n: ["vibration mode"], u: "1f4f3" }, - { n: ["mobile phone off"], u: "1f4f4" }, - { n: ["female sign"], u: "2640-fe0f" }, - { n: ["male sign"], u: "2642-fe0f" }, - { n: ["transgender symbol"], u: "26a7-fe0f" }, - { n: ["heavy multiplication x"], u: "2716-fe0f" }, - { n: ["heavy plus sign"], u: "2795" }, - { n: ["heavy minus sign"], u: "2796" }, - { n: ["heavy division sign"], u: "2797" }, - { n: ["heavy equals sign"], u: "1f7f0" }, - { n: ["infinity"], u: "267e-fe0f" }, - { n: ["bangbang", "double exclamation mark"], u: "203c-fe0f" }, - { n: ["interrobang", "exclamation question mark"], u: "2049-fe0f" }, - { n: ["question", "black question mark ornament"], u: "2753" }, - { n: ["grey question", "white question mark ornament"], u: "2754" }, - { n: ["grey exclamation", "white exclamation mark ornament"], u: "2755" }, - { - n: [ - "exclamation", - "heavy exclamation mark", - "heavy exclamation mark symbol" - ], - u: "2757" + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect, + over: sensorContext.current.over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + windowRect + }); + const pointerCoordinates = activationCoordinates ? add(activationCoordinates, translate) : null; + const scrollOffsets = useScrollOffsets(scrollableAncestors); + const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); + const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); + const scrollAdjustedTranslate = add(modifiedTranslate, scrollAdjustment); + const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; + const collisions = active && collisionRect ? collisionDetection({ + active, + collisionRect, + droppableRects, + droppableContainers: enabledDroppableContainers, + pointerCoordinates + }) : null; + const overId = getFirstCollision(collisions, "id"); + const [over, setOver] = h2(null); + const appliedTranslate = usesDragOverlay ? modifiedTranslate : add(modifiedTranslate, activeNodeScrollDelta); + const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); + const instantiateSensor = T2( + (event, _ref2) => { + let { + sensor: Sensor, + options + } = _ref2; + if (activeRef.current == null) { + return; + } + const activeNode2 = draggableNodes.get(activeRef.current); + if (!activeNode2) { + return; + } + const activatorEvent2 = event.nativeEvent; + const sensorInstance = new Sensor({ + active: activeRef.current, + activeNode: activeNode2, + event: activatorEvent2, + options, + context: sensorContext, + onStart(initialCoordinates) { + const id3 = activeRef.current; + if (id3 == null) { + return; + } + const draggableNode = draggableNodes.get(id3); + if (!draggableNode) { + return; + } + const { + onDragStart + } = latestProps.current; + const event2 = { + active: { + id: id3, + data: draggableNode.data, + rect: activeRects + } + }; + dn(() => { + onDragStart == null ? void 0 : onDragStart(event2); + setStatus(Status.Initializing); + dispatch({ + type: Action.DragStart, + initialCoordinates, + active: id3 + }); + dispatchMonitorEvent({ + type: "onDragStart", + event: event2 + }); + }); + }, + onMove(coordinates) { + dispatch({ + type: Action.DragMove, + coordinates + }); + }, + onEnd: createHandler(Action.DragEnd), + onCancel: createHandler(Action.DragCancel) + }); + dn(() => { + setActiveSensor(sensorInstance); + setActivatorEvent(event.nativeEvent); + }); + function createHandler(type) { + return async function handler() { + const { + active: active2, + collisions: collisions2, + over: over2, + scrollAdjustedTranslate: scrollAdjustedTranslate2 + } = sensorContext.current; + let event2 = null; + if (active2 && scrollAdjustedTranslate2) { + const { + cancelDrop + } = latestProps.current; + event2 = { + activatorEvent: activatorEvent2, + active: active2, + collisions: collisions2, + delta: scrollAdjustedTranslate2, + over: over2 + }; + if (type === Action.DragEnd && typeof cancelDrop === "function") { + const shouldCancel = await Promise.resolve(cancelDrop(event2)); + if (shouldCancel) { + type = Action.DragCancel; + } + } + } + activeRef.current = null; + dn(() => { + dispatch({ + type + }); + setStatus(Status.Uninitialized); + setOver(null); + setActiveSensor(null); + setActivatorEvent(null); + const eventName = type === Action.DragEnd ? "onDragEnd" : "onDragCancel"; + if (event2) { + const handler2 = latestProps.current[eventName]; + handler2 == null ? void 0 : handler2(event2); + dispatchMonitorEvent({ + type: eventName, + event: event2 + }); + } + }); + }; + } }, - { n: ["wavy dash"], u: "3030-fe0f" }, - { n: ["currency exchange"], u: "1f4b1" }, - { n: ["heavy dollar sign"], u: "1f4b2" }, - { n: ["medical symbol", "staff of aesculapius"], u: "2695-fe0f" }, - { n: ["recycle", "black universal recycling symbol"], u: "267b-fe0f" }, - { n: ["fleur-de-lis", "fleur de lis"], u: "269c-fe0f" }, - { n: ["trident", "trident emblem"], u: "1f531" }, - { n: ["name badge"], u: "1f4db" }, - { n: ["beginner", "japanese symbol for beginner"], u: "1f530" }, - { n: ["o", "heavy large circle"], u: "2b55" }, - { n: ["white check mark", "white heavy check mark"], u: "2705" }, - { n: ["ballot box with check"], u: "2611-fe0f" }, - { n: ["heavy check mark"], u: "2714-fe0f" }, - { n: ["x", "cross mark"], u: "274c" }, - { n: ["negative squared cross mark"], u: "274e" }, - { n: ["curly loop"], u: "27b0" }, - { n: ["loop", "double curly loop"], u: "27bf" }, - { n: ["part alternation mark"], u: "303d-fe0f" }, - { n: ["eight spoked asterisk"], u: "2733-fe0f" }, - { n: ["eight pointed black star"], u: "2734-fe0f" }, - { n: ["sparkle"], u: "2747-fe0f" }, - { n: ["copyright", "copyright sign"], u: "00a9-fe0f" }, - { n: ["registered", "registered sign"], u: "00ae-fe0f" }, - { n: ["tm", "trade mark sign"], u: "2122-fe0f" }, - { n: ["hash", "hash key"], u: "0023-fe0f-20e3" }, - { n: ["keycap: *", "keycap star"], u: "002a-fe0f-20e3" }, - { n: ["zero", "keycap 0"], u: "0030-fe0f-20e3" }, - { n: ["one", "keycap 1"], u: "0031-fe0f-20e3" }, - { n: ["two", "keycap 2"], u: "0032-fe0f-20e3" }, - { n: ["three", "keycap 3"], u: "0033-fe0f-20e3" }, - { n: ["four", "keycap 4"], u: "0034-fe0f-20e3" }, - { n: ["five", "keycap 5"], u: "0035-fe0f-20e3" }, - { n: ["six", "keycap 6"], u: "0036-fe0f-20e3" }, - { n: ["seven", "keycap 7"], u: "0037-fe0f-20e3" }, - { n: ["eight", "keycap 8"], u: "0038-fe0f-20e3" }, - { n: ["nine", "keycap 9"], u: "0039-fe0f-20e3" }, - { n: ["keycap ten"], u: "1f51f" }, - { - n: ["capital abcd", "input symbol for latin capital letters"], - u: "1f520" + [draggableNodes] + ); + const bindActivatorToSensorInstantiator = T2((handler, sensor) => { + return (event, active2) => { + const nativeEvent = event.nativeEvent; + const activeDraggableNode = draggableNodes.get(active2); + if (activeRef.current !== null || !activeDraggableNode || nativeEvent.dndKit || nativeEvent.defaultPrevented) { + return; + } + const activationContext = { + active: activeDraggableNode + }; + const shouldActivate = handler(event, sensor.options, activationContext); + if (shouldActivate === true) { + nativeEvent.dndKit = { + capturedBy: sensor.sensor + }; + activeRef.current = active2; + instantiateSensor(event, sensor); + } + }; + }, [draggableNodes, instantiateSensor]); + const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); + useSensorSetup(sensors); + useIsomorphicLayoutEffect(() => { + if (activeNodeRect && status === Status.Initializing) { + setStatus(Status.Initialized); + } + }, [activeNodeRect, status]); + p2( + () => { + const { + onDragMove + } = latestProps.current; + const { + active: active2, + activatorEvent: activatorEvent2, + collisions: collisions2, + over: over2 + } = sensorContext.current; + if (!active2 || !activatorEvent2) { + return; + } + const event = { + active: active2, + activatorEvent: activatorEvent2, + collisions: collisions2, + delta: { + x: scrollAdjustedTranslate.x, + y: scrollAdjustedTranslate.y + }, + over: over2 + }; + dn(() => { + onDragMove == null ? void 0 : onDragMove(event); + dispatchMonitorEvent({ + type: "onDragMove", + event + }); + }); }, - { n: ["abcd", "input symbol for latin small letters"], u: "1f521" }, - { n: ["1234", "input symbol for numbers"], u: "1f522" }, - { n: ["symbols", "input symbol for symbols"], u: "1f523" }, - { n: ["abc", "input symbol for latin letters"], u: "1f524" }, - { n: ["a", "negative squared latin capital letter a"], u: "1f170-fe0f" }, - { n: ["ab", "negative squared ab"], u: "1f18e" }, - { n: ["b", "negative squared latin capital letter b"], u: "1f171-fe0f" }, - { n: ["cl", "squared cl"], u: "1f191" }, - { n: ["cool", "squared cool"], u: "1f192" }, - { n: ["free", "squared free"], u: "1f193" }, - { n: ["information source"], u: "2139-fe0f" }, - { n: ["id", "squared id"], u: "1f194" }, - { n: ["m", "circled latin capital letter m"], u: "24c2-fe0f" }, - { n: ["new", "squared new"], u: "1f195" }, - { n: ["ng", "squared ng"], u: "1f196" }, - { n: ["o2", "negative squared latin capital letter o"], u: "1f17e-fe0f" }, - { n: ["ok", "squared ok"], u: "1f197" }, - { - n: ["parking", "negative squared latin capital letter p"], - u: "1f17f-fe0f" + [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y] + ); + p2( + () => { + const { + active: active2, + activatorEvent: activatorEvent2, + collisions: collisions2, + droppableContainers: droppableContainers2, + scrollAdjustedTranslate: scrollAdjustedTranslate2 + } = sensorContext.current; + if (!active2 || activeRef.current == null || !activatorEvent2 || !scrollAdjustedTranslate2) { + return; + } + const { + onDragOver + } = latestProps.current; + const overContainer = droppableContainers2.get(overId); + const over2 = overContainer && overContainer.rect.current ? { + id: overContainer.id, + rect: overContainer.rect.current, + data: overContainer.data, + disabled: overContainer.disabled + } : null; + const event = { + active: active2, + activatorEvent: activatorEvent2, + collisions: collisions2, + delta: { + x: scrollAdjustedTranslate2.x, + y: scrollAdjustedTranslate2.y + }, + over: over2 + }; + dn(() => { + setOver(over2); + onDragOver == null ? void 0 : onDragOver(event); + dispatchMonitorEvent({ + type: "onDragOver", + event + }); + }); }, - { n: ["sos", "squared sos"], u: "1f198" }, - { n: ["up", "squared up with exclamation mark"], u: "1f199" }, - { n: ["vs", "squared vs"], u: "1f19a" }, - { n: ["koko", "squared katakana koko"], u: "1f201" }, - { n: ["sa", "squared katakana sa"], u: "1f202-fe0f" }, - { n: ["u6708", "squared cjk unified ideograph-6708"], u: "1f237-fe0f" }, - { n: ["u6709", "squared cjk unified ideograph-6709"], u: "1f236" }, - { n: ["u6307", "squared cjk unified ideograph-6307"], u: "1f22f" }, - { n: ["ideograph advantage", "circled ideograph advantage"], u: "1f250" }, - { n: ["u5272", "squared cjk unified ideograph-5272"], u: "1f239" }, - { n: ["u7121", "squared cjk unified ideograph-7121"], u: "1f21a" }, - { n: ["u7981", "squared cjk unified ideograph-7981"], u: "1f232" }, - { n: ["accept", "circled ideograph accept"], u: "1f251" }, - { n: ["u7533", "squared cjk unified ideograph-7533"], u: "1f238" }, - { n: ["u5408", "squared cjk unified ideograph-5408"], u: "1f234" }, - { n: ["u7a7a", "squared cjk unified ideograph-7a7a"], u: "1f233" }, - { - n: ["congratulations", "circled ideograph congratulation"], - u: "3297-fe0f" + [overId] + ); + useIsomorphicLayoutEffect(() => { + sensorContext.current = { + activatorEvent, + active, + activeNode, + collisionRect, + collisions, + droppableRects, + draggableNodes, + draggingNode, + draggingNodeRect, + droppableContainers, + over, + scrollableAncestors, + scrollAdjustedTranslate + }; + activeRects.current = { + initial: draggingNodeRect, + translated: collisionRect + }; + }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); + useAutoScroller({ + ...autoScrollOptions, + delta: translate, + draggingRect: collisionRect, + pointerCoordinates, + scrollableAncestors, + scrollableAncestorRects + }); + const publicContext = F2(() => { + const context = { + active, + activeNode, + activeNodeRect, + activatorEvent, + collisions, + containerNodeRect, + dragOverlay, + draggableNodes, + droppableContainers, + droppableRects, + over, + measureDroppableContainers, + scrollableAncestors, + scrollableAncestorRects, + measuringConfiguration, + measuringScheduled, + windowRect + }; + return context; + }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); + const internalContext = F2(() => { + const context = { + activatorEvent, + activators, + active, + activeNodeRect, + ariaDescribedById: { + draggable: draggableDescribedById + }, + dispatch, + draggableNodes, + over, + measureDroppableContainers + }; + return context; + }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); + return Cn.createElement(DndMonitorContext.Provider, { + value: registerMonitorListener + }, Cn.createElement(InternalContext.Provider, { + value: internalContext + }, Cn.createElement(PublicContext.Provider, { + value: publicContext + }, Cn.createElement(ActiveDraggableContext.Provider, { + value: transform + }, children)), Cn.createElement(RestoreFocus, { + disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false + })), Cn.createElement(Accessibility, { + ...accessibility, + hiddenTextDescribedById: draggableDescribedById + })); + function getAutoScrollerOptions() { + const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; + const autoScrollGloballyDisabled = typeof autoScroll === "object" ? autoScroll.enabled === false : autoScroll === false; + const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; + if (typeof autoScroll === "object") { + return { + ...autoScroll, + enabled + }; + } + return { + enabled + }; + } +}); +var NullContext = /* @__PURE__ */ F(null); +var defaultRole = "button"; +var ID_PREFIX = "Droppable"; +function useDraggable(_ref) { + let { + id: id2, + data: data2, + disabled = false, + attributes + } = _ref; + const key2 = useUniqueId(ID_PREFIX); + const { + activators, + activatorEvent, + active, + activeNodeRect, + ariaDescribedById, + draggableNodes, + over + } = q2(InternalContext); + const { + role = defaultRole, + roleDescription = "draggable", + tabIndex = 0 + } = attributes != null ? attributes : {}; + const isDragging = (active == null ? void 0 : active.id) === id2; + const transform = q2(isDragging ? ActiveDraggableContext : NullContext); + const [node, setNodeRef] = useNodeRef(); + const [activatorNode, setActivatorNodeRef] = useNodeRef(); + const listeners = useSyntheticListeners(activators, id2); + const dataRef = useLatestValue(data2); + useIsomorphicLayoutEffect( + () => { + draggableNodes.set(id2, { + id: id2, + key: key2, + node, + activatorNode, + data: dataRef + }); + return () => { + const node2 = draggableNodes.get(id2); + if (node2 && node2.key === key2) { + draggableNodes.delete(id2); + } + }; }, - { n: ["secret", "circled ideograph secret"], u: "3299-fe0f" }, - { n: ["u55b6", "squared cjk unified ideograph-55b6"], u: "1f23a" }, - { n: ["u6e80", "squared cjk unified ideograph-6e80"], u: "1f235" }, - { n: ["red circle", "large red circle"], u: "1f534" }, - { n: ["large orange circle"], u: "1f7e0" }, - { n: ["large yellow circle"], u: "1f7e1" }, - { n: ["large green circle"], u: "1f7e2" }, - { n: ["large blue circle"], u: "1f535" }, - { n: ["large purple circle"], u: "1f7e3" }, - { n: ["large brown circle"], u: "1f7e4" }, - { n: ["black circle", "medium black circle"], u: "26ab" }, - { n: ["white circle", "medium white circle"], u: "26aa" }, - { n: ["large red square"], u: "1f7e5" }, - { n: ["large orange square"], u: "1f7e7" }, - { n: ["large yellow square"], u: "1f7e8" }, - { n: ["large green square"], u: "1f7e9" }, - { n: ["large blue square"], u: "1f7e6" }, - { n: ["large purple square"], u: "1f7ea" }, - { n: ["large brown square"], u: "1f7eb" }, - { n: ["black large square"], u: "2b1b" }, - { n: ["white large square"], u: "2b1c" }, - { n: ["black medium square"], u: "25fc-fe0f" }, - { n: ["white medium square"], u: "25fb-fe0f" }, - { n: ["black medium small square"], u: "25fe" }, - { n: ["white medium small square"], u: "25fd" }, - { n: ["black small square"], u: "25aa-fe0f" }, - { n: ["white small square"], u: "25ab-fe0f" }, - { n: ["large orange diamond"], u: "1f536" }, - { n: ["large blue diamond"], u: "1f537" }, - { n: ["small orange diamond"], u: "1f538" }, - { n: ["small blue diamond"], u: "1f539" }, - { n: ["small red triangle", "up-pointing red triangle"], u: "1f53a" }, - { - n: ["small red triangle down", "down-pointing red triangle"], - u: "1f53b" + [draggableNodes, id2] + ); + const memoizedAttributes = F2(() => ({ + role, + tabIndex, + "aria-disabled": disabled, + "aria-pressed": isDragging && role === defaultRole ? true : void 0, + "aria-roledescription": roleDescription, + "aria-describedby": ariaDescribedById.draggable + }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); + return { + active, + activatorEvent, + activeNodeRect, + attributes: memoizedAttributes, + isDragging, + listeners: disabled ? void 0 : listeners, + node, + over, + setNodeRef, + setActivatorNodeRef, + transform + }; +} +function useDndContext() { + return q2(PublicContext); +} +var ID_PREFIX$1 = "Droppable"; +var defaultResizeObserverConfig = { + timeout: 25 +}; +function useDroppable(_ref) { + let { + data: data2, + disabled = false, + id: id2, + resizeObserverConfig + } = _ref; + const key2 = useUniqueId(ID_PREFIX$1); + const { + active, + dispatch, + over, + measureDroppableContainers + } = q2(InternalContext); + const previous = _2({ + disabled + }); + const resizeObserverConnected = _2(false); + const rect = _2(null); + const callbackId = _2(null); + const { + disabled: resizeObserverDisabled, + updateMeasurementsFor, + timeout: resizeObserverTimeout + } = { + ...defaultResizeObserverConfig, + ...resizeObserverConfig + }; + const ids2 = useLatestValue(updateMeasurementsFor != null ? updateMeasurementsFor : id2); + const handleResize = T2( + () => { + if (!resizeObserverConnected.current) { + resizeObserverConnected.current = true; + return; + } + if (callbackId.current != null) { + clearTimeout(callbackId.current); + } + callbackId.current = setTimeout(() => { + measureDroppableContainers(Array.isArray(ids2.current) ? ids2.current : [ids2.current]); + callbackId.current = null; + }, resizeObserverTimeout); }, - { n: ["diamond shape with a dot inside"], u: "1f4a0" }, - { n: ["radio button"], u: "1f518" }, - { n: ["white square button"], u: "1f533" }, - { n: ["black square button"], u: "1f532" } - ], - flags: [ - { n: ["chequered flag", "checkered flag"], u: "1f3c1" }, - { n: ["triangular flag on post"], u: "1f6a9" }, - { n: ["crossed flags"], u: "1f38c" }, - { n: ["waving black flag"], u: "1f3f4" }, - { n: ["white flag", "waving white flag"], u: "1f3f3-fe0f" }, - { n: ["rainbow flag", "rainbow-flag"], u: "1f3f3-fe0f-200d-1f308" }, - { n: ["transgender flag"], u: "1f3f3-fe0f-200d-26a7-fe0f" }, - { n: ["pirate flag"], u: "1f3f4-200d-2620-fe0f" }, - { n: ["flag-ac", "ascension island flag"], u: "1f1e6-1f1e8" }, - { n: ["flag-ad", "andorra flag"], u: "1f1e6-1f1e9" }, - { n: ["flag-ae", "united arab emirates flag"], u: "1f1e6-1f1ea" }, - { n: ["flag-af", "afghanistan flag"], u: "1f1e6-1f1eb" }, - { n: ["flag-ag", "antigua & barbuda flag"], u: "1f1e6-1f1ec" }, - { n: ["flag-ai", "anguilla flag"], u: "1f1e6-1f1ee" }, - { n: ["flag-al", "albania flag"], u: "1f1e6-1f1f1" }, - { n: ["flag-am", "armenia flag"], u: "1f1e6-1f1f2" }, - { n: ["flag-ao", "angola flag"], u: "1f1e6-1f1f4" }, - { n: ["flag-aq", "antarctica flag"], u: "1f1e6-1f1f6" }, - { n: ["flag-ar", "argentina flag"], u: "1f1e6-1f1f7" }, - { n: ["flag-as", "american samoa flag"], u: "1f1e6-1f1f8" }, - { n: ["flag-at", "austria flag"], u: "1f1e6-1f1f9" }, - { n: ["flag-au", "australia flag"], u: "1f1e6-1f1fa" }, - { n: ["flag-aw", "aruba flag"], u: "1f1e6-1f1fc" }, - { n: ["flag-ax", "\xE5land islands flag"], u: "1f1e6-1f1fd" }, - { n: ["flag-az", "azerbaijan flag"], u: "1f1e6-1f1ff" }, - { n: ["flag-ba", "bosnia & herzegovina flag"], u: "1f1e7-1f1e6" }, - { n: ["flag-bb", "barbados flag"], u: "1f1e7-1f1e7" }, - { n: ["flag-bd", "bangladesh flag"], u: "1f1e7-1f1e9" }, - { n: ["flag-be", "belgium flag"], u: "1f1e7-1f1ea" }, - { n: ["flag-bf", "burkina faso flag"], u: "1f1e7-1f1eb" }, - { n: ["flag-bg", "bulgaria flag"], u: "1f1e7-1f1ec" }, - { n: ["flag-bh", "bahrain flag"], u: "1f1e7-1f1ed" }, - { n: ["flag-bi", "burundi flag"], u: "1f1e7-1f1ee" }, - { n: ["flag-bj", "benin flag"], u: "1f1e7-1f1ef" }, - { n: ["flag-bl", "st. barth\xE9lemy flag"], u: "1f1e7-1f1f1" }, - { n: ["flag-bm", "bermuda flag"], u: "1f1e7-1f1f2" }, - { n: ["flag-bn", "brunei flag"], u: "1f1e7-1f1f3" }, - { n: ["flag-bo", "bolivia flag"], u: "1f1e7-1f1f4" }, - { n: ["flag-bq", "caribbean netherlands flag"], u: "1f1e7-1f1f6" }, - { n: ["flag-br", "brazil flag"], u: "1f1e7-1f1f7" }, - { n: ["flag-bs", "bahamas flag"], u: "1f1e7-1f1f8" }, - { n: ["flag-bt", "bhutan flag"], u: "1f1e7-1f1f9" }, - { n: ["flag-bv", "bouvet island flag"], u: "1f1e7-1f1fb" }, - { n: ["flag-bw", "botswana flag"], u: "1f1e7-1f1fc" }, - { n: ["flag-by", "belarus flag"], u: "1f1e7-1f1fe" }, - { n: ["flag-bz", "belize flag"], u: "1f1e7-1f1ff" }, - { n: ["flag-ca", "canada flag"], u: "1f1e8-1f1e6" }, - { n: ["flag-cc", "cocos (keeling) islands flag"], u: "1f1e8-1f1e8" }, - { n: ["flag-cd", "congo - kinshasa flag"], u: "1f1e8-1f1e9" }, - { n: ["flag-cf", "central african republic flag"], u: "1f1e8-1f1eb" }, - { n: ["flag-cg", "congo - brazzaville flag"], u: "1f1e8-1f1ec" }, - { n: ["flag-ch", "switzerland flag"], u: "1f1e8-1f1ed" }, - { n: ["flag-ci", "c\xF4te d\u2019ivoire flag"], u: "1f1e8-1f1ee" }, - { n: ["flag-ck", "cook islands flag"], u: "1f1e8-1f1f0" }, - { n: ["flag-cl", "chile flag"], u: "1f1e8-1f1f1" }, - { n: ["flag-cm", "cameroon flag"], u: "1f1e8-1f1f2" }, - { n: ["cn", "flag-cn", "china flag"], u: "1f1e8-1f1f3" }, - { n: ["flag-co", "colombia flag"], u: "1f1e8-1f1f4" }, - { n: ["flag-cp", "clipperton island flag"], u: "1f1e8-1f1f5" }, - { n: ["flag-cr", "costa rica flag"], u: "1f1e8-1f1f7" }, - { n: ["flag-cu", "cuba flag"], u: "1f1e8-1f1fa" }, - { n: ["flag-cv", "cape verde flag"], u: "1f1e8-1f1fb" }, - { n: ["flag-cw", "cura\xE7ao flag"], u: "1f1e8-1f1fc" }, - { n: ["flag-cx", "christmas island flag"], u: "1f1e8-1f1fd" }, - { n: ["flag-cy", "cyprus flag"], u: "1f1e8-1f1fe" }, - { n: ["flag-cz", "czechia flag"], u: "1f1e8-1f1ff" }, - { n: ["de", "flag-de", "germany flag"], u: "1f1e9-1f1ea" }, - { n: ["flag-dg", "diego garcia flag"], u: "1f1e9-1f1ec" }, - { n: ["flag-dj", "djibouti flag"], u: "1f1e9-1f1ef" }, - { n: ["flag-dk", "denmark flag"], u: "1f1e9-1f1f0" }, - { n: ["flag-dm", "dominica flag"], u: "1f1e9-1f1f2" }, - { n: ["flag-do", "dominican republic flag"], u: "1f1e9-1f1f4" }, - { n: ["flag-dz", "algeria flag"], u: "1f1e9-1f1ff" }, - { n: ["flag-ea", "ceuta & melilla flag"], u: "1f1ea-1f1e6" }, - { n: ["flag-ec", "ecuador flag"], u: "1f1ea-1f1e8" }, - { n: ["flag-ee", "estonia flag"], u: "1f1ea-1f1ea" }, - { n: ["flag-eg", "egypt flag"], u: "1f1ea-1f1ec" }, - { n: ["flag-eh", "western sahara flag"], u: "1f1ea-1f1ed" }, - { n: ["flag-er", "eritrea flag"], u: "1f1ea-1f1f7" }, - { n: ["es", "flag-es", "spain flag"], u: "1f1ea-1f1f8" }, - { n: ["flag-et", "ethiopia flag"], u: "1f1ea-1f1f9" }, - { n: ["flag-eu", "european union flag"], u: "1f1ea-1f1fa" }, - { n: ["flag-fi", "finland flag"], u: "1f1eb-1f1ee" }, - { n: ["flag-fj", "fiji flag"], u: "1f1eb-1f1ef" }, - { n: ["flag-fk", "falkland islands flag"], u: "1f1eb-1f1f0" }, - { n: ["flag-fm", "micronesia flag"], u: "1f1eb-1f1f2" }, - { n: ["flag-fo", "faroe islands flag"], u: "1f1eb-1f1f4" }, - { n: ["fr", "flag-fr", "france flag"], u: "1f1eb-1f1f7" }, - { n: ["flag-ga", "gabon flag"], u: "1f1ec-1f1e6" }, - { n: ["gb", "uk", "flag-gb", "united kingdom flag"], u: "1f1ec-1f1e7" }, - { n: ["flag-gd", "grenada flag"], u: "1f1ec-1f1e9" }, - { n: ["flag-ge", "georgia flag"], u: "1f1ec-1f1ea" }, - { n: ["flag-gf", "french guiana flag"], u: "1f1ec-1f1eb" }, - { n: ["flag-gg", "guernsey flag"], u: "1f1ec-1f1ec" }, - { n: ["flag-gh", "ghana flag"], u: "1f1ec-1f1ed" }, - { n: ["flag-gi", "gibraltar flag"], u: "1f1ec-1f1ee" }, - { n: ["flag-gl", "greenland flag"], u: "1f1ec-1f1f1" }, - { n: ["flag-gm", "gambia flag"], u: "1f1ec-1f1f2" }, - { n: ["flag-gn", "guinea flag"], u: "1f1ec-1f1f3" }, - { n: ["flag-gp", "guadeloupe flag"], u: "1f1ec-1f1f5" }, - { n: ["flag-gq", "equatorial guinea flag"], u: "1f1ec-1f1f6" }, - { n: ["flag-gr", "greece flag"], u: "1f1ec-1f1f7" }, - { - n: ["flag-gs", "south georgia & south sandwich islands flag"], - u: "1f1ec-1f1f8" + [resizeObserverTimeout] + ); + const resizeObserver = useResizeObserver({ + callback: handleResize, + disabled: resizeObserverDisabled || !active + }); + const handleNodeChange = T2((newElement, previousElement) => { + if (!resizeObserver) { + return; + } + if (previousElement) { + resizeObserver.unobserve(previousElement); + resizeObserverConnected.current = false; + } + if (newElement) { + resizeObserver.observe(newElement); + } + }, [resizeObserver]); + const [nodeRef, setNodeRef] = useNodeRef(handleNodeChange); + const dataRef = useLatestValue(data2); + p2(() => { + if (!resizeObserver || !nodeRef.current) { + return; + } + resizeObserver.disconnect(); + resizeObserverConnected.current = false; + resizeObserver.observe(nodeRef.current); + }, [nodeRef, resizeObserver]); + useIsomorphicLayoutEffect( + () => { + dispatch({ + type: Action.RegisterDroppable, + element: { + id: id2, + key: key2, + disabled, + node: nodeRef, + rect, + data: dataRef + } + }); + return () => dispatch({ + type: Action.UnregisterDroppable, + key: key2, + id: id2 + }); }, - { n: ["flag-gt", "guatemala flag"], u: "1f1ec-1f1f9" }, - { n: ["flag-gu", "guam flag"], u: "1f1ec-1f1fa" }, - { n: ["flag-gw", "guinea-bissau flag"], u: "1f1ec-1f1fc" }, - { n: ["flag-gy", "guyana flag"], u: "1f1ec-1f1fe" }, - { n: ["flag-hk", "hong kong sar china flag"], u: "1f1ed-1f1f0" }, - { n: ["flag-hm", "heard & mcdonald islands flag"], u: "1f1ed-1f1f2" }, - { n: ["flag-hn", "honduras flag"], u: "1f1ed-1f1f3" }, - { n: ["flag-hr", "croatia flag"], u: "1f1ed-1f1f7" }, - { n: ["flag-ht", "haiti flag"], u: "1f1ed-1f1f9" }, - { n: ["flag-hu", "hungary flag"], u: "1f1ed-1f1fa" }, - { n: ["flag-ic", "canary islands flag"], u: "1f1ee-1f1e8" }, - { n: ["flag-id", "indonesia flag"], u: "1f1ee-1f1e9" }, - { n: ["flag-ie", "ireland flag"], u: "1f1ee-1f1ea" }, - { n: ["flag-il", "israel flag"], u: "1f1ee-1f1f1" }, - { n: ["flag-im", "isle of man flag"], u: "1f1ee-1f1f2" }, - { n: ["flag-in", "india flag"], u: "1f1ee-1f1f3" }, - { n: ["flag-io", "british indian ocean territory flag"], u: "1f1ee-1f1f4" }, - { n: ["flag-iq", "iraq flag"], u: "1f1ee-1f1f6" }, - { n: ["flag-ir", "iran flag"], u: "1f1ee-1f1f7" }, - { n: ["flag-is", "iceland flag"], u: "1f1ee-1f1f8" }, - { n: ["it", "flag-it", "italy flag"], u: "1f1ee-1f1f9" }, - { n: ["flag-je", "jersey flag"], u: "1f1ef-1f1ea" }, - { n: ["flag-jm", "jamaica flag"], u: "1f1ef-1f1f2" }, - { n: ["flag-jo", "jordan flag"], u: "1f1ef-1f1f4" }, - { n: ["jp", "flag-jp", "japan flag"], u: "1f1ef-1f1f5" }, - { n: ["flag-ke", "kenya flag"], u: "1f1f0-1f1ea" }, - { n: ["flag-kg", "kyrgyzstan flag"], u: "1f1f0-1f1ec" }, - { n: ["flag-kh", "cambodia flag"], u: "1f1f0-1f1ed" }, - { n: ["flag-ki", "kiribati flag"], u: "1f1f0-1f1ee" }, - { n: ["flag-km", "comoros flag"], u: "1f1f0-1f1f2" }, - { n: ["flag-kn", "st. kitts & nevis flag"], u: "1f1f0-1f1f3" }, - { n: ["flag-kp", "north korea flag"], u: "1f1f0-1f1f5" }, - { n: ["kr", "flag-kr", "south korea flag"], u: "1f1f0-1f1f7" }, - { n: ["flag-kw", "kuwait flag"], u: "1f1f0-1f1fc" }, - { n: ["flag-ky", "cayman islands flag"], u: "1f1f0-1f1fe" }, - { n: ["flag-kz", "kazakhstan flag"], u: "1f1f0-1f1ff" }, - { n: ["flag-la", "laos flag"], u: "1f1f1-1f1e6" }, - { n: ["flag-lb", "lebanon flag"], u: "1f1f1-1f1e7" }, - { n: ["flag-lc", "st. lucia flag"], u: "1f1f1-1f1e8" }, - { n: ["flag-li", "liechtenstein flag"], u: "1f1f1-1f1ee" }, - { n: ["flag-lk", "sri lanka flag"], u: "1f1f1-1f1f0" }, - { n: ["flag-lr", "liberia flag"], u: "1f1f1-1f1f7" }, - { n: ["flag-ls", "lesotho flag"], u: "1f1f1-1f1f8" }, - { n: ["flag-lt", "lithuania flag"], u: "1f1f1-1f1f9" }, - { n: ["flag-lu", "luxembourg flag"], u: "1f1f1-1f1fa" }, - { n: ["flag-lv", "latvia flag"], u: "1f1f1-1f1fb" }, - { n: ["flag-ly", "libya flag"], u: "1f1f1-1f1fe" }, - { n: ["flag-ma", "morocco flag"], u: "1f1f2-1f1e6" }, - { n: ["flag-mc", "monaco flag"], u: "1f1f2-1f1e8" }, - { n: ["flag-md", "moldova flag"], u: "1f1f2-1f1e9" }, - { n: ["flag-me", "montenegro flag"], u: "1f1f2-1f1ea" }, - { n: ["flag-mf", "st. martin flag"], u: "1f1f2-1f1eb" }, - { n: ["flag-mg", "madagascar flag"], u: "1f1f2-1f1ec" }, - { n: ["flag-mh", "marshall islands flag"], u: "1f1f2-1f1ed" }, - { n: ["flag-mk", "north macedonia flag"], u: "1f1f2-1f1f0" }, - { n: ["flag-ml", "mali flag"], u: "1f1f2-1f1f1" }, - { n: ["flag-mm", "myanmar (burma) flag"], u: "1f1f2-1f1f2" }, - { n: ["flag-mn", "mongolia flag"], u: "1f1f2-1f1f3" }, - { n: ["flag-mo", "macao sar china flag"], u: "1f1f2-1f1f4" }, - { n: ["flag-mp", "northern mariana islands flag"], u: "1f1f2-1f1f5" }, - { n: ["flag-mq", "martinique flag"], u: "1f1f2-1f1f6" }, - { n: ["flag-mr", "mauritania flag"], u: "1f1f2-1f1f7" }, - { n: ["flag-ms", "montserrat flag"], u: "1f1f2-1f1f8" }, - { n: ["flag-mt", "malta flag"], u: "1f1f2-1f1f9" }, - { n: ["flag-mu", "mauritius flag"], u: "1f1f2-1f1fa" }, - { n: ["flag-mv", "maldives flag"], u: "1f1f2-1f1fb" }, - { n: ["flag-mw", "malawi flag"], u: "1f1f2-1f1fc" }, - { n: ["flag-mx", "mexico flag"], u: "1f1f2-1f1fd" }, - { n: ["flag-my", "malaysia flag"], u: "1f1f2-1f1fe" }, - { n: ["flag-mz", "mozambique flag"], u: "1f1f2-1f1ff" }, - { n: ["flag-na", "namibia flag"], u: "1f1f3-1f1e6" }, - { n: ["flag-nc", "new caledonia flag"], u: "1f1f3-1f1e8" }, - { n: ["flag-ne", "niger flag"], u: "1f1f3-1f1ea" }, - { n: ["flag-nf", "norfolk island flag"], u: "1f1f3-1f1eb" }, - { n: ["flag-ng", "nigeria flag"], u: "1f1f3-1f1ec" }, - { n: ["flag-ni", "nicaragua flag"], u: "1f1f3-1f1ee" }, - { n: ["flag-nl", "netherlands flag"], u: "1f1f3-1f1f1" }, - { n: ["flag-no", "norway flag"], u: "1f1f3-1f1f4" }, - { n: ["flag-np", "nepal flag"], u: "1f1f3-1f1f5" }, - { n: ["flag-nr", "nauru flag"], u: "1f1f3-1f1f7" }, - { n: ["flag-nu", "niue flag"], u: "1f1f3-1f1fa" }, - { n: ["flag-nz", "new zealand flag"], u: "1f1f3-1f1ff" }, - { n: ["flag-om", "oman flag"], u: "1f1f4-1f1f2" }, - { n: ["flag-pa", "panama flag"], u: "1f1f5-1f1e6" }, - { n: ["flag-pe", "peru flag"], u: "1f1f5-1f1ea" }, - { n: ["flag-pf", "french polynesia flag"], u: "1f1f5-1f1eb" }, - { n: ["flag-pg", "papua new guinea flag"], u: "1f1f5-1f1ec" }, - { n: ["flag-ph", "philippines flag"], u: "1f1f5-1f1ed" }, - { n: ["flag-pk", "pakistan flag"], u: "1f1f5-1f1f0" }, - { n: ["flag-pl", "poland flag"], u: "1f1f5-1f1f1" }, - { n: ["flag-pm", "st. pierre & miquelon flag"], u: "1f1f5-1f1f2" }, - { n: ["flag-pn", "pitcairn islands flag"], u: "1f1f5-1f1f3" }, - { n: ["flag-pr", "puerto rico flag"], u: "1f1f5-1f1f7" }, - { n: ["flag-ps", "palestinian territories flag"], u: "1f1f5-1f1f8" }, - { n: ["flag-pt", "portugal flag"], u: "1f1f5-1f1f9" }, - { n: ["flag-pw", "palau flag"], u: "1f1f5-1f1fc" }, - { n: ["flag-py", "paraguay flag"], u: "1f1f5-1f1fe" }, - { n: ["flag-qa", "qatar flag"], u: "1f1f6-1f1e6" }, - { n: ["flag-re", "r\xE9union flag"], u: "1f1f7-1f1ea" }, - { n: ["flag-ro", "romania flag"], u: "1f1f7-1f1f4" }, - { n: ["flag-rs", "serbia flag"], u: "1f1f7-1f1f8" }, - { n: ["ru", "flag-ru", "russia flag"], u: "1f1f7-1f1fa" }, - { n: ["flag-rw", "rwanda flag"], u: "1f1f7-1f1fc" }, - { n: ["flag-sa", "saudi arabia flag"], u: "1f1f8-1f1e6" }, - { n: ["flag-sb", "solomon islands flag"], u: "1f1f8-1f1e7" }, - { n: ["flag-sc", "seychelles flag"], u: "1f1f8-1f1e8" }, - { n: ["flag-sd", "sudan flag"], u: "1f1f8-1f1e9" }, - { n: ["flag-se", "sweden flag"], u: "1f1f8-1f1ea" }, - { n: ["flag-sg", "singapore flag"], u: "1f1f8-1f1ec" }, - { n: ["flag-sh", "st. helena flag"], u: "1f1f8-1f1ed" }, - { n: ["flag-si", "slovenia flag"], u: "1f1f8-1f1ee" }, - { n: ["flag-sj", "svalbard & jan mayen flag"], u: "1f1f8-1f1ef" }, - { n: ["flag-sk", "slovakia flag"], u: "1f1f8-1f1f0" }, - { n: ["flag-sl", "sierra leone flag"], u: "1f1f8-1f1f1" }, - { n: ["flag-sm", "san marino flag"], u: "1f1f8-1f1f2" }, - { n: ["flag-sn", "senegal flag"], u: "1f1f8-1f1f3" }, - { n: ["flag-so", "somalia flag"], u: "1f1f8-1f1f4" }, - { n: ["flag-sr", "suriname flag"], u: "1f1f8-1f1f7" }, - { n: ["flag-ss", "south sudan flag"], u: "1f1f8-1f1f8" }, - { n: ["flag-st", "s\xE3o tom\xE9 & pr\xEDncipe flag"], u: "1f1f8-1f1f9" }, - { n: ["flag-sv", "el salvador flag"], u: "1f1f8-1f1fb" }, - { n: ["flag-sx", "sint maarten flag"], u: "1f1f8-1f1fd" }, - { n: ["flag-sy", "syria flag"], u: "1f1f8-1f1fe" }, - { n: ["flag-sz", "eswatini flag"], u: "1f1f8-1f1ff" }, - { n: ["flag-ta", "tristan da cunha flag"], u: "1f1f9-1f1e6" }, - { n: ["flag-tc", "turks & caicos islands flag"], u: "1f1f9-1f1e8" }, - { n: ["flag-td", "chad flag"], u: "1f1f9-1f1e9" }, - { n: ["flag-tf", "french southern territories flag"], u: "1f1f9-1f1eb" }, - { n: ["flag-tg", "togo flag"], u: "1f1f9-1f1ec" }, - { n: ["flag-th", "thailand flag"], u: "1f1f9-1f1ed" }, - { n: ["flag-tj", "tajikistan flag"], u: "1f1f9-1f1ef" }, - { n: ["flag-tk", "tokelau flag"], u: "1f1f9-1f1f0" }, - { n: ["flag-tl", "timor-leste flag"], u: "1f1f9-1f1f1" }, - { n: ["flag-tm", "turkmenistan flag"], u: "1f1f9-1f1f2" }, - { n: ["flag-tn", "tunisia flag"], u: "1f1f9-1f1f3" }, - { n: ["flag-to", "tonga flag"], u: "1f1f9-1f1f4" }, - { n: ["flag-tr", "turkey flag"], u: "1f1f9-1f1f7" }, - { n: ["flag-tt", "trinidad & tobago flag"], u: "1f1f9-1f1f9" }, - { n: ["flag-tv", "tuvalu flag"], u: "1f1f9-1f1fb" }, - { n: ["flag-tw", "taiwan flag"], u: "1f1f9-1f1fc" }, - { n: ["flag-tz", "tanzania flag"], u: "1f1f9-1f1ff" }, - { n: ["flag-ua", "ukraine flag"], u: "1f1fa-1f1e6" }, - { n: ["flag-ug", "uganda flag"], u: "1f1fa-1f1ec" }, - { n: ["flag-um", "u.s. outlying islands flag"], u: "1f1fa-1f1f2" }, - { n: ["flag-un", "united nations flag"], u: "1f1fa-1f1f3" }, - { n: ["us", "flag-us", "united states flag"], u: "1f1fa-1f1f8" }, - { n: ["flag-uy", "uruguay flag"], u: "1f1fa-1f1fe" }, - { n: ["flag-uz", "uzbekistan flag"], u: "1f1fa-1f1ff" }, - { n: ["flag-va", "vatican city flag"], u: "1f1fb-1f1e6" }, - { n: ["flag-vc", "st. vincent & grenadines flag"], u: "1f1fb-1f1e8" }, - { n: ["flag-ve", "venezuela flag"], u: "1f1fb-1f1ea" }, - { n: ["flag-vg", "british virgin islands flag"], u: "1f1fb-1f1ec" }, - { n: ["flag-vi", "u.s. virgin islands flag"], u: "1f1fb-1f1ee" }, - { n: ["flag-vn", "vietnam flag"], u: "1f1fb-1f1f3" }, - { n: ["flag-vu", "vanuatu flag"], u: "1f1fb-1f1fa" }, - { n: ["flag-wf", "wallis & futuna flag"], u: "1f1fc-1f1eb" }, - { n: ["flag-ws", "samoa flag"], u: "1f1fc-1f1f8" }, - { n: ["flag-xk", "kosovo flag"], u: "1f1fd-1f1f0" }, - { n: ["flag-ye", "yemen flag"], u: "1f1fe-1f1ea" }, - { n: ["flag-yt", "mayotte flag"], u: "1f1fe-1f1f9" }, - { n: ["flag-za", "south africa flag"], u: "1f1ff-1f1e6" }, - { n: ["flag-zm", "zambia flag"], u: "1f1ff-1f1f2" }, - { n: ["flag-zw", "zimbabwe flag"], u: "1f1ff-1f1fc" }, - { - n: ["england flag", "flag-england"], - u: "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f" + [id2] + ); + p2(() => { + if (disabled !== previous.current.disabled) { + dispatch({ + type: Action.SetDroppableDisabled, + id: id2, + key: key2, + disabled + }); + previous.current.disabled = disabled; + } + }, [id2, key2, disabled, dispatch]); + return { + active, + rect, + isOver: (over == null ? void 0 : over.id) === id2, + node: nodeRef, + over, + setNodeRef + }; +} +function AnimationManager(_ref) { + let { + animation, + children + } = _ref; + const [clonedChildren, setClonedChildren] = h2(null); + const [element, setElement] = h2(null); + const previousChildren = usePrevious(children); + if (!children && !clonedChildren && previousChildren) { + setClonedChildren(previousChildren); + } + useIsomorphicLayoutEffect(() => { + if (!element) { + return; + } + const key2 = clonedChildren == null ? void 0 : clonedChildren.key; + const id2 = clonedChildren == null ? void 0 : clonedChildren.props.id; + if (key2 == null || id2 == null) { + setClonedChildren(null); + return; + } + Promise.resolve(animation(id2, element)).then(() => { + setClonedChildren(null); + }); + }, [animation, clonedChildren, element]); + return Cn.createElement(Cn.Fragment, null, children, clonedChildren ? sn(clonedChildren, { + ref: setElement + }) : null); +} +var defaultTransform = { + x: 0, + y: 0, + scaleX: 1, + scaleY: 1 +}; +function NullifiedContextProvider(_ref) { + let { + children + } = _ref; + return Cn.createElement(InternalContext.Provider, { + value: defaultInternalContext + }, Cn.createElement(ActiveDraggableContext.Provider, { + value: defaultTransform + }, children)); +} +var baseStyles = { + position: "fixed", + touchAction: "none" +}; +var defaultTransition = (activatorEvent) => { + const isKeyboardActivator = isKeyboardEvent(activatorEvent); + return isKeyboardActivator ? "transform 250ms ease" : void 0; +}; +var PositionedOverlay = /* @__PURE__ */ k3((_ref, ref2) => { + let { + as, + activatorEvent, + adjustScale: adjustScale2, + children, + className, + rect, + style, + transform, + transition = defaultTransition + } = _ref; + if (!rect) { + return null; + } + const scaleAdjustedTransform = adjustScale2 ? transform : { + ...transform, + scaleX: 1, + scaleY: 1 + }; + const styles2 = { + ...baseStyles, + width: rect.width, + height: rect.height, + top: rect.top, + left: rect.left, + transform: CSS.Transform.toString(scaleAdjustedTransform), + transformOrigin: adjustScale2 && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : void 0, + transition: typeof transition === "function" ? transition(activatorEvent) : transition, + ...style + }; + return Cn.createElement(as, { + className, + style: styles2, + ref: ref2 + }, children); +}); +var defaultDropAnimationSideEffects = (options) => (_ref) => { + let { + active, + dragOverlay + } = _ref; + const originalStyles = {}; + const { + styles: styles2, + className + } = options; + if (styles2 != null && styles2.active) { + for (const [key2, value] of Object.entries(styles2.active)) { + if (value === void 0) { + continue; + } + originalStyles[key2] = active.node.style.getPropertyValue(key2); + active.node.style.setProperty(key2, value); + } + } + if (styles2 != null && styles2.dragOverlay) { + for (const [key2, value] of Object.entries(styles2.dragOverlay)) { + if (value === void 0) { + continue; + } + dragOverlay.node.style.setProperty(key2, value); + } + } + if (className != null && className.active) { + active.node.classList.add(className.active); + } + if (className != null && className.dragOverlay) { + dragOverlay.node.classList.add(className.dragOverlay); + } + return function cleanup() { + for (const [key2, value] of Object.entries(originalStyles)) { + active.node.style.setProperty(key2, value); + } + if (className != null && className.active) { + active.node.classList.remove(className.active); + } + }; +}; +var defaultKeyframeResolver = (_ref2) => { + let { + transform: { + initial, + final + } + } = _ref2; + return [{ + transform: CSS.Transform.toString(initial) + }, { + transform: CSS.Transform.toString(final) + }]; +}; +var defaultDropAnimationConfiguration = { + duration: 250, + easing: "ease", + keyframes: defaultKeyframeResolver, + sideEffects: /* @__PURE__ */ defaultDropAnimationSideEffects({ + styles: { + active: { + opacity: "0" + } + } + }) +}; +function useDropAnimation(_ref3) { + let { + config, + draggableNodes, + droppableContainers, + measuringConfiguration + } = _ref3; + return useEvent((id2, node) => { + if (config === null) { + return; + } + const activeDraggable = draggableNodes.get(id2); + if (!activeDraggable) { + return; + } + const activeNode = activeDraggable.node.current; + if (!activeNode) { + return; + } + const measurableNode = getMeasurableNode(node); + if (!measurableNode) { + return; + } + const { + transform + } = getWindow(node).getComputedStyle(node); + const parsedTransform = parseTransform(transform); + if (!parsedTransform) { + return; + } + const animation = typeof config === "function" ? config : createDefaultDropAnimation(config); + scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); + return animation({ + active: { + id: id2, + data: activeDraggable.data, + node: activeNode, + rect: measuringConfiguration.draggable.measure(activeNode) + }, + draggableNodes, + dragOverlay: { + node, + rect: measuringConfiguration.dragOverlay.measure(measurableNode) + }, + droppableContainers, + measuringConfiguration, + transform: parsedTransform + }); + }); +} +function createDefaultDropAnimation(options) { + const { + duration, + easing, + sideEffects, + keyframes + } = { + ...defaultDropAnimationConfiguration, + ...options + }; + return (_ref4) => { + let { + active, + dragOverlay, + transform, + ...rest + } = _ref4; + if (!duration) { + return; + } + const delta = { + x: dragOverlay.rect.left - active.rect.left, + y: dragOverlay.rect.top - active.rect.top + }; + const scale = { + scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, + scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 + }; + const finalTransform = { + x: transform.x - delta.x, + y: transform.y - delta.y, + ...scale + }; + const animationKeyframes = keyframes({ + ...rest, + active, + dragOverlay, + transform: { + initial: transform, + final: finalTransform + } + }); + const [firstKeyframe] = animationKeyframes; + const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; + if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { + return; + } + const cleanup = sideEffects == null ? void 0 : sideEffects({ + active, + dragOverlay, + ...rest + }); + const animation = dragOverlay.node.animate(animationKeyframes, { + duration, + easing, + fill: "forwards" + }); + return new Promise((resolve) => { + animation.onfinish = () => { + cleanup == null ? void 0 : cleanup(); + resolve(); + }; + }); + }; +} +var key = 0; +function useKey(id2) { + return F2(() => { + if (id2 == null) { + return; + } + key++; + return key; + }, [id2]); +} +var DragOverlay = /* @__PURE__ */ Cn.memo((_ref) => { + let { + adjustScale: adjustScale2 = false, + children, + dropAnimation: dropAnimationConfig, + style, + transition, + modifiers, + wrapperElement = "div", + className, + zIndex = 999 + } = _ref; + const { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggableNodes, + droppableContainers, + dragOverlay, + over, + measuringConfiguration, + scrollableAncestors, + scrollableAncestorRects, + windowRect + } = useDndContext(); + const transform = q2(ActiveDraggableContext); + const key2 = useKey(active == null ? void 0 : active.id); + const modifiedTransform = applyModifiers(modifiers, { + activatorEvent, + active, + activeNodeRect, + containerNodeRect, + draggingNodeRect: dragOverlay.rect, + over, + overlayNodeRect: dragOverlay.rect, + scrollableAncestors, + scrollableAncestorRects, + transform, + windowRect + }); + const initialRect = useInitialValue(activeNodeRect); + const dropAnimation = useDropAnimation({ + config: dropAnimationConfig, + draggableNodes, + droppableContainers, + measuringConfiguration + }); + const ref2 = initialRect ? dragOverlay.setRef : void 0; + return Cn.createElement(NullifiedContextProvider, null, Cn.createElement(AnimationManager, { + animation: dropAnimation + }, active && key2 ? Cn.createElement(PositionedOverlay, { + key: key2, + id: active.id, + ref: ref2, + as: wrapperElement, + activatorEvent, + adjustScale: adjustScale2, + className, + transition, + rect: initialRect, + style: { + zIndex, + ...style }, - { - n: ["scotland flag", "flag-scotland"], - u: "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f" + transform: modifiedTransform + }, children) : null)); +}); + +// node_modules/@dnd-kit/sortable/dist/sortable.esm.js +function arrayMove(array, from, to) { + const newArray = array.slice(); + newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]); + return newArray; +} +function getSortedRects(items, rects) { + return items.reduce((accumulator, id2, index) => { + const rect = rects.get(id2); + if (rect) { + accumulator[index] = rect; + } + return accumulator; + }, Array(items.length)); +} +function isValidIndex(index) { + return index !== null && index >= 0; +} +function itemsEqual(a5, b4) { + if (a5 === b4) { + return true; + } + if (a5.length !== b4.length) { + return false; + } + for (let i4 = 0; i4 < a5.length; i4++) { + if (a5[i4] !== b4[i4]) { + return false; + } + } + return true; +} +function normalizeDisabled(disabled) { + if (typeof disabled === "boolean") { + return { + draggable: disabled, + droppable: disabled + }; + } + return disabled; +} +var defaultScale = { + scaleX: 1, + scaleY: 1 +}; +var horizontalListSortingStrategy = (_ref) => { + var _rects$activeIndex; + let { + rects, + activeNodeRect: fallbackActiveRect, + activeIndex, + overIndex, + index + } = _ref; + const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; + if (!activeNodeRect) { + return null; + } + const itemGap = getItemGap(rects, index, activeIndex); + if (index === activeIndex) { + const newIndexRect = rects[overIndex]; + if (!newIndexRect) { + return null; + } + return { + x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left, + y: 0, + ...defaultScale + }; + } + if (index > activeIndex && index <= overIndex) { + return { + x: -activeNodeRect.width - itemGap, + y: 0, + ...defaultScale + }; + } + if (index < activeIndex && index >= overIndex) { + return { + x: activeNodeRect.width + itemGap, + y: 0, + ...defaultScale + }; + } + return { + x: 0, + y: 0, + ...defaultScale + }; +}; +function getItemGap(rects, index, activeIndex) { + const currentRect = rects[index]; + const previousRect = rects[index - 1]; + const nextRect = rects[index + 1]; + if (!currentRect || !previousRect && !nextRect) { + return 0; + } + if (activeIndex < index) { + return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width); + } + return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width); +} +var rectSortingStrategy = (_ref) => { + let { + rects, + activeIndex, + overIndex, + index + } = _ref; + const newRects = arrayMove(rects, overIndex, activeIndex); + const oldRect = rects[index]; + const newRect = newRects[index]; + if (!newRect || !oldRect) { + return null; + } + return { + x: newRect.left - oldRect.left, + y: newRect.top - oldRect.top, + scaleX: newRect.width / oldRect.width, + scaleY: newRect.height / oldRect.height + }; +}; +var defaultScale$1 = { + scaleX: 1, + scaleY: 1 +}; +var verticalListSortingStrategy = (_ref) => { + var _rects$activeIndex; + let { + activeIndex, + activeNodeRect: fallbackActiveRect, + index, + rects, + overIndex + } = _ref; + const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; + if (!activeNodeRect) { + return null; + } + if (index === activeIndex) { + const overIndexRect = rects[overIndex]; + if (!overIndexRect) { + return null; + } + return { + x: 0, + y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top, + ...defaultScale$1 + }; + } + const itemGap = getItemGap$1(rects, index, activeIndex); + if (index > activeIndex && index <= overIndex) { + return { + x: 0, + y: -activeNodeRect.height - itemGap, + ...defaultScale$1 + }; + } + if (index < activeIndex && index >= overIndex) { + return { + x: 0, + y: activeNodeRect.height + itemGap, + ...defaultScale$1 + }; + } + return { + x: 0, + y: 0, + ...defaultScale$1 + }; +}; +function getItemGap$1(clientRects, index, activeIndex) { + const currentRect = clientRects[index]; + const previousRect = clientRects[index - 1]; + const nextRect = clientRects[index + 1]; + if (!currentRect) { + return 0; + } + if (activeIndex < index) { + return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0; + } + return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0; +} +var ID_PREFIX2 = "Sortable"; +var Context = /* @__PURE__ */ Cn.createContext({ + activeIndex: -1, + containerId: ID_PREFIX2, + disableTransforms: false, + items: [], + overIndex: -1, + useDragOverlay: false, + sortedRects: [], + strategy: rectSortingStrategy, + disabled: { + draggable: false, + droppable: false + } +}); +function SortableContext(_ref) { + let { + children, + id: id2, + items: userDefinedItems, + strategy = rectSortingStrategy, + disabled: disabledProp = false + } = _ref; + const { + active, + dragOverlay, + droppableRects, + over, + measureDroppableContainers + } = useDndContext(); + const containerId = useUniqueId(ID_PREFIX2, id2); + const useDragOverlay = Boolean(dragOverlay.rect !== null); + const items = F2(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]); + const isDragging = active != null; + const activeIndex = active ? items.indexOf(active.id) : -1; + const overIndex = over ? items.indexOf(over.id) : -1; + const previousItemsRef = _2(items); + const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current); + const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged; + const disabled = normalizeDisabled(disabledProp); + useIsomorphicLayoutEffect(() => { + if (itemsHaveChanged && isDragging) { + measureDroppableContainers(items); + } + }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]); + p2(() => { + previousItemsRef.current = items; + }, [items]); + const contextValue = F2( + () => ({ + activeIndex, + containerId, + disabled, + disableTransforms, + items, + overIndex, + useDragOverlay, + sortedRects: getSortedRects(items, droppableRects), + strategy + }), + [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy] + ); + return Cn.createElement(Context.Provider, { + value: contextValue + }, children); +} +var defaultNewIndexGetter = (_ref) => { + let { + id: id2, + items, + activeIndex, + overIndex + } = _ref; + return arrayMove(items, activeIndex, overIndex).indexOf(id2); +}; +var defaultAnimateLayoutChanges = (_ref2) => { + let { + containerId, + isSorting, + wasDragging, + index, + items, + newIndex, + previousItems, + previousContainerId, + transition + } = _ref2; + if (!transition || !wasDragging) { + return false; + } + if (previousItems !== items && index === newIndex) { + return false; + } + if (isSorting) { + return true; + } + return newIndex !== index && containerId === previousContainerId; +}; +var defaultTransition2 = { + duration: 200, + easing: "ease" +}; +var transitionProperty = "transform"; +var disabledTransition = /* @__PURE__ */ CSS.Transition.toString({ + property: transitionProperty, + duration: 0, + easing: "linear" +}); +var defaultAttributes = { + roleDescription: "sortable" +}; +function useDerivedTransform(_ref) { + let { + disabled, + index, + node, + rect + } = _ref; + const [derivedTransform, setDerivedtransform] = h2(null); + const previousIndex = _2(index); + useIsomorphicLayoutEffect(() => { + if (!disabled && index !== previousIndex.current && node.current) { + const initial = rect.current; + if (initial) { + const current2 = getClientRect(node.current, { + ignoreTransform: true + }); + const delta = { + x: initial.left - current2.left, + y: initial.top - current2.top, + scaleX: initial.width / current2.width, + scaleY: initial.height / current2.height + }; + if (delta.x || delta.y) { + setDerivedtransform(delta); + } + } + } + if (index !== previousIndex.current) { + previousIndex.current = index; + } + }, [disabled, index, node, rect]); + p2(() => { + if (derivedTransform) { + setDerivedtransform(null); + } + }, [derivedTransform]); + return derivedTransform; +} +function useSortable(_ref) { + let { + animateLayoutChanges: animateLayoutChanges4 = defaultAnimateLayoutChanges, + attributes: userDefinedAttributes, + disabled: localDisabled, + data: customData, + getNewIndex = defaultNewIndexGetter, + id: id2, + strategy: localStrategy, + resizeObserverConfig, + transition = defaultTransition2 + } = _ref; + const { + items, + containerId, + activeIndex, + disabled: globalDisabled, + disableTransforms, + sortedRects, + overIndex, + useDragOverlay, + strategy: globalStrategy + } = q2(Context); + const disabled = normalizeLocalDisabled(localDisabled, globalDisabled); + const index = items.indexOf(id2); + const data2 = F2(() => ({ + sortable: { + containerId, + index, + items }, - { - n: ["wales flag", "flag-wales"], - u: "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f" + ...customData + }), [containerId, customData, index, items]); + const itemsAfterCurrentSortable = F2(() => items.slice(items.indexOf(id2)), [items, id2]); + const { + rect, + node, + isOver, + setNodeRef: setDroppableNodeRef + } = useDroppable({ + id: id2, + data: data2, + disabled: disabled.droppable, + resizeObserverConfig: { + updateMeasurementsFor: itemsAfterCurrentSortable, + ...resizeObserverConfig + } + }); + const { + active, + activatorEvent, + activeNodeRect, + attributes, + setNodeRef: setDraggableNodeRef, + listeners, + isDragging, + over, + setActivatorNodeRef, + transform + } = useDraggable({ + id: id2, + data: data2, + attributes: { + ...defaultAttributes, + ...userDefinedAttributes + }, + disabled: disabled.draggable + }); + const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef); + const isSorting = Boolean(active); + const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex); + const shouldDisplaceDragSource = !useDragOverlay && isDragging; + const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null; + const strategy = localStrategy != null ? localStrategy : globalStrategy; + const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ + rects: sortedRects, + activeNodeRect, + activeIndex, + overIndex, + index + }) : null; + const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ + id: id2, + items, + activeIndex, + overIndex + }) : index; + const activeId = active == null ? void 0 : active.id; + const previous = _2({ + activeId, + items, + newIndex, + containerId + }); + const itemsHaveChanged = items !== previous.current.items; + const shouldAnimateLayoutChanges = animateLayoutChanges4({ + active, + containerId, + isDragging, + isSorting, + id: id2, + index, + items, + newIndex: previous.current.newIndex, + previousItems: previous.current.items, + previousContainerId: previous.current.containerId, + transition, + wasDragging: previous.current.activeId != null + }); + const derivedTransform = useDerivedTransform({ + disabled: !shouldAnimateLayoutChanges, + index, + node, + rect + }); + p2(() => { + if (isSorting && previous.current.newIndex !== newIndex) { + previous.current.newIndex = newIndex; + } + if (containerId !== previous.current.containerId) { + previous.current.containerId = containerId; + } + if (items !== previous.current.items) { + previous.current.items = items; + } + }, [isSorting, newIndex, containerId, items]); + p2(() => { + if (activeId === previous.current.activeId) { + return; + } + if (activeId && !previous.current.activeId) { + previous.current.activeId = activeId; + return; + } + const timeoutId = setTimeout(() => { + previous.current.activeId = activeId; + }, 50); + return () => clearTimeout(timeoutId); + }, [activeId]); + return { + active, + activeIndex, + attributes, + data: data2, + rect, + index, + newIndex, + items, + isOver, + isSorting, + isDragging, + listeners, + node, + overIndex, + over, + setNodeRef, + setActivatorNodeRef, + setDroppableNodeRef, + setDraggableNodeRef, + transform: derivedTransform != null ? derivedTransform : finalTransform, + transition: getTransition() + }; + function getTransition() { + if (derivedTransform || itemsHaveChanged && previous.current.newIndex === index) { + return disabledTransition; + } + if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) { + return void 0; + } + if (isSorting || shouldAnimateLayoutChanges) { + return CSS.Transition.toString({ + ...transition, + property: transitionProperty + }); + } + return void 0; + } +} +function normalizeLocalDisabled(localDisabled, globalDisabled) { + var _localDisabled$dragga, _localDisabled$droppa; + if (typeof localDisabled === "boolean") { + return { + draggable: localDisabled, + droppable: false + }; + } + return { + draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, + droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable + }; +} +function hasSortableData(entry) { + if (!entry) { + return false; + } + const data2 = entry.data.current; + if (data2 && "sortable" in data2 && typeof data2.sortable === "object" && "containerId" in data2.sortable && "items" in data2.sortable && "index" in data2.sortable) { + return true; + } + return false; +} +var directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left]; +var sortableKeyboardCoordinates = (event, _ref) => { + let { + context: { + active, + collisionRect, + droppableRects, + droppableContainers, + over, + scrollableAncestors + } + } = _ref; + if (directions.includes(event.code)) { + event.preventDefault(); + if (!active || !collisionRect) { + return; + } + const filteredContainers = []; + droppableContainers.getEnabled().forEach((entry) => { + if (!entry || entry != null && entry.disabled) { + return; + } + const rect = droppableRects.get(entry.id); + if (!rect) { + return; + } + switch (event.code) { + case KeyboardCode.Down: + if (collisionRect.top < rect.top) { + filteredContainers.push(entry); + } + break; + case KeyboardCode.Up: + if (collisionRect.top > rect.top) { + filteredContainers.push(entry); + } + break; + case KeyboardCode.Left: + if (collisionRect.left > rect.left) { + filteredContainers.push(entry); + } + break; + case KeyboardCode.Right: + if (collisionRect.left < rect.left) { + filteredContainers.push(entry); + } + break; + } + }); + const collisions = closestCorners({ + active, + collisionRect, + droppableRects, + droppableContainers: filteredContainers, + pointerCoordinates: null + }); + let closestId = getFirstCollision(collisions, "id"); + if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) { + closestId = collisions[1].id; + } + if (closestId != null) { + const activeDroppable = droppableContainers.get(active.id); + const newDroppable = droppableContainers.get(closestId); + const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null; + const newNode = newDroppable == null ? void 0 : newDroppable.node.current; + if (newNode && newRect && activeDroppable && newDroppable) { + const newScrollAncestors = getScrollableAncestors(newNode); + const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element); + const hasSameContainer = isSameContainer(activeDroppable, newDroppable); + const isAfterActive = isAfter(activeDroppable, newDroppable); + const offset2 = hasDifferentScrollAncestors || !hasSameContainer ? { + x: 0, + y: 0 + } : { + x: isAfterActive ? collisionRect.width - newRect.width : 0, + y: isAfterActive ? collisionRect.height - newRect.height : 0 + }; + const rectCoordinates = { + x: newRect.left, + y: newRect.top + }; + const newCoordinates = offset2.x && offset2.y ? rectCoordinates : subtract(rectCoordinates, offset2); + return newCoordinates; + } + } + } + return void 0; +}; +function isSameContainer(a5, b4) { + if (!hasSortableData(a5) || !hasSortableData(b4)) { + return false; + } + return a5.data.current.sortable.containerId === b4.data.current.sortable.containerId; +} +function isAfter(a5, b4) { + if (!hasSortableData(a5) || !hasSortableData(b4)) { + return false; + } + if (!isSameContainer(a5, b4)) { + return false; + } + return a5.data.current.sortable.index < b4.data.current.sortable.index; +} + +// src/dispatch/mdb.ts +var import_lodash2 = __toESM(require_lodash()); +var import_obsidian8 = require("obsidian"); + +// src/utils/contexts/file.ts +var renameRowForFile = (folder, filePath, toFilePath) => { + return { + ...folder, + rows: folder.rows.map( + (f4) => f4.File == filePath ? { ...f4, File: toFilePath } : f4 + ) + }; +}; +var removeRowForFile = (folder, filePath) => { + return { + ...folder, + rows: folder.rows.filter( + (f4) => f4.File != filePath + ) + }; +}; +var removeRowsForFile = (folder, filePaths) => { + return { + ...folder, + rows: folder.rows.filter( + (f4) => !filePaths.includes(f4.File) + ) + }; +}; +var reorderRowsForFile = (folder, filePaths, index) => { + const rows = folder.rows.filter( + (f4) => filePaths.includes(f4.File) + ); + return { + ...folder, + rows: insertMulti(folder.rows.filter( + (f4) => !filePaths.includes(f4.File) + ), index, rows) + }; +}; + +// node_modules/date-fns/esm/_lib/toInteger/index.js +function toInteger(dirtyNumber) { + if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { + return NaN; + } + var number = Number(dirtyNumber); + if (isNaN(number)) { + return number; + } + return number < 0 ? Math.ceil(number) : Math.floor(number); +} + +// node_modules/date-fns/esm/_lib/requiredArgs/index.js +function requiredArgs(required, args) { + if (args.length < required) { + throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present"); + } +} + +// node_modules/date-fns/esm/toDate/index.js +function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof5(obj2) { + return typeof obj2; + }; + } else { + _typeof = function _typeof5(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof(obj); +} +function toDate(argument) { + requiredArgs(1, arguments); + var argStr = Object.prototype.toString.call(argument); + if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") { + return new Date(argument.getTime()); + } else if (typeof argument === "number" || argStr === "[object Number]") { + return new Date(argument); + } else { + if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") { + 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); + } + return new Date(NaN); + } +} + +// node_modules/date-fns/esm/addDays/index.js +function addDays(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var date = toDate(dirtyDate); + var amount = toInteger(dirtyAmount); + if (isNaN(amount)) { + return new Date(NaN); + } + if (!amount) { + return date; + } + date.setDate(date.getDate() + amount); + return date; +} + +// node_modules/date-fns/esm/addMonths/index.js +function addMonths(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var date = toDate(dirtyDate); + var amount = toInteger(dirtyAmount); + if (isNaN(amount)) { + return new Date(NaN); + } + if (!amount) { + return date; + } + var dayOfMonth = date.getDate(); + var endOfDesiredMonth = new Date(date.getTime()); + endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0); + var daysInMonth = endOfDesiredMonth.getDate(); + if (dayOfMonth >= daysInMonth) { + return endOfDesiredMonth; + } else { + date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth); + return date; + } +} + +// node_modules/date-fns/esm/addMilliseconds/index.js +function addMilliseconds(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var timestamp = toDate(dirtyDate).getTime(); + var amount = toInteger(dirtyAmount); + return new Date(timestamp + amount); +} + +// node_modules/date-fns/esm/_lib/defaultOptions/index.js +var defaultOptions3 = {}; +function getDefaultOptions() { + return defaultOptions3; +} + +// node_modules/date-fns/esm/startOfWeek/index.js +function startOfWeek(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + requiredArgs(1, arguments); + var defaultOptions4 = getDefaultOptions(); + var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + } + var date = toDate(dirtyDate); + var day = date.getDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + date.setDate(date.getDate() - diff); + date.setHours(0, 0, 0, 0); + return date; +} + +// node_modules/date-fns/esm/startOfISOWeek/index.js +function startOfISOWeek(dirtyDate) { + requiredArgs(1, arguments); + return startOfWeek(dirtyDate, { + weekStartsOn: 1 + }); +} + +// node_modules/date-fns/esm/getISOWeekYear/index.js +function getISOWeekYear(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var year = date.getFullYear(); + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); + var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear); + var fourthOfJanuaryOfThisYear = new Date(0); + fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); + var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear); + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1; + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year; + } else { + return year - 1; + } +} + +// node_modules/date-fns/esm/startOfISOWeekYear/index.js +function startOfISOWeekYear(dirtyDate) { + requiredArgs(1, arguments); + var year = getISOWeekYear(dirtyDate); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setFullYear(year, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + var date = startOfISOWeek(fourthOfJanuary); + return date; +} + +// node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +function getTimezoneOffsetInMilliseconds(date) { + var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())); + utcDate.setUTCFullYear(date.getFullYear()); + return date.getTime() - utcDate.getTime(); +} + +// node_modules/date-fns/esm/startOfDay/index.js +function startOfDay(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + date.setHours(0, 0, 0, 0); + return date; +} + +// node_modules/date-fns/esm/differenceInCalendarDays/index.js +var MILLISECONDS_IN_DAY = 864e5; +function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var startOfDayLeft = startOfDay(dirtyDateLeft); + var startOfDayRight = startOfDay(dirtyDateRight); + var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft); + var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); + return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY); +} + +// node_modules/date-fns/esm/addWeeks/index.js +function addWeeks(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var amount = toInteger(dirtyAmount); + var days = amount * 7; + return addDays(dirtyDate, days); +} + +// node_modules/date-fns/esm/addYears/index.js +function addYears(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var amount = toInteger(dirtyAmount); + return addMonths(dirtyDate, amount * 12); +} + +// node_modules/date-fns/esm/max/index.js +function _typeof2(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof2 = function _typeof5(obj2) { + return typeof obj2; + }; + } else { + _typeof2 = function _typeof5(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof2(obj); +} +function max(dirtyDatesArray) { + requiredArgs(1, arguments); + var datesArray; + if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") { + datesArray = dirtyDatesArray; + } else if (_typeof2(dirtyDatesArray) === "object" && dirtyDatesArray !== null) { + datesArray = Array.prototype.slice.call(dirtyDatesArray); + } else { + return new Date(NaN); + } + var result; + datesArray.forEach(function(dirtyDate) { + var currentDate = toDate(dirtyDate); + if (result === void 0 || result < currentDate || isNaN(Number(currentDate))) { + result = currentDate; + } + }); + return result || new Date(NaN); +} + +// node_modules/date-fns/esm/min/index.js +function _typeof3(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof3 = function _typeof5(obj2) { + return typeof obj2; + }; + } else { + _typeof3 = function _typeof5(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof3(obj); +} +function min(dirtyDatesArray) { + requiredArgs(1, arguments); + var datesArray; + if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") { + datesArray = dirtyDatesArray; + } else if (_typeof3(dirtyDatesArray) === "object" && dirtyDatesArray !== null) { + datesArray = Array.prototype.slice.call(dirtyDatesArray); + } else { + return new Date(NaN); + } + var result; + datesArray.forEach(function(dirtyDate) { + var currentDate = toDate(dirtyDate); + if (result === void 0 || result > currentDate || isNaN(currentDate.getDate())) { + result = currentDate; + } + }); + return result || new Date(NaN); +} + +// node_modules/date-fns/esm/compareAsc/index.js +function compareAsc(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var diff = dateLeft.getTime() - dateRight.getTime(); + if (diff < 0) { + return -1; + } else if (diff > 0) { + return 1; + } else { + return diff; + } +} + +// node_modules/date-fns/esm/isSameDay/index.js +function isSameDay(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeftStartOfDay = startOfDay(dirtyDateLeft); + var dateRightStartOfDay = startOfDay(dirtyDateRight); + return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime(); +} + +// node_modules/date-fns/esm/isDate/index.js +function _typeof4(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof4 = function _typeof5(obj2) { + return typeof obj2; + }; + } else { + _typeof4 = function _typeof5(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof4(obj); +} +function isDate(value) { + requiredArgs(1, arguments); + return value instanceof Date || _typeof4(value) === "object" && Object.prototype.toString.call(value) === "[object Date]"; +} + +// node_modules/date-fns/esm/isValid/index.js +function isValid(dirtyDate) { + requiredArgs(1, arguments); + if (!isDate(dirtyDate) && typeof dirtyDate !== "number") { + return false; + } + var date = toDate(dirtyDate); + return !isNaN(Number(date)); +} + +// node_modules/date-fns/esm/differenceInCalendarMonths/index.js +function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear(); + var monthDiff = dateLeft.getMonth() - dateRight.getMonth(); + return yearDiff * 12 + monthDiff; +} + +// node_modules/date-fns/esm/differenceInCalendarWeeks/index.js +var MILLISECONDS_IN_WEEK = 6048e5; +function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, options) { + requiredArgs(2, arguments); + var startOfWeekLeft = startOfWeek(dirtyDateLeft, options); + var startOfWeekRight = startOfWeek(dirtyDateRight, options); + var timestampLeft = startOfWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekLeft); + var timestampRight = startOfWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekRight); + return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); +} + +// node_modules/date-fns/esm/differenceInMilliseconds/index.js +function differenceInMilliseconds(dateLeft, dateRight) { + requiredArgs(2, arguments); + return toDate(dateLeft).getTime() - toDate(dateRight).getTime(); +} + +// node_modules/date-fns/esm/_lib/roundingMethods/index.js +var roundingMap = { + ceil: Math.ceil, + round: Math.round, + floor: Math.floor, + trunc: function trunc(value) { + return value < 0 ? Math.ceil(value) : Math.floor(value); + } +}; +var defaultRoundingMethod = "trunc"; +function getRoundingMethod(method) { + return method ? roundingMap[method] : roundingMap[defaultRoundingMethod]; +} + +// node_modules/date-fns/esm/endOfDay/index.js +function endOfDay(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + date.setHours(23, 59, 59, 999); + return date; +} + +// node_modules/date-fns/esm/endOfMonth/index.js +function endOfMonth(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var month = date.getMonth(); + date.setFullYear(date.getFullYear(), month + 1, 0); + date.setHours(23, 59, 59, 999); + return date; +} + +// node_modules/date-fns/esm/isLastDayOfMonth/index.js +function isLastDayOfMonth(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + return endOfDay(date).getTime() === endOfMonth(date).getTime(); +} + +// node_modules/date-fns/esm/differenceInMonths/index.js +function differenceInMonths(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + var sign = compareAsc(dateLeft, dateRight); + var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight)); + var result; + if (difference < 1) { + result = 0; + } else { + if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) { + dateLeft.setDate(30); + } + dateLeft.setMonth(dateLeft.getMonth() - sign * difference); + var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign; + if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) { + isLastMonthNotFull = false; + } + result = sign * (difference - Number(isLastMonthNotFull)); + } + return result === 0 ? 0 : result; +} + +// node_modules/date-fns/esm/differenceInSeconds/index.js +function differenceInSeconds(dateLeft, dateRight, options) { + requiredArgs(2, arguments); + var diff = differenceInMilliseconds(dateLeft, dateRight) / 1e3; + return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff); +} + +// node_modules/date-fns/esm/startOfMonth/index.js +function startOfMonth(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + date.setDate(1); + date.setHours(0, 0, 0, 0); + return date; +} + +// node_modules/date-fns/esm/startOfYear/index.js +function startOfYear(dirtyDate) { + requiredArgs(1, arguments); + var cleanDate = toDate(dirtyDate); + var date = new Date(0); + date.setFullYear(cleanDate.getFullYear(), 0, 1); + date.setHours(0, 0, 0, 0); + return date; +} + +// node_modules/date-fns/esm/endOfWeek/index.js +function endOfWeek(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + requiredArgs(1, arguments); + var defaultOptions4 = getDefaultOptions(); + var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + } + var date = toDate(dirtyDate); + var day = date.getDay(); + var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); + date.setDate(date.getDate() + diff); + date.setHours(23, 59, 59, 999); + return date; +} + +// node_modules/date-fns/esm/endOfISOWeek/index.js +function endOfISOWeek(dirtyDate) { + requiredArgs(1, arguments); + return endOfWeek(dirtyDate, { + weekStartsOn: 1 + }); +} + +// node_modules/date-fns/esm/subMilliseconds/index.js +function subMilliseconds(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var amount = toInteger(dirtyAmount); + return addMilliseconds(dirtyDate, -amount); +} + +// node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js +var MILLISECONDS_IN_DAY2 = 864e5; +function getUTCDayOfYear(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var timestamp = date.getTime(); + date.setUTCMonth(0, 1); + date.setUTCHours(0, 0, 0, 0); + var startOfYearTimestamp = date.getTime(); + var difference = timestamp - startOfYearTimestamp; + return Math.floor(difference / MILLISECONDS_IN_DAY2) + 1; +} + +// node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +function startOfUTCISOWeek(dirtyDate) { + requiredArgs(1, arguments); + var weekStartsOn = 1; + var date = toDate(dirtyDate); + var day = date.getUTCDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + date.setUTCDate(date.getUTCDate() - diff); + date.setUTCHours(0, 0, 0, 0); + return date; +} + +// node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +function getUTCISOWeekYear(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var year = date.getUTCFullYear(); + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); + var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear); + var fourthOfJanuaryOfThisYear = new Date(0); + fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); + var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear); + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1; + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year; + } else { + return year - 1; + } +} + +// node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +function startOfUTCISOWeekYear(dirtyDate) { + requiredArgs(1, arguments); + var year = getUTCISOWeekYear(dirtyDate); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(year, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + var date = startOfUTCISOWeek(fourthOfJanuary); + return date; +} + +// node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +var MILLISECONDS_IN_WEEK2 = 6048e5; +function getUTCISOWeek(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); + return Math.round(diff / MILLISECONDS_IN_WEEK2) + 1; +} + +// node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +function startOfUTCWeek(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + requiredArgs(1, arguments); + var defaultOptions4 = getDefaultOptions(); + var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); + } + var date = toDate(dirtyDate); + var day = date.getUTCDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + date.setUTCDate(date.getUTCDate() - diff); + date.setUTCHours(0, 0, 0, 0); + return date; +} + +// node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +function getUTCWeekYear(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var year = date.getUTCFullYear(); + var defaultOptions4 = getDefaultOptions(); + var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); + if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { + throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively"); + } + var firstWeekOfNextYear = new Date(0); + firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); + firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); + var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options); + var firstWeekOfThisYear = new Date(0); + firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); + firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); + var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options); + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1; + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year; + } else { + return year - 1; + } +} + +// node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +function startOfUTCWeekYear(dirtyDate, options) { + var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; + requiredArgs(1, arguments); + var defaultOptions4 = getDefaultOptions(); + var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); + var year = getUTCWeekYear(dirtyDate, options); + var firstWeek = new Date(0); + firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate); + firstWeek.setUTCHours(0, 0, 0, 0); + var date = startOfUTCWeek(firstWeek, options); + return date; +} + +// node_modules/date-fns/esm/_lib/getUTCWeek/index.js +var MILLISECONDS_IN_WEEK3 = 6048e5; +function getUTCWeek(dirtyDate, options) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); + return Math.round(diff / MILLISECONDS_IN_WEEK3) + 1; +} + +// node_modules/date-fns/esm/_lib/addLeadingZeros/index.js +function addLeadingZeros(number, targetLength) { + var sign = number < 0 ? "-" : ""; + var output = Math.abs(number).toString(); + while (output.length < targetLength) { + output = "0" + output; + } + return sign + output; +} + +// node_modules/date-fns/esm/_lib/format/lightFormatters/index.js +var formatters = { + y: function y3(date, token) { + var signedYear = date.getUTCFullYear(); + var year = signedYear > 0 ? signedYear : 1 - signedYear; + return addLeadingZeros(token === "yy" ? year % 100 : year, token.length); + }, + M: function M3(date, token) { + var month = date.getUTCMonth(); + return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2); + }, + d: function d3(date, token) { + return addLeadingZeros(date.getUTCDate(), token.length); + }, + a: function a3(date, token) { + var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am"; + switch (token) { + case "a": + case "aa": + return dayPeriodEnumValue.toUpperCase(); + case "aaa": + return dayPeriodEnumValue; + case "aaaaa": + return dayPeriodEnumValue[0]; + case "aaaa": + default: + return dayPeriodEnumValue === "am" ? "a.m." : "p.m."; + } + }, + h: function h3(date, token) { + return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length); + }, + H: function H3(date, token) { + return addLeadingZeros(date.getUTCHours(), token.length); + }, + m: function m3(date, token) { + return addLeadingZeros(date.getUTCMinutes(), token.length); + }, + s: function s3(date, token) { + return addLeadingZeros(date.getUTCSeconds(), token.length); + }, + S: function S2(date, token) { + var numberOfDigits = token.length; + var milliseconds = date.getUTCMilliseconds(); + var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3)); + return addLeadingZeros(fractionalSeconds, token.length); + } +}; +var lightFormatters_default = formatters; + +// node_modules/date-fns/esm/_lib/format/formatters/index.js +var dayPeriodEnum = { + am: "am", + pm: "pm", + midnight: "midnight", + noon: "noon", + morning: "morning", + afternoon: "afternoon", + evening: "evening", + night: "night" +}; +var formatters2 = { + G: function G2(date, token, localize2) { + var era = date.getUTCFullYear() > 0 ? 1 : 0; + switch (token) { + case "G": + case "GG": + case "GGG": + return localize2.era(era, { + width: "abbreviated" + }); + case "GGGGG": + return localize2.era(era, { + width: "narrow" + }); + case "GGGG": + default: + return localize2.era(era, { + width: "wide" + }); + } + }, + y: function y4(date, token, localize2) { + if (token === "yo") { + var signedYear = date.getUTCFullYear(); + var year = signedYear > 0 ? signedYear : 1 - signedYear; + return localize2.ordinalNumber(year, { + unit: "year" + }); + } + return lightFormatters_default.y(date, token); + }, + Y: function Y2(date, token, localize2, options) { + var signedWeekYear = getUTCWeekYear(date, options); + var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; + if (token === "YY") { + var twoDigitYear = weekYear % 100; + return addLeadingZeros(twoDigitYear, 2); + } + if (token === "Yo") { + return localize2.ordinalNumber(weekYear, { + unit: "year" + }); + } + return addLeadingZeros(weekYear, token.length); + }, + R: function R2(date, token) { + var isoWeekYear = getUTCISOWeekYear(date); + return addLeadingZeros(isoWeekYear, token.length); + }, + u: function u3(date, token) { + var year = date.getUTCFullYear(); + return addLeadingZeros(year, token.length); + }, + Q: function Q2(date, token, localize2) { + var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); + switch (token) { + case "Q": + return String(quarter); + case "QQ": + return addLeadingZeros(quarter, 2); + case "Qo": + return localize2.ordinalNumber(quarter, { + unit: "quarter" + }); + case "QQQ": + return localize2.quarter(quarter, { + width: "abbreviated", + context: "formatting" + }); + case "QQQQQ": + return localize2.quarter(quarter, { + width: "narrow", + context: "formatting" + }); + case "QQQQ": + default: + return localize2.quarter(quarter, { + width: "wide", + context: "formatting" + }); + } + }, + q: function q4(date, token, localize2) { + var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); + switch (token) { + case "q": + return String(quarter); + case "qq": + return addLeadingZeros(quarter, 2); + case "qo": + return localize2.ordinalNumber(quarter, { + unit: "quarter" + }); + case "qqq": + return localize2.quarter(quarter, { + width: "abbreviated", + context: "standalone" + }); + case "qqqqq": + return localize2.quarter(quarter, { + width: "narrow", + context: "standalone" + }); + case "qqqq": + default: + return localize2.quarter(quarter, { + width: "wide", + context: "standalone" + }); + } + }, + M: function M4(date, token, localize2) { + var month = date.getUTCMonth(); + switch (token) { + case "M": + case "MM": + return lightFormatters_default.M(date, token); + case "Mo": + return localize2.ordinalNumber(month + 1, { + unit: "month" + }); + case "MMM": + return localize2.month(month, { + width: "abbreviated", + context: "formatting" + }); + case "MMMMM": + return localize2.month(month, { + width: "narrow", + context: "formatting" + }); + case "MMMM": + default: + return localize2.month(month, { + width: "wide", + context: "formatting" + }); + } + }, + L: function L3(date, token, localize2) { + var month = date.getUTCMonth(); + switch (token) { + case "L": + return String(month + 1); + case "LL": + return addLeadingZeros(month + 1, 2); + case "Lo": + return localize2.ordinalNumber(month + 1, { + unit: "month" + }); + case "LLL": + return localize2.month(month, { + width: "abbreviated", + context: "standalone" + }); + case "LLLLL": + return localize2.month(month, { + width: "narrow", + context: "standalone" + }); + case "LLLL": + default: + return localize2.month(month, { + width: "wide", + context: "standalone" + }); } - ] -}; - -// src/components/UI/modals/stickerModal.tsx -var import_obsidian9 = require("obsidian"); -var htmlFromSticker = (sticker) => { - if (sticker.type == "emoji") { - return emojiFromString(sticker.html); - } - return sticker.html; -}; -var stickerModal = class extends import_obsidian9.FuzzySuggestModal { - constructor(app2, plugin, setIcon) { - super(app2); - this.plugin = plugin; - this.setIcon = setIcon; - this.resultContainerEl.toggleClass("mk-sticker-modal", true); - this.inputEl.focus(); - this.emptyStateText = i18n_default.labels.findStickers; - this.limit = 0; - } - renderSuggestion(item, el) { - el.innerHTML = htmlFromSticker(item.item); - el.setAttr("aria-label", item.item.name); - } - getItemText(item) { - return item.name; - } - getItems() { - const allLucide = lucideIcons.map((f4) => ({ - name: f4, - type: "lucide", - keywords: f4, - value: f4, - html: (0, import_obsidian9.getIcon)(f4).outerHTML - })); - const allCustom = [...this.plugin.index.iconsCache.keys()].map( - (f4) => ({ - name: f4, - type: "vault", - keywords: f4, - value: f4, - html: this.plugin.index.iconsCache.get(f4) - }) - ); - const allUI = [...Object.keys(uiIconSet)].map((f4) => ({ - name: f4, - type: "ui", - keywords: f4, - value: f4, - html: uiIconSet[f4] - })); - const allEmojis = Object.keys(emojis).reduce( - (p3, c4) => [ - ...p3, - ...emojis[c4].map((e4) => ({ - type: "emoji", - name: e4.n[0], - value: e4.u, - html: e4.u - })) - ], - [] - ); - return [...allCustom, ...allEmojis, ...allLucide, ...allUI]; - } - onChooseItem(item, evt) { - this.setIcon(item.type + "//" + item.value); - } -}; - -// src/components/UI/menus/propertyMenu/propertyMenu.tsx -var selectPropertyTypeMenu = (e4, plugin, selectedType) => { - showSelectMenu(e4.target.getBoundingClientRect(), { - plugin, - multi: false, - editable: false, - searchable: false, - saveOptions: selectedType, - value: [], - showAll: true, - options: fieldTypes.filter((f4) => !f4.restricted).map((f4, i4) => ({ - id: i4 + 1, - name: f4.label, - value: f4.type, - icon: f4.icon - })) - }); -}; -var PropertyMenuComponent = (props2) => { - var _a2; - const [field, setField] = h2(props2.field); - const selectedType = (_12, value) => { - const newField = { - ...field, - type: value[0], - value: JSON.stringify(getNewValueForType(field, value)) - }; - setField(newField); - props2.saveField(newField); - }; - const selectedValue = (value) => { - const newField = { ...field, value }; - setField(newField); - props2.saveField(newField); - }; - const toggleMulti = () => { - const newField = { - ...field, - type: field.type == fieldType.multiType ? fieldType.type : fieldType.multiType - }; - setField(newField); - props2.saveField(newField); - }; - const fieldType = (_a2 = fieldTypeForType(field.type)) != null ? _a2 : fieldTypes[0]; - const getNewValueForType = (f4, value) => { - if (value[0].startsWith("option")) { - return JSON.stringify({ - options: props2.options.map((f5) => ({ - name: f5, - value: f5 - })) + }, + w: function w4(date, token, localize2, options) { + var week = getUTCWeek(date, options); + if (token === "wo") { + return localize2.ordinalNumber(week, { + unit: "week" }); } - return value[0] == fieldType.type || value[0] == fieldType.multiType ? f4.value : null; - }; - return /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectPropertyTypeMenu(e4, props2.plugin, selectedType) - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ Cn.createElement("span", null, fieldType.label)), fieldType.multi ? /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item" - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ Cn.createElement("input", { - type: "checkbox", - checked: field.type == fieldType.multiType, - onChange: () => toggleMulti() - })) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), /* @__PURE__ */ Cn.createElement("div", { - className: "menu-separator" - }), /* @__PURE__ */ Cn.createElement(PropertyValueComponent, { - plugin: props2.plugin, - name: field.name, - table: field.table, - fields: props2.fields, - fieldType: fieldType.type, - value: field.value, - contextPath: props2.contextPath, - saveValue: selectedValue - })); -}; -var showPropertyMenu = (props2) => { - const { - plugin, - position, - editable, - options, - field, - fields, - contextPath, - saveField, - hide, - deleteColumn, - sortColumn, - editCode, - hidden - } = props2; - const menu = new import_obsidian10.Menu(); - menu.setUseNativeMenu(false); - if (editable) { - menu.addItem((menuItem) => { - var _a2; - inputMenuItem( - menuItem, - (_a2 = field == null ? void 0 : field.name) != null ? _a2 : "", - (value) => saveField({ ...field, name: value }) - ); - menuItem.setIcon("type"); - }); - menu.addSeparator(); - const frag = document.createDocumentFragment(); - const div = frag.createDiv(); - div.addEventListener("click", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("keydown", (e4) => { - }); - const root = createRoot(div); - root.render( - /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(PropertyMenuComponent, { - plugin, - field, - fields, - contextPath, - options, - saveField - })) - ); - menu.addItem((menuItem) => { - menuItem.setTitle(frag); - menuItem.dom.toggleClass("mk-properties", true); - }); - menu.addSeparator(); - menu.addItem((menuItem) => { - menuItem.setIcon("gem"); - menuItem.setTitle("Set Icon"); - menuItem.onClick(() => { - const vaultChangeModal = new stickerModal( - props2.plugin.app, - props2.plugin, - (emoji) => saveField({ ...field, attrs: emoji }) - ); - vaultChangeModal.open(); + return addLeadingZeros(week, token.length); + }, + I: function I3(date, token, localize2) { + var isoWeek = getUTCISOWeek(date); + if (token === "Io") { + return localize2.ordinalNumber(isoWeek, { + unit: "week" + }); + } + return addLeadingZeros(isoWeek, token.length); + }, + d: function d4(date, token, localize2) { + if (token === "do") { + return localize2.ordinalNumber(date.getUTCDate(), { + unit: "date" + }); + } + return lightFormatters_default.d(date, token); + }, + D: function D3(date, token, localize2) { + var dayOfYear = getUTCDayOfYear(date); + if (token === "Do") { + return localize2.ordinalNumber(dayOfYear, { + unit: "dayOfYear" + }); + } + return addLeadingZeros(dayOfYear, token.length); + }, + E: function E3(date, token, localize2) { + var dayOfWeek = date.getUTCDay(); + switch (token) { + case "E": + case "EE": + case "EEE": + return localize2.day(dayOfWeek, { + width: "abbreviated", + context: "formatting" + }); + case "EEEEE": + return localize2.day(dayOfWeek, { + width: "narrow", + context: "formatting" + }); + case "EEEEEE": + return localize2.day(dayOfWeek, { + width: "short", + context: "formatting" + }); + case "EEEE": + default: + return localize2.day(dayOfWeek, { + width: "wide", + context: "formatting" + }); + } + }, + e: function e3(date, token, localize2, options) { + var dayOfWeek = date.getUTCDay(); + var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; + switch (token) { + case "e": + return String(localDayOfWeek); + case "ee": + return addLeadingZeros(localDayOfWeek, 2); + case "eo": + return localize2.ordinalNumber(localDayOfWeek, { + unit: "day" + }); + case "eee": + return localize2.day(dayOfWeek, { + width: "abbreviated", + context: "formatting" + }); + case "eeeee": + return localize2.day(dayOfWeek, { + width: "narrow", + context: "formatting" + }); + case "eeeeee": + return localize2.day(dayOfWeek, { + width: "short", + context: "formatting" + }); + case "eeee": + default: + return localize2.day(dayOfWeek, { + width: "wide", + context: "formatting" + }); + } + }, + c: function c3(date, token, localize2, options) { + var dayOfWeek = date.getUTCDay(); + var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; + switch (token) { + case "c": + return String(localDayOfWeek); + case "cc": + return addLeadingZeros(localDayOfWeek, token.length); + case "co": + return localize2.ordinalNumber(localDayOfWeek, { + unit: "day" + }); + case "ccc": + return localize2.day(dayOfWeek, { + width: "abbreviated", + context: "standalone" + }); + case "ccccc": + return localize2.day(dayOfWeek, { + width: "narrow", + context: "standalone" + }); + case "cccccc": + return localize2.day(dayOfWeek, { + width: "short", + context: "standalone" + }); + case "cccc": + default: + return localize2.day(dayOfWeek, { + width: "wide", + context: "standalone" + }); + } + }, + i: function i3(date, token, localize2) { + var dayOfWeek = date.getUTCDay(); + var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; + switch (token) { + case "i": + return String(isoDayOfWeek); + case "ii": + return addLeadingZeros(isoDayOfWeek, token.length); + case "io": + return localize2.ordinalNumber(isoDayOfWeek, { + unit: "day" + }); + case "iii": + return localize2.day(dayOfWeek, { + width: "abbreviated", + context: "formatting" + }); + case "iiiii": + return localize2.day(dayOfWeek, { + width: "narrow", + context: "formatting" + }); + case "iiiiii": + return localize2.day(dayOfWeek, { + width: "short", + context: "formatting" + }); + case "iiii": + default: + return localize2.day(dayOfWeek, { + width: "wide", + context: "formatting" + }); + } + }, + a: function a4(date, token, localize2) { + var hours = date.getUTCHours(); + var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; + switch (token) { + case "a": + case "aa": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting" + }); + case "aaa": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting" + }).toLowerCase(); + case "aaaaa": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "narrow", + context: "formatting" + }); + case "aaaa": + default: + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "wide", + context: "formatting" + }); + } + }, + b: function b3(date, token, localize2) { + var hours = date.getUTCHours(); + var dayPeriodEnumValue; + if (hours === 12) { + dayPeriodEnumValue = dayPeriodEnum.noon; + } else if (hours === 0) { + dayPeriodEnumValue = dayPeriodEnum.midnight; + } else { + dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; + } + switch (token) { + case "b": + case "bb": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting" + }); + case "bbb": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting" + }).toLowerCase(); + case "bbbbb": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "narrow", + context: "formatting" + }); + case "bbbb": + default: + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "wide", + context: "formatting" + }); + } + }, + B: function B4(date, token, localize2) { + var hours = date.getUTCHours(); + var dayPeriodEnumValue; + if (hours >= 17) { + dayPeriodEnumValue = dayPeriodEnum.evening; + } else if (hours >= 12) { + dayPeriodEnumValue = dayPeriodEnum.afternoon; + } else if (hours >= 4) { + dayPeriodEnumValue = dayPeriodEnum.morning; + } else { + dayPeriodEnumValue = dayPeriodEnum.night; + } + switch (token) { + case "B": + case "BB": + case "BBB": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "abbreviated", + context: "formatting" + }); + case "BBBBB": + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "narrow", + context: "formatting" + }); + case "BBBB": + default: + return localize2.dayPeriod(dayPeriodEnumValue, { + width: "wide", + context: "formatting" + }); + } + }, + h: function h4(date, token, localize2) { + if (token === "ho") { + var hours = date.getUTCHours() % 12; + if (hours === 0) + hours = 12; + return localize2.ordinalNumber(hours, { + unit: "hour" + }); + } + return lightFormatters_default.h(date, token); + }, + H: function H4(date, token, localize2) { + if (token === "Ho") { + return localize2.ordinalNumber(date.getUTCHours(), { + unit: "hour" + }); + } + return lightFormatters_default.H(date, token); + }, + K: function K2(date, token, localize2) { + var hours = date.getUTCHours() % 12; + if (token === "Ko") { + return localize2.ordinalNumber(hours, { + unit: "hour" }); - }); - if (hide) { - if (!hidden) { - menu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.hideProperty); - menuItem.onClick(() => { - hide(field, true); - }); - menuItem.setIcon("eye-off"); - }); - } else { - menu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.unhideProperty); - menuItem.onClick(() => { - hide(field, false); - }); - menuItem.setIcon("eye"); - }); - } } - if (editCode) { - menu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.editCode); - menuItem.onClick(() => { - editCode(); - }); - menuItem.setIcon("code"); + return addLeadingZeros(hours, token.length); + }, + k: function k4(date, token, localize2) { + var hours = date.getUTCHours(); + if (hours === 0) + hours = 24; + if (token === "ko") { + return localize2.ordinalNumber(hours, { + unit: "hour" }); } - if (deleteColumn) { - menu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.deleteProperty); - menuItem.onClick(() => { - deleteColumn(field); - }); - menuItem.setIcon("trash-2"); + return addLeadingZeros(hours, token.length); + }, + m: function m4(date, token, localize2) { + if (token === "mo") { + return localize2.ordinalNumber(date.getUTCMinutes(), { + unit: "minute" }); } - menu.addSeparator(); + return lightFormatters_default.m(date, token); + }, + s: function s4(date, token, localize2) { + if (token === "so") { + return localize2.ordinalNumber(date.getUTCSeconds(), { + unit: "second" + }); + } + return lightFormatters_default.s(date, token); + }, + S: function S3(date, token) { + return lightFormatters_default.S(date, token); + }, + X: function X2(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + if (timezoneOffset === 0) { + return "Z"; + } + switch (token) { + case "X": + return formatTimezoneWithOptionalMinutes(timezoneOffset); + case "XXXX": + case "XX": + return formatTimezone(timezoneOffset); + case "XXXXX": + case "XXX": + default: + return formatTimezone(timezoneOffset, ":"); + } + }, + x: function x4(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + switch (token) { + case "x": + return formatTimezoneWithOptionalMinutes(timezoneOffset); + case "xxxx": + case "xx": + return formatTimezone(timezoneOffset); + case "xxxxx": + case "xxx": + default: + return formatTimezone(timezoneOffset, ":"); + } + }, + O: function O3(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + switch (token) { + case "O": + case "OO": + case "OOO": + return "GMT" + formatTimezoneShort(timezoneOffset, ":"); + case "OOOO": + default: + return "GMT" + formatTimezone(timezoneOffset, ":"); + } + }, + z: function z4(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timezoneOffset = originalDate.getTimezoneOffset(); + switch (token) { + case "z": + case "zz": + case "zzz": + return "GMT" + formatTimezoneShort(timezoneOffset, ":"); + case "zzzz": + default: + return "GMT" + formatTimezone(timezoneOffset, ":"); + } + }, + t: function t3(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timestamp = Math.floor(originalDate.getTime() / 1e3); + return addLeadingZeros(timestamp, token.length); + }, + T: function T5(date, token, _localize, options) { + var originalDate = options._originalDate || date; + var timestamp = originalDate.getTime(); + return addLeadingZeros(timestamp, token.length); } - const sortableString = normalizedSortForType(field.type, false); - if (sortableString && sortColumn) { - menu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.sortAscending); - menuItem.setIcon("sort-asc"); - menuItem.onClick(() => { - sortColumn({ - field: field.name + field.table, - fn: normalizedSortForType(field.type, false) - }); +}; +function formatTimezoneShort(offset2, dirtyDelimiter) { + var sign = offset2 > 0 ? "-" : "+"; + var absOffset = Math.abs(offset2); + var hours = Math.floor(absOffset / 60); + var minutes = absOffset % 60; + if (minutes === 0) { + return sign + String(hours); + } + var delimiter = dirtyDelimiter || ""; + return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2); +} +function formatTimezoneWithOptionalMinutes(offset2, dirtyDelimiter) { + if (offset2 % 60 === 0) { + var sign = offset2 > 0 ? "-" : "+"; + return sign + addLeadingZeros(Math.abs(offset2) / 60, 2); + } + return formatTimezone(offset2, dirtyDelimiter); +} +function formatTimezone(offset2, dirtyDelimiter) { + var delimiter = dirtyDelimiter || ""; + var sign = offset2 > 0 ? "-" : "+"; + var absOffset = Math.abs(offset2); + var hours = addLeadingZeros(Math.floor(absOffset / 60), 2); + var minutes = addLeadingZeros(absOffset % 60, 2); + return sign + hours + delimiter + minutes; +} +var formatters_default = formatters2; + +// node_modules/date-fns/esm/_lib/format/longFormatters/index.js +var dateLongFormatter = function dateLongFormatter2(pattern, formatLong2) { + switch (pattern) { + case "P": + return formatLong2.date({ + width: "short" }); - }); - menu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.sortDescending); - menuItem.setIcon("sort-desc"); - menuItem.onClick(() => { - sortColumn({ - field: field.name + field.table, - fn: normalizedSortForType(field.type, true) - }); + case "PP": + return formatLong2.date({ + width: "medium" + }); + case "PPP": + return formatLong2.date({ + width: "long" + }); + case "PPPP": + default: + return formatLong2.date({ + width: "full" }); - }); } - menu.showAtPosition(position); - return menu; }; +var timeLongFormatter = function timeLongFormatter2(pattern, formatLong2) { + switch (pattern) { + case "p": + return formatLong2.time({ + width: "short" + }); + case "pp": + return formatLong2.time({ + width: "medium" + }); + case "ppp": + return formatLong2.time({ + width: "long" + }); + case "pppp": + default: + return formatLong2.time({ + width: "full" + }); + } +}; +var dateTimeLongFormatter = function dateTimeLongFormatter2(pattern, formatLong2) { + var matchResult = pattern.match(/(P+)(p+)?/) || []; + var datePattern = matchResult[1]; + var timePattern = matchResult[2]; + if (!timePattern) { + return dateLongFormatter(pattern, formatLong2); + } + var dateTimeFormat; + switch (datePattern) { + case "P": + dateTimeFormat = formatLong2.dateTime({ + width: "short" + }); + break; + case "PP": + dateTimeFormat = formatLong2.dateTime({ + width: "medium" + }); + break; + case "PPP": + dateTimeFormat = formatLong2.dateTime({ + width: "long" + }); + break; + case "PPPP": + default: + dateTimeFormat = formatLong2.dateTime({ + width: "full" + }); + break; + } + return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2)); +}; +var longFormatters = { + p: timeLongFormatter, + P: dateTimeLongFormatter +}; +var longFormatters_default = longFormatters; -// src/context/ContextEditorContext.tsx -var import_lodash4 = __toESM(require_lodash()); -var import_obsidian14 = require("obsidian"); +// node_modules/date-fns/esm/_lib/protectedTokens/index.js +var protectedDayOfYearTokens = ["D", "DD"]; +var protectedWeekYearTokens = ["YY", "YYYY"]; +function isProtectedDayOfYearToken(token) { + return protectedDayOfYearTokens.indexOf(token) !== -1; +} +function isProtectedWeekYearToken(token) { + return protectedWeekYearTokens.indexOf(token) !== -1; +} +function throwProtectedError(token, format2, input) { + if (token === "YYYY") { + throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } else if (token === "YY") { + throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } else if (token === "D") { + throw new RangeError("Use `d` instead of `D` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } else if (token === "DD") { + throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); + } +} -// src/utils/contexts/predicate/filterFns/filterFnTypes.ts -var filterFnTypes = { - isNotEmpty: { - type: ["text", "file", "link", "link-multi", "fileprop", "image"], - fn: (v3, f4) => !empty2(v3, ""), - valueType: "none" - }, - isEmpty: { - type: ["text", "file", "link", "link-multi", "fileprop", "image"], - fn: (v3, f4) => empty2(v3, ""), - valueType: "none" - }, - include: { - fn: (v3, f4) => stringCompare(v3, f4), - type: ["text", "file", "link", "link-multi", "fileprop", "image"], - valueType: "text" - }, - notInclude: { - type: ["text", "file", "link", "link-multi", "fileprop", "image"], - fn: (v3, f4) => !stringCompare(v3, f4), - valueType: "text" +// node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js +var formatDistanceLocale = { + lessThanXSeconds: { + one: "less than a second", + other: "less than {{count}} seconds" }, - is: { - type: ["text", "file", "link", "context", "fileprop"], - fn: (v3, f4) => stringEqual(v3, f4), - valueType: "text" + xSeconds: { + one: "1 second", + other: "{{count}} seconds" }, - isNot: { - type: ["text", "file", "link", "context", "fileprop"], - fn: (v3, f4) => !stringEqual(v3, f4), - valueType: "text" + halfAMinute: "half a minute", + lessThanXMinutes: { + one: "less than a minute", + other: "less than {{count}} minutes" }, - equal: { - type: ["number"], - fn: (v3, f4) => stringEqual(v3, f4), - valueType: "number" + xMinutes: { + one: "1 minute", + other: "{{count}} minutes" }, - isGreatThan: { - type: ["number"], - fn: (v3, f4) => greaterThan(v3, f4), - valueType: "number" + aboutXHours: { + one: "about 1 hour", + other: "about {{count}} hours" }, - isLessThan: { - type: ["number"], - fn: (v3, f4) => lessThan(v3, f4), - valueType: "number" + xHours: { + one: "1 hour", + other: "{{count}} hours" }, - isLessThanOrEqual: { - type: ["number"], - fn: (v3, f4) => !greaterThan(v3, f4), - valueType: "number" + xDays: { + one: "1 day", + other: "{{count}} days" }, - isGreatThanOrEqual: { - type: ["number"], - fn: (v3, f4) => !lessThan(v3, f4), - valueType: "number" + aboutXWeeks: { + one: "about 1 week", + other: "about {{count}} weeks" }, - dateBefore: { - type: ["date", "fileprop"], - fn: (v3, f4) => lessThan(v3, f4), - valueType: "date" + xWeeks: { + one: "1 week", + other: "{{count}} weeks" }, - dateAfter: { - type: ["date", "fileprop"], - fn: (v3, f4) => greaterThan(v3, f4), - valueType: "date" + aboutXMonths: { + one: "about 1 month", + other: "about {{count}} months" }, - isSameDateAsToday: { - type: ["date"], - fn: (v3, f4) => isSameDayAsToday(v3, f4), - valueType: "none" + xMonths: { + one: "1 month", + other: "{{count}} months" }, - isAnyInList: { - type: ["option", "context", "option-multi", "context-multi", "tags-multi", "tags"], - fn: (v3, f4) => listIncludes(v3, f4), - valueType: "list" + aboutXYears: { + one: "about 1 year", + other: "about {{count}} years" }, - isNoneInList: { - type: ["option", "context", "option-multi", "context-multi", "tags-multi", "tags"], - fn: (v3, f4) => !listIncludes(v3, f4), - valueType: "list" + xYears: { + one: "1 year", + other: "{{count}} years" }, - isTrue: { - type: ["boolean"], - fn: (v3, f4) => v3 == "true", - valueType: "none" + overXYears: { + one: "over 1 year", + other: "over {{count}} years" }, - isFalse: { - type: ["boolean"], - fn: (v3, f4) => v3 != "true", - valueType: "none" + almostXYears: { + one: "almost 1 year", + other: "almost {{count}} years" + } +}; +var formatDistance = function formatDistance2(token, count2, options) { + var result; + var tokenValue = formatDistanceLocale[token]; + if (typeof tokenValue === "string") { + result = tokenValue; + } else if (count2 === 1) { + result = tokenValue.one; + } else { + result = tokenValue.other.replace("{{count}}", count2.toString()); + } + if (options !== null && options !== void 0 && options.addSuffix) { + if (options.comparison && options.comparison > 0) { + return "in " + result; + } else { + return result + " ago"; + } } + return result; }; +var formatDistance_default = formatDistance; -// src/utils/contexts/predicate/filter.ts -var stringEqual = (value, filterValue) => { - return value == filterValue; +// node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js +function buildFormatLongFn(args) { + return function() { + var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var width = options.width ? String(options.width) : args.defaultWidth; + var format2 = args.formats[width] || args.formats[args.defaultWidth]; + return format2; + }; +} + +// node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js +var dateFormats = { + full: "EEEE, MMMM do, y", + long: "MMMM do, y", + medium: "MMM d, y", + short: "MM/dd/yyyy" }; -var empty2 = (value, filterValue) => { - return (value != null ? value : "").length == 0; +var timeFormats = { + full: "h:mm:ss a zzzz", + long: "h:mm:ss a z", + medium: "h:mm:ss a", + short: "h:mm a" }; -var stringCompare = (value, filterValue) => { - return (value != null ? value : "").toLowerCase().includes((filterValue != null ? filterValue : "").toLowerCase()); +var dateTimeFormats = { + full: "{{date}} 'at' {{time}}", + long: "{{date}} 'at' {{time}}", + medium: "{{date}}, {{time}}", + short: "{{date}}, {{time}}" }; -var greaterThan = (value, filterValue) => { - return parseFloat(value) > parseFloat(filterValue); +var formatLong = { + date: buildFormatLongFn({ + formats: dateFormats, + defaultWidth: "full" + }), + time: buildFormatLongFn({ + formats: timeFormats, + defaultWidth: "full" + }), + dateTime: buildFormatLongFn({ + formats: dateTimeFormats, + defaultWidth: "full" + }) +}; +var formatLong_default = formatLong; + +// node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js +var formatRelativeLocale = { + lastWeek: "'last' eeee 'at' p", + yesterday: "'yesterday at' p", + today: "'today at' p", + tomorrow: "'tomorrow at' p", + nextWeek: "eeee 'at' p", + other: "P" +}; +var formatRelative = function formatRelative2(token, _date, _baseDate, _options) { + return formatRelativeLocale[token]; +}; +var formatRelative_default = formatRelative; + +// node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js +function buildLocalizeFn(args) { + return function(dirtyIndex, options) { + var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone"; + var valuesArray; + if (context === "formatting" && args.formattingValues) { + var defaultWidth = args.defaultFormattingWidth || args.defaultWidth; + var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth; + valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; + } else { + var _defaultWidth = args.defaultWidth; + var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth; + valuesArray = args.values[_width] || args.values[_defaultWidth]; + } + var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; + return valuesArray[index]; + }; +} + +// node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js +var eraValues = { + narrow: ["B", "A"], + abbreviated: ["BC", "AD"], + wide: ["Before Christ", "Anno Domini"] }; -var lessThan = (value, filterValue) => { - return parseInt(value) > parseInt(filterValue); +var quarterValues = { + narrow: ["1", "2", "3", "4"], + abbreviated: ["Q1", "Q2", "Q3", "Q4"], + wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }; -var listIncludes = (value, filterValue) => { - const valueList = value ? parseMultiString(value) : []; - const strings = filterValue ? parseMultiString(filterValue) : []; - return strings.some((f4) => valueList.some((g4) => g4 == f4)); +var monthValues = { + 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"] }; -var isSameDayAsToday = (value) => { - const inputDate = new Date(`${value}T00:00`); - const currentDate = new Date(); - return inputDate.getMonth() === currentDate.getMonth() && inputDate.getDate() === currentDate.getDate(); +var dayValues = { + 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"] }; -var filterReturnForCol = (col, filter, row) => { - if (!col) - return true; - const filterType = filterFnTypes[filter == null ? void 0 : filter.fn]; - let result = true; - if (filterType && filterType.fn) { - result = filterType.fn(row[filter.field], filter.value); +var dayPeriodValues = { + 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" } - return result; }; - -// node_modules/date-fns/esm/_lib/toInteger/index.js -function toInteger(dirtyNumber) { - if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) { - return NaN; +var formattingDayPeriodValues = { + 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" } +}; +var ordinalNumber = function ordinalNumber2(dirtyNumber, _options) { var number = Number(dirtyNumber); - if (isNaN(number)) { - return number; - } - return number < 0 ? Math.ceil(number) : Math.floor(number); -} - -// node_modules/date-fns/esm/_lib/requiredArgs/index.js -function requiredArgs(required, args) { - if (args.length < required) { - throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present"); + var rem100 = number % 100; + if (rem100 > 20 || rem100 < 10) { + switch (rem100 % 10) { + case 1: + return number + "st"; + case 2: + return number + "nd"; + case 3: + return number + "rd"; + } } -} + return number + "th"; +}; +var localize = { + ordinalNumber, + era: buildLocalizeFn({ + values: eraValues, + defaultWidth: "wide" + }), + quarter: buildLocalizeFn({ + values: quarterValues, + defaultWidth: "wide", + argumentCallback: function argumentCallback(quarter) { + return quarter - 1; + } + }), + month: buildLocalizeFn({ + values: monthValues, + defaultWidth: "wide" + }), + day: buildLocalizeFn({ + values: dayValues, + defaultWidth: "wide" + }), + dayPeriod: buildLocalizeFn({ + values: dayPeriodValues, + defaultWidth: "wide", + formattingValues: formattingDayPeriodValues, + defaultFormattingWidth: "wide" + }) +}; +var localize_default = localize; -// node_modules/date-fns/esm/toDate/index.js -function _typeof(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function _typeof5(obj2) { - return typeof obj2; - }; - } else { - _typeof = function _typeof5(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; +// node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js +function buildMatchFn(args) { + return function(string) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var width = options.width; + var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; + var matchResult = string.match(matchPattern); + if (!matchResult) { + return null; + } + var matchedString = matchResult[0]; + var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; + var key2 = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) { + return pattern.test(matchedString); + }) : findKey(parsePatterns, function(pattern) { + return pattern.test(matchedString); + }); + var value; + value = args.valueCallback ? args.valueCallback(key2) : key2; + value = options.valueCallback ? options.valueCallback(value) : value; + var rest = string.slice(matchedString.length); + return { + value, + rest }; - } - return _typeof(obj); + }; } -function toDate(argument) { - requiredArgs(1, arguments); - var argStr = Object.prototype.toString.call(argument); - if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") { - return new Date(argument.getTime()); - } else if (typeof argument === "number" || argStr === "[object Number]") { - return new Date(argument); - } else { - if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") { - 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); +function findKey(object, predicate) { + for (var key2 in object) { + if (object.hasOwnProperty(key2) && predicate(object[key2])) { + return key2; } - return new Date(NaN); - } -} - -// node_modules/date-fns/esm/addDays/index.js -function addDays(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var date = toDate(dirtyDate); - var amount = toInteger(dirtyAmount); - if (isNaN(amount)) { - return new Date(NaN); } - if (!amount) { - return date; - } - date.setDate(date.getDate() + amount); - return date; + return void 0; } - -// node_modules/date-fns/esm/addMonths/index.js -function addMonths(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var date = toDate(dirtyDate); - var amount = toInteger(dirtyAmount); - if (isNaN(amount)) { - return new Date(NaN); - } - if (!amount) { - return date; - } - var dayOfMonth = date.getDate(); - var endOfDesiredMonth = new Date(date.getTime()); - endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0); - var daysInMonth = endOfDesiredMonth.getDate(); - if (dayOfMonth >= daysInMonth) { - return endOfDesiredMonth; - } else { - date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth); - return date; +function findIndex(array, predicate) { + for (var key2 = 0; key2 < array.length; key2++) { + if (predicate(array[key2])) { + return key2; + } } + return void 0; } -// node_modules/date-fns/esm/addMilliseconds/index.js -function addMilliseconds(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var timestamp = toDate(dirtyDate).getTime(); - var amount = toInteger(dirtyAmount); - return new Date(timestamp + amount); -} - -// node_modules/date-fns/esm/_lib/defaultOptions/index.js -var defaultOptions3 = {}; -function getDefaultOptions() { - return defaultOptions3; +// node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js +function buildMatchPatternFn(args) { + return function(string) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var matchResult = string.match(args.matchPattern); + if (!matchResult) + return null; + var matchedString = matchResult[0]; + var parseResult = string.match(args.parsePattern); + if (!parseResult) + return null; + var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; + value = options.valueCallback ? options.valueCallback(value) : value; + var rest = string.slice(matchedString.length); + return { + value, + rest + }; + }; } -// node_modules/date-fns/esm/startOfWeek/index.js -function startOfWeek(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs(1, arguments); - var defaultOptions4 = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); +// node_modules/date-fns/esm/locale/en-US/_lib/match/index.js +var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; +var parseOrdinalNumberPattern = /\d+/i; +var matchEraPatterns = { + 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 +}; +var parseEraPatterns = { + any: [/^b/i, /^(a|c)/i] +}; +var matchQuarterPatterns = { + narrow: /^[1234]/i, + abbreviated: /^q[1234]/i, + wide: /^[1234](th|st|nd|rd)? quarter/i +}; +var parseQuarterPatterns = { + any: [/1/i, /2/i, /3/i, /4/i] +}; +var matchMonthPatterns = { + 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 +}; +var parseMonthPatterns = { + 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] +}; +var matchDayPatterns = { + 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 +}; +var parseDayPatterns = { + 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] +}; +var matchDayPeriodPatterns = { + 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 +}; +var parseDayPeriodPatterns = { + 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 } - var date = toDate(dirtyDate); - var day = date.getDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date.setDate(date.getDate() - diff); - date.setHours(0, 0, 0, 0); - return date; -} - -// node_modules/date-fns/esm/startOfISOWeek/index.js -function startOfISOWeek(dirtyDate) { - requiredArgs(1, arguments); - return startOfWeek(dirtyDate, { - weekStartsOn: 1 - }); -} +}; +var match = { + ordinalNumber: buildMatchPatternFn({ + matchPattern: matchOrdinalNumberPattern, + parsePattern: parseOrdinalNumberPattern, + valueCallback: function valueCallback(value) { + return parseInt(value, 10); + } + }), + era: buildMatchFn({ + matchPatterns: matchEraPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseEraPatterns, + defaultParseWidth: "any" + }), + quarter: buildMatchFn({ + matchPatterns: matchQuarterPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseQuarterPatterns, + defaultParseWidth: "any", + valueCallback: function valueCallback2(index) { + return index + 1; + } + }), + month: buildMatchFn({ + matchPatterns: matchMonthPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseMonthPatterns, + defaultParseWidth: "any" + }), + day: buildMatchFn({ + matchPatterns: matchDayPatterns, + defaultMatchWidth: "wide", + parsePatterns: parseDayPatterns, + defaultParseWidth: "any" + }), + dayPeriod: buildMatchFn({ + matchPatterns: matchDayPeriodPatterns, + defaultMatchWidth: "any", + parsePatterns: parseDayPeriodPatterns, + defaultParseWidth: "any" + }) +}; +var match_default = match; -// node_modules/date-fns/esm/getISOWeekYear/index.js -function getISOWeekYear(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var year = date.getFullYear(); - var fourthOfJanuaryOfNextYear = new Date(0); - fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); - fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); - var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear); - var fourthOfJanuaryOfThisYear = new Date(0); - fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); - fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); - var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear); - if (date.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (date.getTime() >= startOfThisYear.getTime()) { - return year; - } else { - return year - 1; +// node_modules/date-fns/esm/locale/en-US/index.js +var locale = { + code: "en-US", + formatDistance: formatDistance_default, + formatLong: formatLong_default, + formatRelative: formatRelative_default, + localize: localize_default, + match: match_default, + options: { + weekStartsOn: 0, + firstWeekContainsDate: 1 } -} - -// node_modules/date-fns/esm/startOfISOWeekYear/index.js -function startOfISOWeekYear(dirtyDate) { - requiredArgs(1, arguments); - var year = getISOWeekYear(dirtyDate); - var fourthOfJanuary = new Date(0); - fourthOfJanuary.setFullYear(year, 0, 4); - fourthOfJanuary.setHours(0, 0, 0, 0); - var date = startOfISOWeek(fourthOfJanuary); - return date; -} - -// node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js -function getTimezoneOffsetInMilliseconds(date) { - var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())); - utcDate.setUTCFullYear(date.getFullYear()); - return date.getTime() - utcDate.getTime(); -} - -// node_modules/date-fns/esm/startOfDay/index.js -function startOfDay(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - date.setHours(0, 0, 0, 0); - return date; -} - -// node_modules/date-fns/esm/differenceInCalendarDays/index.js -var MILLISECONDS_IN_DAY = 864e5; -function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var startOfDayLeft = startOfDay(dirtyDateLeft); - var startOfDayRight = startOfDay(dirtyDateRight); - var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft); - var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY); -} +}; +var en_US_default = locale; -// node_modules/date-fns/esm/addWeeks/index.js -function addWeeks(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var amount = toInteger(dirtyAmount); - var days = amount * 7; - return addDays(dirtyDate, days); -} +// node_modules/date-fns/esm/_lib/defaultLocale/index.js +var defaultLocale_default = en_US_default; -// node_modules/date-fns/esm/addYears/index.js -function addYears(dirtyDate, dirtyAmount) { +// node_modules/date-fns/esm/format/index.js +var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; +var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; +var escapedStringRegExp = /^'([^]*?)'?$/; +var doubleQuoteRegExp = /''/g; +var unescapedLatinCharacterRegExp = /[a-zA-Z]/; +function format(dirtyDate, dirtyFormatStr, options) { + var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4; requiredArgs(2, arguments); - var amount = toInteger(dirtyAmount); - return addMonths(dirtyDate, amount * 12); -} - -// node_modules/date-fns/esm/max/index.js -function _typeof2(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof2 = function _typeof5(obj2) { - return typeof obj2; - }; - } else { - _typeof2 = function _typeof5(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }; + var formatStr = String(dirtyFormatStr); + var defaultOptions4 = getDefaultOptions(); + var locale2 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions4.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default; + var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions4.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); + if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { + throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively"); } - return _typeof2(obj); -} -function max(dirtyDatesArray) { - requiredArgs(1, arguments); - var datesArray; - if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") { - datesArray = dirtyDatesArray; - } else if (_typeof2(dirtyDatesArray) === "object" && dirtyDatesArray !== null) { - datesArray = Array.prototype.slice.call(dirtyDatesArray); - } else { - return new Date(NaN); + var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions4.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions4.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); } - var result; - datesArray.forEach(function(dirtyDate) { - var currentDate = toDate(dirtyDate); - if (result === void 0 || result < currentDate || isNaN(Number(currentDate))) { - result = currentDate; - } - }); - return result || new Date(NaN); -} - -// node_modules/date-fns/esm/min/index.js -function _typeof3(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof3 = function _typeof5(obj2) { - return typeof obj2; - }; - } else { - _typeof3 = function _typeof5(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }; + if (!locale2.localize) { + throw new RangeError("locale must contain localize property"); } - return _typeof3(obj); -} -function min(dirtyDatesArray) { - requiredArgs(1, arguments); - var datesArray; - if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") { - datesArray = dirtyDatesArray; - } else if (_typeof3(dirtyDatesArray) === "object" && dirtyDatesArray !== null) { - datesArray = Array.prototype.slice.call(dirtyDatesArray); - } else { - return new Date(NaN); + if (!locale2.formatLong) { + throw new RangeError("locale must contain formatLong property"); } - var result; - datesArray.forEach(function(dirtyDate) { - var currentDate = toDate(dirtyDate); - if (result === void 0 || result > currentDate || isNaN(currentDate.getDate())) { - result = currentDate; + var originalDate = toDate(dirtyDate); + if (!isValid(originalDate)) { + throw new RangeError("Invalid time value"); + } + var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate); + var utcDate = subMilliseconds(originalDate, timezoneOffset); + var formatterOptions = { + firstWeekContainsDate, + weekStartsOn, + locale: locale2, + _originalDate: originalDate + }; + var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) { + var firstCharacter = substring[0]; + if (firstCharacter === "p" || firstCharacter === "P") { + var longFormatter = longFormatters_default[firstCharacter]; + return longFormatter(substring, locale2.formatLong); } - }); - return result || new Date(NaN); + return substring; + }).join("").match(formattingTokensRegExp).map(function(substring) { + if (substring === "''") { + return "'"; + } + var firstCharacter = substring[0]; + if (firstCharacter === "'") { + return cleanEscapedString(substring); + } + var formatter = formatters_default[firstCharacter]; + if (formatter) { + if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) { + throwProtectedError(substring, dirtyFormatStr, String(dirtyDate)); + } + if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) { + throwProtectedError(substring, dirtyFormatStr, String(dirtyDate)); + } + return formatter(utcDate, substring, locale2.localize, formatterOptions); + } + if (firstCharacter.match(unescapedLatinCharacterRegExp)) { + throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"); + } + return substring; + }).join(""); + return result; } - -// node_modules/date-fns/esm/compareAsc/index.js -function compareAsc(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - var diff = dateLeft.getTime() - dateRight.getTime(); - if (diff < 0) { - return -1; - } else if (diff > 0) { - return 1; - } else { - return diff; +function cleanEscapedString(input) { + var matched = input.match(escapedStringRegExp); + if (!matched) { + return input; } + return matched[1].replace(doubleQuoteRegExp, "'"); } -// node_modules/date-fns/esm/isSameDay/index.js -function isSameDay(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeftStartOfDay = startOfDay(dirtyDateLeft); - var dateRightStartOfDay = startOfDay(dirtyDateRight); - return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime(); -} - -// node_modules/date-fns/esm/isDate/index.js -function _typeof4(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof4 = function _typeof5(obj2) { - return typeof obj2; - }; - } else { - _typeof4 = function _typeof5(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }; +// node_modules/date-fns/esm/_lib/assign/index.js +function assign(target, object) { + if (target == null) { + throw new TypeError("assign requires that input parameter not be null or undefined"); } - return _typeof4(obj); -} -function isDate(value) { - requiredArgs(1, arguments); - return value instanceof Date || _typeof4(value) === "object" && Object.prototype.toString.call(value) === "[object Date]"; -} - -// node_modules/date-fns/esm/isValid/index.js -function isValid(dirtyDate) { - requiredArgs(1, arguments); - if (!isDate(dirtyDate) && typeof dirtyDate !== "number") { - return false; + for (var property in object) { + if (Object.prototype.hasOwnProperty.call(object, property)) { + ; + target[property] = object[property]; + } } - var date = toDate(dirtyDate); - return !isNaN(Number(date)); -} - -// node_modules/date-fns/esm/differenceInCalendarMonths/index.js -function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear(); - var monthDiff = dateLeft.getMonth() - dateRight.getMonth(); - return yearDiff * 12 + monthDiff; + return target; } -// node_modules/date-fns/esm/differenceInCalendarWeeks/index.js -var MILLISECONDS_IN_WEEK = 6048e5; -function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, options) { - requiredArgs(2, arguments); - var startOfWeekLeft = startOfWeek(dirtyDateLeft, options); - var startOfWeekRight = startOfWeek(dirtyDateRight, options); - var timestampLeft = startOfWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekLeft); - var timestampRight = startOfWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekRight); - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK); +// node_modules/date-fns/esm/_lib/cloneObject/index.js +function cloneObject(object) { + return assign({}, object); } -// node_modules/date-fns/esm/differenceInMilliseconds/index.js -function differenceInMilliseconds(dateLeft, dateRight) { +// node_modules/date-fns/esm/formatDistance/index.js +var MINUTES_IN_DAY = 1440; +var MINUTES_IN_ALMOST_TWO_DAYS = 2520; +var MINUTES_IN_MONTH = 43200; +var MINUTES_IN_TWO_MONTHS = 86400; +function formatDistance3(dirtyDate, dirtyBaseDate, options) { + var _ref, _options$locale; requiredArgs(2, arguments); - return toDate(dateLeft).getTime() - toDate(dateRight).getTime(); -} - -// node_modules/date-fns/esm/_lib/roundingMethods/index.js -var roundingMap = { - ceil: Math.ceil, - round: Math.round, - floor: Math.floor, - trunc: function trunc(value) { - return value < 0 ? Math.ceil(value) : Math.floor(value); + var defaultOptions4 = getDefaultOptions(); + var locale2 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions4.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default; + if (!locale2.formatDistance) { + throw new RangeError("locale must contain formatDistance property"); } -}; -var defaultRoundingMethod = "trunc"; -function getRoundingMethod(method) { - return method ? roundingMap[method] : roundingMap[defaultRoundingMethod]; -} - -// node_modules/date-fns/esm/endOfDay/index.js -function endOfDay(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - date.setHours(23, 59, 59, 999); - return date; -} - -// node_modules/date-fns/esm/endOfMonth/index.js -function endOfMonth(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var month = date.getMonth(); - date.setFullYear(date.getFullYear(), month + 1, 0); - date.setHours(23, 59, 59, 999); - return date; -} - -// node_modules/date-fns/esm/isLastDayOfMonth/index.js -function isLastDayOfMonth(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - return endOfDay(date).getTime() === endOfMonth(date).getTime(); -} - -// node_modules/date-fns/esm/differenceInMonths/index.js -function differenceInMonths(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - var sign = compareAsc(dateLeft, dateRight); - var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight)); - var result; - if (difference < 1) { - result = 0; + var comparison = compareAsc(dirtyDate, dirtyBaseDate); + if (isNaN(comparison)) { + throw new RangeError("Invalid time value"); + } + var localizeOptions = assign(cloneObject(options), { + addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix), + comparison + }); + var dateLeft; + var dateRight; + if (comparison > 0) { + dateLeft = toDate(dirtyBaseDate); + dateRight = toDate(dirtyDate); } else { - if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) { - dateLeft.setDate(30); + dateLeft = toDate(dirtyDate); + dateRight = toDate(dirtyBaseDate); + } + var seconds = differenceInSeconds(dateRight, dateLeft); + var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1e3; + var minutes = Math.round((seconds - offsetInSeconds) / 60); + var months; + if (minutes < 2) { + if (options !== null && options !== void 0 && options.includeSeconds) { + if (seconds < 5) { + return locale2.formatDistance("lessThanXSeconds", 5, localizeOptions); + } else if (seconds < 10) { + return locale2.formatDistance("lessThanXSeconds", 10, localizeOptions); + } else if (seconds < 20) { + return locale2.formatDistance("lessThanXSeconds", 20, localizeOptions); + } else if (seconds < 40) { + return locale2.formatDistance("halfAMinute", 0, localizeOptions); + } else if (seconds < 60) { + return locale2.formatDistance("lessThanXMinutes", 1, localizeOptions); + } else { + return locale2.formatDistance("xMinutes", 1, localizeOptions); + } + } else { + if (minutes === 0) { + return locale2.formatDistance("lessThanXMinutes", 1, localizeOptions); + } else { + return locale2.formatDistance("xMinutes", minutes, localizeOptions); + } } - dateLeft.setMonth(dateLeft.getMonth() - sign * difference); - var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign; - if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) { - isLastMonthNotFull = false; + } else if (minutes < 45) { + return locale2.formatDistance("xMinutes", minutes, localizeOptions); + } else if (minutes < 90) { + return locale2.formatDistance("aboutXHours", 1, localizeOptions); + } else if (minutes < MINUTES_IN_DAY) { + var hours = Math.round(minutes / 60); + return locale2.formatDistance("aboutXHours", hours, localizeOptions); + } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) { + return locale2.formatDistance("xDays", 1, localizeOptions); + } else if (minutes < MINUTES_IN_MONTH) { + var days = Math.round(minutes / MINUTES_IN_DAY); + return locale2.formatDistance("xDays", days, localizeOptions); + } else if (minutes < MINUTES_IN_TWO_MONTHS) { + months = Math.round(minutes / MINUTES_IN_MONTH); + return locale2.formatDistance("aboutXMonths", months, localizeOptions); + } + months = differenceInMonths(dateRight, dateLeft); + if (months < 12) { + var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH); + return locale2.formatDistance("xMonths", nearestMonth, localizeOptions); + } else { + var monthsSinceStartOfYear = months % 12; + var years = Math.floor(months / 12); + if (monthsSinceStartOfYear < 3) { + return locale2.formatDistance("aboutXYears", years, localizeOptions); + } else if (monthsSinceStartOfYear < 9) { + return locale2.formatDistance("overXYears", years, localizeOptions); + } else { + return locale2.formatDistance("almostXYears", years + 1, localizeOptions); } - result = sign * (difference - Number(isLastMonthNotFull)); } - return result === 0 ? 0 : result; -} - -// node_modules/date-fns/esm/differenceInSeconds/index.js -function differenceInSeconds(dateLeft, dateRight, options) { - requiredArgs(2, arguments); - var diff = differenceInMilliseconds(dateLeft, dateRight) / 1e3; - return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff); } -// node_modules/date-fns/esm/startOfMonth/index.js -function startOfMonth(dirtyDate) { +// node_modules/date-fns/esm/getDaysInMonth/index.js +function getDaysInMonth(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); - date.setDate(1); - date.setHours(0, 0, 0, 0); - return date; -} - -// node_modules/date-fns/esm/startOfYear/index.js -function startOfYear(dirtyDate) { - requiredArgs(1, arguments); - var cleanDate = toDate(dirtyDate); - var date = new Date(0); - date.setFullYear(cleanDate.getFullYear(), 0, 1); - date.setHours(0, 0, 0, 0); - return date; + var year = date.getFullYear(); + var monthIndex = date.getMonth(); + var lastDayOfMonth2 = new Date(0); + lastDayOfMonth2.setFullYear(year, monthIndex + 1, 0); + lastDayOfMonth2.setHours(0, 0, 0, 0); + return lastDayOfMonth2.getDate(); } -// node_modules/date-fns/esm/endOfWeek/index.js -function endOfWeek(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; +// node_modules/date-fns/esm/getISOWeek/index.js +var MILLISECONDS_IN_WEEK4 = 6048e5; +function getISOWeek(dirtyDate) { requiredArgs(1, arguments); - var defaultOptions4 = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - } var date = toDate(dirtyDate); - var day = date.getDay(); - var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn); - date.setDate(date.getDate() + diff); - date.setHours(23, 59, 59, 999); - return date; -} - -// node_modules/date-fns/esm/endOfISOWeek/index.js -function endOfISOWeek(dirtyDate) { - requiredArgs(1, arguments); - return endOfWeek(dirtyDate, { - weekStartsOn: 1 - }); -} - -// node_modules/date-fns/esm/subMilliseconds/index.js -function subMilliseconds(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var amount = toInteger(dirtyAmount); - return addMilliseconds(dirtyDate, -amount); + var diff = startOfISOWeek(date).getTime() - startOfISOWeekYear(date).getTime(); + return Math.round(diff / MILLISECONDS_IN_WEEK4) + 1; } -// node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js -var MILLISECONDS_IN_DAY2 = 864e5; -function getUTCDayOfYear(dirtyDate) { +// node_modules/date-fns/esm/getTime/index.js +function getTime(dirtyDate) { requiredArgs(1, arguments); var date = toDate(dirtyDate); var timestamp = date.getTime(); - date.setUTCMonth(0, 1); - date.setUTCHours(0, 0, 0, 0); - var startOfYearTimestamp = date.getTime(); - var difference = timestamp - startOfYearTimestamp; - return Math.floor(difference / MILLISECONDS_IN_DAY2) + 1; -} - -// node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js -function startOfUTCISOWeek(dirtyDate) { - requiredArgs(1, arguments); - var weekStartsOn = 1; - var date = toDate(dirtyDate); - var day = date.getUTCDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date.setUTCDate(date.getUTCDate() - diff); - date.setUTCHours(0, 0, 0, 0); - return date; -} - -// node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js -function getUTCISOWeekYear(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var year = date.getUTCFullYear(); - var fourthOfJanuaryOfNextYear = new Date(0); - fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); - fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); - var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear); - var fourthOfJanuaryOfThisYear = new Date(0); - fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); - fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); - var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear); - if (date.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (date.getTime() >= startOfThisYear.getTime()) { - return year; - } else { - return year - 1; - } -} - -// node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js -function startOfUTCISOWeekYear(dirtyDate) { - requiredArgs(1, arguments); - var year = getUTCISOWeekYear(dirtyDate); - var fourthOfJanuary = new Date(0); - fourthOfJanuary.setUTCFullYear(year, 0, 4); - fourthOfJanuary.setUTCHours(0, 0, 0, 0); - var date = startOfUTCISOWeek(fourthOfJanuary); - return date; -} - -// node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js -var MILLISECONDS_IN_WEEK2 = 6048e5; -function getUTCISOWeek(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); - return Math.round(diff / MILLISECONDS_IN_WEEK2) + 1; + return timestamp; } -// node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js -function startOfUTCWeek(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; +// node_modules/date-fns/esm/getUnixTime/index.js +function getUnixTime(dirtyDate) { requiredArgs(1, arguments); - var defaultOptions4 = getDefaultOptions(); - var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); - } - var date = toDate(dirtyDate); - var day = date.getUTCDay(); - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; - date.setUTCDate(date.getUTCDate() - diff); - date.setUTCHours(0, 0, 0, 0); - return date; + return Math.floor(getTime(dirtyDate) / 1e3); } -// node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js -function getUTCWeekYear(dirtyDate, options) { +// node_modules/date-fns/esm/getWeekYear/index.js +function getWeekYear(dirtyDate, options) { var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; requiredArgs(1, arguments); var date = toDate(dirtyDate); - var year = date.getUTCFullYear(); + var year = date.getFullYear(); var defaultOptions4 = getDefaultOptions(); var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively"); } var firstWeekOfNextYear = new Date(0); - firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); - firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); - var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options); + firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); + firstWeekOfNextYear.setHours(0, 0, 0, 0); + var startOfNextYear = startOfWeek(firstWeekOfNextYear, options); var firstWeekOfThisYear = new Date(0); - firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); - firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); - var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options); + firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); + firstWeekOfThisYear.setHours(0, 0, 0, 0); + var startOfThisYear = startOfWeek(firstWeekOfThisYear, options); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { @@ -35954,5669 +29536,10679 @@ function getUTCWeekYear(dirtyDate, options) { } } -// node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js -function startOfUTCWeekYear(dirtyDate, options) { +// node_modules/date-fns/esm/startOfWeekYear/index.js +function startOfWeekYear(dirtyDate, options) { var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; requiredArgs(1, arguments); - var defaultOptions4 = getDefaultOptions(); - var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); - var year = getUTCWeekYear(dirtyDate, options); - var firstWeek = new Date(0); - firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate); - firstWeek.setUTCHours(0, 0, 0, 0); - var date = startOfUTCWeek(firstWeek, options); + var defaultOptions4 = getDefaultOptions(); + var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); + var year = getWeekYear(dirtyDate, options); + var firstWeek = new Date(0); + firstWeek.setFullYear(year, 0, firstWeekContainsDate); + firstWeek.setHours(0, 0, 0, 0); + var date = startOfWeek(firstWeek, options); + return date; +} + +// node_modules/date-fns/esm/getWeek/index.js +var MILLISECONDS_IN_WEEK5 = 6048e5; +function getWeek(dirtyDate, options) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var diff = startOfWeek(date, options).getTime() - startOfWeekYear(date, options).getTime(); + return Math.round(diff / MILLISECONDS_IN_WEEK5) + 1; +} + +// node_modules/date-fns/esm/lastDayOfMonth/index.js +function lastDayOfMonth(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + var month = date.getMonth(); + date.setFullYear(date.getFullYear(), month + 1, 0); + date.setHours(0, 0, 0, 0); return date; } -// node_modules/date-fns/esm/_lib/getUTCWeek/index.js -var MILLISECONDS_IN_WEEK3 = 6048e5; -function getUTCWeek(dirtyDate, options) { +// node_modules/date-fns/esm/getWeeksInMonth/index.js +function getWeeksInMonth(date, options) { requiredArgs(1, arguments); + return differenceInCalendarWeeks(lastDayOfMonth(date), startOfMonth(date), options) + 1; +} + +// node_modules/date-fns/esm/isAfter/index.js +function isAfter2(dirtyDate, dirtyDateToCompare) { + requiredArgs(2, arguments); var date = toDate(dirtyDate); - var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); - return Math.round(diff / MILLISECONDS_IN_WEEK3) + 1; + var dateToCompare = toDate(dirtyDateToCompare); + return date.getTime() > dateToCompare.getTime(); } -// node_modules/date-fns/esm/_lib/addLeadingZeros/index.js -function addLeadingZeros(number, targetLength) { - var sign = number < 0 ? "-" : ""; - var output = Math.abs(number).toString(); - while (output.length < targetLength) { - output = "0" + output; - } - return sign + output; +// node_modules/date-fns/esm/isBefore/index.js +function isBefore(dirtyDate, dirtyDateToCompare) { + requiredArgs(2, arguments); + var date = toDate(dirtyDate); + var dateToCompare = toDate(dirtyDateToCompare); + return date.getTime() < dateToCompare.getTime(); } -// node_modules/date-fns/esm/_lib/format/lightFormatters/index.js -var formatters = { - y: function y3(date, token) { - var signedYear = date.getUTCFullYear(); - var year = signedYear > 0 ? signedYear : 1 - signedYear; - return addLeadingZeros(token === "yy" ? year % 100 : year, token.length); - }, - M: function M3(date, token) { - var month = date.getUTCMonth(); - return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2); - }, - d: function d3(date, token) { - return addLeadingZeros(date.getUTCDate(), token.length); - }, - a: function a3(date, token) { - var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am"; - switch (token) { - case "a": - case "aa": - return dayPeriodEnumValue.toUpperCase(); - case "aaa": - return dayPeriodEnumValue; - case "aaaaa": - return dayPeriodEnumValue[0]; - case "aaaa": - default: - return dayPeriodEnumValue === "am" ? "a.m." : "p.m."; - } - }, - h: function h3(date, token) { - return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length); - }, - H: function H3(date, token) { - return addLeadingZeros(date.getUTCHours(), token.length); - }, - m: function m3(date, token) { - return addLeadingZeros(date.getUTCMinutes(), token.length); - }, - s: function s3(date, token) { - return addLeadingZeros(date.getUTCSeconds(), token.length); - }, - S: function S2(date, token) { - var numberOfDigits = token.length; - var milliseconds = date.getUTCMilliseconds(); - var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3)); - return addLeadingZeros(fractionalSeconds, token.length); - } -}; -var lightFormatters_default = formatters; +// node_modules/date-fns/esm/isSameMonth/index.js +function isSameMonth(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth(); +} -// node_modules/date-fns/esm/_lib/format/formatters/index.js -var dayPeriodEnum = { - am: "am", - pm: "pm", - midnight: "midnight", - noon: "noon", - morning: "morning", - afternoon: "afternoon", - evening: "evening", - night: "night" -}; -var formatters2 = { - G: function G2(date, token, localize2) { - var era = date.getUTCFullYear() > 0 ? 1 : 0; - switch (token) { - case "G": - case "GG": - case "GGG": - return localize2.era(era, { - width: "abbreviated" - }); - case "GGGGG": - return localize2.era(era, { - width: "narrow" - }); - case "GGGG": - default: - return localize2.era(era, { - width: "wide" - }); - } - }, - y: function y4(date, token, localize2) { - if (token === "yo") { - var signedYear = date.getUTCFullYear(); - var year = signedYear > 0 ? signedYear : 1 - signedYear; - return localize2.ordinalNumber(year, { - unit: "year" - }); - } - return lightFormatters_default.y(date, token); - }, - Y: function Y2(date, token, localize2, options) { - var signedWeekYear = getUTCWeekYear(date, options); - var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; - if (token === "YY") { - var twoDigitYear = weekYear % 100; - return addLeadingZeros(twoDigitYear, 2); - } - if (token === "Yo") { - return localize2.ordinalNumber(weekYear, { - unit: "year" - }); - } - return addLeadingZeros(weekYear, token.length); - }, - R: function R2(date, token) { - var isoWeekYear = getUTCISOWeekYear(date); - return addLeadingZeros(isoWeekYear, token.length); - }, - u: function u3(date, token) { - var year = date.getUTCFullYear(); - return addLeadingZeros(year, token.length); - }, - Q: function Q2(date, token, localize2) { - var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); - switch (token) { - case "Q": - return String(quarter); - case "QQ": - return addLeadingZeros(quarter, 2); - case "Qo": - return localize2.ordinalNumber(quarter, { - unit: "quarter" - }); - case "QQQ": - return localize2.quarter(quarter, { - width: "abbreviated", - context: "formatting" - }); - case "QQQQQ": - return localize2.quarter(quarter, { - width: "narrow", - context: "formatting" - }); - case "QQQQ": - default: - return localize2.quarter(quarter, { - width: "wide", - context: "formatting" - }); - } - }, - q: function q4(date, token, localize2) { - var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); - switch (token) { - case "q": - return String(quarter); - case "qq": - return addLeadingZeros(quarter, 2); - case "qo": - return localize2.ordinalNumber(quarter, { - unit: "quarter" - }); - case "qqq": - return localize2.quarter(quarter, { - width: "abbreviated", - context: "standalone" - }); - case "qqqqq": - return localize2.quarter(quarter, { - width: "narrow", - context: "standalone" - }); - case "qqqq": - default: - return localize2.quarter(quarter, { - width: "wide", - context: "standalone" - }); - } - }, - M: function M4(date, token, localize2) { - var month = date.getUTCMonth(); - switch (token) { - case "M": - case "MM": - return lightFormatters_default.M(date, token); - case "Mo": - return localize2.ordinalNumber(month + 1, { - unit: "month" - }); - case "MMM": - return localize2.month(month, { - width: "abbreviated", - context: "formatting" - }); - case "MMMMM": - return localize2.month(month, { - width: "narrow", - context: "formatting" - }); - case "MMMM": - default: - return localize2.month(month, { - width: "wide", - context: "formatting" - }); - } - }, - L: function L3(date, token, localize2) { - var month = date.getUTCMonth(); - switch (token) { - case "L": - return String(month + 1); - case "LL": - return addLeadingZeros(month + 1, 2); - case "Lo": - return localize2.ordinalNumber(month + 1, { - unit: "month" - }); - case "LLL": - return localize2.month(month, { - width: "abbreviated", - context: "standalone" - }); - case "LLLLL": - return localize2.month(month, { - width: "narrow", - context: "standalone" - }); - case "LLLL": - default: - return localize2.month(month, { - width: "wide", - context: "standalone" - }); - } - }, - w: function w4(date, token, localize2, options) { - var week = getUTCWeek(date, options); - if (token === "wo") { - return localize2.ordinalNumber(week, { - unit: "week" - }); - } - return addLeadingZeros(week, token.length); - }, - I: function I3(date, token, localize2) { - var isoWeek = getUTCISOWeek(date); - if (token === "Io") { - return localize2.ordinalNumber(isoWeek, { - unit: "week" - }); - } - return addLeadingZeros(isoWeek, token.length); - }, - d: function d4(date, token, localize2) { - if (token === "do") { - return localize2.ordinalNumber(date.getUTCDate(), { - unit: "date" - }); - } - return lightFormatters_default.d(date, token); - }, - D: function D3(date, token, localize2) { - var dayOfYear = getUTCDayOfYear(date); - if (token === "Do") { - return localize2.ordinalNumber(dayOfYear, { - unit: "dayOfYear" - }); - } - return addLeadingZeros(dayOfYear, token.length); - }, - E: function E3(date, token, localize2) { - var dayOfWeek = date.getUTCDay(); - switch (token) { - case "E": - case "EE": - case "EEE": - return localize2.day(dayOfWeek, { - width: "abbreviated", - context: "formatting" - }); - case "EEEEE": - return localize2.day(dayOfWeek, { - width: "narrow", - context: "formatting" - }); - case "EEEEEE": - return localize2.day(dayOfWeek, { - width: "short", - context: "formatting" - }); - case "EEEE": - default: - return localize2.day(dayOfWeek, { - width: "wide", - context: "formatting" - }); - } - }, - e: function e3(date, token, localize2, options) { - var dayOfWeek = date.getUTCDay(); - var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; - switch (token) { - case "e": - return String(localDayOfWeek); - case "ee": - return addLeadingZeros(localDayOfWeek, 2); - case "eo": - return localize2.ordinalNumber(localDayOfWeek, { - unit: "day" - }); - case "eee": - return localize2.day(dayOfWeek, { - width: "abbreviated", - context: "formatting" - }); - case "eeeee": - return localize2.day(dayOfWeek, { - width: "narrow", - context: "formatting" - }); - case "eeeeee": - return localize2.day(dayOfWeek, { - width: "short", - context: "formatting" - }); - case "eeee": - default: - return localize2.day(dayOfWeek, { - width: "wide", - context: "formatting" - }); - } - }, - c: function c3(date, token, localize2, options) { - var dayOfWeek = date.getUTCDay(); - var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; - switch (token) { - case "c": - return String(localDayOfWeek); - case "cc": - return addLeadingZeros(localDayOfWeek, token.length); - case "co": - return localize2.ordinalNumber(localDayOfWeek, { - unit: "day" - }); - case "ccc": - return localize2.day(dayOfWeek, { - width: "abbreviated", - context: "standalone" - }); - case "ccccc": - return localize2.day(dayOfWeek, { - width: "narrow", - context: "standalone" - }); - case "cccccc": - return localize2.day(dayOfWeek, { - width: "short", - context: "standalone" - }); - case "cccc": - default: - return localize2.day(dayOfWeek, { - width: "wide", - context: "standalone" - }); - } - }, - i: function i3(date, token, localize2) { - var dayOfWeek = date.getUTCDay(); - var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; - switch (token) { - case "i": - return String(isoDayOfWeek); - case "ii": - return addLeadingZeros(isoDayOfWeek, token.length); - case "io": - return localize2.ordinalNumber(isoDayOfWeek, { - unit: "day" - }); - case "iii": - return localize2.day(dayOfWeek, { - width: "abbreviated", - context: "formatting" - }); - case "iiiii": - return localize2.day(dayOfWeek, { - width: "narrow", - context: "formatting" - }); - case "iiiiii": - return localize2.day(dayOfWeek, { - width: "short", - context: "formatting" - }); - case "iiii": - default: - return localize2.day(dayOfWeek, { - width: "wide", - context: "formatting" - }); - } - }, - a: function a4(date, token, localize2) { - var hours = date.getUTCHours(); - var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; - switch (token) { - case "a": - case "aa": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting" - }); - case "aaa": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting" - }).toLowerCase(); - case "aaaaa": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "narrow", - context: "formatting" - }); - case "aaaa": - default: - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "wide", - context: "formatting" - }); +// node_modules/date-fns/esm/isSameYear/index.js +function isSameYear(dirtyDateLeft, dirtyDateRight) { + requiredArgs(2, arguments); + var dateLeft = toDate(dirtyDateLeft); + var dateRight = toDate(dirtyDateRight); + return dateLeft.getFullYear() === dateRight.getFullYear(); +} + +// node_modules/date-fns/esm/subDays/index.js +function subDays(dirtyDate, dirtyAmount) { + requiredArgs(2, arguments); + var amount = toInteger(dirtyAmount); + return addDays(dirtyDate, -amount); +} + +// node_modules/date-fns/esm/setMonth/index.js +function setMonth(dirtyDate, dirtyMonth) { + requiredArgs(2, arguments); + var date = toDate(dirtyDate); + var month = toInteger(dirtyMonth); + var year = date.getFullYear(); + var day = date.getDate(); + var dateWithDesiredMonth = new Date(0); + dateWithDesiredMonth.setFullYear(year, month, 15); + dateWithDesiredMonth.setHours(0, 0, 0, 0); + var daysInMonth = getDaysInMonth(dateWithDesiredMonth); + date.setMonth(month, Math.min(day, daysInMonth)); + return date; +} + +// node_modules/date-fns/esm/setYear/index.js +function setYear(dirtyDate, dirtyYear) { + requiredArgs(2, arguments); + var date = toDate(dirtyDate); + var year = toInteger(dirtyYear); + if (isNaN(date.getTime())) { + return new Date(NaN); + } + date.setFullYear(year); + return date; +} + +// src/utils/metadata/frontmatter/fm.ts +var import_lodash = __toESM(require_lodash()); +var import_obsidian7 = require("obsidian"); + +// src/utils/metadata/dv.ts +var import_obsidian6 = require("obsidian"); +var LocationWrapper = { + fullLine: { start: "", end: "" }, + brackets: { start: "[", end: "]" }, + parenthesis: { start: "(", end: ")" } +}; +var fieldComponents = [ + "inQuote", + "inList", + "startStyle", + "attribute", + "endStyle", + "beforeSeparatorSpacer", + "afterSeparatorSpacer", + "values" +]; +var genericFieldRegex = "(?>(\\s+)?)?(?- )?(?[_\\*~`]*)(?[0-9\\w\\p{Letter}\\p{Emoji_Presentation}][-0-9\\w\\p{Letter}\\p{Emoji_Presentation}\\s]*)(?[_\\*~`]*)(?\\s*)"; +var inlineFieldRegex = (attribute) => `(?>(\\s+)?)?(?- )?(?[_\\*~\`]*)(?${attribute})(?[_\\*~\`]*)(?\\s*)::(?\\s*)`; +var fullLineRegex = new RegExp( + `^${genericFieldRegex}::\\s*(?.*)?`, + "u" +); +var inSentenceRegexBrackets = new RegExp( + `\\[${genericFieldRegex}::\\s*(?[^\\]]+)?\\]`, + "gu" +); +var inSentenceRegexPar = new RegExp( + `\\(${genericFieldRegex}::\\s*(?[^\\)]+)?\\)`, + "gu" +); +var encodeLink = (value) => { + return value ? value.replace(/\[\[/g, "\u{1F54C}\u{1F527}").replace(/\]\]/g, "\u{1F413}\u{1F400}") : value; +}; +var decodeLink = (value) => { + return value ? value.replace(/🕌🔧/gu, "[[").replace(/🐓🐀/gu, "]]") : value; +}; +var matchInlineFields = (regex, line, attribute, input, location = "fullLine") => { + const sR = line.matchAll(regex); + let next = sR.next(); + const newFields = []; + while (!next.done) { + const match2 = next.value; + if (match2.groups && Object.keys(match2.groups).every((j4) => fieldComponents.includes(j4))) { + const { + inList, + inQuote, + startStyle, + endStyle, + beforeSeparatorSpacer, + afterSeparatorSpacer, + values + } = match2.groups; + const inputArray = input ? input.replace(/(\,\s+)/g, ",").split(",") : [""]; + const newValue = inputArray.length == 1 ? inputArray[0] : `${serializeMultiDisplayString(inputArray)}`; + const start = LocationWrapper[location].start; + const end = LocationWrapper[location].end; + newFields.push({ + oldField: match2[0], + newField: `${inQuote || ""}${start}${inList || ""}${startStyle}${attribute}${endStyle}${beforeSeparatorSpacer}::${afterSeparatorSpacer}${newValue}${end}` + }); } - }, - b: function b3(date, token, localize2) { - var hours = date.getUTCHours(); - var dayPeriodEnumValue; - if (hours === 12) { - dayPeriodEnumValue = dayPeriodEnum.noon; - } else if (hours === 0) { - dayPeriodEnumValue = dayPeriodEnum.midnight; + next = sR.next(); + } + return newFields; +}; +async function replaceValues(plugin, fileOrFilePath, attribute, input, previousItemsCount = 0) { + var _a2, _b2; + let file; + if (fileOrFilePath instanceof import_obsidian6.TFile) { + file = fileOrFilePath; + } else { + const _file = plugin.app.vault.getAbstractFileByPath(fileOrFilePath); + if (_file instanceof import_obsidian6.TFile && _file.extension == "md") { + file = _file; } else { - dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; - } - switch (token) { - case "b": - case "bb": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting" - }); - case "bbb": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting" - }).toLowerCase(); - case "bbbbb": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "narrow", - context: "formatting" - }); - case "bbbb": - default: - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "wide", - context: "formatting" - }); + throw Error("path doesn't correspond to a proper file"); } - }, - B: function B4(date, token, localize2) { - var hours = date.getUTCHours(); - var dayPeriodEnumValue; - if (hours >= 17) { - dayPeriodEnumValue = dayPeriodEnum.evening; - } else if (hours >= 12) { - dayPeriodEnumValue = dayPeriodEnum.afternoon; - } else if (hours >= 4) { - dayPeriodEnumValue = dayPeriodEnum.morning; + } + const content = (await plugin.app.vault.read(file)).split("\n"); + const frontmatter = (_a2 = plugin.app.metadataCache.getFileCache(file)) == null ? void 0 : _a2.frontmatter; + const skippedLines = []; + const { + position: { start, end } + } = frontmatter ? frontmatter : { position: { start: void 0, end: void 0 } }; + const newContent = content.map((line, i4) => { + const encodedInput = encodeLink(input); + let encodedLine = encodeLink(line); + const fullLineRegex2 = new RegExp( + `^${inlineFieldRegex(attribute)}(?[^\\]]*)`, + "u" + ); + const fR = encodedLine.match(fullLineRegex2); + if ((fR == null ? void 0 : fR.groups) && Object.keys(fR.groups).every((j4) => fieldComponents.includes(j4))) { + const { + inList, + inQuote, + startStyle, + endStyle, + beforeSeparatorSpacer, + afterSeparatorSpacer, + values + } = fR.groups; + const inputArray = input ? input.replace(/(\,\s+)/g, ",").split(",").sort() : []; + const hiddenValue = ""; + const newValue = inputArray.length == 1 ? inputArray[0] : `${serializeMultiDisplayString(inputArray)}`; + return `${inQuote || ""}${inList || ""}${startStyle}${attribute}${endStyle}${beforeSeparatorSpacer}::${afterSeparatorSpacer}${hiddenValue + newValue}`; } else { - dayPeriodEnumValue = dayPeriodEnum.night; - } - switch (token) { - case "B": - case "BB": - case "BBB": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "abbreviated", - context: "formatting" - }); - case "BBBBB": - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "narrow", - context: "formatting" - }); - case "BBBB": - default: - return localize2.dayPeriod(dayPeriodEnumValue, { - width: "wide", - context: "formatting" - }); - } - }, - h: function h4(date, token, localize2) { - if (token === "ho") { - var hours = date.getUTCHours() % 12; - if (hours === 0) - hours = 12; - return localize2.ordinalNumber(hours, { - unit: "hour" - }); - } - return lightFormatters_default.h(date, token); - }, - H: function H4(date, token, localize2) { - if (token === "Ho") { - return localize2.ordinalNumber(date.getUTCHours(), { - unit: "hour" - }); - } - return lightFormatters_default.H(date, token); - }, - K: function K2(date, token, localize2) { - var hours = date.getUTCHours() % 12; - if (token === "Ko") { - return localize2.ordinalNumber(hours, { - unit: "hour" + const newFields = []; + const inSentenceRegexBrackets2 = new RegExp( + `\\[${inlineFieldRegex(attribute)}(?[^\\]]+)?\\]`, + "gu" + ); + const inSentenceRegexPar2 = new RegExp( + `\\(${inlineFieldRegex(attribute)}(?[^\\)]+)?\\)`, + "gu" + ); + newFields.push( + ...matchInlineFields( + inSentenceRegexBrackets2, + encodedLine, + attribute, + encodedInput, + "brackets" /* brackets */ + ) + ); + newFields.push( + ...matchInlineFields( + inSentenceRegexPar2, + encodedLine, + attribute, + encodedInput, + "parenthesis" /* parenthesis */ + ) + ); + newFields.forEach((field) => { + const fieldRegex = new RegExp( + field.oldField.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), + "u" + ); + encodedLine = encodedLine.replace(fieldRegex, field.newField); }); + return decodeLink(encodedLine); } - return addLeadingZeros(hours, token.length); - }, - k: function k4(date, token, localize2) { - var hours = date.getUTCHours(); - if (hours === 0) - hours = 24; - if (token === "ko") { - return localize2.ordinalNumber(hours, { - unit: "hour" - }); + }); + await plugin.app.vault.modify( + file, + newContent.filter((line, i4) => !skippedLines.includes(i4)).join("\n") + ); + const editor = (_b2 = plugin.app.workspace.getActiveViewOfType(import_obsidian6.MarkdownView)) == null ? void 0 : _b2.editor; + if (editor) { + const lineNumber = editor.getCursor().line; + editor.setCursor({ + line: editor.getCursor().line, + ch: editor.getLine(lineNumber).length + }); + } +} + +// src/utils/metadata/frontmatter/detectYAMLType.ts +var detectYAMLType = (value, key2) => { + if (typeof value === "string") { + if (/\/\/(\S+?(?:jpe?g|png|gif|svg))/gi.test(value) || value.includes("unsplash")) { + return "image"; } - return addLeadingZeros(hours, token.length); - }, - m: function m4(date, token, localize2) { - if (token === "mo") { - return localize2.ordinalNumber(date.getUTCMinutes(), { - unit: "minute" - }); + if (/^\d{4}-\d{2}-\d{2}$/.test(value)) { + return "date"; } - return lightFormatters_default.m(date, token); - }, - s: function s4(date, token, localize2) { - if (token === "so") { - return localize2.ordinalNumber(date.getUTCSeconds(), { - unit: "second" - }); + if (key2 == "tag" || key2 == "tags") { + return "tag"; } - return lightFormatters_default.s(date, token); - }, - S: function S3(date, token) { - return lightFormatters_default.S(date, token); - }, - X: function X2(date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); - if (timezoneOffset === 0) { - return "Z"; + if (/\[\[.*?\]\]/.test(value)) { + return "link"; } - switch (token) { - case "X": - return formatTimezoneWithOptionalMinutes(timezoneOffset); - case "XXXX": - case "XX": - return formatTimezone(timezoneOffset); - case "XXXXX": - case "XXX": - default: - return formatTimezone(timezoneOffset, ":"); + } else if (typeof value === "number") { + return "number"; + } else if (typeof value === "boolean") { + return "boolean"; + } else if (!value) { + return "unknown"; + } else if (Array.isArray(value) || typeof value === "string" && value.indexOf(",") > -1) { + let arrayValue = Array.isArray(value) ? value : []; + if (typeof value === "string" && value.indexOf(",") > -1) { + arrayValue = parseMultiString(value); } - }, - x: function x4(date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); - switch (token) { - case "x": - return formatTimezoneWithOptionalMinutes(timezoneOffset); - case "xxxx": - case "xx": - return formatTimezone(timezoneOffset); - case "xxxxx": - case "xxx": - default: - return formatTimezone(timezoneOffset, ":"); + if (key2 == "tag" || key2 == "tags") { + return "tag-multi"; } - }, - O: function O3(date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); - switch (token) { - case "O": - case "OO": - case "OOO": - return "GMT" + formatTimezoneShort(timezoneOffset, ":"); - case "OOOO": - default: - return "GMT" + formatTimezone(timezoneOffset, ":"); + if (arrayValue.length == 1 && Array.isArray(arrayValue[0]) && arrayValue[0].length == 1 && typeof arrayValue[0][0] === "string") { + return "link"; } - }, - z: function z4(date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timezoneOffset = originalDate.getTimezoneOffset(); - switch (token) { - case "z": - case "zz": - case "zzz": - return "GMT" + formatTimezoneShort(timezoneOffset, ":"); - case "zzzz": - default: - return "GMT" + formatTimezone(timezoneOffset, ":"); + const types2 = uniq(arrayValue.map((f4) => detectYAMLType(f4, key2))); + if (types2.length == 1 && types2[0] == "link") { + return "link-multi"; } - }, - t: function t3(date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timestamp = Math.floor(originalDate.getTime() / 1e3); - return addLeadingZeros(timestamp, token.length); - }, - T: function T5(date, token, _localize, options) { - var originalDate = options._originalDate || date; - var timestamp = originalDate.getTime(); - return addLeadingZeros(timestamp, token.length); + return "option-multi"; + } else if (value.isLuxonDateTime) { + return "date"; + } else if (value.isLuxonDuration) { + return "duration"; + } else if (value.type == "file") { + return "link"; + } else if (typeof value === "object" && !Array.isArray(value) && value !== null) { + return "object"; } + return "text"; }; -function formatTimezoneShort(offset2, dirtyDelimiter) { - var sign = offset2 > 0 ? "-" : "+"; - var absOffset = Math.abs(offset2); - var hours = Math.floor(absOffset / 60); - var minutes = absOffset % 60; - if (minutes === 0) { - return sign + String(hours); - } - var delimiter = dirtyDelimiter || ""; - return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2); -} -function formatTimezoneWithOptionalMinutes(offset2, dirtyDelimiter) { - if (offset2 % 60 === 0) { - var sign = offset2 > 0 ? "-" : "+"; - return sign + addLeadingZeros(Math.abs(offset2) / 60, 2); + +// src/utils/metadata/frontmatter/frontMatterKeys.ts +var frontMatterKeys = (fm) => { + return Object.keys(fm != null ? fm : {}).filter((f4) => f4 != "position").filter((f4) => f4 != "tag" && f4 != "tags"); +}; + +// src/utils/metadata/frontmatter/yamlTypeToMDBType.ts +var yamlTypeToMDBType = (YAMLtype) => { + switch (YAMLtype) { + case "duration": + return "text"; + break; + case "unknown": + return "text"; + break; } - return formatTimezone(offset2, dirtyDelimiter); -} -function formatTimezone(offset2, dirtyDelimiter) { - var delimiter = dirtyDelimiter || ""; - var sign = offset2 > 0 ? "-" : "+"; - var absOffset = Math.abs(offset2); - var hours = addLeadingZeros(Math.floor(absOffset / 60), 2); - var minutes = addLeadingZeros(absOffset % 60, 2); - return sign + hours + delimiter + minutes; -} -var formatters_default = formatters2; + return YAMLtype; +}; -// node_modules/date-fns/esm/_lib/format/longFormatters/index.js -var dateLongFormatter = function dateLongFormatter2(pattern, formatLong2) { - switch (pattern) { - case "P": - return formatLong2.date({ - width: "short" - }); - case "PP": - return formatLong2.date({ - width: "medium" - }); - case "PPP": - return formatLong2.date({ - width: "long" - }); - case "PPPP": - default: - return formatLong2.date({ - width: "full" +// src/utils/metadata/frontmatter/fm.ts +var saveContextToFile = (file, cols, context, plugin) => { + if (plugin.metadata.canProcessFrontmatter()) { + plugin.metadata.processFrontMatter(file.path, (frontmatter) => { + Object.keys(context).filter( + (f4) => cols.find((c4) => c4.name == f4) && cols.find((c4) => c4.name == f4).hidden != "true" && !cols.find((c4) => c4.name == f4).type.contains("file") && context[f4] + ).forEach((f4) => { + const col = cols.find((c4) => c4.name == f4); + frontmatter[f4] = valueForFrontmatter(col.type, context[f4]); + frontmatter[f4] = valueForFrontmatter(col.type, context[f4]); }); + }); } }; -var timeLongFormatter = function timeLongFormatter2(pattern, formatLong2) { - switch (pattern) { - case "p": - return formatLong2.time({ - width: "short" - }); - case "pp": - return formatLong2.time({ - width: "medium" - }); - case "ppp": - return formatLong2.time({ - width: "long" - }); - case "pppp": - default: - return formatLong2.time({ - width: "full" - }); +var frontMatterForFile = (plugin, file) => { + let currentCache; + if (file instanceof import_obsidian7.TFile && plugin.app.metadataCache.getFileCache(file) !== null) { + currentCache = plugin.app.metadataCache.getFileCache(file); + } + return currentCache == null ? void 0 : currentCache.frontmatter; +}; +var guestimateTypes = (_files, plugin, dv) => { + const typesArray = _files.map((f4) => getAbstractFileAtPath(plugin, f4)).filter((f4) => f4).map((k5) => { + const fm = dv && plugin.dataViewAPI() ? plugin.dataViewAPI().page(k5.path) : frontMatterForFile(plugin, k5); + const fmKeys = dv ? Object.keys(fm != null ? fm : {}).filter( + (f4, i4, self2) => !self2.find( + (g4, j4) => g4.toLowerCase().replace(/\s/g, "-") == f4.toLowerCase().replace(/\s/g, "-") && i4 > j4 + ) ? true : false + ).filter((f4) => f4 != "file") : frontMatterKeys(fm); + return fmKeys.reduce( + (pk, ck) => ({ ...pk, [ck]: detectYAMLType(fm[ck], ck) }), + {} + ); + }); + const types2 = typesArray.reduce( + (p3, c4) => { + const newSet = Object.keys(c4).reduce( + (pk, ck) => { + var _a2; + return { ...pk, [ck]: [...(_a2 = p3 == null ? void 0 : p3[ck]) != null ? _a2 : [], c4[ck]] }; + }, + { ...p3 } + ); + return newSet; + }, + {} + ); + const guessType = (ts) => { + return import_lodash.default.head((0, import_lodash.default)(ts).countBy().entries().maxBy(import_lodash.default.last)); + }; + const guessedTypes = Object.keys(types2).reduce((p3, c4) => { + return { ...p3, [c4]: guessType(types2[c4]) }; + }, {}); + return guessedTypes; +}; +var valueForFrontmatter = (type, value) => { + if (type == "number") { + return parseFloat(value); + } else if (type == "boolean") { + return value == "true"; + } else if (type.contains("multi")) { + return parseMultiString(value).map( + (f4) => valueForFrontmatter(type.replace("-multi", ""), f4) + ); + } else if (type.contains("link") || type.contains("context")) { + return `[[${value}]]`; } + return value; }; -var dateTimeLongFormatter = function dateTimeLongFormatter2(pattern, formatLong2) { - var matchResult = pattern.match(/(P+)(p+)?/) || []; - var datePattern = matchResult[1]; - var timePattern = matchResult[2]; - if (!timePattern) { - return dateLongFormatter(pattern, formatLong2); - } - var dateTimeFormat; - switch (datePattern) { - case "P": - dateTimeFormat = formatLong2.dateTime({ - width: "short" - }); - break; - case "PP": - dateTimeFormat = formatLong2.dateTime({ - width: "medium" - }); - break; - case "PPP": - dateTimeFormat = formatLong2.dateTime({ - width: "long" - }); - break; - case "PPPP": - default: - dateTimeFormat = formatLong2.dateTime({ - width: "full" - }); - break; +var valueForDataview = (type, value) => { + if (type.contains("link") || type.contains("context")) { + return `[[${value}]]`; } - return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2)); + return value; }; -var longFormatters = { - p: timeLongFormatter, - P: dateTimeLongFormatter +var renameFrontmatterKey = (plugin, path, key2, name) => { + if (plugin.metadata.canProcessFrontmatter()) { + plugin.metadata.processFrontMatter(path, (frontmatter) => { + if (key2 in frontmatter) { + frontmatter[name] = frontmatter[key2]; + delete frontmatter[key2]; + } + }); + } }; -var longFormatters_default = longFormatters; - -// node_modules/date-fns/esm/_lib/protectedTokens/index.js -var protectedDayOfYearTokens = ["D", "DD"]; -var protectedWeekYearTokens = ["YY", "YYYY"]; -function isProtectedDayOfYearToken(token) { - return protectedDayOfYearTokens.indexOf(token) !== -1; -} -function isProtectedWeekYearToken(token) { - return protectedWeekYearTokens.indexOf(token) !== -1; -} -function throwProtectedError(token, format2, input) { - if (token === "YYYY") { - throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); - } else if (token === "YY") { - throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); - } else if (token === "D") { - throw new RangeError("Use `d` instead of `D` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); - } else if (token === "DD") { - throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md")); +var defaultValueForType = (value, type) => { + if (type == "date") { + return format(Date.now(), "yyyy-MM-dd"); } -} - -// node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js -var formatDistanceLocale = { - 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" + if (type == "number") { + return 0; } -}; -var formatDistance = function formatDistance2(token, count2, options) { - var result; - var tokenValue = formatDistanceLocale[token]; - if (typeof tokenValue === "string") { - result = tokenValue; - } else if (count2 === 1) { - result = tokenValue.one; - } else { - result = tokenValue.other.replace("{{count}}", count2.toString()); + if (type == "boolean") { + return true; } - if (options !== null && options !== void 0 && options.addSuffix) { - if (options.comparison && options.comparison > 0) { - return "in " + result; - } else { - return result + " ago"; - } + if (type == "link") { + return "[[Select Note]]"; + } + if (type == "option") { + return "one, two"; + } + if (type == "text") { + return " "; + } + if (type == "image") { + return "https://images.unsplash.com/photo-1675789652575-0a5d2425b6c2?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80"; } - return result; -}; -var formatDistance_default = formatDistance; - -// node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js -function buildFormatLongFn(args) { - return function() { - var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var width = options.width ? String(options.width) : args.defaultWidth; - var format2 = args.formats[width] || args.formats[args.defaultWidth]; - return format2; - }; -} - -// node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js -var dateFormats = { - full: "EEEE, MMMM do, y", - long: "MMMM do, y", - medium: "MMM d, y", - short: "MM/dd/yyyy" }; -var timeFormats = { - full: "h:mm:ss a zzzz", - long: "h:mm:ss a z", - medium: "h:mm:ss a", - short: "h:mm a" +var changeFrontmatterType = (plugin, path, key2, type) => { + if (plugin.metadata.canProcessFrontmatter()) { + plugin.metadata.processFrontMatter(path, (frontmatter) => { + if (key2 in frontmatter) { + frontmatter[key2] = defaultValueForType(frontmatter[key2], type); + } + }); + } }; -var dateTimeFormats = { - full: "{{date}} 'at' {{time}}", - long: "{{date}} 'at' {{time}}", - medium: "{{date}}, {{time}}", - short: "{{date}}, {{time}}" +var deleteFrontmatterValue = (plugin, path, key2) => { + if (plugin.metadata.canProcessFrontmatter()) { + plugin.metadata.processFrontMatter(path, (frontmatter) => { + if (plugin.dataViewAPI()) { + if (plugin.dataViewAPI().page(path)[key2] && !frontmatter[key2]) { + replaceValues(plugin, path, key2, ""); + } else { + if (key2 in frontmatter) { + delete frontmatter[key2]; + } + } + } else { + if (key2 in frontmatter) { + delete frontmatter[key2]; + } + } + }); + } }; -var formatLong = { - date: buildFormatLongFn({ - formats: dateFormats, - defaultWidth: "full" - }), - time: buildFormatLongFn({ - formats: timeFormats, - defaultWidth: "full" - }), - dateTime: buildFormatLongFn({ - formats: dateTimeFormats, - defaultWidth: "full" - }) +var saveFrontmatterValue = (plugin, path, key2, value, type, forceSave) => { + let afile = getAbstractFileAtPath(plugin, path); + const fileCache = plugin.index.filesIndex.get(path); + if (afile) { + if (fileCache && fileCache.isFolder && fileCache.folderNote) { + afile = getAbstractFileAtPath(plugin, fileCache.folderNote.folderNotePath); + } + if (afile instanceof import_obsidian7.TFile) { + if (plugin.metadata.canProcessFrontmatter()) { + plugin.metadata.processFrontMatter(afile.path, (frontmatter) => { + var _a2; + if (plugin.dataViewAPI()) { + if (((_a2 = plugin.dataViewAPI().page(afile.path)) == null ? void 0 : _a2[key2]) && !frontmatter[key2]) { + replaceValues(plugin, afile.path, key2, valueForDataview(type, value)); + } else { + if (key2 in frontmatter || forceSave) { + frontmatter[key2] = valueForFrontmatter(type, value); + } + } + } else { + if (key2 in frontmatter || forceSave) { + frontmatter[key2] = valueForFrontmatter(type, value); + } + } + }); + } + } + } }; -var formatLong_default = formatLong; -// node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js -var formatRelativeLocale = { - lastWeek: "'last' eeee 'at' p", - yesterday: "'yesterday at' p", - today: "'today at' p", - tomorrow: "'tomorrow at' p", - nextWeek: "eeee 'at' p", - other: "P" +// src/utils/contexts/links.ts +var valueContainsLink = (link, value) => { + return parseMultiString(value).some((f4) => link == parseLinkString(f4)); }; -var formatRelative = function formatRelative2(token, _date, _baseDate, _options) { - return formatRelativeLocale[token]; +var replaceLinkInValue = (link, newLink, value) => { + return serializeMultiString(parseMultiString(value).map((f4) => parseLinkString(f4) == link ? newLink : link)); }; -var formatRelative_default = formatRelative; - -// node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js -function buildLocalizeFn(args) { - return function(dirtyIndex, options) { - var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone"; - var valuesArray; - if (context === "formatting" && args.formattingValues) { - var defaultWidth = args.defaultFormattingWidth || args.defaultWidth; - var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth; - valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; - } else { - var _defaultWidth = args.defaultWidth; - var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth; - valuesArray = args.values[_width] || args.values[_defaultWidth]; - } - var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; - return valuesArray[index]; - }; -} - -// node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js -var eraValues = { - narrow: ["B", "A"], - abbreviated: ["BC", "AD"], - wide: ["Before Christ", "Anno Domini"] +var removeLinkInValue = (link, value) => { + return serializeMultiString(parseMultiString(value).filter((f4) => f4 != link)); }; -var quarterValues = { - narrow: ["1", "2", "3", "4"], - abbreviated: ["Q1", "Q2", "Q3", "Q4"], - wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] +var linkColumns = (cols) => { + return cols.filter((f4) => f4.type.startsWith("link") || f4.type.startsWith("context")); }; -var monthValues = { - 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"] +var removeLinksInRow = (plugin, row, link, cols) => { + if (cols.length == 0) { + return row; + } + const deltaRow = cols.reduce((p3, c4) => { + if (valueContainsLink(link, row[c4.name])) { + const newValue = removeLinkInValue(link, row[c4.name]); + saveFrontmatterValue( + plugin, + row.File, + c4.name, + newValue, + c4.type, + plugin.settings.saveAllContextToFrontmatter + ); + return { ...p3, [c4.name]: newValue }; + } + return p3; + }, {}); + return { ...row, ...deltaRow }; }; -var dayValues = { - 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"] +var renameLinksInRow = (plugin, row, link, newLink, cols) => { + if (cols.length == 0) { + return row; + } + const deltaRow = cols.reduce((p3, c4) => { + if (valueContainsLink(link, row[c4.name])) { + const newValue = replaceLinkInValue(link, newLink, row[c4.name]); + saveFrontmatterValue( + plugin, + row.File, + c4.name, + newValue, + c4.type, + plugin.settings.saveAllContextToFrontmatter + ); + return { ...p3, [c4.name]: newValue }; + } + return p3; + }, {}); + return { ...row, ...deltaRow }; }; -var dayPeriodValues = { - 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" + +// src/utils/metadata/dataview/parseDataview.ts +var parseDataview = (field, value) => { + const YAMLtype = detectYAMLType(value, field); + switch (YAMLtype) { + case "object": + return JSON.stringify(value); + break; + case "number": + return value.toString(); + break; + case "boolean": + return value ? "true" : "false"; + break; + case "date": + return format(new Date(value.ts), "yyyy-MM-dd"); + break; + case "duration": + return serializeMultiDisplayString(Object.keys(value.values).reduce( + (p3, c4) => [ + ...p3, + ...value.values[c4] > 0 ? [value.values[c4] + " " + c4] : [] + ], + [] + )); + break; + case "option-multi": + case "link-multi": + if (typeof value === "string") { + return value; + } + return serializeMultiString( + value.map((v3) => { + if (!v3) { + return ""; + } + if (typeof v3 === "string") { + return v3; + } + if (v3.path) { + return v3.path; + } + if (Array.isArray(value) && v3.length == 1 && Array.isArray(v3[0]) && v3[0].length == 1 && typeof v3[0][0] === "string") { + return v3[0][0]; + } + return JSON.stringify(v3); + }) + ); + break; + case "link": + { + if (Array.isArray(value) && value.length == 1 && Array.isArray(value[0]) && value[0].length == 1 && typeof value[0][0] === "string") { + return value[0][0]; + } else if (typeof value === "string") { + return value; + } + return value.path; + } + break; + case "text": + case "tag": + case "image": + return value; + break; } + return ""; }; -var formattingDayPeriodValues = { - 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" + +// src/utils/metadata/frontmatter/parseFrontMatter.ts +var parseFrontMatter = (field, value) => { + const YAMLtype = detectYAMLType(value, field); + switch (YAMLtype) { + case "object": + return JSON.stringify(value); + break; + case "number": + return value.toString(); + break; + case "boolean": + return value ? "true" : "false"; + break; + case "date": + return value; + break; + case "duration": + return serializeMultiDisplayString(Object.keys(value.values).reduce( + (p3, c4) => [ + ...p3, + ...value.values[c4] > 0 ? [value.values[c4] + " " + c4] : [] + ], + [] + )); + break; + case "option-multi": + case "link-multi": + if (typeof value === "string") { + return parseLinkString(value); + } + return serializeMultiString( + value.map((v3) => { + if (!v3) { + return ""; + } + if (typeof v3 === "string") { + return parseLinkString(v3); + } + if (v3.path) { + return v3.path; + } + if (Array.isArray(value) && v3.length == 1 && Array.isArray(v3[0]) && v3[0].length == 1 && typeof v3[0][0] === "string") { + return v3[0][0]; + } + return JSON.stringify(v3); + }) + ); + break; + case "link": + { + if (Array.isArray(value) && value.length == 1 && Array.isArray(value[0]) && value[0].length == 1 && typeof value[0][0] === "string") { + return value[0][0]; + } else if (typeof value === "string") { + return parseLinkString(value); + } + return value.path; + } + break; + case "text": + case "tag": + case "image": + return value; + break; } + return ""; }; -var ordinalNumber = function ordinalNumber2(dirtyNumber, _options) { - var number = Number(dirtyNumber); - var rem100 = number % 100; - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + "st"; - case 2: - return number + "nd"; - case 3: - return number + "rd"; + +// src/dispatch/mdb.ts +var processContextFile = async (plugin, space, processor, fallback) => { + const dbFileExists = await plugin.app.vault.adapter.exists(space.dbPath); + if (dbFileExists) { + const contextDB = await getMDBTable(plugin, space, "files", "context"); + if (contextDB) { + await processor(contextDB, space); + return; + } else if (fallback) { + await fallback(); } + } else if (fallback) { + await fallback(); } - return number + "th"; }; -var localize = { - ordinalNumber, - era: buildLocalizeFn({ - values: eraValues, - defaultWidth: "wide" - }), - quarter: buildLocalizeFn({ - values: quarterValues, - defaultWidth: "wide", - argumentCallback: function argumentCallback(quarter) { - return quarter - 1; - } - }), - month: buildLocalizeFn({ - values: monthValues, - defaultWidth: "wide" - }), - day: buildLocalizeFn({ - values: dayValues, - defaultWidth: "wide" - }), - dayPeriod: buildLocalizeFn({ - values: dayPeriodValues, - defaultWidth: "wide", - formattingValues: formattingDayPeriodValues, - defaultFormattingWidth: "wide" - }) +var saveDB = async (plugin, context, newTable) => { + return saveMDBToPath(plugin, context, newTable); }; -var localize_default = localize; - -// node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js -function buildMatchFn(args) { - return function(string) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var width = options.width; - var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; - var matchResult = string.match(matchPattern); - if (!matchResult) { - return null; - } - var matchedString = matchResult[0]; - var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; - var key2 = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) { - return pattern.test(matchedString); - }) : findKey(parsePatterns, function(pattern) { - return pattern.test(matchedString); - }); - var value; - value = args.valueCallback ? args.valueCallback(key2) : key2; - value = options.valueCallback ? options.valueCallback(value) : value; - var rest = string.slice(matchedString.length); - return { - value, - rest - }; - }; -} -function findKey(object, predicate) { - for (var key2 in object) { - if (object.hasOwnProperty(key2) && predicate(object[key2])) { - return key2; - } - } - return void 0; -} -function findIndex(array, predicate) { - for (var key2 = 0; key2 < array.length; key2++) { - if (predicate(array[key2])) { - return key2; - } +var insertColumn = (table, column) => { + if (table.cols.find((f4) => f4.name == column.name)) { + new import_obsidian8.Notice(i18n_default.notice.duplicatePropertyName); + return; } - return void 0; -} - -// node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js -function buildMatchPatternFn(args) { - return function(string) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var matchResult = string.match(args.matchPattern); - if (!matchResult) - return null; - var matchedString = matchResult[0]; - var parseResult = string.match(args.parsePattern); - if (!parseResult) - return null; - var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; - value = options.valueCallback ? options.valueCallback(value) : value; - var rest = string.slice(matchedString.length); - return { - value, - rest - }; + return { + ...table, + cols: [...table.cols, column] }; -} - -// node_modules/date-fns/esm/locale/en-US/_lib/match/index.js -var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; -var parseOrdinalNumberPattern = /\d+/i; -var matchEraPatterns = { - 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 }; -var parseEraPatterns = { - any: [/^b/i, /^(a|c)/i] -}; -var matchQuarterPatterns = { - narrow: /^[1234]/i, - abbreviated: /^q[1234]/i, - wide: /^[1234](th|st|nd|rd)? quarter/i -}; -var parseQuarterPatterns = { - any: [/1/i, /2/i, /3/i, /4/i] -}; -var matchMonthPatterns = { - 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 +var insertColumns = (table, columns) => { + return { + ...table, + cols: [...table.cols, ...columns.filter((f4) => !table.cols.some((g4) => g4.name == f4.name))] + }; }; -var parseMonthPatterns = { - 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] +var deletePropertyMultiValue = (folder, lookupField, lookupValue, field, value) => { + return { + ...folder, + rows: folder.rows.map( + (f4) => f4[lookupField] == lookupValue ? { + ...f4, + [field]: serializeMultiString(parseMultiString(f4[field]).filter((g4) => g4 != value)) + } : f4 + ) + }; }; -var matchDayPatterns = { - 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 +var updateValue = (folder, lookupField, lookupValue, field, value) => { + return { + ...folder, + rows: folder.rows.map( + (f4) => f4[lookupField] == lookupValue ? { + ...f4, + [field]: value + } : f4 + ) + }; }; -var parseDayPatterns = { - 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] +var insertRowsIfUnique = (folder, rows, index) => { + return { ...folder, rows: index ? insertMulti(folder.rows, index, rows.filter((f4) => !folder.rows.some((g4) => g4.File == f4.File))) : [...folder.rows, ...rows.filter((f4) => !folder.rows.some((g4) => g4.File == f4.File))] }; }; -var matchDayPeriodPatterns = { - 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 +var saveContextToFrontmatter = (file, cols, context, plugin) => { + const afile = getAbstractFileAtPath(plugin, file); + if (afile && afile instanceof import_obsidian8.TFile) + saveContextToFile(afile, cols, context, plugin); }; -var parseDayPeriodPatterns = { - 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 +var updateContextValue = async (plugin, space, file, field, value, _updateFunction) => { + let tagFileExists = await plugin.app.vault.adapter.exists(space.dbPath); + if (!tagFileExists) { + tagFileExists = await createContextMDB(plugin, space); } + if (tagFileExists) + await getMDBTable(plugin, space, "files", "context").then( + (tagDB) => { + const updateFunction = _updateFunction != null ? _updateFunction : updateValue; + const newMDB = updateFunction(tagDB, FilePropertyName, file, field, value); + return saveDB(plugin, space, newMDB).then((f4) => newMDB); + } + ); }; -var match = { - ordinalNumber: buildMatchPatternFn({ - matchPattern: matchOrdinalNumberPattern, - parsePattern: parseOrdinalNumberPattern, - valueCallback: function valueCallback(value) { - return parseInt(value, 10); - } - }), - era: buildMatchFn({ - matchPatterns: matchEraPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseEraPatterns, - defaultParseWidth: "any" - }), - quarter: buildMatchFn({ - matchPatterns: matchQuarterPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseQuarterPatterns, - defaultParseWidth: "any", - valueCallback: function valueCallback2(index) { - return index + 1; - } - }), - month: buildMatchFn({ - matchPatterns: matchMonthPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseMonthPatterns, - defaultParseWidth: "any" - }), - day: buildMatchFn({ - matchPatterns: matchDayPatterns, - defaultMatchWidth: "wide", - parsePatterns: parseDayPatterns, - defaultParseWidth: "any" - }), - dayPeriod: buildMatchFn({ - matchPatterns: matchDayPeriodPatterns, - defaultMatchWidth: "any", - parsePatterns: parseDayPeriodPatterns, - defaultParseWidth: "any" - }) -}; -var match_default = match; - -// node_modules/date-fns/esm/locale/en-US/index.js -var locale = { - code: "en-US", - formatDistance: formatDistance_default, - formatLong: formatLong_default, - formatRelative: formatRelative_default, - localize: localize_default, - match: match_default, - options: { - weekStartsOn: 0, - firstWeekContainsDate: 1 +var insertContextColumn = async (plugin, space, field) => { + let tagFileExists = await plugin.app.vault.adapter.exists(space.dbPath); + if (!tagFileExists) { + tagFileExists = await createContextMDB(plugin, space); } + if (tagFileExists) + await getMDBTable(plugin, space, "files", "context").then((tagDB) => { + const newDB = insertColumn(tagDB, field); + saveDB(plugin, space, newDB).then((f4) => newDB); + return newDB; + }).then((f4) => plugin.index.reloadContext(space)); }; -var en_US_default = locale; - -// node_modules/date-fns/esm/_lib/defaultLocale/index.js -var defaultLocale_default = en_US_default; - -// node_modules/date-fns/esm/format/index.js -var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; -var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; -var escapedStringRegExp = /^'([^]*?)'?$/; -var doubleQuoteRegExp = /''/g; -var unescapedLatinCharacterRegExp = /[a-zA-Z]/; -function format(dirtyDate, dirtyFormatStr, options) { - var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4; - requiredArgs(2, arguments); - var formatStr = String(dirtyFormatStr); - var defaultOptions4 = getDefaultOptions(); - var locale2 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions4.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default; - var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions4.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); - if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { - throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively"); - } - var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions4.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions4.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); - if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { - throw new RangeError("weekStartsOn must be between 0 and 6 inclusively"); +var insertContextColumns = async (plugin, space, fields) => { + let tagFileExists = await plugin.app.vault.adapter.exists(space.dbPath); + if (!tagFileExists) { + tagFileExists = await createContextMDB(plugin, space); } - if (!locale2.localize) { - throw new RangeError("locale must contain localize property"); + if (tagFileExists) + await getMDBTable(plugin, space, "files", "context").then((tagDB) => { + const newDB = insertColumns(tagDB, fields); + saveDB(plugin, space, newDB).then((f4) => newDB); + return newDB; + }).then((f4) => plugin.index.reloadContext(space)); +}; +var insertContextItems = async (plugin, newPaths, t4) => { + const saveNewContextRows = async (tag, space2) => { + const newRow = newPaths.map((newPath) => ({ File: newPath })); + await saveDB(plugin, space2, insertRowsIfUnique(tag, newRow)); + }; + const space = plugin.index.spacesIndex.get(t4); + let tagFileExists = await plugin.app.vault.adapter.exists(space.space.dbPath); + if (!tagFileExists) { + tagFileExists = await createContextMDB(plugin, space.space); } - if (!locale2.formatLong) { - throw new RangeError("locale must contain formatLong property"); + if (tagFileExists) + await getMDBTable(plugin, space.space, "files", "context").then( + (tagDB) => saveNewContextRows(tagDB, space.space) + ); +}; +var fileToFM = (afile, cols, plugin) => { + let file = afile; + if (afile instanceof import_obsidian8.TFolder) { + file = getAbstractFileAtPath(plugin, folderNotePathFromAFile(plugin.settings, tFileToAFile(afile))); } - var originalDate = toDate(dirtyDate); - if (!isValid(originalDate)) { - throw new RangeError("Invalid time value"); + if (!file) + return []; + const fm = frontMatterForFile(plugin, file); + const fmKeys = frontMatterKeys(fm).filter((f4) => cols.some((g4) => f4 == g4)); + const rows = fmKeys.reduce( + (p3, c4) => ({ ...p3, [c4]: parseFrontMatter(c4, fm[c4]) }), + {} + ); + if (plugin.dataViewAPI()) { + return { ...rows, ...fileToDV(file, cols, plugin) }; } - var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate); - var utcDate = subMilliseconds(originalDate, timezoneOffset); - var formatterOptions = { - firstWeekContainsDate, - weekStartsOn, - locale: locale2, - _originalDate: originalDate - }; - var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) { - var firstCharacter = substring[0]; - if (firstCharacter === "p" || firstCharacter === "P") { - var longFormatter = longFormatters_default[firstCharacter]; - return longFormatter(substring, locale2.formatLong); - } - return substring; - }).join("").match(formattingTokensRegExp).map(function(substring) { - if (substring === "''") { - return "'"; + return rows; +}; +var fileToDV = (file, cols, plugin) => { + const dvValues = plugin.dataViewAPI().page(file.path); + const fmKeys = uniqCaseInsensitive( + Object.keys(dvValues != null ? dvValues : {}).filter( + (f4, i4, self2) => !self2.find( + (g4, j4) => g4.toLowerCase().replace(/\s/g, "-") == f4.toLowerCase().replace(/\s/g, "-") && i4 > j4 + ) ? true : false + ).filter((f4) => f4 != "file") + ).filter((f4) => cols.some((g4) => f4 == g4)); + return fmKeys.reduce( + (p3, c4) => ({ + ...p3, + [c4]: parseDataview(c4, dvValues[c4]) + }), + {} + ); +}; +var onMetadataChange = async (plugin, file, spaces) => { + const updateFile = (mdb) => { + const objectExists = mdb.rows.some((item) => item.File === file.path); + if (objectExists) { + return mdb.rows.map( + (f4) => f4.File == file.path ? { + ...f4, + ...fileToFM( + file, + mdb.cols.map((f5) => f5.name), + plugin + ) + } : f4 + ); + } else { + return [ + ...mdb.rows, + { + File: file.path, + ...fileToFM( + file, + mdb.cols.map((f4) => f4.name), + plugin + ) + } + ]; } - var firstCharacter = substring[0]; - if (firstCharacter === "'") { - return cleanEscapedString(substring); + }; + const promises = spaces.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const newDB = { + ...mdb, + rows: updateFile(mdb) + }; + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); + } + return newDB; + }); + }); + return Promise.all(promises); +}; +var updateValueInContext = async (plugin, row, field, value, space) => { + const changeTagInContextMDB = (mdb) => { + return { ...mdb, rows: mdb.rows.map((f4) => f4.File == row ? { ...f4, [field]: value } : f4) }; + }; + return processContextFile(plugin, space, async (mdb, space2) => { + const newDB = changeTagInContextMDB(mdb); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); } - var formatter = formatters_default[firstCharacter]; - if (formatter) { - if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) { - throwProtectedError(substring, dirtyFormatStr, String(dirtyDate)); + return newDB; + }); +}; +var renameTagInContexts = async (plugin, oldTag, newTag, spaces) => { + const changeTagInContextMDB = (mdb) => { + const cols = mdb.cols.map((f4) => f4.type.startsWith("context") && f4.value == oldTag ? { ...f4, value: newTag } : f4); + return { ...mdb, cols }; + }; + const promises = spaces.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const newDB = changeTagInContextMDB(mdb); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); + } + return newDB; + }); + }); + return Promise.all(promises); +}; +var removeTagInContexts = async (plugin, tag, spaces) => { + const deleteTagInContextMDB = (mdb) => { + const cols = mdb.cols.map((f4) => f4.type.startsWith("context") && f4.value == tag ? { ...f4, type: "link-multi" } : f4); + return { ...mdb, cols }; + }; + const promises = spaces.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const newDB = deleteTagInContextMDB(mdb); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); + } + return newDB; + }); + }); + return Promise.all(promises); +}; +var addFileInContexts = async (plugin, path, contexts, index) => { + const promises = contexts.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const newDB = insertRowsIfUnique(mdb, [{ File: path }], index); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); } - if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) { - throwProtectedError(substring, dirtyFormatStr, String(dirtyDate)); + return newDB; + }); + }); + return Promise.all(promises); +}; +var renameLinkInContexts = async (plugin, oldPath, newPath, spaces) => { + const promises = spaces.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const linkCols = linkColumns(mdb.cols); + const newDB = { + ...mdb, + rows: mdb.rows.map((r3) => renameLinksInRow(plugin, r3, oldPath, newPath, linkCols)) + }; + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); } - return formatter(utcDate, substring, locale2.localize, formatterOptions); + return newDB; + }); + }); + return Promise.all(promises); +}; +var removeLinkInContexts = async (plugin, path, spaces) => { + const promises = spaces.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const linkCols = linkColumns(mdb.cols); + const newDB = { + ...mdb, + rows: mdb.rows.map((r3) => removeLinksInRow(plugin, r3, path, linkCols)) + }; + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); + } + return newDB; + }); + }); + return Promise.all(promises); +}; +var renameFileInContexts = async (plugin, oldPath, newPath, spaces) => { + const promises = spaces.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const newDB = renameRowForFile(mdb, oldPath, newPath); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); + } + return newDB; + }); + }); + return Promise.all(promises); +}; +var removeFileInContexts = async (plugin, path, spaces) => { + const promises = spaces.map((space) => { + return processContextFile(plugin, space, async (mdb, space2) => { + const removeRow = mdb.rows.find((f4) => f4.File == path); + if (removeRow) { + saveContextToFrontmatter(path, mdb.cols, removeRow, plugin); + } + const newDB = removeRowForFile(mdb, path); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, space2, newDB); + } + return newDB; + }); + }); + return Promise.all(promises); +}; +var reorderFilesInContext = async (plugin, paths, index, space) => { + return processContextFile(plugin, space, async (mdb, context) => { + const newDB = reorderRowsForFile(mdb, paths, index); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, context, newDB); } - if (firstCharacter.match(unescapedLatinCharacterRegExp)) { - throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"); + return newDB; + }); +}; +var removeFilesInContext = async (plugin, paths, space) => { + return processContextFile(plugin, space, async (mdb, context) => { + mdb.rows.forEach((row) => { + if (paths.includes(row.File)) + saveContextToFrontmatter(row.File, mdb.cols, row, plugin); + }); + const newDB = removeRowsForFile(mdb, paths); + if (!import_lodash2.default.isEqual(mdb, newDB)) { + await saveDB(plugin, context, newDB); } - return substring; - }).join(""); - return result; -} -function cleanEscapedString(input) { - var matched = input.match(escapedStringRegExp); - if (!matched) { - return input; - } - return matched[1].replace(doubleQuoteRegExp, "'"); -} + return newDB; + }); +}; -// node_modules/date-fns/esm/_lib/assign/index.js -function assign(target, object) { - if (target == null) { - throw new TypeError("assign requires that input parameter not be null or undefined"); - } - for (var property in object) { - if (Object.prototype.hasOwnProperty.call(object, property)) { - ; - target[property] = object[property]; - } - } - return target; -} +// src/react/components/MarkdownEditor/EditorHeader.tsx +var import_he = __toESM(require_he()); -// node_modules/date-fns/esm/_lib/cloneObject/index.js -function cloneObject(object) { - return assign({}, object); -} +// src/react/components/SpaceView/Contexts/TagsView/NoteSpacesBar.tsx +var import_obsidian17 = require("obsidian"); -// node_modules/date-fns/esm/formatDistance/index.js -var MINUTES_IN_DAY = 1440; -var MINUTES_IN_ALMOST_TWO_DAYS = 2520; -var MINUTES_IN_MONTH = 43200; -var MINUTES_IN_TWO_MONTHS = 86400; -function formatDistance3(dirtyDate, dirtyBaseDate, options) { - var _ref, _options$locale; - requiredArgs(2, arguments); - var defaultOptions4 = getDefaultOptions(); - var locale2 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions4.locale) !== null && _ref !== void 0 ? _ref : defaultLocale_default; - if (!locale2.formatDistance) { - throw new RangeError("locale must contain formatDistance property"); - } - var comparison = compareAsc(dirtyDate, dirtyBaseDate); - if (isNaN(comparison)) { - throw new RangeError("Invalid time value"); - } - var localizeOptions = assign(cloneObject(options), { - addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix), - comparison - }); - var dateLeft; - var dateRight; - if (comparison > 0) { - dateLeft = toDate(dirtyBaseDate); - dateRight = toDate(dirtyDate); - } else { - dateLeft = toDate(dirtyDate); - dateRight = toDate(dirtyBaseDate); - } - var seconds = differenceInSeconds(dateRight, dateLeft); - var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1e3; - var minutes = Math.round((seconds - offsetInSeconds) / 60); - var months; - if (minutes < 2) { - if (options !== null && options !== void 0 && options.includeSeconds) { - if (seconds < 5) { - return locale2.formatDistance("lessThanXSeconds", 5, localizeOptions); - } else if (seconds < 10) { - return locale2.formatDistance("lessThanXSeconds", 10, localizeOptions); - } else if (seconds < 20) { - return locale2.formatDistance("lessThanXSeconds", 20, localizeOptions); - } else if (seconds < 40) { - return locale2.formatDistance("halfAMinute", 0, localizeOptions); - } else if (seconds < 60) { - return locale2.formatDistance("lessThanXMinutes", 1, localizeOptions); - } else { - return locale2.formatDistance("xMinutes", 1, localizeOptions); +// src/react/components/UI/Menus/propertyMenu/newPropertyMenu.tsx +var import_obsidian16 = require("obsidian"); + +// src/react/components/UI/Menus/menuItems.tsx +var import_obsidian11 = require("obsidian"); + +// src/react/components/UI/Menus/selectMenu/SelectMenuComponent.tsx +var import_fuzzysort = __toESM(require_fuzzysort()); +var import_lodash3 = __toESM(require_lodash()); + +// src/react/components/UI/Menus/selectMenu/SelectMenuInput.tsx +var SIZER_STYLES = { + position: "absolute", + width: 0, + height: 0, + visibility: "hidden", + overflow: "scroll", + whiteSpace: "pre" +}; +var STYLE_PROPS = [ + "fontSize", + "fontFamily", + "fontWeight", + "fontStyle", + "letterSpacing", + "textTransform" +]; +var SelectMenuInput = k3( + (props2, input) => { + const { classNames: classNames9, inputAttributes, inputEventHandlers, index } = props2; + const sizer = _2(null); + const [inputWidth, setInputWidth] = h2(null); + const [query, setQuery] = h2(""); + const [placeholderText, setPlaceholderText] = h2(""); + p2(() => { + copyInputStyles(); + updateInputWidth(); + setTimeout(() => { + input.current.focus(); + }, 50); + }, []); + p2(() => { + if (query !== props2.query || placeholderText !== props2.placeholderText) { + setQuery(props2.query); + setPlaceholderText(props2.placeholderText); + updateInputWidth(); } - } else { - if (minutes === 0) { - return locale2.formatDistance("lessThanXMinutes", 1, localizeOptions); - } else { - return locale2.formatDistance("xMinutes", minutes, localizeOptions); + }, [props2.query, props2.placeholderText]); + const copyInputStyles = () => { + const inputStyle = window.getComputedStyle(input.current); + STYLE_PROPS.forEach((prop) => { + sizer.current.style[prop] = inputStyle[prop]; + }); + }; + const updateInputWidth = () => { + let _inputWidth; + _inputWidth = Math.ceil(sizer.current.scrollWidth) + 2; + if (_inputWidth !== inputWidth) { + setInputWidth(_inputWidth); } - } - } else if (minutes < 45) { - return locale2.formatDistance("xMinutes", minutes, localizeOptions); - } else if (minutes < 90) { - return locale2.formatDistance("aboutXHours", 1, localizeOptions); - } else if (minutes < MINUTES_IN_DAY) { - var hours = Math.round(minutes / 60); - return locale2.formatDistance("aboutXHours", hours, localizeOptions); - } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) { - return locale2.formatDistance("xDays", 1, localizeOptions); - } else if (minutes < MINUTES_IN_MONTH) { - var days = Math.round(minutes / MINUTES_IN_DAY); - return locale2.formatDistance("xDays", days, localizeOptions); - } else if (minutes < MINUTES_IN_TWO_MONTHS) { - months = Math.round(minutes / MINUTES_IN_MONTH); - return locale2.formatDistance("aboutXMonths", months, localizeOptions); - } - months = differenceInMonths(dateRight, dateLeft); - if (months < 12) { - var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH); - return locale2.formatDistance("xMonths", nearestMonth, localizeOptions); - } else { - var monthsSinceStartOfYear = months % 12; - var years = Math.floor(months / 12); - if (monthsSinceStartOfYear < 3) { - return locale2.formatDistance("aboutXYears", years, localizeOptions); - } else if (monthsSinceStartOfYear < 9) { - return locale2.formatDistance("overXYears", years, localizeOptions); - } else { - return locale2.formatDistance("almostXYears", years + 1, localizeOptions); - } + }; + return /* @__PURE__ */ Cn.createElement("div", { + className: classNames9.searchWrapper + }, /* @__PURE__ */ Cn.createElement("input", { + ...inputAttributes, + ...inputEventHandlers, + ref: input, + value: query, + placeholder: placeholderText, + className: classNames9.searchInput, + role: "combobox", + style: { width: "100%" } + }), /* @__PURE__ */ Cn.createElement("div", { + ref: sizer, + style: SIZER_STYLES + }, query || placeholderText)); } -} +); +var SelectMenuInput_default = SelectMenuInput; -// node_modules/date-fns/esm/getDaysInMonth/index.js -function getDaysInMonth(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var year = date.getFullYear(); - var monthIndex = date.getMonth(); - var lastDayOfMonth2 = new Date(0); - lastDayOfMonth2.setFullYear(year, monthIndex + 1, 0); - lastDayOfMonth2.setHours(0, 0, 0, 0); - return lastDayOfMonth2.getDate(); -} +// src/react/components/UI/Menus/selectMenu/SelectMenuPill.tsx +var SelectMenuPillComponent = (props2) => { + return /* @__PURE__ */ Cn.createElement("button", { + type: "button", + className: props2.classNames.selectedTag, + onClick: props2.onDelete + }, /* @__PURE__ */ Cn.createElement("span", { + className: props2.classNames.selectedTagName + }, props2.tag.name)); +}; +var SelectMenuPill_default = SelectMenuPillComponent; -// node_modules/date-fns/esm/getISOWeek/index.js -var MILLISECONDS_IN_WEEK4 = 6048e5; -function getISOWeek(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var diff = startOfISOWeek(date).getTime() - startOfISOWeekYear(date).getTime(); - return Math.round(diff / MILLISECONDS_IN_WEEK4) + 1; -} +// src/utils/sticker.ts +var import_obsidian10 = require("obsidian"); -// node_modules/date-fns/esm/getTime/index.js -function getTime(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var timestamp = date.getTime(); - return timestamp; -} +// src/utils/icons.ts +var import_obsidian9 = require("obsidian"); +var iconForSpaceType = (type, path, force) => { + if (path == "Spaces/Home") + return "ui//mk-ui-home"; + return type == "folder" ? "ui//mk-ui-folder" : type == "tag" ? force ? "lucide//tags" : "" : type == "vault" ? "lucide//vault" : "lucide//layout-grid"; +}; +var lucideIcon = (value) => { + var _a2; + return (_a2 = (0, import_obsidian9.getIcon)(value)) == null ? void 0 : _a2.outerHTML; +}; +var uiIconSet = { + "mk-ui-rows": ``, + "mk-ui-close": ` + + `, + "mk-ui-flow-hover": ` + + `, + "mk-ui-folder": ` + + `, + "mk-ui-open-link": ` + + `, + "mk-ui-file": ` + +`, + "mk-ui-expand": ` + +`, + "mk-ui-new-folder": ``, + "mk-ui-new-note": ``, + "mk-ui-collapse": ` + +`, + "mk-ui-options": ` + +`, + "mk-ui-plus": ` + +`, + "mk-ui-collapse-sm": ` + +`, + "mk-ui-search": ` + + +`, + "mk-ui-view-options": ` + + +`, + "mk-ui-clear": ` + + +`, + "mk-ui-new-file": ` + + +`, + "mk-ui-blink": ` + + + + +`, + "mk-ui-spaces": ` + +`, + "mk-ui-home": ` + +`, + "mk-ui-tags": ` + +`, + "mk-ui-handle": ` + + + + + + + +`, + "mk-ui-new-space": ` + + +`, + "mk-ui-file-solid": ` + + + +`, + "mk-ui-folder-solid": ` + + +`, + "mk-ui-sync": ` + + +`, + "mk-ui-stack": ` + + +`, + "mk-ui-cut": ` + + +`, + "mk-ui-backlink": ` + + +`, + "mk-ui-canvas": ` + + + + + +`, + "mk-ui-video": ` + + +`, + "mk-ui-edit": ` + + +`, + "mk-ui-list": ` + + + +`, + "mk-ui-build": ` + + +`, + "mk-ui-check": ` + + +`, + "mk-ui-layout": ` + + +`, + "mk-ui-colors": ` + + +`, + "mk-make-todo": ` + + + +`, + "mk-make-list": ` + + + + + + + +`, + "mk-make-ordered": ` + + + + + + + +`, + "mk-make-h1": ` + + + +`, + "mk-make-h2": ` + + + +`, + "mk-make-h3": ` + + + +`, + "mk-make-quote": ` + + + + + +`, + "mk-make-hr": ` + + +`, + "mk-make-link": ` + + +`, + "mk-make-image": ` + + + + + +`, + "mk-make-codeblock": ` + + + + +`, + "mk-make-callout": ` + + + +`, + "mk-make-note": ` + + + + + +`, + "mk-make-flow": ` + + +`, + "mk-make-tag": ` + + +`, + "mk-make-table": ` + + + + +`, + "mk-make-date": ` + + +`, + "mk-make-indent": ` + + + + + -// node_modules/date-fns/esm/getUnixTime/index.js -function getUnixTime(dirtyDate) { - requiredArgs(1, arguments); - return Math.floor(getTime(dirtyDate) / 1e3); -} +`, + "mk-make-unindent": ` + + + + + +`, + "mk-mark-strong": ` + + +`, + "mk-mark-em": ` + +`, + "mk-mark-strikethrough": ` + + + +`, + "mk-mark-code": ` + + + + +`, + "mk-mark-link": ` + +`, + "mk-mark-blocklink": ` + + + + +`, + "mk-mark-highlight": ` + + + + + +`, + "mk-make-attach": ` + + + + +`, + "mk-make-keyboard": ` + + + +`, + "mk-make-slash": ` + + + +`, + "mk-make-style": ` + +`, + "mk-mark-color": ` + + +`, + "mk-ui-any": ` + + +`, + "mk-ui-all": ` + + + +`, + "mk-ui-context": ` + + + + + +`, + "mk-ui-full-width": `` +}; +var mkLogo = ` + + +`; +var lucideIcons = [ + "accessibility", + "activity", + "air-vent", + "airplay", + "alarm-check", + "alarm-clock-off", + "alarm-clock", + "alarm-minus", + "alarm-plus", + "album", + "alert-circle", + "alert-octagon", + "alert-triangle", + "align-center-horizontal", + "align-center-vertical", + "align-center", + "align-end-horizontal", + "align-end-vertical", + "align-horizontal-distribute-center", + "align-horizontal-distribute-end", + "align-horizontal-distribute-start", + "align-horizontal-justify-center", + "align-horizontal-justify-end", + "align-horizontal-justify-start", + "align-horizontal-space-around", + "align-horizontal-space-between", + "align-justify", + "align-left", + "align-right", + "align-start-horizontal", + "align-start-vertical", + "align-vertical-distribute-center", + "align-vertical-distribute-end", + "align-vertical-distribute-start", + "align-vertical-justify-center", + "align-vertical-justify-end", + "align-vertical-justify-start", + "align-vertical-space-around", + "align-vertical-space-between", + "anchor", + "angry", + "annoyed", + "aperture", + "apple", + "archive-restore", + "archive", + "armchair", + "arrow-big-down", + "arrow-big-left", + "arrow-big-right", + "arrow-big-up", + "arrow-down-circle", + "arrow-down-left-from-circle", + "arrow-down-left", + "arrow-down-right-from-circle", + "arrow-down-right", + "arrow-down", + "arrow-left-circle", + "arrow-left-right", + "arrow-left", + "arrow-right-circle", + "arrow-right", + "arrow-up-circle", + "arrow-up-down", + "arrow-up-left-from-circle", + "arrow-up-left", + "arrow-up-right-from-circle", + "arrow-up-right", + "arrow-up", + "asterisk", + "at-sign", + "atom", + "award", + "axe", + "axis-3d", + "baby", + "backpack", + "baggage-claim", + "ban", + "banana", + "banknote", + "bar-chart-2", + "bar-chart-3", + "bar-chart-4", + "bar-chart-horizontal", + "bar-chart", + "baseline", + "bath", + "battery-charging", + "battery-full", + "battery-low", + "battery-medium", + "battery-warning", + "battery", + "beaker", + "bean-off", + "bean", + "bed-double", + "bed-single", + "bed", + "beef", + "beer", + "bell-minus", + "bell-off", + "bell-plus", + "bell-ring", + "bell", + "bike", + "binary", + "bird", + "bitcoin", + "blinds", + "bluetooth-connected", + "bluetooth-off", + "bluetooth-searching", + "bluetooth", + "bold", + "bomb", + "bone", + "book-copy", + "book-down", + "book-key", + "book-lock", + "book-marked", + "book-minus", + "book-open-check", + "book-open", + "book-plus", + "book-template", + "book-up", + "book-x", + "book", + "bookmark-minus", + "bookmark-plus", + "bookmark", + "bot", + "box-select", + "box", + "boxes", + "brain-circuit", + "brain-cog", + "brain", + "briefcase", + "brush", + "bug", + "building-2", + "building", + "bus", + "cake", + "calculator", + "calendar-check-2", + "calendar-check", + "calendar-clock", + "calendar-days", + "calendar-heart", + "calendar-minus", + "calendar-off", + "calendar-plus", + "calendar-range", + "calendar-search", + "calendar-x2", + "calendar-x", + "calendar", + "camera-off", + "camera", + "candy-off", + "candy", + "car", + "carrot", + "case-lower", + "case-sensitive", + "case-upper", + "cast", + "castle", + "cat", + "check-check", + "check-circle-2", + "check-circle", + "check-square", + "check", + "chef-hat", + "cherry", + "chevron-down-square", + "chevron-down", + "chevron-first", + "chevron-last", + "chevron-left-square", + "chevron-left", + "chevron-right-square", + "chevron-right", + "chevron-up-square", + "chevron-up", + "chevrons-down-up", + "chevrons-down", + "chevrons-left-right", + "chevrons-left", + "chevrons-right-left", + "chevrons-right", + "chevrons-up-down", + "chevrons-up", + "chrome", + "church", + "cigarette-off", + "cigarette", + "circle-dot", + "circle-ellipsis", + "circle-equal", + "circle-off", + "circle-slash-2", + "circle-slash", + "circle", + "circuit-board", + "citrus", + "clapperboard", + "clipboard-check", + "clipboard-copy", + "clipboard-edit", + "clipboard-list", + "clipboard-paste", + "clipboard-signature", + "clipboard-type", + "clipboard-x", + "clipboard", + "clock-1", + "clock-10", + "clock-11", + "clock-12", + "clock-2", + "clock-3", + "clock-4", + "clock-5", + "clock-6", + "clock-7", + "clock-8", + "clock-9", + "clock", + "cloud-cog", + "cloud-drizzle", + "cloud-fog", + "cloud-hail", + "cloud-lightning", + "cloud-moon-rain", + "cloud-moon", + "cloud-off", + "cloud-rain-wind", + "cloud-rain", + "cloud-snow", + "cloud-sun-rain", + "cloud-sun", + "cloud", + "cloudy", + "clover", + "code-2", + "code", + "codepen", + "codesandbox", + "coffee", + "cog", + "coins", + "columns", + "command", + "compass", + "component", + "concierge-bell", + "construction", + "contact", + "contrast", + "cookie", + "copy-check", + "copy-minus", + "copy-plus", + "copy-slash", + "copy-x", + "copy", + "copyleft", + "copyright", + "corner-down-left", + "corner-down-right", + "corner-left-down", + "corner-left-up", + "corner-right-down", + "corner-right-up", + "corner-up-left", + "corner-up-right", + "cpu", + "creative-commons", + "credit-card", + "croissant", + "crop", + "cross", + "crosshair", + "crown", + "cup-soda", + "curly-braces", + "currency", + "database-backup", + "database", + "delete", + "diamond", + "dice-1", + "dice-2", + "dice-3", + "dice-4", + "dice-5", + "dice-6", + "dices", + "diff", + "disc-2", + "disc", + "divide-circle", + "divide-square", + "divide", + "dna-off", + "dna", + "dog", + "dollar-sign", + "door-closed", + "door-open", + "download-cloud", + "download", + "dribbble", + "droplet", + "droplets", + "drumstick", + "dumbbell", + "ear-off", + "ear", + "edit-2", + "edit-3", + "edit", + "egg-fried", + "egg-off", + "egg", + "equal-not", + "equal", + "eraser", + "euro", + "expand", + "external-link", + "eye-off", + "eye", + "facebook", + "factory", + "fan", + "fast-forward", + "feather", + "figma", + "file-archive", + "file-audio-2", + "file-audio", + "file-axis-3d", + "file-badge-2", + "file-badge", + "file-bar-chart-2", + "file-bar-chart", + "file-box", + "file-check-2", + "file-check", + "file-clock", + "file-code", + "file-cog-2", + "file-cog", + "file-diff", + "file-digit", + "file-down", + "file-edit", + "file-heart", + "file-image", + "file-input", + "file-json-2", + "file-json", + "file-key-2", + "file-key", + "file-line-chart", + "file-lock-2", + "file-lock", + "file-minus-2", + "file-minus", + "file-output", + "file-pie-chart", + "file-plus-2", + "file-plus", + "file-question", + "file-scan", + "file-search-2", + "file-search", + "file-signature", + "file-spreadsheet", + "file-symlink", + "file-terminal", + "file-text", + "file-type-2", + "file-type", + "file-up", + "file-video-2", + "file-video", + "file-volume-2", + "file-volume", + "file-warning", + "file-x2", + "file-x", + "file", + "files", + "film", + "filter-x", + "filter", + "fingerprint", + "fish-off", + "fish", + "flag-off", + "flag-triangle-left", + "flag-triangle-right", + "flag", + "flame", + "flashlight-off", + "flashlight", + "flask-conical-off", + "flask-conical", + "flask-round", + "flip-horizontal-2", + "flip-horizontal", + "flip-vertical-2", + "flip-vertical", + "flower-2", + "flower", + "focus", + "folder-archive", + "folder-check", + "folder-clock", + "folder-closed", + "folder-cog-2", + "folder-cog", + "folder-down", + "folder-edit", + "folder-git-2", + "folder-git", + "folder-heart", + "folder-input", + "folder-key", + "folder-lock", + "folder-minus", + "folder-open", + "folder-output", + "folder-plus", + "folder-search-2", + "folder-search", + "folder-symlink", + "folder-tree", + "folder-up", + "folder-x", + "folder", + "folders", + "footprints", + "forklift", + "form-input", + "forward", + "frame", + "framer", + "frown", + "fuel", + "function-square", + "gamepad-2", + "gamepad", + "gauge", + "gavel", + "gem", + "ghost", + "gift", + "git-branch-plus", + "git-branch", + "git-commit", + "git-compare", + "git-fork", + "git-merge", + "git-pull-request-closed", + "git-pull-request-draft", + "git-pull-request", + "github", + "gitlab", + "glass-water", + "glasses", + "globe-2", + "globe", + "grab", + "graduation-cap", + "grape", + "grid", + "grip-horizontal", + "grip-vertical", + "grip", + "hammer", + "hand-metal", + "hand", + "hard-drive", + "hard-hat", + "hash", + "haze", + "heading-1", + "heading-2", + "heading-3", + "heading-4", + "heading-5", + "heading-6", + "heading", + "headphones", + "heart-crack", + "heart-handshake", + "heart-off", + "heart-pulse", + "heart", + "help-circle", + "helping-hand", + "hexagon", + "highlighter", + "history", + "home", + "hop-off", + "hop", + "hotel", + "hourglass", + "ice-cream-2", + "ice-cream", + "image-minus", + "image-off", + "image-plus", + "image", + "import", + "inbox", + "indent", + "indian-rupee", + "infinity", + "info", + "inspect", + "instagram", + "italic", + "japanese-yen", + "joystick", + "key", + "keyboard", + "lamp-ceiling", + "lamp-desk", + "lamp-floor", + "lamp-wall-down", + "lamp-wall-up", + "lamp", + "landmark", + "languages", + "laptop-2", + "laptop", + "lasso-select", + "lasso", + "laugh", + "layers", + "layout-dashboard", + "layout-grid", + "layout-list", + "layout-template", + "layout", + "leaf", + "library", + "life-buoy", + "lightbulb-off", + "lightbulb", + "line-chart", + "link-2off", + "link-2", + "link", + "linkedin", + "list-checks", + "list-end", + "list-minus", + "list-music", + "list-ordered", + "list-plus", + "list-start", + "list-tree", + "list-video", + "list-x", + "list", + "loader-2", + "loader", + "locate-fixed", + "locate-off", + "locate", + "lock", + "log-in", + "log-out", + "luggage", + "magnet", + "mail-check", + "mail-minus", + "mail-open", + "mail-plus", + "mail-question", + "mail-search", + "mail-warning", + "mail-x", + "mail", + "mailbox", + "mails", + "map-pin-off", + "map-pin", + "map", + "martini", + "maximize-2", + "maximize", + "medal", + "megaphone-off", + "megaphone", + "meh", + "menu", + "message-circle", + "message-square-dashed", + "message-square-plus", + "message-square", + "messages-square", + "mic-2", + "mic-off", + "mic", + "microscope", + "microwave", + "milestone", + "milk-off", + "milk", + "minimize-2", + "minimize", + "minus-circle", + "minus-square", + "minus", + "monitor-off", + "monitor-smartphone", + "monitor-speaker", + "monitor", + "moon", + "more-horizontal", + "more-vertical", + "mountain-snow", + "mountain", + "mouse-pointer-2", + "mouse-pointer-click", + "mouse-pointer", + "mouse", + "move-3d", + "move-diagonal-2", + "move-diagonal", + "move-horizontal", + "move-vertical", + "move", + "music-2", + "music-3", + "music-4", + "music", + "navigation-2off", + "navigation-2", + "navigation-off", + "navigation", + "network", + "newspaper", + "nfc", + "nut-off", + "nut", + "octagon", + "option", + "orbit", + "outdent", + "package-2", + "package-check", + "package-minus", + "package-open", + "package-plus", + "package-search", + "package-x", + "package", + "paint-bucket", + "paintbrush-2", + "paintbrush", + "palette", + "palmtree", + "paperclip", + "parking-circle-off", + "parking-circle", + "parking-square-off", + "parking-square", + "party-popper", + "pause-circle", + "pause-octagon", + "pause", + "pen-tool", + "pencil", + "percent", + "person-standing", + "phone-call", + "phone-forwarded", + "phone-incoming", + "phone-missed", + "phone-off", + "phone-outgoing", + "phone", + "picture-in-picture-2", + "picture-in-picture", + "pie-chart", + "piggy-bank", + "pilcrow", + "pill", + "pin-off", + "pin", + "pipette", + "pizza", + "plane-landing", + "plane-takeoff", + "plane", + "play-circle", + "play", + "plug-2", + "plug-zap", + "plug", + "plus-circle", + "plus-square", + "plus", + "pocket", + "podcast", + "pointer", + "pound-sterling", + "power-off", + "power", + "printer", + "puzzle", + "qr-code", + "quote", + "radio-receiver", + "radio-tower", + "radio", + "rat", + "receipt", + "rectangle-horizontal", + "rectangle-vertical", + "recycle", + "redo-2", + "redo", + "refresh-ccw", + "refresh-cw", + "refrigerator", + "regex", + "remove-formatting", + "repeat-1", + "repeat", + "replace-all", + "replace", + "reply-all", + "reply", + "rewind", + "rocket", + "rocking-chair", + "rotate-3d", + "rotate-ccw", + "rotate-cw", + "router", + "rss", + "ruler", + "russian-ruble", + "sailboat", + "salad", + "sandwich", + "save", + "scale-3d", + "scale", + "scaling", + "scan-face", + "scan-line", + "scan", + "school-2", + "school", + "scissors", + "screen-share-off", + "screen-share", + "scroll", + "search", + "send", + "separator-horizontal", + "separator-vertical", + "server-cog", + "server-crash", + "server-off", + "server", + "settings-2", + "settings", + "share-2", + "share", + "sheet", + "shield-alert", + "shield-check", + "shield-close", + "shield-off", + "shield-question", + "shield", + "ship", + "shirt", + "shopping-bag", + "shopping-cart", + "shovel", + "shower-head", + "shrink", + "shrub", + "shuffle", + "sidebar-close", + "sidebar-open", + "sidebar", + "sigma", + "signal-high", + "signal-low", + "signal-medium", + "signal-zero", + "signal", + "siren", + "skip-back", + "skip-forward", + "skull", + "slack", + "slice", + "sliders-horizontal", + "sliders", + "smartphone-charging", + "smartphone-nfc", + "smartphone", + "smile-plus", + "smile", + "snowflake", + "sofa", + "sort-asc", + "sort-desc", + "soup", + "space", + "speaker", + "spline", + "split-square-horizontal", + "split-square-vertical", + "sprout", + "square", + "stamp", + "star-half", + "star-off", + "star", + "step-back", + "step-forward", + "stethoscope", + "sticker", + "sticky-note", + "stop-circle", + "store", + "stretch-horizontal", + "stretch-vertical", + "strikethrough", + "subscript", + "subtitles", + "sun-dim", + "sun-medium", + "sun-moon", + "sun-snow", + "sun", + "sunrise", + "sunset", + "superscript", + "swiss-franc", + "switch-camera", + "sword", + "swords", + "syringe", + "table-2", + "table", + "tablet", + "tablets", + "tag", + "tags", + "target", + "tent", + "terminal-square", + "terminal", + "test-tube-2", + "test-tube", + "test-tubes", + "text-cursor-input", + "text-cursor", + "text-selection", + "text", + "thermometer-snowflake", + "thermometer-sun", + "thermometer", + "thumbs-down", + "thumbs-up", + "ticket", + "timer-off", + "timer-reset", + "timer", + "toggle-left", + "toggle-right", + "tornado", + "tower-control", + "toy-brick", + "train", + "trash-2", + "trash", + "tree-deciduous", + "tree-pine", + "trees", + "trello", + "trending-down", + "trending-up", + "triangle", + "trophy", + "truck", + "tv-2", + "tv", + "twitch", + "twitter", + "type", + "umbrella", + "underline", + "undo-2", + "undo", + "unlink-2", + "unlink", + "unlock", + "upload-cloud", + "upload", + "usb", + "user-check", + "user-cog", + "user-minus", + "user-plus", + "user-x", + "user", + "users", + "utensils-crossed", + "utensils", + "utility-pole", + "vault", + "vegan", + "venetian-mask", + "verified", + "vibrate-off", + "vibrate", + "video-off", + "video", + "view", + "voicemail", + "volume-1", + "volume-2", + "volume-x", + "volume", + "vote", + "wallet", + "wand-2", + "wand", + "warehouse", + "watch", + "waves", + "webcam", + "webhook", + "wheat-off", + "wheat", + "whole-word", + "wifi-off", + "wifi", + "wind", + "wine-off", + "wine", + "wrap-text", + "wrench", + "x-circle", + "x-octagon", + "x-square", + "x", + "youtube", + "zap-off", + "zap", + "zoom-in", + "zoom-out" +]; -// node_modules/date-fns/esm/getWeekYear/index.js -function getWeekYear(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var year = date.getFullYear(); - var defaultOptions4 = getDefaultOptions(); - var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); - if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { - throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively"); - } - var firstWeekOfNextYear = new Date(0); - firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); - firstWeekOfNextYear.setHours(0, 0, 0, 0); - var startOfNextYear = startOfWeek(firstWeekOfNextYear, options); - var firstWeekOfThisYear = new Date(0); - firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); - firstWeekOfThisYear.setHours(0, 0, 0, 0); - var startOfThisYear = startOfWeek(firstWeekOfThisYear, options); - if (date.getTime() >= startOfNextYear.getTime()) { - return year + 1; - } else if (date.getTime() >= startOfThisYear.getTime()) { - return year; +// src/utils/sticker.ts +var stickerFromString = (sticker, plugin) => { + var _a2; + if (!sticker || typeof sticker != "string") + return ""; + const [type, value] = parseStickerString(sticker); + if (type == "" || type == "emoji") { + return emojiFromString(value); + } else if (type == "ui") { + return uiIconSet[value]; + } else if (type == "lucide") { + return (_a2 = (0, import_obsidian10.getIcon)(value)) == null ? void 0 : _a2.outerHTML; } else { - return year - 1; + return plugin.index.iconsCache.get(value); } -} - -// node_modules/date-fns/esm/startOfWeekYear/index.js -function startOfWeekYear(dirtyDate, options) { - var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2; - requiredArgs(1, arguments); - var defaultOptions4 = getDefaultOptions(); - var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions4.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions4.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); - var year = getWeekYear(dirtyDate, options); - var firstWeek = new Date(0); - firstWeek.setFullYear(year, 0, firstWeekContainsDate); - firstWeek.setHours(0, 0, 0, 0); - var date = startOfWeek(firstWeek, options); - return date; -} - -// node_modules/date-fns/esm/getWeek/index.js -var MILLISECONDS_IN_WEEK5 = 6048e5; -function getWeek(dirtyDate, options) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var diff = startOfWeek(date, options).getTime() - startOfWeekYear(date, options).getTime(); - return Math.round(diff / MILLISECONDS_IN_WEEK5) + 1; -} - -// node_modules/date-fns/esm/lastDayOfMonth/index.js -function lastDayOfMonth(dirtyDate) { - requiredArgs(1, arguments); - var date = toDate(dirtyDate); - var month = date.getMonth(); - date.setFullYear(date.getFullYear(), month + 1, 0); - date.setHours(0, 0, 0, 0); - return date; -} - -// node_modules/date-fns/esm/getWeeksInMonth/index.js -function getWeeksInMonth(date, options) { - requiredArgs(1, arguments); - return differenceInCalendarWeeks(lastDayOfMonth(date), startOfMonth(date), options) + 1; -} - -// node_modules/date-fns/esm/isAfter/index.js -function isAfter2(dirtyDate, dirtyDateToCompare) { - requiredArgs(2, arguments); - var date = toDate(dirtyDate); - var dateToCompare = toDate(dirtyDateToCompare); - return date.getTime() > dateToCompare.getTime(); -} +}; -// node_modules/date-fns/esm/isBefore/index.js -function isBefore(dirtyDate, dirtyDateToCompare) { - requiredArgs(2, arguments); - var date = toDate(dirtyDate); - var dateToCompare = toDate(dirtyDateToCompare); - return date.getTime() < dateToCompare.getTime(); -} +// src/react/components/UI/Stickers/Sticker.tsx +var Sticker = (props2) => { + return /* @__PURE__ */ Cn.createElement("div", { + className: "mk-sticker", + dangerouslySetInnerHTML: { + __html: stickerFromString(props2.sticker, props2.plugin) + } + }); +}; -// node_modules/date-fns/esm/isSameMonth/index.js -function isSameMonth(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth(); +// src/react/components/UI/Menus/selectMenu/concerns/matchers.js +function escapeForRegExp(string) { + return string.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); } - -// node_modules/date-fns/esm/isSameYear/index.js -function isSameYear(dirtyDateLeft, dirtyDateRight) { - requiredArgs(2, arguments); - var dateLeft = toDate(dirtyDateLeft); - var dateRight = toDate(dirtyDateRight); - return dateLeft.getFullYear() === dateRight.getFullYear(); +function matchAny(string) { + return new RegExp(escapeForRegExp(string), "gi"); } - -// node_modules/date-fns/esm/subDays/index.js -function subDays(dirtyDate, dirtyAmount) { - requiredArgs(2, arguments); - var amount = toInteger(dirtyAmount); - return addDays(dirtyDate, -amount); +function matchExact(string) { + return new RegExp(`^${escapeForRegExp(string)}$`, "i"); } -// node_modules/date-fns/esm/setMonth/index.js -function setMonth(dirtyDate, dirtyMonth) { - requiredArgs(2, arguments); - var date = toDate(dirtyDate); - var month = toInteger(dirtyMonth); - var year = date.getFullYear(); - var day = date.getDate(); - var dateWithDesiredMonth = new Date(0); - dateWithDesiredMonth.setFullYear(year, month, 15); - dateWithDesiredMonth.setHours(0, 0, 0, 0); - var daysInMonth = getDaysInMonth(dateWithDesiredMonth); - date.setMonth(month, Math.min(day, daysInMonth)); - return date; +// src/react/components/UI/Menus/selectMenu/SelectMenuSuggestions.tsx +function markIt(name, query) { + const regexp = matchAny(query); + return name.replace(regexp, "$&"); } +var SelectMenuSuggestionsComponent = (props2) => { + const ref2 = _2(null); + p2(() => { + var _a2; + if (props2.active) { + (_a2 = ref2 == null ? void 0 : ref2.current) == null ? void 0 : _a2.scrollIntoViewIfNeeded(); + } + }, [props2.active]); + return /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, props2.item.icon && /* @__PURE__ */ Cn.createElement(Sticker, { + plugin: props2.plugin, + sticker: props2.item.icon + }), /* @__PURE__ */ Cn.createElement("div", { + className: "mk-options-menu-inner" + }, props2.item.onToggle && /* @__PURE__ */ Cn.createElement("div", null, "Toggle"), /* @__PURE__ */ Cn.createElement("span", { + ref: ref2, + dangerouslySetInnerHTML: { + __html: markIt(props2.item.name, props2.query) + } + }), props2.item.description && /* @__PURE__ */ Cn.createElement("span", { + className: "mk-description", + ref: ref2, + dangerouslySetInnerHTML: { + __html: markIt(props2.item.description, props2.query) + } + })), props2.item.removeable && /* @__PURE__ */ Cn.createElement("div", { + onClick: (e4) => { + e4.stopPropagation(); + e4.preventDefault(); + props2.onDeleteOption(props2.item.value); + }, + className: "mk-icon-small", + dangerouslySetInnerHTML: { __html: uiIconSet["mk-ui-close"] } + })); +}; +var SelectMenuSuggestions = (props2) => { + const timer = _2(null); + const mouseOver = (e4, index) => { + if (!props2.hoverSelect) { + return; + } + timer.current && clearTimeout(timer.current); + timer.current = setTimeout(() => props2.setIndex(index), 300); + }; + const options = props2.options.map((item, index) => { + const key2 = `${props2.id}-${index}`; + const classNames9 = []; + if (props2.index === index) { + classNames9.push(props2.classNames.suggestionActive); + } + if (item.disabled) { + classNames9.push(props2.classNames.suggestionDisabled); + } + return /* @__PURE__ */ Cn.createElement("li", { + id: key2, + key: key2, + role: "option", + className: classNames9.join(" "), + "aria-disabled": Boolean(item.disabled), + onMouseDown: (e4) => e4.preventDefault(), + onClick: (e4) => props2.addTag(item, { + ctrlKey: e4.ctrlKey, + metaKey: e4.metaKey, + altKey: e4.altKey, + shiftKey: e4.shiftKey + }), + onMouseOver: (e4) => mouseOver(e4, index), + onMouseOut: (e4) => props2.hoverSelect && clearTimeout(timer.current) + }, /* @__PURE__ */ Cn.createElement(SelectMenuSuggestionsComponent, { + plugin: props2.plugin, + item, + query: props2.query, + active: index == props2.index, + onDeleteOption: props2.deleteOption + })); + }); + return /* @__PURE__ */ Cn.createElement("div", { + className: props2.classNames.suggestions + }, /* @__PURE__ */ Cn.createElement("ul", { + role: "listbox", + id: props2.id + }, options, props2.query && props2.allowNew && /* @__PURE__ */ Cn.createElement("li", { + onMouseDown: (e4) => e4.preventDefault(), + onClick: (e4) => props2.addTag( + { name: props2.query, value: props2.query }, + { + ctrlKey: e4.ctrlKey, + metaKey: e4.metaKey, + altKey: e4.altKey, + shiftKey: e4.shiftKey + } + ) + }, "Add ", props2.query))); +}; +var SelectMenuSuggestions_default = SelectMenuSuggestions; -// node_modules/date-fns/esm/setYear/index.js -function setYear(dirtyDate, dirtyYear) { - requiredArgs(2, arguments); - var date = toDate(dirtyDate); - var year = toInteger(dirtyYear); - if (isNaN(date.getTime())) { - return new Date(NaN); +// src/react/components/UI/Menus/selectMenu/concerns/focusNextElement.js +function focusNextElement(scope, currentTarget) { + const interactiveEls = scope.querySelectorAll("a,button,input"); + const currentEl = Array.prototype.findIndex.call( + interactiveEls, + (element) => element === currentTarget + ); + const nextEl = interactiveEls[currentEl - 1] || interactiveEls[currentEl + 1]; + if (nextEl) { + nextEl.focus(); } - date.setFullYear(year); - return date; } -// src/utils/metadata/frontmatter/fm.ts -var import_lodash2 = __toESM(require_lodash()); -var import_obsidian12 = require("obsidian"); - -// src/utils/metadata/dv.ts -var import_obsidian11 = require("obsidian"); -var LocationWrapper = { - fullLine: { start: "", end: "" }, - brackets: { start: "[", end: "]" }, - parenthesis: { start: "(", end: ")" } +// src/react/components/UI/Menus/selectMenu/SelectMenuComponent.tsx +var KEYS = { + ENTER: "Enter", + TAB: "Tab", + BACKSPACE: "Backspace", + UP_ARROW: "ArrowUp", + UP_ARROW_COMPAT: "Up", + DOWN_ARROW: "ArrowDown", + DOWN_ARROW_COMPAT: "Down" }; -var fieldComponents = [ - "inQuote", - "inList", - "startStyle", - "attribute", - "endStyle", - "beforeSeparatorSpacer", - "afterSeparatorSpacer", - "values" -]; -var genericFieldRegex = "(?>(\\s+)?)?(?- )?(?[_\\*~`]*)(?[0-9\\w\\p{Letter}\\p{Emoji_Presentation}][-0-9\\w\\p{Letter}\\p{Emoji_Presentation}\\s]*)(?[_\\*~`]*)(?\\s*)"; -var inlineFieldRegex = (attribute) => `(?>(\\s+)?)?(?- )?(?[_\\*~\`]*)(?${attribute})(?[_\\*~\`]*)(?\\s*)::(?\\s*)`; -var fullLineRegex = new RegExp( - `^${genericFieldRegex}::\\s*(?.*)?`, - "u" -); -var inSentenceRegexBrackets = new RegExp( - `\\[${genericFieldRegex}::\\s*(?[^\\]]+)?\\]`, - "gu" -); -var inSentenceRegexPar = new RegExp( - `\\(${genericFieldRegex}::\\s*(?[^\\)]+)?\\)`, - "gu" -); -var encodeLink = (value) => { - return value ? value.replace(/\[\[/g, "\u{1F54C}\u{1F527}").replace(/\]\]/g, "\u{1F413}\u{1F400}") : value; +var CLASS_NAMES = { + root: "mk-options-menu", + rootFocused: "is-focused", + selected: "mk-options-menu__selected", + selectedTag: "mk-options-menu__selected-tag", + selectedTagName: "mk-options-menu__selected-tag-name", + search: "mk-options-menu__search", + searchWrapper: "mk-options-menu__search-wrapper", + searchInput: "mk-options-menu__search-input", + suggestions: "mk-options-menu__suggestions", + suggestionActive: "is-active", + suggestionDisabled: "is-disabled" }; -var decodeLink = (value) => { - return value ? value.replace(/🕌🔧/gu, "[[").replace(/🐓🐀/gu, "]]") : value; +var defaultProps = { + plugin: null, + id: "SelectMenu", + tags: [], + suggestionsOnly: false, + placeholderText: i18n_default.labels.optionItemSelectPlaceholder, + noSuggestionsText: null, + newTagText: null, + suggestions: [], + suggestionsFilter: defaultSuggestionsFilter, + suggestionsTransform: null, + classNames: CLASS_NAMES, + delimiters: [KEYS.ENTER], + minQueryLength: 2, + maxSuggestionsLength: 8, + inputAttributes: {}, + hoverSelect: false }; -var matchInlineFields = (regex, line, attribute, input, location = "fullLine") => { - const sR = line.matchAll(regex); - let next = sR.next(); - const newFields = []; - while (!next.done) { - const match2 = next.value; - if (match2.groups && Object.keys(match2.groups).every((j4) => fieldComponents.includes(j4))) { - const { - inList, - inQuote, - startStyle, - endStyle, - beforeSeparatorSpacer, - afterSeparatorSpacer, - values - } = match2.groups; - const inputArray = input ? input.replace(/(\,\s+)/g, ",").split(",") : [""]; - const newValue = inputArray.length == 1 ? inputArray[0] : `${serializeMultiDisplayString(inputArray)}`; - const start = LocationWrapper[location].start; - const end = LocationWrapper[location].end; - newFields.push({ - oldField: match2[0], - newField: `${inQuote || ""}${start}${inList || ""}${startStyle}${attribute}${endStyle}${beforeSeparatorSpacer}::${afterSeparatorSpacer}${newValue}${end}` - }); +var findMatchIndex = (options, query) => { + return options.findIndex((option) => matchExact(query).test(option.name)); +}; +var pressDelimiter = (props2, query, index, options, addTag, modifiers) => { + if (query.length >= props2.minQueryLength) { + const match2 = findMatchIndex(options, query); + const _index = index === -1 ? match2 : index; + const tag = _index > -1 ? options[_index] : null; + if (tag) { + addTag(tag, modifiers); + } else { + addTag({ name: query, value: query }, modifiers); + } + } +}; +function defaultSuggestionsFilter(item, query) { + const regexp = matchAny(query); + return regexp.test(item.name); +} +function getOptions2(props2, query, section) { + let options; + let suggestions = props2.suggestions; + if (section.length > 0) { + suggestions = props2.suggestions.filter((f4) => f4.section == section); + } + options = query.length == 0 ? suggestions : import_fuzzysort.default.go(query, suggestions, { + keys: ["name", "value"] + }).map((result) => result.obj); + options = options.slice(0, props2.maxSuggestionsLength); + if (props2.newTagText && findMatchIndex(options, query) === -1) { + options.push({ id: 0, name: query, value: query }); + } else if (props2.noSuggestionsText && options.length === 0) { + options.push({ + id: 0, + name: props2.noSuggestionsText, + value: "", + disabled: true + }); + } + return options; +} +var SelectMenuComponent = Cn.forwardRef( + (_props, ref2) => { + const props2 = { ...defaultProps, ..._props }; + const [options, setOptions] = h2([]); + const sections = F2(() => { + var _a2; + if (!props2.showSections) + return []; + return [ + "", + ...(_a2 = props2.sections) != null ? _a2 : uniq(props2.suggestions.map((f4) => f4.section)).filter((f4) => f4) + ]; + }, [props2.showSections, props2.sections, props2.suggestions]); + const inputRef = _2(null); + const [section, setSection] = h2(""); + const [query, setQuery] = h2(""); + const [focused, setFocused] = h2(false); + const [index, setIndex] = h2(0); + const onComposition = _2(false); + p2(() => { + if (ref2) { + ref2.current = () => { + var _a2; + if (!focused) { + (_a2 = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a2.focus(); + setFocused(true); + return false; + } + return true; + }; + } + }, [focused]); + p2(() => { + var _a2; + if (index != -1 && props2.onHover && props2.hoverSelect) { + debounceFn((_a2 = options[index]) == null ? void 0 : _a2.value); + } + }, [index, options]); + const debounceFn = T2( + (0, import_lodash3.debounce)(handleDebounceFn, 300, { + leading: false + }), + [] + ); + function handleDebounceFn(inputValue) { + props2.onHover(inputValue); } - next = sR.next(); - } - return newFields; -}; -async function replaceValues(plugin, fileOrFilePath, attribute, input, previousItemsCount = 0) { - var _a2, _b2; - let file; - if (fileOrFilePath instanceof import_obsidian11.TFile) { - file = fileOrFilePath; - } else { - const _file = plugin.app.vault.getAbstractFileByPath(fileOrFilePath); - if (_file instanceof import_obsidian11.TFile && _file.extension == "md") { - file = _file; - } else { - throw Error("path doesn't correspond to a proper file"); + p2(() => { + if (query.length == 0 && props2.defaultSuggestions) { + setOptions(props2.defaultSuggestions); + return; + } + setOptions(getOptions2(props2, query, section)); + }, [query, props2.suggestions, section, props2]); + const container = _2(null); + const onInput = (e4) => { + if (e4.type === "compositionstart") { + onComposition.current = true; + return; + } + if (e4.type === "compositionend") { + onComposition.current = false; + } + if (onComposition.current) { + return; + } + const _query = e4.target.value; + if (props2.onInput) { + props2.onInput(_query); + } + if (_query.length === query.length + 1 && props2.delimiters.indexOf(query.slice(-1)) > -1) { + pressDelimiter(props2, query, index, options, addTag, {}); + } else if (_query !== query) { + setQuery(_query); + } + }; + const onKeyDown = (e4) => { + if (props2.delimiters.indexOf(e4.key) > -1) { + if (query || index > -1) { + e4.preventDefault(); + } + pressDelimiter(props2, query, index, options, addTag, { + ctrlKey: e4.ctrlKey, + metaKey: e4.metaKey, + altKey: e4.altKey, + shiftKey: e4.shiftKey + }); + } + if (e4.key === KEYS.TAB) { + pressTabKey(e4); + } + if (e4.key === KEYS.BACKSPACE) { + pressBackspaceKey(); + } + if (e4.key === KEYS.UP_ARROW || e4.key === KEYS.UP_ARROW_COMPAT) { + pressUpKey(e4); + } + if (e4.key === KEYS.DOWN_ARROW || e4.key === KEYS.DOWN_ARROW_COMPAT) { + pressDownKey(e4); + } + }; + const onBlur = () => { + setFocused(false); + if (props2.onBlur) { + props2.onBlur(); + } + }; + const onFocus = () => { + setFocused(true); + if (props2.onFocus) { + props2.onFocus(); + } + }; + const onDeleteTag = (index2, event) => { + if (container.current) { + focusNextElement(container.current, event.currentTarget); + } + deleteTag(index2); + }; + const addTag = (tag, modifiers) => { + if (tag.disabled) { + return; + } + if (props2.onValidate && !props2.onValidate(tag)) { + return; + } + props2.onAddition(tag, modifiers); + clearInput(); + }; + const deleteTag = (i4) => { + props2.onDelete(i4); + }; + const clearInput = () => { + setQuery(""); + setIndex(-1); + }; + const clearSelectedIndex = () => { + setIndex(-1); + }; + const pressUpKey = (e4) => { + e4.preventDefault(); + const size = options.length - 1; + setIndex(index <= 0 ? size : index - 1); + }; + const pressDownKey = (e4) => { + e4.preventDefault(); + const size = options.length - 1; + setIndex((i4) => i4 >= size ? 0 : i4 + 1); + }; + function pressBackspaceKey() { + if (!query.length) { + deleteTag(props2.tags.length - 1); + } + } + function pressTabKey(e4) { + if (props2.showSections) { + e4.preventDefault(); + e4.stopPropagation(); + setSection((p3) => { + const sectionIndex = sections.findIndex((g4) => g4 == p3); + if (e4.shiftKey) { + if (sectionIndex == 0) { + return p3; + } + return sections[sectionIndex - 1]; + } + if (sectionIndex == sections.length - 1) { + return p3; + } + return sections[sectionIndex + 1]; + }); + } } + const focusInput = () => { + inputRef.current.focus(); + }; + const inputEventHandlers = { + onChange: onInput, + onBlur, + onFocus, + onInput: () => { + }, + onKeyDown, + onCompositionEnd: onInput, + onCompositionStart: onInput + }; + const expanded = focused && query.length >= props2.minQueryLength; + const classNames9 = Object.assign({}, CLASS_NAMES, props2.classNames); + const rootClassNames = [classNames9.root]; + focused && rootClassNames.push(classNames9.rootFocused); + return /* @__PURE__ */ Cn.createElement("div", { + ref: container, + className: rootClassNames.join(" ") + }, !props2.suggestionsOnly ? /* @__PURE__ */ Cn.createElement("div", { + className: classNames9.selected, + "aria-relevant": "additions removals", + "aria-live": "polite" + }, /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, props2.tags.map((tag, i4) => /* @__PURE__ */ Cn.createElement(SelectMenuPill_default, { + key: i4, + tag, + classNames: classNames9, + onDelete: (e4) => onDeleteTag(i4, e4) + }))), /* @__PURE__ */ Cn.createElement("div", { + className: classNames9.search + }, /* @__PURE__ */ Cn.createElement(SelectMenuInput_default, { + ref: inputRef, + query, + index, + id: props2.id, + classNames: classNames9, + inputAttributes: props2.inputAttributes, + inputEventHandlers, + expanded, + placeholderText: props2.placeholderText + }))) : null, props2.showSections ? /* @__PURE__ */ Cn.createElement("div", { + className: "mk-options-menu-sections" + }, sections.map((f4, i4) => /* @__PURE__ */ Cn.createElement("div", { + key: i4, + onClick: () => setSection(f4), + className: `${section == f4 ? "is-active" : ""} mk-options-menu-section` + }, f4 == "" ? "All" : f4))) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), options.length || props2.allowNew ? /* @__PURE__ */ Cn.createElement(SelectMenuSuggestions_default, { + plugin: props2.plugin, + options, + hoverSelect: props2.hoverSelect, + query, + setIndex, + index, + id: props2.id, + classNames: classNames9, + expanded, + addTag, + allowNew: props2.allowNew, + deleteOption: props2.onDeleteOption + }) : null, props2.previewComponent); } - const content = (await plugin.app.vault.read(file)).split("\n"); - const frontmatter = (_a2 = plugin.app.metadataCache.getFileCache(file)) == null ? void 0 : _a2.frontmatter; - const skippedLines = []; - const { - position: { start, end } - } = frontmatter ? frontmatter : { position: { start: void 0, end: void 0 } }; - const newContent = content.map((line, i4) => { - const encodedInput = encodeLink(input); - let encodedLine = encodeLink(line); - const fullLineRegex2 = new RegExp( - `^${inlineFieldRegex(attribute)}(?[^\\]]*)`, - "u" - ); - const fR = encodedLine.match(fullLineRegex2); - if ((fR == null ? void 0 : fR.groups) && Object.keys(fR.groups).every((j4) => fieldComponents.includes(j4))) { - const { - inList, - inQuote, - startStyle, - endStyle, - beforeSeparatorSpacer, - afterSeparatorSpacer, - values - } = fR.groups; - const inputArray = input ? input.replace(/(\,\s+)/g, ",").split(",").sort() : []; - const hiddenValue = ""; - const newValue = inputArray.length == 1 ? inputArray[0] : `${serializeMultiDisplayString(inputArray)}`; - return `${inQuote || ""}${inList || ""}${startStyle}${attribute}${endStyle}${beforeSeparatorSpacer}::${afterSeparatorSpacer}${hiddenValue + newValue}`; - } else { - const newFields = []; - const inSentenceRegexBrackets2 = new RegExp( - `\\[${inlineFieldRegex(attribute)}(?[^\\]]+)?\\]`, - "gu" - ); - const inSentenceRegexPar2 = new RegExp( - `\\(${inlineFieldRegex(attribute)}(?[^\\)]+)?\\)`, - "gu" - ); - newFields.push( - ...matchInlineFields( - inSentenceRegexBrackets2, - encodedLine, - attribute, - encodedInput, - "brackets" /* brackets */ - ) - ); - newFields.push( - ...matchInlineFields( - inSentenceRegexPar2, - encodedLine, - attribute, - encodedInput, - "parenthesis" /* parenthesis */ - ) +); +SelectMenuComponent.displayName = "SelectMenuComponent"; +var SelectMenuComponent_default = SelectMenuComponent; + +// src/react/components/UI/Menus/selectMenu.tsx +var SelectMenu = Cn.forwardRef( + (props2, ref2) => { + var _a2; + const initialOptions = props2.options.map((o3, i4) => { + return { + ...o3, + id: i4 + 1 + }; + }); + p2(() => { + setSuggestions( + props2.options.map((o3, i4) => { + return { + ...o3, + id: i4 + 1 + }; + }) ); - newFields.forEach((field) => { - const fieldRegex = new RegExp( - field.oldField.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), - "u" + }, [props2.options]); + const [suggestions, setSuggestions] = h2(initialOptions); + const [tags, setTags] = h2( + props2.value.map( + (v3) => { + var _a3; + return (_a3 = initialOptions.find((f4) => f4.value == v3)) != null ? _a3 : { + id: 0, + name: v3, + value: v3 + }; + } + ) + ); + const onDelete = T2( + (tagIndex) => { + const newTags = tags.filter((_12, i4) => i4 !== tagIndex); + setTags(newTags); + props2.saveOptions( + suggestions.map((f4) => f4.value), + newTags.map((f4) => f4.value), + false ); - encodedLine = encodedLine.replace(fieldRegex, field.newField); - }); - return decodeLink(encodedLine); - } - }); - await plugin.app.vault.modify( - file, - newContent.filter((line, i4) => !skippedLines.includes(i4)).join("\n") - ); - const editor = (_b2 = plugin.app.workspace.getActiveViewOfType(import_obsidian11.MarkdownView)) == null ? void 0 : _b2.editor; - if (editor) { - const lineNumber = editor.getCursor().line; - editor.setCursor({ - line: editor.getCursor().line, - ch: editor.getLine(lineNumber).length + }, + [suggestions, tags, props2] + ); + const onDeleteOption = T2( + (removeTag) => { + const newSuggestions = suggestions.filter((f4) => f4.value != removeTag); + const newTags = tags.filter((f4) => f4.value != removeTag); + setSuggestions(newSuggestions); + setTags(newTags); + if (props2.removeOption) + props2.removeOption(removeTag); + props2.hide(); + }, + [tags, suggestions, props2] + ); + const onAddition = T2( + (newTag, modifiers) => { + var _a3; + let tag = newTag; + let newSuggestions = suggestions; + let newTags = tags; + if (!suggestions.find((s5) => s5.value == newTag.value)) { + tag = { + id: suggestions.length + 1, + name: newTag.name, + value: (_a3 = newTag.value) != null ? _a3 : newTag.name + }; + newSuggestions = [...suggestions, tag]; + setSuggestions(newSuggestions); + } + if (props2.multi) { + if (!tags.find((t4) => t4.value == tag.value)) { + newTags = [...tags, tag]; + setTags(newTags); + } + } else { + newTags = [tag]; + setTags(newTags); + } + props2.saveOptions( + newSuggestions.map((f4) => f4.value), + newTags.map((f4) => f4.value), + true + ); + if (!props2.multi) { + props2.hide(); + } + }, + [tags, suggestions] + ); + const onValidation = T2( + (newTag) => { + if (!props2.editable && !suggestions.find((s5) => s5.value == newTag.value)) { + return false; + } + if (newTag.name.length == 0) { + return false; + } + return true; + }, + [suggestions] + ); + return /* @__PURE__ */ Cn.createElement(SelectMenuComponent_default, { + tags: props2.multi ? tags : [], + suggestions, + plugin: props2.plugin, + ref: ref2, + onDelete, + onDeleteOption, + onAddition, + onValidate: onValidation, + defaultSuggestions: props2.defaultOptions, + placeholderText: (_a2 = props2.placeholder) != null ? _a2 : "", + minQueryLength: 0, + onHover: props2.onHover, + hoverSelect: props2.onHover ? true : false, + showSections: props2.showSections, + sections: props2.sections, + maxSuggestionsLength: props2.showAll ? Math.min(50, props2.options.length) : 25, + suggestionsOnly: !props2.searchable && !props2.editable, + allowNew: props2.editable, + previewComponent: props2.previewComponent }); } -} +); +SelectMenu.displayName = "SelectMenu"; +var selectMenu_default = SelectMenu; -// src/utils/metadata/frontmatter/detectYAMLType.ts -var detectYAMLType = (value, key2) => { - if (typeof value === "string") { - if (/\/\/(\S+?(?:jpe?g|png|gif|svg))/gi.test(value) || value.includes("unsplash")) { - return "image"; - } - if (/^\d{4}-\d{2}-\d{2}$/.test(value)) { - return "date"; - } - if (key2 == "tag" || key2 == "tags") { - return "tag"; - } - if (/\[\[.*?\]\]/.test(value)) { - return "link"; - } - } else if (typeof value === "number") { - return "number"; - } else if (typeof value === "boolean") { - return "boolean"; - } else if (!value) { - return "unknown"; - } else if (Array.isArray(value) || typeof value === "string" && value.indexOf(",") > -1) { - let arrayValue = Array.isArray(value) ? value : []; - if (typeof value === "string" && value.indexOf(",") > -1) { - arrayValue = parseMultiString(value); - } - if (key2 == "tag" || key2 == "tags") { - return "tag-multi"; - } - if (arrayValue.length == 1 && Array.isArray(arrayValue[0]) && arrayValue[0].length == 1 && typeof arrayValue[0][0] === "string") { - return "link"; - } - const types2 = uniq(arrayValue.map((f4) => detectYAMLType(f4, key2))); - if (types2.length == 1 && types2[0] == "link") { - return "link-multi"; +// src/react/components/UI/Menus/menuItems.tsx +var inputMenuItem = (menuItem, value, setValue) => { + const frag = document.createDocumentFragment(); + const spanEl = frag.createEl("span"); + const inputEl = frag.createEl("input"); + inputEl.type = "text"; + inputEl.value = value; + inputEl.addEventListener("click", (e4) => { + e4.stopImmediatePropagation(); + }); + inputEl.addEventListener("mousedown", (e4) => { + e4.stopImmediatePropagation(); + }); + inputEl.addEventListener("mouseup", (e4) => { + e4.stopImmediatePropagation(); + }); + inputEl.addEventListener("blur", (e4) => { + setValue(inputEl.value); + }); + menuItem.dom.toggleClass("mk-menu-input", true); + menuItem.setTitle(frag); + return menuItem; +}; +var showSelectMenu = (point, optionProps) => { + const menu = new import_obsidian11.Menu(); + menu.dom.toggleClass("mk-menu", true); + menu.setUseNativeMenu(false); + const frag = document.createDocumentFragment(); + const div = frag.createDiv("mk-options-container"); + div.style.minHeight = Math.min( + 200, + (optionProps.options.length + (optionProps.searchable ? 1 : 0)) * 28 + ).toString() + "px"; + div.addEventListener("click", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("mousedown", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("mouseup", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("keydown", (e4) => { + }); + menu.onHide(() => optionProps.onHide && optionProps.onHide()); + const root = createRoot(div); + root.render( + /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(selectMenu_default, { + hide: () => { + menu.hide(); + optionProps.onHide && optionProps.onHide(); + }, + ...optionProps + })) + ); + menu.addItem((item) => { + item.setTitle(frag); + }); + const keys = [...menu.scope.keys]; + for (let i4 = 0; i4 < keys.length; i4++) { + if (keys[i4].key != "Escape") { + menu.scope.unregister(keys[i4]); } - return "option-multi"; - } else if (value.isLuxonDateTime) { - return "date"; - } else if (value.isLuxonDuration) { - return "duration"; - } else if (value.type == "file") { - return "link"; - } else if (typeof value === "object" && !Array.isArray(value) && value !== null) { - return "object"; } - return "text"; + menu.showAtPosition(point); + return menu; }; - -// src/utils/metadata/frontmatter/frontMatterKeys.ts -var frontMatterKeys = (fm) => { - return Object.keys(fm != null ? fm : {}).filter((f4) => f4 != "position").filter((f4) => f4 != "tag" && f4 != "tags"); +var disclosureMenuItem = (plugin, menuItem, multi, editable, title, value, options, saveOptions) => { + const frag = document.createDocumentFragment(); + const div = frag.createDiv("title"); + div.textContent = title; + const div2 = frag.createDiv("disclosure"); + div2.textContent = value; + menuItem.setTitle(frag); + menuItem.onClick((ev) => { + var _a2; + ev.stopPropagation(); + const offset2 = menuItem.dom.getBoundingClientRect(); + showSelectMenu( + { x: offset2.right + 10, y: offset2.top }, + { + plugin, + multi, + editable, + value: (_a2 = parseMultiString(value)) != null ? _a2 : [], + options, + saveOptions, + searchable: true, + showAll: true + } + ); + }); + return menuItem; }; -// src/utils/metadata/frontmatter/yamlTypeToMDBType.ts -var yamlTypeToMDBType = (YAMLtype) => { - switch (YAMLtype) { - case "duration": - return "text"; - break; - case "unknown": - return "text"; - break; - } - return YAMLtype; -}; +// src/react/components/UI/Menus/propertyMenu/propertyMenu.tsx +var import_obsidian13 = require("obsidian"); -// src/utils/metadata/frontmatter/fm.ts -var saveContextToFile = (file, cols, context, plugin) => { - if (plugin.metadata.canProcessFrontmatter()) { - plugin.metadata.processFrontMatter(file.path, (frontmatter) => { - Object.keys(context).filter( - (f4) => cols.find((c4) => c4.name == f4) && cols.find((c4) => c4.name == f4).hidden != "true" && !cols.find((c4) => c4.name == f4).type.contains("file") && context[f4] - ).forEach((f4) => { - const col = cols.find((c4) => c4.name == f4); - frontmatter[f4] = valueForFrontmatter(col.type, context[f4]); - frontmatter[f4] = valueForFrontmatter(col.type, context[f4]); - }); - }); +// src/utils/contexts/predicate/sort.ts +var simpleSort = (a5, b4) => { + if (a5 < b4) + return -1; + if (a5 > b4) + return 1; + return 0; +}; +var stringSort = (value, filterValue) => simpleSort(value, filterValue); +var numSort = (value, filterValue) => simpleSort(parseFloat(value), parseFloat(filterValue)); +var boolSort = (value, filterValue) => simpleSort(value == "true" ? 1 : 0, filterValue == "true" ? 1 : 0); +var countSort = (value, filterValue) => simpleSort(parseMultiString(value).length, parseMultiString(filterValue).length); +var normalizedSortForType = (type, desc) => { + return Object.keys(sortFnTypes).find( + (f4) => sortFnTypes[f4].type.some((g4) => g4 == type) && sortFnTypes[f4].desc == desc + ); +}; +var sortFnTypes = { + alphabetical: { + type: ["text", "file", "link", "context", "fileprop"], + fn: stringSort, + label: i18n_default.sortTypes.alphaAsc, + desc: false + }, + reverseAlphabetical: { + type: ["text", "file", "link", "context", "fileprop"], + fn: (v3, f4) => stringSort(v3, f4) * -1, + label: i18n_default.sortTypes.alphaDesc, + desc: true + }, + earliest: { + type: ["date", "fileprop"], + fn: stringSort, + label: i18n_default.sortTypes.earliest, + desc: false + }, + latest: { + type: ["date", "fileprop"], + fn: (v3, f4) => stringSort(v3, f4) * -1, + label: i18n_default.sortTypes.latest, + desc: true + }, + boolean: { + type: ["boolean"], + fn: boolSort, + label: i18n_default.sortTypes.checkAsc, + desc: false + }, + booleanReverse: { + type: ["boolean"], + fn: (v3, f4) => boolSort(v3, f4) * -1, + label: i18n_default.sortTypes.checkDesc, + desc: true + }, + number: { + type: ["number", "fileprop"], + fn: numSort, + label: "1 \u2192 9", + desc: false + }, + reverseNumber: { + type: ["number", "fileprop"], + fn: (v3, f4) => numSort(v3, f4) * -1, + label: "9 \u2192 1", + desc: true + }, + count: { + type: ["option-multi", "context-multi", "link-multi"], + fn: countSort, + label: i18n_default.sortTypes.itemsDesc, + desc: true + }, + reverseCount: { + type: ["option-multi", "context-multi", "link-multi"], + fn: (v3, f4) => countSort(v3, f4) * -1, + label: i18n_default.sortTypes.itemsAsc, + desc: false } }; -var frontMatterForFile = (plugin, file) => { - let currentCache; - if (file instanceof import_obsidian12.TFile && plugin.app.metadataCache.getFileCache(file) !== null) { - currentCache = plugin.app.metadataCache.getFileCache(file); +var sortReturnForCol = (col, sort, row, row2) => { + if (!col) + return 0; + const sortType = sortFnTypes[sort.fn]; + if (sortType) { + return sortType.fn(row[sort.field], row2[sort.field]); } - return currentCache == null ? void 0 : currentCache.frontmatter; + return 0; }; -var guestimateTypes = (_files, plugin, dv) => { - const typesArray = _files.map((f4) => getAbstractFileAtPath(plugin, f4)).filter((f4) => f4).map((k5) => { - const fm = dv && plugin.dataViewAPI() ? plugin.dataViewAPI().page(k5.path) : frontMatterForFile(plugin, k5); - const fmKeys = dv ? Object.keys(fm != null ? fm : {}).filter( - (f4, i4, self2) => !self2.find( - (g4, j4) => g4.toLowerCase().replace(/\s/g, "-") == f4.toLowerCase().replace(/\s/g, "-") && i4 > j4 - ) ? true : false - ).filter((f4) => f4 != "file") : frontMatterKeys(fm); - return fmKeys.reduce( - (pk, ck) => ({ ...pk, [ck]: detectYAMLType(fm[ck], ck) }), - {} - ); - }); - const types2 = typesArray.reduce( - (p3, c4) => { - const newSet = Object.keys(c4).reduce( - (pk, ck) => { - var _a2; - return { ...pk, [ck]: [...(_a2 = p3 == null ? void 0 : p3[ck]) != null ? _a2 : [], c4[ck]] }; - }, - { ...p3 } - ); - return newSet; + +// src/react/components/UI/Modals/stickerModal.tsx +var import_obsidian12 = require("obsidian"); + +// src/react/components/SpaceView/Editor/StickerMenu/emojis/default.ts +var emojis = { + smileys_people: [ + { n: ["grinning", "grinning face"], u: "1f600" }, + { n: ["smiley", "smiling face with open mouth"], u: "1f603" }, + { + n: ["smile", "smiling face with open mouth and smiling eyes"], + u: "1f604" + }, + { n: ["grin", "grinning face with smiling eyes"], u: "1f601" }, + { + n: [ + "laughing", + "satisfied", + "smiling face with open mouth and tightly-closed eyes" + ], + u: "1f606" + }, + { + n: ["sweat smile", "smiling face with open mouth and cold sweat"], + u: "1f605" + }, + { n: ["rolling on the floor laughing"], u: "1f923" }, + { n: ["joy", "face with tears of joy"], u: "1f602" }, + { n: ["slightly smiling face"], u: "1f642" }, + { n: ["upside-down face", "upside down face"], u: "1f643" }, + { n: ["melting face"], u: "1fae0" }, + { n: ["wink", "winking face"], u: "1f609" }, + { n: ["blush", "smiling face with smiling eyes"], u: "1f60a" }, + { n: ["innocent", "smiling face with halo"], u: "1f607" }, + { + n: [ + "smiling face with 3 hearts", + "smiling face with smiling eyes and three hearts" + ], + u: "1f970" + }, + { n: ["heart eyes", "smiling face with heart-shaped eyes"], u: "1f60d" }, + { n: ["star-struck", "grinning face with star eyes"], u: "1f929" }, + { n: ["kissing heart", "face throwing a kiss"], u: "1f618" }, + { n: ["kissing", "kissing face"], u: "1f617" }, + { n: ["relaxed", "white smiling face"], u: "263a-fe0f" }, + { n: ["kissing closed eyes", "kissing face with closed eyes"], u: "1f61a" }, + { + n: ["kissing smiling eyes", "kissing face with smiling eyes"], + u: "1f619" + }, + { n: ["smiling face with tear"], u: "1f972" }, + { n: ["yum", "face savouring delicious food"], u: "1f60b" }, + { n: ["stuck out tongue", "face with stuck-out tongue"], u: "1f61b" }, + { + n: [ + "stuck out tongue winking eye", + "face with stuck-out tongue and winking eye" + ], + u: "1f61c" + }, + { + n: ["zany face", "grinning face with one large and one small eye"], + u: "1f92a" + }, + { + n: [ + "stuck out tongue closed eyes", + "face with stuck-out tongue and tightly-closed eyes" + ], + u: "1f61d" + }, + { n: ["money-mouth face", "money mouth face"], u: "1f911" }, + { n: ["hugging face"], u: "1f917" }, + { + n: [ + "face with hand over mouth", + "smiling face with smiling eyes and hand covering mouth" + ], + u: "1f92d" + }, + { n: ["face with open eyes and hand over mouth"], u: "1fae2" }, + { n: ["face with peeking eye"], u: "1fae3" }, + { + n: ["shushing face", "face with finger covering closed lips"], + u: "1f92b" + }, + { n: ["thinking face"], u: "1f914" }, + { n: ["saluting face"], u: "1fae1" }, + { n: ["zipper-mouth face", "zipper mouth face"], u: "1f910" }, + { + n: ["face with raised eyebrow", "face with one eyebrow raised"], + u: "1f928" + }, + { n: ["neutral face"], u: "1f610" }, + { n: ["expressionless", "expressionless face"], u: "1f611" }, + { n: ["no mouth", "face without mouth"], u: "1f636" }, + { n: ["dotted line face"], u: "1fae5" }, + { n: ["face in clouds"], u: "1f636-200d-1f32b-fe0f" }, + { n: ["smirk", "smirking face"], u: "1f60f" }, + { n: ["unamused", "unamused face"], u: "1f612" }, + { n: ["face with rolling eyes"], u: "1f644" }, + { n: ["grimacing", "grimacing face"], u: "1f62c" }, + { n: ["face exhaling"], u: "1f62e-200d-1f4a8" }, + { n: ["lying face"], u: "1f925" }, + { n: ["relieved", "relieved face"], u: "1f60c" }, + { n: ["pensive", "pensive face"], u: "1f614" }, + { n: ["sleepy", "sleepy face"], u: "1f62a" }, + { n: ["drooling face"], u: "1f924" }, + { n: ["sleeping", "sleeping face"], u: "1f634" }, + { n: ["mask", "face with medical mask"], u: "1f637" }, + { n: ["face with thermometer"], u: "1f912" }, + { n: ["face with head-bandage", "face with head bandage"], u: "1f915" }, + { n: ["nauseated face"], u: "1f922" }, + { n: ["face vomiting", "face with open mouth vomiting"], u: "1f92e" }, + { n: ["sneezing face"], u: "1f927" }, + { n: ["hot face", "overheated face"], u: "1f975" }, + { n: ["cold face", "freezing face"], u: "1f976" }, + { n: ["woozy face", "face with uneven eyes and wavy mouth"], u: "1f974" }, + { n: ["dizzy face"], u: "1f635" }, + { n: ["face with spiral eyes"], u: "1f635-200d-1f4ab" }, + { n: ["exploding head", "shocked face with exploding head"], u: "1f92f" }, + { n: ["face with cowboy hat"], u: "1f920" }, + { n: ["partying face", "face with party horn and party hat"], u: "1f973" }, + { n: ["disguised face"], u: "1f978" }, + { n: ["sunglasses", "smiling face with sunglasses"], u: "1f60e" }, + { n: ["nerd face"], u: "1f913" }, + { n: ["face with monocle"], u: "1f9d0" }, + { n: ["confused", "confused face"], u: "1f615" }, + { n: ["face with diagonal mouth"], u: "1fae4" }, + { n: ["worried", "worried face"], u: "1f61f" }, + { n: ["slightly frowning face"], u: "1f641" }, + { n: ["frowning face", "white frowning face"], u: "2639-fe0f" }, + { n: ["open mouth", "face with open mouth"], u: "1f62e" }, + { n: ["hushed", "hushed face"], u: "1f62f" }, + { n: ["astonished", "astonished face"], u: "1f632" }, + { n: ["flushed", "flushed face"], u: "1f633" }, + { n: ["pleading face", "face with pleading eyes"], u: "1f97a" }, + { n: ["face holding back tears"], u: "1f979" }, + { n: ["frowning", "frowning face with open mouth"], u: "1f626" }, + { n: ["anguished", "anguished face"], u: "1f627" }, + { n: ["fearful", "fearful face"], u: "1f628" }, + { n: ["cold sweat", "face with open mouth and cold sweat"], u: "1f630" }, + { + n: ["disappointed relieved", "disappointed but relieved face"], + u: "1f625" + }, + { n: ["cry", "crying face"], u: "1f622" }, + { n: ["sob", "loudly crying face"], u: "1f62d" }, + { n: ["scream", "face screaming in fear"], u: "1f631" }, + { n: ["confounded", "confounded face"], u: "1f616" }, + { n: ["persevere", "persevering face"], u: "1f623" }, + { n: ["disappointed", "disappointed face"], u: "1f61e" }, + { n: ["sweat", "face with cold sweat"], u: "1f613" }, + { n: ["weary", "weary face"], u: "1f629" }, + { n: ["tired face"], u: "1f62b" }, + { n: ["yawning face"], u: "1f971" }, + { n: ["triumph", "face with look of triumph"], u: "1f624" }, + { n: ["rage", "pouting face"], u: "1f621" }, + { n: ["angry", "angry face"], u: "1f620" }, + { + n: [ + "face with symbols on mouth", + "serious face with symbols covering mouth" + ], + u: "1f92c" + }, + { n: ["smiling imp", "smiling face with horns"], u: "1f608" }, + { n: ["imp"], u: "1f47f" }, + { n: ["skull"], u: "1f480" }, + { n: ["skull and crossbones"], u: "2620-fe0f" }, + { n: ["poop", "shit", "hankey", "pile of poo"], u: "1f4a9" }, + { n: ["clown face"], u: "1f921" }, + { n: ["japanese ogre"], u: "1f479" }, + { n: ["japanese goblin"], u: "1f47a" }, + { n: ["ghost"], u: "1f47b" }, + { n: ["alien", "extraterrestrial alien"], u: "1f47d" }, + { n: ["alien monster", "space invader"], u: "1f47e" }, + { n: ["robot face"], u: "1f916" }, + { n: ["smiley cat", "smiling cat face with open mouth"], u: "1f63a" }, + { n: ["smile cat", "grinning cat face with smiling eyes"], u: "1f638" }, + { n: ["joy cat", "cat face with tears of joy"], u: "1f639" }, + { + n: ["heart eyes cat", "smiling cat face with heart-shaped eyes"], + u: "1f63b" + }, + { n: ["smirk cat", "cat face with wry smile"], u: "1f63c" }, + { n: ["kissing cat", "kissing cat face with closed eyes"], u: "1f63d" }, + { n: ["scream cat", "weary cat face"], u: "1f640" }, + { n: ["crying cat face"], u: "1f63f" }, + { n: ["pouting cat", "pouting cat face"], u: "1f63e" }, + { n: ["see no evil", "see-no-evil monkey"], u: "1f648" }, + { n: ["hear no evil", "hear-no-evil monkey"], u: "1f649" }, + { n: ["speak no evil", "speak-no-evil monkey"], u: "1f64a" }, + { n: ["kiss", "kiss mark"], u: "1f48b" }, + { n: ["love letter"], u: "1f48c" }, + { n: ["cupid", "heart with arrow"], u: "1f498" }, + { n: ["gift heart", "heart with ribbon"], u: "1f49d" }, + { n: ["sparkling heart"], u: "1f496" }, + { n: ["heartpulse", "growing heart"], u: "1f497" }, + { n: ["heartbeat", "beating heart"], u: "1f493" }, + { n: ["revolving hearts"], u: "1f49e" }, + { n: ["two hearts"], u: "1f495" }, + { n: ["heart decoration"], u: "1f49f" }, + { + n: ["heart exclamation", "heavy heart exclamation mark ornament"], + u: "2763-fe0f" + }, + { n: ["broken heart"], u: "1f494" }, + { n: ["heart on fire"], u: "2764-fe0f-200d-1f525" }, + { n: ["mending heart"], u: "2764-fe0f-200d-1fa79" }, + { n: ["heart", "heavy black heart"], u: "2764-fe0f" }, + { n: ["orange heart"], u: "1f9e1" }, + { n: ["yellow heart"], u: "1f49b" }, + { n: ["green heart"], u: "1f49a" }, + { n: ["blue heart"], u: "1f499" }, + { n: ["purple heart"], u: "1f49c" }, + { n: ["brown heart"], u: "1f90e" }, + { n: ["black heart"], u: "1f5a4" }, + { n: ["white heart"], u: "1f90d" }, + { n: ["100", "hundred points symbol"], u: "1f4af" }, + { n: ["anger", "anger symbol"], u: "1f4a2" }, + { n: ["boom", "collision", "collision symbol"], u: "1f4a5" }, + { n: ["dizzy", "dizzy symbol"], u: "1f4ab" }, + { n: ["sweat drops", "splashing sweat symbol"], u: "1f4a6" }, + { n: ["dash", "dash symbol"], u: "1f4a8" }, + { n: ["hole"], u: "1f573-fe0f" }, + { n: ["bomb"], u: "1f4a3" }, + { n: ["speech balloon"], u: "1f4ac" }, + { + n: ["eye in speech bubble", "eye-in-speech-bubble"], + u: "1f441-fe0f-200d-1f5e8-fe0f" + }, + { n: ["left speech bubble"], u: "1f5e8-fe0f" }, + { n: ["right anger bubble"], u: "1f5ef-fe0f" }, + { n: ["thought balloon"], u: "1f4ad" }, + { n: ["zzz", "sleeping symbol"], u: "1f4a4" }, + { + n: ["wave", "waving hand sign"], + u: "1f44b", + v: [ + "1f44b-1f3fb", + "1f44b-1f3fc", + "1f44b-1f3fd", + "1f44b-1f3fe", + "1f44b-1f3ff" + ] + }, + { + n: ["raised back of hand"], + u: "1f91a", + v: [ + "1f91a-1f3fb", + "1f91a-1f3fc", + "1f91a-1f3fd", + "1f91a-1f3fe", + "1f91a-1f3ff" + ] + }, + { + n: ["hand with fingers splayed", "raised hand with fingers splayed"], + u: "1f590-fe0f", + v: [ + "1f590-1f3fb", + "1f590-1f3fc", + "1f590-1f3fd", + "1f590-1f3fe", + "1f590-1f3ff" + ] + }, + { + n: ["hand", "raised hand"], + u: "270b", + v: ["270b-1f3fb", "270b-1f3fc", "270b-1f3fd", "270b-1f3fe", "270b-1f3ff"] + }, + { + n: [ + "spock-hand", + "raised hand with part between middle and ring fingers" + ], + u: "1f596", + v: [ + "1f596-1f3fb", + "1f596-1f3fc", + "1f596-1f3fd", + "1f596-1f3fe", + "1f596-1f3ff" + ] + }, + { + n: ["rightwards hand"], + u: "1faf1", + v: [ + "1faf1-1f3fb", + "1faf1-1f3fc", + "1faf1-1f3fd", + "1faf1-1f3fe", + "1faf1-1f3ff" + ] + }, + { + n: ["leftwards hand"], + u: "1faf2", + v: [ + "1faf2-1f3fb", + "1faf2-1f3fc", + "1faf2-1f3fd", + "1faf2-1f3fe", + "1faf2-1f3ff" + ] + }, + { + n: ["palm down hand"], + u: "1faf3", + v: [ + "1faf3-1f3fb", + "1faf3-1f3fc", + "1faf3-1f3fd", + "1faf3-1f3fe", + "1faf3-1f3ff" + ] + }, + { + n: ["palm up hand"], + u: "1faf4", + v: [ + "1faf4-1f3fb", + "1faf4-1f3fc", + "1faf4-1f3fd", + "1faf4-1f3fe", + "1faf4-1f3ff" + ] + }, + { + n: ["ok hand", "ok hand sign"], + u: "1f44c", + v: [ + "1f44c-1f3fb", + "1f44c-1f3fc", + "1f44c-1f3fd", + "1f44c-1f3fe", + "1f44c-1f3ff" + ] + }, + { + n: ["pinched fingers"], + u: "1f90c", + v: [ + "1f90c-1f3fb", + "1f90c-1f3fc", + "1f90c-1f3fd", + "1f90c-1f3fe", + "1f90c-1f3ff" + ] + }, + { + n: ["pinching hand"], + u: "1f90f", + v: [ + "1f90f-1f3fb", + "1f90f-1f3fc", + "1f90f-1f3fd", + "1f90f-1f3fe", + "1f90f-1f3ff" + ] + }, + { + n: ["v", "victory hand"], + u: "270c-fe0f", + v: ["270c-1f3fb", "270c-1f3fc", "270c-1f3fd", "270c-1f3fe", "270c-1f3ff"] + }, + { + n: ["crossed fingers", "hand with index and middle fingers crossed"], + u: "1f91e", + v: [ + "1f91e-1f3fb", + "1f91e-1f3fc", + "1f91e-1f3fd", + "1f91e-1f3fe", + "1f91e-1f3ff" + ] + }, + { + n: ["hand with index finger and thumb crossed"], + u: "1faf0", + v: [ + "1faf0-1f3fb", + "1faf0-1f3fc", + "1faf0-1f3fd", + "1faf0-1f3fe", + "1faf0-1f3ff" + ] + }, + { + n: ["i love you hand sign"], + u: "1f91f", + v: [ + "1f91f-1f3fb", + "1f91f-1f3fc", + "1f91f-1f3fd", + "1f91f-1f3fe", + "1f91f-1f3ff" + ] + }, + { + n: ["the horns", "sign of the horns"], + u: "1f918", + v: [ + "1f918-1f3fb", + "1f918-1f3fc", + "1f918-1f3fd", + "1f918-1f3fe", + "1f918-1f3ff" + ] + }, + { + n: ["call me hand"], + u: "1f919", + v: [ + "1f919-1f3fb", + "1f919-1f3fc", + "1f919-1f3fd", + "1f919-1f3fe", + "1f919-1f3ff" + ] + }, + { + n: ["point left", "white left pointing backhand index"], + u: "1f448", + v: [ + "1f448-1f3fb", + "1f448-1f3fc", + "1f448-1f3fd", + "1f448-1f3fe", + "1f448-1f3ff" + ] + }, + { + n: ["point right", "white right pointing backhand index"], + u: "1f449", + v: [ + "1f449-1f3fb", + "1f449-1f3fc", + "1f449-1f3fd", + "1f449-1f3fe", + "1f449-1f3ff" + ] + }, + { + n: ["point up 2", "white up pointing backhand index"], + u: "1f446", + v: [ + "1f446-1f3fb", + "1f446-1f3fc", + "1f446-1f3fd", + "1f446-1f3fe", + "1f446-1f3ff" + ] + }, + { + n: ["middle finger", "reversed hand with middle finger extended"], + u: "1f595", + v: [ + "1f595-1f3fb", + "1f595-1f3fc", + "1f595-1f3fd", + "1f595-1f3fe", + "1f595-1f3ff" + ] + }, + { + n: ["point down", "white down pointing backhand index"], + u: "1f447", + v: [ + "1f447-1f3fb", + "1f447-1f3fc", + "1f447-1f3fd", + "1f447-1f3fe", + "1f447-1f3ff" + ] + }, + { + n: ["point up", "white up pointing index"], + u: "261d-fe0f", + v: ["261d-1f3fb", "261d-1f3fc", "261d-1f3fd", "261d-1f3fe", "261d-1f3ff"] + }, + { + n: ["index pointing at the viewer"], + u: "1faf5", + v: [ + "1faf5-1f3fb", + "1faf5-1f3fc", + "1faf5-1f3fd", + "1faf5-1f3fe", + "1faf5-1f3ff" + ] + }, + { + n: ["+1", "thumbsup", "thumbs up sign"], + u: "1f44d", + v: [ + "1f44d-1f3fb", + "1f44d-1f3fc", + "1f44d-1f3fd", + "1f44d-1f3fe", + "1f44d-1f3ff" + ] + }, + { + n: ["-1", "thumbsdown", "thumbs down sign"], + u: "1f44e", + v: [ + "1f44e-1f3fb", + "1f44e-1f3fc", + "1f44e-1f3fd", + "1f44e-1f3fe", + "1f44e-1f3ff" + ] + }, + { + n: ["fist", "raised fist"], + u: "270a", + v: ["270a-1f3fb", "270a-1f3fc", "270a-1f3fd", "270a-1f3fe", "270a-1f3ff"] + }, + { + n: ["punch", "facepunch", "fisted hand sign"], + u: "1f44a", + v: [ + "1f44a-1f3fb", + "1f44a-1f3fc", + "1f44a-1f3fd", + "1f44a-1f3fe", + "1f44a-1f3ff" + ] + }, + { + n: ["left-facing fist"], + u: "1f91b", + v: [ + "1f91b-1f3fb", + "1f91b-1f3fc", + "1f91b-1f3fd", + "1f91b-1f3fe", + "1f91b-1f3ff" + ] + }, + { + n: ["right-facing fist"], + u: "1f91c", + v: [ + "1f91c-1f3fb", + "1f91c-1f3fc", + "1f91c-1f3fd", + "1f91c-1f3fe", + "1f91c-1f3ff" + ] + }, + { + n: ["clap", "clapping hands sign"], + u: "1f44f", + v: [ + "1f44f-1f3fb", + "1f44f-1f3fc", + "1f44f-1f3fd", + "1f44f-1f3fe", + "1f44f-1f3ff" + ] + }, + { + n: ["raised hands", "person raising both hands in celebration"], + u: "1f64c", + v: [ + "1f64c-1f3fb", + "1f64c-1f3fc", + "1f64c-1f3fd", + "1f64c-1f3fe", + "1f64c-1f3ff" + ] + }, + { + n: ["heart hands"], + u: "1faf6", + v: [ + "1faf6-1f3fb", + "1faf6-1f3fc", + "1faf6-1f3fd", + "1faf6-1f3fe", + "1faf6-1f3ff" + ] + }, + { + n: ["open hands", "open hands sign"], + u: "1f450", + v: [ + "1f450-1f3fb", + "1f450-1f3fc", + "1f450-1f3fd", + "1f450-1f3fe", + "1f450-1f3ff" + ] + }, + { + n: ["palms up together"], + u: "1f932", + v: [ + "1f932-1f3fb", + "1f932-1f3fc", + "1f932-1f3fd", + "1f932-1f3fe", + "1f932-1f3ff" + ] + }, + { + n: ["handshake"], + u: "1f91d", + v: [ + "1f91d-1f3fb", + "1f91d-1f3fc", + "1f91d-1f3fd", + "1f91d-1f3fe", + "1f91d-1f3ff", + "1faf1-1f3fb-200d-1faf2-1f3fc", + "1faf1-1f3fb-200d-1faf2-1f3fd", + "1faf1-1f3fb-200d-1faf2-1f3fe", + "1faf1-1f3fb-200d-1faf2-1f3ff", + "1faf1-1f3fc-200d-1faf2-1f3fb", + "1faf1-1f3fc-200d-1faf2-1f3fd", + "1faf1-1f3fc-200d-1faf2-1f3fe", + "1faf1-1f3fc-200d-1faf2-1f3ff", + "1faf1-1f3fd-200d-1faf2-1f3fb", + "1faf1-1f3fd-200d-1faf2-1f3fc", + "1faf1-1f3fd-200d-1faf2-1f3fe", + "1faf1-1f3fd-200d-1faf2-1f3ff", + "1faf1-1f3fe-200d-1faf2-1f3fb", + "1faf1-1f3fe-200d-1faf2-1f3fc", + "1faf1-1f3fe-200d-1faf2-1f3fd", + "1faf1-1f3fe-200d-1faf2-1f3ff", + "1faf1-1f3ff-200d-1faf2-1f3fb", + "1faf1-1f3ff-200d-1faf2-1f3fc", + "1faf1-1f3ff-200d-1faf2-1f3fd", + "1faf1-1f3ff-200d-1faf2-1f3fe" + ] + }, + { + n: ["pray", "person with folded hands"], + u: "1f64f", + v: [ + "1f64f-1f3fb", + "1f64f-1f3fc", + "1f64f-1f3fd", + "1f64f-1f3fe", + "1f64f-1f3ff" + ] + }, + { + n: ["writing hand"], + u: "270d-fe0f", + v: ["270d-1f3fb", "270d-1f3fc", "270d-1f3fd", "270d-1f3fe", "270d-1f3ff"] + }, + { + n: ["nail care", "nail polish"], + u: "1f485", + v: [ + "1f485-1f3fb", + "1f485-1f3fc", + "1f485-1f3fd", + "1f485-1f3fe", + "1f485-1f3ff" + ] + }, + { + n: ["selfie"], + u: "1f933", + v: [ + "1f933-1f3fb", + "1f933-1f3fc", + "1f933-1f3fd", + "1f933-1f3fe", + "1f933-1f3ff" + ] + }, + { + n: ["muscle", "flexed biceps"], + u: "1f4aa", + v: [ + "1f4aa-1f3fb", + "1f4aa-1f3fc", + "1f4aa-1f3fd", + "1f4aa-1f3fe", + "1f4aa-1f3ff" + ] + }, + { n: ["mechanical arm"], u: "1f9be" }, + { n: ["mechanical leg"], u: "1f9bf" }, + { + n: ["leg"], + u: "1f9b5", + v: [ + "1f9b5-1f3fb", + "1f9b5-1f3fc", + "1f9b5-1f3fd", + "1f9b5-1f3fe", + "1f9b5-1f3ff" + ] + }, + { + n: ["foot"], + u: "1f9b6", + v: [ + "1f9b6-1f3fb", + "1f9b6-1f3fc", + "1f9b6-1f3fd", + "1f9b6-1f3fe", + "1f9b6-1f3ff" + ] + }, + { + n: ["ear"], + u: "1f442", + v: [ + "1f442-1f3fb", + "1f442-1f3fc", + "1f442-1f3fd", + "1f442-1f3fe", + "1f442-1f3ff" + ] + }, + { + n: ["ear with hearing aid"], + u: "1f9bb", + v: [ + "1f9bb-1f3fb", + "1f9bb-1f3fc", + "1f9bb-1f3fd", + "1f9bb-1f3fe", + "1f9bb-1f3ff" + ] + }, + { + n: ["nose"], + u: "1f443", + v: [ + "1f443-1f3fb", + "1f443-1f3fc", + "1f443-1f3fd", + "1f443-1f3fe", + "1f443-1f3ff" + ] + }, + { n: ["brain"], u: "1f9e0" }, + { n: ["anatomical heart"], u: "1fac0" }, + { n: ["lungs"], u: "1fac1" }, + { n: ["tooth"], u: "1f9b7" }, + { n: ["bone"], u: "1f9b4" }, + { n: ["eyes"], u: "1f440" }, + { n: ["eye"], u: "1f441-fe0f" }, + { n: ["tongue"], u: "1f445" }, + { n: ["lips", "mouth"], u: "1f444" }, + { n: ["biting lip"], u: "1fae6" }, + { + n: ["baby"], + u: "1f476", + v: [ + "1f476-1f3fb", + "1f476-1f3fc", + "1f476-1f3fd", + "1f476-1f3fe", + "1f476-1f3ff" + ] + }, + { + n: ["child"], + u: "1f9d2", + v: [ + "1f9d2-1f3fb", + "1f9d2-1f3fc", + "1f9d2-1f3fd", + "1f9d2-1f3fe", + "1f9d2-1f3ff" + ] + }, + { + n: ["boy"], + u: "1f466", + v: [ + "1f466-1f3fb", + "1f466-1f3fc", + "1f466-1f3fd", + "1f466-1f3fe", + "1f466-1f3ff" + ] + }, + { + n: ["girl"], + u: "1f467", + v: [ + "1f467-1f3fb", + "1f467-1f3fc", + "1f467-1f3fd", + "1f467-1f3fe", + "1f467-1f3ff" + ] + }, + { + n: ["adult"], + u: "1f9d1", + v: [ + "1f9d1-1f3fb", + "1f9d1-1f3fc", + "1f9d1-1f3fd", + "1f9d1-1f3fe", + "1f9d1-1f3ff" + ] + }, + { + n: ["person with blond hair"], + u: "1f471", + v: [ + "1f471-1f3fb", + "1f471-1f3fc", + "1f471-1f3fd", + "1f471-1f3fe", + "1f471-1f3ff" + ] + }, + { + n: ["man"], + u: "1f468", + v: [ + "1f468-1f3fb", + "1f468-1f3fc", + "1f468-1f3fd", + "1f468-1f3fe", + "1f468-1f3ff" + ] + }, + { + n: ["bearded person"], + u: "1f9d4", + v: [ + "1f9d4-1f3fb", + "1f9d4-1f3fc", + "1f9d4-1f3fd", + "1f9d4-1f3fe", + "1f9d4-1f3ff" + ] + }, + { + n: ["man: beard", "man with beard"], + u: "1f9d4-200d-2642-fe0f", + v: [ + "1f9d4-1f3fb-200d-2642-fe0f", + "1f9d4-1f3fc-200d-2642-fe0f", + "1f9d4-1f3fd-200d-2642-fe0f", + "1f9d4-1f3fe-200d-2642-fe0f", + "1f9d4-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman: beard", "woman with beard"], + u: "1f9d4-200d-2640-fe0f", + v: [ + "1f9d4-1f3fb-200d-2640-fe0f", + "1f9d4-1f3fc-200d-2640-fe0f", + "1f9d4-1f3fd-200d-2640-fe0f", + "1f9d4-1f3fe-200d-2640-fe0f", + "1f9d4-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["man: red hair", "red haired man"], + u: "1f468-200d-1f9b0", + v: [ + "1f468-1f3fb-200d-1f9b0", + "1f468-1f3fc-200d-1f9b0", + "1f468-1f3fd-200d-1f9b0", + "1f468-1f3fe-200d-1f9b0", + "1f468-1f3ff-200d-1f9b0" + ] + }, + { + n: ["man: curly hair", "curly haired man"], + u: "1f468-200d-1f9b1", + v: [ + "1f468-1f3fb-200d-1f9b1", + "1f468-1f3fc-200d-1f9b1", + "1f468-1f3fd-200d-1f9b1", + "1f468-1f3fe-200d-1f9b1", + "1f468-1f3ff-200d-1f9b1" + ] + }, + { + n: ["man: white hair", "white haired man"], + u: "1f468-200d-1f9b3", + v: [ + "1f468-1f3fb-200d-1f9b3", + "1f468-1f3fc-200d-1f9b3", + "1f468-1f3fd-200d-1f9b3", + "1f468-1f3fe-200d-1f9b3", + "1f468-1f3ff-200d-1f9b3" + ] + }, + { + n: ["bald man", "man: bald"], + u: "1f468-200d-1f9b2", + v: [ + "1f468-1f3fb-200d-1f9b2", + "1f468-1f3fc-200d-1f9b2", + "1f468-1f3fd-200d-1f9b2", + "1f468-1f3fe-200d-1f9b2", + "1f468-1f3ff-200d-1f9b2" + ] + }, + { + n: ["woman"], + u: "1f469", + v: [ + "1f469-1f3fb", + "1f469-1f3fc", + "1f469-1f3fd", + "1f469-1f3fe", + "1f469-1f3ff" + ] + }, + { + n: ["woman: red hair", "red haired woman"], + u: "1f469-200d-1f9b0", + v: [ + "1f469-1f3fb-200d-1f9b0", + "1f469-1f3fc-200d-1f9b0", + "1f469-1f3fd-200d-1f9b0", + "1f469-1f3fe-200d-1f9b0", + "1f469-1f3ff-200d-1f9b0" + ] + }, + { + n: ["person: red hair", "red haired person"], + u: "1f9d1-200d-1f9b0", + v: [ + "1f9d1-1f3fb-200d-1f9b0", + "1f9d1-1f3fc-200d-1f9b0", + "1f9d1-1f3fd-200d-1f9b0", + "1f9d1-1f3fe-200d-1f9b0", + "1f9d1-1f3ff-200d-1f9b0" + ] + }, + { + n: ["woman: curly hair", "curly haired woman"], + u: "1f469-200d-1f9b1", + v: [ + "1f469-1f3fb-200d-1f9b1", + "1f469-1f3fc-200d-1f9b1", + "1f469-1f3fd-200d-1f9b1", + "1f469-1f3fe-200d-1f9b1", + "1f469-1f3ff-200d-1f9b1" + ] + }, + { + n: ["person: curly hair", "curly haired person"], + u: "1f9d1-200d-1f9b1", + v: [ + "1f9d1-1f3fb-200d-1f9b1", + "1f9d1-1f3fc-200d-1f9b1", + "1f9d1-1f3fd-200d-1f9b1", + "1f9d1-1f3fe-200d-1f9b1", + "1f9d1-1f3ff-200d-1f9b1" + ] + }, + { + n: ["woman: white hair", "white haired woman"], + u: "1f469-200d-1f9b3", + v: [ + "1f469-1f3fb-200d-1f9b3", + "1f469-1f3fc-200d-1f9b3", + "1f469-1f3fd-200d-1f9b3", + "1f469-1f3fe-200d-1f9b3", + "1f469-1f3ff-200d-1f9b3" + ] + }, + { + n: ["person: white hair", "white haired person"], + u: "1f9d1-200d-1f9b3", + v: [ + "1f9d1-1f3fb-200d-1f9b3", + "1f9d1-1f3fc-200d-1f9b3", + "1f9d1-1f3fd-200d-1f9b3", + "1f9d1-1f3fe-200d-1f9b3", + "1f9d1-1f3ff-200d-1f9b3" + ] + }, + { + n: ["bald woman", "woman: bald"], + u: "1f469-200d-1f9b2", + v: [ + "1f469-1f3fb-200d-1f9b2", + "1f469-1f3fc-200d-1f9b2", + "1f469-1f3fd-200d-1f9b2", + "1f469-1f3fe-200d-1f9b2", + "1f469-1f3ff-200d-1f9b2" + ] + }, + { + n: ["bald person", "person: bald"], + u: "1f9d1-200d-1f9b2", + v: [ + "1f9d1-1f3fb-200d-1f9b2", + "1f9d1-1f3fc-200d-1f9b2", + "1f9d1-1f3fd-200d-1f9b2", + "1f9d1-1f3fe-200d-1f9b2", + "1f9d1-1f3ff-200d-1f9b2" + ] + }, + { + n: ["woman: blond hair", "blond-haired-woman"], + u: "1f471-200d-2640-fe0f", + v: [ + "1f471-1f3fb-200d-2640-fe0f", + "1f471-1f3fc-200d-2640-fe0f", + "1f471-1f3fd-200d-2640-fe0f", + "1f471-1f3fe-200d-2640-fe0f", + "1f471-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["man: blond hair", "blond-haired-man"], + u: "1f471-200d-2642-fe0f", + v: [ + "1f471-1f3fb-200d-2642-fe0f", + "1f471-1f3fc-200d-2642-fe0f", + "1f471-1f3fd-200d-2642-fe0f", + "1f471-1f3fe-200d-2642-fe0f", + "1f471-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["older adult"], + u: "1f9d3", + v: [ + "1f9d3-1f3fb", + "1f9d3-1f3fc", + "1f9d3-1f3fd", + "1f9d3-1f3fe", + "1f9d3-1f3ff" + ] + }, + { + n: ["older man"], + u: "1f474", + v: [ + "1f474-1f3fb", + "1f474-1f3fc", + "1f474-1f3fd", + "1f474-1f3fe", + "1f474-1f3ff" + ] + }, + { + n: ["older woman"], + u: "1f475", + v: [ + "1f475-1f3fb", + "1f475-1f3fc", + "1f475-1f3fd", + "1f475-1f3fe", + "1f475-1f3ff" + ] + }, + { + n: ["person frowning"], + u: "1f64d", + v: [ + "1f64d-1f3fb", + "1f64d-1f3fc", + "1f64d-1f3fd", + "1f64d-1f3fe", + "1f64d-1f3ff" + ] + }, + { + n: ["man frowning", "man-frowning"], + u: "1f64d-200d-2642-fe0f", + v: [ + "1f64d-1f3fb-200d-2642-fe0f", + "1f64d-1f3fc-200d-2642-fe0f", + "1f64d-1f3fd-200d-2642-fe0f", + "1f64d-1f3fe-200d-2642-fe0f", + "1f64d-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman frowning", "woman-frowning"], + u: "1f64d-200d-2640-fe0f", + v: [ + "1f64d-1f3fb-200d-2640-fe0f", + "1f64d-1f3fc-200d-2640-fe0f", + "1f64d-1f3fd-200d-2640-fe0f", + "1f64d-1f3fe-200d-2640-fe0f", + "1f64d-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["person with pouting face"], + u: "1f64e", + v: [ + "1f64e-1f3fb", + "1f64e-1f3fc", + "1f64e-1f3fd", + "1f64e-1f3fe", + "1f64e-1f3ff" + ] + }, + { + n: ["man pouting", "man-pouting"], + u: "1f64e-200d-2642-fe0f", + v: [ + "1f64e-1f3fb-200d-2642-fe0f", + "1f64e-1f3fc-200d-2642-fe0f", + "1f64e-1f3fd-200d-2642-fe0f", + "1f64e-1f3fe-200d-2642-fe0f", + "1f64e-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman pouting", "woman-pouting"], + u: "1f64e-200d-2640-fe0f", + v: [ + "1f64e-1f3fb-200d-2640-fe0f", + "1f64e-1f3fc-200d-2640-fe0f", + "1f64e-1f3fd-200d-2640-fe0f", + "1f64e-1f3fe-200d-2640-fe0f", + "1f64e-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["no good", "face with no good gesture"], + u: "1f645", + v: [ + "1f645-1f3fb", + "1f645-1f3fc", + "1f645-1f3fd", + "1f645-1f3fe", + "1f645-1f3ff" + ] + }, + { + n: ["man gesturing no", "man-gesturing-no"], + u: "1f645-200d-2642-fe0f", + v: [ + "1f645-1f3fb-200d-2642-fe0f", + "1f645-1f3fc-200d-2642-fe0f", + "1f645-1f3fd-200d-2642-fe0f", + "1f645-1f3fe-200d-2642-fe0f", + "1f645-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman gesturing no", "woman-gesturing-no"], + u: "1f645-200d-2640-fe0f", + v: [ + "1f645-1f3fb-200d-2640-fe0f", + "1f645-1f3fc-200d-2640-fe0f", + "1f645-1f3fd-200d-2640-fe0f", + "1f645-1f3fe-200d-2640-fe0f", + "1f645-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["ok woman", "face with ok gesture"], + u: "1f646", + v: [ + "1f646-1f3fb", + "1f646-1f3fc", + "1f646-1f3fd", + "1f646-1f3fe", + "1f646-1f3ff" + ] + }, + { + n: ["man gesturing ok", "man-gesturing-ok"], + u: "1f646-200d-2642-fe0f", + v: [ + "1f646-1f3fb-200d-2642-fe0f", + "1f646-1f3fc-200d-2642-fe0f", + "1f646-1f3fd-200d-2642-fe0f", + "1f646-1f3fe-200d-2642-fe0f", + "1f646-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman gesturing ok", "woman-gesturing-ok"], + u: "1f646-200d-2640-fe0f", + v: [ + "1f646-1f3fb-200d-2640-fe0f", + "1f646-1f3fc-200d-2640-fe0f", + "1f646-1f3fd-200d-2640-fe0f", + "1f646-1f3fe-200d-2640-fe0f", + "1f646-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["information desk person"], + u: "1f481", + v: [ + "1f481-1f3fb", + "1f481-1f3fc", + "1f481-1f3fd", + "1f481-1f3fe", + "1f481-1f3ff" + ] + }, + { + n: ["man tipping hand", "man-tipping-hand"], + u: "1f481-200d-2642-fe0f", + v: [ + "1f481-1f3fb-200d-2642-fe0f", + "1f481-1f3fc-200d-2642-fe0f", + "1f481-1f3fd-200d-2642-fe0f", + "1f481-1f3fe-200d-2642-fe0f", + "1f481-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman tipping hand", "woman-tipping-hand"], + u: "1f481-200d-2640-fe0f", + v: [ + "1f481-1f3fb-200d-2640-fe0f", + "1f481-1f3fc-200d-2640-fe0f", + "1f481-1f3fd-200d-2640-fe0f", + "1f481-1f3fe-200d-2640-fe0f", + "1f481-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["raising hand", "happy person raising one hand"], + u: "1f64b", + v: [ + "1f64b-1f3fb", + "1f64b-1f3fc", + "1f64b-1f3fd", + "1f64b-1f3fe", + "1f64b-1f3ff" + ] + }, + { + n: ["man raising hand", "man-raising-hand"], + u: "1f64b-200d-2642-fe0f", + v: [ + "1f64b-1f3fb-200d-2642-fe0f", + "1f64b-1f3fc-200d-2642-fe0f", + "1f64b-1f3fd-200d-2642-fe0f", + "1f64b-1f3fe-200d-2642-fe0f", + "1f64b-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman raising hand", "woman-raising-hand"], + u: "1f64b-200d-2640-fe0f", + v: [ + "1f64b-1f3fb-200d-2640-fe0f", + "1f64b-1f3fc-200d-2640-fe0f", + "1f64b-1f3fd-200d-2640-fe0f", + "1f64b-1f3fe-200d-2640-fe0f", + "1f64b-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["deaf person"], + u: "1f9cf", + v: [ + "1f9cf-1f3fb", + "1f9cf-1f3fc", + "1f9cf-1f3fd", + "1f9cf-1f3fe", + "1f9cf-1f3ff" + ] + }, + { + n: ["deaf man"], + u: "1f9cf-200d-2642-fe0f", + v: [ + "1f9cf-1f3fb-200d-2642-fe0f", + "1f9cf-1f3fc-200d-2642-fe0f", + "1f9cf-1f3fd-200d-2642-fe0f", + "1f9cf-1f3fe-200d-2642-fe0f", + "1f9cf-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["deaf woman"], + u: "1f9cf-200d-2640-fe0f", + v: [ + "1f9cf-1f3fb-200d-2640-fe0f", + "1f9cf-1f3fc-200d-2640-fe0f", + "1f9cf-1f3fd-200d-2640-fe0f", + "1f9cf-1f3fe-200d-2640-fe0f", + "1f9cf-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["bow", "person bowing deeply"], + u: "1f647", + v: [ + "1f647-1f3fb", + "1f647-1f3fc", + "1f647-1f3fd", + "1f647-1f3fe", + "1f647-1f3ff" + ] + }, + { + n: ["man bowing", "man-bowing"], + u: "1f647-200d-2642-fe0f", + v: [ + "1f647-1f3fb-200d-2642-fe0f", + "1f647-1f3fc-200d-2642-fe0f", + "1f647-1f3fd-200d-2642-fe0f", + "1f647-1f3fe-200d-2642-fe0f", + "1f647-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman bowing", "woman-bowing"], + u: "1f647-200d-2640-fe0f", + v: [ + "1f647-1f3fb-200d-2640-fe0f", + "1f647-1f3fc-200d-2640-fe0f", + "1f647-1f3fd-200d-2640-fe0f", + "1f647-1f3fe-200d-2640-fe0f", + "1f647-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["face palm"], + u: "1f926", + v: [ + "1f926-1f3fb", + "1f926-1f3fc", + "1f926-1f3fd", + "1f926-1f3fe", + "1f926-1f3ff" + ] + }, + { + n: ["man facepalming", "man-facepalming"], + u: "1f926-200d-2642-fe0f", + v: [ + "1f926-1f3fb-200d-2642-fe0f", + "1f926-1f3fc-200d-2642-fe0f", + "1f926-1f3fd-200d-2642-fe0f", + "1f926-1f3fe-200d-2642-fe0f", + "1f926-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman facepalming", "woman-facepalming"], + u: "1f926-200d-2640-fe0f", + v: [ + "1f926-1f3fb-200d-2640-fe0f", + "1f926-1f3fc-200d-2640-fe0f", + "1f926-1f3fd-200d-2640-fe0f", + "1f926-1f3fe-200d-2640-fe0f", + "1f926-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["shrug"], + u: "1f937", + v: [ + "1f937-1f3fb", + "1f937-1f3fc", + "1f937-1f3fd", + "1f937-1f3fe", + "1f937-1f3ff" + ] + }, + { + n: ["man shrugging", "man-shrugging"], + u: "1f937-200d-2642-fe0f", + v: [ + "1f937-1f3fb-200d-2642-fe0f", + "1f937-1f3fc-200d-2642-fe0f", + "1f937-1f3fd-200d-2642-fe0f", + "1f937-1f3fe-200d-2642-fe0f", + "1f937-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman shrugging", "woman-shrugging"], + u: "1f937-200d-2640-fe0f", + v: [ + "1f937-1f3fb-200d-2640-fe0f", + "1f937-1f3fc-200d-2640-fe0f", + "1f937-1f3fd-200d-2640-fe0f", + "1f937-1f3fe-200d-2640-fe0f", + "1f937-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["health worker"], + u: "1f9d1-200d-2695-fe0f", + v: [ + "1f9d1-1f3fb-200d-2695-fe0f", + "1f9d1-1f3fc-200d-2695-fe0f", + "1f9d1-1f3fd-200d-2695-fe0f", + "1f9d1-1f3fe-200d-2695-fe0f", + "1f9d1-1f3ff-200d-2695-fe0f" + ] + }, + { + n: ["male-doctor", "man health worker"], + u: "1f468-200d-2695-fe0f", + v: [ + "1f468-1f3fb-200d-2695-fe0f", + "1f468-1f3fc-200d-2695-fe0f", + "1f468-1f3fd-200d-2695-fe0f", + "1f468-1f3fe-200d-2695-fe0f", + "1f468-1f3ff-200d-2695-fe0f" + ] + }, + { + n: ["female-doctor", "woman health worker"], + u: "1f469-200d-2695-fe0f", + v: [ + "1f469-1f3fb-200d-2695-fe0f", + "1f469-1f3fc-200d-2695-fe0f", + "1f469-1f3fd-200d-2695-fe0f", + "1f469-1f3fe-200d-2695-fe0f", + "1f469-1f3ff-200d-2695-fe0f" + ] + }, + { + n: ["student"], + u: "1f9d1-200d-1f393", + v: [ + "1f9d1-1f3fb-200d-1f393", + "1f9d1-1f3fc-200d-1f393", + "1f9d1-1f3fd-200d-1f393", + "1f9d1-1f3fe-200d-1f393", + "1f9d1-1f3ff-200d-1f393" + ] + }, + { + n: ["man student", "male-student"], + u: "1f468-200d-1f393", + v: [ + "1f468-1f3fb-200d-1f393", + "1f468-1f3fc-200d-1f393", + "1f468-1f3fd-200d-1f393", + "1f468-1f3fe-200d-1f393", + "1f468-1f3ff-200d-1f393" + ] + }, + { + n: ["woman student", "female-student"], + u: "1f469-200d-1f393", + v: [ + "1f469-1f3fb-200d-1f393", + "1f469-1f3fc-200d-1f393", + "1f469-1f3fd-200d-1f393", + "1f469-1f3fe-200d-1f393", + "1f469-1f3ff-200d-1f393" + ] + }, + { + n: ["teacher"], + u: "1f9d1-200d-1f3eb", + v: [ + "1f9d1-1f3fb-200d-1f3eb", + "1f9d1-1f3fc-200d-1f3eb", + "1f9d1-1f3fd-200d-1f3eb", + "1f9d1-1f3fe-200d-1f3eb", + "1f9d1-1f3ff-200d-1f3eb" + ] + }, + { + n: ["man teacher", "male-teacher"], + u: "1f468-200d-1f3eb", + v: [ + "1f468-1f3fb-200d-1f3eb", + "1f468-1f3fc-200d-1f3eb", + "1f468-1f3fd-200d-1f3eb", + "1f468-1f3fe-200d-1f3eb", + "1f468-1f3ff-200d-1f3eb" + ] + }, + { + n: ["woman teacher", "female-teacher"], + u: "1f469-200d-1f3eb", + v: [ + "1f469-1f3fb-200d-1f3eb", + "1f469-1f3fc-200d-1f3eb", + "1f469-1f3fd-200d-1f3eb", + "1f469-1f3fe-200d-1f3eb", + "1f469-1f3ff-200d-1f3eb" + ] + }, + { + n: ["judge"], + u: "1f9d1-200d-2696-fe0f", + v: [ + "1f9d1-1f3fb-200d-2696-fe0f", + "1f9d1-1f3fc-200d-2696-fe0f", + "1f9d1-1f3fd-200d-2696-fe0f", + "1f9d1-1f3fe-200d-2696-fe0f", + "1f9d1-1f3ff-200d-2696-fe0f" + ] + }, + { + n: ["man judge", "male-judge"], + u: "1f468-200d-2696-fe0f", + v: [ + "1f468-1f3fb-200d-2696-fe0f", + "1f468-1f3fc-200d-2696-fe0f", + "1f468-1f3fd-200d-2696-fe0f", + "1f468-1f3fe-200d-2696-fe0f", + "1f468-1f3ff-200d-2696-fe0f" + ] + }, + { + n: ["woman judge", "female-judge"], + u: "1f469-200d-2696-fe0f", + v: [ + "1f469-1f3fb-200d-2696-fe0f", + "1f469-1f3fc-200d-2696-fe0f", + "1f469-1f3fd-200d-2696-fe0f", + "1f469-1f3fe-200d-2696-fe0f", + "1f469-1f3ff-200d-2696-fe0f" + ] + }, + { + n: ["farmer"], + u: "1f9d1-200d-1f33e", + v: [ + "1f9d1-1f3fb-200d-1f33e", + "1f9d1-1f3fc-200d-1f33e", + "1f9d1-1f3fd-200d-1f33e", + "1f9d1-1f3fe-200d-1f33e", + "1f9d1-1f3ff-200d-1f33e" + ] + }, + { + n: ["man farmer", "male-farmer"], + u: "1f468-200d-1f33e", + v: [ + "1f468-1f3fb-200d-1f33e", + "1f468-1f3fc-200d-1f33e", + "1f468-1f3fd-200d-1f33e", + "1f468-1f3fe-200d-1f33e", + "1f468-1f3ff-200d-1f33e" + ] + }, + { + n: ["woman farmer", "female-farmer"], + u: "1f469-200d-1f33e", + v: [ + "1f469-1f3fb-200d-1f33e", + "1f469-1f3fc-200d-1f33e", + "1f469-1f3fd-200d-1f33e", + "1f469-1f3fe-200d-1f33e", + "1f469-1f3ff-200d-1f33e" + ] + }, + { + n: ["cook"], + u: "1f9d1-200d-1f373", + v: [ + "1f9d1-1f3fb-200d-1f373", + "1f9d1-1f3fc-200d-1f373", + "1f9d1-1f3fd-200d-1f373", + "1f9d1-1f3fe-200d-1f373", + "1f9d1-1f3ff-200d-1f373" + ] + }, + { + n: ["man cook", "male-cook"], + u: "1f468-200d-1f373", + v: [ + "1f468-1f3fb-200d-1f373", + "1f468-1f3fc-200d-1f373", + "1f468-1f3fd-200d-1f373", + "1f468-1f3fe-200d-1f373", + "1f468-1f3ff-200d-1f373" + ] + }, + { + n: ["woman cook", "female-cook"], + u: "1f469-200d-1f373", + v: [ + "1f469-1f3fb-200d-1f373", + "1f469-1f3fc-200d-1f373", + "1f469-1f3fd-200d-1f373", + "1f469-1f3fe-200d-1f373", + "1f469-1f3ff-200d-1f373" + ] + }, + { + n: ["mechanic"], + u: "1f9d1-200d-1f527", + v: [ + "1f9d1-1f3fb-200d-1f527", + "1f9d1-1f3fc-200d-1f527", + "1f9d1-1f3fd-200d-1f527", + "1f9d1-1f3fe-200d-1f527", + "1f9d1-1f3ff-200d-1f527" + ] + }, + { + n: ["man mechanic", "male-mechanic"], + u: "1f468-200d-1f527", + v: [ + "1f468-1f3fb-200d-1f527", + "1f468-1f3fc-200d-1f527", + "1f468-1f3fd-200d-1f527", + "1f468-1f3fe-200d-1f527", + "1f468-1f3ff-200d-1f527" + ] + }, + { + n: ["woman mechanic", "female-mechanic"], + u: "1f469-200d-1f527", + v: [ + "1f469-1f3fb-200d-1f527", + "1f469-1f3fc-200d-1f527", + "1f469-1f3fd-200d-1f527", + "1f469-1f3fe-200d-1f527", + "1f469-1f3ff-200d-1f527" + ] + }, + { + n: ["factory worker"], + u: "1f9d1-200d-1f3ed", + v: [ + "1f9d1-1f3fb-200d-1f3ed", + "1f9d1-1f3fc-200d-1f3ed", + "1f9d1-1f3fd-200d-1f3ed", + "1f9d1-1f3fe-200d-1f3ed", + "1f9d1-1f3ff-200d-1f3ed" + ] + }, + { + n: ["man factory worker", "male-factory-worker"], + u: "1f468-200d-1f3ed", + v: [ + "1f468-1f3fb-200d-1f3ed", + "1f468-1f3fc-200d-1f3ed", + "1f468-1f3fd-200d-1f3ed", + "1f468-1f3fe-200d-1f3ed", + "1f468-1f3ff-200d-1f3ed" + ] + }, + { + n: ["woman factory worker", "female-factory-worker"], + u: "1f469-200d-1f3ed", + v: [ + "1f469-1f3fb-200d-1f3ed", + "1f469-1f3fc-200d-1f3ed", + "1f469-1f3fd-200d-1f3ed", + "1f469-1f3fe-200d-1f3ed", + "1f469-1f3ff-200d-1f3ed" + ] + }, + { + n: ["office worker"], + u: "1f9d1-200d-1f4bc", + v: [ + "1f9d1-1f3fb-200d-1f4bc", + "1f9d1-1f3fc-200d-1f4bc", + "1f9d1-1f3fd-200d-1f4bc", + "1f9d1-1f3fe-200d-1f4bc", + "1f9d1-1f3ff-200d-1f4bc" + ] + }, + { + n: ["man office worker", "male-office-worker"], + u: "1f468-200d-1f4bc", + v: [ + "1f468-1f3fb-200d-1f4bc", + "1f468-1f3fc-200d-1f4bc", + "1f468-1f3fd-200d-1f4bc", + "1f468-1f3fe-200d-1f4bc", + "1f468-1f3ff-200d-1f4bc" + ] + }, + { + n: ["woman office worker", "female-office-worker"], + u: "1f469-200d-1f4bc", + v: [ + "1f469-1f3fb-200d-1f4bc", + "1f469-1f3fc-200d-1f4bc", + "1f469-1f3fd-200d-1f4bc", + "1f469-1f3fe-200d-1f4bc", + "1f469-1f3ff-200d-1f4bc" + ] + }, + { + n: ["scientist"], + u: "1f9d1-200d-1f52c", + v: [ + "1f9d1-1f3fb-200d-1f52c", + "1f9d1-1f3fc-200d-1f52c", + "1f9d1-1f3fd-200d-1f52c", + "1f9d1-1f3fe-200d-1f52c", + "1f9d1-1f3ff-200d-1f52c" + ] + }, + { + n: ["man scientist", "male-scientist"], + u: "1f468-200d-1f52c", + v: [ + "1f468-1f3fb-200d-1f52c", + "1f468-1f3fc-200d-1f52c", + "1f468-1f3fd-200d-1f52c", + "1f468-1f3fe-200d-1f52c", + "1f468-1f3ff-200d-1f52c" + ] + }, + { + n: ["woman scientist", "female-scientist"], + u: "1f469-200d-1f52c", + v: [ + "1f469-1f3fb-200d-1f52c", + "1f469-1f3fc-200d-1f52c", + "1f469-1f3fd-200d-1f52c", + "1f469-1f3fe-200d-1f52c", + "1f469-1f3ff-200d-1f52c" + ] + }, + { + n: ["technologist"], + u: "1f9d1-200d-1f4bb", + v: [ + "1f9d1-1f3fb-200d-1f4bb", + "1f9d1-1f3fc-200d-1f4bb", + "1f9d1-1f3fd-200d-1f4bb", + "1f9d1-1f3fe-200d-1f4bb", + "1f9d1-1f3ff-200d-1f4bb" + ] + }, + { + n: ["man technologist", "male-technologist"], + u: "1f468-200d-1f4bb", + v: [ + "1f468-1f3fb-200d-1f4bb", + "1f468-1f3fc-200d-1f4bb", + "1f468-1f3fd-200d-1f4bb", + "1f468-1f3fe-200d-1f4bb", + "1f468-1f3ff-200d-1f4bb" + ] + }, + { + n: ["woman technologist", "female-technologist"], + u: "1f469-200d-1f4bb", + v: [ + "1f469-1f3fb-200d-1f4bb", + "1f469-1f3fc-200d-1f4bb", + "1f469-1f3fd-200d-1f4bb", + "1f469-1f3fe-200d-1f4bb", + "1f469-1f3ff-200d-1f4bb" + ] + }, + { + n: ["singer"], + u: "1f9d1-200d-1f3a4", + v: [ + "1f9d1-1f3fb-200d-1f3a4", + "1f9d1-1f3fc-200d-1f3a4", + "1f9d1-1f3fd-200d-1f3a4", + "1f9d1-1f3fe-200d-1f3a4", + "1f9d1-1f3ff-200d-1f3a4" + ] + }, + { + n: ["man singer", "male-singer"], + u: "1f468-200d-1f3a4", + v: [ + "1f468-1f3fb-200d-1f3a4", + "1f468-1f3fc-200d-1f3a4", + "1f468-1f3fd-200d-1f3a4", + "1f468-1f3fe-200d-1f3a4", + "1f468-1f3ff-200d-1f3a4" + ] + }, + { + n: ["woman singer", "female-singer"], + u: "1f469-200d-1f3a4", + v: [ + "1f469-1f3fb-200d-1f3a4", + "1f469-1f3fc-200d-1f3a4", + "1f469-1f3fd-200d-1f3a4", + "1f469-1f3fe-200d-1f3a4", + "1f469-1f3ff-200d-1f3a4" + ] + }, + { + n: ["artist"], + u: "1f9d1-200d-1f3a8", + v: [ + "1f9d1-1f3fb-200d-1f3a8", + "1f9d1-1f3fc-200d-1f3a8", + "1f9d1-1f3fd-200d-1f3a8", + "1f9d1-1f3fe-200d-1f3a8", + "1f9d1-1f3ff-200d-1f3a8" + ] + }, + { + n: ["man artist", "male-artist"], + u: "1f468-200d-1f3a8", + v: [ + "1f468-1f3fb-200d-1f3a8", + "1f468-1f3fc-200d-1f3a8", + "1f468-1f3fd-200d-1f3a8", + "1f468-1f3fe-200d-1f3a8", + "1f468-1f3ff-200d-1f3a8" + ] + }, + { + n: ["woman artist", "female-artist"], + u: "1f469-200d-1f3a8", + v: [ + "1f469-1f3fb-200d-1f3a8", + "1f469-1f3fc-200d-1f3a8", + "1f469-1f3fd-200d-1f3a8", + "1f469-1f3fe-200d-1f3a8", + "1f469-1f3ff-200d-1f3a8" + ] + }, + { + n: ["pilot"], + u: "1f9d1-200d-2708-fe0f", + v: [ + "1f9d1-1f3fb-200d-2708-fe0f", + "1f9d1-1f3fc-200d-2708-fe0f", + "1f9d1-1f3fd-200d-2708-fe0f", + "1f9d1-1f3fe-200d-2708-fe0f", + "1f9d1-1f3ff-200d-2708-fe0f" + ] + }, + { + n: ["man pilot", "male-pilot"], + u: "1f468-200d-2708-fe0f", + v: [ + "1f468-1f3fb-200d-2708-fe0f", + "1f468-1f3fc-200d-2708-fe0f", + "1f468-1f3fd-200d-2708-fe0f", + "1f468-1f3fe-200d-2708-fe0f", + "1f468-1f3ff-200d-2708-fe0f" + ] + }, + { + n: ["woman pilot", "female-pilot"], + u: "1f469-200d-2708-fe0f", + v: [ + "1f469-1f3fb-200d-2708-fe0f", + "1f469-1f3fc-200d-2708-fe0f", + "1f469-1f3fd-200d-2708-fe0f", + "1f469-1f3fe-200d-2708-fe0f", + "1f469-1f3ff-200d-2708-fe0f" + ] + }, + { + n: ["astronaut"], + u: "1f9d1-200d-1f680", + v: [ + "1f9d1-1f3fb-200d-1f680", + "1f9d1-1f3fc-200d-1f680", + "1f9d1-1f3fd-200d-1f680", + "1f9d1-1f3fe-200d-1f680", + "1f9d1-1f3ff-200d-1f680" + ] + }, + { + n: ["man astronaut", "male-astronaut"], + u: "1f468-200d-1f680", + v: [ + "1f468-1f3fb-200d-1f680", + "1f468-1f3fc-200d-1f680", + "1f468-1f3fd-200d-1f680", + "1f468-1f3fe-200d-1f680", + "1f468-1f3ff-200d-1f680" + ] + }, + { + n: ["woman astronaut", "female-astronaut"], + u: "1f469-200d-1f680", + v: [ + "1f469-1f3fb-200d-1f680", + "1f469-1f3fc-200d-1f680", + "1f469-1f3fd-200d-1f680", + "1f469-1f3fe-200d-1f680", + "1f469-1f3ff-200d-1f680" + ] + }, + { + n: ["firefighter"], + u: "1f9d1-200d-1f692", + v: [ + "1f9d1-1f3fb-200d-1f692", + "1f9d1-1f3fc-200d-1f692", + "1f9d1-1f3fd-200d-1f692", + "1f9d1-1f3fe-200d-1f692", + "1f9d1-1f3ff-200d-1f692" + ] + }, + { + n: ["man firefighter", "male-firefighter"], + u: "1f468-200d-1f692", + v: [ + "1f468-1f3fb-200d-1f692", + "1f468-1f3fc-200d-1f692", + "1f468-1f3fd-200d-1f692", + "1f468-1f3fe-200d-1f692", + "1f468-1f3ff-200d-1f692" + ] + }, + { + n: ["woman firefighter", "female-firefighter"], + u: "1f469-200d-1f692", + v: [ + "1f469-1f3fb-200d-1f692", + "1f469-1f3fc-200d-1f692", + "1f469-1f3fd-200d-1f692", + "1f469-1f3fe-200d-1f692", + "1f469-1f3ff-200d-1f692" + ] + }, + { + n: ["cop", "police officer"], + u: "1f46e", + v: [ + "1f46e-1f3fb", + "1f46e-1f3fc", + "1f46e-1f3fd", + "1f46e-1f3fe", + "1f46e-1f3ff" + ] + }, + { + n: ["man police officer", "male-police-officer"], + u: "1f46e-200d-2642-fe0f", + v: [ + "1f46e-1f3fb-200d-2642-fe0f", + "1f46e-1f3fc-200d-2642-fe0f", + "1f46e-1f3fd-200d-2642-fe0f", + "1f46e-1f3fe-200d-2642-fe0f", + "1f46e-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman police officer", "female-police-officer"], + u: "1f46e-200d-2640-fe0f", + v: [ + "1f46e-1f3fb-200d-2640-fe0f", + "1f46e-1f3fc-200d-2640-fe0f", + "1f46e-1f3fd-200d-2640-fe0f", + "1f46e-1f3fe-200d-2640-fe0f", + "1f46e-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["detective", "sleuth or spy"], + u: "1f575-fe0f", + v: [ + "1f575-1f3fb", + "1f575-1f3fc", + "1f575-1f3fd", + "1f575-1f3fe", + "1f575-1f3ff" + ] + }, + { + n: ["man detective", "male-detective"], + u: "1f575-fe0f-200d-2642-fe0f", + v: [ + "1f575-1f3fb-200d-2642-fe0f", + "1f575-1f3fc-200d-2642-fe0f", + "1f575-1f3fd-200d-2642-fe0f", + "1f575-1f3fe-200d-2642-fe0f", + "1f575-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman detective", "female-detective"], + u: "1f575-fe0f-200d-2640-fe0f", + v: [ + "1f575-1f3fb-200d-2640-fe0f", + "1f575-1f3fc-200d-2640-fe0f", + "1f575-1f3fd-200d-2640-fe0f", + "1f575-1f3fe-200d-2640-fe0f", + "1f575-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["guardsman"], + u: "1f482", + v: [ + "1f482-1f3fb", + "1f482-1f3fc", + "1f482-1f3fd", + "1f482-1f3fe", + "1f482-1f3ff" + ] + }, + { + n: ["man guard", "male-guard"], + u: "1f482-200d-2642-fe0f", + v: [ + "1f482-1f3fb-200d-2642-fe0f", + "1f482-1f3fc-200d-2642-fe0f", + "1f482-1f3fd-200d-2642-fe0f", + "1f482-1f3fe-200d-2642-fe0f", + "1f482-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman guard", "female-guard"], + u: "1f482-200d-2640-fe0f", + v: [ + "1f482-1f3fb-200d-2640-fe0f", + "1f482-1f3fc-200d-2640-fe0f", + "1f482-1f3fd-200d-2640-fe0f", + "1f482-1f3fe-200d-2640-fe0f", + "1f482-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["ninja"], + u: "1f977", + v: [ + "1f977-1f3fb", + "1f977-1f3fc", + "1f977-1f3fd", + "1f977-1f3fe", + "1f977-1f3ff" + ] + }, + { + n: ["construction worker"], + u: "1f477", + v: [ + "1f477-1f3fb", + "1f477-1f3fc", + "1f477-1f3fd", + "1f477-1f3fe", + "1f477-1f3ff" + ] + }, + { + n: ["man construction worker", "male-construction-worker"], + u: "1f477-200d-2642-fe0f", + v: [ + "1f477-1f3fb-200d-2642-fe0f", + "1f477-1f3fc-200d-2642-fe0f", + "1f477-1f3fd-200d-2642-fe0f", + "1f477-1f3fe-200d-2642-fe0f", + "1f477-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman construction worker", "female-construction-worker"], + u: "1f477-200d-2640-fe0f", + v: [ + "1f477-1f3fb-200d-2640-fe0f", + "1f477-1f3fc-200d-2640-fe0f", + "1f477-1f3fd-200d-2640-fe0f", + "1f477-1f3fe-200d-2640-fe0f", + "1f477-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["person with crown"], + u: "1fac5", + v: [ + "1fac5-1f3fb", + "1fac5-1f3fc", + "1fac5-1f3fd", + "1fac5-1f3fe", + "1fac5-1f3ff" + ] + }, + { + n: ["prince"], + u: "1f934", + v: [ + "1f934-1f3fb", + "1f934-1f3fc", + "1f934-1f3fd", + "1f934-1f3fe", + "1f934-1f3ff" + ] + }, + { + n: ["princess"], + u: "1f478", + v: [ + "1f478-1f3fb", + "1f478-1f3fc", + "1f478-1f3fd", + "1f478-1f3fe", + "1f478-1f3ff" + ] + }, + { + n: ["man with turban"], + u: "1f473", + v: [ + "1f473-1f3fb", + "1f473-1f3fc", + "1f473-1f3fd", + "1f473-1f3fe", + "1f473-1f3ff" + ] + }, + { + n: ["man wearing turban", "man-wearing-turban"], + u: "1f473-200d-2642-fe0f", + v: [ + "1f473-1f3fb-200d-2642-fe0f", + "1f473-1f3fc-200d-2642-fe0f", + "1f473-1f3fd-200d-2642-fe0f", + "1f473-1f3fe-200d-2642-fe0f", + "1f473-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman wearing turban", "woman-wearing-turban"], + u: "1f473-200d-2640-fe0f", + v: [ + "1f473-1f3fb-200d-2640-fe0f", + "1f473-1f3fc-200d-2640-fe0f", + "1f473-1f3fd-200d-2640-fe0f", + "1f473-1f3fe-200d-2640-fe0f", + "1f473-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["man with gua pi mao"], + u: "1f472", + v: [ + "1f472-1f3fb", + "1f472-1f3fc", + "1f472-1f3fd", + "1f472-1f3fe", + "1f472-1f3ff" + ] + }, + { + n: ["person with headscarf"], + u: "1f9d5", + v: [ + "1f9d5-1f3fb", + "1f9d5-1f3fc", + "1f9d5-1f3fd", + "1f9d5-1f3fe", + "1f9d5-1f3ff" + ] + }, + { + n: ["man in tuxedo", "person in tuxedo"], + u: "1f935", + v: [ + "1f935-1f3fb", + "1f935-1f3fc", + "1f935-1f3fd", + "1f935-1f3fe", + "1f935-1f3ff" + ] + }, + { + n: ["man in tuxedo"], + u: "1f935-200d-2642-fe0f", + v: [ + "1f935-1f3fb-200d-2642-fe0f", + "1f935-1f3fc-200d-2642-fe0f", + "1f935-1f3fd-200d-2642-fe0f", + "1f935-1f3fe-200d-2642-fe0f", + "1f935-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman in tuxedo"], + u: "1f935-200d-2640-fe0f", + v: [ + "1f935-1f3fb-200d-2640-fe0f", + "1f935-1f3fc-200d-2640-fe0f", + "1f935-1f3fd-200d-2640-fe0f", + "1f935-1f3fe-200d-2640-fe0f", + "1f935-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["bride with veil"], + u: "1f470", + v: [ + "1f470-1f3fb", + "1f470-1f3fc", + "1f470-1f3fd", + "1f470-1f3fe", + "1f470-1f3ff" + ] + }, + { + n: ["man with veil"], + u: "1f470-200d-2642-fe0f", + v: [ + "1f470-1f3fb-200d-2642-fe0f", + "1f470-1f3fc-200d-2642-fe0f", + "1f470-1f3fd-200d-2642-fe0f", + "1f470-1f3fe-200d-2642-fe0f", + "1f470-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman with veil"], + u: "1f470-200d-2640-fe0f", + v: [ + "1f470-1f3fb-200d-2640-fe0f", + "1f470-1f3fc-200d-2640-fe0f", + "1f470-1f3fd-200d-2640-fe0f", + "1f470-1f3fe-200d-2640-fe0f", + "1f470-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["pregnant woman"], + u: "1f930", + v: [ + "1f930-1f3fb", + "1f930-1f3fc", + "1f930-1f3fd", + "1f930-1f3fe", + "1f930-1f3ff" + ] + }, + { + n: ["pregnant man"], + u: "1fac3", + v: [ + "1fac3-1f3fb", + "1fac3-1f3fc", + "1fac3-1f3fd", + "1fac3-1f3fe", + "1fac3-1f3ff" + ] + }, + { + n: ["pregnant person"], + u: "1fac4", + v: [ + "1fac4-1f3fb", + "1fac4-1f3fc", + "1fac4-1f3fd", + "1fac4-1f3fe", + "1fac4-1f3ff" + ] + }, + { + n: ["breast-feeding"], + u: "1f931", + v: [ + "1f931-1f3fb", + "1f931-1f3fc", + "1f931-1f3fd", + "1f931-1f3fe", + "1f931-1f3ff" + ] + }, + { + n: ["woman feeding baby"], + u: "1f469-200d-1f37c", + v: [ + "1f469-1f3fb-200d-1f37c", + "1f469-1f3fc-200d-1f37c", + "1f469-1f3fd-200d-1f37c", + "1f469-1f3fe-200d-1f37c", + "1f469-1f3ff-200d-1f37c" + ] + }, + { + n: ["man feeding baby"], + u: "1f468-200d-1f37c", + v: [ + "1f468-1f3fb-200d-1f37c", + "1f468-1f3fc-200d-1f37c", + "1f468-1f3fd-200d-1f37c", + "1f468-1f3fe-200d-1f37c", + "1f468-1f3ff-200d-1f37c" + ] + }, + { + n: ["person feeding baby"], + u: "1f9d1-200d-1f37c", + v: [ + "1f9d1-1f3fb-200d-1f37c", + "1f9d1-1f3fc-200d-1f37c", + "1f9d1-1f3fd-200d-1f37c", + "1f9d1-1f3fe-200d-1f37c", + "1f9d1-1f3ff-200d-1f37c" + ] + }, + { + n: ["angel", "baby angel"], + u: "1f47c", + v: [ + "1f47c-1f3fb", + "1f47c-1f3fc", + "1f47c-1f3fd", + "1f47c-1f3fe", + "1f47c-1f3ff" + ] + }, + { + n: ["santa", "father christmas"], + u: "1f385", + v: [ + "1f385-1f3fb", + "1f385-1f3fc", + "1f385-1f3fd", + "1f385-1f3fe", + "1f385-1f3ff" + ] + }, + { + n: ["mrs claus", "mother christmas"], + u: "1f936", + v: [ + "1f936-1f3fb", + "1f936-1f3fc", + "1f936-1f3fd", + "1f936-1f3fe", + "1f936-1f3ff" + ] + }, + { + n: ["mx claus"], + u: "1f9d1-200d-1f384", + v: [ + "1f9d1-1f3fb-200d-1f384", + "1f9d1-1f3fc-200d-1f384", + "1f9d1-1f3fd-200d-1f384", + "1f9d1-1f3fe-200d-1f384", + "1f9d1-1f3ff-200d-1f384" + ] + }, + { + n: ["superhero"], + u: "1f9b8", + v: [ + "1f9b8-1f3fb", + "1f9b8-1f3fc", + "1f9b8-1f3fd", + "1f9b8-1f3fe", + "1f9b8-1f3ff" + ] + }, + { + n: ["man superhero", "male superhero"], + u: "1f9b8-200d-2642-fe0f", + v: [ + "1f9b8-1f3fb-200d-2642-fe0f", + "1f9b8-1f3fc-200d-2642-fe0f", + "1f9b8-1f3fd-200d-2642-fe0f", + "1f9b8-1f3fe-200d-2642-fe0f", + "1f9b8-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman superhero", "female superhero"], + u: "1f9b8-200d-2640-fe0f", + v: [ + "1f9b8-1f3fb-200d-2640-fe0f", + "1f9b8-1f3fc-200d-2640-fe0f", + "1f9b8-1f3fd-200d-2640-fe0f", + "1f9b8-1f3fe-200d-2640-fe0f", + "1f9b8-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["supervillain"], + u: "1f9b9", + v: [ + "1f9b9-1f3fb", + "1f9b9-1f3fc", + "1f9b9-1f3fd", + "1f9b9-1f3fe", + "1f9b9-1f3ff" + ] + }, + { + n: ["man supervillain", "male supervillain"], + u: "1f9b9-200d-2642-fe0f", + v: [ + "1f9b9-1f3fb-200d-2642-fe0f", + "1f9b9-1f3fc-200d-2642-fe0f", + "1f9b9-1f3fd-200d-2642-fe0f", + "1f9b9-1f3fe-200d-2642-fe0f", + "1f9b9-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman supervillain", "female supervillain"], + u: "1f9b9-200d-2640-fe0f", + v: [ + "1f9b9-1f3fb-200d-2640-fe0f", + "1f9b9-1f3fc-200d-2640-fe0f", + "1f9b9-1f3fd-200d-2640-fe0f", + "1f9b9-1f3fe-200d-2640-fe0f", + "1f9b9-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["mage"], + u: "1f9d9", + v: [ + "1f9d9-1f3fb", + "1f9d9-1f3fc", + "1f9d9-1f3fd", + "1f9d9-1f3fe", + "1f9d9-1f3ff" + ] + }, + { + n: ["man mage", "male mage"], + u: "1f9d9-200d-2642-fe0f", + v: [ + "1f9d9-1f3fb-200d-2642-fe0f", + "1f9d9-1f3fc-200d-2642-fe0f", + "1f9d9-1f3fd-200d-2642-fe0f", + "1f9d9-1f3fe-200d-2642-fe0f", + "1f9d9-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman mage", "female mage"], + u: "1f9d9-200d-2640-fe0f", + v: [ + "1f9d9-1f3fb-200d-2640-fe0f", + "1f9d9-1f3fc-200d-2640-fe0f", + "1f9d9-1f3fd-200d-2640-fe0f", + "1f9d9-1f3fe-200d-2640-fe0f", + "1f9d9-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["fairy"], + u: "1f9da", + v: [ + "1f9da-1f3fb", + "1f9da-1f3fc", + "1f9da-1f3fd", + "1f9da-1f3fe", + "1f9da-1f3ff" + ] + }, + { + n: ["man fairy", "male fairy"], + u: "1f9da-200d-2642-fe0f", + v: [ + "1f9da-1f3fb-200d-2642-fe0f", + "1f9da-1f3fc-200d-2642-fe0f", + "1f9da-1f3fd-200d-2642-fe0f", + "1f9da-1f3fe-200d-2642-fe0f", + "1f9da-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman fairy", "female fairy"], + u: "1f9da-200d-2640-fe0f", + v: [ + "1f9da-1f3fb-200d-2640-fe0f", + "1f9da-1f3fc-200d-2640-fe0f", + "1f9da-1f3fd-200d-2640-fe0f", + "1f9da-1f3fe-200d-2640-fe0f", + "1f9da-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["vampire"], + u: "1f9db", + v: [ + "1f9db-1f3fb", + "1f9db-1f3fc", + "1f9db-1f3fd", + "1f9db-1f3fe", + "1f9db-1f3ff" + ] + }, + { + n: ["man vampire", "male vampire"], + u: "1f9db-200d-2642-fe0f", + v: [ + "1f9db-1f3fb-200d-2642-fe0f", + "1f9db-1f3fc-200d-2642-fe0f", + "1f9db-1f3fd-200d-2642-fe0f", + "1f9db-1f3fe-200d-2642-fe0f", + "1f9db-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman vampire", "female vampire"], + u: "1f9db-200d-2640-fe0f", + v: [ + "1f9db-1f3fb-200d-2640-fe0f", + "1f9db-1f3fc-200d-2640-fe0f", + "1f9db-1f3fd-200d-2640-fe0f", + "1f9db-1f3fe-200d-2640-fe0f", + "1f9db-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["merperson"], + u: "1f9dc", + v: [ + "1f9dc-1f3fb", + "1f9dc-1f3fc", + "1f9dc-1f3fd", + "1f9dc-1f3fe", + "1f9dc-1f3ff" + ] + }, + { + n: ["merman"], + u: "1f9dc-200d-2642-fe0f", + v: [ + "1f9dc-1f3fb-200d-2642-fe0f", + "1f9dc-1f3fc-200d-2642-fe0f", + "1f9dc-1f3fd-200d-2642-fe0f", + "1f9dc-1f3fe-200d-2642-fe0f", + "1f9dc-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["mermaid"], + u: "1f9dc-200d-2640-fe0f", + v: [ + "1f9dc-1f3fb-200d-2640-fe0f", + "1f9dc-1f3fc-200d-2640-fe0f", + "1f9dc-1f3fd-200d-2640-fe0f", + "1f9dc-1f3fe-200d-2640-fe0f", + "1f9dc-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["elf"], + u: "1f9dd", + v: [ + "1f9dd-1f3fb", + "1f9dd-1f3fc", + "1f9dd-1f3fd", + "1f9dd-1f3fe", + "1f9dd-1f3ff" + ] + }, + { + n: ["man elf", "male elf"], + u: "1f9dd-200d-2642-fe0f", + v: [ + "1f9dd-1f3fb-200d-2642-fe0f", + "1f9dd-1f3fc-200d-2642-fe0f", + "1f9dd-1f3fd-200d-2642-fe0f", + "1f9dd-1f3fe-200d-2642-fe0f", + "1f9dd-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman elf", "female elf"], + u: "1f9dd-200d-2640-fe0f", + v: [ + "1f9dd-1f3fb-200d-2640-fe0f", + "1f9dd-1f3fc-200d-2640-fe0f", + "1f9dd-1f3fd-200d-2640-fe0f", + "1f9dd-1f3fe-200d-2640-fe0f", + "1f9dd-1f3ff-200d-2640-fe0f" + ] + }, + { n: ["genie"], u: "1f9de" }, + { n: ["man genie", "male genie"], u: "1f9de-200d-2642-fe0f" }, + { n: ["woman genie", "female genie"], u: "1f9de-200d-2640-fe0f" }, + { n: ["zombie"], u: "1f9df" }, + { n: ["man zombie", "male zombie"], u: "1f9df-200d-2642-fe0f" }, + { n: ["woman zombie", "female zombie"], u: "1f9df-200d-2640-fe0f" }, + { n: ["troll"], u: "1f9cc" }, + { + n: ["massage", "face massage"], + u: "1f486", + v: [ + "1f486-1f3fb", + "1f486-1f3fc", + "1f486-1f3fd", + "1f486-1f3fe", + "1f486-1f3ff" + ] + }, + { + n: ["man getting massage", "man-getting-massage"], + u: "1f486-200d-2642-fe0f", + v: [ + "1f486-1f3fb-200d-2642-fe0f", + "1f486-1f3fc-200d-2642-fe0f", + "1f486-1f3fd-200d-2642-fe0f", + "1f486-1f3fe-200d-2642-fe0f", + "1f486-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman getting massage", "woman-getting-massage"], + u: "1f486-200d-2640-fe0f", + v: [ + "1f486-1f3fb-200d-2640-fe0f", + "1f486-1f3fc-200d-2640-fe0f", + "1f486-1f3fd-200d-2640-fe0f", + "1f486-1f3fe-200d-2640-fe0f", + "1f486-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["haircut"], + u: "1f487", + v: [ + "1f487-1f3fb", + "1f487-1f3fc", + "1f487-1f3fd", + "1f487-1f3fe", + "1f487-1f3ff" + ] + }, + { + n: ["man getting haircut", "man-getting-haircut"], + u: "1f487-200d-2642-fe0f", + v: [ + "1f487-1f3fb-200d-2642-fe0f", + "1f487-1f3fc-200d-2642-fe0f", + "1f487-1f3fd-200d-2642-fe0f", + "1f487-1f3fe-200d-2642-fe0f", + "1f487-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman getting haircut", "woman-getting-haircut"], + u: "1f487-200d-2640-fe0f", + v: [ + "1f487-1f3fb-200d-2640-fe0f", + "1f487-1f3fc-200d-2640-fe0f", + "1f487-1f3fd-200d-2640-fe0f", + "1f487-1f3fe-200d-2640-fe0f", + "1f487-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["walking", "pedestrian"], + u: "1f6b6", + v: [ + "1f6b6-1f3fb", + "1f6b6-1f3fc", + "1f6b6-1f3fd", + "1f6b6-1f3fe", + "1f6b6-1f3ff" + ] + }, + { + n: ["man walking", "man-walking"], + u: "1f6b6-200d-2642-fe0f", + v: [ + "1f6b6-1f3fb-200d-2642-fe0f", + "1f6b6-1f3fc-200d-2642-fe0f", + "1f6b6-1f3fd-200d-2642-fe0f", + "1f6b6-1f3fe-200d-2642-fe0f", + "1f6b6-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman walking", "woman-walking"], + u: "1f6b6-200d-2640-fe0f", + v: [ + "1f6b6-1f3fb-200d-2640-fe0f", + "1f6b6-1f3fc-200d-2640-fe0f", + "1f6b6-1f3fd-200d-2640-fe0f", + "1f6b6-1f3fe-200d-2640-fe0f", + "1f6b6-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["standing person"], + u: "1f9cd", + v: [ + "1f9cd-1f3fb", + "1f9cd-1f3fc", + "1f9cd-1f3fd", + "1f9cd-1f3fe", + "1f9cd-1f3ff" + ] + }, + { + n: ["man standing"], + u: "1f9cd-200d-2642-fe0f", + v: [ + "1f9cd-1f3fb-200d-2642-fe0f", + "1f9cd-1f3fc-200d-2642-fe0f", + "1f9cd-1f3fd-200d-2642-fe0f", + "1f9cd-1f3fe-200d-2642-fe0f", + "1f9cd-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman standing"], + u: "1f9cd-200d-2640-fe0f", + v: [ + "1f9cd-1f3fb-200d-2640-fe0f", + "1f9cd-1f3fc-200d-2640-fe0f", + "1f9cd-1f3fd-200d-2640-fe0f", + "1f9cd-1f3fe-200d-2640-fe0f", + "1f9cd-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["kneeling person"], + u: "1f9ce", + v: [ + "1f9ce-1f3fb", + "1f9ce-1f3fc", + "1f9ce-1f3fd", + "1f9ce-1f3fe", + "1f9ce-1f3ff" + ] + }, + { + n: ["man kneeling"], + u: "1f9ce-200d-2642-fe0f", + v: [ + "1f9ce-1f3fb-200d-2642-fe0f", + "1f9ce-1f3fc-200d-2642-fe0f", + "1f9ce-1f3fd-200d-2642-fe0f", + "1f9ce-1f3fe-200d-2642-fe0f", + "1f9ce-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman kneeling"], + u: "1f9ce-200d-2640-fe0f", + v: [ + "1f9ce-1f3fb-200d-2640-fe0f", + "1f9ce-1f3fc-200d-2640-fe0f", + "1f9ce-1f3fd-200d-2640-fe0f", + "1f9ce-1f3fe-200d-2640-fe0f", + "1f9ce-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["person with white cane", "person with probing cane"], + u: "1f9d1-200d-1f9af", + v: [ + "1f9d1-1f3fb-200d-1f9af", + "1f9d1-1f3fc-200d-1f9af", + "1f9d1-1f3fd-200d-1f9af", + "1f9d1-1f3fe-200d-1f9af", + "1f9d1-1f3ff-200d-1f9af" + ] + }, + { + n: ["man with white cane", "man with probing cane"], + u: "1f468-200d-1f9af", + v: [ + "1f468-1f3fb-200d-1f9af", + "1f468-1f3fc-200d-1f9af", + "1f468-1f3fd-200d-1f9af", + "1f468-1f3fe-200d-1f9af", + "1f468-1f3ff-200d-1f9af" + ] + }, + { + n: ["woman with white cane", "woman with probing cane"], + u: "1f469-200d-1f9af", + v: [ + "1f469-1f3fb-200d-1f9af", + "1f469-1f3fc-200d-1f9af", + "1f469-1f3fd-200d-1f9af", + "1f469-1f3fe-200d-1f9af", + "1f469-1f3ff-200d-1f9af" + ] + }, + { + n: ["person in motorized wheelchair"], + u: "1f9d1-200d-1f9bc", + v: [ + "1f9d1-1f3fb-200d-1f9bc", + "1f9d1-1f3fc-200d-1f9bc", + "1f9d1-1f3fd-200d-1f9bc", + "1f9d1-1f3fe-200d-1f9bc", + "1f9d1-1f3ff-200d-1f9bc" + ] + }, + { + n: ["man in motorized wheelchair"], + u: "1f468-200d-1f9bc", + v: [ + "1f468-1f3fb-200d-1f9bc", + "1f468-1f3fc-200d-1f9bc", + "1f468-1f3fd-200d-1f9bc", + "1f468-1f3fe-200d-1f9bc", + "1f468-1f3ff-200d-1f9bc" + ] + }, + { + n: ["woman in motorized wheelchair"], + u: "1f469-200d-1f9bc", + v: [ + "1f469-1f3fb-200d-1f9bc", + "1f469-1f3fc-200d-1f9bc", + "1f469-1f3fd-200d-1f9bc", + "1f469-1f3fe-200d-1f9bc", + "1f469-1f3ff-200d-1f9bc" + ] + }, + { + n: ["person in manual wheelchair"], + u: "1f9d1-200d-1f9bd", + v: [ + "1f9d1-1f3fb-200d-1f9bd", + "1f9d1-1f3fc-200d-1f9bd", + "1f9d1-1f3fd-200d-1f9bd", + "1f9d1-1f3fe-200d-1f9bd", + "1f9d1-1f3ff-200d-1f9bd" + ] + }, + { + n: ["man in manual wheelchair"], + u: "1f468-200d-1f9bd", + v: [ + "1f468-1f3fb-200d-1f9bd", + "1f468-1f3fc-200d-1f9bd", + "1f468-1f3fd-200d-1f9bd", + "1f468-1f3fe-200d-1f9bd", + "1f468-1f3ff-200d-1f9bd" + ] + }, + { + n: ["woman in manual wheelchair"], + u: "1f469-200d-1f9bd", + v: [ + "1f469-1f3fb-200d-1f9bd", + "1f469-1f3fc-200d-1f9bd", + "1f469-1f3fd-200d-1f9bd", + "1f469-1f3fe-200d-1f9bd", + "1f469-1f3ff-200d-1f9bd" + ] + }, + { + n: ["runner", "running"], + u: "1f3c3", + v: [ + "1f3c3-1f3fb", + "1f3c3-1f3fc", + "1f3c3-1f3fd", + "1f3c3-1f3fe", + "1f3c3-1f3ff" + ] + }, + { + n: ["man running", "man-running"], + u: "1f3c3-200d-2642-fe0f", + v: [ + "1f3c3-1f3fb-200d-2642-fe0f", + "1f3c3-1f3fc-200d-2642-fe0f", + "1f3c3-1f3fd-200d-2642-fe0f", + "1f3c3-1f3fe-200d-2642-fe0f", + "1f3c3-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman running", "woman-running"], + u: "1f3c3-200d-2640-fe0f", + v: [ + "1f3c3-1f3fb-200d-2640-fe0f", + "1f3c3-1f3fc-200d-2640-fe0f", + "1f3c3-1f3fd-200d-2640-fe0f", + "1f3c3-1f3fe-200d-2640-fe0f", + "1f3c3-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["dancer"], + u: "1f483", + v: [ + "1f483-1f3fb", + "1f483-1f3fc", + "1f483-1f3fd", + "1f483-1f3fe", + "1f483-1f3ff" + ] + }, + { + n: ["man dancing"], + u: "1f57a", + v: [ + "1f57a-1f3fb", + "1f57a-1f3fc", + "1f57a-1f3fd", + "1f57a-1f3fe", + "1f57a-1f3ff" + ] + }, + { + n: ["person in suit levitating", "man in business suit levitating"], + u: "1f574-fe0f", + v: [ + "1f574-1f3fb", + "1f574-1f3fc", + "1f574-1f3fd", + "1f574-1f3fe", + "1f574-1f3ff" + ] + }, + { n: ["dancers", "woman with bunny ears"], u: "1f46f" }, + { + n: [ + "men with bunny ears", + "men-with-bunny-ears-partying", + "man-with-bunny-ears-partying" + ], + u: "1f46f-200d-2642-fe0f" + }, + { + n: [ + "women with bunny ears", + "women-with-bunny-ears-partying", + "woman-with-bunny-ears-partying" + ], + u: "1f46f-200d-2640-fe0f" + }, + { + n: ["person in steamy room"], + u: "1f9d6", + v: [ + "1f9d6-1f3fb", + "1f9d6-1f3fc", + "1f9d6-1f3fd", + "1f9d6-1f3fe", + "1f9d6-1f3ff" + ] + }, + { + n: ["man in steamy room"], + u: "1f9d6-200d-2642-fe0f", + v: [ + "1f9d6-1f3fb-200d-2642-fe0f", + "1f9d6-1f3fc-200d-2642-fe0f", + "1f9d6-1f3fd-200d-2642-fe0f", + "1f9d6-1f3fe-200d-2642-fe0f", + "1f9d6-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman in steamy room"], + u: "1f9d6-200d-2640-fe0f", + v: [ + "1f9d6-1f3fb-200d-2640-fe0f", + "1f9d6-1f3fc-200d-2640-fe0f", + "1f9d6-1f3fd-200d-2640-fe0f", + "1f9d6-1f3fe-200d-2640-fe0f", + "1f9d6-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["person climbing"], + u: "1f9d7", + v: [ + "1f9d7-1f3fb", + "1f9d7-1f3fc", + "1f9d7-1f3fd", + "1f9d7-1f3fe", + "1f9d7-1f3ff" + ] + }, + { + n: ["man climbing"], + u: "1f9d7-200d-2642-fe0f", + v: [ + "1f9d7-1f3fb-200d-2642-fe0f", + "1f9d7-1f3fc-200d-2642-fe0f", + "1f9d7-1f3fd-200d-2642-fe0f", + "1f9d7-1f3fe-200d-2642-fe0f", + "1f9d7-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman climbing"], + u: "1f9d7-200d-2640-fe0f", + v: [ + "1f9d7-1f3fb-200d-2640-fe0f", + "1f9d7-1f3fc-200d-2640-fe0f", + "1f9d7-1f3fd-200d-2640-fe0f", + "1f9d7-1f3fe-200d-2640-fe0f", + "1f9d7-1f3ff-200d-2640-fe0f" + ] + }, + { n: ["fencer"], u: "1f93a" }, + { + n: ["horse racing"], + u: "1f3c7", + v: [ + "1f3c7-1f3fb", + "1f3c7-1f3fc", + "1f3c7-1f3fd", + "1f3c7-1f3fe", + "1f3c7-1f3ff" + ] + }, + { n: ["skier"], u: "26f7-fe0f" }, + { + n: ["snowboarder"], + u: "1f3c2", + v: [ + "1f3c2-1f3fb", + "1f3c2-1f3fc", + "1f3c2-1f3fd", + "1f3c2-1f3fe", + "1f3c2-1f3ff" + ] + }, + { + n: ["golfer", "person golfing"], + u: "1f3cc-fe0f", + v: [ + "1f3cc-1f3fb", + "1f3cc-1f3fc", + "1f3cc-1f3fd", + "1f3cc-1f3fe", + "1f3cc-1f3ff" + ] + }, + { + n: ["man golfing", "man-golfing"], + u: "1f3cc-fe0f-200d-2642-fe0f", + v: [ + "1f3cc-1f3fb-200d-2642-fe0f", + "1f3cc-1f3fc-200d-2642-fe0f", + "1f3cc-1f3fd-200d-2642-fe0f", + "1f3cc-1f3fe-200d-2642-fe0f", + "1f3cc-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman golfing", "woman-golfing"], + u: "1f3cc-fe0f-200d-2640-fe0f", + v: [ + "1f3cc-1f3fb-200d-2640-fe0f", + "1f3cc-1f3fc-200d-2640-fe0f", + "1f3cc-1f3fd-200d-2640-fe0f", + "1f3cc-1f3fe-200d-2640-fe0f", + "1f3cc-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["surfer"], + u: "1f3c4", + v: [ + "1f3c4-1f3fb", + "1f3c4-1f3fc", + "1f3c4-1f3fd", + "1f3c4-1f3fe", + "1f3c4-1f3ff" + ] + }, + { + n: ["man surfing", "man-surfing"], + u: "1f3c4-200d-2642-fe0f", + v: [ + "1f3c4-1f3fb-200d-2642-fe0f", + "1f3c4-1f3fc-200d-2642-fe0f", + "1f3c4-1f3fd-200d-2642-fe0f", + "1f3c4-1f3fe-200d-2642-fe0f", + "1f3c4-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman surfing", "woman-surfing"], + u: "1f3c4-200d-2640-fe0f", + v: [ + "1f3c4-1f3fb-200d-2640-fe0f", + "1f3c4-1f3fc-200d-2640-fe0f", + "1f3c4-1f3fd-200d-2640-fe0f", + "1f3c4-1f3fe-200d-2640-fe0f", + "1f3c4-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["rowboat"], + u: "1f6a3", + v: [ + "1f6a3-1f3fb", + "1f6a3-1f3fc", + "1f6a3-1f3fd", + "1f6a3-1f3fe", + "1f6a3-1f3ff" + ] + }, + { + n: ["man rowing boat", "man-rowing-boat"], + u: "1f6a3-200d-2642-fe0f", + v: [ + "1f6a3-1f3fb-200d-2642-fe0f", + "1f6a3-1f3fc-200d-2642-fe0f", + "1f6a3-1f3fd-200d-2642-fe0f", + "1f6a3-1f3fe-200d-2642-fe0f", + "1f6a3-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman rowing boat", "woman-rowing-boat"], + u: "1f6a3-200d-2640-fe0f", + v: [ + "1f6a3-1f3fb-200d-2640-fe0f", + "1f6a3-1f3fc-200d-2640-fe0f", + "1f6a3-1f3fd-200d-2640-fe0f", + "1f6a3-1f3fe-200d-2640-fe0f", + "1f6a3-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["swimmer"], + u: "1f3ca", + v: [ + "1f3ca-1f3fb", + "1f3ca-1f3fc", + "1f3ca-1f3fd", + "1f3ca-1f3fe", + "1f3ca-1f3ff" + ] + }, + { + n: ["man swimming", "man-swimming"], + u: "1f3ca-200d-2642-fe0f", + v: [ + "1f3ca-1f3fb-200d-2642-fe0f", + "1f3ca-1f3fc-200d-2642-fe0f", + "1f3ca-1f3fd-200d-2642-fe0f", + "1f3ca-1f3fe-200d-2642-fe0f", + "1f3ca-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman swimming", "woman-swimming"], + u: "1f3ca-200d-2640-fe0f", + v: [ + "1f3ca-1f3fb-200d-2640-fe0f", + "1f3ca-1f3fc-200d-2640-fe0f", + "1f3ca-1f3fd-200d-2640-fe0f", + "1f3ca-1f3fe-200d-2640-fe0f", + "1f3ca-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["person with ball", "person bouncing ball"], + u: "26f9-fe0f", + v: ["26f9-1f3fb", "26f9-1f3fc", "26f9-1f3fd", "26f9-1f3fe", "26f9-1f3ff"] + }, + { + n: ["man bouncing ball", "man-bouncing-ball"], + u: "26f9-fe0f-200d-2642-fe0f", + v: [ + "26f9-1f3fb-200d-2642-fe0f", + "26f9-1f3fc-200d-2642-fe0f", + "26f9-1f3fd-200d-2642-fe0f", + "26f9-1f3fe-200d-2642-fe0f", + "26f9-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman bouncing ball", "woman-bouncing-ball"], + u: "26f9-fe0f-200d-2640-fe0f", + v: [ + "26f9-1f3fb-200d-2640-fe0f", + "26f9-1f3fc-200d-2640-fe0f", + "26f9-1f3fd-200d-2640-fe0f", + "26f9-1f3fe-200d-2640-fe0f", + "26f9-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["weight lifter", "person lifting weights"], + u: "1f3cb-fe0f", + v: [ + "1f3cb-1f3fb", + "1f3cb-1f3fc", + "1f3cb-1f3fd", + "1f3cb-1f3fe", + "1f3cb-1f3ff" + ] + }, + { + n: ["man lifting weights", "man-lifting-weights"], + u: "1f3cb-fe0f-200d-2642-fe0f", + v: [ + "1f3cb-1f3fb-200d-2642-fe0f", + "1f3cb-1f3fc-200d-2642-fe0f", + "1f3cb-1f3fd-200d-2642-fe0f", + "1f3cb-1f3fe-200d-2642-fe0f", + "1f3cb-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman lifting weights", "woman-lifting-weights"], + u: "1f3cb-fe0f-200d-2640-fe0f", + v: [ + "1f3cb-1f3fb-200d-2640-fe0f", + "1f3cb-1f3fc-200d-2640-fe0f", + "1f3cb-1f3fd-200d-2640-fe0f", + "1f3cb-1f3fe-200d-2640-fe0f", + "1f3cb-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["bicyclist"], + u: "1f6b4", + v: [ + "1f6b4-1f3fb", + "1f6b4-1f3fc", + "1f6b4-1f3fd", + "1f6b4-1f3fe", + "1f6b4-1f3ff" + ] + }, + { + n: ["man biking", "man-biking"], + u: "1f6b4-200d-2642-fe0f", + v: [ + "1f6b4-1f3fb-200d-2642-fe0f", + "1f6b4-1f3fc-200d-2642-fe0f", + "1f6b4-1f3fd-200d-2642-fe0f", + "1f6b4-1f3fe-200d-2642-fe0f", + "1f6b4-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman biking", "woman-biking"], + u: "1f6b4-200d-2640-fe0f", + v: [ + "1f6b4-1f3fb-200d-2640-fe0f", + "1f6b4-1f3fc-200d-2640-fe0f", + "1f6b4-1f3fd-200d-2640-fe0f", + "1f6b4-1f3fe-200d-2640-fe0f", + "1f6b4-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["mountain bicyclist"], + u: "1f6b5", + v: [ + "1f6b5-1f3fb", + "1f6b5-1f3fc", + "1f6b5-1f3fd", + "1f6b5-1f3fe", + "1f6b5-1f3ff" + ] + }, + { + n: ["man mountain biking", "man-mountain-biking"], + u: "1f6b5-200d-2642-fe0f", + v: [ + "1f6b5-1f3fb-200d-2642-fe0f", + "1f6b5-1f3fc-200d-2642-fe0f", + "1f6b5-1f3fd-200d-2642-fe0f", + "1f6b5-1f3fe-200d-2642-fe0f", + "1f6b5-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman mountain biking", "woman-mountain-biking"], + u: "1f6b5-200d-2640-fe0f", + v: [ + "1f6b5-1f3fb-200d-2640-fe0f", + "1f6b5-1f3fc-200d-2640-fe0f", + "1f6b5-1f3fd-200d-2640-fe0f", + "1f6b5-1f3fe-200d-2640-fe0f", + "1f6b5-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["person doing cartwheel"], + u: "1f938", + v: [ + "1f938-1f3fb", + "1f938-1f3fc", + "1f938-1f3fd", + "1f938-1f3fe", + "1f938-1f3ff" + ] + }, + { + n: ["man cartwheeling", "man-cartwheeling"], + u: "1f938-200d-2642-fe0f", + v: [ + "1f938-1f3fb-200d-2642-fe0f", + "1f938-1f3fc-200d-2642-fe0f", + "1f938-1f3fd-200d-2642-fe0f", + "1f938-1f3fe-200d-2642-fe0f", + "1f938-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman cartwheeling", "woman-cartwheeling"], + u: "1f938-200d-2640-fe0f", + v: [ + "1f938-1f3fb-200d-2640-fe0f", + "1f938-1f3fc-200d-2640-fe0f", + "1f938-1f3fd-200d-2640-fe0f", + "1f938-1f3fe-200d-2640-fe0f", + "1f938-1f3ff-200d-2640-fe0f" + ] + }, + { n: ["wrestlers"], u: "1f93c" }, + { n: ["men wrestling", "man-wrestling"], u: "1f93c-200d-2642-fe0f" }, + { n: ["women wrestling", "woman-wrestling"], u: "1f93c-200d-2640-fe0f" }, + { + n: ["water polo"], + u: "1f93d", + v: [ + "1f93d-1f3fb", + "1f93d-1f3fc", + "1f93d-1f3fd", + "1f93d-1f3fe", + "1f93d-1f3ff" + ] + }, + { + n: ["man playing water polo", "man-playing-water-polo"], + u: "1f93d-200d-2642-fe0f", + v: [ + "1f93d-1f3fb-200d-2642-fe0f", + "1f93d-1f3fc-200d-2642-fe0f", + "1f93d-1f3fd-200d-2642-fe0f", + "1f93d-1f3fe-200d-2642-fe0f", + "1f93d-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman playing water polo", "woman-playing-water-polo"], + u: "1f93d-200d-2640-fe0f", + v: [ + "1f93d-1f3fb-200d-2640-fe0f", + "1f93d-1f3fc-200d-2640-fe0f", + "1f93d-1f3fd-200d-2640-fe0f", + "1f93d-1f3fe-200d-2640-fe0f", + "1f93d-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["handball"], + u: "1f93e", + v: [ + "1f93e-1f3fb", + "1f93e-1f3fc", + "1f93e-1f3fd", + "1f93e-1f3fe", + "1f93e-1f3ff" + ] + }, + { + n: ["man playing handball", "man-playing-handball"], + u: "1f93e-200d-2642-fe0f", + v: [ + "1f93e-1f3fb-200d-2642-fe0f", + "1f93e-1f3fc-200d-2642-fe0f", + "1f93e-1f3fd-200d-2642-fe0f", + "1f93e-1f3fe-200d-2642-fe0f", + "1f93e-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman playing handball", "woman-playing-handball"], + u: "1f93e-200d-2640-fe0f", + v: [ + "1f93e-1f3fb-200d-2640-fe0f", + "1f93e-1f3fc-200d-2640-fe0f", + "1f93e-1f3fd-200d-2640-fe0f", + "1f93e-1f3fe-200d-2640-fe0f", + "1f93e-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["juggling"], + u: "1f939", + v: [ + "1f939-1f3fb", + "1f939-1f3fc", + "1f939-1f3fd", + "1f939-1f3fe", + "1f939-1f3ff" + ] + }, + { + n: ["man juggling", "man-juggling"], + u: "1f939-200d-2642-fe0f", + v: [ + "1f939-1f3fb-200d-2642-fe0f", + "1f939-1f3fc-200d-2642-fe0f", + "1f939-1f3fd-200d-2642-fe0f", + "1f939-1f3fe-200d-2642-fe0f", + "1f939-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman juggling", "woman-juggling"], + u: "1f939-200d-2640-fe0f", + v: [ + "1f939-1f3fb-200d-2640-fe0f", + "1f939-1f3fc-200d-2640-fe0f", + "1f939-1f3fd-200d-2640-fe0f", + "1f939-1f3fe-200d-2640-fe0f", + "1f939-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["person in lotus position"], + u: "1f9d8", + v: [ + "1f9d8-1f3fb", + "1f9d8-1f3fc", + "1f9d8-1f3fd", + "1f9d8-1f3fe", + "1f9d8-1f3ff" + ] + }, + { + n: ["man in lotus position"], + u: "1f9d8-200d-2642-fe0f", + v: [ + "1f9d8-1f3fb-200d-2642-fe0f", + "1f9d8-1f3fc-200d-2642-fe0f", + "1f9d8-1f3fd-200d-2642-fe0f", + "1f9d8-1f3fe-200d-2642-fe0f", + "1f9d8-1f3ff-200d-2642-fe0f" + ] + }, + { + n: ["woman in lotus position"], + u: "1f9d8-200d-2640-fe0f", + v: [ + "1f9d8-1f3fb-200d-2640-fe0f", + "1f9d8-1f3fc-200d-2640-fe0f", + "1f9d8-1f3fd-200d-2640-fe0f", + "1f9d8-1f3fe-200d-2640-fe0f", + "1f9d8-1f3ff-200d-2640-fe0f" + ] + }, + { + n: ["bath"], + u: "1f6c0", + v: [ + "1f6c0-1f3fb", + "1f6c0-1f3fc", + "1f6c0-1f3fd", + "1f6c0-1f3fe", + "1f6c0-1f3ff" + ] + }, + { + n: ["sleeping accommodation"], + u: "1f6cc", + v: [ + "1f6cc-1f3fb", + "1f6cc-1f3fc", + "1f6cc-1f3fd", + "1f6cc-1f3fe", + "1f6cc-1f3ff" + ] + }, + { + n: ["people holding hands"], + u: "1f9d1-200d-1f91d-200d-1f9d1", + v: [ + "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb", + "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc", + "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd", + "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe", + "1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff", + "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb", + "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc", + "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd", + "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe", + "1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff", + "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb", + "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc", + "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd", + "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe", + "1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff", + "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb", + "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc", + "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd", + "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe", + "1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff", + "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb", + "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc", + "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd", + "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe", + "1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff" + ] + }, + { + n: ["women holding hands", "two women holding hands"], + u: "1f46d", + v: [ + "1f46d-1f3fb", + "1f46d-1f3fc", + "1f46d-1f3fd", + "1f46d-1f3fe", + "1f46d-1f3ff", + "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc", + "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd", + "1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe", + "1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff", + "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb", + "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd", + "1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe", + "1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff", + "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb", + "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc", + "1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe", + "1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff", + "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb", + "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc", + "1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd", + "1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff", + "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb", + "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc", + "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd", + "1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe" + ] + }, + { + n: [ + "couple", + "man and woman holding hands", + "woman and man holding hands" + ], + u: "1f46b", + v: [ + "1f46b-1f3fb", + "1f46b-1f3fc", + "1f46b-1f3fd", + "1f46b-1f3fe", + "1f46b-1f3ff", + "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc", + "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd", + "1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe", + "1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff", + "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb", + "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd", + "1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe", + "1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff", + "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb", + "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc", + "1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe", + "1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff", + "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb", + "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc", + "1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd", + "1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff", + "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb", + "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc", + "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd", + "1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe" + ] + }, + { + n: ["men holding hands", "two men holding hands"], + u: "1f46c", + v: [ + "1f46c-1f3fb", + "1f46c-1f3fc", + "1f46c-1f3fd", + "1f46c-1f3fe", + "1f46c-1f3ff", + "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc", + "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd", + "1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe", + "1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff", + "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb", + "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd", + "1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe", + "1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff", + "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb", + "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc", + "1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe", + "1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff", + "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb", + "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc", + "1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd", + "1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff", + "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb", + "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc", + "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd", + "1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe" + ] + }, + { + n: ["kiss", "couplekiss"], + u: "1f48f", + v: [ + "1f48f-1f3fb", + "1f48f-1f3fc", + "1f48f-1f3fd", + "1f48f-1f3fe", + "1f48f-1f3ff", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3ff", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fb", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fc", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fd", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f9d1-1f3fe" + ] + }, + { + n: ["woman-kiss-man", "kiss: woman, man"], + u: "1f469-200d-2764-fe0f-200d-1f48b-200d-1f468", + v: [ + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + ] + }, + { + n: ["man-kiss-man", "kiss: man, man"], + u: "1f468-200d-2764-fe0f-200d-1f48b-200d-1f468", + v: [ + "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f468-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f468-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f468-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f468-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff", + "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fb", + "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fc", + "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fd", + "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3fe", + "1f468-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f468-1f3ff" + ] + }, + { + n: ["woman-kiss-woman", "kiss: woman, woman"], + u: "1f469-200d-2764-fe0f-200d-1f48b-200d-1f469", + v: [ + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", + "1f469-1f3fb-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", + "1f469-1f3fc-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", + "1f469-1f3fd-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", + "1f469-1f3fe-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fb", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fc", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fd", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3fe", + "1f469-1f3ff-200d-2764-fe0f-200d-1f48b-200d-1f469-1f3ff" + ] + }, + { + n: ["couple with heart"], + u: "1f491", + v: [ + "1f491-1f3fb", + "1f491-1f3fc", + "1f491-1f3fd", + "1f491-1f3fe", + "1f491-1f3ff", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fc", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fd", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3fe", + "1f9d1-1f3fb-200d-2764-fe0f-200d-1f9d1-1f3ff", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fb", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fd", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3fe", + "1f9d1-1f3fc-200d-2764-fe0f-200d-1f9d1-1f3ff", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fb", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fc", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3fe", + "1f9d1-1f3fd-200d-2764-fe0f-200d-1f9d1-1f3ff", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fb", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fc", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3fd", + "1f9d1-1f3fe-200d-2764-fe0f-200d-1f9d1-1f3ff", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fb", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fc", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fd", + "1f9d1-1f3ff-200d-2764-fe0f-200d-1f9d1-1f3fe" + ] + }, + { + n: ["woman-heart-man", "couple with heart: woman, man"], + u: "1f469-200d-2764-fe0f-200d-1f468", + v: [ + "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb", + "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc", + "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd", + "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe", + "1f469-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff", + "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb", + "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc", + "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd", + "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe", + "1f469-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff", + "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb", + "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc", + "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd", + "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe", + "1f469-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff", + "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb", + "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc", + "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd", + "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe", + "1f469-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff", + "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb", + "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc", + "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd", + "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe", + "1f469-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff" + ] + }, + { + n: ["man-heart-man", "couple with heart: man, man"], + u: "1f468-200d-2764-fe0f-200d-1f468", + v: [ + "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fb", + "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fc", + "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fd", + "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3fe", + "1f468-1f3fb-200d-2764-fe0f-200d-1f468-1f3ff", + "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fb", + "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fc", + "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fd", + "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3fe", + "1f468-1f3fc-200d-2764-fe0f-200d-1f468-1f3ff", + "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fb", + "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fc", + "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fd", + "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3fe", + "1f468-1f3fd-200d-2764-fe0f-200d-1f468-1f3ff", + "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fb", + "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fc", + "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fd", + "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3fe", + "1f468-1f3fe-200d-2764-fe0f-200d-1f468-1f3ff", + "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fb", + "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fc", + "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fd", + "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3fe", + "1f468-1f3ff-200d-2764-fe0f-200d-1f468-1f3ff" + ] + }, + { + n: ["woman-heart-woman", "couple with heart: woman, woman"], + u: "1f469-200d-2764-fe0f-200d-1f469", + v: [ + "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fb", + "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fc", + "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fd", + "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3fe", + "1f469-1f3fb-200d-2764-fe0f-200d-1f469-1f3ff", + "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fb", + "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fc", + "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fd", + "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3fe", + "1f469-1f3fc-200d-2764-fe0f-200d-1f469-1f3ff", + "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fb", + "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fc", + "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fd", + "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3fe", + "1f469-1f3fd-200d-2764-fe0f-200d-1f469-1f3ff", + "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fb", + "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fc", + "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fd", + "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3fe", + "1f469-1f3fe-200d-2764-fe0f-200d-1f469-1f3ff", + "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fb", + "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fc", + "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fd", + "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3fe", + "1f469-1f3ff-200d-2764-fe0f-200d-1f469-1f3ff" + ] + }, + { n: ["family"], u: "1f46a" }, + { + n: ["man-woman-boy", "family: man, woman, boy"], + u: "1f468-200d-1f469-200d-1f466" + }, + { + n: ["man-woman-girl", "family: man, woman, girl"], + u: "1f468-200d-1f469-200d-1f467" + }, + { + n: ["man-woman-girl-boy", "family: man, woman, girl, boy"], + u: "1f468-200d-1f469-200d-1f467-200d-1f466" + }, + { + n: ["man-woman-boy-boy", "family: man, woman, boy, boy"], + u: "1f468-200d-1f469-200d-1f466-200d-1f466" + }, + { + n: ["man-woman-girl-girl", "family: man, woman, girl, girl"], + u: "1f468-200d-1f469-200d-1f467-200d-1f467" + }, + { + n: ["man-man-boy", "family: man, man, boy"], + u: "1f468-200d-1f468-200d-1f466" + }, + { + n: ["man-man-girl", "family: man, man, girl"], + u: "1f468-200d-1f468-200d-1f467" + }, + { + n: ["man-man-girl-boy", "family: man, man, girl, boy"], + u: "1f468-200d-1f468-200d-1f467-200d-1f466" + }, + { + n: ["man-man-boy-boy", "family: man, man, boy, boy"], + u: "1f468-200d-1f468-200d-1f466-200d-1f466" + }, + { + n: ["man-man-girl-girl", "family: man, man, girl, girl"], + u: "1f468-200d-1f468-200d-1f467-200d-1f467" + }, + { + n: ["woman-woman-boy", "family: woman, woman, boy"], + u: "1f469-200d-1f469-200d-1f466" + }, + { + n: ["woman-woman-girl", "family: woman, woman, girl"], + u: "1f469-200d-1f469-200d-1f467" + }, + { + n: ["woman-woman-girl-boy", "family: woman, woman, girl, boy"], + u: "1f469-200d-1f469-200d-1f467-200d-1f466" + }, + { + n: ["woman-woman-boy-boy", "family: woman, woman, boy, boy"], + u: "1f469-200d-1f469-200d-1f466-200d-1f466" + }, + { + n: ["woman-woman-girl-girl", "family: woman, woman, girl, girl"], + u: "1f469-200d-1f469-200d-1f467-200d-1f467" + }, + { n: ["man-boy", "family: man, boy"], u: "1f468-200d-1f466" }, + { + n: ["man-boy-boy", "family: man, boy, boy"], + u: "1f468-200d-1f466-200d-1f466" + }, + { n: ["man-girl", "family: man, girl"], u: "1f468-200d-1f467" }, + { + n: ["man-girl-boy", "family: man, girl, boy"], + u: "1f468-200d-1f467-200d-1f466" + }, + { + n: ["man-girl-girl", "family: man, girl, girl"], + u: "1f468-200d-1f467-200d-1f467" + }, + { n: ["woman-boy", "family: woman, boy"], u: "1f469-200d-1f466" }, + { + n: ["woman-boy-boy", "family: woman, boy, boy"], + u: "1f469-200d-1f466-200d-1f466" + }, + { n: ["woman-girl", "family: woman, girl"], u: "1f469-200d-1f467" }, + { + n: ["woman-girl-boy", "family: woman, girl, boy"], + u: "1f469-200d-1f467-200d-1f466" + }, + { + n: ["woman-girl-girl", "family: woman, girl, girl"], + u: "1f469-200d-1f467-200d-1f467" + }, + { n: ["speaking head", "speaking head in silhouette"], u: "1f5e3-fe0f" }, + { n: ["bust in silhouette"], u: "1f464" }, + { n: ["busts in silhouette"], u: "1f465" }, + { n: ["people hugging"], u: "1fac2" }, + { n: ["footprints"], u: "1f463" } + ], + animals_nature: [ + { n: ["monkey face"], u: "1f435" }, + { n: ["monkey"], u: "1f412" }, + { n: ["gorilla"], u: "1f98d" }, + { n: ["orangutan"], u: "1f9a7" }, + { n: ["dog", "dog face"], u: "1f436" }, + { n: ["dog", "dog2"], u: "1f415" }, + { n: ["guide dog"], u: "1f9ae" }, + { n: ["service dog"], u: "1f415-200d-1f9ba" }, + { n: ["poodle"], u: "1f429" }, + { n: ["wolf", "wolf face"], u: "1f43a" }, + { n: ["fox face"], u: "1f98a" }, + { n: ["raccoon"], u: "1f99d" }, + { n: ["cat", "cat face"], u: "1f431" }, + { n: ["cat", "cat2"], u: "1f408" }, + { n: ["black cat"], u: "1f408-200d-2b1b" }, + { n: ["lion face"], u: "1f981" }, + { n: ["tiger", "tiger face"], u: "1f42f" }, + { n: ["tiger", "tiger2"], u: "1f405" }, + { n: ["leopard"], u: "1f406" }, + { n: ["horse", "horse face"], u: "1f434" }, + { n: ["horse", "racehorse"], u: "1f40e" }, + { n: ["unicorn face"], u: "1f984" }, + { n: ["zebra face"], u: "1f993" }, + { n: ["deer"], u: "1f98c" }, + { n: ["bison"], u: "1f9ac" }, + { n: ["cow", "cow face"], u: "1f42e" }, + { n: ["ox"], u: "1f402" }, + { n: ["water buffalo"], u: "1f403" }, + { n: ["cow", "cow2"], u: "1f404" }, + { n: ["pig", "pig face"], u: "1f437" }, + { n: ["pig", "pig2"], u: "1f416" }, + { n: ["boar"], u: "1f417" }, + { n: ["pig nose"], u: "1f43d" }, + { n: ["ram"], u: "1f40f" }, + { n: ["sheep"], u: "1f411" }, + { n: ["goat"], u: "1f410" }, + { n: ["dromedary camel"], u: "1f42a" }, + { n: ["camel", "bactrian camel"], u: "1f42b" }, + { n: ["llama"], u: "1f999" }, + { n: ["giraffe face"], u: "1f992" }, + { n: ["elephant"], u: "1f418" }, + { n: ["mammoth"], u: "1f9a3" }, + { n: ["rhinoceros"], u: "1f98f" }, + { n: ["hippopotamus"], u: "1f99b" }, + { n: ["mouse", "mouse face"], u: "1f42d" }, + { n: ["mouse", "mouse2"], u: "1f401" }, + { n: ["rat"], u: "1f400" }, + { n: ["hamster", "hamster face"], u: "1f439" }, + { n: ["rabbit", "rabbit face"], u: "1f430" }, + { n: ["rabbit", "rabbit2"], u: "1f407" }, + { n: ["chipmunk"], u: "1f43f-fe0f" }, + { n: ["beaver"], u: "1f9ab" }, + { n: ["hedgehog"], u: "1f994" }, + { n: ["bat"], u: "1f987" }, + { n: ["bear", "bear face"], u: "1f43b" }, + { n: ["polar bear"], u: "1f43b-200d-2744-fe0f" }, + { n: ["koala"], u: "1f428" }, + { n: ["panda face"], u: "1f43c" }, + { n: ["sloth"], u: "1f9a5" }, + { n: ["otter"], u: "1f9a6" }, + { n: ["skunk"], u: "1f9a8" }, + { n: ["kangaroo"], u: "1f998" }, + { n: ["badger"], u: "1f9a1" }, + { n: ["feet", "paw prints"], u: "1f43e" }, + { n: ["turkey"], u: "1f983" }, + { n: ["chicken"], u: "1f414" }, + { n: ["rooster"], u: "1f413" }, + { n: ["hatching chick"], u: "1f423" }, + { n: ["baby chick"], u: "1f424" }, + { n: ["hatched chick", "front-facing baby chick"], u: "1f425" }, + { n: ["bird"], u: "1f426" }, + { n: ["penguin"], u: "1f427" }, + { n: ["dove", "dove of peace"], u: "1f54a-fe0f" }, + { n: ["eagle"], u: "1f985" }, + { n: ["duck"], u: "1f986" }, + { n: ["swan"], u: "1f9a2" }, + { n: ["owl"], u: "1f989" }, + { n: ["dodo"], u: "1f9a4" }, + { n: ["feather"], u: "1fab6" }, + { n: ["flamingo"], u: "1f9a9" }, + { n: ["peacock"], u: "1f99a" }, + { n: ["parrot"], u: "1f99c" }, + { n: ["frog", "frog face"], u: "1f438" }, + { n: ["crocodile"], u: "1f40a" }, + { n: ["turtle"], u: "1f422" }, + { n: ["lizard"], u: "1f98e" }, + { n: ["snake"], u: "1f40d" }, + { n: ["dragon face"], u: "1f432" }, + { n: ["dragon"], u: "1f409" }, + { n: ["sauropod"], u: "1f995" }, + { n: ["t-rex"], u: "1f996" }, + { n: ["whale", "spouting whale"], u: "1f433" }, + { n: ["whale", "whale2"], u: "1f40b" }, + { n: ["dolphin", "flipper"], u: "1f42c" }, + { n: ["seal"], u: "1f9ad" }, + { n: ["fish"], u: "1f41f" }, + { n: ["tropical fish"], u: "1f420" }, + { n: ["blowfish"], u: "1f421" }, + { n: ["shark"], u: "1f988" }, + { n: ["octopus"], u: "1f419" }, + { n: ["shell", "spiral shell"], u: "1f41a" }, + { n: ["coral"], u: "1fab8" }, + { n: ["snail"], u: "1f40c" }, + { n: ["butterfly"], u: "1f98b" }, + { n: ["bug"], u: "1f41b" }, + { n: ["ant"], u: "1f41c" }, + { n: ["bee", "honeybee"], u: "1f41d" }, + { n: ["beetle"], u: "1fab2" }, + { n: ["ladybug", "lady beetle"], u: "1f41e" }, + { n: ["cricket"], u: "1f997" }, + { n: ["cockroach"], u: "1fab3" }, + { n: ["spider"], u: "1f577-fe0f" }, + { n: ["spider web"], u: "1f578-fe0f" }, + { n: ["scorpion"], u: "1f982" }, + { n: ["mosquito"], u: "1f99f" }, + { n: ["fly"], u: "1fab0" }, + { n: ["worm"], u: "1fab1" }, + { n: ["microbe"], u: "1f9a0" }, + { n: ["bouquet"], u: "1f490" }, + { n: ["cherry blossom"], u: "1f338" }, + { n: ["white flower"], u: "1f4ae" }, + { n: ["lotus"], u: "1fab7" }, + { n: ["rosette"], u: "1f3f5-fe0f" }, + { n: ["rose"], u: "1f339" }, + { n: ["wilted flower"], u: "1f940" }, + { n: ["hibiscus"], u: "1f33a" }, + { n: ["sunflower"], u: "1f33b" }, + { n: ["blossom"], u: "1f33c" }, + { n: ["tulip"], u: "1f337" }, + { n: ["seedling"], u: "1f331" }, + { n: ["potted plant"], u: "1fab4" }, + { n: ["evergreen tree"], u: "1f332" }, + { n: ["deciduous tree"], u: "1f333" }, + { n: ["palm tree"], u: "1f334" }, + { n: ["cactus"], u: "1f335" }, + { n: ["ear of rice"], u: "1f33e" }, + { n: ["herb"], u: "1f33f" }, + { n: ["shamrock"], u: "2618-fe0f" }, + { n: ["four leaf clover"], u: "1f340" }, + { n: ["maple leaf"], u: "1f341" }, + { n: ["fallen leaf"], u: "1f342" }, + { n: ["leaves", "leaf fluttering in wind"], u: "1f343" }, + { n: ["empty nest"], u: "1fab9" }, + { n: ["nest with eggs"], u: "1faba" } + ], + food_drink: [ + { n: ["grapes"], u: "1f347" }, + { n: ["melon"], u: "1f348" }, + { n: ["watermelon"], u: "1f349" }, + { n: ["tangerine"], u: "1f34a" }, + { n: ["lemon"], u: "1f34b" }, + { n: ["banana"], u: "1f34c" }, + { n: ["pineapple"], u: "1f34d" }, + { n: ["mango"], u: "1f96d" }, + { n: ["apple", "red apple"], u: "1f34e" }, + { n: ["green apple"], u: "1f34f" }, + { n: ["pear"], u: "1f350" }, + { n: ["peach"], u: "1f351" }, + { n: ["cherries"], u: "1f352" }, + { n: ["strawberry"], u: "1f353" }, + { n: ["blueberries"], u: "1fad0" }, + { n: ["kiwifruit"], u: "1f95d" }, + { n: ["tomato"], u: "1f345" }, + { n: ["olive"], u: "1fad2" }, + { n: ["coconut"], u: "1f965" }, + { n: ["avocado"], u: "1f951" }, + { n: ["eggplant", "aubergine"], u: "1f346" }, + { n: ["potato"], u: "1f954" }, + { n: ["carrot"], u: "1f955" }, + { n: ["corn", "ear of maize"], u: "1f33d" }, + { n: ["hot pepper"], u: "1f336-fe0f" }, + { n: ["bell pepper"], u: "1fad1" }, + { n: ["cucumber"], u: "1f952" }, + { n: ["leafy green"], u: "1f96c" }, + { n: ["broccoli"], u: "1f966" }, + { n: ["garlic"], u: "1f9c4" }, + { n: ["onion"], u: "1f9c5" }, + { n: ["mushroom"], u: "1f344" }, + { n: ["peanuts"], u: "1f95c" }, + { n: ["beans"], u: "1fad8" }, + { n: ["chestnut"], u: "1f330" }, + { n: ["bread"], u: "1f35e" }, + { n: ["croissant"], u: "1f950" }, + { n: ["baguette bread"], u: "1f956" }, + { n: ["flatbread"], u: "1fad3" }, + { n: ["pretzel"], u: "1f968" }, + { n: ["bagel"], u: "1f96f" }, + { n: ["pancakes"], u: "1f95e" }, + { n: ["waffle"], u: "1f9c7" }, + { n: ["cheese wedge"], u: "1f9c0" }, + { n: ["meat on bone"], u: "1f356" }, + { n: ["poultry leg"], u: "1f357" }, + { n: ["cut of meat"], u: "1f969" }, + { n: ["bacon"], u: "1f953" }, + { n: ["hamburger"], u: "1f354" }, + { n: ["fries", "french fries"], u: "1f35f" }, + { n: ["pizza", "slice of pizza"], u: "1f355" }, + { n: ["hotdog", "hot dog"], u: "1f32d" }, + { n: ["sandwich"], u: "1f96a" }, + { n: ["taco"], u: "1f32e" }, + { n: ["burrito"], u: "1f32f" }, + { n: ["tamale"], u: "1fad4" }, + { n: ["stuffed flatbread"], u: "1f959" }, + { n: ["falafel"], u: "1f9c6" }, + { n: ["egg"], u: "1f95a" }, + { n: ["cooking", "fried egg"], u: "1f373" }, + { n: ["shallow pan of food"], u: "1f958" }, + { n: ["stew", "pot of food"], u: "1f372" }, + { n: ["fondue"], u: "1fad5" }, + { n: ["bowl with spoon"], u: "1f963" }, + { n: ["green salad"], u: "1f957" }, + { n: ["popcorn"], u: "1f37f" }, + { n: ["butter"], u: "1f9c8" }, + { n: ["salt", "salt shaker"], u: "1f9c2" }, + { n: ["canned food"], u: "1f96b" }, + { n: ["bento", "bento box"], u: "1f371" }, + { n: ["rice cracker"], u: "1f358" }, + { n: ["rice ball"], u: "1f359" }, + { n: ["rice", "cooked rice"], u: "1f35a" }, + { n: ["curry", "curry and rice"], u: "1f35b" }, + { n: ["ramen", "steaming bowl"], u: "1f35c" }, + { n: ["spaghetti"], u: "1f35d" }, + { n: ["sweet potato", "roasted sweet potato"], u: "1f360" }, + { n: ["oden"], u: "1f362" }, + { n: ["sushi"], u: "1f363" }, + { n: ["fried shrimp"], u: "1f364" }, + { n: ["fish cake", "fish cake with swirl design"], u: "1f365" }, + { n: ["moon cake"], u: "1f96e" }, + { n: ["dango"], u: "1f361" }, + { n: ["dumpling"], u: "1f95f" }, + { n: ["fortune cookie"], u: "1f960" }, + { n: ["takeout box"], u: "1f961" }, + { n: ["crab"], u: "1f980" }, + { n: ["lobster"], u: "1f99e" }, + { n: ["shrimp"], u: "1f990" }, + { n: ["squid"], u: "1f991" }, + { n: ["oyster"], u: "1f9aa" }, + { n: ["icecream", "soft ice cream"], u: "1f366" }, + { n: ["shaved ice"], u: "1f367" }, + { n: ["ice cream"], u: "1f368" }, + { n: ["doughnut"], u: "1f369" }, + { n: ["cookie"], u: "1f36a" }, + { n: ["birthday", "birthday cake"], u: "1f382" }, + { n: ["cake", "shortcake"], u: "1f370" }, + { n: ["cupcake"], u: "1f9c1" }, + { n: ["pie"], u: "1f967" }, + { n: ["chocolate bar"], u: "1f36b" }, + { n: ["candy"], u: "1f36c" }, + { n: ["lollipop"], u: "1f36d" }, + { n: ["custard"], u: "1f36e" }, + { n: ["honey pot"], u: "1f36f" }, + { n: ["baby bottle"], u: "1f37c" }, + { n: ["glass of milk"], u: "1f95b" }, + { n: ["coffee", "hot beverage"], u: "2615" }, + { n: ["teapot"], u: "1fad6" }, + { n: ["tea", "teacup without handle"], u: "1f375" }, + { n: ["sake", "sake bottle and cup"], u: "1f376" }, + { n: ["champagne", "bottle with popping cork"], u: "1f37e" }, + { n: ["wine glass"], u: "1f377" }, + { n: ["cocktail", "cocktail glass"], u: "1f378" }, + { n: ["tropical drink"], u: "1f379" }, + { n: ["beer", "beer mug"], u: "1f37a" }, + { n: ["beers", "clinking beer mugs"], u: "1f37b" }, + { n: ["clinking glasses"], u: "1f942" }, + { n: ["tumbler glass"], u: "1f943" }, + { n: ["pouring liquid"], u: "1fad7" }, + { n: ["cup with straw"], u: "1f964" }, + { n: ["bubble tea"], u: "1f9cb" }, + { n: ["beverage box"], u: "1f9c3" }, + { n: ["mate drink"], u: "1f9c9" }, + { n: ["ice cube"], u: "1f9ca" }, + { n: ["chopsticks"], u: "1f962" }, + { n: ["knife fork plate", "fork and knife with plate"], u: "1f37d-fe0f" }, + { n: ["fork and knife"], u: "1f374" }, + { n: ["spoon"], u: "1f944" }, + { n: ["hocho", "knife"], u: "1f52a" }, + { n: ["jar"], u: "1fad9" }, + { n: ["amphora"], u: "1f3fa" } + ], + travel_places: [ + { n: ["earth africa", "earth globe europe-africa"], u: "1f30d" }, + { n: ["earth americas", "earth globe americas"], u: "1f30e" }, + { n: ["earth asia", "earth globe asia-australia"], u: "1f30f" }, + { n: ["globe with meridians"], u: "1f310" }, + { n: ["world map"], u: "1f5fa-fe0f" }, + { n: ["japan", "silhouette of japan"], u: "1f5fe" }, + { n: ["compass"], u: "1f9ed" }, + { n: ["snow-capped mountain", "snow capped mountain"], u: "1f3d4-fe0f" }, + { n: ["mountain"], u: "26f0-fe0f" }, + { n: ["volcano"], u: "1f30b" }, + { n: ["mount fuji"], u: "1f5fb" }, + { n: ["camping"], u: "1f3d5-fe0f" }, + { n: ["beach with umbrella"], u: "1f3d6-fe0f" }, + { n: ["desert"], u: "1f3dc-fe0f" }, + { n: ["desert island"], u: "1f3dd-fe0f" }, + { n: ["national park"], u: "1f3de-fe0f" }, + { n: ["stadium"], u: "1f3df-fe0f" }, + { n: ["classical building"], u: "1f3db-fe0f" }, + { n: ["building construction"], u: "1f3d7-fe0f" }, + { n: ["brick", "bricks"], u: "1f9f1" }, + { n: ["rock"], u: "1faa8" }, + { n: ["wood"], u: "1fab5" }, + { n: ["hut"], u: "1f6d6" }, + { n: ["houses", "house buildings"], u: "1f3d8-fe0f" }, + { n: ["derelict house", "derelict house building"], u: "1f3da-fe0f" }, + { n: ["house", "house building"], u: "1f3e0" }, + { n: ["house with garden"], u: "1f3e1" }, + { n: ["office", "office building"], u: "1f3e2" }, + { n: ["post office", "japanese post office"], u: "1f3e3" }, + { n: ["european post office"], u: "1f3e4" }, + { n: ["hospital"], u: "1f3e5" }, + { n: ["bank"], u: "1f3e6" }, + { n: ["hotel"], u: "1f3e8" }, + { n: ["love hotel"], u: "1f3e9" }, + { n: ["convenience store"], u: "1f3ea" }, + { n: ["school"], u: "1f3eb" }, + { n: ["department store"], u: "1f3ec" }, + { n: ["factory"], u: "1f3ed" }, + { n: ["japanese castle"], u: "1f3ef" }, + { n: ["european castle"], u: "1f3f0" }, + { n: ["wedding"], u: "1f492" }, + { n: ["tokyo tower"], u: "1f5fc" }, + { n: ["statue of liberty"], u: "1f5fd" }, + { n: ["church"], u: "26ea" }, + { n: ["mosque"], u: "1f54c" }, + { n: ["hindu temple"], u: "1f6d5" }, + { n: ["synagogue"], u: "1f54d" }, + { n: ["shinto shrine"], u: "26e9-fe0f" }, + { n: ["kaaba"], u: "1f54b" }, + { n: ["fountain"], u: "26f2" }, + { n: ["tent"], u: "26fa" }, + { n: ["foggy"], u: "1f301" }, + { n: ["night with stars"], u: "1f303" }, + { n: ["cityscape"], u: "1f3d9-fe0f" }, + { n: ["sunrise over mountains"], u: "1f304" }, + { n: ["sunrise"], u: "1f305" }, + { n: ["city sunset", "cityscape at dusk"], u: "1f306" }, + { n: ["city sunrise", "sunset over buildings"], u: "1f307" }, + { n: ["bridge at night"], u: "1f309" }, + { n: ["hotsprings", "hot springs"], u: "2668-fe0f" }, + { n: ["carousel horse"], u: "1f3a0" }, + { n: ["playground slide"], u: "1f6dd" }, + { n: ["ferris wheel"], u: "1f3a1" }, + { n: ["roller coaster"], u: "1f3a2" }, + { n: ["barber", "barber pole"], u: "1f488" }, + { n: ["circus tent"], u: "1f3aa" }, + { n: ["steam locomotive"], u: "1f682" }, + { n: ["railway car"], u: "1f683" }, + { n: ["high-speed train", "bullettrain side"], u: "1f684" }, + { + n: ["bullettrain front", "high-speed train with bullet nose"], + u: "1f685" + }, + { n: ["train", "train2"], u: "1f686" }, + { n: ["metro"], u: "1f687" }, + { n: ["light rail"], u: "1f688" }, + { n: ["station"], u: "1f689" }, + { n: ["tram"], u: "1f68a" }, + { n: ["monorail"], u: "1f69d" }, + { n: ["mountain railway"], u: "1f69e" }, + { n: ["train", "tram car"], u: "1f68b" }, + { n: ["bus"], u: "1f68c" }, + { n: ["oncoming bus"], u: "1f68d" }, + { n: ["trolleybus"], u: "1f68e" }, + { n: ["minibus"], u: "1f690" }, + { n: ["ambulance"], u: "1f691" }, + { n: ["fire engine"], u: "1f692" }, + { n: ["police car"], u: "1f693" }, + { n: ["oncoming police car"], u: "1f694" }, + { n: ["taxi"], u: "1f695" }, + { n: ["oncoming taxi"], u: "1f696" }, + { n: ["car", "red car", "automobile"], u: "1f697" }, + { n: ["oncoming automobile"], u: "1f698" }, + { n: ["blue car", "recreational vehicle"], u: "1f699" }, + { n: ["pickup truck"], u: "1f6fb" }, + { n: ["truck", "delivery truck"], u: "1f69a" }, + { n: ["articulated lorry"], u: "1f69b" }, + { n: ["tractor"], u: "1f69c" }, + { n: ["racing car"], u: "1f3ce-fe0f" }, + { n: ["motorcycle", "racing motorcycle"], u: "1f3cd-fe0f" }, + { n: ["motor scooter"], u: "1f6f5" }, + { n: ["manual wheelchair"], u: "1f9bd" }, + { n: ["motorized wheelchair"], u: "1f9bc" }, + { n: ["auto rickshaw"], u: "1f6fa" }, + { n: ["bike", "bicycle"], u: "1f6b2" }, + { n: ["scooter"], u: "1f6f4" }, + { n: ["skateboard"], u: "1f6f9" }, + { n: ["roller skate"], u: "1f6fc" }, + { n: ["busstop", "bus stop"], u: "1f68f" }, + { n: ["motorway"], u: "1f6e3-fe0f" }, + { n: ["railway track"], u: "1f6e4-fe0f" }, + { n: ["oil drum"], u: "1f6e2-fe0f" }, + { n: ["fuelpump", "fuel pump"], u: "26fd" }, + { n: ["wheel"], u: "1f6de" }, + { n: ["rotating light", "police cars revolving light"], u: "1f6a8" }, + { n: ["traffic light", "horizontal traffic light"], u: "1f6a5" }, + { n: ["vertical traffic light"], u: "1f6a6" }, + { n: ["octagonal sign"], u: "1f6d1" }, + { n: ["construction", "construction sign"], u: "1f6a7" }, + { n: ["anchor"], u: "2693" }, + { n: ["ring buoy"], u: "1f6df" }, + { n: ["boat", "sailboat"], u: "26f5" }, + { n: ["canoe"], u: "1f6f6" }, + { n: ["speedboat"], u: "1f6a4" }, + { n: ["passenger ship"], u: "1f6f3-fe0f" }, + { n: ["ferry"], u: "26f4-fe0f" }, + { n: ["motor boat"], u: "1f6e5-fe0f" }, + { n: ["ship"], u: "1f6a2" }, + { n: ["airplane"], u: "2708-fe0f" }, + { n: ["small airplane"], u: "1f6e9-fe0f" }, + { n: ["airplane departure"], u: "1f6eb" }, + { n: ["airplane arriving"], u: "1f6ec" }, + { n: ["parachute"], u: "1fa82" }, + { n: ["seat"], u: "1f4ba" }, + { n: ["helicopter"], u: "1f681" }, + { n: ["suspension railway"], u: "1f69f" }, + { n: ["mountain cableway"], u: "1f6a0" }, + { n: ["aerial tramway"], u: "1f6a1" }, + { n: ["satellite"], u: "1f6f0-fe0f" }, + { n: ["rocket"], u: "1f680" }, + { n: ["flying saucer"], u: "1f6f8" }, + { n: ["bellhop bell"], u: "1f6ce-fe0f" }, + { n: ["luggage"], u: "1f9f3" }, + { n: ["hourglass"], u: "231b" }, + { n: ["hourglass flowing sand", "hourglass with flowing sand"], u: "23f3" }, + { n: ["watch"], u: "231a" }, + { n: ["alarm clock"], u: "23f0" }, + { n: ["stopwatch"], u: "23f1-fe0f" }, + { n: ["timer clock"], u: "23f2-fe0f" }, + { n: ["mantelpiece clock"], u: "1f570-fe0f" }, + { n: ["clock12", "clock face twelve oclock"], u: "1f55b" }, + { n: ["clock1230", "clock face twelve-thirty"], u: "1f567" }, + { n: ["clock1", "clock face one oclock"], u: "1f550" }, + { n: ["clock130", "clock face one-thirty"], u: "1f55c" }, + { n: ["clock2", "clock face two oclock"], u: "1f551" }, + { n: ["clock230", "clock face two-thirty"], u: "1f55d" }, + { n: ["clock3", "clock face three oclock"], u: "1f552" }, + { n: ["clock330", "clock face three-thirty"], u: "1f55e" }, + { n: ["clock4", "clock face four oclock"], u: "1f553" }, + { n: ["clock430", "clock face four-thirty"], u: "1f55f" }, + { n: ["clock5", "clock face five oclock"], u: "1f554" }, + { n: ["clock530", "clock face five-thirty"], u: "1f560" }, + { n: ["clock6", "clock face six oclock"], u: "1f555" }, + { n: ["clock630", "clock face six-thirty"], u: "1f561" }, + { n: ["clock7", "clock face seven oclock"], u: "1f556" }, + { n: ["clock730", "clock face seven-thirty"], u: "1f562" }, + { n: ["clock8", "clock face eight oclock"], u: "1f557" }, + { n: ["clock830", "clock face eight-thirty"], u: "1f563" }, + { n: ["clock9", "clock face nine oclock"], u: "1f558" }, + { n: ["clock930", "clock face nine-thirty"], u: "1f564" }, + { n: ["clock10", "clock face ten oclock"], u: "1f559" }, + { n: ["clock1030", "clock face ten-thirty"], u: "1f565" }, + { n: ["clock11", "clock face eleven oclock"], u: "1f55a" }, + { n: ["clock1130", "clock face eleven-thirty"], u: "1f566" }, + { n: ["new moon", "new moon symbol"], u: "1f311" }, + { n: ["waxing crescent moon", "waxing crescent moon symbol"], u: "1f312" }, + { n: ["first quarter moon", "first quarter moon symbol"], u: "1f313" }, + { + n: ["moon", "waxing gibbous moon", "waxing gibbous moon symbol"], + u: "1f314" + }, + { n: ["full moon", "full moon symbol"], u: "1f315" }, + { n: ["waning gibbous moon", "waning gibbous moon symbol"], u: "1f316" }, + { n: ["last quarter moon", "last quarter moon symbol"], u: "1f317" }, + { n: ["waning crescent moon", "waning crescent moon symbol"], u: "1f318" }, + { n: ["crescent moon"], u: "1f319" }, + { n: ["new moon with face"], u: "1f31a" }, + { n: ["first quarter moon with face"], u: "1f31b" }, + { n: ["last quarter moon with face"], u: "1f31c" }, + { n: ["thermometer"], u: "1f321-fe0f" }, + { n: ["sunny", "black sun with rays"], u: "2600-fe0f" }, + { n: ["full moon with face"], u: "1f31d" }, + { n: ["sun with face"], u: "1f31e" }, + { n: ["ringed planet"], u: "1fa90" }, + { n: ["star", "white medium star"], u: "2b50" }, + { n: ["star2", "glowing star"], u: "1f31f" }, + { n: ["stars", "shooting star"], u: "1f320" }, + { n: ["milky way"], u: "1f30c" }, + { n: ["cloud"], u: "2601-fe0f" }, + { n: ["partly sunny", "sun behind cloud"], u: "26c5" }, + { + n: ["thunder cloud and rain", "cloud with lightning and rain"], + u: "26c8-fe0f" + }, + { + n: ["mostly sunny", "sun small cloud", "sun behind small cloud"], + u: "1f324-fe0f" + }, + { + n: ["barely sunny", "sun behind cloud", "sun behind large cloud"], + u: "1f325-fe0f" + }, + { n: ["partly sunny rain", "sun behind rain cloud"], u: "1f326-fe0f" }, + { n: ["rain cloud", "cloud with rain"], u: "1f327-fe0f" }, + { n: ["snow cloud", "cloud with snow"], u: "1f328-fe0f" }, + { + n: ["lightning", "lightning cloud", "cloud with lightning"], + u: "1f329-fe0f" + }, + { n: ["tornado", "tornado cloud"], u: "1f32a-fe0f" }, + { n: ["fog"], u: "1f32b-fe0f" }, + { n: ["wind face", "wind blowing face"], u: "1f32c-fe0f" }, + { n: ["cyclone"], u: "1f300" }, + { n: ["rainbow"], u: "1f308" }, + { n: ["closed umbrella"], u: "1f302" }, + { n: ["umbrella"], u: "2602-fe0f" }, + { n: ["umbrella with rain drops"], u: "2614" }, + { n: ["umbrella on ground"], u: "26f1-fe0f" }, + { n: ["zap", "high voltage sign"], u: "26a1" }, + { n: ["snowflake"], u: "2744-fe0f" }, + { n: ["snowman"], u: "2603-fe0f" }, + { n: ["snowman without snow"], u: "26c4" }, + { n: ["comet"], u: "2604-fe0f" }, + { n: ["fire"], u: "1f525" }, + { n: ["droplet"], u: "1f4a7" }, + { n: ["ocean", "water wave"], u: "1f30a" } + ], + activities: [ + { n: ["jack-o-lantern", "jack o lantern"], u: "1f383" }, + { n: ["christmas tree"], u: "1f384" }, + { n: ["fireworks"], u: "1f386" }, + { n: ["sparkler", "firework sparkler"], u: "1f387" }, + { n: ["firecracker"], u: "1f9e8" }, + { n: ["sparkles"], u: "2728" }, + { n: ["balloon"], u: "1f388" }, + { n: ["tada", "party popper"], u: "1f389" }, + { n: ["confetti ball"], u: "1f38a" }, + { n: ["tanabata tree"], u: "1f38b" }, + { n: ["bamboo", "pine decoration"], u: "1f38d" }, + { n: ["dolls", "japanese dolls"], u: "1f38e" }, + { n: ["flags", "carp streamer"], u: "1f38f" }, + { n: ["wind chime"], u: "1f390" }, + { n: ["rice scene", "moon viewing ceremony"], u: "1f391" }, + { n: ["red envelope", "red gift envelope"], u: "1f9e7" }, + { n: ["ribbon"], u: "1f380" }, + { n: ["gift", "wrapped present"], u: "1f381" }, + { n: ["reminder ribbon"], u: "1f397-fe0f" }, + { n: ["admission tickets"], u: "1f39f-fe0f" }, + { n: ["ticket"], u: "1f3ab" }, + { n: ["medal", "military medal"], u: "1f396-fe0f" }, + { n: ["trophy"], u: "1f3c6" }, + { n: ["sports medal"], u: "1f3c5" }, + { n: ["first place medal"], u: "1f947" }, + { n: ["second place medal"], u: "1f948" }, + { n: ["third place medal"], u: "1f949" }, + { n: ["soccer", "soccer ball"], u: "26bd" }, + { n: ["baseball"], u: "26be" }, + { n: ["softball"], u: "1f94e" }, + { n: ["basketball", "basketball and hoop"], u: "1f3c0" }, + { n: ["volleyball"], u: "1f3d0" }, + { n: ["football", "american football"], u: "1f3c8" }, + { n: ["rugby football"], u: "1f3c9" }, + { n: ["tennis", "tennis racquet and ball"], u: "1f3be" }, + { n: ["flying disc"], u: "1f94f" }, + { n: ["bowling"], u: "1f3b3" }, + { n: ["cricket bat and ball"], u: "1f3cf" }, + { n: ["field hockey stick and ball"], u: "1f3d1" }, + { n: ["ice hockey stick and puck"], u: "1f3d2" }, + { n: ["lacrosse", "lacrosse stick and ball"], u: "1f94d" }, + { n: ["table tennis paddle and ball"], u: "1f3d3" }, + { n: ["badminton racquet and shuttlecock"], u: "1f3f8" }, + { n: ["boxing glove"], u: "1f94a" }, + { n: ["martial arts uniform"], u: "1f94b" }, + { n: ["goal net"], u: "1f945" }, + { n: ["golf", "flag in hole"], u: "26f3" }, + { n: ["ice skate"], u: "26f8-fe0f" }, + { n: ["fishing pole and fish"], u: "1f3a3" }, + { n: ["diving mask"], u: "1f93f" }, + { n: ["running shirt with sash"], u: "1f3bd" }, + { n: ["ski", "ski and ski boot"], u: "1f3bf" }, + { n: ["sled"], u: "1f6f7" }, + { n: ["curling stone"], u: "1f94c" }, + { n: ["dart", "direct hit"], u: "1f3af" }, + { n: ["yo-yo"], u: "1fa80" }, + { n: ["kite"], u: "1fa81" }, + { n: ["8ball", "billiards"], u: "1f3b1" }, + { n: ["crystal ball"], u: "1f52e" }, + { n: ["magic wand"], u: "1fa84" }, + { n: ["nazar amulet"], u: "1f9ff" }, + { n: ["hamsa"], u: "1faac" }, + { n: ["video game"], u: "1f3ae" }, + { n: ["joystick"], u: "1f579-fe0f" }, + { n: ["slot machine"], u: "1f3b0" }, + { n: ["game die"], u: "1f3b2" }, + { n: ["jigsaw", "jigsaw puzzle piece"], u: "1f9e9" }, + { n: ["teddy bear"], u: "1f9f8" }, + { n: ["pinata"], u: "1fa85" }, + { n: ["mirror ball"], u: "1faa9" }, + { n: ["nesting dolls"], u: "1fa86" }, + { n: ["spades", "black spade suit"], u: "2660-fe0f" }, + { n: ["hearts", "black heart suit"], u: "2665-fe0f" }, + { n: ["diamonds", "black diamond suit"], u: "2666-fe0f" }, + { n: ["clubs", "black club suit"], u: "2663-fe0f" }, + { n: ["chess pawn"], u: "265f-fe0f" }, + { n: ["black joker", "playing card black joker"], u: "1f0cf" }, + { n: ["mahjong", "mahjong tile red dragon"], u: "1f004" }, + { n: ["flower playing cards"], u: "1f3b4" }, + { n: ["performing arts"], u: "1f3ad" }, + { n: ["framed picture", "frame with picture"], u: "1f5bc-fe0f" }, + { n: ["art", "artist palette"], u: "1f3a8" }, + { n: ["thread", "spool of thread"], u: "1f9f5" }, + { n: ["sewing needle"], u: "1faa1" }, + { n: ["yarn", "ball of yarn"], u: "1f9f6" }, + { n: ["knot"], u: "1faa2" } + ], + objects: [ + { n: ["eyeglasses"], u: "1f453" }, + { n: ["sunglasses", "dark sunglasses"], u: "1f576-fe0f" }, + { n: ["goggles"], u: "1f97d" }, + { n: ["lab coat"], u: "1f97c" }, + { n: ["safety vest"], u: "1f9ba" }, + { n: ["necktie"], u: "1f454" }, + { n: ["shirt", "tshirt", "t-shirt"], u: "1f455" }, + { n: ["jeans"], u: "1f456" }, + { n: ["scarf"], u: "1f9e3" }, + { n: ["gloves"], u: "1f9e4" }, + { n: ["coat"], u: "1f9e5" }, + { n: ["socks"], u: "1f9e6" }, + { n: ["dress"], u: "1f457" }, + { n: ["kimono"], u: "1f458" }, + { n: ["sari"], u: "1f97b" }, + { n: ["one-piece swimsuit"], u: "1fa71" }, + { n: ["briefs"], u: "1fa72" }, + { n: ["shorts"], u: "1fa73" }, + { n: ["bikini"], u: "1f459" }, + { n: ["womans clothes"], u: "1f45a" }, + { n: ["purse"], u: "1f45b" }, + { n: ["handbag"], u: "1f45c" }, + { n: ["pouch"], u: "1f45d" }, + { n: ["shopping bags"], u: "1f6cd-fe0f" }, + { n: ["school satchel"], u: "1f392" }, + { n: ["thong sandal"], u: "1fa74" }, + { n: ["shoe", "mans shoe"], u: "1f45e" }, + { n: ["athletic shoe"], u: "1f45f" }, + { n: ["hiking boot"], u: "1f97e" }, + { n: ["flat shoe", "womans flat shoe"], u: "1f97f" }, + { n: ["high heel", "high-heeled shoe"], u: "1f460" }, + { n: ["sandal", "womans sandal"], u: "1f461" }, + { n: ["ballet shoes"], u: "1fa70" }, + { n: ["boot", "womans boots"], u: "1f462" }, + { n: ["crown"], u: "1f451" }, + { n: ["womans hat"], u: "1f452" }, + { n: ["tophat", "top hat"], u: "1f3a9" }, + { n: ["mortar board", "graduation cap"], u: "1f393" }, + { n: ["billed cap"], u: "1f9e2" }, + { n: ["military helmet"], u: "1fa96" }, + { + n: ["rescue worker\u2019s helmet", "helmet with white cross"], + u: "26d1-fe0f" + }, + { n: ["prayer beads"], u: "1f4ff" }, + { n: ["lipstick"], u: "1f484" }, + { n: ["ring"], u: "1f48d" }, + { n: ["gem", "gem stone"], u: "1f48e" }, + { n: ["mute", "speaker with cancellation stroke"], u: "1f507" }, + { n: ["speaker"], u: "1f508" }, + { n: ["sound", "speaker with one sound wave"], u: "1f509" }, + { n: ["loud sound", "speaker with three sound waves"], u: "1f50a" }, + { n: ["loudspeaker", "public address loudspeaker"], u: "1f4e2" }, + { n: ["mega", "cheering megaphone"], u: "1f4e3" }, + { n: ["postal horn"], u: "1f4ef" }, + { n: ["bell"], u: "1f514" }, + { n: ["no bell", "bell with cancellation stroke"], u: "1f515" }, + { n: ["musical score"], u: "1f3bc" }, + { n: ["musical note"], u: "1f3b5" }, + { n: ["notes", "multiple musical notes"], u: "1f3b6" }, + { n: ["studio microphone"], u: "1f399-fe0f" }, + { n: ["level slider"], u: "1f39a-fe0f" }, + { n: ["control knobs"], u: "1f39b-fe0f" }, + { n: ["microphone"], u: "1f3a4" }, + { n: ["headphone", "headphones"], u: "1f3a7" }, + { n: ["radio"], u: "1f4fb" }, + { n: ["saxophone"], u: "1f3b7" }, + { n: ["accordion"], u: "1fa97" }, + { n: ["guitar"], u: "1f3b8" }, + { n: ["musical keyboard"], u: "1f3b9" }, + { n: ["trumpet"], u: "1f3ba" }, + { n: ["violin"], u: "1f3bb" }, + { n: ["banjo"], u: "1fa95" }, + { n: ["drum with drumsticks"], u: "1f941" }, + { n: ["long drum"], u: "1fa98" }, + { n: ["iphone", "mobile phone"], u: "1f4f1" }, + { + n: ["calling", "mobile phone with rightwards arrow at left"], + u: "1f4f2" + }, + { n: ["phone", "telephone", "black telephone"], u: "260e-fe0f" }, + { n: ["telephone receiver"], u: "1f4de" }, + { n: ["pager"], u: "1f4df" }, + { n: ["fax", "fax machine"], u: "1f4e0" }, + { n: ["battery"], u: "1f50b" }, + { n: ["low battery"], u: "1faab" }, + { n: ["electric plug"], u: "1f50c" }, + { n: ["computer", "personal computer"], u: "1f4bb" }, + { n: ["desktop computer"], u: "1f5a5-fe0f" }, + { n: ["printer"], u: "1f5a8-fe0f" }, + { n: ["keyboard"], u: "2328-fe0f" }, + { n: ["computer mouse", "three button mouse"], u: "1f5b1-fe0f" }, + { n: ["trackball"], u: "1f5b2-fe0f" }, + { n: ["minidisc"], u: "1f4bd" }, + { n: ["floppy disk"], u: "1f4be" }, + { n: ["cd", "optical disc"], u: "1f4bf" }, + { n: ["dvd"], u: "1f4c0" }, + { n: ["abacus"], u: "1f9ee" }, + { n: ["movie camera"], u: "1f3a5" }, + { n: ["film frames"], u: "1f39e-fe0f" }, + { n: ["film projector"], u: "1f4fd-fe0f" }, + { n: ["clapper", "clapper board"], u: "1f3ac" }, + { n: ["tv", "television"], u: "1f4fa" }, + { n: ["camera"], u: "1f4f7" }, + { n: ["camera with flash"], u: "1f4f8" }, + { n: ["video camera"], u: "1f4f9" }, + { n: ["vhs", "videocassette"], u: "1f4fc" }, + { n: ["mag", "left-pointing magnifying glass"], u: "1f50d" }, + { n: ["mag right", "right-pointing magnifying glass"], u: "1f50e" }, + { n: ["candle"], u: "1f56f-fe0f" }, + { n: ["bulb", "electric light bulb"], u: "1f4a1" }, + { n: ["flashlight", "electric torch"], u: "1f526" }, + { n: ["lantern", "izakaya lantern"], u: "1f3ee" }, + { n: ["diya lamp"], u: "1fa94" }, + { n: ["notebook with decorative cover"], u: "1f4d4" }, + { n: ["closed book"], u: "1f4d5" }, + { n: ["book", "open book"], u: "1f4d6" }, + { n: ["green book"], u: "1f4d7" }, + { n: ["blue book"], u: "1f4d8" }, + { n: ["orange book"], u: "1f4d9" }, + { n: ["books"], u: "1f4da" }, + { n: ["notebook"], u: "1f4d3" }, + { n: ["ledger"], u: "1f4d2" }, + { n: ["page with curl"], u: "1f4c3" }, + { n: ["scroll"], u: "1f4dc" }, + { n: ["page facing up"], u: "1f4c4" }, + { n: ["newspaper"], u: "1f4f0" }, + { n: ["rolled-up newspaper", "rolled up newspaper"], u: "1f5de-fe0f" }, + { n: ["bookmark tabs"], u: "1f4d1" }, + { n: ["bookmark"], u: "1f516" }, + { n: ["label"], u: "1f3f7-fe0f" }, + { n: ["moneybag", "money bag"], u: "1f4b0" }, + { n: ["coin"], u: "1fa99" }, + { n: ["yen", "banknote with yen sign"], u: "1f4b4" }, + { n: ["dollar", "banknote with dollar sign"], u: "1f4b5" }, + { n: ["euro", "banknote with euro sign"], u: "1f4b6" }, + { n: ["pound", "banknote with pound sign"], u: "1f4b7" }, + { n: ["money with wings"], u: "1f4b8" }, + { n: ["credit card"], u: "1f4b3" }, + { n: ["receipt"], u: "1f9fe" }, + { n: ["chart", "chart with upwards trend and yen sign"], u: "1f4b9" }, + { n: ["email", "envelope"], u: "2709-fe0f" }, + { n: ["e-mail", "e-mail symbol"], u: "1f4e7" }, + { n: ["incoming envelope"], u: "1f4e8" }, + { + n: ["envelope with arrow", "envelope with downwards arrow above"], + u: "1f4e9" + }, + { n: ["outbox tray"], u: "1f4e4" }, + { n: ["inbox tray"], u: "1f4e5" }, + { n: ["package"], u: "1f4e6" }, + { n: ["mailbox", "closed mailbox with raised flag"], u: "1f4eb" }, + { n: ["mailbox closed", "closed mailbox with lowered flag"], u: "1f4ea" }, + { n: ["mailbox with mail", "open mailbox with raised flag"], u: "1f4ec" }, + { + n: ["mailbox with no mail", "open mailbox with lowered flag"], + u: "1f4ed" + }, + { n: ["postbox"], u: "1f4ee" }, + { n: ["ballot box with ballot"], u: "1f5f3-fe0f" }, + { n: ["pencil", "pencil2"], u: "270f-fe0f" }, + { n: ["black nib"], u: "2712-fe0f" }, + { n: ["fountain pen", "lower left fountain pen"], u: "1f58b-fe0f" }, + { n: ["pen", "lower left ballpoint pen"], u: "1f58a-fe0f" }, + { n: ["paintbrush", "lower left paintbrush"], u: "1f58c-fe0f" }, + { n: ["crayon", "lower left crayon"], u: "1f58d-fe0f" }, + { n: ["memo", "pencil"], u: "1f4dd" }, + { n: ["briefcase"], u: "1f4bc" }, + { n: ["file folder"], u: "1f4c1" }, + { n: ["open file folder"], u: "1f4c2" }, + { n: ["card index dividers"], u: "1f5c2-fe0f" }, + { n: ["date", "calendar"], u: "1f4c5" }, + { n: ["calendar", "tear-off calendar"], u: "1f4c6" }, + { n: ["spiral notepad", "spiral note pad"], u: "1f5d2-fe0f" }, + { n: ["spiral calendar", "spiral calendar pad"], u: "1f5d3-fe0f" }, + { n: ["card index"], u: "1f4c7" }, + { n: ["chart with upwards trend"], u: "1f4c8" }, + { n: ["chart with downwards trend"], u: "1f4c9" }, + { n: ["bar chart"], u: "1f4ca" }, + { n: ["clipboard"], u: "1f4cb" }, + { n: ["pushpin"], u: "1f4cc" }, + { n: ["round pushpin"], u: "1f4cd" }, + { n: ["paperclip"], u: "1f4ce" }, + { n: ["linked paperclips"], u: "1f587-fe0f" }, + { n: ["straight ruler"], u: "1f4cf" }, + { n: ["triangular ruler"], u: "1f4d0" }, + { n: ["scissors", "black scissors"], u: "2702-fe0f" }, + { n: ["card file box"], u: "1f5c3-fe0f" }, + { n: ["file cabinet"], u: "1f5c4-fe0f" }, + { n: ["wastebasket"], u: "1f5d1-fe0f" }, + { n: ["lock"], u: "1f512" }, + { n: ["unlock", "open lock"], u: "1f513" }, + { n: ["lock with ink pen"], u: "1f50f" }, + { n: ["closed lock with key"], u: "1f510" }, + { n: ["key"], u: "1f511" }, + { n: ["old key"], u: "1f5dd-fe0f" }, + { n: ["hammer"], u: "1f528" }, + { n: ["axe"], u: "1fa93" }, + { n: ["pick"], u: "26cf-fe0f" }, + { n: ["hammer and pick"], u: "2692-fe0f" }, + { n: ["hammer and wrench"], u: "1f6e0-fe0f" }, + { n: ["dagger", "dagger knife"], u: "1f5e1-fe0f" }, + { n: ["crossed swords"], u: "2694-fe0f" }, + { n: ["gun", "pistol"], u: "1f52b" }, + { n: ["boomerang"], u: "1fa83" }, + { n: ["bow and arrow"], u: "1f3f9" }, + { n: ["shield"], u: "1f6e1-fe0f" }, + { n: ["carpentry saw"], u: "1fa9a" }, + { n: ["wrench"], u: "1f527" }, + { n: ["screwdriver"], u: "1fa9b" }, + { n: ["nut and bolt"], u: "1f529" }, + { n: ["gear"], u: "2699-fe0f" }, + { n: ["clamp", "compression"], u: "1f5dc-fe0f" }, + { n: ["scales", "balance scale"], u: "2696-fe0f" }, + { n: ["probing cane"], u: "1f9af" }, + { n: ["link", "link symbol"], u: "1f517" }, + { n: ["chains"], u: "26d3-fe0f" }, + { n: ["hook"], u: "1fa9d" }, + { n: ["toolbox"], u: "1f9f0" }, + { n: ["magnet"], u: "1f9f2" }, + { n: ["ladder"], u: "1fa9c" }, + { n: ["alembic"], u: "2697-fe0f" }, + { n: ["test tube"], u: "1f9ea" }, + { n: ["petri dish"], u: "1f9eb" }, + { n: ["dna", "dna double helix"], u: "1f9ec" }, + { n: ["microscope"], u: "1f52c" }, + { n: ["telescope"], u: "1f52d" }, + { n: ["satellite antenna"], u: "1f4e1" }, + { n: ["syringe"], u: "1f489" }, + { n: ["drop of blood"], u: "1fa78" }, + { n: ["pill"], u: "1f48a" }, + { n: ["adhesive bandage"], u: "1fa79" }, + { n: ["crutch"], u: "1fa7c" }, + { n: ["stethoscope"], u: "1fa7a" }, + { n: ["x-ray"], u: "1fa7b" }, + { n: ["door"], u: "1f6aa" }, + { n: ["elevator"], u: "1f6d7" }, + { n: ["mirror"], u: "1fa9e" }, + { n: ["window"], u: "1fa9f" }, + { n: ["bed"], u: "1f6cf-fe0f" }, + { n: ["couch and lamp"], u: "1f6cb-fe0f" }, + { n: ["chair"], u: "1fa91" }, + { n: ["toilet"], u: "1f6bd" }, + { n: ["plunger"], u: "1faa0" }, + { n: ["shower"], u: "1f6bf" }, + { n: ["bathtub"], u: "1f6c1" }, + { n: ["mouse trap"], u: "1faa4" }, + { n: ["razor"], u: "1fa92" }, + { n: ["lotion bottle"], u: "1f9f4" }, + { n: ["safety pin"], u: "1f9f7" }, + { n: ["broom"], u: "1f9f9" }, + { n: ["basket"], u: "1f9fa" }, + { n: ["roll of paper"], u: "1f9fb" }, + { n: ["bucket"], u: "1faa3" }, + { n: ["soap", "bar of soap"], u: "1f9fc" }, + { n: ["bubbles"], u: "1fae7" }, + { n: ["toothbrush"], u: "1faa5" }, + { n: ["sponge"], u: "1f9fd" }, + { n: ["fire extinguisher"], u: "1f9ef" }, + { n: ["shopping trolley"], u: "1f6d2" }, + { n: ["smoking", "smoking symbol"], u: "1f6ac" }, + { n: ["coffin"], u: "26b0-fe0f" }, + { n: ["headstone"], u: "1faa6" }, + { n: ["funeral urn"], u: "26b1-fe0f" }, + { n: ["moyai"], u: "1f5ff" }, + { n: ["placard"], u: "1faa7" }, + { n: ["identification card"], u: "1faaa" } + ], + symbols: [ + { n: ["atm", "automated teller machine"], u: "1f3e7" }, + { + n: ["put litter in its place", "put litter in its place symbol"], + u: "1f6ae" + }, + { n: ["potable water", "potable water symbol"], u: "1f6b0" }, + { n: ["wheelchair", "wheelchair symbol"], u: "267f" }, + { n: ["mens", "mens symbol"], u: "1f6b9" }, + { n: ["womens", "womens symbol"], u: "1f6ba" }, + { n: ["restroom"], u: "1f6bb" }, + { n: ["baby symbol"], u: "1f6bc" }, + { n: ["wc", "water closet"], u: "1f6be" }, + { n: ["passport control"], u: "1f6c2" }, + { n: ["customs"], u: "1f6c3" }, + { n: ["baggage claim"], u: "1f6c4" }, + { n: ["left luggage"], u: "1f6c5" }, + { n: ["warning", "warning sign"], u: "26a0-fe0f" }, + { n: ["children crossing"], u: "1f6b8" }, + { n: ["no entry"], u: "26d4" }, + { n: ["no entry sign"], u: "1f6ab" }, + { n: ["no bicycles"], u: "1f6b3" }, + { n: ["no smoking", "no smoking symbol"], u: "1f6ad" }, + { n: ["do not litter", "do not litter symbol"], u: "1f6af" }, + { n: ["non-potable water", "non-potable water symbol"], u: "1f6b1" }, + { n: ["no pedestrians"], u: "1f6b7" }, + { n: ["no mobile phones"], u: "1f4f5" }, + { n: ["underage", "no one under eighteen symbol"], u: "1f51e" }, + { n: ["radioactive", "radioactive sign"], u: "2622-fe0f" }, + { n: ["biohazard", "biohazard sign"], u: "2623-fe0f" }, + { n: ["arrow up", "upwards black arrow"], u: "2b06-fe0f" }, + { n: ["north east arrow", "arrow upper right"], u: "2197-fe0f" }, + { n: ["arrow right", "black rightwards arrow"], u: "27a1-fe0f" }, + { n: ["south east arrow", "arrow lower right"], u: "2198-fe0f" }, + { n: ["arrow down", "downwards black arrow"], u: "2b07-fe0f" }, + { n: ["south west arrow", "arrow lower left"], u: "2199-fe0f" }, + { n: ["arrow left", "leftwards black arrow"], u: "2b05-fe0f" }, + { n: ["north west arrow", "arrow upper left"], u: "2196-fe0f" }, + { n: ["up down arrow", "arrow up down"], u: "2195-fe0f" }, + { n: ["left right arrow"], u: "2194-fe0f" }, + { n: ["leftwards arrow with hook"], u: "21a9-fe0f" }, + { n: ["arrow right hook", "rightwards arrow with hook"], u: "21aa-fe0f" }, + { + n: ["arrow heading up", "arrow pointing rightwards then curving upwards"], + u: "2934-fe0f" + }, + { + n: [ + "arrow heading down", + "arrow pointing rightwards then curving downwards" + ], + u: "2935-fe0f" + }, + { + n: [ + "arrows clockwise", + "clockwise downwards and upwards open circle arrows" + ], + u: "1f503" + }, + { + n: [ + "arrows counterclockwise", + "anticlockwise downwards and upwards open circle arrows" + ], + u: "1f504" + }, + { n: ["back", "back with leftwards arrow above"], u: "1f519" }, + { n: ["end", "end with leftwards arrow above"], u: "1f51a" }, + { + n: ["on", "on with exclamation mark with left right arrow above"], + u: "1f51b" + }, + { n: ["soon", "soon with rightwards arrow above"], u: "1f51c" }, + { n: ["top", "top with upwards arrow above"], u: "1f51d" }, + { n: ["place of worship"], u: "1f6d0" }, + { n: ["atom symbol"], u: "269b-fe0f" }, + { n: ["om", "om symbol"], u: "1f549-fe0f" }, + { n: ["star of david"], u: "2721-fe0f" }, + { n: ["wheel of dharma"], u: "2638-fe0f" }, + { n: ["yin yang"], u: "262f-fe0f" }, + { n: ["latin cross"], u: "271d-fe0f" }, + { n: ["orthodox cross"], u: "2626-fe0f" }, + { n: ["star and crescent"], u: "262a-fe0f" }, + { n: ["peace symbol"], u: "262e-fe0f" }, + { n: ["menorah with nine branches"], u: "1f54e" }, + { n: ["six pointed star", "six pointed star with middle dot"], u: "1f52f" }, + { n: ["aries"], u: "2648" }, + { n: ["taurus"], u: "2649" }, + { n: ["gemini"], u: "264a" }, + { n: ["cancer"], u: "264b" }, + { n: ["leo"], u: "264c" }, + { n: ["virgo"], u: "264d" }, + { n: ["libra"], u: "264e" }, + { n: ["scorpius"], u: "264f" }, + { n: ["sagittarius"], u: "2650" }, + { n: ["capricorn"], u: "2651" }, + { n: ["aquarius"], u: "2652" }, + { n: ["pisces"], u: "2653" }, + { n: ["ophiuchus"], u: "26ce" }, + { n: ["twisted rightwards arrows"], u: "1f500" }, + { + n: ["repeat", "clockwise rightwards and leftwards open circle arrows"], + u: "1f501" + }, + { + n: [ + "repeat one", + "clockwise rightwards and leftwards open circle arrows with circled one overlay" + ], + u: "1f502" + }, + { n: ["arrow forward", "black right-pointing triangle"], u: "25b6-fe0f" }, + { n: ["fast forward", "black right-pointing double triangle"], u: "23e9" }, + { + n: [ + "next track button", + "black right pointing double triangle with vertical bar" + ], + u: "23ed-fe0f" + }, + { + n: [ + "play or pause button", + "black right pointing triangle with double vertical bar" + ], + u: "23ef-fe0f" }, - {} - ); - const guessType = (ts) => { - return import_lodash2.default.head((0, import_lodash2.default)(ts).countBy().entries().maxBy(import_lodash2.default.last)); - }; - const guessedTypes = Object.keys(types2).reduce((p3, c4) => { - return { ...p3, [c4]: guessType(types2[c4]) }; - }, {}); - return guessedTypes; -}; -var valueForFrontmatter = (type, value) => { - if (type == "number") { - return parseFloat(value); - } else if (type == "boolean") { - return value == "true"; - } else if (type.contains("multi")) { - return parseMultiString(value).map( - (f4) => valueForFrontmatter(type.replace("-multi", ""), f4) - ); - } else if (type.contains("link") || type.contains("context")) { - return `[[${value}]]`; - } - return value; -}; -var valueForDataview = (type, value) => { - if (type.contains("link") || type.contains("context")) { - return `[[${value}]]`; - } - return value; -}; -var renameFrontmatterKey = (plugin, path, key2, name) => { - if (plugin.metadata.canProcessFrontmatter()) { - plugin.metadata.processFrontMatter(path, (frontmatter) => { - if (key2 in frontmatter) { - frontmatter[name] = frontmatter[key2]; - delete frontmatter[key2]; - } - }); - } -}; -var defaultValueForType = (value, type) => { - if (type == "date") { - return format(Date.now(), "yyyy-MM-dd"); - } - if (type == "number") { - return 0; - } - if (type == "boolean") { - return true; - } - if (type == "link") { - return "[[Select Note]]"; - } - if (type == "option") { - return "one, two"; - } - if (type == "text") { - return " "; - } - if (type == "image") { - return "https://images.unsplash.com/photo-1675789652575-0a5d2425b6c2?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80"; - } -}; -var changeFrontmatterType = (plugin, path, key2, type) => { - if (plugin.metadata.canProcessFrontmatter()) { - plugin.metadata.processFrontMatter(path, (frontmatter) => { - if (key2 in frontmatter) { - frontmatter[key2] = defaultValueForType(frontmatter[key2], type); - } - }); - } -}; -var deleteFrontmatterValue = (plugin, path, key2) => { - if (plugin.metadata.canProcessFrontmatter()) { - plugin.metadata.processFrontMatter(path, (frontmatter) => { - if (plugin.dataViewAPI()) { - if (plugin.dataViewAPI().page(path)[key2] && !frontmatter[key2]) { - replaceValues(plugin, path, key2, ""); - } else { - if (key2 in frontmatter) { - delete frontmatter[key2]; - } - } - } else { - if (key2 in frontmatter) { - delete frontmatter[key2]; - } - } - }); - } -}; -var saveFrontmatterValue = (plugin, path, key2, value, type, forceSave) => { - let afile = getAbstractFileAtPath(plugin, path); - const fileCache = plugin.index.filesIndex.get(path); - if (afile) { - if (fileCache && fileCache.isFolder && fileCache.folderNote) { - afile = getAbstractFileAtPath(plugin, fileCache.folderNote.folderNotePath); - } - if (afile instanceof import_obsidian12.TFile) { - if (plugin.metadata.canProcessFrontmatter()) { - plugin.metadata.processFrontMatter(afile.path, (frontmatter) => { - var _a2; - if (plugin.dataViewAPI()) { - if (((_a2 = plugin.dataViewAPI().page(afile.path)) == null ? void 0 : _a2[key2]) && !frontmatter[key2]) { - replaceValues(plugin, afile.path, key2, valueForDataview(type, value)); - } else { - if (key2 in frontmatter || forceSave) { - frontmatter[key2] = valueForFrontmatter(type, value); - } - } - } else { - if (key2 in frontmatter || forceSave) { - frontmatter[key2] = valueForFrontmatter(type, value); - } - } - }); - } - } - } -}; - -// src/utils/metadata/frontmatter/parseFrontMatter.ts -var parseFrontMatter = (field, value) => { - const YAMLtype = detectYAMLType(value, field); - switch (YAMLtype) { - case "object": - return JSON.stringify(value); - break; - case "number": - return value.toString(); - break; - case "boolean": - return value ? "true" : "false"; - break; - case "date": - return value; - break; - case "duration": - return serializeMultiDisplayString(Object.keys(value.values).reduce( - (p3, c4) => [ - ...p3, - ...value.values[c4] > 0 ? [value.values[c4] + " " + c4] : [] - ], - [] - )); - break; - case "option-multi": - case "link-multi": - if (typeof value === "string") { - return parseLinkString(value); - } - return serializeMultiString( - value.map((v3) => { - if (!v3) { - return ""; - } - if (typeof v3 === "string") { - return parseLinkString(v3); - } - if (v3.path) { - return v3.path; - } - if (Array.isArray(value) && v3.length == 1 && Array.isArray(v3[0]) && v3[0].length == 1 && typeof v3[0][0] === "string") { - return v3[0][0]; - } - return JSON.stringify(v3); - }) - ); - break; - case "link": - { - if (Array.isArray(value) && value.length == 1 && Array.isArray(value[0]) && value[0].length == 1 && typeof value[0][0] === "string") { - return value[0][0]; - } else if (typeof value === "string") { - return parseLinkString(value); - } - return value.path; - } - break; - case "text": - case "tag": - case "image": - return value; - break; - } - return ""; -}; - -// src/utils/contexts/predicate/predicate.tsx -var defaultPredicateFnForType = (type, types2) => { - const fnType = Object.keys(types2).find( - (f4) => types2[f4].type.find((g4) => g4 == type) - ); - return fnType; -}; -var predicateFnsForType = (type, types2) => { - const fnTypes = Object.keys(types2).filter( - (f4) => types2[f4].type.find((g4) => g4 == type) - ); - return fnTypes; -}; -var cleanPredicateType = (type, definedTypes) => { - return type.filter((f4) => Object.keys(definedTypes).find((g4) => g4 == f4.fn)); -}; -var validatePredicate = (prevPredicate) => { - if (!prevPredicate) { - return defaultPredicate; - } - return { - ...defaultPredicate, - view: prevPredicate.view, - frame: prevPredicate.frame, - frameProps: prevPredicate.frameProps, - filters: Array.isArray(prevPredicate.filters) ? cleanPredicateType(prevPredicate.filters, filterFnTypes) : [], - sort: Array.isArray(prevPredicate.sort) ? cleanPredicateType(prevPredicate.sort, sortFnTypes) : [], - groupBy: Array.isArray(prevPredicate.groupBy) ? prevPredicate.groupBy : [], - colsOrder: Array.isArray(prevPredicate.colsOrder) ? prevPredicate.colsOrder : [], - colsHidden: Array.isArray(prevPredicate.colsHidden) ? prevPredicate.colsHidden : [], - colsSize: prevPredicate.colsSize - }; -}; -var defaultPredicate = { - view: "list", - filters: [], - frame: "", - frameProps: {}, - sort: [], - groupBy: [], - colsOrder: [], - colsHidden: [], - colsSize: {} -}; -var defaultTablePredicate = { - view: "table", - filters: [], - frame: "", - frameProps: {}, - sort: [], - groupBy: [], - colsOrder: [], - colsHidden: [], - colsSize: {} -}; - -// src/context/ContextMDBContext.tsx -var import_lodash3 = __toESM(require_lodash()); -var import_obsidian13 = require("obsidian"); -var ContextMDBContext = F({ - dbSchemas: [], - tableData: null, - contextTable: {}, - setContextTable: () => null, - saveDB: () => null, - saveContextDB: () => null, - dbSchema: null, - setDBSchema: () => null, - saveSchema: () => null, - deleteSchema: () => null, - dbFileExists: false -}); -var ContextMDBProvider = (props2) => { - var _a2, _b2; - const [dbFileExists, setDBFileExists] = h2(false); - const [schemaTable, setSchemaTable] = h2(null); - const schemas = (_a2 = schemaTable == null ? void 0 : schemaTable.rows) != null ? _a2 : []; - const [tableData, setTableData] = h2(null); - const [dbSchema, setDBSchema] = h2(null); - const [contextTable, setContextTable] = h2({}); - const [metadataCache, setMetadataCache] = h2(null); - const defaultSchema = defaultFolderSchema; - const { spaceInfo, readMode, spaceCache } = q2(SpaceContext); - const contexts = (_b2 = spaceCache == null ? void 0 : spaceCache.contexts) != null ? _b2 : []; - const deleteSchema = async (table) => { - if (table.primary) - return; - const deleteResult = await deleteMDBTable( - props2.plugin, - spaceInfo, - table.id, - spaceInfo.dbPath - ); - if (deleteResult) { - const newSchemaTable = { - ...schemaTable, - rows: schemaTable.rows.filter( - (f4) => f4.id != table.id && f4.def != table.id - ) - }; - setSchemaTable(newSchemaTable); - if (dbSchema.id == table.id) { - setDBSchema( - newSchemaTable.rows.find((g4) => g4.type == "db") - ); - } - } - }; - const saveSchema = async (table) => { - const newSchema = schemaTable.rows.find((f4) => f4.id == table.id) ? true : false; - const newSchemaTable = newSchema ? { - ...schemaTable, - rows: schemaTable.rows.map((f4) => f4.id == table.id ? table : f4) - } : { - ...schemaTable, - rows: [...schemaTable.rows, table] - }; - if (!spaceInfo.readOnly) { - await saveSpaceDBToPath(props2.plugin, spaceInfo, "context", { - m_schema: newSchemaTable - }); - } - if (table.id == (dbSchema == null ? void 0 : dbSchema.id)) { - setDBSchema(table); - setTableData((f4) => ({ - ...f4, - schema: table - })); - } - setSchemaTable(newSchemaTable); - }; - p2(() => { - var _a3, _b3; - if (schemaTable) { - if (props2.schema) { - const preselectSchema = schemaTable.rows.find( - (g4) => g4.id == props2.schema - ); - if (preselectSchema) { - if (preselectSchema.type == "db") { - setDBSchema(preselectSchema); - return; - } else { - const preselectDBSchema = schemaTable.rows.find( - (g4) => g4.id == preselectSchema.def - ); - if (preselectDBSchema) { - setDBSchema(preselectDBSchema); - return; - } - } - } else { - const newSchema = { - id: uniqueNameFromString( - sanitizeTableName(props2.schema), - schemaTable.rows.map((g4) => g4.id) - ), - name: props2.schema, - type: "db" - }; - setDBSchema(newSchema); - saveSchema(newSchema).then(() => { - saveDB2({ - schema: newSchema, - cols: defaultTableFields.map((g4) => ({ - ...g4, - schemaId: newSchema.id - })), - rows: [] - }); - }); - } - } else { - if (!dbSchema) { - setDBSchema( - (_a3 = schemaTable.rows) == null ? void 0 : _a3.find((g4) => g4.id == "files") - ); - } else { - setDBSchema( - (_b3 = schemaTable.rows) == null ? void 0 : _b3.find((g4) => g4.id == dbSchema.id) - ); - } - } - } - }, [schemaTable]); - const loadTables = async () => { - if (!spaceInfo) - return; - const spaceExists = await props2.plugin.app.vault.adapter.exists( - spaceInfo.dbPath - ); - if (spaceExists || spaceInfo.isRemote) { - setDBFileExists(true); - getMDBTableSchemas(props2.plugin, spaceInfo, "context").then((f4) => { - if (f4) - setSchemaTable(() => ({ - ...defaultSchema, - rows: f4 - })); - }); - } else { - setDBFileExists(false); - if (props2.schema) { - const tableData2 = defaultTableDataForContext(props2.plugin, spaceInfo); - if (tableData2) { - setSchemaTable(defaultSchema); - } - } else { - setSchemaTable(defaultSchema); - setDBSchema(defaultFileDBSchema); - } - } - }; - const refreshFile = T2(async (file) => { - var _a3; - if (file.path == props2.file && dbSchema) { - const fCache = (_a3 = props2.plugin.app.metadataCache.getCache( - file.path - )) == null ? void 0 : _a3.frontmatter; - if ((0, import_lodash3.isEqual)(fCache, metadataCache)) - return; - setMetadataCache(fCache); - if (dbSchema.primary) { - runDef(); - } else { - getMDBData(); - } - } - }, []); - const loadContextFields = T2(async (tag) => { - getMDBTable( - props2.plugin, - spaceFromTag(props2.plugin, tag), - "files", - "context" - ).then((f4) => { - setContextTable((t4) => ({ - ...t4, - [tag]: f4 - })); - }); - }, []); - const refreshTags = async (tags) => { - if (contexts.some((f4) => tags.some((g4) => g4 == f4))) - if (dbSchema.primary) { - runDef(); - } else { - getMDBData(); - } - }; - const refreshMDB = T2( - async (contextPath) => { - if ((dbSchema == null ? void 0 : dbSchema.primary) != "true") { - return; - } - if (contextPath == spaceInfo.path) { - if (dbSchema) { - loadTables(); - } - } else { - const tag = Object.keys(contextTable).find( - (t4) => spaceFromTag(props2.plugin, t4).path == contextPath - ); - if (tag) - loadContextFields(tag); - } + { n: ["arrow backward", "black left-pointing triangle"], u: "25c0-fe0f" }, + { n: ["rewind", "black left-pointing double triangle"], u: "23ea" }, + { + n: [ + "last track button", + "black left pointing double triangle with vertical bar" + ], + u: "23ee-fe0f" + }, + { n: ["arrow up small", "up-pointing small red triangle"], u: "1f53c" }, + { n: ["arrow double up", "black up-pointing double triangle"], u: "23eb" }, + { n: ["arrow down small", "down-pointing small red triangle"], u: "1f53d" }, + { + n: ["arrow double down", "black down-pointing double triangle"], + u: "23ec" + }, + { n: ["pause button", "double vertical bar"], u: "23f8-fe0f" }, + { n: ["stop button", "black square for stop"], u: "23f9-fe0f" }, + { n: ["record button", "black circle for record"], u: "23fa-fe0f" }, + { n: ["eject", "eject button"], u: "23cf-fe0f" }, + { n: ["cinema"], u: "1f3a6" }, + { n: ["low brightness", "low brightness symbol"], u: "1f505" }, + { n: ["high brightness", "high brightness symbol"], u: "1f506" }, + { n: ["signal strength", "antenna with bars"], u: "1f4f6" }, + { n: ["vibration mode"], u: "1f4f3" }, + { n: ["mobile phone off"], u: "1f4f4" }, + { n: ["female sign"], u: "2640-fe0f" }, + { n: ["male sign"], u: "2642-fe0f" }, + { n: ["transgender symbol"], u: "26a7-fe0f" }, + { n: ["heavy multiplication x"], u: "2716-fe0f" }, + { n: ["heavy plus sign"], u: "2795" }, + { n: ["heavy minus sign"], u: "2796" }, + { n: ["heavy division sign"], u: "2797" }, + { n: ["heavy equals sign"], u: "1f7f0" }, + { n: ["infinity"], u: "267e-fe0f" }, + { n: ["bangbang", "double exclamation mark"], u: "203c-fe0f" }, + { n: ["interrobang", "exclamation question mark"], u: "2049-fe0f" }, + { n: ["question", "black question mark ornament"], u: "2753" }, + { n: ["grey question", "white question mark ornament"], u: "2754" }, + { n: ["grey exclamation", "white exclamation mark ornament"], u: "2755" }, + { + n: [ + "exclamation", + "heavy exclamation mark", + "heavy exclamation mark symbol" + ], + u: "2757" + }, + { n: ["wavy dash"], u: "3030-fe0f" }, + { n: ["currency exchange"], u: "1f4b1" }, + { n: ["heavy dollar sign"], u: "1f4b2" }, + { n: ["medical symbol", "staff of aesculapius"], u: "2695-fe0f" }, + { n: ["recycle", "black universal recycling symbol"], u: "267b-fe0f" }, + { n: ["fleur-de-lis", "fleur de lis"], u: "269c-fe0f" }, + { n: ["trident", "trident emblem"], u: "1f531" }, + { n: ["name badge"], u: "1f4db" }, + { n: ["beginner", "japanese symbol for beginner"], u: "1f530" }, + { n: ["o", "heavy large circle"], u: "2b55" }, + { n: ["white check mark", "white heavy check mark"], u: "2705" }, + { n: ["ballot box with check"], u: "2611-fe0f" }, + { n: ["heavy check mark"], u: "2714-fe0f" }, + { n: ["x", "cross mark"], u: "274c" }, + { n: ["negative squared cross mark"], u: "274e" }, + { n: ["curly loop"], u: "27b0" }, + { n: ["loop", "double curly loop"], u: "27bf" }, + { n: ["part alternation mark"], u: "303d-fe0f" }, + { n: ["eight spoked asterisk"], u: "2733-fe0f" }, + { n: ["eight pointed black star"], u: "2734-fe0f" }, + { n: ["sparkle"], u: "2747-fe0f" }, + { n: ["copyright", "copyright sign"], u: "00a9-fe0f" }, + { n: ["registered", "registered sign"], u: "00ae-fe0f" }, + { n: ["tm", "trade mark sign"], u: "2122-fe0f" }, + { n: ["hash", "hash key"], u: "0023-fe0f-20e3" }, + { n: ["keycap: *", "keycap star"], u: "002a-fe0f-20e3" }, + { n: ["zero", "keycap 0"], u: "0030-fe0f-20e3" }, + { n: ["one", "keycap 1"], u: "0031-fe0f-20e3" }, + { n: ["two", "keycap 2"], u: "0032-fe0f-20e3" }, + { n: ["three", "keycap 3"], u: "0033-fe0f-20e3" }, + { n: ["four", "keycap 4"], u: "0034-fe0f-20e3" }, + { n: ["five", "keycap 5"], u: "0035-fe0f-20e3" }, + { n: ["six", "keycap 6"], u: "0036-fe0f-20e3" }, + { n: ["seven", "keycap 7"], u: "0037-fe0f-20e3" }, + { n: ["eight", "keycap 8"], u: "0038-fe0f-20e3" }, + { n: ["nine", "keycap 9"], u: "0039-fe0f-20e3" }, + { n: ["keycap ten"], u: "1f51f" }, + { + n: ["capital abcd", "input symbol for latin capital letters"], + u: "1f520" }, - [ - contextTable, - dbFileExists, - dbSchema, - loadContextFields, - loadTables, - props2.plugin, - spaceInfo - ] - ); - const refreshSpace = T2( - async (evt) => { - if (evt.detail.type == "context") { - refreshMDB(evt.detail.name); - return; - } - if (evt.detail.type == "file") { - refreshFile(getAbstractFileAtPath(props2.plugin, evt.detail.name)); - return; - } - if ((evt.detail.type == "space" || evt.detail.type == "vault") && !dbFileExists) { - const defaultTable = defaultTableDataForContext( - props2.plugin, - spaceInfo - ); - if (defaultTable) - setTableData(defaultTable); - } else if (evt.detail.type == "vault") { - refreshMDB(spaceInfo.path); - } + { n: ["abcd", "input symbol for latin small letters"], u: "1f521" }, + { n: ["1234", "input symbol for numbers"], u: "1f522" }, + { n: ["symbols", "input symbol for symbols"], u: "1f523" }, + { n: ["abc", "input symbol for latin letters"], u: "1f524" }, + { n: ["a", "negative squared latin capital letter a"], u: "1f170-fe0f" }, + { n: ["ab", "negative squared ab"], u: "1f18e" }, + { n: ["b", "negative squared latin capital letter b"], u: "1f171-fe0f" }, + { n: ["cl", "squared cl"], u: "1f191" }, + { n: ["cool", "squared cool"], u: "1f192" }, + { n: ["free", "squared free"], u: "1f193" }, + { n: ["information source"], u: "2139-fe0f" }, + { n: ["id", "squared id"], u: "1f194" }, + { n: ["m", "circled latin capital letter m"], u: "24c2-fe0f" }, + { n: ["new", "squared new"], u: "1f195" }, + { n: ["ng", "squared ng"], u: "1f196" }, + { n: ["o2", "negative squared latin capital letter o"], u: "1f17e-fe0f" }, + { n: ["ok", "squared ok"], u: "1f197" }, + { + n: ["parking", "negative squared latin capital letter p"], + u: "1f17f-fe0f" }, - [dbFileExists, props2.plugin, refreshFile, refreshMDB, spaceInfo] - ); - const getMDBData = () => { - getMDBTable(props2.plugin, spaceInfo, dbSchema.id, "context").then((f4) => { - setTableData(f4); - }); - }; - p2(() => { - window.addEventListener(eventTypes.spacesChange, refreshSpace); - return () => { - window.removeEventListener(eventTypes.spacesChange, refreshSpace); - }; - }, [refreshSpace]); - p2(() => { - loadTables(); - }, [spaceInfo]); - const saveDB2 = async (newTable) => { - var _a3, _b3; - if (spaceInfo.readOnly) - return; - if (!dbFileExists) { - const defaultFields = defaultFieldsForContext(spaceInfo); - const defaultTable = defaultTablesForContext(spaceInfo); - const dbField = { - ...defaultTable, - m_fields: { - uniques: defaultFields.uniques, - cols: defaultFields.cols, - rows: [...(_a3 = defaultFields.rows) != null ? _a3 : [], ...(_b3 = newTable == null ? void 0 : newTable.cols) != null ? _b3 : []] - }, - [newTable.schema.id]: { - uniques: newTable.cols.filter((c4) => c4.unique == "true").map((c4) => c4.name), - cols: newTable.cols.map((c4) => c4.name), - rows: newTable.rows - } - }; - await saveSpaceDBToPath(props2.plugin, spaceInfo, "context", dbField).then( - (f4) => { - setDBFileExists(true); - f4 ? setTableData(newTable) : new import_obsidian13.Notice("DB ERROR"); - } - ); - } else { - await saveMDBToPath(props2.plugin, spaceInfo, newTable).then((f4) => { - f4 ? setTableData(newTable) : new import_obsidian13.Notice("DB ERROR"); - }); - } - }; - p2(() => { - if (!schemaTable || !dbSchema) - return; - if (dbFileExists) { - if (dbSchema.primary) { - runDef(); - } else { - getMDBData(); - } - } else { - const defaultTable = defaultTableDataForContext(props2.plugin, spaceInfo); - if (defaultTable) - setTableData(defaultTable); - } - }, [dbSchema]); - p2(() => { - if (dbFileExists && tableData) - getContextTags(tableData); - }, [tableData]); - const getContextTags = async (_tableData) => { - const contextFields = _tableData.cols.filter((f4) => f4.type.contains("context")).map((f4) => f4.value).filter((f4) => !contexts.some((g4) => g4 == f4)); - for (const c4 of contextFields) { - loadContextFields(c4); - } - }; - const runDef = async () => { - if (spaceInfo.uri.type == "folder") { - getMDBTable(props2.plugin, spaceInfo, "files", "context").then((f4) => { - if (f4) { - for (const c4 of contexts) { - loadTagContext(c4, f4.rows); - } - setTableData(f4); - } - return f4; - }); - } else if (spaceInfo.uri.type == "tag") { - getMDBTable(props2.plugin, spaceInfo, "files", "context").then((f4) => { - if (f4) { - for (const c4 of contexts) { - loadTagContext(c4, f4.rows); - } - setTableData(f4); - } - return f4; - }); - } else if (spaceInfo.uri.type == "space") { - getMDBTable(props2.plugin, spaceInfo, "files", "context").then((f4) => { - if (f4) - setTableData(f4); - return f4; - }); - } else { - getMDBTable(props2.plugin, spaceInfo, dbSchema.id, "context").then((f4) => { - if (f4) - setTableData(f4); - }); - } - }; - const loadTagContext = async (tag, files) => { - getMDBTable( - props2.plugin, - spaceFromTag(props2.plugin, tag), - "files", - "context" - ).then((f4) => { - if (f4) { - const contextFields = f4.cols.filter((g4) => g4.type.contains("context")).map((g4) => g4.value).filter((g4) => !contexts.some((h5) => h5 == g4)); - for (const c4 of contextFields) { - loadContextFields(c4); - } - setContextTable((t4) => ({ - ...t4, - [tag]: f4 - })); - } - }); - }; - const saveContextDB = async (newTable, tag) => { - const context = spaceFromTag(props2.plugin, tag); - await saveMDBToPath(props2.plugin, context, newTable).then( - (f4) => f4 && setContextTable((t4) => ({ - ...t4, - [tag]: newTable - })) - ); - }; - return /* @__PURE__ */ Cn.createElement(ContextMDBContext.Provider, { - value: { - tableData, - contextTable, - setContextTable, - saveDB: saveDB2, - saveContextDB, - dbSchemas: schemas, - saveSchema, - deleteSchema, - dbFileExists, - dbSchema, - setDBSchema - } - }, props2.children); -}; - -// src/context/ContextEditorContext.tsx -var ContextEditorContext = F({ - cols: [], - data: [], - schema: null, - views: [], - setSchema: () => null, - sortedColumns: [], - filteredData: [], - contextTable: {}, - selectedRows: [], - selectRows: () => null, - setContextTable: () => null, - predicate: defaultPredicate, - savePredicate: () => null, - saveContextDB: () => null, - hideColumn: () => null, - saveColumn: () => false, - newColumn: () => false, - sortColumn: () => null, - delColumn: () => null, - searchString: "", - setSearchString: () => null, - loadContextFields: () => null, - updateValue: () => null, - updateFieldValue: () => null -}); -var ContextEditorProvider = (props2) => { - var _a2; - const { spaceInfo, spaceCache } = q2(SpaceContext); - const contexts = (_a2 = spaceCache == null ? void 0 : spaceCache.contexts) != null ? _a2 : []; - const { dbFileExists, dbSchema, saveDB: saveDB2, tableData } = q2(ContextMDBContext); - const { frameSchemas, saveSchema } = q2(FramesMDBContext); - const [schema, setSchema] = h2(defaultFileListSchema); - const [searchString, setSearchString] = h2(null); - const [contextTable, setContextTable] = h2({}); - const [predicate, setPredicate] = h2(defaultPredicate); - const [selectedRows, setSelectedRows] = h2([]); - const views = F2(() => { - const _views = frameSchemas.filter( - (f4) => f4.type == "view" && f4.def.db == (dbSchema == null ? void 0 : dbSchema.id) - ); - return _views.length > 0 ? _views : schema ? [schema] : []; - }, [frameSchemas, schema]); - const getSchema = (_schemaTable, _dbSchema, _currentSchema) => { - var _a3, _b2; - let _schema; - if (props2.schema) { - _schema = _schemaTable.find((f4) => f4.id == props2.schema); - } else { - _schema = ((_a3 = _currentSchema == null ? void 0 : _currentSchema.def) == null ? void 0 : _a3.db) == _dbSchema.id ? _schemaTable.find((f4) => f4.id == _currentSchema.id) : (_b2 = _schemaTable.find((f4) => { - var _a4; - return ((_a4 = f4.def) == null ? void 0 : _a4.db) == _dbSchema.id; - })) != null ? _b2 : { - ..._dbSchema, - id: uniqueNameFromString( - _dbSchema.id + "View", - _schemaTable.map((f4) => f4.id) - ), - type: "view", - def: { db: _dbSchema.id }, - predicate: JSON.stringify( - _dbSchema.primary == "true" ? defaultPredicate : defaultTablePredicate - ) - }; - } - return _schema; - }; - p2(() => { - if (!dbSchema) - return; - const _schema = getSchema(frameSchemas, dbSchema, schema); - if (_schema) { - setSchema(_schema); - } - }, [dbSchema, frameSchemas, props2.schema]); - const cols = F2( - () => { - var _a3; - return tableData ? [ - ...(_a3 = tableData.cols.map((f4) => ({ ...f4, table: "" }))) != null ? _a3 : [], - ...(dbSchema == null ? void 0 : dbSchema.primary) == "true" ? contexts.reduce( - (p3, c4) => { - var _a4, _b2; - return [ - ...p3, - ...(_b2 = (_a4 = contextTable[c4]) == null ? void 0 : _a4.cols.filter( - (f4) => f4.name != FilePropertyName && f4.type != "fileprop" - ).map((f4) => ({ ...f4, table: c4 }))) != null ? _b2 : [] - ]; - }, - [] - ) : [] - ] : []; + { n: ["sos", "squared sos"], u: "1f198" }, + { n: ["up", "squared up with exclamation mark"], u: "1f199" }, + { n: ["vs", "squared vs"], u: "1f19a" }, + { n: ["koko", "squared katakana koko"], u: "1f201" }, + { n: ["sa", "squared katakana sa"], u: "1f202-fe0f" }, + { n: ["u6708", "squared cjk unified ideograph-6708"], u: "1f237-fe0f" }, + { n: ["u6709", "squared cjk unified ideograph-6709"], u: "1f236" }, + { n: ["u6307", "squared cjk unified ideograph-6307"], u: "1f22f" }, + { n: ["ideograph advantage", "circled ideograph advantage"], u: "1f250" }, + { n: ["u5272", "squared cjk unified ideograph-5272"], u: "1f239" }, + { n: ["u7121", "squared cjk unified ideograph-7121"], u: "1f21a" }, + { n: ["u7981", "squared cjk unified ideograph-7981"], u: "1f232" }, + { n: ["accept", "circled ideograph accept"], u: "1f251" }, + { n: ["u7533", "squared cjk unified ideograph-7533"], u: "1f238" }, + { n: ["u5408", "squared cjk unified ideograph-5408"], u: "1f234" }, + { n: ["u7a7a", "squared cjk unified ideograph-7a7a"], u: "1f233" }, + { + n: ["congratulations", "circled ideograph congratulation"], + u: "3297-fe0f" }, - [tableData, contextTable, contexts] - ); - const data2 = F2( - () => { - var _a3; - return (_a3 = tableData == null ? void 0 : tableData.rows.map( - (r3, index) => linkContextRow( - props2.plugin, - { - _index: index.toString(), - ...r3, - ...contexts.reduce((p3, c4) => { - var _a4, _b2, _c2, _d2; - const contextRowIndexByFile = (_b2 = (_a4 = contextTable[c4]) == null ? void 0 : _a4.rows.findIndex((f4) => f4.File == r3.File)) != null ? _b2 : -1; - const contextRowsByFile = (_d2 = (_c2 = contextTable[c4]) == null ? void 0 : _c2.rows[contextRowIndexByFile]) != null ? _d2 : {}; - const contextRowsWithKeysAppended = Object.keys( - contextRowsByFile - ).reduce( - (pa, ca) => ({ ...pa, [ca + c4]: contextRowsByFile[ca] }), - { - ["_index" + c4]: contextRowIndexByFile.toString() - } - ); - return { ...p3, ...contextRowsWithKeysAppended }; - }, {}) - }, - cols - ) - )) != null ? _a3 : []; + { n: ["secret", "circled ideograph secret"], u: "3299-fe0f" }, + { n: ["u55b6", "squared cjk unified ideograph-55b6"], u: "1f23a" }, + { n: ["u6e80", "squared cjk unified ideograph-6e80"], u: "1f235" }, + { n: ["red circle", "large red circle"], u: "1f534" }, + { n: ["large orange circle"], u: "1f7e0" }, + { n: ["large yellow circle"], u: "1f7e1" }, + { n: ["large green circle"], u: "1f7e2" }, + { n: ["large blue circle"], u: "1f535" }, + { n: ["large purple circle"], u: "1f7e3" }, + { n: ["large brown circle"], u: "1f7e4" }, + { n: ["black circle", "medium black circle"], u: "26ab" }, + { n: ["white circle", "medium white circle"], u: "26aa" }, + { n: ["large red square"], u: "1f7e5" }, + { n: ["large orange square"], u: "1f7e7" }, + { n: ["large yellow square"], u: "1f7e8" }, + { n: ["large green square"], u: "1f7e9" }, + { n: ["large blue square"], u: "1f7e6" }, + { n: ["large purple square"], u: "1f7ea" }, + { n: ["large brown square"], u: "1f7eb" }, + { n: ["black large square"], u: "2b1b" }, + { n: ["white large square"], u: "2b1c" }, + { n: ["black medium square"], u: "25fc-fe0f" }, + { n: ["white medium square"], u: "25fb-fe0f" }, + { n: ["black medium small square"], u: "25fe" }, + { n: ["white medium small square"], u: "25fd" }, + { n: ["black small square"], u: "25aa-fe0f" }, + { n: ["white small square"], u: "25ab-fe0f" }, + { n: ["large orange diamond"], u: "1f536" }, + { n: ["large blue diamond"], u: "1f537" }, + { n: ["small orange diamond"], u: "1f538" }, + { n: ["small blue diamond"], u: "1f539" }, + { n: ["small red triangle", "up-pointing red triangle"], u: "1f53a" }, + { + n: ["small red triangle down", "down-pointing red triangle"], + u: "1f53b" + }, + { n: ["diamond shape with a dot inside"], u: "1f4a0" }, + { n: ["radio button"], u: "1f518" }, + { n: ["white square button"], u: "1f533" }, + { n: ["black square button"], u: "1f532" } + ], + flags: [ + { n: ["chequered flag", "checkered flag"], u: "1f3c1" }, + { n: ["triangular flag on post"], u: "1f6a9" }, + { n: ["crossed flags"], u: "1f38c" }, + { n: ["waving black flag"], u: "1f3f4" }, + { n: ["white flag", "waving white flag"], u: "1f3f3-fe0f" }, + { n: ["rainbow flag", "rainbow-flag"], u: "1f3f3-fe0f-200d-1f308" }, + { n: ["transgender flag"], u: "1f3f3-fe0f-200d-26a7-fe0f" }, + { n: ["pirate flag"], u: "1f3f4-200d-2620-fe0f" }, + { n: ["flag-ac", "ascension island flag"], u: "1f1e6-1f1e8" }, + { n: ["flag-ad", "andorra flag"], u: "1f1e6-1f1e9" }, + { n: ["flag-ae", "united arab emirates flag"], u: "1f1e6-1f1ea" }, + { n: ["flag-af", "afghanistan flag"], u: "1f1e6-1f1eb" }, + { n: ["flag-ag", "antigua & barbuda flag"], u: "1f1e6-1f1ec" }, + { n: ["flag-ai", "anguilla flag"], u: "1f1e6-1f1ee" }, + { n: ["flag-al", "albania flag"], u: "1f1e6-1f1f1" }, + { n: ["flag-am", "armenia flag"], u: "1f1e6-1f1f2" }, + { n: ["flag-ao", "angola flag"], u: "1f1e6-1f1f4" }, + { n: ["flag-aq", "antarctica flag"], u: "1f1e6-1f1f6" }, + { n: ["flag-ar", "argentina flag"], u: "1f1e6-1f1f7" }, + { n: ["flag-as", "american samoa flag"], u: "1f1e6-1f1f8" }, + { n: ["flag-at", "austria flag"], u: "1f1e6-1f1f9" }, + { n: ["flag-au", "australia flag"], u: "1f1e6-1f1fa" }, + { n: ["flag-aw", "aruba flag"], u: "1f1e6-1f1fc" }, + { n: ["flag-ax", "\xE5land islands flag"], u: "1f1e6-1f1fd" }, + { n: ["flag-az", "azerbaijan flag"], u: "1f1e6-1f1ff" }, + { n: ["flag-ba", "bosnia & herzegovina flag"], u: "1f1e7-1f1e6" }, + { n: ["flag-bb", "barbados flag"], u: "1f1e7-1f1e7" }, + { n: ["flag-bd", "bangladesh flag"], u: "1f1e7-1f1e9" }, + { n: ["flag-be", "belgium flag"], u: "1f1e7-1f1ea" }, + { n: ["flag-bf", "burkina faso flag"], u: "1f1e7-1f1eb" }, + { n: ["flag-bg", "bulgaria flag"], u: "1f1e7-1f1ec" }, + { n: ["flag-bh", "bahrain flag"], u: "1f1e7-1f1ed" }, + { n: ["flag-bi", "burundi flag"], u: "1f1e7-1f1ee" }, + { n: ["flag-bj", "benin flag"], u: "1f1e7-1f1ef" }, + { n: ["flag-bl", "st. barth\xE9lemy flag"], u: "1f1e7-1f1f1" }, + { n: ["flag-bm", "bermuda flag"], u: "1f1e7-1f1f2" }, + { n: ["flag-bn", "brunei flag"], u: "1f1e7-1f1f3" }, + { n: ["flag-bo", "bolivia flag"], u: "1f1e7-1f1f4" }, + { n: ["flag-bq", "caribbean netherlands flag"], u: "1f1e7-1f1f6" }, + { n: ["flag-br", "brazil flag"], u: "1f1e7-1f1f7" }, + { n: ["flag-bs", "bahamas flag"], u: "1f1e7-1f1f8" }, + { n: ["flag-bt", "bhutan flag"], u: "1f1e7-1f1f9" }, + { n: ["flag-bv", "bouvet island flag"], u: "1f1e7-1f1fb" }, + { n: ["flag-bw", "botswana flag"], u: "1f1e7-1f1fc" }, + { n: ["flag-by", "belarus flag"], u: "1f1e7-1f1fe" }, + { n: ["flag-bz", "belize flag"], u: "1f1e7-1f1ff" }, + { n: ["flag-ca", "canada flag"], u: "1f1e8-1f1e6" }, + { n: ["flag-cc", "cocos (keeling) islands flag"], u: "1f1e8-1f1e8" }, + { n: ["flag-cd", "congo - kinshasa flag"], u: "1f1e8-1f1e9" }, + { n: ["flag-cf", "central african republic flag"], u: "1f1e8-1f1eb" }, + { n: ["flag-cg", "congo - brazzaville flag"], u: "1f1e8-1f1ec" }, + { n: ["flag-ch", "switzerland flag"], u: "1f1e8-1f1ed" }, + { n: ["flag-ci", "c\xF4te d\u2019ivoire flag"], u: "1f1e8-1f1ee" }, + { n: ["flag-ck", "cook islands flag"], u: "1f1e8-1f1f0" }, + { n: ["flag-cl", "chile flag"], u: "1f1e8-1f1f1" }, + { n: ["flag-cm", "cameroon flag"], u: "1f1e8-1f1f2" }, + { n: ["cn", "flag-cn", "china flag"], u: "1f1e8-1f1f3" }, + { n: ["flag-co", "colombia flag"], u: "1f1e8-1f1f4" }, + { n: ["flag-cp", "clipperton island flag"], u: "1f1e8-1f1f5" }, + { n: ["flag-cr", "costa rica flag"], u: "1f1e8-1f1f7" }, + { n: ["flag-cu", "cuba flag"], u: "1f1e8-1f1fa" }, + { n: ["flag-cv", "cape verde flag"], u: "1f1e8-1f1fb" }, + { n: ["flag-cw", "cura\xE7ao flag"], u: "1f1e8-1f1fc" }, + { n: ["flag-cx", "christmas island flag"], u: "1f1e8-1f1fd" }, + { n: ["flag-cy", "cyprus flag"], u: "1f1e8-1f1fe" }, + { n: ["flag-cz", "czechia flag"], u: "1f1e8-1f1ff" }, + { n: ["de", "flag-de", "germany flag"], u: "1f1e9-1f1ea" }, + { n: ["flag-dg", "diego garcia flag"], u: "1f1e9-1f1ec" }, + { n: ["flag-dj", "djibouti flag"], u: "1f1e9-1f1ef" }, + { n: ["flag-dk", "denmark flag"], u: "1f1e9-1f1f0" }, + { n: ["flag-dm", "dominica flag"], u: "1f1e9-1f1f2" }, + { n: ["flag-do", "dominican republic flag"], u: "1f1e9-1f1f4" }, + { n: ["flag-dz", "algeria flag"], u: "1f1e9-1f1ff" }, + { n: ["flag-ea", "ceuta & melilla flag"], u: "1f1ea-1f1e6" }, + { n: ["flag-ec", "ecuador flag"], u: "1f1ea-1f1e8" }, + { n: ["flag-ee", "estonia flag"], u: "1f1ea-1f1ea" }, + { n: ["flag-eg", "egypt flag"], u: "1f1ea-1f1ec" }, + { n: ["flag-eh", "western sahara flag"], u: "1f1ea-1f1ed" }, + { n: ["flag-er", "eritrea flag"], u: "1f1ea-1f1f7" }, + { n: ["es", "flag-es", "spain flag"], u: "1f1ea-1f1f8" }, + { n: ["flag-et", "ethiopia flag"], u: "1f1ea-1f1f9" }, + { n: ["flag-eu", "european union flag"], u: "1f1ea-1f1fa" }, + { n: ["flag-fi", "finland flag"], u: "1f1eb-1f1ee" }, + { n: ["flag-fj", "fiji flag"], u: "1f1eb-1f1ef" }, + { n: ["flag-fk", "falkland islands flag"], u: "1f1eb-1f1f0" }, + { n: ["flag-fm", "micronesia flag"], u: "1f1eb-1f1f2" }, + { n: ["flag-fo", "faroe islands flag"], u: "1f1eb-1f1f4" }, + { n: ["fr", "flag-fr", "france flag"], u: "1f1eb-1f1f7" }, + { n: ["flag-ga", "gabon flag"], u: "1f1ec-1f1e6" }, + { n: ["gb", "uk", "flag-gb", "united kingdom flag"], u: "1f1ec-1f1e7" }, + { n: ["flag-gd", "grenada flag"], u: "1f1ec-1f1e9" }, + { n: ["flag-ge", "georgia flag"], u: "1f1ec-1f1ea" }, + { n: ["flag-gf", "french guiana flag"], u: "1f1ec-1f1eb" }, + { n: ["flag-gg", "guernsey flag"], u: "1f1ec-1f1ec" }, + { n: ["flag-gh", "ghana flag"], u: "1f1ec-1f1ed" }, + { n: ["flag-gi", "gibraltar flag"], u: "1f1ec-1f1ee" }, + { n: ["flag-gl", "greenland flag"], u: "1f1ec-1f1f1" }, + { n: ["flag-gm", "gambia flag"], u: "1f1ec-1f1f2" }, + { n: ["flag-gn", "guinea flag"], u: "1f1ec-1f1f3" }, + { n: ["flag-gp", "guadeloupe flag"], u: "1f1ec-1f1f5" }, + { n: ["flag-gq", "equatorial guinea flag"], u: "1f1ec-1f1f6" }, + { n: ["flag-gr", "greece flag"], u: "1f1ec-1f1f7" }, + { + n: ["flag-gs", "south georgia & south sandwich islands flag"], + u: "1f1ec-1f1f8" }, - [tableData, schema, contextTable] - ); - const sortedColumns = F2(() => { - return cols.filter( - (f4) => f4.hidden != "true" && !predicate.colsHidden.some((c4) => c4 == f4.name + f4.table) - ).sort( - (a5, b4) => predicate.colsOrder.findIndex((x5) => x5 == a5.name + a5.table) - predicate.colsOrder.findIndex((x5) => x5 == b4.name + b4.table) - ); - }, [cols, predicate]); - const filteredData = F2( - () => data2.filter((f4) => { - return predicate.filters.reduce((p3, c4) => { - return p3 ? filterReturnForCol( - cols.find((col) => col.name + col.table == c4.field), - c4, - f4 - ) : p3; - }, true); - }).filter( - (f4) => (searchString == null ? void 0 : searchString.length) > 0 ? matchAny(searchString).test( - Object.keys(f4).filter((g4) => g4.charAt(0) != "_").map((g4) => f4[g4]).join("|") - ) : true - ).sort((a5, b4) => { - return predicate.sort.reduce((p3, c4) => { - return p3 == 0 ? sortReturnForCol( - cols.find((col) => col.name + col.table == c4.field), - c4, - a5, - b4 - ) : p3; - }, 0); - }), - [predicate, data2, cols, searchString] - ); - const updateValue2 = (column, value, table, index, file) => { - var _a3, _b2; - const col = (_a3 = table == "" ? tableData : contextTable[table]) == null ? void 0 : _a3.cols.find( - (f4) => f4.name == column - ); - if (col) - saveFrontmatterValue( - props2.plugin, - file != null ? file : (_b2 = tableData.rows[index]) == null ? void 0 : _b2.File, - column, - value, - col.type, - props2.plugin.settings.saveAllContextToFrontmatter - ); - if (table == "") { - saveDB2({ - ...tableData, - rows: tableData.rows.map( - (r3, i4) => i4 == index ? { - ...r3, - [column]: value - } : r3 - ) - }); - } else if (contextTable[table]) { - saveContextDB( - { - ...contextTable[table], - rows: contextTable[table].rows.map( - (r3, i4) => i4 == index ? { - ...r3, - [column]: value - } : r3 - ) - }, - table - ); - } - }; - const sortColumn = (sort) => { - savePredicate({ - ...predicate, - sort: [sort] - }); - }; - const hideColumn = (col, hidden) => { - savePredicate({ - ...predicate, - colsHidden: hidden ? [ - ...predicate.colsHidden.filter((s5) => s5 != col.name + col.table), - col.name + col.table - ] : predicate.colsHidden.filter((s5) => s5 != col.name + col.table) - }); - }; - const updateFieldValue = (column, fieldValue, value, table, index, file) => { - var _a3; - const col = tableData.cols.find((f4) => f4.name == column); - saveFrontmatterValue( - props2.plugin, - file != null ? file : (_a3 = tableData.rows[index]) == null ? void 0 : _a3.File, - column, - value, - col.type, - props2.plugin.settings.saveAllContextToFrontmatter - ); - if (table == "") { - const newTable = { - ...tableData, - cols: tableData.cols.map( - (m5) => m5.name == column ? { - ...m5, - value: fieldValue - } : m5 - ), - rows: tableData.rows.map( - (r3, i4) => i4 == index ? { - ...r3, - [column]: value - } : r3 - ) - }; - saveDB2(newTable); - } else if (contextTable[table]) { - saveContextDB( - { - ...contextTable[table], - cols: contextTable[table].cols.map( - (m5) => m5.name == column ? { - ...m5, - value: fieldValue - } : m5 - ), - rows: contextTable[table].rows.map( - (r3, i4) => i4 == index ? { - ...r3, - [column]: value - } : r3 - ) - }, - table - ); - } - }; - const syncAllMetadata = (f4) => { - const files = f4.rows.map((f5) => f5.File); - const importYAML = (files2, fmKeys) => { - return files2.map((f5) => getAbstractFileAtPath(props2.plugin, f5)).filter((f5) => f5).reduce( - (p3, c4) => { - const fm = frontMatterForFile(props2.plugin, c4); - if (!fm) - return p3; - return { - uniques: [], - cols: uniq([...p3.cols, ...fmKeys]), - rows: [ - ...p3.rows, - { - File: c4.path, - ...fmKeys.reduce((p4, c5) => { - const value = parseFrontMatter(c5, fm[c5]); - if ((value == null ? void 0 : value.length) > 0) - return { ...p4, [c5]: value }; - return p4; - }, {}) - } - ] - }; - }, - { uniques: [], cols: [], rows: [] } - ); - }; - const yamlTableData = importYAML( - files, - f4.cols.filter((f5) => !f5.type.contains("file")).map((f5) => f5.name) - ); - const newRows = f4.rows.map((r3) => { - const fmRow = yamlTableData.rows.find((f5) => f5.File == r3.File); - if (fmRow) { - return { - ...r3, - ...fmRow - }; - } - return r3; - }); - const rowsChanged = !import_lodash4.default.isEqual(newRows, tableData == null ? void 0 : tableData.rows); - const colsChanged = !import_lodash4.default.isEqual(tableData == null ? void 0 : tableData.cols, f4.cols); - if (rowsChanged || colsChanged) { - saveDB2({ - ...f4, - rows: newRows - }); - } - }; - const refreshSpace = async (evt) => { - if (evt.detail.type == "context") { - refreshMDB(evt.detail.name); - return; - } - if (evt.detail.type == "vault") { - refreshMDB(spaceInfo.path); - } - }; - const refreshMDB = async (contextPath) => { - if (!dbFileExists || (dbSchema == null ? void 0 : dbSchema.primary) != "true") { - return; - } - const tag = Object.keys(contextTable).find( - (t4) => spaceFromTag(props2.plugin, t4).path == contextPath - ); - if (tag) - loadContextFields(tag); - }; - p2(() => { - window.addEventListener(eventTypes.spacesChange, refreshSpace); - return () => { - window.removeEventListener(eventTypes.spacesChange, refreshSpace); - }; - }, [refreshSpace]); - p2(() => { - if (schema) { - parsePredicate(schema.predicate); - } - }, [schema]); - p2(() => { - if (dbFileExists && tableData) - getContextTags(tableData); - }, [tableData]); - const selectRows = (lastSelected, rows) => { - setSelectedRows(rows); - if (!((dbSchema == null ? void 0 : dbSchema.primary) == "true")) - return; - if (lastSelected) { - const path = tableData.rows[parseInt(lastSelected)].File; - const evt = new CustomEvent( - eventTypes.activePathChange, - { - detail: { - selection: path, - path: { - ...uriByString(props2.plugin, spaceInfo.path), - ref: schema == null ? void 0 : schema.id - } - } - } - ); - window.dispatchEvent(evt); - } else { - const evt = new CustomEvent( - eventTypes.activePathChange, - { - detail: { - path: { - ...uriByString(props2.plugin, spaceInfo.path), - ref: schema == null ? void 0 : schema.id - }, - selection: null - } - } - ); - window.dispatchEvent(evt); - } - }; - const getContextTags = async (_tableData) => { - const contextFields = _tableData.cols.filter((f4) => f4.type.contains("context")).map((f4) => f4.value).filter((f4) => !contexts.some((g4) => g4 == f4)); - for (const c4 of contextFields) { - loadContextFields(c4); - } - }; - p2(() => { - if (tableData) { - for (const c4 of contexts) { - loadTagContext(c4, tableData.rows); - } - } - }, [tableData]); - const loadTagContext = async (tag, files) => { - getMDBTable( - props2.plugin, - spaceFromTag(props2.plugin, tag), - "files", - "context" - ).then((f4) => { - if (f4) { - const contextFields = f4.cols.filter((g4) => g4.type.contains("context")).map((g4) => g4.value).filter((g4) => !contexts.some((h5) => h5 == g4)); - for (const c4 of contextFields) { - loadContextFields(c4); - } - setContextTable((t4) => ({ - ...t4, - [tag]: f4 - })); - } - }); - }; - const loadContextFields = async (tag) => { - getMDBTable( - props2.plugin, - spaceFromTag(props2.plugin, tag), - "files", - "context" - ).then((f4) => { - setContextTable((t4) => ({ - ...t4, - [tag]: f4 - })); - }); - }; - const saveContextDB = async (newTable, tag) => { - const context = spaceFromTag(props2.plugin, tag); - await saveMDBToPath(props2.plugin, context, newTable).then( - (f4) => f4 && setContextTable((t4) => ({ - ...t4, - [tag]: newTable - })) - ); - }; - const savePredicate = (newPredicate) => { - const cleanedPredicate = validatePredicate(newPredicate); - saveSchema({ - ...schema, - predicate: JSON.stringify(cleanedPredicate) - }); - setPredicate(cleanedPredicate); - }; - p2(() => { - setPredicate((p3) => ({ - ...p3, - colsOrder: uniq([ - ...p3.colsOrder, - ...cols.filter((f4) => f4.hidden != "true").map((c4) => c4.name + c4.table) - ]) - })); - }, [cols]); - const parsePredicate = (predicateStr) => { - const newPredicate = safelyParseJSON(predicateStr); - setPredicate(validatePredicate(newPredicate)); - }; - const delColumn = (column) => { - let mdbtable; - const table = column.table; - if (table == "") { - mdbtable = tableData; - } else if (contextTable[table]) { - mdbtable = contextTable[table]; - } - const newFields = mdbtable.cols.filter( - (f4, i4) => f4.name != column.name - ); - const newTable = { - ...mdbtable, - cols: newFields, - rows: mdbtable.rows.map((r3) => { - const { [column.name]: val, ...rest } = r3; - return rest; - }) - }; - if (table == "") { - saveDB2(newTable); - } else if (contextTable[table]) { - saveContextDB(newTable, table); - } - }; - const newColumn = (col) => { - return saveColumn(col); - }; - const saveColumn = (newColumn2, oldColumn) => { - let mdbtable; - const column = { - ...newColumn2, - name: sanitizeColumnName(newColumn2.name) - }; - const table = column.table; - if (table == "") { - mdbtable = tableData; - } else if (contextTable[table]) { - mdbtable = contextTable[table]; - } - if (column.name == "") { - new import_obsidian14.Notice(i18n_default.notice.noPropertyName); - return false; - } - if (!oldColumn && mdbtable.cols.find( - (f4) => f4.name.toLowerCase() == column.name.toLowerCase() - ) || oldColumn && oldColumn.name != column.name && mdbtable.cols.find( - (f4) => f4.name.toLowerCase() == column.name.toLowerCase() - )) { - new import_obsidian14.Notice(i18n_default.notice.duplicatePropertyName); - return false; - } - const oldFieldIndex = oldColumn ? mdbtable.cols.findIndex((f4) => f4.name == oldColumn.name) : -1; - const newFields = oldFieldIndex == -1 ? [...mdbtable.cols, column] : mdbtable.cols.map((f4, i4) => i4 == oldFieldIndex ? column : f4); - const newTable = { - ...mdbtable, - cols: newFields, - rows: mdbtable.rows.map( - (f4) => oldColumn ? { - ...f4, - [column.name]: f4[oldColumn.name], - oldColumn: void 0 - } : f4 - ) - }; - if (oldColumn) - savePredicate({ - view: predicate.view, - frame: predicate.frame, - frameProps: predicate.frameProps, - filters: predicate.filters.map( - (f4) => f4.field == oldColumn.name + oldColumn.table ? { ...f4, field: column.name + column.table } : f4 - ), - sort: predicate.sort.map( - (f4) => f4.field == oldColumn.name + oldColumn.table ? { ...f4, field: column.name + column.table } : f4 - ), - groupBy: predicate.groupBy.map( - (f4) => f4 == oldColumn.name + oldColumn.table ? column.name + column.table : f4 - ), - colsHidden: predicate.colsHidden.map( - (f4) => f4 == oldColumn.name + oldColumn.table ? column.name + column.table : f4 - ), - colsOrder: predicate.colsOrder.map( - (f4) => f4 == oldColumn.name + oldColumn.table ? column.name + column.table : f4 - ), - colsSize: { - ...predicate.colsSize, - [column.name + column.table]: predicate.colsSize[oldColumn.name + oldColumn.table], - [oldColumn.name + oldColumn.table]: void 0 - } - }); - if (table == "") { - syncAllMetadata(newTable); - } else if (contextTable[table]) { - saveContextDB(newTable, table); - } - return true; - }; - return /* @__PURE__ */ Cn.createElement(ContextEditorContext.Provider, { - value: { - cols, - data: data2, - views, - schema, - setSchema, - filteredData, - loadContextFields, - selectedRows, - selectRows, - sortedColumns, - contextTable, - setContextTable, - predicate, - savePredicate, - saveContextDB, - saveColumn, - hideColumn, - sortColumn, - delColumn, - newColumn, - searchString, - setSearchString, - updateValue: updateValue2, - updateFieldValue - } - }, props2.children); -}; - -// src/hooks/useCombinedRef.tsx -function useCombinedRefs2(...refs) { - return F2( - () => (node) => { - refs.forEach((ref2) => ref2(node)); + { n: ["flag-gt", "guatemala flag"], u: "1f1ec-1f1f9" }, + { n: ["flag-gu", "guam flag"], u: "1f1ec-1f1fa" }, + { n: ["flag-gw", "guinea-bissau flag"], u: "1f1ec-1f1fc" }, + { n: ["flag-gy", "guyana flag"], u: "1f1ec-1f1fe" }, + { n: ["flag-hk", "hong kong sar china flag"], u: "1f1ed-1f1f0" }, + { n: ["flag-hm", "heard & mcdonald islands flag"], u: "1f1ed-1f1f2" }, + { n: ["flag-hn", "honduras flag"], u: "1f1ed-1f1f3" }, + { n: ["flag-hr", "croatia flag"], u: "1f1ed-1f1f7" }, + { n: ["flag-ht", "haiti flag"], u: "1f1ed-1f1f9" }, + { n: ["flag-hu", "hungary flag"], u: "1f1ed-1f1fa" }, + { n: ["flag-ic", "canary islands flag"], u: "1f1ee-1f1e8" }, + { n: ["flag-id", "indonesia flag"], u: "1f1ee-1f1e9" }, + { n: ["flag-ie", "ireland flag"], u: "1f1ee-1f1ea" }, + { n: ["flag-il", "israel flag"], u: "1f1ee-1f1f1" }, + { n: ["flag-im", "isle of man flag"], u: "1f1ee-1f1f2" }, + { n: ["flag-in", "india flag"], u: "1f1ee-1f1f3" }, + { n: ["flag-io", "british indian ocean territory flag"], u: "1f1ee-1f1f4" }, + { n: ["flag-iq", "iraq flag"], u: "1f1ee-1f1f6" }, + { n: ["flag-ir", "iran flag"], u: "1f1ee-1f1f7" }, + { n: ["flag-is", "iceland flag"], u: "1f1ee-1f1f8" }, + { n: ["it", "flag-it", "italy flag"], u: "1f1ee-1f1f9" }, + { n: ["flag-je", "jersey flag"], u: "1f1ef-1f1ea" }, + { n: ["flag-jm", "jamaica flag"], u: "1f1ef-1f1f2" }, + { n: ["flag-jo", "jordan flag"], u: "1f1ef-1f1f4" }, + { n: ["jp", "flag-jp", "japan flag"], u: "1f1ef-1f1f5" }, + { n: ["flag-ke", "kenya flag"], u: "1f1f0-1f1ea" }, + { n: ["flag-kg", "kyrgyzstan flag"], u: "1f1f0-1f1ec" }, + { n: ["flag-kh", "cambodia flag"], u: "1f1f0-1f1ed" }, + { n: ["flag-ki", "kiribati flag"], u: "1f1f0-1f1ee" }, + { n: ["flag-km", "comoros flag"], u: "1f1f0-1f1f2" }, + { n: ["flag-kn", "st. kitts & nevis flag"], u: "1f1f0-1f1f3" }, + { n: ["flag-kp", "north korea flag"], u: "1f1f0-1f1f5" }, + { n: ["kr", "flag-kr", "south korea flag"], u: "1f1f0-1f1f7" }, + { n: ["flag-kw", "kuwait flag"], u: "1f1f0-1f1fc" }, + { n: ["flag-ky", "cayman islands flag"], u: "1f1f0-1f1fe" }, + { n: ["flag-kz", "kazakhstan flag"], u: "1f1f0-1f1ff" }, + { n: ["flag-la", "laos flag"], u: "1f1f1-1f1e6" }, + { n: ["flag-lb", "lebanon flag"], u: "1f1f1-1f1e7" }, + { n: ["flag-lc", "st. lucia flag"], u: "1f1f1-1f1e8" }, + { n: ["flag-li", "liechtenstein flag"], u: "1f1f1-1f1ee" }, + { n: ["flag-lk", "sri lanka flag"], u: "1f1f1-1f1f0" }, + { n: ["flag-lr", "liberia flag"], u: "1f1f1-1f1f7" }, + { n: ["flag-ls", "lesotho flag"], u: "1f1f1-1f1f8" }, + { n: ["flag-lt", "lithuania flag"], u: "1f1f1-1f1f9" }, + { n: ["flag-lu", "luxembourg flag"], u: "1f1f1-1f1fa" }, + { n: ["flag-lv", "latvia flag"], u: "1f1f1-1f1fb" }, + { n: ["flag-ly", "libya flag"], u: "1f1f1-1f1fe" }, + { n: ["flag-ma", "morocco flag"], u: "1f1f2-1f1e6" }, + { n: ["flag-mc", "monaco flag"], u: "1f1f2-1f1e8" }, + { n: ["flag-md", "moldova flag"], u: "1f1f2-1f1e9" }, + { n: ["flag-me", "montenegro flag"], u: "1f1f2-1f1ea" }, + { n: ["flag-mf", "st. martin flag"], u: "1f1f2-1f1eb" }, + { n: ["flag-mg", "madagascar flag"], u: "1f1f2-1f1ec" }, + { n: ["flag-mh", "marshall islands flag"], u: "1f1f2-1f1ed" }, + { n: ["flag-mk", "north macedonia flag"], u: "1f1f2-1f1f0" }, + { n: ["flag-ml", "mali flag"], u: "1f1f2-1f1f1" }, + { n: ["flag-mm", "myanmar (burma) flag"], u: "1f1f2-1f1f2" }, + { n: ["flag-mn", "mongolia flag"], u: "1f1f2-1f1f3" }, + { n: ["flag-mo", "macao sar china flag"], u: "1f1f2-1f1f4" }, + { n: ["flag-mp", "northern mariana islands flag"], u: "1f1f2-1f1f5" }, + { n: ["flag-mq", "martinique flag"], u: "1f1f2-1f1f6" }, + { n: ["flag-mr", "mauritania flag"], u: "1f1f2-1f1f7" }, + { n: ["flag-ms", "montserrat flag"], u: "1f1f2-1f1f8" }, + { n: ["flag-mt", "malta flag"], u: "1f1f2-1f1f9" }, + { n: ["flag-mu", "mauritius flag"], u: "1f1f2-1f1fa" }, + { n: ["flag-mv", "maldives flag"], u: "1f1f2-1f1fb" }, + { n: ["flag-mw", "malawi flag"], u: "1f1f2-1f1fc" }, + { n: ["flag-mx", "mexico flag"], u: "1f1f2-1f1fd" }, + { n: ["flag-my", "malaysia flag"], u: "1f1f2-1f1fe" }, + { n: ["flag-mz", "mozambique flag"], u: "1f1f2-1f1ff" }, + { n: ["flag-na", "namibia flag"], u: "1f1f3-1f1e6" }, + { n: ["flag-nc", "new caledonia flag"], u: "1f1f3-1f1e8" }, + { n: ["flag-ne", "niger flag"], u: "1f1f3-1f1ea" }, + { n: ["flag-nf", "norfolk island flag"], u: "1f1f3-1f1eb" }, + { n: ["flag-ng", "nigeria flag"], u: "1f1f3-1f1ec" }, + { n: ["flag-ni", "nicaragua flag"], u: "1f1f3-1f1ee" }, + { n: ["flag-nl", "netherlands flag"], u: "1f1f3-1f1f1" }, + { n: ["flag-no", "norway flag"], u: "1f1f3-1f1f4" }, + { n: ["flag-np", "nepal flag"], u: "1f1f3-1f1f5" }, + { n: ["flag-nr", "nauru flag"], u: "1f1f3-1f1f7" }, + { n: ["flag-nu", "niue flag"], u: "1f1f3-1f1fa" }, + { n: ["flag-nz", "new zealand flag"], u: "1f1f3-1f1ff" }, + { n: ["flag-om", "oman flag"], u: "1f1f4-1f1f2" }, + { n: ["flag-pa", "panama flag"], u: "1f1f5-1f1e6" }, + { n: ["flag-pe", "peru flag"], u: "1f1f5-1f1ea" }, + { n: ["flag-pf", "french polynesia flag"], u: "1f1f5-1f1eb" }, + { n: ["flag-pg", "papua new guinea flag"], u: "1f1f5-1f1ec" }, + { n: ["flag-ph", "philippines flag"], u: "1f1f5-1f1ed" }, + { n: ["flag-pk", "pakistan flag"], u: "1f1f5-1f1f0" }, + { n: ["flag-pl", "poland flag"], u: "1f1f5-1f1f1" }, + { n: ["flag-pm", "st. pierre & miquelon flag"], u: "1f1f5-1f1f2" }, + { n: ["flag-pn", "pitcairn islands flag"], u: "1f1f5-1f1f3" }, + { n: ["flag-pr", "puerto rico flag"], u: "1f1f5-1f1f7" }, + { n: ["flag-ps", "palestinian territories flag"], u: "1f1f5-1f1f8" }, + { n: ["flag-pt", "portugal flag"], u: "1f1f5-1f1f9" }, + { n: ["flag-pw", "palau flag"], u: "1f1f5-1f1fc" }, + { n: ["flag-py", "paraguay flag"], u: "1f1f5-1f1fe" }, + { n: ["flag-qa", "qatar flag"], u: "1f1f6-1f1e6" }, + { n: ["flag-re", "r\xE9union flag"], u: "1f1f7-1f1ea" }, + { n: ["flag-ro", "romania flag"], u: "1f1f7-1f1f4" }, + { n: ["flag-rs", "serbia flag"], u: "1f1f7-1f1f8" }, + { n: ["ru", "flag-ru", "russia flag"], u: "1f1f7-1f1fa" }, + { n: ["flag-rw", "rwanda flag"], u: "1f1f7-1f1fc" }, + { n: ["flag-sa", "saudi arabia flag"], u: "1f1f8-1f1e6" }, + { n: ["flag-sb", "solomon islands flag"], u: "1f1f8-1f1e7" }, + { n: ["flag-sc", "seychelles flag"], u: "1f1f8-1f1e8" }, + { n: ["flag-sd", "sudan flag"], u: "1f1f8-1f1e9" }, + { n: ["flag-se", "sweden flag"], u: "1f1f8-1f1ea" }, + { n: ["flag-sg", "singapore flag"], u: "1f1f8-1f1ec" }, + { n: ["flag-sh", "st. helena flag"], u: "1f1f8-1f1ed" }, + { n: ["flag-si", "slovenia flag"], u: "1f1f8-1f1ee" }, + { n: ["flag-sj", "svalbard & jan mayen flag"], u: "1f1f8-1f1ef" }, + { n: ["flag-sk", "slovakia flag"], u: "1f1f8-1f1f0" }, + { n: ["flag-sl", "sierra leone flag"], u: "1f1f8-1f1f1" }, + { n: ["flag-sm", "san marino flag"], u: "1f1f8-1f1f2" }, + { n: ["flag-sn", "senegal flag"], u: "1f1f8-1f1f3" }, + { n: ["flag-so", "somalia flag"], u: "1f1f8-1f1f4" }, + { n: ["flag-sr", "suriname flag"], u: "1f1f8-1f1f7" }, + { n: ["flag-ss", "south sudan flag"], u: "1f1f8-1f1f8" }, + { n: ["flag-st", "s\xE3o tom\xE9 & pr\xEDncipe flag"], u: "1f1f8-1f1f9" }, + { n: ["flag-sv", "el salvador flag"], u: "1f1f8-1f1fb" }, + { n: ["flag-sx", "sint maarten flag"], u: "1f1f8-1f1fd" }, + { n: ["flag-sy", "syria flag"], u: "1f1f8-1f1fe" }, + { n: ["flag-sz", "eswatini flag"], u: "1f1f8-1f1ff" }, + { n: ["flag-ta", "tristan da cunha flag"], u: "1f1f9-1f1e6" }, + { n: ["flag-tc", "turks & caicos islands flag"], u: "1f1f9-1f1e8" }, + { n: ["flag-td", "chad flag"], u: "1f1f9-1f1e9" }, + { n: ["flag-tf", "french southern territories flag"], u: "1f1f9-1f1eb" }, + { n: ["flag-tg", "togo flag"], u: "1f1f9-1f1ec" }, + { n: ["flag-th", "thailand flag"], u: "1f1f9-1f1ed" }, + { n: ["flag-tj", "tajikistan flag"], u: "1f1f9-1f1ef" }, + { n: ["flag-tk", "tokelau flag"], u: "1f1f9-1f1f0" }, + { n: ["flag-tl", "timor-leste flag"], u: "1f1f9-1f1f1" }, + { n: ["flag-tm", "turkmenistan flag"], u: "1f1f9-1f1f2" }, + { n: ["flag-tn", "tunisia flag"], u: "1f1f9-1f1f3" }, + { n: ["flag-to", "tonga flag"], u: "1f1f9-1f1f4" }, + { n: ["flag-tr", "turkey flag"], u: "1f1f9-1f1f7" }, + { n: ["flag-tt", "trinidad & tobago flag"], u: "1f1f9-1f1f9" }, + { n: ["flag-tv", "tuvalu flag"], u: "1f1f9-1f1fb" }, + { n: ["flag-tw", "taiwan flag"], u: "1f1f9-1f1fc" }, + { n: ["flag-tz", "tanzania flag"], u: "1f1f9-1f1ff" }, + { n: ["flag-ua", "ukraine flag"], u: "1f1fa-1f1e6" }, + { n: ["flag-ug", "uganda flag"], u: "1f1fa-1f1ec" }, + { n: ["flag-um", "u.s. outlying islands flag"], u: "1f1fa-1f1f2" }, + { n: ["flag-un", "united nations flag"], u: "1f1fa-1f1f3" }, + { n: ["us", "flag-us", "united states flag"], u: "1f1fa-1f1f8" }, + { n: ["flag-uy", "uruguay flag"], u: "1f1fa-1f1fe" }, + { n: ["flag-uz", "uzbekistan flag"], u: "1f1fa-1f1ff" }, + { n: ["flag-va", "vatican city flag"], u: "1f1fb-1f1e6" }, + { n: ["flag-vc", "st. vincent & grenadines flag"], u: "1f1fb-1f1e8" }, + { n: ["flag-ve", "venezuela flag"], u: "1f1fb-1f1ea" }, + { n: ["flag-vg", "british virgin islands flag"], u: "1f1fb-1f1ec" }, + { n: ["flag-vi", "u.s. virgin islands flag"], u: "1f1fb-1f1ee" }, + { n: ["flag-vn", "vietnam flag"], u: "1f1fb-1f1f3" }, + { n: ["flag-vu", "vanuatu flag"], u: "1f1fb-1f1fa" }, + { n: ["flag-wf", "wallis & futuna flag"], u: "1f1fc-1f1eb" }, + { n: ["flag-ws", "samoa flag"], u: "1f1fc-1f1f8" }, + { n: ["flag-xk", "kosovo flag"], u: "1f1fd-1f1f0" }, + { n: ["flag-ye", "yemen flag"], u: "1f1fe-1f1ea" }, + { n: ["flag-yt", "mayotte flag"], u: "1f1fe-1f1f9" }, + { n: ["flag-za", "south africa flag"], u: "1f1ff-1f1e6" }, + { n: ["flag-zm", "zambia flag"], u: "1f1ff-1f1f2" }, + { n: ["flag-zw", "zimbabwe flag"], u: "1f1ff-1f1fc" }, + { + n: ["england flag", "flag-england"], + u: "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f" }, - refs - ); -} - -// src/components/SpaceView/Contexts/TableView/ColumnHeader.tsx -var filePropTypes = [ - { - name: i18n_default.properties.fileProperty.createdTime, - value: "ctime" - }, - { - name: i18n_default.properties.fileProperty.modifiedTime, - value: "mtime" - }, - { - name: i18n_default.properties.fileProperty.extension, - value: "extension" - }, - { - name: i18n_default.properties.fileProperty.size, - value: "size" - }, - { - name: i18n_default.properties.fileProperty.parentFolder, - value: "folder" - }, - { - name: "Links", - value: "links" - }, - { - name: "Tags", - value: "tags" - }, - { - name: "Spaces", - value: "spaces" - } -]; -var ColumnHeader = (props2) => { - var _a2, _b2; - const [field, setField] = h2(props2.column); - const menuRef = _2(null); - const { spaceInfo, spaceCache } = q2(SpaceContext); - const { tableData, contextTable } = q2(ContextMDBContext); - const { - predicate, - loadContextFields, - cols, - newColumn, - saveColumn, - hideColumn, - sortColumn, - delColumn - } = q2(ContextEditorContext); - p2(() => { - setField(props2.column); - }, [props2.column]); - const { - attributes, - listeners, - setNodeRef: setDraggableNodeRef, - transform - } = useDraggable({ - id: field.name + field.table, - data: { name: field.name } - }); - const { setNodeRef: setDroppableNodeRef } = useDroppable({ - id: field.name + field.table, - data: { name: field.name } - }); - const saveField = (field2) => { - if (field2.name.length > 0) { - if (field2.name != props2.column.name || field2.type != props2.column.type || field2.value != props2.column.value || field2.attrs != props2.column.attrs) { - const saveResult = saveColumn(field2, props2.column); - if (saveResult) { - if (props2.isNew) { - setField(props2.column); - } - } - } - } - }; - const showNewMenu = (e4) => { - var _a3; - const offset2 = ref2.current.getBoundingClientRect(); - showNewPropertyMenu( - props2.plugin, - { x: offset2.left, y: offset2.top + 30 }, - (_a3 = spaceCache == null ? void 0 : spaceCache.contexts) != null ? _a3 : [], - cols, - (source, field2) => newColumn({ ...field2, table: source }), - tableData.schema.id, - spaceInfo.path, - false - ); - }; - const toggleMenu = (e4) => { - if (props2.isNew) { - showNewMenu(e4); - } else { - const offset2 = e4.target.getBoundingClientRect(); - const options = optionValuesForColumn( - field.name, - field.table == "" ? tableData : contextTable[field.table] - ); - showPropertyMenu({ - plugin: props2.plugin, - position: { x: offset2.left, y: offset2.top + 30 }, - editable: props2.editable, - options, - field, - fields: cols, - contextPath: spaceInfo.path, - saveField, - hide: hideColumn, - deleteColumn: delColumn, - sortColumn, - hidden: predicate.colsHidden.includes(field.name + field.table) - }); - } - }; - const ref2 = _2(null); - const setNodeRef = useCombinedRefs2(setDroppableNodeRef, setDraggableNodeRef); - return /* @__PURE__ */ Cn.createElement("div", { - ref: setNodeRef, - ...listeners, - ...attributes, - className: "mk-col-header", - onClick: (e4) => { - toggleMenu(e4); - } - }, /* @__PURE__ */ Cn.createElement("div", { - ref: ref2 - }, props2.column.name.length > 0 ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { - dangerouslySetInnerHTML: { - __html: stickerFromString( - ((_a2 = props2.column.attrs) == null ? void 0 : _a2.length) > 0 ? props2.column.attrs : (_b2 = fieldTypeForType(props2.column.type)) == null ? void 0 : _b2.icon, - props2.plugin - ) - } - }), field.name) : "+", /* @__PURE__ */ Cn.createElement("span", { - className: "mk-col-header-context", - "aria-label": props2.column.table.length > 0 ? props2.column.table : "" - }, props2.column.table.length > 0 ? "#" : ""))); -}; - -// src/dispatch/mdb.ts -var import_lodash5 = __toESM(require_lodash()); -var import_obsidian15 = require("obsidian"); - -// src/utils/contexts/file.ts -var renameRowForFile = (folder, filePath, toFilePath) => { - return { - ...folder, - rows: folder.rows.map( - (f4) => f4.File == filePath ? { ...f4, File: toFilePath } : f4 - ) - }; -}; -var removeRowForFile = (folder, filePath) => { - return { - ...folder, - rows: folder.rows.filter( - (f4) => f4.File != filePath - ) - }; -}; -var removeRowsForFile = (folder, filePaths) => { - return { - ...folder, - rows: folder.rows.filter( - (f4) => !filePaths.includes(f4.File) - ) - }; -}; -var reorderRowsForFile = (folder, filePaths, index) => { - const rows = folder.rows.filter( - (f4) => filePaths.includes(f4.File) - ); - return { - ...folder, - rows: insertMulti(folder.rows.filter( - (f4) => !filePaths.includes(f4.File) - ), index, rows) - }; -}; - -// src/utils/contexts/links.ts -var valueContainsLink = (link, value) => { - return parseMultiString(value).some((f4) => link == parseLinkString(f4)); -}; -var replaceLinkInValue = (link, newLink, value) => { - return serializeMultiString(parseMultiString(value).map((f4) => parseLinkString(f4) == link ? newLink : link)); -}; -var removeLinkInValue = (link, value) => { - return serializeMultiString(parseMultiString(value).filter((f4) => f4 != link)); -}; -var linkColumns = (cols) => { - return cols.filter((f4) => f4.type.startsWith("link") || f4.type.startsWith("context")); -}; -var removeLinksInRow = (plugin, row, link, cols) => { - if (cols.length == 0) { - return row; - } - const deltaRow = cols.reduce((p3, c4) => { - if (valueContainsLink(link, row[c4.name])) { - const newValue = removeLinkInValue(link, row[c4.name]); - saveFrontmatterValue( - plugin, - row.File, - c4.name, - newValue, - c4.type, - plugin.settings.saveAllContextToFrontmatter - ); - return { ...p3, [c4.name]: newValue }; - } - return p3; - }, {}); - return { ...row, ...deltaRow }; -}; -var renameLinksInRow = (plugin, row, link, newLink, cols) => { - if (cols.length == 0) { - return row; - } - const deltaRow = cols.reduce((p3, c4) => { - if (valueContainsLink(link, row[c4.name])) { - const newValue = replaceLinkInValue(link, newLink, row[c4.name]); - saveFrontmatterValue( - plugin, - row.File, - c4.name, - newValue, - c4.type, - plugin.settings.saveAllContextToFrontmatter - ); - return { ...p3, [c4.name]: newValue }; - } - return p3; - }, {}); - return { ...row, ...deltaRow }; -}; - -// src/utils/metadata/dataview/parseDataview.ts -var parseDataview = (field, value) => { - const YAMLtype = detectYAMLType(value, field); - switch (YAMLtype) { - case "object": - return JSON.stringify(value); - break; - case "number": - return value.toString(); - break; - case "boolean": - return value ? "true" : "false"; - break; - case "date": - return format(new Date(value.ts), "yyyy-MM-dd"); - break; - case "duration": - return serializeMultiDisplayString(Object.keys(value.values).reduce( - (p3, c4) => [ - ...p3, - ...value.values[c4] > 0 ? [value.values[c4] + " " + c4] : [] - ], - [] - )); - break; - case "option-multi": - case "link-multi": - if (typeof value === "string") { - return value; - } - return serializeMultiString( - value.map((v3) => { - if (!v3) { - return ""; - } - if (typeof v3 === "string") { - return v3; - } - if (v3.path) { - return v3.path; - } - if (Array.isArray(value) && v3.length == 1 && Array.isArray(v3[0]) && v3[0].length == 1 && typeof v3[0][0] === "string") { - return v3[0][0]; - } - return JSON.stringify(v3); - }) - ); - break; - case "link": - { - if (Array.isArray(value) && value.length == 1 && Array.isArray(value[0]) && value[0].length == 1 && typeof value[0][0] === "string") { - return value[0][0]; - } else if (typeof value === "string") { - return value; - } - return value.path; - } - break; - case "text": - case "tag": - case "image": - return value; - break; - } - return ""; -}; - -// src/dispatch/mdb.ts -var processContextFile = async (plugin, space, processor, fallback) => { - const dbFileExists = await plugin.app.vault.adapter.exists(space.dbPath); - if (dbFileExists) { - const contextDB = await getMDBTable(plugin, space, "files", "context"); - if (contextDB) { - await processor(contextDB, space); - return; - } else if (fallback) { - await fallback(); + { + n: ["scotland flag", "flag-scotland"], + u: "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f" + }, + { + n: ["wales flag", "flag-wales"], + u: "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f" } - } else if (fallback) { - await fallback(); - } -}; -var saveDB = async (plugin, context, newTable) => { - return saveMDBToPath(plugin, context, newTable); -}; -var insertColumn = (table, column) => { - if (table.cols.find((f4) => f4.name == column.name)) { - new import_obsidian15.Notice(i18n_default.notice.duplicatePropertyName); - return; - } - return { - ...table, - cols: [...table.cols, column] - }; -}; -var insertColumns = (table, columns) => { - return { - ...table, - cols: [...table.cols, ...columns.filter((f4) => !table.cols.some((g4) => g4.name == f4.name))] - }; -}; -var deletePropertyMultiValue = (folder, lookupField, lookupValue, field, value) => { - return { - ...folder, - rows: folder.rows.map( - (f4) => f4[lookupField] == lookupValue ? { - ...f4, - [field]: serializeMultiString(parseMultiString(f4[field]).filter((g4) => g4 != value)) - } : f4 - ) - }; -}; -var updateValue = (folder, lookupField, lookupValue, field, value) => { - return { - ...folder, - rows: folder.rows.map( - (f4) => f4[lookupField] == lookupValue ? { - ...f4, - [field]: value - } : f4 - ) - }; -}; -var insertRowsIfUnique = (folder, rows, index) => { - return { ...folder, rows: index ? insertMulti(folder.rows, index, rows.filter((f4) => !folder.rows.some((g4) => g4.File == f4.File))) : [...folder.rows, ...rows.filter((f4) => !folder.rows.some((g4) => g4.File == f4.File))] }; -}; -var saveContextToFrontmatter = (file, cols, context, plugin) => { - const afile = getAbstractFileAtPath(plugin, file); - if (afile && afile instanceof import_obsidian15.TFile) - saveContextToFile(afile, cols, context, plugin); -}; -var updateContextValue = async (plugin, space, file, field, value, _updateFunction) => { - let tagFileExists = await plugin.app.vault.adapter.exists(space.dbPath); - if (!tagFileExists) { - tagFileExists = await createContextMDB(plugin, space); - } - if (tagFileExists) - await getMDBTable(plugin, space, "files", "context").then( - (tagDB) => { - const updateFunction = _updateFunction != null ? _updateFunction : updateValue; - const newMDB = updateFunction(tagDB, FilePropertyName, file, field, value); - return saveDB(plugin, space, newMDB).then((f4) => newMDB); - } - ); + ] }; -var insertContextColumn = async (plugin, space, field) => { - let tagFileExists = await plugin.app.vault.adapter.exists(space.dbPath); - if (!tagFileExists) { - tagFileExists = await createContextMDB(plugin, space); + +// src/react/components/UI/Modals/stickerModal.tsx +var htmlFromSticker = (sticker) => { + if (sticker.type == "emoji") { + return emojiFromString(sticker.html); } - if (tagFileExists) - await getMDBTable(plugin, space, "files", "context").then((tagDB) => { - const newDB = insertColumn(tagDB, field); - saveDB(plugin, space, newDB).then((f4) => newDB); - return newDB; - }).then((f4) => plugin.index.reloadContext(space)); + return sticker.html; }; -var insertContextColumns = async (plugin, space, fields) => { - let tagFileExists = await plugin.app.vault.adapter.exists(space.dbPath); - if (!tagFileExists) { - tagFileExists = await createContextMDB(plugin, space); +var stickerModal = class extends import_obsidian12.FuzzySuggestModal { + constructor(app2, plugin, setIcon) { + super(app2); + this.plugin = plugin; + this.setIcon = setIcon; + this.resultContainerEl.toggleClass("mk-sticker-modal", true); + this.inputEl.focus(); + this.emptyStateText = i18n_default.labels.findStickers; + this.limit = 0; } - if (tagFileExists) - await getMDBTable(plugin, space, "files", "context").then((tagDB) => { - const newDB = insertColumns(tagDB, fields); - saveDB(plugin, space, newDB).then((f4) => newDB); - return newDB; - }).then((f4) => plugin.index.reloadContext(space)); -}; -var insertContextItems = async (plugin, newPaths, t4) => { - const saveNewContextRows = async (tag, space2) => { - const newRow = newPaths.map((newPath) => ({ File: newPath })); - await saveDB(plugin, space2, insertRowsIfUnique(tag, newRow)); - }; - const space = plugin.index.spacesIndex.get(t4); - let tagFileExists = await plugin.app.vault.adapter.exists(space.space.dbPath); - if (!tagFileExists) { - tagFileExists = await createContextMDB(plugin, space.space); + renderSuggestion(item, el) { + el.innerHTML = htmlFromSticker(item.item); + el.setAttr("aria-label", item.item.name); } - if (tagFileExists) - await getMDBTable(plugin, space.space, "files", "context").then( - (tagDB) => saveNewContextRows(tagDB, space.space) + getItemText(item) { + return item.name; + } + getItems() { + const allLucide = lucideIcons.map((f4) => ({ + name: f4, + type: "lucide", + keywords: f4, + value: f4, + html: (0, import_obsidian12.getIcon)(f4).outerHTML + })); + const allCustom = [...this.plugin.index.iconsCache.keys()].map( + (f4) => ({ + name: f4, + type: "vault", + keywords: f4, + value: f4, + html: this.plugin.index.iconsCache.get(f4) + }) ); -}; -var fileToFM = (afile, cols, plugin) => { - let file = afile; - if (afile instanceof import_obsidian15.TFolder) { - file = getAbstractFileAtPath(plugin, folderNotePathFromAFile(plugin.settings, tFileToAFile(afile))); + const allUI = [...Object.keys(uiIconSet)].map((f4) => ({ + name: f4, + type: "ui", + keywords: f4, + value: f4, + html: uiIconSet[f4] + })); + const allEmojis = Object.keys(emojis).reduce( + (p3, c4) => [ + ...p3, + ...emojis[c4].map((e4) => ({ + type: "emoji", + name: e4.n[0], + value: e4.u, + html: e4.u + })) + ], + [] + ); + return [...allCustom, ...allEmojis, ...allLucide, ...allUI]; } - if (!file) - return []; - const fm = frontMatterForFile(plugin, file); - const fmKeys = frontMatterKeys(fm).filter((f4) => cols.some((g4) => f4 == g4)); - const rows = fmKeys.reduce( - (p3, c4) => ({ ...p3, [c4]: parseFrontMatter(c4, fm[c4]) }), - {} - ); - if (plugin.dataViewAPI()) { - return { ...rows, ...fileToDV(file, cols, plugin) }; + onChooseItem(item, evt) { + this.setIcon(item.type + "//" + item.value); } - return rows; -}; -var fileToDV = (file, cols, plugin) => { - const dvValues = plugin.dataViewAPI().page(file.path); - const fmKeys = uniqCaseInsensitive( - Object.keys(dvValues != null ? dvValues : {}).filter( - (f4, i4, self2) => !self2.find( - (g4, j4) => g4.toLowerCase().replace(/\s/g, "-") == f4.toLowerCase().replace(/\s/g, "-") && i4 > j4 - ) ? true : false - ).filter((f4) => f4 != "file") - ).filter((f4) => cols.some((g4) => f4 == g4)); - return fmKeys.reduce( - (p3, c4) => ({ - ...p3, - [c4]: parseDataview(c4, dvValues[c4]) - }), - {} - ); -}; -var onMetadataChange = async (plugin, file, spaces) => { - const updateFile = (mdb) => { - const objectExists = mdb.rows.some((item) => item.File === file.path); - if (objectExists) { - return mdb.rows.map( - (f4) => f4.File == file.path ? { - ...f4, - ...fileToFM( - file, - mdb.cols.map((f5) => f5.name), - plugin - ) - } : f4 - ); - } else { - return [ - ...mdb.rows, - { - File: file.path, - ...fileToFM( - file, - mdb.cols.map((f4) => f4.name), - plugin - ) - } - ]; - } - }; - const promises = spaces.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const newDB = { - ...mdb, - rows: updateFile(mdb) - }; - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var updateValueInContext = async (plugin, row, field, value, space) => { - const changeTagInContextMDB = (mdb) => { - return { ...mdb, rows: mdb.rows.map((f4) => f4.File == row ? { ...f4, [field]: value } : f4) }; - }; - return processContextFile(plugin, space, async (mdb, space2) => { - const newDB = changeTagInContextMDB(mdb); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); -}; -var renameTagInContexts = async (plugin, oldTag, newTag, spaces) => { - const changeTagInContextMDB = (mdb) => { - const cols = mdb.cols.map((f4) => f4.type.startsWith("context") && f4.value == oldTag ? { ...f4, value: newTag } : f4); - return { ...mdb, cols }; - }; - const promises = spaces.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const newDB = changeTagInContextMDB(mdb); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var removeTagInContexts = async (plugin, tag, spaces) => { - const deleteTagInContextMDB = (mdb) => { - const cols = mdb.cols.map((f4) => f4.type.startsWith("context") && f4.value == tag ? { ...f4, type: "link-multi" } : f4); - return { ...mdb, cols }; - }; - const promises = spaces.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const newDB = deleteTagInContextMDB(mdb); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var addFileInContexts = async (plugin, path, contexts, index) => { - const promises = contexts.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const newDB = insertRowsIfUnique(mdb, [{ File: path }], index); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var renameLinkInContexts = async (plugin, oldPath, newPath, spaces) => { - const promises = spaces.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const linkCols = linkColumns(mdb.cols); - const newDB = { - ...mdb, - rows: mdb.rows.map((r3) => renameLinksInRow(plugin, r3, oldPath, newPath, linkCols)) - }; - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var removeLinkInContexts = async (plugin, path, spaces) => { - const promises = spaces.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const linkCols = linkColumns(mdb.cols); - const newDB = { - ...mdb, - rows: mdb.rows.map((r3) => removeLinksInRow(plugin, r3, path, linkCols)) - }; - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var renameFileInContexts = async (plugin, oldPath, newPath, spaces) => { - const promises = spaces.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const newDB = renameRowForFile(mdb, oldPath, newPath); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var removeFileInContexts = async (plugin, path, spaces) => { - const promises = spaces.map((space) => { - return processContextFile(plugin, space, async (mdb, space2) => { - const removeRow = mdb.rows.find((f4) => f4.File == path); - if (removeRow) { - saveContextToFrontmatter(path, mdb.cols, removeRow, plugin); - } - const newDB = removeRowForFile(mdb, path); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, space2, newDB); - } - return newDB; - }); - }); - return Promise.all(promises); -}; -var reorderFilesInContext = async (plugin, paths, index, space) => { - return processContextFile(plugin, space, async (mdb, context) => { - const newDB = reorderRowsForFile(mdb, paths, index); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, context, newDB); - } - return newDB; - }); }; -var removeFilesInContext = async (plugin, paths, space) => { - return processContextFile(plugin, space, async (mdb, context) => { - mdb.rows.forEach((row) => { - if (paths.includes(row.File)) - saveContextToFrontmatter(row.File, mdb.cols, row, plugin); - }); - const newDB = removeRowsForFile(mdb, paths); - if (!import_lodash5.default.isEqual(mdb, newDB)) { - await saveDB(plugin, context, newDB); - } - return newDB; + +// src/react/components/UI/Menus/propertyMenu/propertyMenu.tsx +var selectPropertyTypeMenu = (e4, plugin, selectedType) => { + showSelectMenu(e4.target.getBoundingClientRect(), { + plugin, + multi: false, + editable: false, + searchable: false, + saveOptions: selectedType, + value: [], + showAll: true, + options: fieldTypes.filter((f4) => !f4.restricted).map((f4, i4) => ({ + id: i4 + 1, + name: f4.label, + value: f4.type, + icon: f4.icon + })) }); }; - -// src/components/UI/menus/propertyMenu/PropertyValue.tsx -var PropertyValueComponent = (props2) => { +var PropertyMenuComponent = (props2) => { var _a2; - const showOptions = (e4, value, options, field, saveProperty) => { - showSelectMenu(e4.target.getBoundingClientRect(), { - plugin: props2.plugin, - multi: false, - editable: true, - searchable: true, - saveOptions: (_12, v3) => { - if (saveProperty) { - saveProperty(v3[0]); - } else { - saveParsedValue(field, v3[0]); - } - }, - placeholder: i18n_default.labels.propertyValueSpace, - value: [value != null ? value : ""], - options - }); - }; - const parsedValue = F2( - () => parseFieldValue(props2.value, props2.fieldType), - [props2.value, props2.fieldType] - ); - const saveParsedValue = (field, value) => { - props2.saveValue(JSON.stringify({ ...parsedValue, [field]: value })); - }; - const saveSpaceProperty = (field) => { - var _a3, _b2; - const colExists = (_b2 = (_a3 = props2.plugin.index.contextsIndex.get(parsedValue.space)) == null ? void 0 : _a3.cols) == null ? void 0 : _b2.some((f4) => f4.name == field); - if (!colExists) { - insertContextColumn( - props2.plugin, - props2.plugin.index.spacesIndex.get(parsedValue.space).space, - { - name: field, - schemaId: "files", - type: "context", - value: props2.name - } - ); - } - saveParsedValue("field", field); - }; - const selectContext = (e4) => { - showOptions( - e4, - parsedValue.space, - props2.plugin.index.allSpaces().filter((f4) => f4.type != "default").map((m5) => ({ name: m5.name, value: m5.path })), - "space" - ); - }; - const selectSpaceProperty = (e4) => { - var _a3, _b2; - showOptions( - e4, - parsedValue.property, - (_b2 = (_a3 = props2.plugin.index.contextsIndex.get(parsedValue.space)) == null ? void 0 : _a3.cols.filter((f4) => { - return f4.type.startsWith("context") && parseFieldValue(f4.value, f4.type)["space"] == props2.contextPath ? true : false; - }).map((m5) => ({ name: m5.name, value: m5.name }))) != null ? _b2 : [], - "field", - saveSpaceProperty - ); - }; - const selectProperty = (e4) => { - var _a3, _b2; - const properties2 = (_b2 = (_a3 = props2.plugin.index.contextsIndex.get(props2.contextPath)) == null ? void 0 : _a3.cols.filter( - (f4) => f4.type == "file" || f4.type == "link" || f4.type == "context" - ).map((f4) => ({ - name: f4.name, - value: f4.name - }))) != null ? _b2 : []; - showOptions(e4, null, properties2, "field"); - }; - const selectFileProp = (e4) => { - var _a3, _b2, _c2; - const property = (_a3 = props2.plugin.index.contextsIndex.get(props2.contextPath)) == null ? void 0 : _a3.cols.find((f4) => f4.name == parsedValue.field); - const fileProps2 = property ? property.type == "file" || property.type == "link" ? filePropTypes.map((f4) => ({ - name: f4.name, - value: f4.value - })) : (_c2 = (_b2 = props2.plugin.index.contextsIndex.get(parseFieldValue(property.value, "context").space)) == null ? void 0 : _b2.cols.filter((f4) => f4.hidden != "true").map((f4) => ({ - name: f4.name, - value: f4.name - }))) != null ? _c2 : [] : []; - showOptions(e4, null, fileProps2, "value"); - }; - const selectDateFormat = (e4) => { - const formats = [ - { - name: "2020-04-21", - value: "yyyy-MM-dd" - }, - { - name: "Apr 21, 2020", - value: "MMM d, yyyy" - }, - { - name: "Tue Apr 21, 2020", - value: "EEE MMM d, yyyy" - } - ]; - showOptions(e4, null, formats, "format"); - }; - return props2.fieldType.startsWith("date") ? /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectDateFormat(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.dateFormat), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.format)) : props2.fieldType.startsWith("context") ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectContext(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ Cn.createElement("span", null, spaceNameFromSpacePath(parsedValue.space, props2.plugin))), ((_a2 = parsedValue.space) == null ? void 0 : _a2.length) > 0 && /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectSpaceProperty(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field))) : props2.fieldType == "fileprop" ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectProperty(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field)), parsedValue.field && /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectFileProp(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.value))) : props2.fieldType == "super" ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item" - }, /* @__PURE__ */ Cn.createElement("span", null, "Dynamic"), /* @__PURE__ */ Cn.createElement("input", { - type: "checkbox", - checked: parsedValue.dynamic == true, - onChange: () => saveParsedValue("dynamic", !parsedValue.dynamic) - })), !parsedValue.dynamic ? /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => showOptions( - e4, - parsedValue.field, - [...props2.plugin.index.superProperties.keys()].map((f4) => ({ - value: f4, - name: props2.plugin.index.superProperties.get(f4).name - })), - "field" - ) - }, /* @__PURE__ */ Cn.createElement("span", null, "Field"), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field)) : /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectProperty(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field))) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); -}; - -// src/components/UI/menus/propertyMenu/newPropertyMenu.tsx -var NewPropertyMenuComponent = (props2) => { - const [fieldName, setFieldName] = h2(""); - const [fieldSource, setFieldSource] = h2( - props2.fileMetadata ? "fm" : "" - ); - const spaceCaches = F2( - () => props2.spaces.map((f4) => props2.plugin.index.spacesIndex.get(f4)).filter((f4) => f4), - [props2.spaces] - ); - const [fieldValue, setFieldValue] = h2(""); - const [fieldType, setFieldType] = h2("text"); - const options = F2(() => { - const options2 = []; - if (props2.fileMetadata) { - options2.push({ - name: i18n_default.menu.fileMetadata, - value: "fm" - }); - } - if (props2.contextPath) { - options2.push({ - name: folderPathToString(props2.contextPath), - value: "" - }); - } - options2.push( - ...(spaceCaches != null ? spaceCaches : []).map((f4) => ({ - name: f4.name, - value: f4.path - })) - ); - return options2; - }, [spaceCaches]); - const selectedType = (_12, value) => { - setFieldType(value[0]); - }; - const selectedValue = (value) => { - setFieldValue(value); - }; - const selectedSource = (_12, value) => { - setFieldSource(value[0]); - }; - const toggleMulti = () => { - const field = fieldTypes.find( - (f4) => f4.type == fieldType || f4.multiType == fieldType - ); - setFieldType(field.type == fieldType ? field.multiType : field.type); - }; - const selectType = (e4) => { - showSelectMenu(e4.target.getBoundingClientRect(), { - plugin: props2.plugin, - multi: false, - editable: false, - searchable: false, - saveOptions: selectedType, - value: [], - showAll: true, - options: fieldTypes.filter((f4) => fieldSource == "fm" ? f4.metadata : !f4.restricted).map((f4, i4) => ({ - id: i4 + 1, - name: f4.label, - value: f4.type, - icon: "" - })) - }); - }; - const selectedContext = (value) => { - setFieldValue(value); + const [field, setField] = h2(props2.field); + const selectedType = (_12, value) => { + const newField = { + ...field, + type: value[0], + value: JSON.stringify(getNewValueForType(field, value)) + }; + setField(newField); + props2.saveField(newField); }; - const type = F2( - () => { - var _a2; - return (_a2 = fieldTypeForType(fieldType)) != null ? _a2 : fieldTypes[0]; - }, - [fieldType] - ); - const selectSource = (e4) => { - showSelectMenu(e4.target.getBoundingClientRect(), { - plugin: props2.plugin, - multi: false, - editable: false, - searchable: false, - saveOptions: selectedSource, - value: [], - showAll: true, - options - }); + const selectedValue = (value) => { + const newField = { ...field, value }; + setField(newField); + props2.saveField(newField); }; - const saveField = () => { - if (fieldName.length == 0) { - new import_obsidian16.Notice(i18n_default.notice.noPropertyName); - return; - } - props2.saveField(fieldSource, { - name: fieldName, - type: fieldType, - value: fieldValue, - schemaId: props2.schemaId - }); - props2.hide(); + const toggleMulti = () => { + const newField = { + ...field, + type: field.type == fieldType.multiType ? fieldType.type : fieldType.multiType + }; + setField(newField); + props2.saveField(newField); }; - const onKeyDown = (e4) => { - if (e4.key == "Enter") { - saveField(); + const fieldType = (_a2 = fieldTypeForType(field.type)) != null ? _a2 : fieldTypes[0]; + const getNewValueForType = (f4, value) => { + if (value[0].startsWith("option")) { + return JSON.stringify({ + options: props2.options.map((f5) => ({ + name: f5, + value: f5 + })) + }); } + return value[0] == fieldType.type || value[0] == fieldType.multiType ? f4.value : null; }; - p2(() => { - setTimeout(() => { - input.current.focus(); - }, 50); - }, []); - const input = _2(null); return /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item" - }, /* @__PURE__ */ Cn.createElement("span", null, "Name"), /* @__PURE__ */ Cn.createElement("input", { - type: "text", - ref: input, - onKeyDown, - onChange: (e4) => setFieldName(e4.target.value), - onMouseDown: (e4) => e4.stopPropagation(), - value: fieldName - })), /* @__PURE__ */ Cn.createElement("div", { - className: "menu-separator" - }), options.length > 1 && /* @__PURE__ */ Cn.createElement("div", { className: "menu-item", - onClick: (e4) => selectSource(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, "Space"), /* @__PURE__ */ Cn.createElement("span", null, fieldSource == "fm" ? "None" : fieldSource == "" ? props2.contextPath : fieldSource)), /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => selectType(e4) - }, /* @__PURE__ */ Cn.createElement("span", null, "Type"), /* @__PURE__ */ Cn.createElement("span", null, type.label)), type.multi ? /* @__PURE__ */ Cn.createElement("div", { + onClick: (e4) => selectPropertyTypeMenu(e4, props2.plugin, selectedType) + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyType), /* @__PURE__ */ Cn.createElement("span", null, fieldType.label)), fieldType.multi ? /* @__PURE__ */ Cn.createElement("div", { className: "menu-item" }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ Cn.createElement("input", { type: "checkbox", - checked: fieldType == type.multiType, + checked: field.type == fieldType.multiType, onChange: () => toggleMulti() })) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), /* @__PURE__ */ Cn.createElement("div", { className: "menu-separator" - }), fieldSource != "fm" ? /* @__PURE__ */ Cn.createElement(PropertyValueComponent, { + }), /* @__PURE__ */ Cn.createElement(PropertyValueComponent, { plugin: props2.plugin, - table: fieldSource, + name: field.name, + table: field.table, fields: props2.fields, - fieldType, - value: fieldValue, + fieldType: fieldType.type, + value: field.value, contextPath: props2.contextPath, saveValue: selectedValue - }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), /* @__PURE__ */ Cn.createElement("div", { - className: "menu-separator" - }), /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => saveField() - }, /* @__PURE__ */ Cn.createElement("span", null, "Save Property")), /* @__PURE__ */ Cn.createElement("div", { - className: "menu-item", - onClick: (e4) => props2.hide() - }, /* @__PURE__ */ Cn.createElement("span", null, "Cancel"))); -}; -var showNewPropertyMenu = (plugin, position, spaces, fields, saveField, schemaId, contextPath, fileMetadata) => { - const menu = new import_obsidian16.Menu(); - menu.setUseNativeMenu(false); - const frag = document.createDocumentFragment(); - const div = frag.createDiv(); - div.addEventListener("click", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("keydown", (e4) => { - }); - const root = createRoot(div); - root.render( - /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(NewPropertyMenuComponent, { - plugin, - spaces, - schemaId, - contextPath, - fields, - hide: () => menu.hide(), - saveField, - fileMetadata - })) - ); - menu.addItem((menuItem) => { - menuItem.setTitle(frag); - menuItem.dom.toggleClass("mk-properties", true); - }); - const keys = [...menu.scope.keys]; - for (let i4 = 0; i4 < keys.length; i4++) { - if (keys[i4].key != "Escape") { - menu.scope.unregister(keys[i4]); - } - } - menu.showAtPosition(position); - return menu; -}; - -// src/components/UI/menus/spaceMenu.tsx -var showSpacesMenu = (e4, plugin, saveLink, includeDefaults, canAdd) => { - const offset2 = e4.target.getBoundingClientRect(); - const options = plugin.index.allSpaces(true).filter((f4) => includeDefaults || f4.type != "default").map((f4) => ({ - name: f4.name, - value: f4.path, - icon: f4.sticker, - section: f4.type == "tag" ? "Tag" : "Folder", - description: f4.type == "tag" ? f4.name : f4.path })); - showSelectMenu( - { x: offset2.left, y: offset2.top + 30 }, - { - plugin, - multi: false, - editable: canAdd, - value: [], - options, - sections: ["Tag", "Folder"], - saveOptions: (_12, value) => { - saveLink(value[0], !options.some((f4) => f4.value == value[0])); - }, - placeholder: i18n_default.labels.spaceSelectPlaceholder, - detail: true, - searchable: true, - showSections: true, - showAll: true - } - ); }; - -// src/components/SpaceView/Contexts/TagsView/NoteSpacesBar.tsx -var import_obsidian17 = require("obsidian"); -var NoteSpacesBar = (props2) => { - const showContextMenu = (e4, space) => { - e4.stopPropagation(); - e4.preventDefault(); - const menu = new import_obsidian17.Menu(); +var showPropertyMenu = (props2) => { + const { + plugin, + position, + editable, + options, + field, + fields, + contextPath, + saveField, + hide, + deleteColumn, + sortColumn, + editCode, + hidden + } = props2; + const menu = new import_obsidian13.Menu(); + menu.setUseNativeMenu(false); + if (editable) { menu.addItem((menuItem) => { - menuItem.setIcon("layout-grid"); - menuItem.setTitle(i18n_default.menu.openSpace); - menuItem.onClick(() => { - openSpace(space.path, props2.plugin, e4.metaKey); - }); + var _a2; + inputMenuItem( + menuItem, + (_a2 = field == null ? void 0 : field.name) != null ? _a2 : "", + (value) => saveField({ ...field, name: value }) + ); + menuItem.setIcon("type"); + }); + menu.addSeparator(); + const frag = document.createDocumentFragment(); + const div = frag.createDiv(); + div.addEventListener("click", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("keydown", (e4) => { + }); + const root = createRoot(div); + root.render( + /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(PropertyMenuComponent, { + plugin, + field, + fields, + contextPath, + options, + saveField + })) + ); + menu.addItem((menuItem) => { + menuItem.setTitle(frag); + menuItem.dom.toggleClass("mk-properties", true); }); + menu.addSeparator(); menu.addItem((menuItem) => { - menuItem.setIcon("add"); - menuItem.setTitle(i18n_default.labels.newProperty); + menuItem.setIcon("gem"); + menuItem.setTitle("Set Icon"); menuItem.onClick(() => { - newProperty(e4, space.path); + const vaultChangeModal = new stickerModal( + props2.plugin.app, + props2.plugin, + (emoji) => saveField({ ...field, attrs: emoji }) + ); + vaultChangeModal.open(); }); }); - if (space.type == "folder") { + if (hide) { + if (!hidden) { + menu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.hideProperty); + menuItem.onClick(() => { + hide(field, true); + }); + menuItem.setIcon("eye-off"); + }); + } else { + menu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.unhideProperty); + menuItem.onClick(() => { + hide(field, false); + }); + menuItem.setIcon("eye"); + }); + } } - if (props2.removeSpace && space.type == "tag") + if (editCode) { menu.addItem((menuItem) => { - menuItem.setIcon("trash"); - menuItem.setTitle(i18n_default.menu.removeFromSpace); + menuItem.setTitle(i18n_default.menu.editCode); menuItem.onClick(() => { - props2.removeSpace(space.path); + editCode(); }); + menuItem.setIcon("code"); }); - const offset2 = e4.target.getBoundingClientRect(); - menu.showAtPosition({ x: offset2.left, y: offset2.top + 30 }); - }; - const showAddMenu = (e4) => { - showSpacesMenu( - e4, - props2.plugin, - (link) => { - props2.addSpace(link); - }, - false, - true - ); - }; - const spacesFromPath = (path) => { - return [...props2.plugin.index.spacesMap.get(path)].map((f4) => props2.plugin.index.spacesIndex.get(f4)).filter((f4) => f4 && f4.type != "default" && f4.path != "/").sort( - (f4, k5) => path.startsWith(f4.path) ? -1 : path.startsWith(k5.path) ? 1 : 0 - ); - }; - const [spaces, setSpaces] = h2( - spacesFromPath(props2.path) - ); - const saveField = (source, field) => { - var _a2; - insertContextColumn( - props2.plugin, - (_a2 = spaces.find((f4) => f4.path == source)) == null ? void 0 : _a2.space, - field - ); - }; - const newProperty = (e4, space) => { - const offset2 = e4.target.getBoundingClientRect(); - showNewPropertyMenu( - props2.plugin, - { x: offset2.left, y: offset2.top + 30 }, - [], - [], - saveField, - "files", - space - ); - }; - const refreshSpaces = (evt) => { - if (evt.detail.type == "file" && evt.detail.name == props2.path || evt.detail.type == "space" && evt.detail.name == props2.path) { - setSpaces(spacesFromPath(props2.path)); - } - }; - p2(() => { - setSpaces(spacesFromPath(props2.path)); - window.addEventListener(eventTypes.spacesChange, refreshSpaces); - return () => { - window.removeEventListener(eventTypes.spacesChange, refreshSpaces); - }; - }, [props2.path]); - return spaces.length > 0 ? /* @__PURE__ */ Cn.createElement("div", { - className: "mk-tag-selector" - }, spaces.map((f4, i4) => { - var _a2; - return /* @__PURE__ */ Cn.createElement("div", { - key: i4, - onContextMenu: (e4) => showContextMenu(e4, f4), - onClick: (e4) => openSpace( - f4.path, - props2.plugin, - e4.ctrlKey || e4.metaKey ? e4.altKey ? "split" : "tab" : false - ), - style: ((_a2 = f4.color) == null ? void 0 : _a2.length) > 0 ? { - "--tag-background": f4.color, - "--tag-color": "var(--color-white)" - } : {} - }, /* @__PURE__ */ Cn.createElement("span", { - className: "cm-hashtag cm-hashtag-begin mk-space-icon" - }, /* @__PURE__ */ Cn.createElement("div", { - className: `mk-icon-xsmall`, - dangerouslySetInnerHTML: { - __html: stickerFromString(f4.sticker, props2.plugin) - } - })), /* @__PURE__ */ Cn.createElement("span", { - className: "cm-hashtag cm-hashtag-end" - }, f4.name)); - })) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); -}; - -// src/hooks/useLongPress.tsx -function isMouseEvent(e4) { - return e4 && "screenX" in e4; -} - -// src/components/UI/FileSticker/FileSticker.tsx -var import_obsidian22 = require("obsidian"); - -// src/components/UI/modals/vaultChangeModals.ts -var import_obsidian18 = require("obsidian"); -var VaultChangeModal = class extends import_obsidian18.Modal { - constructor(plugin, file, action, space) { - super(plugin.app); - this.file = file; - this.action = action; - this.plugin = plugin; - this.space = space; - } - onOpen() { - const { contentEl } = this; - let headerText; - if (this.action === "rename") { - headerText = i18n_default.labels.rename; - } else if (this.action === "create folder") { - headerText = i18n_default.labels.createFolder; - } else if (this.action === "create note") { - headerText = i18n_default.labels.createNote; - } - const headerEl = contentEl.createEl("div", { text: headerText }); - headerEl.addClass("modal-title"); - const inputEl = contentEl.createEl("input"); - inputEl.style.cssText = "width: 100%; height: 2.5em; margin-bottom: 15px;"; - if (this.action === "rename") { - if (this.file instanceof import_obsidian18.TFolder) { - inputEl.value = this.file.name; - } else { - inputEl.value = this.file.name.substring( - 0, - indexOfCharElseEOS(".", this.file.name) - ); - } } - inputEl.focus(); - let changeButtonText; - if (this.action === "rename") { - changeButtonText = i18n_default.buttons.rename; - } else if (this.action === "create folder") { - changeButtonText = i18n_default.buttons.createFolder; - } else if (this.action === "create note") { - changeButtonText = i18n_default.buttons.createNote; + if (deleteColumn) { + menu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.deleteProperty); + menuItem.onClick(() => { + deleteColumn(field); + }); + menuItem.setIcon("trash-2"); + }); } - const changeButton = contentEl.createEl("button", { - text: changeButtonText - }); - const cancelButton = contentEl.createEl("button", { - text: i18n_default.buttons.cancel - }); - cancelButton.style.cssText = "float: right;"; - cancelButton.addEventListener("click", () => { - this.close(); + menu.addSeparator(); + } + const sortableString = normalizedSortForType(field.type, false); + if (sortableString && sortColumn) { + menu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.sortAscending); + menuItem.setIcon("sort-asc"); + menuItem.onClick(() => { + sortColumn({ + field: field.name + field.table, + fn: normalizedSortForType(field.type, false) + }); + }); }); - const onClickAction = async () => { - const newName = inputEl.value; - if (this.action === "rename") { - renameFile(this.plugin, this.file, newName); - } else if (this.action === "create folder") { - const path = !this.file || this.file.path == "/" ? newName : this.file.path + "/" + newName; - if (getAbstractFileAtPath(this.plugin, path)) { - new import_obsidian18.Notice(i18n_default.notice.folderExists); - return; - } - this.app.vault.createFolder(path); - if (this.space) - insertSpaceItemAtIndex(this.plugin, this.space, path, 0); - } - this.close(); - }; - changeButton.addEventListener("click", onClickAction); - inputEl.addEventListener("keydown", (e4) => { - if (e4.key === "Enter") - onClickAction(); + menu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.sortDescending); + menuItem.setIcon("sort-desc"); + menuItem.onClick(() => { + sortColumn({ + field: field.name + field.table, + fn: normalizedSortForType(field.type, true) + }); + }); }); } - onClose() { - const { contentEl } = this; - contentEl.empty(); - } + menu.showAtPosition(position); + return menu; }; -var MoveSuggestionModal = class extends import_obsidian18.FuzzySuggestModal { - constructor(plugin, files) { - super(plugin.app); - this.files = files; - this.plugin = plugin; - } - getItemText(item) { - return item.path; - } - getItems() { - return getAllFoldersInVault(this.plugin); - } - onChooseItem(item, evt) { - this.files.forEach((f4) => { - const file = getAbstractFileAtPath(this.plugin, f4); - if (file) { - this.app.vault.rename(file, item.path + "/" + file.name); - } - }); + +// src/react/context/ContextEditorContext.tsx +var import_lodash5 = __toESM(require_lodash()); +var import_obsidian15 = require("obsidian"); + +// src/utils/contexts/predicate/filterFns/filterFnTypes.ts +var filterFnTypes = { + isNotEmpty: { + type: ["text", "file", "link", "link-multi", "fileprop", "image"], + fn: (v3, f4) => !empty2(v3, ""), + valueType: "none" + }, + isEmpty: { + type: ["text", "file", "link", "link-multi", "fileprop", "image"], + fn: (v3, f4) => empty2(v3, ""), + valueType: "none" + }, + include: { + fn: (v3, f4) => stringCompare(v3, f4), + type: ["text", "file", "link", "link-multi", "fileprop", "image"], + valueType: "text" + }, + notInclude: { + type: ["text", "file", "link", "link-multi", "fileprop", "image"], + fn: (v3, f4) => !stringCompare(v3, f4), + valueType: "text" + }, + is: { + type: ["text", "file", "link", "context", "fileprop"], + fn: (v3, f4) => stringEqual(v3, f4), + valueType: "text" + }, + isNot: { + type: ["text", "file", "link", "context", "fileprop"], + fn: (v3, f4) => !stringEqual(v3, f4), + valueType: "text" + }, + equal: { + type: ["number"], + fn: (v3, f4) => stringEqual(v3, f4), + valueType: "number" + }, + isGreatThan: { + type: ["number"], + fn: (v3, f4) => greaterThan(v3, f4), + valueType: "number" + }, + isLessThan: { + type: ["number"], + fn: (v3, f4) => lessThan(v3, f4), + valueType: "number" + }, + isLessThanOrEqual: { + type: ["number"], + fn: (v3, f4) => !greaterThan(v3, f4), + valueType: "number" + }, + isGreatThanOrEqual: { + type: ["number"], + fn: (v3, f4) => !lessThan(v3, f4), + valueType: "number" + }, + dateBefore: { + type: ["date", "fileprop"], + fn: (v3, f4) => lessThan(v3, f4), + valueType: "date" + }, + dateAfter: { + type: ["date", "fileprop"], + fn: (v3, f4) => greaterThan(v3, f4), + valueType: "date" + }, + isSameDateAsToday: { + type: ["date"], + fn: (v3, f4) => isSameDayAsToday(v3, f4), + valueType: "none" + }, + isAnyInList: { + type: ["option", "context", "option-multi", "context-multi", "tags-multi", "tags"], + fn: (v3, f4) => listIncludes(v3, f4), + valueType: "list" + }, + isNoneInList: { + type: ["option", "context", "option-multi", "context-multi", "tags-multi", "tags"], + fn: (v3, f4) => !listIncludes(v3, f4), + valueType: "list" + }, + isTrue: { + type: ["boolean"], + fn: (v3, f4) => v3 == "true", + valueType: "none" + }, + isFalse: { + type: ["boolean"], + fn: (v3, f4) => v3 != "true", + valueType: "none" } }; -// src/superstate/spacesStore/spaces.ts -var import_lodash7 = __toESM(require_lodash()); -var import_obsidian21 = require("obsidian"); - -// src/schemas/spaces.ts -var vaultSchema = { - uniques: ["path"], - cols: ["path", "parent", "created", "sticker", "color", "folder", "rank"], - rows: [] -}; - -// src/superstate/cacheParsers.ts -var import_lodash6 = __toESM(require_lodash()); - -// src/utils/defaultIconForExtension.ts -var defaultIconForExtension = (type, solid) => { - if (!type) - return solid ? "ui//mk-ui-folder-solid" : "ui//mk-ui-folder"; - switch (type) { - case "png": - case "jpg": - case "jpeg": - case "svg": - return "ui//mk-make-image"; - break; - case "mov": - case "webm": - return "ui//mk-ui-video"; - break; - case "canvas": - return "ui//mk-ui-canvas"; - default: - return solid ? "ui//mk-ui-file-solid" : "ui//mk-ui-file"; - } +// src/utils/contexts/predicate/filter.ts +var stringEqual = (value, filterValue) => { + return value == filterValue; }; - -// src/utils/spaces/query.ts -var filterFilesForAny = (files, filters) => { - const newArray = filters.reduce((p3, c4) => { - const [result, remaining] = p3; - const filteredFiles = c4.type == "fileprop" ? filterFileprop(remaining, c4) : c4.type == "filemeta" ? filterFilemeta(remaining, c4) : c4.type == "frontmatter" ? filterFM(remaining, c4) : []; - const diffArray = remaining.filter((x5) => !filteredFiles.includes(x5)); - return [[...result, ...filteredFiles], diffArray]; - }, [[], files]); - return newArray[0]; +var empty2 = (value, filterValue) => { + return (value != null ? value : "").length == 0; }; -var filterFilesForAll = (files, filters) => { - return filters.reduce((p3, c4) => { - return c4.type == "fileprop" ? filterFileprop(p3, c4) : c4.type == "filemeta" ? filterFilemeta(p3, c4) : c4.type == "frontmatter" ? filterFM(p3, c4) : []; - }, files); +var stringCompare = (value, filterValue) => { + return (value != null ? value : "").toLowerCase().includes((filterValue != null ? filterValue : "").toLowerCase()); }; -var filterFM = (files, def) => { - return files.filter((f4) => { - const fm = f4.frontmatter; - if (!fm || !fm[def.field]) { - return false; - } - const filterFn = filterFnTypes[def.fn]; - let result = true; - if (filterFn) { - result = filterFn.fn(parseFrontMatter(def.field, fm[def.field]), def.value); - } - return result; - }); +var greaterThan = (value, filterValue) => { + return parseFloat(value) > parseFloat(filterValue); }; -var filterFilemeta = (files, def) => { - return files.filter((f4) => { - let value = ""; - if (def.field == "outlinks") { - value = serializeMultiString(f4.outlinks); - } else if (def.field == "inlinks") { - value = serializeMultiString(f4.inlinks); - } else if (def.field == "tags") { - value = serializeMultiString(f4.tags); - } - const filterFn = filterFnTypes[def.fn]; - let result = true; - if (filterFn) { - result = filterFn.fn(value, def.value); - } - return result; - }); +var lessThan = (value, filterValue) => { + return parseInt(value) > parseInt(filterValue); }; -var filterFileprop = (files, def) => { - return files.filter((f4) => { - const vaultItemFields = ["name", "path", "sticker", "color", "isFolder", "extension", "ctime", "mtime", "size", "parent"]; - if (vaultItemFields.includes(def.field)) { - const filterFn = filterFnTypes[def.fn]; - let result = true; - if (filterFn) { - result = filterFn.fn(f4[def.field], def.value); - } - return result; - } - return true; - }); +var listIncludes = (value, filterValue) => { + const valueList = value ? parseMultiString(value) : []; + const strings = filterValue ? parseMultiString(filterValue) : []; + return strings.some((f4) => valueList.some((g4) => g4 == f4)); }; -var fileByDef = (filters, file) => { - const fileInFilter = filters.reduce((p3, c4) => { - if (!p3 || c4.filters.length == 0) - return p3; - const result = c4.type == "any" ? filterFilesForAny([file], c4.filters).length > 0 : filterFilesForAll([file], c4.filters).length > 0; - return result; - }, true); - return fileInFilter; +var isSameDayAsToday = (value) => { + const inputDate = new Date(`${value}T00:00`); + const currentDate = new Date(); + return inputDate.getMonth() === currentDate.getMonth() && inputDate.getDate() === currentDate.getDate(); }; - -// src/superstate/cacheParsers.ts -var fileMetadataToVaultItem = (cache) => { - var _a2, _b2; - return { - path: cache.path, - parent: cache.parent, - color: cache.color, - created: (_b2 = (_a2 = cache.ctime) == null ? void 0 : _a2.toString()) != null ? _b2 : "", - sticker: cache.sticker, - folder: cache.isFolder ? "true" : "false" - }; +var filterReturnForCol = (col, filter, row) => { + if (!col) + return true; + const filterType = filterFnTypes[filter == null ? void 0 : filter.fn]; + let result = true; + if (filterType && filterType.fn) { + result = filterType.fn(row[filter.field], filter.value); + } + return result; }; -// src/utils/metadata/tags.ts -var import_obsidian19 = require("obsidian"); -var tagKeys = ["tag", "tags", "Tag", "Tags"]; -var tagToTagPath = (tag) => { - if (!tag) - return null; - let string = tag; - if (string.charAt(0) != "#") - string = "#" + string; - return encodeSpaceName(string); -}; -var tagPathToTag = (string) => { - return filePathToString(string).replace(/\+/g, "/"); +// src/utils/contexts/predicate/predicate.tsx +var defaultPredicateFnForType = (type, types2) => { + const fnType = Object.keys(types2).find( + (f4) => types2[f4].type.find((g4) => g4 == type) + ); + return fnType; }; -var loadTags = (plugin) => { - var _a2; - const folder = plugin.settings.spacesFolder == "" ? plugin.app.vault.getRoot() : getAbstractFileAtPath( - plugin, - getFolderPathFromString(plugin, plugin.settings.spacesFolder) +var predicateFnsForType = (type, types2) => { + const fnTypes = Object.keys(types2).filter( + (f4) => types2[f4].type.find((g4) => g4 == type) ); - return uniq([ - ...Object.keys(plugin.app.metadataCache.getTags()), - ...(_a2 = folder == null ? void 0 : folder.children.filter( - (f4) => f4 instanceof import_obsidian19.TFile && f4.extension == "mdb" && f4.name.charAt(0) == "#" - ).map((f4) => tagPathToTag(f4.name))) != null ? _a2 : [] - ]); + return fnTypes; }; -var tagExists = (currentCache, findTag) => { - let currentTags = []; - if ((0, import_obsidian19.getAllTags)(currentCache)) { - currentTags = (0, import_obsidian19.getAllTags)(currentCache); +var cleanPredicateType = (type, definedTypes) => { + return type.filter((f4) => Object.keys(definedTypes).find((g4) => g4 == f4.fn)); +}; +var validatePredicate = (prevPredicate) => { + if (!prevPredicate) { + return defaultPredicate; } - return currentTags.find((tag) => tag.toLowerCase() == findTag.toLowerCase()) ? true : false; + return { + ...defaultPredicate, + view: prevPredicate.view, + frame: prevPredicate.frame, + frameProps: prevPredicate.frameProps, + filters: Array.isArray(prevPredicate.filters) ? cleanPredicateType(prevPredicate.filters, filterFnTypes) : [], + sort: Array.isArray(prevPredicate.sort) ? cleanPredicateType(prevPredicate.sort, sortFnTypes) : [], + groupBy: Array.isArray(prevPredicate.groupBy) ? prevPredicate.groupBy : [], + colsOrder: Array.isArray(prevPredicate.colsOrder) ? prevPredicate.colsOrder : [], + colsHidden: Array.isArray(prevPredicate.colsHidden) ? prevPredicate.colsHidden : [], + colsSize: prevPredicate.colsSize + }; }; -var getAllFilesForTag = (plugin, tag) => { - const tagsCache = []; - (() => { - plugin.app.vault.getMarkdownFiles().forEach((tfile) => { - let currentCache; - if (plugin.app.metadataCache.getFileCache(tfile) !== null) { - currentCache = plugin.app.metadataCache.getFileCache(tfile); +var defaultPredicate = { + view: "list", + filters: [], + frame: "", + frameProps: {}, + sort: [], + groupBy: [], + colsOrder: [], + colsHidden: [], + colsSize: {} +}; +var defaultTablePredicate = { + view: "table", + filters: [], + frame: "", + frameProps: {}, + sort: [], + groupBy: [], + colsOrder: [], + colsHidden: [], + colsSize: {} +}; + +// src/react/context/ContextMDBContext.tsx +var import_lodash4 = __toESM(require_lodash()); +var import_obsidian14 = require("obsidian"); +var ContextMDBContext = F({ + dbSchemas: [], + tableData: null, + contextTable: {}, + setContextTable: () => null, + saveDB: () => null, + saveContextDB: () => null, + dbSchema: null, + setDBSchema: () => null, + saveSchema: () => null, + deleteSchema: () => null, + dbFileExists: false +}); +var ContextMDBProvider = (props2) => { + var _a2, _b2; + const [dbFileExists, setDBFileExists] = h2(false); + const [schemaTable, setSchemaTable] = h2(null); + const schemas = (_a2 = schemaTable == null ? void 0 : schemaTable.rows) != null ? _a2 : []; + const [tableData, setTableData] = h2(null); + const [dbSchema, setDBSchema] = h2(null); + const [contextTable, setContextTable] = h2({}); + const [metadataCache, setMetadataCache] = h2(null); + const defaultSchema = defaultFolderSchema; + const { spaceInfo, readMode, spaceCache } = q2(SpaceContext); + const contexts = (_b2 = spaceCache == null ? void 0 : spaceCache.contexts) != null ? _b2 : []; + const deleteSchema = async (table) => { + if (table.primary) + return; + const deleteResult = await deleteMDBTable( + props2.plugin, + spaceInfo, + table.id, + spaceInfo.dbPath + ); + if (deleteResult) { + const newSchemaTable = { + ...schemaTable, + rows: schemaTable.rows.filter( + (f4) => f4.id != table.id && f4.def != table.id + ) + }; + setSchemaTable(newSchemaTable); + if (dbSchema.id == table.id) { + setDBSchema( + newSchemaTable.rows.find((g4) => g4.type == "db") + ); } - const relativePath = tfile.path; - const hasTag = tagExists(currentCache, tag); - if (hasTag) { - tagsCache.push(relativePath); + } + }; + const saveSchema = async (table) => { + const newSchema = schemaTable.rows.find((f4) => f4.id == table.id) ? true : false; + const newSchemaTable = newSchema ? { + ...schemaTable, + rows: schemaTable.rows.map((f4) => f4.id == table.id ? table : f4) + } : { + ...schemaTable, + rows: [...schemaTable.rows, table] + }; + if (!spaceInfo.readOnly) { + await saveSpaceDBToPath(props2.plugin, spaceInfo, "context", { + m_schema: newSchemaTable + }); + } + if (table.id == (dbSchema == null ? void 0 : dbSchema.id)) { + setDBSchema(table); + setTableData((f4) => ({ + ...f4, + schema: table + })); + } + setSchemaTable(newSchemaTable); + }; + p2(() => { + var _a3, _b3; + if (schemaTable) { + if (props2.schema) { + const preselectSchema = schemaTable.rows.find( + (g4) => g4.id == props2.schema + ); + if (preselectSchema) { + if (preselectSchema.type == "db") { + setDBSchema(preselectSchema); + return; + } else { + const preselectDBSchema = schemaTable.rows.find( + (g4) => g4.id == preselectSchema.def + ); + if (preselectDBSchema) { + setDBSchema(preselectDBSchema); + return; + } + } + } else { + const newSchema = { + id: uniqueNameFromString( + sanitizeTableName(props2.schema), + schemaTable.rows.map((g4) => g4.id) + ), + name: props2.schema, + type: "db" + }; + setDBSchema(newSchema); + saveSchema(newSchema).then(() => { + saveDB2({ + schema: newSchema, + cols: defaultTableFields.map((g4) => ({ + ...g4, + schemaId: newSchema.id + })), + rows: [] + }); + }); + } + } else { + if (!dbSchema) { + setDBSchema( + (_a3 = schemaTable.rows) == null ? void 0 : _a3.find((g4) => g4.id == "files") + ); + } else { + setDBSchema( + (_b3 = schemaTable.rows) == null ? void 0 : _b3.find((g4) => g4.id == dbSchema.id) + ); + } + } + } + }, [schemaTable]); + const loadTables = async () => { + if (!spaceInfo) + return; + const spaceExists = await props2.plugin.app.vault.adapter.exists( + spaceInfo.dbPath + ); + if (spaceExists || spaceInfo.isRemote) { + setDBFileExists(true); + getMDBTableSchemas(props2.plugin, spaceInfo, "context").then((f4) => { + if (f4) + setSchemaTable(() => ({ + ...defaultSchema, + rows: f4 + })); + }); + } else { + setDBFileExists(false); + if (props2.schema) { + const tableData2 = defaultTableDataForContext(props2.plugin, spaceInfo); + if (tableData2) { + setSchemaTable(defaultSchema); + } + } else { + setSchemaTable(defaultSchema); + setDBSchema(defaultFileDBSchema); + } + } + }; + const refreshFile = T2(async (file) => { + var _a3; + if (file.path == props2.file && dbSchema) { + const fCache = (_a3 = props2.plugin.app.metadataCache.getCache( + file.path + )) == null ? void 0 : _a3.frontmatter; + if ((0, import_lodash4.isEqual)(fCache, metadataCache)) + return; + setMetadataCache(fCache); + if (dbSchema.primary) { + runDef(); + } else { + getMDBData(); } + } + }, []); + const loadContextFields = T2(async (tag) => { + getMDBTable( + props2.plugin, + spaceFromTag(props2.plugin, tag), + "files", + "context" + ).then((f4) => { + setContextTable((t4) => ({ + ...t4, + [tag]: f4 + })); }); - })(); - return tagsCache; -}; -var addTagToNote = (plugin, tag, tFile) => { - const newTag = validateName(tag); - editTagInFrontmatter(plugin, "", newTag, tFile); -}; -var positionsForTag = (plugin, tag, file) => { - const currentCache = plugin.app.metadataCache.getFileCache(file); - if (currentCache.tags) { - const positions = currentCache.tags.filter((f4) => f4.tag == tag).map((f4) => f4.position).sort((a5, b4) => { - if (a5.start.offset < b4.start.offset) { - return -1; + }, []); + const refreshTags = async (tags) => { + if (contexts.some((f4) => tags.some((g4) => g4 == f4))) + if (dbSchema.primary) { + runDef(); + } else { + getMDBData(); + } + }; + const refreshMDB = T2( + async (contextPath) => { + if ((dbSchema == null ? void 0 : dbSchema.primary) != "true") { + return; + } + if (contextPath == spaceInfo.path) { + if (dbSchema) { + loadTables(); + } + } else { + const tag = Object.keys(contextTable).find( + (t4) => spaceFromTag(props2.plugin, t4).path == contextPath + ); + if (tag) + loadContextFields(tag); + } + }, + [ + contextTable, + dbFileExists, + dbSchema, + loadContextFields, + loadTables, + props2.plugin, + spaceInfo + ] + ); + const refreshSpace = T2( + async (evt) => { + if (evt.detail.type == "context") { + refreshMDB(evt.detail.name); + return; } - if (a5.start.offset > b4.start.offset) { - return 1; + if (evt.detail.type == "file") { + refreshFile(getAbstractFileAtPath(props2.plugin, evt.detail.name)); + return; } - return 0; + if ((evt.detail.type == "space" || evt.detail.type == "vault") && !dbFileExists) { + const defaultTable = defaultTableDataForContext( + props2.plugin, + spaceInfo + ); + if (defaultTable) + setTableData(defaultTable); + } else if (evt.detail.type == "vault") { + refreshMDB(spaceInfo.path); + } + }, + [dbFileExists, props2.plugin, refreshFile, refreshMDB, spaceInfo] + ); + const getMDBData = () => { + getMDBTable(props2.plugin, spaceInfo, dbSchema.id, "context").then((f4) => { + setTableData(f4); }); - return positions; - } - return []; -}; -var removeTagFromFile = (plugin, tag, file) => { - const pos = positionsForTag(plugin, tag, file); - removeTagInFrontmatter(plugin, tag, file); - editTagInFileBody(plugin, tag, "", pos, file); -}; -var validateName = (tag) => { - return tag.trim(); -}; -var renameTag = async (plugin, tag, toTag) => { - const tags = getAllSubtags(plugin, tag); - const newTag = validateName(toTag); - const files = getAllFilesForTag(plugin, tag); - for (const file of files) { - const tFile = getAbstractFileAtPath(plugin, file); - if (tFile instanceof import_obsidian19.TFile) { - const positions = positionsForTag(plugin, tag, tFile); - if (positions.length > 0) { - await editTagInFileBody(plugin, tag, newTag, positions, tFile); + }; + p2(() => { + window.addEventListener(eventTypes.spacesChange, refreshSpace); + return () => { + window.removeEventListener(eventTypes.spacesChange, refreshSpace); + }; + }, [refreshSpace]); + p2(() => { + loadTables(); + }, [spaceInfo]); + const saveDB2 = async (newTable) => { + var _a3, _b3; + if (spaceInfo.readOnly) + return; + if (!dbFileExists) { + const defaultFields = defaultFieldsForContext(spaceInfo); + const defaultTable = defaultTablesForContext(spaceInfo); + const dbField = { + ...defaultTable, + m_fields: { + uniques: defaultFields.uniques, + cols: defaultFields.cols, + rows: [...(_a3 = defaultFields.rows) != null ? _a3 : [], ...(_b3 = newTable == null ? void 0 : newTable.cols) != null ? _b3 : []] + }, + [newTable.schema.id]: { + uniques: newTable.cols.filter((c4) => c4.unique == "true").map((c4) => c4.name), + cols: newTable.cols.map((c4) => c4.name), + rows: newTable.rows + } + }; + await saveSpaceDBToPath(props2.plugin, spaceInfo, "context", dbField).then( + (f4) => { + setDBFileExists(true); + f4 ? setTableData(newTable) : new import_obsidian14.Notice("DB ERROR"); + } + ); + } else { + await saveMDBToPath(props2.plugin, spaceInfo, newTable).then((f4) => { + f4 ? setTableData(newTable) : new import_obsidian14.Notice("DB ERROR"); + }); + } + }; + p2(() => { + if (!schemaTable || !dbSchema) + return; + if (dbFileExists) { + if (dbSchema.primary) { + runDef(); } else { - await editTagInFrontmatter(plugin, tag, newTag, tFile); + getMDBData(); } + } else { + const defaultTable = defaultTableDataForContext(props2.plugin, spaceInfo); + if (defaultTable) + setTableData(defaultTable); } - } - await renameSpaceFolder(plugin, tag, toTag); - plugin.index.renameTag(tag, toTag); - for (const subtag of tags) { - await renameTag(plugin, subtag, subtag.replace(tag, newTag)); - } -}; -var getAllSubtags = (plugin, tag) => { - const tags = loadTags(plugin); - return tags.filter((f4) => f4.startsWith(tag) && f4 != tag); -}; -var getAllParentTags = (str) => { - if (str.startsWith("#")) { - str = str.slice(1); - } - const parts = str.split("/"); - const result = []; - for (let i4 = 0; i4 < parts.length - 1; i4++) { - if (i4 === 0) { - result.push(parts[i4]); + }, [dbSchema]); + p2(() => { + if (dbFileExists && tableData) + getContextTags(tableData); + }, [tableData]); + const getContextTags = async (_tableData) => { + const contextFields = _tableData.cols.filter((f4) => f4.type.contains("context")).map((f4) => f4.value).filter((f4) => !contexts.some((g4) => g4 == f4)); + for (const c4 of contextFields) { + loadContextFields(c4); + } + }; + const runDef = async () => { + if (spaceInfo.uri.type == "folder") { + getMDBTable(props2.plugin, spaceInfo, "files", "context").then((f4) => { + if (f4) { + for (const c4 of contexts) { + loadTagContext(c4, f4.rows); + } + setTableData(f4); + } + return f4; + }); + } else if (spaceInfo.uri.type == "tag") { + getMDBTable(props2.plugin, spaceInfo, "files", "context").then((f4) => { + if (f4) { + for (const c4 of contexts) { + loadTagContext(c4, f4.rows); + } + setTableData(f4); + } + return f4; + }); + } else if (spaceInfo.uri.type == "space") { + getMDBTable(props2.plugin, spaceInfo, "files", "context").then((f4) => { + if (f4) + setTableData(f4); + return f4; + }); } else { - result.push(result[i4 - 1] + "/" + parts[i4]); + getMDBTable(props2.plugin, spaceInfo, dbSchema.id, "context").then((f4) => { + if (f4) + setTableData(f4); + }); } - } - return result; + }; + const loadTagContext = async (tag, files) => { + getMDBTable( + props2.plugin, + spaceFromTag(props2.plugin, tag), + "files", + "context" + ).then((f4) => { + if (f4) { + const contextFields = f4.cols.filter((g4) => g4.type.contains("context")).map((g4) => g4.value).filter((g4) => !contexts.some((h5) => h5 == g4)); + for (const c4 of contextFields) { + loadContextFields(c4); + } + setContextTable((t4) => ({ + ...t4, + [tag]: f4 + })); + } + }); + }; + const saveContextDB = async (newTable, tag) => { + const context = spaceFromTag(props2.plugin, tag); + await saveMDBToPath(props2.plugin, context, newTable).then( + (f4) => f4 && setContextTable((t4) => ({ + ...t4, + [tag]: newTable + })) + ); + }; + return /* @__PURE__ */ Cn.createElement(ContextMDBContext.Provider, { + value: { + tableData, + contextTable, + setContextTable, + saveDB: saveDB2, + saveContextDB, + dbSchemas: schemas, + saveSchema, + deleteSchema, + dbFileExists, + dbSchema, + setDBSchema + } + }, props2.children); }; -var removeTagInFrontmatter = async (plugin, oldTag, file) => { + +// src/react/context/ContextEditorContext.tsx +var ContextEditorContext = F({ + cols: [], + data: [], + schema: null, + views: [], + setSchema: () => null, + sortedColumns: [], + filteredData: [], + contextTable: {}, + selectedRows: [], + selectRows: () => null, + setContextTable: () => null, + predicate: defaultPredicate, + savePredicate: () => null, + saveContextDB: () => null, + hideColumn: () => null, + saveColumn: () => false, + newColumn: () => false, + sortColumn: () => null, + delColumn: () => null, + searchString: "", + setSearchString: () => null, + loadContextFields: () => null, + updateValue: () => null, + updateFieldValue: () => null +}); +var ContextEditorProvider = (props2) => { var _a2; - let fm; - if (plugin.app.metadataCache.getFileCache(file) !== null) { - fm = (_a2 = plugin.app.metadataCache.getFileCache(file)) == null ? void 0 : _a2.frontmatter; - } - if (fm && plugin.metadata.canProcessFrontmatter()) { - const processKey = (value) => { - if (Array.isArray(value)) { - return value.filter((f4) => stringFromTag(oldTag) != f4); - } else if (typeof value === "string") { - return serializeMultiDisplayString( - value.replace(/\s/g, "").split(",").filter((f4) => stringFromTag(oldTag) != f4) - ); - } - return value; + const { spaceInfo, spaceCache } = q2(SpaceContext); + const contexts = (_a2 = spaceCache == null ? void 0 : spaceCache.contexts) != null ? _a2 : []; + const { dbFileExists, dbSchema, saveDB: saveDB2, tableData } = q2(ContextMDBContext); + const { frameSchemas, saveSchema } = q2(FramesMDBContext); + const [schema, setSchema] = h2(defaultFileListSchema); + const [searchString, setSearchString] = h2(null); + const [contextTable, setContextTable] = h2({}); + const [predicate, setPredicate] = h2(defaultPredicate); + const [selectedRows, setSelectedRows] = h2([]); + const views = F2(() => { + const _views = frameSchemas.filter( + (f4) => f4.type == "view" && f4.def.db == (dbSchema == null ? void 0 : dbSchema.id) + ); + return _views.length > 0 ? _views : schema ? [schema] : []; + }, [frameSchemas, schema]); + const getSchema = (_schemaTable, _dbSchema, _currentSchema) => { + var _a3, _b2; + let _schema; + if (props2.schema) { + _schema = _schemaTable.find((f4) => f4.id == props2.schema); + } else { + _schema = ((_a3 = _currentSchema == null ? void 0 : _currentSchema.def) == null ? void 0 : _a3.db) == _dbSchema.id ? _schemaTable.find((f4) => f4.id == _currentSchema.id) : (_b2 = _schemaTable.find((f4) => { + var _a4; + return ((_a4 = f4.def) == null ? void 0 : _a4.db) == _dbSchema.id; + })) != null ? _b2 : { + ..._dbSchema, + id: uniqueNameFromString( + _dbSchema.id + "View", + _schemaTable.map((f4) => f4.id) + ), + type: "view", + def: { db: _dbSchema.id }, + predicate: JSON.stringify( + _dbSchema.primary == "true" ? defaultPredicate : defaultTablePredicate + ) + }; + } + return _schema; + }; + p2(() => { + if (!dbSchema) + return; + const _schema = getSchema(frameSchemas, dbSchema, schema); + if (_schema) { + setSchema(_schema); + } + }, [dbSchema, frameSchemas, props2.schema]); + const cols = F2( + () => { + var _a3; + return tableData ? [ + ...(_a3 = tableData.cols.map((f4) => ({ ...f4, table: "" }))) != null ? _a3 : [], + ...(dbSchema == null ? void 0 : dbSchema.primary) == "true" ? contexts.reduce( + (p3, c4) => { + var _a4, _b2; + return [ + ...p3, + ...(_b2 = (_a4 = contextTable[c4]) == null ? void 0 : _a4.cols.filter( + (f4) => f4.name != FilePropertyName && f4.type != "fileprop" + ).map((f4) => ({ ...f4, table: c4 }))) != null ? _b2 : [] + ]; + }, + [] + ) : [] + ] : []; + }, + [tableData, contextTable, contexts] + ); + const data2 = F2( + () => { + var _a3; + return (_a3 = tableData == null ? void 0 : tableData.rows.map( + (r3, index) => linkContextRow( + props2.plugin, + { + _index: index.toString(), + ...r3, + ...contexts.reduce((p3, c4) => { + var _a4, _b2, _c2, _d2; + const contextRowIndexByFile = (_b2 = (_a4 = contextTable[c4]) == null ? void 0 : _a4.rows.findIndex((f4) => f4.File == r3.File)) != null ? _b2 : -1; + const contextRowsByFile = (_d2 = (_c2 = contextTable[c4]) == null ? void 0 : _c2.rows[contextRowIndexByFile]) != null ? _d2 : {}; + const contextRowsWithKeysAppended = Object.keys( + contextRowsByFile + ).reduce( + (pa, ca) => ({ ...pa, [ca + c4]: contextRowsByFile[ca] }), + { + ["_index" + c4]: contextRowIndexByFile.toString() + } + ); + return { ...p3, ...contextRowsWithKeysAppended }; + }, {}) + }, + cols + ) + )) != null ? _a3 : []; + }, + [tableData, schema, contextTable] + ); + const sortedColumns = F2(() => { + return cols.filter( + (f4) => f4.hidden != "true" && !predicate.colsHidden.some((c4) => c4 == f4.name + f4.table) + ).sort( + (a5, b4) => predicate.colsOrder.findIndex((x5) => x5 == a5.name + a5.table) - predicate.colsOrder.findIndex((x5) => x5 == b4.name + b4.table) + ); + }, [cols, predicate]); + const filteredData = F2( + () => data2.filter((f4) => { + return predicate.filters.reduce((p3, c4) => { + return p3 ? filterReturnForCol( + cols.find((col) => col.name + col.table == c4.field), + c4, + f4 + ) : p3; + }, true); + }).filter( + (f4) => (searchString == null ? void 0 : searchString.length) > 0 ? matchAny(searchString).test( + Object.keys(f4).filter((g4) => g4.charAt(0) != "_").map((g4) => f4[g4]).join("|") + ) : true + ).sort((a5, b4) => { + return predicate.sort.reduce((p3, c4) => { + return p3 == 0 ? sortReturnForCol( + cols.find((col) => col.name + col.table == c4.field), + c4, + a5, + b4 + ) : p3; + }, 0); + }), + [predicate, data2, cols, searchString] + ); + const updateValue2 = (column, value, table, index, file) => { + var _a3, _b2; + const col = (_a3 = table == "" ? tableData : contextTable[table]) == null ? void 0 : _a3.cols.find( + (f4) => f4.name == column + ); + if (col) + saveFrontmatterValue( + props2.plugin, + file != null ? file : (_b2 = tableData.rows[index]) == null ? void 0 : _b2.File, + column, + value, + col.type, + props2.plugin.settings.saveAllContextToFrontmatter + ); + if (table == "") { + saveDB2({ + ...tableData, + rows: tableData.rows.map( + (r3, i4) => i4 == index ? { + ...r3, + [column]: value + } : r3 + ) + }); + } else if (contextTable[table]) { + saveContextDB( + { + ...contextTable[table], + rows: contextTable[table].rows.map( + (r3, i4) => i4 == index ? { + ...r3, + [column]: value + } : r3 + ) + }, + table + ); + } + }; + const sortColumn = (sort) => { + savePredicate({ + ...predicate, + sort: [sort] + }); + }; + const hideColumn = (col, hidden) => { + savePredicate({ + ...predicate, + colsHidden: hidden ? [ + ...predicate.colsHidden.filter((s5) => s5 != col.name + col.table), + col.name + col.table + ] : predicate.colsHidden.filter((s5) => s5 != col.name + col.table) + }); + }; + const updateFieldValue = (column, fieldValue, value, table, index, file) => { + var _a3; + const col = tableData.cols.find((f4) => f4.name == column); + saveFrontmatterValue( + props2.plugin, + file != null ? file : (_a3 = tableData.rows[index]) == null ? void 0 : _a3.File, + column, + value, + col.type, + props2.plugin.settings.saveAllContextToFrontmatter + ); + if (table == "") { + const newTable = { + ...tableData, + cols: tableData.cols.map( + (m5) => m5.name == column ? { + ...m5, + value: fieldValue + } : m5 + ), + rows: tableData.rows.map( + (r3, i4) => i4 == index ? { + ...r3, + [column]: value + } : r3 + ) + }; + saveDB2(newTable); + } else if (contextTable[table]) { + saveContextDB( + { + ...contextTable[table], + cols: contextTable[table].cols.map( + (m5) => m5.name == column ? { + ...m5, + value: fieldValue + } : m5 + ), + rows: contextTable[table].rows.map( + (r3, i4) => i4 == index ? { + ...r3, + [column]: value + } : r3 + ) + }, + table + ); + } + }; + const syncAllMetadata = (f4) => { + const files = f4.rows.map((f5) => f5.File); + const importYAML = (files2, fmKeys) => { + return files2.map((f5) => getAbstractFileAtPath(props2.plugin, f5)).filter((f5) => f5).reduce( + (p3, c4) => { + const fm = frontMatterForFile(props2.plugin, c4); + if (!fm) + return p3; + return { + uniques: [], + cols: uniq([...p3.cols, ...fmKeys]), + rows: [ + ...p3.rows, + { + File: c4.path, + ...fmKeys.reduce((p4, c5) => { + const value = parseFrontMatter(c5, fm[c5]); + if ((value == null ? void 0 : value.length) > 0) + return { ...p4, [c5]: value }; + return p4; + }, {}) + } + ] + }; + }, + { uniques: [], cols: [], rows: [] } + ); }; - const editKeys = tagKeys.filter((f4) => { - let tags = []; - if (Array.isArray(fm[f4])) { - tags = fm[f4]; - } else if (typeof fm[f4] === "string") { - tags = fm[f4].replace(/\s/g, "").split(","); + const yamlTableData = importYAML( + files, + f4.cols.filter((f5) => !f5.type.contains("file")).map((f5) => f5.name) + ); + const newRows = f4.rows.map((r3) => { + const fmRow = yamlTableData.rows.find((f5) => f5.File == r3.File); + if (fmRow) { + return { + ...r3, + ...fmRow + }; } - if (tags.find((g4) => g4 == stringFromTag(oldTag))) - return true; - return false; + return r3; }); - editKeys.forEach((tag) => { - plugin.metadata.processFrontMatter(file.path, (frontmatter) => { - frontmatter[tag] = processKey(fm[tag]); + const rowsChanged = !import_lodash5.default.isEqual(newRows, tableData == null ? void 0 : tableData.rows); + const colsChanged = !import_lodash5.default.isEqual(tableData == null ? void 0 : tableData.cols, f4.cols); + if (rowsChanged || colsChanged) { + saveDB2({ + ...f4, + rows: newRows }); - }); - } -}; -var editTagInFrontmatter = async (plugin, oldTag, newTag, file) => { - var _a2; - let fm; - if (plugin.app.metadataCache.getFileCache(file) !== null) { - fm = (_a2 = plugin.app.metadataCache.getFileCache(file)) == null ? void 0 : _a2.frontmatter; - } - const addTag = (plugin2, value) => { - if (Array.isArray(value)) { - return uniq([...value, stringFromTag(newTag)]).filter((f4) => (f4 == null ? void 0 : f4.length) > 0); - } else if (typeof value === "string") { - return serializeMultiDisplayString(uniq([ - ...value.replace(/\s/g, "").split(","), - stringFromTag(newTag) - ]).filter((f4) => (f4 == null ? void 0 : f4.length) > 0)); } - return stringFromTag(newTag); }; - if (plugin.metadata.canProcessFrontmatter()) { - if (fm) { - const processKey = (value) => { - if (Array.isArray(value)) { - return uniq( - value.map( - (f4) => stringFromTag(oldTag) == f4 ? stringFromTag(newTag) : f4 - ) - ); - } else if (typeof value === "string") { - return serializeMultiDisplayString(uniq( - value.replace(/\s/g, "").split(",").map( - (f4) => stringFromTag(oldTag) == f4 ? stringFromTag(newTag) : f4 - ) - )); - } - return value; - }; - const editKeys = tagKeys.filter((f4) => { - let tags = []; - if (Array.isArray(fm[f4])) { - tags = fm[f4]; - } else if (typeof fm[f4] === "string") { - tags = fm[f4].replace(/\s/g, "").split(","); - } - if (tags.find((g4) => g4 == stringFromTag(oldTag))) - return true; - return false; - }); - if (editKeys.length > 0) { - editKeys.forEach((key2) => { - plugin.metadata.processFrontMatter(file.path, (frontmatter) => { - frontmatter[key2] = processKey(fm[key2]); - }); - }); - } else { - plugin.metadata.processFrontMatter(file.path, (frontmatter) => { - frontmatter["tags"] = addTag(plugin, fm["tags"]); - }); - } - } else { - plugin.metadata.processFrontMatter(file.path, (frontmatter) => { - frontmatter["tags"] = stringFromTag(newTag); - }); + const refreshSpace = async (evt) => { + if (evt.detail.type == "context") { + refreshMDB(evt.detail.name); + return; } - } -}; -var editTagInFileBody = async (plugin, oldTag, newTag, positions, file) => { - const offsetOffset = newTag.length - oldTag.length; - if (positions.length == 0) - return false; - const original = await plugin.app.vault.read(file); - let text2 = original; - let offset2 = 0; - for (const { start, end } of positions) { - const startOff = start.offset + offset2; - const endOff = end.offset + offset2; - if (text2.slice(startOff, endOff) !== oldTag) { - return false; + if (evt.detail.type == "vault") { + refreshMDB(spaceInfo.path); } - text2 = text2.slice(0, startOff) + newTag + text2.slice(startOff + oldTag.length); - offset2 += offsetOffset; - } - if (text2 !== original) { - await plugin.app.vault.modify(file, text2); - return true; - } -}; - -// src/utils/tree.ts -var import_obsidian20 = require("obsidian"); -var nodeIsAncestorOfTarget = (path, target) => { - if (target.type == "folder" && path.type == "folder") - return target.path.startsWith(path.path); - return false; -}; -var excludeVaultItemPredicate = (settings) => (f4, index, folder) => !(f4.folder != "true" && settings.hiddenExtensions.find( - (e4) => f4.path.endsWith(e4) -)) && !settings.hiddenFiles.find((e4) => e4 == f4.path) && (!settings.enableFolderNote || !settings.folderNoteInsideFolder && !folder.some((g4) => g4.path + ".md" == f4.path) || settings.folderNoteInsideFolder && !(f4.parent + "/" + folderPathToString(f4.parent) + ".md" == f4.path)); -var excludeFilePredicate = (plugin) => (f4) => f4 && !(f4 instanceof import_obsidian20.TFile && plugin.settings.hiddenExtensions.some((e4) => f4.extension == e4)) && !f4.path.startsWith(plugin.settings.spacesFolder + "/#") && !plugin.settings.hiddenFiles.some((e4) => e4 == f4.path) && (!f4.parent || !plugin.settings.enableFolderNote || !plugin.settings.folderNoteInsideFolder && !f4.parent.children.some((g4) => g4.path + ".md" == f4.path) || plugin.settings.folderNoteInsideFolder && !((f4.parent.path == "/" ? plugin.systemName() + ".md" : f4.parent.path + "/" + f4.parent.name + ".md") == f4.path)); -var folderChildren = (plugin, f4, exclusionList) => { - var _a2, _b2; - return (_b2 = (_a2 = f4 == null ? void 0 : f4.children) == null ? void 0 : _a2.filter(excludeFilePredicate(plugin))) != null ? _b2 : []; -}; -var compareByField = (field, dir) => (_a2, _b2) => { - const a5 = dir ? _a2 : _b2; - const b4 = dir ? _b2 : _a2; - if (a5[field] < b4[field]) { - return -1; - } - if (a5[field] > b4[field]) { - return 1; - } - return 0; -}; -var compareByFieldCaseInsensitive = (field, dir) => (_a2, _b2) => { - var _a3, _b3, _c2, _d2; - const a5 = dir ? _a2 : _b2; - const b4 = dir ? _b2 : _a2; - if (((_a3 = a5[field]) == null ? void 0 : _a3.toLowerCase()) < ((_b3 = b4[field]) == null ? void 0 : _b3.toLowerCase())) { - return -1; - } - if (((_c2 = a5[field]) == null ? void 0 : _c2.toLowerCase()) > ((_d2 = b4[field]) == null ? void 0 : _d2.toLowerCase())) { - return 1; - } - return 0; -}; -var internalPluginLoaded = (pluginName, app2) => { - var _a2; - return (_a2 = app2.internalPlugins.plugins[pluginName]) == null ? void 0 : _a2._loaded; -}; -function selectElementContents(el) { - if (!el) - return; - const range = document.createRange(); - range.selectNodeContents(el); - const sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(range); -} - -// src/superstate/spacesStore/spaces.ts -var spaceContextsKey = (plugin) => plugin.settings.fmKeyContexts; -var spaceFilterKey = (plugin) => plugin.settings.fmKeyFilter; -var spaceLinksKey = (plugin) => plugin.settings.fmKeyLinks; -var spaceSortKey = (plugin) => plugin.settings.fmKeySort; -var FMSpaceKeys = (plugin) => [spaceContextsKey(plugin), spaceFilterKey(plugin), spaceLinksKey(plugin), spaceSortKey(plugin)]; -var parseSpaceSort = (value) => { - var _a2; - return { - field: ensureString((_a2 = value == null ? void 0 : value["field"]) != null ? _a2 : "rank"), - asc: ensureBoolean(value == null ? void 0 : value["asc"]), - group: ensureBoolean(value == null ? void 0 : value["group"]) - }; -}; -var parseSpaceFilterGroupFilter = (value) => { - return { - type: ensureStringValueFromSet(value["type"], ["frontmatter", "fileprop", "filemeta"], "frontmatter"), - fType: ensureString(value["fType"]), - field: ensureString(value["field"]), - fn: ensureString(value["fn"]), - value: ensureString(value["value"]) - }; -}; -var parseSpaceFilterGroup = (value) => { - return { - type: ensureStringValueFromSet(value["type"], ["any", "all"], "any"), - trueFalse: value["truefalse"] ? true : false, - filters: ensureArray(value["filters"]).map((f4) => parseSpaceFilterGroupFilter(f4)) - }; -}; -var parseSpaceMetadata = (metadata, spaceInfo, plugin) => { - return { ...metadata, sort: parseSpaceSort(metadata[spaceSortKey(plugin)]), contexts: ensureArray(metadata[spaceContextsKey(plugin)]), links: ensureArray(metadata[spaceLinksKey(plugin)]), filters: ensureArray(metadata[spaceFilterKey(plugin)]).map((f4) => parseSpaceFilterGroup(f4)) }; -}; -var rebuildIndex = async (plugin, save) => { - var _a2; - console.time("Make.md Vault Index"); - const newTables = indexCurrentFileTree(plugin, (_a2 = plugin.index.vaultDBCache) != null ? _a2 : []); - if (save && !import_lodash7.default.isEqual(newTables.vault.rows, plugin.index.vaultDBCache)) { - await plugin.index.saveSpacesDatabaseToDisk(newTables, save); - } - plugin.index.initialize(); - console.timeEnd("Make.md Vault Index"); -}; -var spaceToTreeNode = (space, collapsed, sortable, depth, parentId, parentPath, childrenCount, hasChildren) => { - var _a2; - return { - id: parentId ? parentId + "/" + space.path : space.path, - parentId, - depth, - index: 0, - space: parentPath, - path: space.path, - item: space, - uri: (_a2 = space.space) == null ? void 0 : _a2.uri, - collapsed, - sortable, - childrenCount, - type: "space", - leaf: false }; -}; -var vaulItemToTreeNode = (plugin, item, space, path, depth, i4, collapsed, sortable, childrenCount, parentId) => ({ - item, - file: getAbstractFileAtPath(plugin, item.path), - space, - id: parentId + "/" + item.filename, - parentId, - depth, - path, - index: i4, - uri: uriByString(plugin, item.path), - collapsed, - sortable, - childrenCount, - type: "file", - leaf: true -}); -var spaceRowHeight = (plugin) => { - return platformIsMobile() ? 40 : plugin.settings.spaceRowHeight; -}; -var spaceSortFn = (sortStrategy) => (a5, b4) => { - if (sortStrategy.field == "rank") { - return a5.rank - b4.rank; - } - const sortFns = []; - if (sortStrategy.group) { - sortFns.push(compareByField("cacheType", false)); - } - if (sortStrategy.field == "name") { - sortFns.push(compareByFieldCaseInsensitive(sortStrategy.field, sortStrategy.asc)); - } else { - sortFns.push(compareByField(sortStrategy.field, sortStrategy.asc)); - } - return sortFns.reduce((p3, c4) => { - return p3 == 0 ? c4(a5, b4) : p3; - }, 0); -}; -var flattenedTreeFromVaultItems = (plugin, root, openNodes, depth, sortStrategy) => { - const _caches = plugin.index.getSpaceItems(root); - if (!_caches) { - return []; - } - const flattenNavigatorTree = (path, openNodes2, depth2, index, folderSort, caches) => { - const items = []; - let i4 = index; - const sortStrat = folderSort.length > 0 ? parseSortStrat(folderSort) : sortStrategy; - caches.sort(spaceSortFn(sortStrat)).forEach( - (item) => { - if (item.cacheType == "file") { - item = item; - const id2 = path + "/" + item.filename; - const collapsed = !openNodes2.includes(id2); - i4 = i4 + 1; - const newItems = []; - const newCaches = plugin.index.getSpaceItems(item.path); - if (newCaches && !collapsed) { - newItems.push( - ...flattenNavigatorTree(item.path, openNodes2, depth2 + 1, i4, item.sortBy, newCaches) - ); - } - const node = vaulItemToTreeNode( - plugin, - item, - item.path, - path, - depth2, - i4, - collapsed, - sortStrategy.field == "rank", - newItems.length, - path - ); - if (node.file) - newItems.splice(0, 0, node); - items.push(...newItems); - } else { - const collapsed = !openNodes2.includes(item.path); - items.push(spaceToTreeNode(item, collapsed, sortStrategy.field == "rank", depth2, path, item.path, 0, false)); - } - } + const refreshMDB = async (contextPath) => { + if (!dbFileExists || (dbSchema == null ? void 0 : dbSchema.primary) != "true") { + return; + } + const tag = Object.keys(contextTable).find( + (t4) => spaceFromTag(props2.plugin, t4).path == contextPath ); - return items; - }; - return flattenNavigatorTree(root, openNodes, depth, 0, "", _caches); -}; -var vaultItemForPath = (plugin, path) => { - if (!path) - return null; - return plugin.index.vaultDBCache.find((f4) => f4.path == path); -}; -var saveFileSticker = async (plugin, path, sticker) => { - if (plugin.settings.spacesEnabled) { - const newVaultDB = plugin.index.vaultDBCache.map((f4) => f4.path == path ? { ...f4, sticker } : f4); - await plugin.index.saveSpacesDatabaseToDisk({ vault: { ...vaultSchema, rows: newVaultDB } }); - } - saveFrontmatterValue( - plugin, - path, - plugin.settings.fmKeySticker, - sticker, - "text", - true - ); - plugin.index.reloadFile(getAbstractFileAtPath(plugin, path)).then((f4) => plugin.index.broadcast("space")); -}; -var saveFileColor = async (plugin, path, color) => { - if (plugin.settings.spacesEnabled) { - const newVaultDB = plugin.index.vaultDBCache.map((f4) => f4.path == path ? { ...f4, color } : f4); - await plugin.index.saveSpacesDatabaseToDisk({ vault: { ...vaultSchema, rows: newVaultDB } }); - } - saveFrontmatterValue( - plugin, - path, - plugin.settings.fmKeyColor, - color, - "text", - true - ); - plugin.index.reloadFile(getAbstractFileAtPath(plugin, path)).then((f4) => plugin.index.broadcast("space")); -}; -var saveSpaceColor = async (plugin, path, color) => { - await saveSpaceMetadataValue(plugin, path, "color", color); - plugin.index.broadcast("space"); -}; -var saveSpaceSticker = async (plugin, path, sticker) => { - await saveSpaceMetadataValue(plugin, path, "sticker", sticker); - plugin.index.broadcast("space"); -}; -var updateFileRank = async (plugin, path, rank, space) => { - const fixedRank = rank; - if (!await plugin.app.vault.adapter.exists(space.space.dbPath)) { - await createContextMDB(plugin, space.space); - } - plugin.index.addToContextStoreQueue(() => reorderFilesInContext(plugin, [path], fixedRank, space.space).then((f4) => { - return plugin.index.reloadContext(space.space); - }).then((f4) => { - const promises = [...plugin.index.spacesMap.getInverse(space.path)].map((f5) => plugin.index.reloadFile(getAbstractFileAtPath(plugin, f5))); - return Promise.all(promises); - }).then((f4) => plugin.index.broadcast("space"))); -}; -var moveAFileToNewParentAtIndex = async (plugin, item, newParent, index, copy) => { - if (!item) - return; - const currFile = getAbstractFileAtPath(plugin, item.path); - const newPath = newParent == "/" ? currFile.name : newParent + "/" + currFile.name; - const newItem = { - ...fileMetadataToVaultItem(item), - path: newPath, - parent: newParent + if (tag) + loadContextFields(tag); }; - if (getAbstractFileAtPath(plugin, newPath)) { - new import_obsidian21.Notice(i18n_default.notice.fileExists); - return; - } - const allRows = plugin.index.vaultDBCache.filter((f4) => f4.parent == newParent); - const rows = insert( - allRows, - index, - newItem - ); - const newVaultTable = [...plugin.index.vaultDBCache, newItem].filter((f4) => copy || f4.path != item.path).map((f4) => { - const newItem2 = rows.find((g4) => g4.path == f4.path); - if (newItem2) { - return { ...f4, ...newItem2 }; - } - return f4; - }); - await plugin.index.saveSpacesDatabaseToDisk({ vault: { ...vaultSchema, rows: newVaultTable } }); - const afile = getAbstractFileAtPath(plugin, item.path); - if (copy) { - await copyFile(plugin, getAbstractFileAtPath(plugin, newParent), afile); - } else { - await moveFile(plugin, getAbstractFileAtPath(plugin, newParent), afile); - } - updateFileRank(plugin, newPath, index, plugin.index.spacesIndex.get(newParent)); -}; -var movePathsToSpace = async (plugin, paths, newSpaceCache, index, modifier) => { - if (newSpaceCache.type == "folder" || newSpaceCache.type == "vault") { - paths.forEach((path) => { - if (modifier == "link" || nodeIsAncestorOfTarget(uriByString(plugin, path), newSpaceCache.space.uri)) { - insertSpaceItemAtIndex(plugin, newSpaceCache, path, index); - } else { - moveAFileToNewParentAtIndex(plugin, plugin.index.filesIndex.get(path), newSpaceCache.path, index, modifier == "copy"); - } - }); - } - if (newSpaceCache.type == "tag") { - paths.map((f4) => { - var _a2, _b2, _c2; - return (_c2 = (_a2 = plugin.index.spacesIndex.get(f4)) == null ? void 0 : _a2.space.defPath) != null ? _c2 : (_b2 = plugin.index.filesIndex.get(f4)) == null ? void 0 : _b2.path; - }).filter((f4) => f4).forEach((path) => addTagToNote(plugin, newSpaceCache.name, getAbstractFileAtPath(plugin, path))); - } -}; -var movePathToSpace = async (plugin, path, oldSpaceCache, newSpaceCache, index, modifier) => { - let cache = plugin.index.spacesIndex.get(path); - if (!cache) { - cache = plugin.index.filesIndex.get(path); - } - if (!cache || !newSpaceCache) - return false; - if ((oldSpaceCache == null ? void 0 : oldSpaceCache.path) == newSpaceCache.path) { - updateFileRank(plugin, path, index, oldSpaceCache); - return; - } - if (newSpaceCache.type == "folder" || newSpaceCache.type == "vault") { - if (modifier == "link" || nodeIsAncestorOfTarget(uriByString(plugin, path), newSpaceCache.space.uri)) { - insertSpaceItemAtIndex(plugin, newSpaceCache, path, index); - } else { - moveAFileToNewParentAtIndex(plugin, plugin.index.filesIndex.get(path), newSpaceCache.path, index, modifier == "copy"); + p2(() => { + window.addEventListener(eventTypes.spacesChange, refreshSpace); + return () => { + window.removeEventListener(eventTypes.spacesChange, refreshSpace); + }; + }, [refreshSpace]); + p2(() => { + if (schema) { + parsePredicate(schema.predicate); } - } - if (newSpaceCache.type == "tag") { - addTagToNote(plugin, newSpaceCache.name, getAbstractFileAtPath(plugin, path)); - } - if (oldSpaceCache && (oldSpaceCache == null ? void 0 : oldSpaceCache.path) != newSpaceCache.path) { - removePathsFromSpace(plugin, oldSpaceCache, [path]); - } -}; -var insertSpaceAtIndex = async (plugin, path, newSpace) => { - const spaces = plugin.index.allSpaces(); - const spaceInfo = spaceFromFolder(plugin, path); - let newSpaceCache; - if (spaces.find((f4) => f4.path == spaceInfo.path)) { - if (newSpace) { - newSpaceCache = await saveSpaceCache(plugin, spaceInfo, newSpace); - } else { + }, [schema]); + p2(() => { + if (dbFileExists && tableData) + getContextTags(tableData); + }, [tableData]); + const selectRows = (lastSelected, rows) => { + setSelectedRows(rows); + if (!((dbSchema == null ? void 0 : dbSchema.primary) == "true")) return; + if (lastSelected) { + const path = tableData.rows[parseInt(lastSelected)].File; + const evt = new CustomEvent( + eventTypes.activePathChange, + { + detail: { + selection: path, + path: { + ...uriByString(props2.plugin, spaceInfo.path), + ref: schema == null ? void 0 : schema.id + } + } + } + ); + window.dispatchEvent(evt); + } else { + const evt = new CustomEvent( + eventTypes.activePathChange, + { + detail: { + path: { + ...uriByString(props2.plugin, spaceInfo.path), + ref: schema == null ? void 0 : schema.id + }, + selection: null + } + } + ); + window.dispatchEvent(evt); } - } else { - if (!await abstractFileAtPathExists(plugin, spaceInfo.folderPath)) { - await plugin.app.vault.createFolder(spaceInfo.folderPath); + }; + const getContextTags = async (_tableData) => { + const contextFields = _tableData.cols.filter((f4) => f4.type.contains("context")).map((f4) => f4.value).filter((f4) => !contexts.some((g4) => g4 == f4)); + for (const c4 of contextFields) { + loadContextFields(c4); } - if (newSpace) { - await createNewMarkdownFile(plugin, getAbstractFileAtPath(plugin, spaceInfo.folderPath), spaceInfo.name, null, true); - await saveSpaceCache(plugin, spaceInfo, newSpace); - newSpaceCache = await plugin.index.reloadSpace(spaceInfo, newSpace); - } else { - newSpaceCache = await plugin.index.reloadSpace(spaceInfo); + }; + p2(() => { + if (tableData) { + for (const c4 of contexts) { + loadTagContext(c4, tableData.rows); + } } - } - plugin.index.initalizeFiles(); - plugin.settings.rootSpaces = [...plugin.settings.rootSpaces, spaceInfo.path]; - plugin.saveSettings(); - return newSpaceCache; -}; -var saveSpaceMetadataValue = async (plugin, space, key2, value) => { - const spaceCache = plugin.index.spacesIndex.get(space); - let file = getAbstractFileAtPath(plugin, spaceCache.space.defPath); - if (!file) { - file = await createNewMarkdownFile(plugin, getAbstractFileAtPath(plugin, spaceCache.space.folderPath), filePathToString(spaceCache.space.defPath), "", true); - } - if (plugin.metadata.canProcessFrontmatter()) { - await plugin.metadata.processFrontMatter(file.path, (frontmatter) => { - frontmatter[key2] = value; + }, [tableData]); + const loadTagContext = async (tag, files) => { + getMDBTable( + props2.plugin, + spaceFromTag(props2.plugin, tag), + "files", + "context" + ).then((f4) => { + if (f4) { + const contextFields = f4.cols.filter((g4) => g4.type.contains("context")).map((g4) => g4.value).filter((g4) => !contexts.some((h5) => h5 == g4)); + for (const c4 of contextFields) { + loadContextFields(c4); + } + setContextTable((t4) => ({ + ...t4, + [tag]: f4 + })); + } }); - } - plugin.index.updateSpaceMetadata(space, { ...spaceCache.metadata, [key2]: value }); -}; -var saveSpaceCache = async (plugin, spaceInfo, metadata) => { - let file = getAbstractFileAtPath(plugin, spaceInfo.defPath); - if (!file) { - file = await createNewMarkdownFile(plugin, getAbstractFileAtPath(plugin, spaceInfo.folderPath), filePathToString(spaceInfo.defPath), "", true); - } - if (plugin.metadata.canProcessFrontmatter()) { - await plugin.metadata.processFrontMatter(file.path, (frontmatter) => { - frontmatter[plugin.settings.fmKeySticker] = metadata.sticker; - frontmatter[spaceFilterKey(plugin)] = metadata.filters; - frontmatter[plugin.settings.fmKeyBanner] = metadata.banner; - frontmatter[spaceContextsKey(plugin)] = metadata.contexts; - frontmatter[spaceLinksKey(plugin)] = metadata.links; - frontmatter[spaceSortKey(plugin)] = metadata.sort; - frontmatter["tags"] = metadata.tags; + }; + const loadContextFields = async (tag) => { + getMDBTable( + props2.plugin, + spaceFromTag(props2.plugin, tag), + "files", + "context" + ).then((f4) => { + setContextTable((t4) => ({ + ...t4, + [tag]: f4 + })); }); - } - return plugin.index.updateSpaceMetadata(spaceInfo.path, metadata); -}; -var insertSpaceItemAtIndex = async (plugin, space, path, rank) => { - var _a2; - const spaceExists = (_a2 = ensureArray(space.metadata.links)) != null ? _a2 : []; - const pathExists = spaceExists.find((f4) => f4 == path); - if (!pathExists) { - spaceExists.push(path); - } - await saveSpaceCache(plugin, space.space, { ...space.metadata, links: spaceExists }); - await plugin.index.reloadFile(getAbstractFileAtPath(plugin, path)); - await plugin.index.reloadSpace(space.space); - updateFileRank(plugin, path, rank, space); - plugin.index.broadcast("vault"); -}; -var removeSpace = async (plugin, space) => { - const spaceCache = plugin.index.spacesIndex.get(space); - if (spaceCache.type == "tag") { - plugin.index.deleteTag(spaceCache.name); - } else if (spaceCache.type == "folder") { - deleteFile(plugin, getAbstractFileAtPath(plugin, space)); - } else { - deleteSpaceFolder(plugin, spaceCache.name); - plugin.index.deleteSpace(space); - } -}; -var updateSpaceSort = (plugin, spaceName, sort) => { - const space = plugin.index.spacesIndex.get(spaceName); - if (space) - saveSpaceCache(plugin, space.space, { - ...space.metadata, - sort + }; + const saveContextDB = async (newTable, tag) => { + const context = spaceFromTag(props2.plugin, tag); + await saveMDBToPath(props2.plugin, context, newTable).then( + (f4) => f4 && setContextTable((t4) => ({ + ...t4, + [tag]: newTable + })) + ); + }; + const savePredicate = (newPredicate) => { + const cleanedPredicate = validatePredicate(newPredicate); + saveSchema({ + ...schema, + predicate: JSON.stringify(cleanedPredicate) }); -}; -var toggleSpacePin = (plugin, spacePath, type, remove, rank) => { - if (type == "home") { - if (remove) { - plugin.settings.rootSpaces = plugin.settings.rootSpaces.filter((f4) => f4 != spacePath); - } else if (plugin.settings.rootSpaces.some((f4) => f4 == spacePath)) { - const currIndex = plugin.settings.rootSpaces.findIndex((f4) => f4 == spacePath); - plugin.settings.rootSpaces = arrayMove(plugin.settings.rootSpaces, currIndex, rank); - } else { - plugin.settings.rootSpaces = insert(plugin.settings.rootSpaces, rank, spacePath); + setPredicate(cleanedPredicate); + }; + p2(() => { + setPredicate((p3) => ({ + ...p3, + colsOrder: uniq([ + ...p3.colsOrder, + ...cols.filter((f4) => f4.hidden != "true").map((c4) => c4.name + c4.table) + ]) + })); + }, [cols]); + const parsePredicate = (predicateStr) => { + const newPredicate = safelyParseJSON(predicateStr); + setPredicate(validatePredicate(newPredicate)); + }; + const delColumn = (column) => { + let mdbtable; + const table = column.table; + if (table == "") { + mdbtable = tableData; + } else if (contextTable[table]) { + mdbtable = contextTable[table]; } - } else if (type == "pinned") { - if (remove) { - plugin.settings.waypoints = plugin.settings.waypoints.filter((f4) => f4 != spacePath); - } else if (plugin.settings.waypoints.some((f4) => f4 == spacePath)) { - const currIndex = plugin.settings.waypoints.findIndex((f4) => f4 == spacePath); - plugin.settings.waypoints = arrayMove(plugin.settings.waypoints, currIndex, rank); - } else { - plugin.settings.waypoints = insert(plugin.settings.waypoints, rank, spacePath); + const newFields = mdbtable.cols.filter( + (f4, i4) => f4.name != column.name + ); + const newTable = { + ...mdbtable, + cols: newFields, + rows: mdbtable.rows.map((r3) => { + const { [column.name]: val, ...rest } = r3; + return rest; + }) + }; + if (table == "") { + saveDB2(newTable); + } else if (contextTable[table]) { + saveContextDB(newTable, table); } - } - plugin.saveSettings(); -}; -var removePathsFromSpace = async (plugin, space, paths) => { - if (space.type == "tag") { - paths.map((f4) => { - var _a2, _b2, _c2; - return (_c2 = (_a2 = plugin.index.spacesIndex.get(f4)) == null ? void 0 : _a2.space.defPath) != null ? _c2 : (_b2 = plugin.index.filesIndex.get(f4)) == null ? void 0 : _b2.path; - }).filter((f4) => f4).forEach((path) => removeTagFromFile(plugin, space.name, getAbstractFileAtPath(plugin, path))); - } else if (space.type == "folder" || space.type == "vault") { - paths.forEach((f4) => { - if (pathIsSpace(plugin, f4)) { - plugin.index.spacesMap.set(f4, new Set([...plugin.index.spacesMap.get(f4)].filter((g4) => g4 != space.path))); - } - }); - await saveSpaceMetadataValue(plugin, space.path, spaceLinksKey(plugin), space.metadata.links.filter((f4) => !paths.some((g4) => g4 == f4))); - await plugin.index.reloadSpace(space.space); - const promises = paths.map((f4) => pathIsSpace(plugin, f4) ? plugin.index.reloadSpaceByPath(f4) : plugin.index.reloadFile(getAbstractFileAtPath(plugin, f4))); - await Promise.all(promises); - plugin.index.broadcast("vault"); - } -}; -var retrieveAllRecursiveChildren = (vaultDB, settings, folder) => { - return vaultDB.filter((f4) => f4["parent"].startsWith(folder)).filter( - excludeVaultItemPredicate(settings) - ); -}; -var retrieveAllFiles = (vaultDB, settings) => { - return vaultDB.filter( - excludeVaultItemPredicate(settings) - ); -}; -var initiateDB = (db) => { - replaceDB(db, { - vault: vaultSchema - }); -}; -var indexCurrentFileTree = (plugin, vaultDB) => { - const treeItems = getAllAbstractFilesInVault(plugin).map((file) => { - var _a2; - return { - path: file.path, - parent: (_a2 = file.parent) == null ? void 0 : _a2.path, - created: file instanceof import_obsidian21.TFile ? file.stat.ctime.toString() : void 0, - folder: file instanceof import_obsidian21.TFolder ? "true" : "false" + }; + const newColumn = (col) => { + return saveColumn(col); + }; + const saveColumn = (newColumn2, oldColumn) => { + let mdbtable; + const column = { + ...newColumn2, + name: sanitizeColumnName(newColumn2.name) }; - }); - const currentPaths = vaultDB; - const deleteRows = currentPaths.filter( - (item) => !treeItems.some((i4) => i4.path == item.path) - ); - const fixRows = currentPaths.filter( - (item) => treeItems.some((i4) => i4.path == item.path && i4.parent != item.parent) - ).map((item) => ({ - ...item, - ...treeItems.find((i4) => i4.path == item.path) - })); - const newRows = treeItems.filter( - (item) => !currentPaths.some((i4) => i4.path == item.path) - ); - const newVaultRows = [...vaultDB.map((f4) => { - const newItem = fixRows.find((g4) => g4.path == f4.path); - if (newItem) { - return { ...f4, ...newItem }; + const table = column.table; + if (table == "") { + mdbtable = tableData; + } else if (contextTable[table]) { + mdbtable = contextTable[table]; } - return f4; - }).filter((f4) => !deleteRows.some((g4) => g4.path == f4.path)), ...newRows]; - return { - vault: { - ...vaultSchema, - rows: newVaultRows + if (column.name == "") { + new import_obsidian15.Notice(i18n_default.notice.noPropertyName); + return false; + } + if (!oldColumn && mdbtable.cols.find( + (f4) => f4.name.toLowerCase() == column.name.toLowerCase() + ) || oldColumn && oldColumn.name != column.name && mdbtable.cols.find( + (f4) => f4.name.toLowerCase() == column.name.toLowerCase() + )) { + new import_obsidian15.Notice(i18n_default.notice.duplicatePropertyName); + return false; + } + const oldFieldIndex = oldColumn ? mdbtable.cols.findIndex((f4) => f4.name == oldColumn.name) : -1; + const newFields = oldFieldIndex == -1 ? [...mdbtable.cols, column] : mdbtable.cols.map((f4, i4) => i4 == oldFieldIndex ? column : f4); + const newTable = { + ...mdbtable, + cols: newFields, + rows: mdbtable.rows.map( + (f4) => oldColumn ? { + ...f4, + [column.name]: f4[oldColumn.name], + oldColumn: void 0 + } : f4 + ) + }; + if (oldColumn) + savePredicate({ + view: predicate.view, + frame: predicate.frame, + frameProps: predicate.frameProps, + filters: predicate.filters.map( + (f4) => f4.field == oldColumn.name + oldColumn.table ? { ...f4, field: column.name + column.table } : f4 + ), + sort: predicate.sort.map( + (f4) => f4.field == oldColumn.name + oldColumn.table ? { ...f4, field: column.name + column.table } : f4 + ), + groupBy: predicate.groupBy.map( + (f4) => f4 == oldColumn.name + oldColumn.table ? column.name + column.table : f4 + ), + colsHidden: predicate.colsHidden.map( + (f4) => f4 == oldColumn.name + oldColumn.table ? column.name + column.table : f4 + ), + colsOrder: predicate.colsOrder.map( + (f4) => f4 == oldColumn.name + oldColumn.table ? column.name + column.table : f4 + ), + colsSize: { + ...predicate.colsSize, + [column.name + column.table]: predicate.colsSize[oldColumn.name + oldColumn.table], + [oldColumn.name + oldColumn.table]: void 0 + } + }); + if (table == "") { + syncAllMetadata(newTable); + } else if (contextTable[table]) { + saveContextDB(newTable, table); } + return true; }; + return /* @__PURE__ */ Cn.createElement(ContextEditorContext.Provider, { + value: { + cols, + data: data2, + views, + schema, + setSchema, + filteredData, + loadContextFields, + selectedRows, + selectRows, + sortedColumns, + contextTable, + setContextTable, + predicate, + savePredicate, + saveContextDB, + saveColumn, + hideColumn, + sortColumn, + delColumn, + newColumn, + searchString, + setSearchString, + updateValue: updateValue2, + updateFieldValue + } + }, props2.children); }; -var newFileInSpace = async (plugin, space, activeFile, canvas, dontOpen) => { + +// src/react/hooks/useCombinedRef.tsx +function useCombinedRefs2(...refs) { + return F2( + () => (node) => { + refs.forEach((ref2) => ref2(node)); + }, + refs + ); +} + +// src/react/components/SpaceView/Contexts/TableView/ColumnHeader.tsx +var filePropTypes = [ + { + name: i18n_default.properties.fileProperty.createdTime, + value: "ctime" + }, + { + name: i18n_default.properties.fileProperty.modifiedTime, + value: "mtime" + }, + { + name: i18n_default.properties.fileProperty.extension, + value: "extension" + }, + { + name: i18n_default.properties.fileProperty.size, + value: "size" + }, + { + name: i18n_default.properties.fileProperty.parentFolder, + value: "folder" + }, + { + name: "Links", + value: "links" + }, + { + name: "Tags", + value: "tags" + }, + { + name: "Spaces", + value: "spaces" + } +]; +var ColumnHeader = (props2) => { var _a2, _b2; - let newFile; - const folder = space.type == "tag" ? defaultNoteFolder(plugin, activeFile) : ((_b2 = (_a2 = space.space) == null ? void 0 : _a2.folderPath) == null ? void 0 : _b2.length) > 0 ? getFolderFromPath(plugin, space.space.folderPath) : defaultNoteFolder(plugin, activeFile); - if (canvas) { - newFile = await createNewCanvasFile( - plugin, - folder, - "Canvas", - dontOpen - ); - } else { - newFile = await createNewMarkdownFile( - plugin, - folder, - "", - space.type == "tag" ? `--- -tags: - - ${space.name.replace("#", "")} ----` : "", - dontOpen + const [field, setField] = h2(props2.column); + const menuRef = _2(null); + const { spaceInfo, spaceCache } = q2(SpaceContext); + const { tableData, contextTable } = q2(ContextMDBContext); + const { + predicate, + loadContextFields, + cols, + newColumn, + saveColumn, + hideColumn, + sortColumn, + delColumn + } = q2(ContextEditorContext); + p2(() => { + setField(props2.column); + }, [props2.column]); + const { + attributes, + listeners, + setNodeRef: setDraggableNodeRef, + transform + } = useDraggable({ + id: field.name + field.table, + data: { name: field.name } + }); + const { setNodeRef: setDroppableNodeRef } = useDroppable({ + id: field.name + field.table, + data: { name: field.name } + }); + const saveField = (field2) => { + if (field2.name.length > 0) { + if (field2.name != props2.column.name || field2.type != props2.column.type || field2.value != props2.column.value || field2.attrs != props2.column.attrs) { + const saveResult = saveColumn(field2, props2.column); + if (saveResult) { + if (props2.isNew) { + setField(props2.column); + } + } + } + } + }; + const showNewMenu = (e4) => { + var _a3; + const offset2 = ref2.current.getBoundingClientRect(); + showNewPropertyMenu( + props2.plugin, + { x: offset2.left, y: offset2.top + 30 }, + (_a3 = spaceCache == null ? void 0 : spaceCache.contexts) != null ? _a3 : [], + cols, + (source, field2) => newColumn({ ...field2, table: source }), + tableData.schema.id, + spaceInfo.path, + false ); - } - return newFile; -}; - -// src/utils/emoji.ts -var saveIconsForPaths = (plugin, files, icon) => { - files.forEach((file) => { - const cache = plugin.index.cacheForURI(uriByString(plugin, file)); - if ((cache == null ? void 0 : cache.cacheType) == "file") { - saveFileSticker(plugin, file, icon); - } else if ((cache == null ? void 0 : cache.cacheType) == "space") { - saveSpaceSticker(plugin, file, icon); + }; + const toggleMenu = (e4) => { + if (props2.isNew) { + showNewMenu(e4); + } else { + const offset2 = e4.target.getBoundingClientRect(); + const options = optionValuesForColumn( + field.name, + field.table == "" ? tableData : contextTable[field.table] + ); + showPropertyMenu({ + plugin: props2.plugin, + position: { x: offset2.left, y: offset2.top + 30 }, + editable: props2.editable, + options, + field, + fields: cols, + contextPath: spaceInfo.path, + saveField, + hide: hideColumn, + deleteColumn: delColumn, + sortColumn, + hidden: predicate.colsHidden.includes(field.name + field.table) + }); + } + }; + const ref2 = _2(null); + const setNodeRef = useCombinedRefs2(setDroppableNodeRef, setDraggableNodeRef); + return /* @__PURE__ */ Cn.createElement("div", { + ref: setNodeRef, + ...listeners, + ...attributes, + className: "mk-col-header", + onClick: (e4) => { + toggleMenu(e4); } - }); -}; -var saveColorForPaths = (plugin, files, icon) => { - files.forEach((file) => { - const cache = plugin.index.cacheForURI(uriByString(plugin, file)); - if ((cache == null ? void 0 : cache.cacheType) == "file") { - saveFileColor(plugin, file, icon); - } else if ((cache == null ? void 0 : cache.cacheType) == "space") { - saveSpaceColor(plugin, file, icon); + }, /* @__PURE__ */ Cn.createElement("div", { + ref: ref2 + }, props2.column.name.length > 0 ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { + dangerouslySetInnerHTML: { + __html: stickerFromString( + ((_a2 = props2.column.attrs) == null ? void 0 : _a2.length) > 0 ? props2.column.attrs : (_b2 = fieldTypeForType(props2.column.type)) == null ? void 0 : _b2.icon, + props2.plugin + ) } - }); -}; -var removeSpaceIcon = (plugin, space) => { - saveSpaceSticker(plugin, space, ""); -}; -var saveFileIcon = (plugin, data2, icon) => { - saveFileSticker(plugin, data2.path, icon); + }), field.name) : "+", /* @__PURE__ */ Cn.createElement("span", { + className: "mk-col-header-context", + "aria-label": props2.column.table.length > 0 ? props2.column.table : "" + }, props2.column.table.length > 0 ? "#" : ""))); }; -var removeIconsForPaths = (plugin, files) => { - files.forEach((file) => { - const cache = plugin.index.cacheForURI(uriByString(plugin, file)); - if ((cache == null ? void 0 : cache.cacheType) == "file") { - saveFileSticker(plugin, file, ""); - } else if ((cache == null ? void 0 : cache.cacheType) == "space") { - saveSpaceSticker(plugin, file, ""); + +// src/react/components/UI/Menus/propertyMenu/PropertyValue.tsx +var PropertyValueComponent = (props2) => { + var _a2; + const showOptions = (e4, value, options, field, saveProperty) => { + showSelectMenu(e4.target.getBoundingClientRect(), { + plugin: props2.plugin, + multi: false, + editable: true, + searchable: true, + saveOptions: (_12, v3) => { + if (saveProperty) { + saveProperty(v3[0]); + } else { + saveParsedValue(field, v3[0]); + } + }, + placeholder: i18n_default.labels.propertyValueSpace, + value: [value != null ? value : ""], + options + }); + }; + const parsedValue = F2( + () => parseFieldValue(props2.value, props2.fieldType), + [props2.value, props2.fieldType] + ); + const saveParsedValue = (field, value) => { + props2.saveValue(JSON.stringify({ ...parsedValue, [field]: value })); + }; + const saveSpaceProperty = (field) => { + var _a3, _b2; + const colExists = (_b2 = (_a3 = props2.plugin.index.contextsIndex.get(parsedValue.space)) == null ? void 0 : _a3.cols) == null ? void 0 : _b2.some((f4) => f4.name == field); + if (!colExists) { + insertContextColumn( + props2.plugin, + props2.plugin.index.spacesIndex.get(parsedValue.space).space, + { + name: field, + schemaId: "files", + type: "context", + value: props2.name + } + ); } - }); -}; -var removeFileIcon = (plugin, data2) => { - saveFileSticker(plugin, data2.path, ""); + saveParsedValue("field", field); + }; + const selectContext = (e4) => { + showOptions( + e4, + parsedValue.space, + props2.plugin.index.allSpaces().filter((f4) => f4.type != "default").map((m5) => ({ name: m5.name, value: m5.path })), + "space" + ); + }; + const selectSpaceProperty = (e4) => { + var _a3, _b2; + showOptions( + e4, + parsedValue.property, + (_b2 = (_a3 = props2.plugin.index.contextsIndex.get(parsedValue.space)) == null ? void 0 : _a3.cols.filter((f4) => { + return f4.type.startsWith("context") && parseFieldValue(f4.value, f4.type)["space"] == props2.contextPath ? true : false; + }).map((m5) => ({ name: m5.name, value: m5.name }))) != null ? _b2 : [], + "field", + saveSpaceProperty + ); + }; + const selectProperty = (e4) => { + var _a3, _b2; + const properties2 = (_b2 = (_a3 = props2.plugin.index.contextsIndex.get(props2.contextPath)) == null ? void 0 : _a3.cols.filter( + (f4) => f4.type == "file" || f4.type == "link" || f4.type == "context" + ).map((f4) => ({ + name: f4.name, + value: f4.name + }))) != null ? _b2 : []; + showOptions(e4, null, properties2, "field"); + }; + const selectFileProp = (e4) => { + var _a3, _b2, _c2; + const property = (_a3 = props2.plugin.index.contextsIndex.get(props2.contextPath)) == null ? void 0 : _a3.cols.find((f4) => f4.name == parsedValue.field); + const fileProps2 = property ? property.type == "file" || property.type == "link" ? filePropTypes.map((f4) => ({ + name: f4.name, + value: f4.value + })) : (_c2 = (_b2 = props2.plugin.index.contextsIndex.get(parseFieldValue(property.value, "context").space)) == null ? void 0 : _b2.cols.filter((f4) => f4.hidden != "true").map((f4) => ({ + name: f4.name, + value: f4.name + }))) != null ? _c2 : [] : []; + showOptions(e4, null, fileProps2, "value"); + }; + const selectDateFormat = (e4) => { + const formats = [ + { + name: "2020-04-21", + value: "yyyy-MM-dd" + }, + { + name: "Apr 21, 2020", + value: "MMM d, yyyy" + }, + { + name: "Tue Apr 21, 2020", + value: "EEE MMM d, yyyy" + } + ]; + showOptions(e4, null, formats, "format"); + }; + return props2.fieldType.startsWith("date") ? /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectDateFormat(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.dateFormat), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.format)) : props2.fieldType.startsWith("context") ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectContext(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyValueSpace), /* @__PURE__ */ Cn.createElement("span", null, spaceNameFromSpacePath(parsedValue.space, props2.plugin))), ((_a2 = parsedValue.space) == null ? void 0 : _a2.length) > 0 && /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectSpaceProperty(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field))) : props2.fieldType == "fileprop" ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectProperty(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field)), parsedValue.field && /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectFileProp(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyValueProperty), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.value))) : props2.fieldType == "super" ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item" + }, /* @__PURE__ */ Cn.createElement("span", null, "Dynamic"), /* @__PURE__ */ Cn.createElement("input", { + type: "checkbox", + checked: parsedValue.dynamic == true, + onChange: () => saveParsedValue("dynamic", !parsedValue.dynamic) + })), !parsedValue.dynamic ? /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => showOptions( + e4, + parsedValue.field, + [...props2.plugin.index.superProperties.keys()].map((f4) => ({ + value: f4, + name: props2.plugin.index.superProperties.get(f4).name + })), + "field" + ) + }, /* @__PURE__ */ Cn.createElement("span", null, "Field"), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field)) : /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectProperty(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.propertyFileProp), /* @__PURE__ */ Cn.createElement("span", null, parsedValue.field))) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); }; -// src/components/UI/FileSticker/FileSticker.tsx -var FileSticker = (props2) => { - const { fileCache } = props2; - const sticker = fileCache == null ? void 0 : fileCache.sticker; - const color = fileCache == null ? void 0 : fileCache.color; - const extension = (fileCache == null ? void 0 : fileCache.cacheType) == "file" && (fileCache == null ? void 0 : fileCache.extension); - const triggerStickerContextMenu = (e4) => { - if (!fileCache) - return; - e4.preventDefault(); - const fileMenu = new import_obsidian22.Menu(); - fileMenu.addSeparator(); - fileMenu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.buttons.changeIcon); - menuItem.setIcon("lucide-sticker"); - menuItem.onClick((ev) => { - const vaultChangeModal = new stickerModal( - props2.plugin.app, - props2.plugin, - (emoji) => (fileCache == null ? void 0 : fileCache.cacheType) == "space" ? saveSpaceSticker(props2.plugin, fileCache == null ? void 0 : fileCache.path, emoji) : saveFileSticker(props2.plugin, fileCache == null ? void 0 : fileCache.path, emoji) - ); - vaultChangeModal.open(); - }); - }); - fileMenu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.buttons.removeIcon); - menuItem.setIcon("lucide-file-minus"); - menuItem.onClick((ev) => { - removeIconsForPaths(props2.plugin, [fileCache.path]); +// src/react/components/UI/Menus/propertyMenu/newPropertyMenu.tsx +var NewPropertyMenuComponent = (props2) => { + const [fieldName, setFieldName] = h2(""); + const [fieldSource, setFieldSource] = h2( + props2.fileMetadata ? "fm" : "" + ); + const spaceCaches = F2( + () => props2.spaces.map((f4) => props2.plugin.index.spacesIndex.get(f4)).filter((f4) => f4), + [props2.spaces] + ); + const [fieldValue, setFieldValue] = h2(""); + const [fieldType, setFieldType] = h2("text"); + const options = F2(() => { + const options2 = []; + if (props2.fileMetadata) { + options2.push({ + name: i18n_default.menu.setNone, + value: "fm" }); - }); - if (isMouseEvent(e4)) { - fileMenu.showAtPosition({ x: e4.pageX, y: e4.pageY }); - } else { - fileMenu.showAtPosition({ - x: e4.nativeEvent.locationX, - y: e4.nativeEvent.locationY + } + if (props2.contextPath) { + options2.push({ + name: folderPathToString(props2.contextPath), + value: "" }); } - return false; + options2.push( + ...(spaceCaches != null ? spaceCaches : []).map((f4) => ({ + name: f4.name, + value: f4.path + })) + ); + return options2; + }, [spaceCaches]); + const selectedType = (_12, value) => { + setFieldType(value[0]); }; - const triggerStickerMenu = (e4) => { - e4.stopPropagation(); - if ((fileCache == null ? void 0 : fileCache.cacheType) == "space") { - const vaultChangeModal2 = new stickerModal( - props2.plugin.app, - props2.plugin, - (emoji) => saveSpaceSticker( - props2.plugin, - fileCache.space.path, - emoji - ) - ); - vaultChangeModal2.open(); - return; - } - const vaultChangeModal = new stickerModal( - props2.plugin.app, - props2.plugin, - (emoji) => saveFileSticker(props2.plugin, fileCache.path, emoji) + const selectedValue = (value) => { + setFieldValue(value); + }; + const selectedSource = (_12, value) => { + setFieldSource(value[0]); + }; + const toggleMulti = () => { + const field = fieldTypes.find( + (f4) => f4.type == fieldType || f4.multiType == fieldType ); - vaultChangeModal.open(); + setFieldType(field.type == fieldType ? field.multiType : field.type); }; - return /* @__PURE__ */ Cn.createElement("div", { - className: `mk-file-icon ${sticker ? "" : "mk-file-icon-placeholder"}` - }, /* @__PURE__ */ Cn.createElement("button", { - "aria-label": i18n_default.buttons.changeIcon, - onContextMenu: triggerStickerContextMenu, - style: (color == null ? void 0 : color.length) > 0 ? { - "--label-color": `${color}`, - "--icon-color": `#ffffff` - } : { - "--icon-color": `var(--text-muted)` - }, - dangerouslySetInnerHTML: sticker ? { __html: stickerFromString(sticker, props2.plugin) } : fileCache.cacheType == "file" ? { - __html: stickerFromString( - defaultIconForExtension(extension, color ? true : false), - props2.plugin - ) - } : { - __html: stickerFromString( - iconForSpaceType( - fileCache.type, - fileCache.path, - true - ), - props2.plugin - ) + const selectType = (e4) => { + showSelectMenu(e4.target.getBoundingClientRect(), { + plugin: props2.plugin, + multi: false, + editable: false, + searchable: false, + saveOptions: selectedType, + value: [], + showAll: true, + options: fieldTypes.filter((f4) => fieldSource == "fm" ? f4.metadata : !f4.restricted).map((f4, i4) => ({ + id: i4 + 1, + name: f4.label, + value: f4.type, + icon: "" + })) + }); + }; + const selectedContext = (value) => { + setFieldValue(value); + }; + const type = F2( + () => { + var _a2; + return (_a2 = fieldTypeForType(fieldType)) != null ? _a2 : fieldTypes[0]; }, - onClick: (e4) => triggerStickerMenu(e4) - })); -}; -var FileStickerContainer = (props2) => { - const [cache, setCache] = h2(null); - const reloadCache = () => { - setCache(props2.plugin.index.cacheForURI(props2.path)); + [fieldType] + ); + const selectSource = (e4) => { + showSelectMenu(e4.target.getBoundingClientRect(), { + plugin: props2.plugin, + multi: false, + editable: false, + searchable: false, + saveOptions: selectedSource, + value: [], + showAll: true, + options + }); }; - const reloadIcon = (e4) => { - if (e4.detail.type == "file" && e4.detail.name == props2.path.path || e4.detail.type == "space" && e4.detail.name == props2.path.fullPath) { - reloadCache(); + const saveField = () => { + if (fieldName.length == 0) { + new import_obsidian16.Notice(i18n_default.notice.noPropertyName); + return; + } + props2.saveField(fieldSource, { + name: fieldName, + type: fieldType, + value: fieldValue, + schemaId: props2.schemaId + }); + props2.hide(); + }; + const onKeyDown = (e4) => { + if (e4.key == "Enter") { + saveField(); } }; p2(() => { - reloadCache(); + setTimeout(() => { + input.current.focus(); + }, 50); }, []); - p2(() => { - window.addEventListener(eventTypes.spacesChange, reloadIcon); - return () => { - window.removeEventListener(eventTypes.spacesChange, reloadIcon); - }; - }, [props2.path]); - return cache ? /* @__PURE__ */ Cn.createElement(FileSticker, { + const input = _2(null); + return /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item" + }, /* @__PURE__ */ Cn.createElement("span", null, "Name"), /* @__PURE__ */ Cn.createElement("input", { + type: "text", + ref: input, + onKeyDown, + onChange: (e4) => setFieldName(e4.target.value), + onMouseDown: (e4) => e4.stopPropagation(), + value: fieldName + })), /* @__PURE__ */ Cn.createElement("div", { + className: "menu-separator" + }), options.length > 1 && /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectSource(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, "Space"), /* @__PURE__ */ Cn.createElement("span", null, fieldSource == "fm" ? "None" : fieldSource == "" ? props2.contextPath : fieldSource)), /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => selectType(e4) + }, /* @__PURE__ */ Cn.createElement("span", null, "Type"), /* @__PURE__ */ Cn.createElement("span", null, type.label)), type.multi ? /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item" + }, /* @__PURE__ */ Cn.createElement("span", null, i18n_default.labels.multiple), /* @__PURE__ */ Cn.createElement("input", { + type: "checkbox", + checked: fieldType == type.multiType, + onChange: () => toggleMulti() + })) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), /* @__PURE__ */ Cn.createElement("div", { + className: "menu-separator" + }), fieldSource != "fm" ? /* @__PURE__ */ Cn.createElement(PropertyValueComponent, { plugin: props2.plugin, - fileCache: cache - }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); + table: fieldSource, + fields: props2.fields, + fieldType, + value: fieldValue, + contextPath: props2.contextPath, + saveValue: selectedValue + }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), /* @__PURE__ */ Cn.createElement("div", { + className: "menu-separator" + }), /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => saveField() + }, /* @__PURE__ */ Cn.createElement("span", null, "Save Property")), /* @__PURE__ */ Cn.createElement("div", { + className: "menu-item", + onClick: (e4) => props2.hide() + }, /* @__PURE__ */ Cn.createElement("span", null, "Cancel"))); }; - -// src/components/SpaceView/Contexts/ContextBuilder/SpacePropertyEditor.tsx -var SpacePropertyEditor = (props2) => { - const [activeId, setActiveId] = h2(""); - const items = props2.columns.map((f4) => ({ ...f4, table: "", id: f4.name })); - const [openNodes, setOpenNodes] = h2([]); - const [overId, setOverId] = h2(""); - const contextProperties = F2(() => { - return props2.contexts.reduce((p3, c4) => { - var _a2, _b2; - return { - ...p3, - [c4]: { - space: props2.plugin.index.spacesIndex.get(tagSpacePathFromTag(c4)), - cols: (_b2 = (_a2 = props2.plugin.index.contextsIndex.get(tagSpacePathFromTag(c4))) == null ? void 0 : _a2.cols) != null ? _b2 : [].map((f4) => ({ ...f4, table: c4 })) - } - }; - }, {}); - }, [props2.contexts]); - const sensors = useSensors( - useSensor(MouseSensor, { - activationConstraint: { - distance: 10 - } - }), - useSensor(TouchSensor, { - activationConstraint: { - delay: 250, - tolerance: 5 - } - }), - useSensor(KeyboardSensor, { - coordinateGetter: sortableKeyboardCoordinates - }) +var showNewPropertyMenu = (plugin, position, spaces, fields, saveField, schemaId, contextPath, fileMetadata) => { + const menu = new import_obsidian16.Menu(); + menu.setUseNativeMenu(false); + const frag = document.createDocumentFragment(); + const div = frag.createDiv(); + div.addEventListener("click", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("keydown", (e4) => { + }); + const root = createRoot(div); + root.render( + /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(NewPropertyMenuComponent, { + plugin, + spaces, + schemaId, + contextPath, + fields, + hide: () => menu.hide(), + saveField, + fileMetadata + })) ); - const resetState = () => { - setActiveId(null); - setOverId(null); + menu.addItem((menuItem) => { + menuItem.setTitle(frag); + menuItem.dom.toggleClass("mk-properties", true); + }); + const keys = [...menu.scope.keys]; + for (let i4 = 0; i4 < keys.length; i4++) { + if (keys[i4].key != "Escape") { + menu.scope.unregister(keys[i4]); + } + } + menu.showAtPosition(position); + return menu; +}; + +// src/react/components/SpaceView/Contexts/TagsView/NoteSpacesBar.tsx +var NoteSpacesBar = (props2) => { + const showContextMenu = (e4, space) => { + e4.stopPropagation(); + e4.preventDefault(); + const menu = new import_obsidian17.Menu(); + menu.addItem((menuItem) => { + menuItem.setIcon("layout-grid"); + menuItem.setTitle(i18n_default.menu.openSpace); + menuItem.onClick(() => { + openSpace(space.path, props2.plugin, e4.metaKey); + }); + }); + menu.addItem((menuItem) => { + menuItem.setIcon("add"); + menuItem.setTitle(i18n_default.labels.newProperty); + menuItem.onClick(() => { + newProperty(e4, space.path); + }); + }); + if (space.type == "folder") { + } + if (props2.removeSpace && space.type == "tag") + menu.addItem((menuItem) => { + menuItem.setIcon("trash"); + menuItem.setTitle(i18n_default.menu.removeFromSpace); + menuItem.onClick(() => { + props2.removeSpace(space.path); + }); + }); + const offset2 = e4.target.getBoundingClientRect(); + menu.showAtPosition({ x: offset2.left, y: offset2.top + 30 }); }; - const saveNewField = (source, field) => { - props2.saveColumn({ ...field, table: "" }); + const spacesFromPath = (path) => { + return [...props2.plugin.index.spacesMap.get(path)].map((f4) => props2.plugin.index.spacesIndex.get(f4)).filter((f4) => f4 && f4.type != "default" && f4.path != "/").sort( + (f4, k5) => path.startsWith(f4.path) ? -1 : path.startsWith(k5.path) ? 1 : 0 + ); }; - const newProperty = (e4) => { + const [spaces, setSpaces] = h2( + spacesFromPath(props2.path) + ); + const saveField = (source, field) => { var _a2; + insertContextColumn( + props2.plugin, + (_a2 = spaces.find((f4) => f4.path == source)) == null ? void 0 : _a2.space, + field + ); + }; + const newProperty = (e4, space) => { const offset2 = e4.target.getBoundingClientRect(); showNewPropertyMenu( props2.plugin, { x: offset2.left, y: offset2.top + 30 }, - (_a2 = props2.contexts) != null ? _a2 : [], [], - saveNewField, + [], + saveField, "files", - null, - false + space ); }; - const newContexts = (e4) => { - const offset2 = e4.target.getBoundingClientRect(); - const f4 = loadTags(props2.plugin); - const addTag = async (tag) => { - const newTag = tagToTagPath(tag); - props2.saveContexts([ - ...props2.contexts.filter((f5) => f5 != newTag), - newTag - ]); - }; - showSelectMenu( - { x: offset2.left, y: offset2.top + 30 }, - { - plugin: props2.plugin, - multi: false, - editable: true, - value: [], - options: f4.map((m5) => ({ name: m5, value: m5 })), - saveOptions: (_12, value) => addTag(value[0]), - placeholder: i18n_default.labels.contextItemSelectPlaceholder, - searchable: true, - showAll: true - } - ); + const refreshSpaces = (evt) => { + if (evt.detail.type == "file" && evt.detail.name == props2.path || evt.detail.type == "space" && evt.detail.name == props2.path) { + setSpaces(spacesFromPath(props2.path)); + } }; - return /* @__PURE__ */ Cn.createElement(DndContext, { - sensors, - collisionDetection: closestCenter, - measuring: { - droppable: { - strategy: MeasuringStrategy.Always - } - }, - onDragStart: ({ active }) => { - setActiveId(active.id); - }, - onDragOver: ({ active, over }) => { - const overId2 = over == null ? void 0 : over.id; - if (overId2) - setOverId(overId2); - }, - onDragEnd: ({ active, over }) => { - const overId2 = over == null ? void 0 : over.id; - if (!overId2) { - resetState(); - return; - } - props2.setColumnOrder( - arrayMove( - props2.colsOrder, - props2.colsOrder.findIndex((f4) => f4 == activeId), - props2.colsOrder.findIndex((f4) => f4 == overId2) - ) - ); - resetState(); - }, - onDragCancel: resetState - }, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor" - }, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor-context" - }, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor-context-title" - }, /* @__PURE__ */ Cn.createElement("span", null, "Define Properties for your Space Items"), /* @__PURE__ */ Cn.createElement("button", { - onClick: (e4) => newProperty(e4) - }, "Add Property")), /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor-context-list" - }, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor-list" - }, /* @__PURE__ */ Cn.createElement(SortableContext, { - items, - strategy: verticalListSortingStrategy - }, items.map((value, index) => { - return /* @__PURE__ */ Cn.createElement(SortableItem, { - key: index, - id: value.id, - field: value, - plugin: props2.plugin, - saveColumn: (field) => props2.saveColumn(field, value), - cols: items, - colsHidden: props2.colsHidden, - hideColumn: props2.hideColumn, - delColumn: props2.delColumn - }); - }))))), props2.contexts.map((f4, i4) => { + p2(() => { + setSpaces(spacesFromPath(props2.path)); + window.addEventListener(eventTypes.spacesChange, refreshSpaces); + return () => { + window.removeEventListener(eventTypes.spacesChange, refreshSpaces); + }; + }, [props2.path]); + return spaces.length > 0 ? /* @__PURE__ */ Cn.createElement("div", { + className: "mk-tag-selector" + }, spaces.map((f4, i4) => { var _a2; return /* @__PURE__ */ Cn.createElement("div", { key: i4, - className: "mk-property-editor-context" + onContextMenu: (e4) => showContextMenu(e4, f4), + onClick: (e4) => openSpace( + f4.path, + props2.plugin, + e4.ctrlKey || e4.metaKey ? e4.altKey ? "split" : "tab" : false + ), + style: ((_a2 = f4.color) == null ? void 0 : _a2.length) > 0 ? { + "--tag-background": f4.color, + "--tag-color": "var(--color-white)" + } : {} + }, /* @__PURE__ */ Cn.createElement("span", { + className: "cm-hashtag cm-hashtag-begin mk-space-icon" }, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor-context-title" - }, f4, /* @__PURE__ */ Cn.createElement("button", { - className: `mk-collapse mk-inline-button mk-icon-xsmall ${!openNodes.some((g4) => g4 == f4) ? "mk-collapsed" : ""}`, - dangerouslySetInnerHTML: { - __html: stickerFromString("ui//mk-ui-collapse", props2.plugin) - }, - onClick: () => setOpenNodes( - (p3) => p3.some((g4) => g4 == f4) ? p3.filter((o3) => o3 != f4) : [...p3, f4] - ) - }), /* @__PURE__ */ Cn.createElement("span", null), /* @__PURE__ */ Cn.createElement("div", null, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-icon-small", + className: `mk-icon-xsmall`, dangerouslySetInnerHTML: { - __html: uiIconSet["mk-ui-close"] - }, - onClick: (e4) => { - props2.saveContexts(props2.contexts.filter((g4) => g4 != f4)); + __html: stickerFromString(f4.sticker, props2.plugin) } - }))), openNodes.some((g4) => g4 == f4) ? /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor-list" - }, (_a2 = contextProperties[f4]) == null ? void 0 : _a2.cols.filter((f5) => f5.primary != "true").map((g4, h5) => /* @__PURE__ */ Cn.createElement(SortableItem, { - key: h5, - id: g4.name + "#" + f4, - field: g4, - plugin: props2.plugin, - saveColumn: (field) => props2.saveColumn(field, g4), - cols: contextProperties[f4].cols, - colsHidden: props2.colsHidden, - hideColumn: props2.hideColumn, - delColumn: props2.delColumn - }))) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); - }), /* @__PURE__ */ Cn.createElement("div", { - onClick: (e4) => newContexts(e4), - className: "mk-property-editor-new" - }, "+ Add Context", /* @__PURE__ */ Cn.createElement("span", null, "Contexts lets you connect properties from your tags"))), z3( - /* @__PURE__ */ Cn.createElement(DragOverlay, { - adjustScale: false - }, activeId ? /* @__PURE__ */ Cn.createElement(SortableItem, { - id: items.find((f4) => f4.id == activeId).id, - field: items.find((f4) => f4.id == activeId), - plugin: props2.plugin, - cols: items, - colsHidden: props2.colsHidden - }) : null), - document.body - )); + })), /* @__PURE__ */ Cn.createElement("span", { + className: "cm-hashtag cm-hashtag-end" + }, f4.name)); + })) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); }; -function SortableItem(props2) { - var _a2, _b2; - const { spaceInfo } = q2(SpaceContext); - const { field } = props2; - const saveField = (field2, oldField) => { - if (field2.name.length > 0) { - if (field2.name != oldField.name || field2.type != oldField.type || field2.value != oldField.value || field2.attrs != oldField.attrs) { - const saveResult = props2.saveColumn(field2, oldField); - } - } - }; - const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: props2.id }); - const style = { - transform: CSS.Transform.toString(transform), - transition - }; - const icon = ((_a2 = props2.field.attrs) == null ? void 0 : _a2.length) > 0 ? props2.field.attrs : (_b2 = fieldTypeForType(props2.field.type)) == null ? void 0 : _b2.icon; - const selectedType = (_12, value) => { - const newField = { - ...props2.field, - type: value[0] - }; - props2.saveColumn(newField); - }; - return /* @__PURE__ */ Cn.createElement("div", { - className: "mk-property-editor-property", - ref: setNodeRef, - style, - ...attributes, - ...listeners - }, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-file-context-field-icon", - dangerouslySetInnerHTML: { - __html: stickerFromString(icon, props2.plugin) - }, - onClick: (e4) => { - selectPropertyTypeMenu(e4, props2.plugin, selectedType); - } - }), props2.field.name, /* @__PURE__ */ Cn.createElement("span", null), /* @__PURE__ */ Cn.createElement("div", { - className: "mk-icon-small", - dangerouslySetInnerHTML: { - __html: uiIconSet["mk-ui-options"] - }, - onClick: (e4) => { - const offset2 = e4.target.getBoundingClientRect(); - showPropertyMenu({ - plugin: props2.plugin, - position: { x: offset2.left, y: offset2.top + 30 }, - editable: true, - options: [], - field, - fields: props2.cols, - contextPath: spaceInfo == null ? void 0 : spaceInfo.path, - saveField: (newField) => saveField(newField, field), - hide: props2.hideColumn, - deleteColumn: props2.delColumn, - hidden: props2.colsHidden.includes(field.name + field.table) - }); - } - })); -} -// src/components/UI/menus/linkMenu.tsx -var showLinkMenu = (e4, plugin, saveLink) => { +// src/react/components/UI/Menus/fileMenu.tsx +var import_obsidian44 = require("obsidian"); + +// src/react/components/UI/Modals/editSpaceModal.tsx +var import_obsidian42 = require("obsidian"); + +// src/react/components/Navigator/SpaceEditor.tsx +var import_obsidian41 = require("obsidian"); + +// src/react/components/UI/Menus/linkMenu.tsx +var showLinkMenu = (e4, plugin, saveLink, placeholder) => { const offset2 = e4.target.getBoundingClientRect(); const options = getAllAbstractFilesInVault(plugin).map((f4) => ({ name: fileNameToString(f4.name), @@ -41634,7 +40226,7 @@ var showLinkMenu = (e4, plugin, saveLink) => { saveOptions: (_12, value) => { saveLink(value[0]); }, - placeholder: i18n_default.labels.linkItemSelectPlaceholder, + placeholder: placeholder != null ? placeholder : i18n_default.labels.linkItemSelectPlaceholder, detail: true, searchable: true, showAll: true @@ -41642,2444 +40234,2961 @@ var showLinkMenu = (e4, plugin, saveLink) => { ); }; -// src/components/Navigator/SpaceEditor.tsx -var import_obsidian41 = require("obsidian"); +// src/superstate/spacesStore/spaces.ts +var import_lodash7 = __toESM(require_lodash()); +var import_obsidian21 = require("obsidian"); -// src/components/SpaceView/Contexts/ContextBuilder/BuilderMetadataFields.tsx -var import_obsidian23 = require("obsidian"); -var allMetadataForFiles = (plugin, files) => { - return files.reduce((p3, c4) => { - const fm = frontMatterForFile(plugin, c4); - const fmKeys = uniqCaseInsensitive(frontMatterKeys(fm)); - if (plugin.dataViewAPI()) { - const dvValues = plugin.dataViewAPI().page(c4.path); - const dvKeys = uniqCaseInsensitive( - Object.keys(dvValues != null ? dvValues : {}).filter( - (f4, i4, self2) => !self2.find( - (g4, j4) => g4.toLowerCase().replace(/\s/g, "-") == f4.toLowerCase().replace(/\s/g, "-") && i4 > j4 - ) ? true : false - ).filter((f4) => f4 != "file" && !fmKeys.some((g4) => f4 == g4)) - ); - return [ - ...p3, - ...fmKeys.map((f4) => ({ name: f4, type: "fm" })), - ...dvKeys.map((f4) => ({ name: f4, type: "dv" })) - ].filter(metadatTypeFilterPredicate); +// src/react/components/UI/Modals/vaultChangeModals.ts +var import_obsidian18 = require("obsidian"); +var VaultChangeModal = class extends import_obsidian18.Modal { + constructor(plugin, file, action, space) { + super(plugin.app); + this.file = file; + this.action = action; + this.plugin = plugin; + this.space = space; + } + onOpen() { + const { contentEl } = this; + let headerText; + if (this.action === "rename") { + headerText = i18n_default.labels.rename; + } else if (this.action === "create folder") { + headerText = i18n_default.labels.createFolder; + } else if (this.action === "create note") { + headerText = i18n_default.labels.createNote; } - return [ - ...p3, - ...fmKeys.map((f4) => ({ name: f4, type: "fm" })) - ].filter(metadatTypeFilterPredicate); - }, []); -}; -var metadatTypeFilterPredicate = (value, index, self2) => { - return self2.findIndex( - (v3) => value["type"] == v3["type"] && value["name"] == v3["name"] - ) === index; -}; - -// src/components/UI/menus/datePickerMenu.tsx -var import_obsidian24 = require("obsidian"); - -// node_modules/react-day-picker/dist/index.esm.js -var __assign = function() { - __assign = Object.assign || function __assign5(t4) { - for (var s5, i4 = 1, n2 = arguments.length; i4 < n2; i4++) { - s5 = arguments[i4]; - for (var p3 in s5) - if (Object.prototype.hasOwnProperty.call(s5, p3)) - t4[p3] = s5[p3]; + const headerEl = contentEl.createEl("div", { text: headerText }); + headerEl.addClass("modal-title"); + const inputEl = contentEl.createEl("input"); + inputEl.style.cssText = "width: 100%; height: 2.5em; margin-bottom: 15px;"; + if (this.action === "rename") { + if (this.file instanceof import_obsidian18.TFolder) { + inputEl.value = this.file.name; + } else { + inputEl.value = this.file.name.substring( + 0, + indexOfCharElseEOS(".", this.file.name) + ); + } } - return t4; - }; - return __assign.apply(this, arguments); -}; -function __rest(s5, e4) { - var t4 = {}; - for (var p3 in s5) - if (Object.prototype.hasOwnProperty.call(s5, p3) && e4.indexOf(p3) < 0) - t4[p3] = s5[p3]; - if (s5 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i4 = 0, p3 = Object.getOwnPropertySymbols(s5); i4 < p3.length; i4++) { - if (e4.indexOf(p3[i4]) < 0 && Object.prototype.propertyIsEnumerable.call(s5, p3[i4])) - t4[p3[i4]] = s5[p3[i4]]; + inputEl.focus(); + let changeButtonText; + if (this.action === "rename") { + changeButtonText = i18n_default.buttons.rename; + } else if (this.action === "create folder") { + changeButtonText = i18n_default.buttons.createFolder; + } else if (this.action === "create note") { + changeButtonText = i18n_default.buttons.createNote; } - return t4; -} -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) - for (var i4 = 0, l3 = from.length, ar; i4 < l3; i4++) { - if (ar || !(i4 in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i4); - ar[i4] = from[i4]; + const changeButton = contentEl.createEl("button", { + text: changeButtonText + }); + const cancelButton = contentEl.createEl("button", { + text: i18n_default.buttons.cancel + }); + cancelButton.style.cssText = "float: right;"; + cancelButton.addEventListener("click", () => { + this.close(); + }); + const onClickAction = async () => { + const newName = inputEl.value; + if (this.action === "rename") { + renameFile(this.plugin, this.file, newName); + } else if (this.action === "create folder") { + const path = !this.file || this.file.path == "/" ? newName : this.file.path + "/" + newName; + if (getAbstractFileAtPath(this.plugin, path)) { + new import_obsidian18.Notice(i18n_default.notice.folderExists); + return; + } + this.plugin.files.createFolder(path); + if (this.space) + insertSpaceItemAtIndex(this.plugin, this.space, path, 0); } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function isDayPickerMultiple(props2) { - return props2.mode === "multiple"; -} -function isDayPickerRange(props2) { - return props2.mode === "range"; -} -function isDayPickerSingle(props2) { - return props2.mode === "single"; -} -var defaultClassNames = { - root: "rdp", - multiple_months: "rdp-multiple_months", - with_weeknumber: "rdp-with_weeknumber", - vhidden: "rdp-vhidden", - button_reset: "rdp-button_reset", - button: "rdp-button", - caption: "rdp-caption", - caption_start: "rdp-caption_start", - caption_end: "rdp-caption_end", - caption_between: "rdp-caption_between", - caption_label: "rdp-caption_label", - caption_dropdowns: "rdp-caption_dropdowns", - dropdown: "rdp-dropdown", - dropdown_month: "rdp-dropdown_month", - dropdown_year: "rdp-dropdown_year", - dropdown_icon: "rdp-dropdown_icon", - months: "rdp-months", - month: "rdp-month", - table: "rdp-table", - tbody: "rdp-tbody", - tfoot: "rdp-tfoot", - head: "rdp-head", - head_row: "rdp-head_row", - head_cell: "rdp-head_cell", - nav: "rdp-nav", - nav_button: "rdp-nav_button", - nav_button_previous: "rdp-nav_button_previous", - nav_button_next: "rdp-nav_button_next", - nav_icon: "rdp-nav_icon", - row: "rdp-row", - weeknumber: "rdp-weeknumber", - cell: "rdp-cell", - day: "rdp-day", - day_today: "rdp-day_today", - day_outside: "rdp-day_outside", - day_selected: "rdp-day_selected", - day_disabled: "rdp-day_disabled", - day_hidden: "rdp-day_hidden", - day_range_start: "rdp-day_range_start", - day_range_end: "rdp-day_range_end", - day_range_middle: "rdp-day_range_middle" + this.close(); + }; + changeButton.addEventListener("click", onClickAction); + inputEl.addEventListener("keydown", (e4) => { + if (e4.key === "Enter") + onClickAction(); + }); + } + onClose() { + const { contentEl } = this; + contentEl.empty(); + } }; -function formatCaption(month, options) { - return format(month, "LLLL y", options); -} -function formatDay(day, options) { - return format(day, "d", options); -} -function formatMonthCaption(month, options) { - return format(month, "LLLL", options); -} -function formatWeekNumber(weekNumber) { - return "".concat(weekNumber); -} -function formatWeekdayName(weekday, options) { - return format(weekday, "cccccc", options).toUpperCase(); -} -function formatYearCaption(year, options) { - return format(year, "yyyy", options); -} -var formatters3 = /* @__PURE__ */ Object.freeze({ - __proto__: null, - formatCaption, - formatDay, - formatMonthCaption, - formatWeekNumber, - formatWeekdayName, - formatYearCaption -}); -var labelDay = function(day, activeModifiers, options) { - return format(day, "do MMMM (EEEE)", options); +var MoveSuggestionModal = class extends import_obsidian18.FuzzySuggestModal { + constructor(plugin, files) { + super(plugin.app); + this.files = files; + this.plugin = plugin; + } + getItemText(item) { + return item.path; + } + getItems() { + return getAllFoldersInVault(this.plugin); + } + onChooseItem(item, evt) { + this.files.forEach((f4) => { + const file = getAbstractFileAtPath(this.plugin, f4); + if (file) { + this.app.vault.rename(file, item.path + "/" + file.name); + } + }); + } +}; + +// src/schemas/spaces.ts +var vaultSchema = { + uniques: ["path"], + cols: ["path", "parent", "created", "sticker", "color", "folder", "rank"], + rows: [] +}; + +// src/superstate/cacheParsers.ts +var import_lodash6 = __toESM(require_lodash()); + +// src/utils/defaultIconForExtension.ts +var defaultIconForExtension = (path, type, solid) => { + if (path == "Spaces/Home") + return "ui//mk-ui-spaces"; + if (!type) + return solid ? "ui//mk-ui-folder-solid" : "ui//mk-ui-folder"; + switch (type) { + case "png": + case "jpg": + case "jpeg": + case "svg": + return "ui//mk-make-image"; + break; + case "mov": + case "webm": + return "ui//mk-ui-video"; + break; + case "canvas": + return "ui//mk-ui-canvas"; + default: + return solid ? "ui//mk-ui-file-solid" : "ui//mk-ui-file"; + } }; -var labelMonthDropdown = function() { - return "Month: "; + +// src/utils/spaces/query.ts +var filterFilesForAny = (files, filters) => { + const newArray = filters.reduce((p3, c4) => { + const [result, remaining] = p3; + const filteredFiles = c4.type == "fileprop" ? filterFileprop(remaining, c4) : c4.type == "filemeta" ? filterFilemeta(remaining, c4) : c4.type == "frontmatter" ? filterFM(remaining, c4) : []; + const diffArray = remaining.filter((x5) => !filteredFiles.includes(x5)); + return [[...result, ...filteredFiles], diffArray]; + }, [[], files]); + return newArray[0]; }; -var labelNext = function() { - return "Go to next month"; +var filterFilesForAll = (files, filters) => { + return filters.reduce((p3, c4) => { + return c4.type == "fileprop" ? filterFileprop(p3, c4) : c4.type == "filemeta" ? filterFilemeta(p3, c4) : c4.type == "frontmatter" ? filterFM(p3, c4) : []; + }, files); }; -var labelPrevious = function() { - return "Go to previous month"; +var filterFM = (files, def) => { + return files.filter((f4) => { + const fm = f4.frontmatter; + if (!fm || !fm[def.field]) { + return false; + } + const filterFn = filterFnTypes[def.fn]; + let result = true; + if (filterFn) { + result = filterFn.fn(parseFrontMatter(def.field, fm[def.field]), def.value); + } + return result; + }); }; -var labelWeekday = function(day, options) { - return format(day, "cccc", options); +var filterFilemeta = (files, def) => { + return files.filter((f4) => { + let value = ""; + if (def.field == "outlinks") { + value = serializeMultiString(f4.outlinks); + } else if (def.field == "inlinks") { + value = serializeMultiString(f4.inlinks); + } else if (def.field == "tags") { + value = serializeMultiString(f4.tags); + } + const filterFn = filterFnTypes[def.fn]; + let result = true; + if (filterFn) { + result = filterFn.fn(value, def.value); + } + return result; + }); }; -var labelWeekNumber = function(n2) { - return "Week n. ".concat(n2); +var filterFileprop = (files, def) => { + return files.filter((f4) => { + const vaultItemFields = ["name", "path", "sticker", "color", "isFolder", "extension", "ctime", "mtime", "size", "parent"]; + if (vaultItemFields.includes(def.field)) { + const filterFn = filterFnTypes[def.fn]; + let result = true; + if (filterFn) { + result = filterFn.fn(f4[def.field], def.value); + } + return result; + } + return true; + }); }; -var labelYearDropdown = function() { - return "Year: "; +var fileByDef = (filters, file) => { + const fileInFilter = filters.reduce((p3, c4) => { + if (!p3 || c4.filters.length == 0) + return p3; + const result = c4.type == "any" ? filterFilesForAny([file], c4.filters).length > 0 : filterFilesForAll([file], c4.filters).length > 0; + return result; + }, true); + return fileInFilter; }; -var labels = /* @__PURE__ */ Object.freeze({ - __proto__: null, - labelDay, - labelMonthDropdown, - labelNext, - labelPrevious, - labelWeekNumber, - labelWeekday, - labelYearDropdown -}); -function getDefaultContextValues() { - var captionLayout = "buttons"; - var classNames9 = defaultClassNames; - var locale2 = en_US_default; - var modifiersClassNames = {}; - var modifiers = {}; - var numberOfMonths = 1; - var styles2 = {}; - var today = new Date(); + +// src/superstate/cacheParsers.ts +var fileMetadataToVaultItem = (cache) => { + var _a2, _b2; return { - captionLayout, - classNames: classNames9, - formatters: formatters3, - labels, - locale: locale2, - modifiersClassNames, - modifiers, - numberOfMonths, - styles: styles2, - today, - mode: "default" + path: cache.path, + parent: cache.parent, + color: cache.color, + created: (_b2 = (_a2 = cache.ctime) == null ? void 0 : _a2.toString()) != null ? _b2 : "", + sticker: cache.sticker, + folder: cache.isFolder ? "true" : "false" }; -} -function parseFromToProps(props2) { - var fromYear = props2.fromYear, toYear = props2.toYear, fromMonth = props2.fromMonth, toMonth = props2.toMonth; - var fromDate = props2.fromDate, toDate2 = props2.toDate; - if (fromMonth) { - fromDate = startOfMonth(fromMonth); - } else if (fromYear) { - fromDate = new Date(fromYear, 0, 1); +}; + +// src/utils/metadata/tags.ts +var import_obsidian19 = require("obsidian"); +var tagKeys = ["tag", "tags", "Tag", "Tags"]; +var tagToTagPath = (tag) => { + if (!tag) + return null; + let string = tag; + if (string.charAt(0) != "#") + string = "#" + string; + return encodeSpaceName(string); +}; +var tagPathToTag = (string) => { + return filePathToString(string).replace(/\+/g, "/"); +}; +var loadTags = (plugin) => { + var _a2; + const folder = plugin.settings.spacesFolder == "" ? plugin.app.vault.getRoot() : getAbstractFileAtPath( + plugin, + getFolderPathFromString(plugin, plugin.settings.spacesFolder) + ); + return uniq([ + ...Object.keys(plugin.app.metadataCache.getTags()), + ...(_a2 = folder == null ? void 0 : folder.children.filter( + (f4) => f4 instanceof import_obsidian19.TFolder && f4.name.charAt(0) == "#" + ).map((f4) => tagPathToTag(f4.name))) != null ? _a2 : [] + ]); +}; +var tagExists = (currentCache, findTag) => { + let currentTags = []; + if ((0, import_obsidian19.getAllTags)(currentCache)) { + currentTags = (0, import_obsidian19.getAllTags)(currentCache); } - if (toMonth) { - toDate2 = endOfMonth(toMonth); - } else if (toYear) { - toDate2 = new Date(toYear, 11, 31); + return currentTags.find((tag) => tag.toLowerCase() == findTag.toLowerCase()) ? true : false; +}; +var getAllFilesForTag = (plugin, tag) => { + const tagsCache = []; + (() => { + plugin.app.vault.getMarkdownFiles().forEach((tfile) => { + let currentCache; + if (plugin.app.metadataCache.getFileCache(tfile) !== null) { + currentCache = plugin.app.metadataCache.getFileCache(tfile); + } + const relativePath = tfile.path; + const hasTag = tagExists(currentCache, tag); + if (hasTag) { + tagsCache.push(relativePath); + } + }); + })(); + return tagsCache; +}; +var addTagToNote = (plugin, tag, tFile) => { + const newTag = validateName(tag); + editTagInFrontmatter(plugin, "", newTag, tFile); +}; +var positionsForTag = (plugin, tag, file) => { + const currentCache = plugin.app.metadataCache.getFileCache(file); + if (currentCache.tags) { + const positions = currentCache.tags.filter((f4) => f4.tag == tag).map((f4) => f4.position).sort((a5, b4) => { + if (a5.start.offset < b4.start.offset) { + return -1; + } + if (a5.start.offset > b4.start.offset) { + return 1; + } + return 0; + }); + return positions; } - return { - fromDate: fromDate ? startOfDay(fromDate) : void 0, - toDate: toDate2 ? startOfDay(toDate2) : void 0 - }; -} -var DayPickerContext = F(void 0); -function DayPickerProvider(props2) { - var _a2; - var initialProps = props2.initialProps; - var defaultContextValues = getDefaultContextValues(); - var _b2 = parseFromToProps(initialProps), fromDate = _b2.fromDate, toDate2 = _b2.toDate; - var captionLayout = (_a2 = initialProps.captionLayout) !== null && _a2 !== void 0 ? _a2 : defaultContextValues.captionLayout; - if (captionLayout !== "buttons" && (!fromDate || !toDate2)) { - captionLayout = "buttons"; + return []; +}; +var removeTagFromFile = (plugin, tag, file) => { + const pos = positionsForTag(plugin, tag, file); + removeTagInFrontmatter(plugin, tag, file); + editTagInFileBody(plugin, tag, "", pos, file); +}; +var validateName = (tag) => { + return tag.trim(); +}; +var renameTag = async (plugin, tag, toTag) => { + const tags = getAllSubtags(plugin, tag); + const newTag = validateName(toTag); + const files = getAllFilesForTag(plugin, tag); + for (const file of files) { + const tFile = getAbstractFileAtPath(plugin, file); + if (tFile instanceof import_obsidian19.TFile) { + const positions = positionsForTag(plugin, tag, tFile); + if (positions.length > 0) { + await editTagInFileBody(plugin, tag, newTag, positions, tFile); + } else { + await editTagInFrontmatter(plugin, tag, newTag, tFile); + } + } } - var onSelect; - if (isDayPickerSingle(initialProps) || isDayPickerMultiple(initialProps) || isDayPickerRange(initialProps)) { - onSelect = initialProps.onSelect; + await renameTagSpaceFolder(plugin, tag, toTag); + plugin.index.renameTag(tag, toTag); + for (const subtag of tags) { + await renameTag(plugin, subtag, subtag.replace(tag, newTag)); } - var value = __assign(__assign(__assign({}, defaultContextValues), initialProps), { captionLayout, classNames: __assign(__assign({}, defaultContextValues.classNames), initialProps.classNames), components: __assign({}, initialProps.components), formatters: __assign(__assign({}, defaultContextValues.formatters), initialProps.formatters), fromDate, labels: __assign(__assign({}, defaultContextValues.labels), initialProps.labels), mode: initialProps.mode || defaultContextValues.mode, modifiers: __assign(__assign({}, defaultContextValues.modifiers), initialProps.modifiers), modifiersClassNames: __assign(__assign({}, defaultContextValues.modifiersClassNames), initialProps.modifiersClassNames), onSelect, styles: __assign(__assign({}, defaultContextValues.styles), initialProps.styles), toDate: toDate2 }); - return Cn.createElement(DayPickerContext.Provider, { value }, props2.children); -} -function useDayPicker() { - var context = q2(DayPickerContext); - if (!context) { - throw new Error("useDayPicker must be used within a DayPickerProvider."); +}; +var getAllSubtags = (plugin, tag) => { + const tags = loadTags(plugin); + return tags.filter((f4) => f4.startsWith(tag) && f4 != tag); +}; +var getAllParentTags = (str) => { + if (str.startsWith("#")) { + str = str.slice(1); } - return context; -} -function CaptionLabel(props2) { - var _a2 = useDayPicker(), locale2 = _a2.locale, classNames9 = _a2.classNames, styles2 = _a2.styles, formatCaption2 = _a2.formatters.formatCaption; - return Cn.createElement("div", { className: classNames9.caption_label, style: styles2.caption_label, "aria-live": "polite", role: "presentation", id: props2.id }, formatCaption2(props2.displayMonth, { locale: locale2 })); -} -function IconDropdown(props2) { - return Cn.createElement( - "svg", - __assign({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, props2), - Cn.createElement("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" }) - ); -} -function Dropdown(props2) { - var _a2, _b2; - var onChange = props2.onChange, value = props2.value, children = props2.children, caption = props2.caption, className = props2.className, style = props2.style; - var dayPicker = useDayPicker(); - var IconDropdownComponent = (_b2 = (_a2 = dayPicker.components) === null || _a2 === void 0 ? void 0 : _a2.IconDropdown) !== null && _b2 !== void 0 ? _b2 : IconDropdown; - return Cn.createElement( - "div", - { className, style }, - Cn.createElement("span", { className: dayPicker.classNames.vhidden }, props2["aria-label"]), - Cn.createElement("select", { name: props2.name, "aria-label": props2["aria-label"], className: dayPicker.classNames.dropdown, style: dayPicker.styles.dropdown, value, onChange }, children), - Cn.createElement( - "div", - { className: dayPicker.classNames.caption_label, style: dayPicker.styles.caption_label, "aria-hidden": "true" }, - caption, - Cn.createElement(IconDropdownComponent, { className: dayPicker.classNames.dropdown_icon, style: dayPicker.styles.dropdown_icon }) - ) - ); -} -function MonthsDropdown(props2) { - var _a2; - var _b2 = useDayPicker(), fromDate = _b2.fromDate, toDate2 = _b2.toDate, styles2 = _b2.styles, locale2 = _b2.locale, formatMonthCaption2 = _b2.formatters.formatMonthCaption, classNames9 = _b2.classNames, components = _b2.components, labelMonthDropdown2 = _b2.labels.labelMonthDropdown; - if (!fromDate) - return Cn.createElement(Cn.Fragment, null); - if (!toDate2) - return Cn.createElement(Cn.Fragment, null); - var dropdownMonths = []; - if (isSameYear(fromDate, toDate2)) { - var date = startOfMonth(fromDate); - for (var month = fromDate.getMonth(); month <= toDate2.getMonth(); month++) { - dropdownMonths.push(setMonth(date, month)); - } - } else { - var date = startOfMonth(new Date()); - for (var month = 0; month <= 11; month++) { - dropdownMonths.push(setMonth(date, month)); + const parts = str.split("/"); + const result = []; + for (let i4 = 0; i4 < parts.length - 1; i4++) { + if (i4 === 0) { + result.push(parts[i4]); + } else { + result.push(result[i4 - 1] + "/" + parts[i4]); } } - var handleChange = function(e4) { - var selectedMonth = Number(e4.target.value); - var newMonth = setMonth(startOfMonth(props2.displayMonth), selectedMonth); - props2.onChange(newMonth); - }; - var DropdownComponent2 = (_a2 = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a2 !== void 0 ? _a2 : Dropdown; - return Cn.createElement(DropdownComponent2, { name: "months", "aria-label": labelMonthDropdown2(), className: classNames9.dropdown_month, style: styles2.dropdown_month, onChange: handleChange, value: props2.displayMonth.getMonth(), caption: formatMonthCaption2(props2.displayMonth, { locale: locale2 }) }, dropdownMonths.map(function(m5) { - return Cn.createElement("option", { key: m5.getMonth(), value: m5.getMonth() }, formatMonthCaption2(m5, { locale: locale2 })); - })); -} -function YearsDropdown(props2) { + return result; +}; +var removeTagInFrontmatter = async (plugin, oldTag, file) => { var _a2; - var displayMonth = props2.displayMonth; - var _b2 = useDayPicker(), fromDate = _b2.fromDate, toDate2 = _b2.toDate, locale2 = _b2.locale, styles2 = _b2.styles, classNames9 = _b2.classNames, components = _b2.components, formatYearCaption2 = _b2.formatters.formatYearCaption, labelYearDropdown2 = _b2.labels.labelYearDropdown; - var years = []; - if (!fromDate) - return Cn.createElement(Cn.Fragment, null); - if (!toDate2) - return Cn.createElement(Cn.Fragment, null); - var fromYear = fromDate.getFullYear(); - var toYear = toDate2.getFullYear(); - for (var year = fromYear; year <= toYear; year++) { - years.push(setYear(startOfYear(new Date()), year)); + let fm; + if (plugin.app.metadataCache.getFileCache(file) !== null) { + fm = (_a2 = plugin.app.metadataCache.getFileCache(file)) == null ? void 0 : _a2.frontmatter; } - var handleChange = function(e4) { - var newMonth = setYear(startOfMonth(displayMonth), Number(e4.target.value)); - props2.onChange(newMonth); - }; - var DropdownComponent2 = (_a2 = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a2 !== void 0 ? _a2 : Dropdown; - return Cn.createElement(DropdownComponent2, { name: "years", "aria-label": labelYearDropdown2(), className: classNames9.dropdown_year, style: styles2.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption2(displayMonth, { locale: locale2 }) }, years.map(function(year2) { - return Cn.createElement("option", { key: year2.getFullYear(), value: year2.getFullYear() }, formatYearCaption2(year2, { locale: locale2 })); - })); -} -function useControlledValue(defaultValue2, controlledValue) { - var _a2 = h2(defaultValue2), uncontrolledValue = _a2[0], setValue = _a2[1]; - var value = controlledValue === void 0 ? uncontrolledValue : controlledValue; - return [value, setValue]; -} -function getInitialMonth(context) { - var month = context.month, defaultMonth = context.defaultMonth, today = context.today; - var initialMonth = month || defaultMonth || today || new Date(); - var toDate2 = context.toDate, fromDate = context.fromDate, _a2 = context.numberOfMonths, numberOfMonths = _a2 === void 0 ? 1 : _a2; - if (toDate2 && differenceInCalendarMonths(toDate2, initialMonth) < 0) { - var offset2 = -1 * (numberOfMonths - 1); - initialMonth = addMonths(toDate2, offset2); + if (fm && plugin.metadata.canProcessFrontmatter()) { + const processKey = (value) => { + if (Array.isArray(value)) { + return value.filter((f4) => stringFromTag(oldTag) != f4); + } else if (typeof value === "string") { + return serializeMultiDisplayString( + value.replace(/\s/g, "").split(",").filter((f4) => stringFromTag(oldTag) != f4) + ); + } + return value; + }; + const editKeys = tagKeys.filter((f4) => { + let tags = []; + if (Array.isArray(fm[f4])) { + tags = fm[f4]; + } else if (typeof fm[f4] === "string") { + tags = fm[f4].replace(/\s/g, "").split(","); + } + if (tags.find((g4) => g4 == stringFromTag(oldTag))) + return true; + return false; + }); + editKeys.forEach((tag) => { + plugin.metadata.processFrontMatter(file.path, (frontmatter) => { + frontmatter[tag] = processKey(fm[tag]); + }); + }); } - if (fromDate && differenceInCalendarMonths(initialMonth, fromDate) < 0) { - initialMonth = fromDate; +}; +var editTagInFrontmatter = async (plugin, oldTag, newTag, file) => { + var _a2; + let fm; + if (plugin.app.metadataCache.getFileCache(file) !== null) { + fm = (_a2 = plugin.app.metadataCache.getFileCache(file)) == null ? void 0 : _a2.frontmatter; } - return startOfMonth(initialMonth); -} -function useNavigationState() { - var context = useDayPicker(); - var initialMonth = getInitialMonth(context); - var _a2 = useControlledValue(initialMonth, context.month), month = _a2[0], setMonth2 = _a2[1]; - var goToMonth = function(date) { - var _a3; - if (context.disableNavigation) - return; - var month2 = startOfMonth(date); - setMonth2(month2); - (_a3 = context.onMonthChange) === null || _a3 === void 0 ? void 0 : _a3.call(context, month2); + const addTag = (plugin2, value) => { + if (Array.isArray(value)) { + return uniq([...value, stringFromTag(newTag)]).filter((f4) => (f4 == null ? void 0 : f4.length) > 0); + } else if (typeof value === "string") { + return serializeMultiDisplayString(uniq([ + ...value.replace(/\s/g, "").split(","), + stringFromTag(newTag) + ]).filter((f4) => (f4 == null ? void 0 : f4.length) > 0)); + } + return stringFromTag(newTag); }; - return [month, goToMonth]; -} -function getDisplayMonths(month, _a2) { - var reverseMonths = _a2.reverseMonths, numberOfMonths = _a2.numberOfMonths; - var start = startOfMonth(month); - var end = startOfMonth(addMonths(start, numberOfMonths)); - var monthsDiff = differenceInCalendarMonths(end, start); - var months = []; - for (var i4 = 0; i4 < monthsDiff; i4++) { - var nextMonth = addMonths(start, i4); - months.push(nextMonth); + if (plugin.metadata.canProcessFrontmatter()) { + if (fm) { + const processKey = (value) => { + if (Array.isArray(value)) { + return uniq( + value.map( + (f4) => stringFromTag(oldTag) == f4 ? stringFromTag(newTag) : f4 + ) + ); + } else if (typeof value === "string") { + return serializeMultiDisplayString(uniq( + value.replace(/\s/g, "").split(",").map( + (f4) => stringFromTag(oldTag) == f4 ? stringFromTag(newTag) : f4 + ) + )); + } + return value; + }; + const editKeys = tagKeys.filter((f4) => { + let tags = []; + if (Array.isArray(fm[f4])) { + tags = fm[f4]; + } else if (typeof fm[f4] === "string") { + tags = fm[f4].replace(/\s/g, "").split(","); + } + if (tags.find((g4) => g4 == stringFromTag(oldTag))) + return true; + return false; + }); + if (editKeys.length > 0) { + editKeys.forEach((key2) => { + plugin.metadata.processFrontMatter(file.path, (frontmatter) => { + frontmatter[key2] = processKey(fm[key2]); + }); + }); + } else { + plugin.metadata.processFrontMatter(file.path, (frontmatter) => { + frontmatter["tags"] = addTag(plugin, fm["tags"]); + }); + } + } else { + plugin.metadata.processFrontMatter(file.path, (frontmatter) => { + frontmatter["tags"] = stringFromTag(newTag); + }); + } } - if (reverseMonths) - months = months.reverse(); - return months; -} -function getNextMonth(startingMonth, options) { - if (options.disableNavigation) { - return void 0; +}; +var editTagInFileBody = async (plugin, oldTag, newTag, positions, file) => { + const offsetOffset = newTag.length - oldTag.length; + if (positions.length == 0) + return false; + const original = await plugin.app.vault.read(file); + let text2 = original; + let offset2 = 0; + for (const { start, end } of positions) { + const startOff = start.offset + offset2; + const endOff = end.offset + offset2; + if (text2.slice(startOff, endOff) !== oldTag) { + return false; + } + text2 = text2.slice(0, startOff) + newTag + text2.slice(startOff + oldTag.length); + offset2 += offsetOffset; } - var toDate2 = options.toDate, pagedNavigation = options.pagedNavigation, _a2 = options.numberOfMonths, numberOfMonths = _a2 === void 0 ? 1 : _a2; - var offset2 = pagedNavigation ? numberOfMonths : 1; - var month = startOfMonth(startingMonth); - if (!toDate2) { - return addMonths(month, offset2); + if (text2 !== original) { + await plugin.app.vault.modify(file, text2); + return true; } - var monthsDiff = differenceInCalendarMonths(toDate2, startingMonth); - if (monthsDiff < numberOfMonths) { - return void 0; +}; + +// src/utils/tree.ts +var import_obsidian20 = require("obsidian"); +var nodeIsAncestorOfTarget = (path, target) => { + if (target.type == "folder" && path.type == "folder") + return target.path.startsWith(path.path); + return false; +}; +var excludeVaultItemPredicate = (settings) => (f4, index, folder) => !(f4.folder != "true" && settings.hiddenExtensions.find( + (e4) => f4.path.endsWith(e4) +)) && !settings.hiddenFiles.find((e4) => e4 == f4.path) && (!settings.enableFolderNote || !settings.folderNoteInsideFolder && !folder.some((g4) => g4.path + ".md" == f4.path) || settings.folderNoteInsideFolder && !(f4.parent + "/" + folderPathToString(f4.parent) + ".md" == f4.path)); +var excludeFilePredicate = (plugin) => (f4) => f4 && !(f4 instanceof import_obsidian20.TFile && plugin.settings.hiddenExtensions.some((e4) => f4.extension == e4)) && !f4.path.startsWith(plugin.settings.spacesFolder + "/#") && !plugin.settings.hiddenFiles.some((e4) => e4 == f4.path) && (!f4.parent || !plugin.settings.enableFolderNote || !plugin.settings.folderNoteInsideFolder && !f4.parent.children.some((g4) => g4.path + ".md" == f4.path) || plugin.settings.folderNoteInsideFolder && !((f4.parent.path == "/" ? plugin.systemName() + ".md" : f4.parent.path + "/" + f4.parent.name + ".md") == f4.path)); +var folderChildren = (plugin, f4, exclusionList) => { + var _a2, _b2; + return (_b2 = (_a2 = f4 == null ? void 0 : f4.children) == null ? void 0 : _a2.filter(excludeFilePredicate(plugin))) != null ? _b2 : []; +}; +var compareByField = (field, dir) => (_a2, _b2) => { + const a5 = dir ? _a2 : _b2; + const b4 = dir ? _b2 : _a2; + if (a5[field] < b4[field]) { + return -1; } - return addMonths(month, offset2); -} -function getPreviousMonth(startingMonth, options) { - if (options.disableNavigation) { - return void 0; + if (a5[field] > b4[field]) { + return 1; } - var fromDate = options.fromDate, pagedNavigation = options.pagedNavigation, _a2 = options.numberOfMonths, numberOfMonths = _a2 === void 0 ? 1 : _a2; - var offset2 = pagedNavigation ? numberOfMonths : 1; - var month = startOfMonth(startingMonth); - if (!fromDate) { - return addMonths(month, -offset2); + return 0; +}; +var compareByFieldCaseInsensitive = (field, dir) => (_a2, _b2) => { + var _a3, _b3, _c2, _d2; + const a5 = dir ? _a2 : _b2; + const b4 = dir ? _b2 : _a2; + if (((_a3 = a5[field]) == null ? void 0 : _a3.toLowerCase()) < ((_b3 = b4[field]) == null ? void 0 : _b3.toLowerCase())) { + return -1; } - var monthsDiff = differenceInCalendarMonths(month, fromDate); - if (monthsDiff <= 0) { - return void 0; + if (((_c2 = a5[field]) == null ? void 0 : _c2.toLowerCase()) > ((_d2 = b4[field]) == null ? void 0 : _d2.toLowerCase())) { + return 1; } - return addMonths(month, -offset2); + return 0; +}; +var internalPluginLoaded = (pluginName, app2) => { + var _a2; + return (_a2 = app2.internalPlugins.plugins[pluginName]) == null ? void 0 : _a2._loaded; +}; +function selectElementContents(el) { + if (!el) + return; + const range = document.createRange(); + range.selectNodeContents(el); + const sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); } -var NavigationContext = F(void 0); -function NavigationProvider(props2) { - var dayPicker = useDayPicker(); - var _a2 = useNavigationState(), currentMonth = _a2[0], goToMonth = _a2[1]; - var displayMonths = getDisplayMonths(currentMonth, dayPicker); - var nextMonth = getNextMonth(currentMonth, dayPicker); - var previousMonth = getPreviousMonth(currentMonth, dayPicker); - var isDateDisplayed = function(date) { - return displayMonths.some(function(displayMonth) { - return isSameMonth(date, displayMonth); - }); + +// src/superstate/spacesStore/spaces.ts +var spaceContextsKey = (plugin) => plugin.settings.fmKeyContexts; +var spaceFilterKey = (plugin) => plugin.settings.fmKeyFilter; +var spaceLinksKey = (plugin) => plugin.settings.fmKeyLinks; +var spaceSortKey = (plugin) => plugin.settings.fmKeySort; +var FMSpaceKeys = (plugin) => [spaceContextsKey(plugin), spaceFilterKey(plugin), spaceLinksKey(plugin), spaceSortKey(plugin)]; +var parseSpaceSort = (value) => { + var _a2; + return { + field: ensureString((_a2 = value == null ? void 0 : value["field"]) != null ? _a2 : "rank"), + asc: ensureBoolean(value == null ? void 0 : value["asc"]), + group: ensureBoolean(value == null ? void 0 : value["group"]) }; - var goToDate = function(date, refDate) { - if (isDateDisplayed(date)) { - return; - } - if (refDate && isBefore(date, refDate)) { - goToMonth(addMonths(date, 1 + dayPicker.numberOfMonths * -1)); - } else { - goToMonth(date); - } +}; +var parseSpaceFilterGroupFilter = (value) => { + return { + type: ensureStringValueFromSet(value["type"], ["frontmatter", "fileprop", "filemeta"], "frontmatter"), + fType: ensureString(value["fType"]), + field: ensureString(value["field"]), + fn: ensureString(value["fn"]), + value: ensureString(value["value"]) }; - var value = { - currentMonth, - displayMonths, - goToMonth, - goToDate, - previousMonth, - nextMonth, - isDateDisplayed +}; +var parseSpaceFilterGroup = (value) => { + return { + type: ensureStringValueFromSet(value["type"], ["any", "all"], "any"), + trueFalse: value["truefalse"] ? true : false, + filters: ensureArray(value["filters"]).map((f4) => parseSpaceFilterGroupFilter(f4)) }; - return Cn.createElement(NavigationContext.Provider, { value }, props2.children); -} -function useNavigation() { - var context = q2(NavigationContext); - if (!context) { - throw new Error("useNavigation must be used within a NavigationProvider"); +}; +var parseSpaceMetadata = (metadata, spaceInfo, plugin) => { + return { ...metadata, sort: parseSpaceSort(metadata[spaceSortKey(plugin)]), contexts: ensureArray(metadata[spaceContextsKey(plugin)]), links: ensureArray(metadata[spaceLinksKey(plugin)]), filters: ensureArray(metadata[spaceFilterKey(plugin)]).map((f4) => parseSpaceFilterGroup(f4)) }; +}; +var rebuildIndex = async (plugin, save) => { + var _a2; + console.time("Make.md Vault Index"); + const newTables = indexCurrentFileTree(plugin, (_a2 = plugin.index.vaultDBCache) != null ? _a2 : []); + if (save && !import_lodash7.default.isEqual(newTables.vault.rows, plugin.index.vaultDBCache)) { + await plugin.index.saveSpacesDatabaseToDisk(newTables, save); } - return context; -} -function CaptionDropdowns(props2) { + plugin.index.initialize(); + console.timeEnd("Make.md Vault Index"); +}; +var spaceToTreeNode = (space, collapsed, sortable, depth, parentId, parentPath, childrenCount, hasChildren) => { var _a2; - var _b2 = useDayPicker(), classNames9 = _b2.classNames, styles2 = _b2.styles, components = _b2.components; - var goToMonth = useNavigation().goToMonth; - var handleMonthChange = function(newMonth) { - goToMonth(newMonth); + return { + id: parentId ? parentId + "/" + space.path : space.path, + parentId, + depth, + index: 0, + space: parentPath, + path: space.path, + item: space, + uri: (_a2 = space.space) == null ? void 0 : _a2.uri, + collapsed, + sortable, + childrenCount, + type: "space", + leaf: false }; - var CaptionLabelComponent = (_a2 = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a2 !== void 0 ? _a2 : CaptionLabel; - var captionLabel = Cn.createElement(CaptionLabelComponent, { id: props2.id, displayMonth: props2.displayMonth }); - return Cn.createElement( - "div", - { className: classNames9.caption_dropdowns, style: styles2.caption_dropdowns }, - Cn.createElement("div", { className: classNames9.vhidden }, captionLabel), - Cn.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props2.displayMonth }), - Cn.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: props2.displayMonth }) - ); -} -function IconLeft(props2) { - return Cn.createElement( - "svg", - __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props2), - Cn.createElement("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" }) - ); -} -function IconRight(props2) { - return Cn.createElement( - "svg", - __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props2), - Cn.createElement("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" }) - ); -} -var Button = k3(function(props2, ref2) { - var _a2 = useDayPicker(), classNames9 = _a2.classNames, styles2 = _a2.styles; - var classNamesArr = [classNames9.button_reset, classNames9.button]; - if (props2.className) { - classNamesArr.push(props2.className); - } - var className = classNamesArr.join(" "); - var style = __assign(__assign({}, styles2.button_reset), styles2.button); - if (props2.style) { - Object.assign(style, props2.style); - } - return Cn.createElement("button", __assign({}, props2, { ref: ref2, type: "button", className, style })); +}; +var vaulItemToTreeNode = (plugin, item, space, path, depth, i4, collapsed, sortable, childrenCount, parentId) => ({ + item, + file: getAbstractFileAtPath(plugin, item.path), + space, + id: parentId + "/" + item.filename, + parentId, + depth, + path, + index: i4, + uri: uriByString(plugin, item.path), + collapsed, + sortable, + childrenCount, + type: "file", + leaf: true }); -function Navigation(props2) { - var _a2, _b2; - var _c2 = useDayPicker(), dir = _c2.dir, locale2 = _c2.locale, classNames9 = _c2.classNames, styles2 = _c2.styles, _d2 = _c2.labels, labelPrevious2 = _d2.labelPrevious, labelNext2 = _d2.labelNext, components = _c2.components; - if (!props2.nextMonth && !props2.previousMonth) { - return Cn.createElement(Cn.Fragment, null); +var spaceRowHeight = (plugin) => { + return platformIsMobile() ? 40 : plugin.settings.spaceRowHeight; +}; +var spaceSortFn = (sortStrategy) => (a5, b4) => { + if (sortStrategy.field == "rank") { + return a5.rank - b4.rank; } - var previousLabel = labelPrevious2(props2.previousMonth, { locale: locale2 }); - var previousClassName = [ - classNames9.nav_button, - classNames9.nav_button_previous - ].join(" "); - var nextLabel = labelNext2(props2.nextMonth, { locale: locale2 }); - var nextClassName = [ - classNames9.nav_button, - classNames9.nav_button_next - ].join(" "); - var IconRightComponent = (_a2 = components === null || components === void 0 ? void 0 : components.IconRight) !== null && _a2 !== void 0 ? _a2 : IconRight; - var IconLeftComponent = (_b2 = components === null || components === void 0 ? void 0 : components.IconLeft) !== null && _b2 !== void 0 ? _b2 : IconLeft; - return Cn.createElement( - "div", - { className: classNames9.nav, style: styles2.nav }, - !props2.hidePrevious && Cn.createElement(Button, { name: "previous-month", "aria-label": previousLabel, className: previousClassName, style: styles2.nav_button_previous, disabled: !props2.previousMonth, onClick: props2.onPreviousClick }, dir === "rtl" ? Cn.createElement(IconRightComponent, { className: classNames9.nav_icon, style: styles2.nav_icon }) : Cn.createElement(IconLeftComponent, { className: classNames9.nav_icon, style: styles2.nav_icon })), - !props2.hideNext && Cn.createElement(Button, { name: "next-month", "aria-label": nextLabel, className: nextClassName, style: styles2.nav_button_next, disabled: !props2.nextMonth, onClick: props2.onNextClick }, dir === "rtl" ? Cn.createElement(IconLeftComponent, { className: classNames9.nav_icon, style: styles2.nav_icon }) : Cn.createElement(IconRightComponent, { className: classNames9.nav_icon, style: styles2.nav_icon })) - ); -} -function CaptionNavigation(props2) { - var _a2; - var _b2 = useDayPicker(), numberOfMonths = _b2.numberOfMonths, dir = _b2.dir; - var _c2 = useNavigation(), previousMonth = _c2.previousMonth, nextMonth = _c2.nextMonth, goToMonth = _c2.goToMonth, displayMonths = _c2.displayMonths; - var displayIndex = displayMonths.findIndex(function(month) { - return isSameMonth(props2.displayMonth, month); - }); - var isFirst = displayIndex === 0; - var isLast = displayIndex === displayMonths.length - 1; - if (dir === "rtl") { - _a2 = [isFirst, isLast], isLast = _a2[0], isFirst = _a2[1]; + const sortFns = []; + if (sortStrategy.group) { + sortFns.push(compareByField("cacheType", false)); } - var hideNext = numberOfMonths > 1 && (isFirst || !isLast); - var hidePrevious = numberOfMonths > 1 && (isLast || !isFirst); - var handlePreviousClick = function() { - if (!previousMonth) - return; - goToMonth(previousMonth); - }; - var handleNextClick = function() { - if (!nextMonth) - return; - goToMonth(nextMonth); - }; - return Cn.createElement(Navigation, { displayMonth: props2.displayMonth, hideNext, hidePrevious, nextMonth, previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick }); -} -function Caption(props2) { - var _a2; - var _b2 = useDayPicker(), classNames9 = _b2.classNames, disableNavigation = _b2.disableNavigation, styles2 = _b2.styles, captionLayout = _b2.captionLayout, components = _b2.components; - var CaptionLabelComponent = (_a2 = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a2 !== void 0 ? _a2 : CaptionLabel; - var caption; - if (disableNavigation) { - caption = Cn.createElement(CaptionLabelComponent, { id: props2.id, displayMonth: props2.displayMonth }); - } else if (captionLayout === "dropdown") { - caption = Cn.createElement(CaptionDropdowns, { displayMonth: props2.displayMonth, id: props2.id }); - } else if (captionLayout === "dropdown-buttons") { - caption = Cn.createElement( - Cn.Fragment, - null, - Cn.createElement(CaptionDropdowns, { displayMonth: props2.displayMonth, id: props2.id }), - Cn.createElement(CaptionNavigation, { displayMonth: props2.displayMonth, id: props2.id }) - ); + if (sortStrategy.field == "name") { + sortFns.push(compareByFieldCaseInsensitive(sortStrategy.field, sortStrategy.asc)); } else { - caption = Cn.createElement( - Cn.Fragment, - null, - Cn.createElement(CaptionLabelComponent, { id: props2.id, displayMonth: props2.displayMonth }), - Cn.createElement(CaptionNavigation, { displayMonth: props2.displayMonth, id: props2.id }) + sortFns.push(compareByField(sortStrategy.field, sortStrategy.asc)); + } + return sortFns.reduce((p3, c4) => { + return p3 == 0 ? c4(a5, b4) : p3; + }, 0); +}; +var flattenedTreeFromVaultItems = (plugin, root, openNodes, depth, sortStrategy) => { + const _caches = plugin.index.getSpaceItems(root); + if (!_caches) { + return []; + } + const flattenNavigatorTree = (path, openNodes2, depth2, index, folderSort, caches) => { + const items = []; + let i4 = index; + const sortStrat = folderSort.length > 0 ? parseSortStrat(folderSort) : sortStrategy; + caches.sort(spaceSortFn(sortStrat)).forEach( + (item) => { + if (item.cacheType == "file") { + item = item; + const id2 = path + "/" + item.filename; + const collapsed = !openNodes2.includes(id2); + i4 = i4 + 1; + const newItems = []; + const newCaches = plugin.index.getSpaceItems(item.path); + if (newCaches && !collapsed) { + newItems.push( + ...flattenNavigatorTree(item.path, openNodes2, depth2 + 1, i4, item.sortBy, newCaches) + ); + } + const node = vaulItemToTreeNode( + plugin, + item, + item.path, + path, + depth2, + i4, + collapsed, + sortStrategy.field == "rank", + newItems.length, + path + ); + if (node.file) + newItems.splice(0, 0, node); + items.push(...newItems); + } else { + const collapsed = !openNodes2.includes(item.path); + items.push(spaceToTreeNode(item, collapsed, sortStrategy.field == "rank", depth2, path, item.path, 0, false)); + } + } ); + return items; + }; + return flattenNavigatorTree(root, openNodes, depth, 0, "", _caches); +}; +var vaultItemForPath = (plugin, path) => { + if (!path) + return null; + return plugin.index.vaultDBCache.find((f4) => f4.path == path); +}; +var saveFileSticker = async (plugin, path, sticker) => { + if (plugin.settings.spacesEnabled) { + const newVaultDB = plugin.index.vaultDBCache.map((f4) => f4.path == path ? { ...f4, sticker } : f4); + await plugin.index.saveSpacesDatabaseToDisk({ vault: { ...vaultSchema, rows: newVaultDB } }); } - return Cn.createElement("div", { className: classNames9.caption, style: styles2.caption }, caption); -} -function Footer(props2) { - var _a2 = useDayPicker(), footer = _a2.footer, styles2 = _a2.styles, tfoot = _a2.classNames.tfoot; - if (!footer) - return Cn.createElement(Cn.Fragment, null); - return Cn.createElement( - "tfoot", - { className: tfoot, style: styles2.tfoot }, - Cn.createElement( - "tr", - null, - Cn.createElement("td", { colSpan: 8 }, footer) - ) + saveFrontmatterValue( + plugin, + path, + plugin.settings.fmKeySticker, + sticker, + "text", + true ); -} -function getWeekdays(locale2, weekStartsOn, ISOWeek) { - var start = ISOWeek ? startOfISOWeek(new Date()) : startOfWeek(new Date(), { locale: locale2, weekStartsOn }); - var days = []; - for (var i4 = 0; i4 < 7; i4++) { - var day = addDays(start, i4); - days.push(day); + plugin.index.reloadFile(getAbstractFileAtPath(plugin, path)).then((f4) => plugin.index.broadcast("space")); +}; +var saveFileColor = async (plugin, path, color) => { + if (plugin.settings.spacesEnabled) { + const newVaultDB = plugin.index.vaultDBCache.map((f4) => f4.path == path ? { ...f4, color } : f4); + await plugin.index.saveSpacesDatabaseToDisk({ vault: { ...vaultSchema, rows: newVaultDB } }); } - return days; -} -function HeadRow() { - var _a2 = useDayPicker(), classNames9 = _a2.classNames, styles2 = _a2.styles, showWeekNumber = _a2.showWeekNumber, locale2 = _a2.locale, weekStartsOn = _a2.weekStartsOn, ISOWeek = _a2.ISOWeek, formatWeekdayName2 = _a2.formatters.formatWeekdayName, labelWeekday2 = _a2.labels.labelWeekday; - var weekdays = getWeekdays(locale2, weekStartsOn, ISOWeek); - return Cn.createElement( - "tr", - { style: styles2.head_row, className: classNames9.head_row }, - showWeekNumber && Cn.createElement("th", { scope: "col", style: styles2.head_cell, className: classNames9.head_cell }), - weekdays.map(function(weekday, i4) { - return Cn.createElement("th", { key: i4, scope: "col", className: classNames9.head_cell, style: styles2.head_cell, "aria-label": labelWeekday2(weekday, { locale: locale2 }) }, formatWeekdayName2(weekday, { locale: locale2 })); - }) + saveFrontmatterValue( + plugin, + path, + plugin.settings.fmKeyColor, + color, + "text", + true ); -} -function Head() { - var _a2; - var _b2 = useDayPicker(), classNames9 = _b2.classNames, styles2 = _b2.styles, components = _b2.components; - var HeadRowComponent = (_a2 = components === null || components === void 0 ? void 0 : components.HeadRow) !== null && _a2 !== void 0 ? _a2 : HeadRow; - return Cn.createElement( - "thead", - { style: styles2.head, className: classNames9.head }, - Cn.createElement(HeadRowComponent, null) + plugin.index.reloadFile(getAbstractFileAtPath(plugin, path)).then((f4) => plugin.index.broadcast("space")); +}; +var saveSpaceColor = async (plugin, path, color) => { + await saveSpaceMetadataValue(plugin, path, "color", color); + plugin.index.broadcast("space"); +}; +var saveSpaceSticker = async (plugin, path, sticker) => { + await saveSpaceMetadataValue(plugin, path, "sticker", sticker); + plugin.index.broadcast("space"); +}; +var updateFileRank = async (plugin, path, rank, space) => { + const fixedRank = rank; + if (!await plugin.app.vault.adapter.exists(space.space.dbPath)) { + await createContextMDB(plugin, space.space); + } + plugin.index.addToContextStoreQueue(() => reorderFilesInContext(plugin, [path], fixedRank, space.space).then((f4) => { + return plugin.index.reloadContext(space.space); + }).then((f4) => { + const promises = [...plugin.index.spacesMap.getInverse(space.path)].map((f5) => plugin.index.reloadFile(getAbstractFileAtPath(plugin, f5))); + return Promise.all(promises); + }).then((f4) => plugin.index.broadcast("space"))); +}; +var moveAFileToNewParentAtIndex = async (plugin, item, newParent, index, copy) => { + if (!item) + return; + const currFile = getAbstractFileAtPath(plugin, item.path); + const newPath = newParent == "/" ? currFile.name : newParent + "/" + currFile.name; + const newItem = { + ...fileMetadataToVaultItem(item), + path: newPath, + parent: newParent + }; + if (getAbstractFileAtPath(plugin, newPath)) { + new import_obsidian21.Notice(i18n_default.notice.fileExists); + return; + } + const allRows = plugin.index.vaultDBCache.filter((f4) => f4.parent == newParent); + const rows = insert( + allRows, + index, + newItem ); -} -function DayContent(props2) { - var _a2 = useDayPicker(), locale2 = _a2.locale, formatDay2 = _a2.formatters.formatDay; - return Cn.createElement(Cn.Fragment, null, formatDay2(props2.date, { locale: locale2 })); -} -var SelectMultipleContext = F(void 0); -function SelectMultipleProvider(props2) { - if (!isDayPickerMultiple(props2.initialProps)) { - var emptyContextValue = { - selected: void 0, - modifiers: { - disabled: [] + const newVaultTable = [...plugin.index.vaultDBCache, newItem].filter((f4) => copy || f4.path != item.path).map((f4) => { + const newItem2 = rows.find((g4) => g4.path == f4.path); + if (newItem2) { + return { ...f4, ...newItem2 }; + } + return f4; + }); + await plugin.index.saveSpacesDatabaseToDisk({ vault: { ...vaultSchema, rows: newVaultTable } }); + const afile = getAbstractFileAtPath(plugin, item.path); + if (copy) { + await copyFile(plugin, getAbstractFileAtPath(plugin, newParent), afile); + } else { + await moveFile(plugin, getAbstractFileAtPath(plugin, newParent), afile); + } + updateFileRank(plugin, newPath, index, plugin.index.spacesIndex.get(newParent)); +}; +var movePathsToSpace = async (plugin, paths, newSpaceCache, index, modifier) => { + if (newSpaceCache.type == "folder" || newSpaceCache.type == "vault") { + paths.forEach((path) => { + if (modifier == "link" || nodeIsAncestorOfTarget(uriByString(plugin, path), newSpaceCache.space.uri)) { + insertSpaceItemAtIndex(plugin, newSpaceCache, path, index); + } else { + moveAFileToNewParentAtIndex(plugin, plugin.index.filesIndex.get(path), newSpaceCache.path, index, modifier == "copy"); } - }; - return Cn.createElement(SelectMultipleContext.Provider, { value: emptyContextValue }, props2.children); + }); } - return Cn.createElement(SelectMultipleProviderInternal, { initialProps: props2.initialProps, children: props2.children }); -} -function SelectMultipleProviderInternal(_a2) { - var initialProps = _a2.initialProps, children = _a2.children; - var selected = initialProps.selected, min3 = initialProps.min, max3 = initialProps.max; - var onDayClick = function(day, activeModifiers, e4) { - var _a3, _b2; - (_a3 = initialProps.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(initialProps, day, activeModifiers, e4); - var isMinSelected = Boolean(activeModifiers.selected && min3 && (selected === null || selected === void 0 ? void 0 : selected.length) === min3); - if (isMinSelected) { - return; + if (newSpaceCache.type == "tag") { + paths.map((f4) => { + var _a2, _b2, _c2; + return (_c2 = (_a2 = plugin.index.spacesIndex.get(f4)) == null ? void 0 : _a2.space.defPath) != null ? _c2 : (_b2 = plugin.index.filesIndex.get(f4)) == null ? void 0 : _b2.path; + }).filter((f4) => f4).forEach((path) => addTagToNote(plugin, newSpaceCache.name, getAbstractFileAtPath(plugin, path))); + } +}; +var movePathToSpace = async (plugin, path, oldSpaceCache, newSpaceCache, index, modifier) => { + let cache = plugin.index.spacesIndex.get(path); + if (!cache) { + cache = plugin.index.filesIndex.get(path); + } + if (!cache || !newSpaceCache) + return false; + if ((oldSpaceCache == null ? void 0 : oldSpaceCache.path) == newSpaceCache.path) { + updateFileRank(plugin, path, index, oldSpaceCache); + return; + } + if (newSpaceCache.type == "folder" || newSpaceCache.type == "vault") { + if (modifier == "link" || nodeIsAncestorOfTarget(uriByString(plugin, path), newSpaceCache.space.uri)) { + insertSpaceItemAtIndex(plugin, newSpaceCache, path, index); + } else { + moveAFileToNewParentAtIndex(plugin, plugin.index.filesIndex.get(path), newSpaceCache.path, index, modifier == "copy"); } - var isMaxSelected = Boolean(!activeModifiers.selected && max3 && (selected === null || selected === void 0 ? void 0 : selected.length) === max3); - if (isMaxSelected) { + } + if (newSpaceCache.type == "tag") { + addTagToNote(plugin, newSpaceCache.name, getAbstractFileAtPath(plugin, path)); + } + if (oldSpaceCache && (oldSpaceCache == null ? void 0 : oldSpaceCache.path) != newSpaceCache.path) { + removePathsFromSpace(plugin, oldSpaceCache, [path]); + } +}; +var insertSpaceAtIndex = async (plugin, path, newSpace) => { + const spaces = plugin.index.allSpaces(); + const spaceInfo = spaceFromFolder(plugin, path); + let newSpaceCache; + if (spaces.find((f4) => f4.path == spaceInfo.path)) { + if (newSpace) { + newSpaceCache = await saveSpaceCache(plugin, spaceInfo, newSpace); + } else { return; } - var selectedDays = selected ? __spreadArray([], selected, true) : []; - if (activeModifiers.selected) { - var index = selectedDays.findIndex(function(selectedDay) { - return isSameDay(day, selectedDay); - }); - selectedDays.splice(index, 1); + } else { + if (!await abstractFileAtPathExists(plugin, spaceInfo.folderPath)) { + await plugin.app.vault.createFolder(spaceInfo.folderPath); + } + if (newSpace) { + await createNewMarkdownFile(plugin, getAbstractFileAtPath(plugin, spaceInfo.folderPath), spaceInfo.name, null, true); + await saveSpaceCache(plugin, spaceInfo, newSpace); + newSpaceCache = await plugin.index.reloadSpace(spaceInfo, newSpace); } else { - selectedDays.push(day); + newSpaceCache = await plugin.index.reloadSpace(spaceInfo); } - (_b2 = initialProps.onSelect) === null || _b2 === void 0 ? void 0 : _b2.call(initialProps, selectedDays, day, activeModifiers, e4); - }; - var modifiers = { - disabled: [] - }; - if (selected) { - modifiers.disabled.push(function(day) { - var isMaxSelected = max3 && selected.length > max3 - 1; - var isSelected = selected.some(function(selectedDay) { - return isSameDay(selectedDay, day); - }); - return Boolean(isMaxSelected && !isSelected); - }); - } - var contextValue = { - selected, - onDayClick, - modifiers - }; - return Cn.createElement(SelectMultipleContext.Provider, { value: contextValue }, children); -} -function useSelectMultiple() { - var context = q2(SelectMultipleContext); - if (!context) { - throw new Error("useSelectMultiple must be used within a SelectMultipleProvider"); } - return context; -} -function addToRange(day, range) { - var _a2 = range || {}, from = _a2.from, to = _a2.to; - if (!from) { - return { from: day, to: void 0 }; + plugin.index.initalizeFiles(); + plugin.settings.rootSpaces = [...plugin.settings.rootSpaces, spaceInfo.path]; + plugin.saveSettings(); + return newSpaceCache; +}; +var saveSpaceMetadataValue = async (plugin, space, key2, value) => { + const spaceCache = plugin.index.spacesIndex.get(space); + let file = getAbstractFileAtPath(plugin, spaceCache.space.defPath); + if (!file) { + file = await createNewMarkdownFile(plugin, getAbstractFileAtPath(plugin, spaceCache.space.folderPath), filePathToString(spaceCache.space.defPath), "", true); } - if (!to && isSameDay(from, day)) { - return { from, to: day }; + if (plugin.metadata.canProcessFrontmatter()) { + await plugin.metadata.processFrontMatter(file.path, (frontmatter) => { + frontmatter[key2] = value; + }); } - if (!to && isBefore(day, from)) { - return { from: day, to: from }; + plugin.index.updateSpaceMetadata(space, { ...spaceCache.metadata, [key2]: value }); +}; +var saveSpaceCache = async (plugin, spaceInfo, metadata) => { + let file = getAbstractFileAtPath(plugin, spaceInfo.defPath); + if (!file) { + file = await createNewMarkdownFile(plugin, getAbstractFileAtPath(plugin, spaceInfo.folderPath), filePathToString(spaceInfo.defPath), "", true); } - if (!to) { - return { from, to: day }; + if (plugin.metadata.canProcessFrontmatter()) { + await plugin.metadata.processFrontMatter(file.path, (frontmatter) => { + frontmatter[plugin.settings.fmKeySticker] = metadata.sticker; + frontmatter[spaceFilterKey(plugin)] = metadata.filters; + frontmatter[plugin.settings.fmKeyBanner] = metadata.banner; + frontmatter[spaceContextsKey(plugin)] = metadata.contexts; + frontmatter[spaceLinksKey(plugin)] = metadata.links; + frontmatter[spaceSortKey(plugin)] = metadata.sort; + frontmatter["tags"] = metadata.tags; + }); } - if (isSameDay(to, day) && isSameDay(from, day)) { - return void 0; + return plugin.index.updateSpaceMetadata(spaceInfo.path, metadata); +}; +var insertSpaceItemAtIndex = async (plugin, space, path, rank) => { + var _a2; + const spaceExists = (_a2 = ensureArray(space.metadata.links)) != null ? _a2 : []; + const pathExists = spaceExists.find((f4) => f4 == path); + if (!pathExists) { + spaceExists.push(path); } - if (isSameDay(to, day)) { - return { from: to, to: void 0 }; + await saveSpaceCache(plugin, space.space, { ...space.metadata, links: spaceExists }); + await plugin.index.reloadFile(getAbstractFileAtPath(plugin, path)); + await plugin.index.reloadSpace(space.space); + updateFileRank(plugin, path, rank, space); + plugin.index.broadcast("vault"); +}; +var removeSpace = async (plugin, space) => { + const spaceCache = plugin.index.spacesIndex.get(space); + if (spaceCache.type == "tag") { + plugin.index.deleteTag(spaceCache.name); + } else if (spaceCache.type == "folder") { + deleteFile(plugin, getAbstractFileAtPath(plugin, space)); } - if (isSameDay(from, day)) { - return void 0; +}; +var updateSpaceSort = (plugin, spaceName, sort) => { + const space = plugin.index.spacesIndex.get(spaceName); + if (space) + saveSpaceCache(plugin, space.space, { + ...space.metadata, + sort + }); +}; +var toggleSpacePin = (plugin, spacePath, type, remove, rank) => { + if (type == "home") { + if (remove) { + plugin.settings.rootSpaces = plugin.settings.rootSpaces.filter((f4) => f4 != spacePath); + } else if (plugin.settings.rootSpaces.some((f4) => f4 == spacePath)) { + const currIndex = plugin.settings.rootSpaces.findIndex((f4) => f4 == spacePath); + plugin.settings.rootSpaces = arrayMove(plugin.settings.rootSpaces, currIndex, rank); + } else { + plugin.settings.rootSpaces = insert(plugin.settings.rootSpaces, rank, spacePath); + } + } else if (type == "waypoints") { + if (remove) { + plugin.settings.waypoints = plugin.settings.waypoints.filter((f4) => f4 != spacePath); + } else if (plugin.settings.waypoints.some((f4) => f4 == spacePath)) { + const currIndex = plugin.settings.waypoints.findIndex((f4) => f4 == spacePath); + plugin.settings.waypoints = arrayMove(plugin.settings.waypoints, currIndex, rank); + } else { + plugin.settings.waypoints = insert(plugin.settings.waypoints, rank, spacePath); + } } - if (isAfter2(from, day)) { - return { from: day, to }; + plugin.saveSettings(); +}; +var removePathsFromSpace = async (plugin, space, paths) => { + if (space.type == "default") { + if (space.path == "spaces://$waypoints") { + toggleSpacePin(plugin, paths[0], "waypoints", true); + return; + } } - return { from, to: day }; -} -var SelectRangeContext = F(void 0); -function SelectRangeProvider(props2) { - if (!isDayPickerRange(props2.initialProps)) { - var emptyContextValue = { - selected: void 0, - modifiers: { - range_start: [], - range_end: [], - range_middle: [], - disabled: [] + if (space.type == "tag") { + paths.map((f4) => { + var _a2, _b2, _c2; + return (_c2 = (_a2 = plugin.index.spacesIndex.get(f4)) == null ? void 0 : _a2.space.defPath) != null ? _c2 : (_b2 = plugin.index.filesIndex.get(f4)) == null ? void 0 : _b2.path; + }).filter((f4) => f4).forEach((path) => removeTagFromFile(plugin, space.name, getAbstractFileAtPath(plugin, path))); + } else if (space.type == "folder" || space.type == "vault") { + paths.forEach((f4) => { + if (pathIsSpace(plugin, f4)) { + plugin.index.spacesMap.set(f4, new Set([...plugin.index.spacesMap.get(f4)].filter((g4) => g4 != space.path))); } + }); + await saveSpaceMetadataValue(plugin, space.path, spaceLinksKey(plugin), space.metadata.links.filter((f4) => !paths.some((g4) => g4 == f4))); + await plugin.index.reloadSpace(space.space); + const promises = paths.map((f4) => pathIsSpace(plugin, f4) ? plugin.index.reloadSpaceByPath(f4) : plugin.index.reloadFile(getAbstractFileAtPath(plugin, f4))); + await Promise.all(promises); + plugin.index.broadcast("vault"); + } +}; +var retrieveAllRecursiveChildren = (vaultDB, settings, folder) => { + return vaultDB.filter((f4) => f4["parent"].startsWith(folder)).filter( + excludeVaultItemPredicate(settings) + ); +}; +var retrieveAllFiles = (vaultDB, settings) => { + return vaultDB.filter( + excludeVaultItemPredicate(settings) + ); +}; +var initiateDB = (db) => { + replaceDB(db, { + vault: vaultSchema + }); +}; +var indexCurrentFileTree = (plugin, vaultDB) => { + const treeItems = getAllAbstractFilesInVault(plugin).map((file) => { + var _a2; + return { + path: file.path, + parent: (_a2 = file.parent) == null ? void 0 : _a2.path, + created: file instanceof import_obsidian21.TFile ? file.stat.ctime.toString() : void 0, + folder: file instanceof import_obsidian21.TFolder ? "true" : "false" }; - return Cn.createElement(SelectRangeContext.Provider, { value: emptyContextValue }, props2.children); + }); + const currentPaths = vaultDB; + const deleteRows = currentPaths.filter( + (item) => !treeItems.some((i4) => i4.path == item.path) + ); + const fixRows = currentPaths.filter( + (item) => treeItems.some((i4) => i4.path == item.path && i4.parent != item.parent) + ).map((item) => ({ + ...item, + ...treeItems.find((i4) => i4.path == item.path) + })); + const newRows = treeItems.filter( + (item) => !currentPaths.some((i4) => i4.path == item.path) + ); + const newVaultRows = [...vaultDB.map((f4) => { + const newItem = fixRows.find((g4) => g4.path == f4.path); + if (newItem) { + return { ...f4, ...newItem }; + } + return f4; + }).filter((f4) => !deleteRows.some((g4) => g4.path == f4.path)), ...newRows]; + return { + vault: { + ...vaultSchema, + rows: newVaultRows + } + }; +}; +var newFileInSpace = async (plugin, space, activeFile, canvas, dontOpen) => { + var _a2, _b2; + let newFile; + const folder = space.type == "tag" ? defaultNoteFolder(plugin, activeFile) : ((_b2 = (_a2 = space.space) == null ? void 0 : _a2.folderPath) == null ? void 0 : _b2.length) > 0 ? getFolderFromPath(plugin, space.space.folderPath) : defaultNoteFolder(plugin, activeFile); + if (canvas) { + newFile = await createNewCanvasFile( + plugin, + folder, + "Canvas", + dontOpen + ); + } else { + newFile = await createNewMarkdownFile( + plugin, + folder, + "", + space.type == "tag" ? `--- +tags: + - ${space.name.replace("#", "")} +---` : "", + dontOpen + ); } - return Cn.createElement(SelectRangeProviderInternal, { initialProps: props2.initialProps, children: props2.children }); + return newFile; +}; + +// src/react/components/UI/Stickers/FileSticker/FileSticker.tsx +var import_obsidian22 = require("obsidian"); + +// src/react/hooks/useLongPress.tsx +function isMouseEvent(e4) { + return e4 && "screenX" in e4; } -function SelectRangeProviderInternal(_a2) { - var initialProps = _a2.initialProps, children = _a2.children; - var selected = initialProps.selected; - var _b2 = selected || {}, selectedFrom = _b2.from, selectedTo = _b2.to; - var min3 = initialProps.min; - var max3 = initialProps.max; - var onDayClick = function(day, activeModifiers, e4) { - var _a3, _b3; - (_a3 = initialProps.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(initialProps, day, activeModifiers, e4); - var newRange = addToRange(day, selected); - (_b3 = initialProps.onSelect) === null || _b3 === void 0 ? void 0 : _b3.call(initialProps, newRange, day, activeModifiers, e4); - }; - var modifiers = { - range_start: [], - range_end: [], - range_middle: [], - disabled: [] - }; - if (selectedFrom) { - modifiers.range_start = [selectedFrom]; - if (!selectedTo) { - modifiers.range_end = [selectedFrom]; - } else { - modifiers.range_end = [selectedTo]; - if (!isSameDay(selectedFrom, selectedTo)) { - modifiers.range_middle = [ - { - after: selectedFrom, - before: selectedTo - } - ]; - } + +// src/utils/emoji.ts +var saveIconsForPaths = (plugin, files, icon) => { + files.forEach((file) => { + const cache = plugin.index.cacheForURI(uriByString(plugin, file)); + if ((cache == null ? void 0 : cache.cacheType) == "file") { + saveFileSticker(plugin, file, icon); + } else if ((cache == null ? void 0 : cache.cacheType) == "space") { + saveSpaceSticker(plugin, file, icon); } - } - if (min3) { - if (selectedFrom && !selectedTo) { - modifiers.disabled.push({ - after: subDays(selectedFrom, min3 - 1), - before: addDays(selectedFrom, min3 - 1) - }); + }); +}; +var saveColorForPaths = (plugin, files, icon) => { + files.forEach((file) => { + const cache = plugin.index.cacheForURI(uriByString(plugin, file)); + if ((cache == null ? void 0 : cache.cacheType) == "file") { + saveFileColor(plugin, file, icon); + } else if ((cache == null ? void 0 : cache.cacheType) == "space") { + saveSpaceColor(plugin, file, icon); } - if (selectedFrom && selectedTo) { - modifiers.disabled.push({ - after: selectedFrom, - before: addDays(selectedFrom, min3 - 1) + }); +}; +var removeSpaceIcon = (plugin, space) => { + saveSpaceSticker(plugin, space, ""); +}; +var saveFileIcon = (plugin, data2, icon) => { + saveFileSticker(plugin, data2.path, icon); +}; +var removeIconsForPaths = (plugin, files) => { + files.forEach((file) => { + const cache = plugin.index.cacheForURI(uriByString(plugin, file)); + if ((cache == null ? void 0 : cache.cacheType) == "file") { + saveFileSticker(plugin, file, ""); + } else if ((cache == null ? void 0 : cache.cacheType) == "space") { + saveSpaceSticker(plugin, file, ""); + } + }); +}; +var removeFileIcon = (plugin, data2) => { + saveFileSticker(plugin, data2.path, ""); +}; + +// src/react/components/UI/Stickers/FileSticker/FileSticker.tsx +var FileSticker = (props2) => { + const { fileCache } = props2; + const sticker = fileCache == null ? void 0 : fileCache.sticker; + const color = fileCache == null ? void 0 : fileCache.color; + const extension = (fileCache == null ? void 0 : fileCache.cacheType) == "file" && (fileCache == null ? void 0 : fileCache.extension); + const triggerStickerContextMenu = (e4) => { + if (!fileCache) + return; + e4.preventDefault(); + const fileMenu = new import_obsidian22.Menu(); + fileMenu.addSeparator(); + fileMenu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.buttons.changeIcon); + menuItem.setIcon("lucide-sticker"); + menuItem.onClick((ev) => { + const vaultChangeModal = new stickerModal( + props2.plugin.app, + props2.plugin, + (emoji) => (fileCache == null ? void 0 : fileCache.cacheType) == "space" ? saveSpaceSticker(props2.plugin, fileCache == null ? void 0 : fileCache.path, emoji) : saveFileSticker(props2.plugin, fileCache == null ? void 0 : fileCache.path, emoji) + ); + vaultChangeModal.open(); + }); + }); + fileMenu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.buttons.removeIcon); + menuItem.setIcon("lucide-file-minus"); + menuItem.onClick((ev) => { + removeIconsForPaths(props2.plugin, [fileCache.path]); + }); + }); + if (isMouseEvent(e4)) { + fileMenu.showAtPosition({ x: e4.pageX, y: e4.pageY }); + } else { + fileMenu.showAtPosition({ + x: e4.nativeEvent.locationX, + y: e4.nativeEvent.locationY }); } - } - if (max3) { - if (selectedFrom && !selectedTo) { - modifiers.disabled.push({ - before: addDays(selectedFrom, -max3 + 1) - }); - modifiers.disabled.push({ - after: addDays(selectedFrom, max3 - 1) - }); + return false; + }; + const triggerStickerMenu = (e4) => { + e4.stopPropagation(); + if ((fileCache == null ? void 0 : fileCache.cacheType) == "space") { + const vaultChangeModal2 = new stickerModal( + props2.plugin.app, + props2.plugin, + (emoji) => saveSpaceSticker( + props2.plugin, + fileCache.space.path, + emoji + ) + ); + vaultChangeModal2.open(); + return; + } + const vaultChangeModal = new stickerModal( + props2.plugin.app, + props2.plugin, + (emoji) => saveFileSticker(props2.plugin, fileCache.path, emoji) + ); + vaultChangeModal.open(); + }; + return /* @__PURE__ */ Cn.createElement("div", { + className: `mk-file-icon ${sticker ? "" : "mk-file-icon-placeholder"}` + }, /* @__PURE__ */ Cn.createElement("button", { + "aria-label": i18n_default.buttons.changeIcon, + onContextMenu: triggerStickerContextMenu, + style: (color == null ? void 0 : color.length) > 0 ? { + "--label-color": `${color}`, + "--icon-color": `#ffffff` + } : { + "--icon-color": `var(--text-muted)` + }, + dangerouslySetInnerHTML: sticker ? { __html: stickerFromString(sticker, props2.plugin) } : fileCache.cacheType == "file" ? { + __html: stickerFromString( + defaultIconForExtension( + fileCache.path, + extension, + color ? true : false + ), + props2.plugin + ) + } : { + __html: stickerFromString( + iconForSpaceType( + fileCache.type, + fileCache.path, + true + ), + props2.plugin + ) + }, + onClick: (e4) => triggerStickerMenu(e4) + })); +}; +var FileStickerContainer = (props2) => { + const [cache, setCache] = h2(null); + const reloadCache = () => { + setCache(props2.plugin.index.cacheForURI(props2.path)); + }; + const reloadIcon = (e4) => { + if (e4.detail.type == "file" && e4.detail.name == props2.path.path || e4.detail.type == "space" && e4.detail.name == props2.path.fullPath) { + reloadCache(); + } + }; + p2(() => { + reloadCache(); + }, []); + p2(() => { + window.addEventListener(eventTypes.spacesChange, reloadIcon); + return () => { + window.removeEventListener(eventTypes.spacesChange, reloadIcon); + }; + }, [props2.path]); + return cache ? /* @__PURE__ */ Cn.createElement(FileSticker, { + plugin: props2.plugin, + fileCache: cache + }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); +}; + +// src/react/components/Navigator/SpaceQuery.tsx +var import_obsidian40 = require("obsidian"); + +// src/react/components/SpaceView/Contexts/ContextBuilder/BuilderMetadataFields.tsx +var import_obsidian23 = require("obsidian"); +var allMetadataForFiles = (plugin, files) => { + return files.reduce((p3, c4) => { + const fm = frontMatterForFile(plugin, c4); + const fmKeys = uniqCaseInsensitive(frontMatterKeys(fm)); + if (plugin.dataViewAPI()) { + const dvValues = plugin.dataViewAPI().page(c4.path); + const dvKeys = uniqCaseInsensitive( + Object.keys(dvValues != null ? dvValues : {}).filter( + (f4, i4, self2) => !self2.find( + (g4, j4) => g4.toLowerCase().replace(/\s/g, "-") == f4.toLowerCase().replace(/\s/g, "-") && i4 > j4 + ) ? true : false + ).filter((f4) => f4 != "file" && !fmKeys.some((g4) => f4 == g4)) + ); + return [ + ...p3, + ...fmKeys.map((f4) => ({ name: f4, type: "fm" })), + ...dvKeys.map((f4) => ({ name: f4, type: "dv" })) + ].filter(metadatTypeFilterPredicate); + } + return [ + ...p3, + ...fmKeys.map((f4) => ({ name: f4, type: "fm" })) + ].filter(metadatTypeFilterPredicate); + }, []); +}; +var metadatTypeFilterPredicate = (value, index, self2) => { + return self2.findIndex( + (v3) => value["type"] == v3["type"] && value["name"] == v3["name"] + ) === index; +}; + +// src/react/components/UI/Menus/datePickerMenu.tsx +var import_obsidian24 = require("obsidian"); + +// node_modules/react-day-picker/dist/index.esm.js +var __assign = function() { + __assign = Object.assign || function __assign5(t4) { + for (var s5, i4 = 1, n2 = arguments.length; i4 < n2; i4++) { + s5 = arguments[i4]; + for (var p3 in s5) + if (Object.prototype.hasOwnProperty.call(s5, p3)) + t4[p3] = s5[p3]; } - if (selectedFrom && selectedTo) { - var selectedCount = differenceInCalendarDays(selectedTo, selectedFrom) + 1; - var offset2 = max3 - selectedCount; - modifiers.disabled.push({ - before: subDays(selectedFrom, offset2) - }); - modifiers.disabled.push({ - after: addDays(selectedTo, offset2) - }); + return t4; + }; + return __assign.apply(this, arguments); +}; +function __rest(s5, e4) { + var t4 = {}; + for (var p3 in s5) + if (Object.prototype.hasOwnProperty.call(s5, p3) && e4.indexOf(p3) < 0) + t4[p3] = s5[p3]; + if (s5 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i4 = 0, p3 = Object.getOwnPropertySymbols(s5); i4 < p3.length; i4++) { + if (e4.indexOf(p3[i4]) < 0 && Object.prototype.propertyIsEnumerable.call(s5, p3[i4])) + t4[p3[i4]] = s5[p3[i4]]; } - } - return Cn.createElement(SelectRangeContext.Provider, { value: { selected, onDayClick, modifiers } }, children); -} -function useSelectRange() { - var context = q2(SelectRangeContext); - if (!context) { - throw new Error("useSelectRange must be used within a SelectRangeProvider"); - } - return context; -} -function matcherToArray(matcher) { - if (Array.isArray(matcher)) { - return __spreadArray([], matcher, true); - } else if (matcher !== void 0) { - return [matcher]; - } else { - return []; - } -} -function getCustomModifiers(dayModifiers) { - var customModifiers = {}; - Object.entries(dayModifiers).forEach(function(_a2) { - var modifier = _a2[0], matcher = _a2[1]; - customModifiers[modifier] = matcherToArray(matcher); - }); - return customModifiers; -} -var InternalModifier; -(function(InternalModifier2) { - InternalModifier2["Outside"] = "outside"; - InternalModifier2["Disabled"] = "disabled"; - InternalModifier2["Selected"] = "selected"; - InternalModifier2["Hidden"] = "hidden"; - InternalModifier2["Today"] = "today"; - InternalModifier2["RangeStart"] = "range_start"; - InternalModifier2["RangeEnd"] = "range_end"; - InternalModifier2["RangeMiddle"] = "range_middle"; -})(InternalModifier || (InternalModifier = {})); -var Selected = InternalModifier.Selected; -var Disabled = InternalModifier.Disabled; -var Hidden = InternalModifier.Hidden; -var Today = InternalModifier.Today; -var RangeEnd = InternalModifier.RangeEnd; -var RangeMiddle = InternalModifier.RangeMiddle; -var RangeStart = InternalModifier.RangeStart; -var Outside2 = InternalModifier.Outside; -function getInternalModifiers(dayPicker, selectMultiple, selectRange2) { - var _a2; - var internalModifiers = (_a2 = {}, _a2[Selected] = matcherToArray(dayPicker.selected), _a2[Disabled] = matcherToArray(dayPicker.disabled), _a2[Hidden] = matcherToArray(dayPicker.hidden), _a2[Today] = [dayPicker.today], _a2[RangeEnd] = [], _a2[RangeMiddle] = [], _a2[RangeStart] = [], _a2[Outside2] = [], _a2); - if (dayPicker.fromDate) { - internalModifiers[Disabled].push({ before: dayPicker.fromDate }); - } - if (dayPicker.toDate) { - internalModifiers[Disabled].push({ after: dayPicker.toDate }); - } - if (isDayPickerMultiple(dayPicker)) { - internalModifiers[Disabled] = internalModifiers[Disabled].concat(selectMultiple.modifiers[Disabled]); - } else if (isDayPickerRange(dayPicker)) { - internalModifiers[Disabled] = internalModifiers[Disabled].concat(selectRange2.modifiers[Disabled]); - internalModifiers[RangeStart] = selectRange2.modifiers[RangeStart]; - internalModifiers[RangeMiddle] = selectRange2.modifiers[RangeMiddle]; - internalModifiers[RangeEnd] = selectRange2.modifiers[RangeEnd]; - } - return internalModifiers; -} -var ModifiersContext = F(void 0); -function ModifiersProvider(props2) { - var dayPicker = useDayPicker(); - var selectMultiple = useSelectMultiple(); - var selectRange2 = useSelectRange(); - var internalModifiers = getInternalModifiers(dayPicker, selectMultiple, selectRange2); - var customModifiers = getCustomModifiers(dayPicker.modifiers); - var modifiers = __assign(__assign({}, internalModifiers), customModifiers); - return Cn.createElement(ModifiersContext.Provider, { value: modifiers }, props2.children); -} -function useModifiers() { - var context = q2(ModifiersContext); - if (!context) { - throw new Error("useModifiers must be used within a ModifiersProvider"); - } - return context; -} -function isDateInterval(matcher) { - return Boolean(matcher && typeof matcher === "object" && "before" in matcher && "after" in matcher); + return t4; } -function isDateRange(value) { - return Boolean(value && typeof value === "object" && "from" in value); +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) + for (var i4 = 0, l3 = from.length, ar; i4 < l3; i4++) { + if (ar || !(i4 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i4); + ar[i4] = from[i4]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); } -function isDateAfterType(value) { - return Boolean(value && typeof value === "object" && "after" in value); +function isDayPickerMultiple(props2) { + return props2.mode === "multiple"; } -function isDateBeforeType(value) { - return Boolean(value && typeof value === "object" && "before" in value); +function isDayPickerRange(props2) { + return props2.mode === "range"; } -function isDayOfWeekType(value) { - return Boolean(value && typeof value === "object" && "dayOfWeek" in value); +function isDayPickerSingle(props2) { + return props2.mode === "single"; } -function isDateInRange(date, range) { - var _a2; - var from = range.from, to = range.to; - if (!from) { - return false; - } - if (!to && isSameDay(from, date)) { - return true; - } - if (!to) { - return false; - } - var isRangeInverted = differenceInCalendarDays(to, from) < 0; - if (isRangeInverted) { - _a2 = [to, from], from = _a2[0], to = _a2[1]; - } - var isInRange = differenceInCalendarDays(date, from) >= 0 && differenceInCalendarDays(to, date) >= 0; - return isInRange; +var defaultClassNames = { + root: "rdp", + multiple_months: "rdp-multiple_months", + with_weeknumber: "rdp-with_weeknumber", + vhidden: "rdp-vhidden", + button_reset: "rdp-button_reset", + button: "rdp-button", + caption: "rdp-caption", + caption_start: "rdp-caption_start", + caption_end: "rdp-caption_end", + caption_between: "rdp-caption_between", + caption_label: "rdp-caption_label", + caption_dropdowns: "rdp-caption_dropdowns", + dropdown: "rdp-dropdown", + dropdown_month: "rdp-dropdown_month", + dropdown_year: "rdp-dropdown_year", + dropdown_icon: "rdp-dropdown_icon", + months: "rdp-months", + month: "rdp-month", + table: "rdp-table", + tbody: "rdp-tbody", + tfoot: "rdp-tfoot", + head: "rdp-head", + head_row: "rdp-head_row", + head_cell: "rdp-head_cell", + nav: "rdp-nav", + nav_button: "rdp-nav_button", + nav_button_previous: "rdp-nav_button_previous", + nav_button_next: "rdp-nav_button_next", + nav_icon: "rdp-nav_icon", + row: "rdp-row", + weeknumber: "rdp-weeknumber", + cell: "rdp-cell", + day: "rdp-day", + day_today: "rdp-day_today", + day_outside: "rdp-day_outside", + day_selected: "rdp-day_selected", + day_disabled: "rdp-day_disabled", + day_hidden: "rdp-day_hidden", + day_range_start: "rdp-day_range_start", + day_range_end: "rdp-day_range_end", + day_range_middle: "rdp-day_range_middle" +}; +function formatCaption(month, options) { + return format(month, "LLLL y", options); } -function isDateType(value) { - return isDate(value); +function formatDay(day, options) { + return format(day, "d", options); } -function isArrayOfDates(value) { - return Array.isArray(value) && value.every(isDate); +function formatMonthCaption(month, options) { + return format(month, "LLLL", options); } -function isMatch(day, matchers) { - return matchers.some(function(matcher) { - if (typeof matcher === "boolean") { - return matcher; - } - if (isDateType(matcher)) { - return isSameDay(day, matcher); - } - if (isArrayOfDates(matcher)) { - return matcher.includes(day); - } - if (isDateRange(matcher)) { - return isDateInRange(day, matcher); - } - if (isDayOfWeekType(matcher)) { - return matcher.dayOfWeek.includes(day.getDay()); - } - if (isDateInterval(matcher)) { - var diffBefore = differenceInCalendarDays(matcher.before, day); - var diffAfter = differenceInCalendarDays(matcher.after, day); - var isDayBefore = diffBefore > 0; - var isDayAfter = diffAfter < 0; - var isClosedInterval = isAfter2(matcher.before, matcher.after); - if (isClosedInterval) { - return isDayAfter && isDayBefore; - } else { - return isDayBefore || isDayAfter; - } - } - if (isDateAfterType(matcher)) { - return differenceInCalendarDays(day, matcher.after) > 0; - } - if (isDateBeforeType(matcher)) { - return differenceInCalendarDays(matcher.before, day) > 0; - } - if (typeof matcher === "function") { - return matcher(day); - } - return false; - }); +function formatWeekNumber(weekNumber) { + return "".concat(weekNumber); } -function getActiveModifiers(day, modifiers, displayMonth) { - var matchedModifiers = Object.keys(modifiers).reduce(function(result, key2) { - var modifier = modifiers[key2]; - if (isMatch(day, modifier)) { - result.push(key2); - } - return result; - }, []); - var activeModifiers = {}; - matchedModifiers.forEach(function(modifier) { - return activeModifiers[modifier] = true; - }); - if (displayMonth && !isSameMonth(day, displayMonth)) { - activeModifiers.outside = true; - } - return activeModifiers; +function formatWeekdayName(weekday, options) { + return format(weekday, "cccccc", options).toUpperCase(); } -function getInitialFocusTarget(displayMonths, modifiers) { - var firstDayInMonth = startOfMonth(displayMonths[0]); - var lastDayInMonth = endOfMonth(displayMonths[displayMonths.length - 1]); - var firstFocusableDay; - var today; - var date = firstDayInMonth; - while (date <= lastDayInMonth) { - var activeModifiers = getActiveModifiers(date, modifiers); - var isFocusable = !activeModifiers.disabled && !activeModifiers.hidden; - if (!isFocusable) { - date = addDays(date, 1); - continue; - } - if (activeModifiers.selected) { - return date; - } - if (activeModifiers.today && !today) { - today = date; - } - if (!firstFocusableDay) { - firstFocusableDay = date; - } - date = addDays(date, 1); - } - if (today) { - return today; - } else { - return firstFocusableDay; - } +function formatYearCaption(year, options) { + return format(year, "yyyy", options); } -var MAX_RETRY = 365; -function getNextFocus(focusedDay, options) { - var moveBy = options.moveBy, direction = options.direction, context = options.context, modifiers = options.modifiers, _a2 = options.retry, retry = _a2 === void 0 ? { count: 0, lastFocused: focusedDay } : _a2; - var weekStartsOn = context.weekStartsOn, fromDate = context.fromDate, toDate2 = context.toDate, locale2 = context.locale; - var moveFns = { - day: addDays, - week: addWeeks, - month: addMonths, - year: addYears, - startOfWeek: function(date) { - return context.ISOWeek ? startOfISOWeek(date) : startOfWeek(date, { locale: locale2, weekStartsOn }); - }, - endOfWeek: function(date) { - return context.ISOWeek ? endOfISOWeek(date) : endOfWeek(date, { locale: locale2, weekStartsOn }); - } +var formatters3 = /* @__PURE__ */ Object.freeze({ + __proto__: null, + formatCaption, + formatDay, + formatMonthCaption, + formatWeekNumber, + formatWeekdayName, + formatYearCaption +}); +var labelDay = function(day, activeModifiers, options) { + return format(day, "do MMMM (EEEE)", options); +}; +var labelMonthDropdown = function() { + return "Month: "; +}; +var labelNext = function() { + return "Go to next month"; +}; +var labelPrevious = function() { + return "Go to previous month"; +}; +var labelWeekday = function(day, options) { + return format(day, "cccc", options); +}; +var labelWeekNumber = function(n2) { + return "Week n. ".concat(n2); +}; +var labelYearDropdown = function() { + return "Year: "; +}; +var labels = /* @__PURE__ */ Object.freeze({ + __proto__: null, + labelDay, + labelMonthDropdown, + labelNext, + labelPrevious, + labelWeekNumber, + labelWeekday, + labelYearDropdown +}); +function getDefaultContextValues() { + var captionLayout = "buttons"; + var classNames9 = defaultClassNames; + var locale2 = en_US_default; + var modifiersClassNames = {}; + var modifiers = {}; + var numberOfMonths = 1; + var styles2 = {}; + var today = new Date(); + return { + captionLayout, + classNames: classNames9, + formatters: formatters3, + labels, + locale: locale2, + modifiersClassNames, + modifiers, + numberOfMonths, + styles: styles2, + today, + mode: "default" }; - var newFocusedDay = moveFns[moveBy](focusedDay, direction === "after" ? 1 : -1); - if (direction === "before" && fromDate) { - newFocusedDay = max([fromDate, newFocusedDay]); - } else if (direction === "after" && toDate2) { - newFocusedDay = min([toDate2, newFocusedDay]); - } - var isFocusable = true; - if (modifiers) { - var activeModifiers = getActiveModifiers(newFocusedDay, modifiers); - isFocusable = !activeModifiers.disabled && !activeModifiers.hidden; - } - if (isFocusable) { - return newFocusedDay; - } else { - if (retry.count > MAX_RETRY) { - return retry.lastFocused; - } - return getNextFocus(newFocusedDay, { - moveBy, - direction, - context, - modifiers, - retry: __assign(__assign({}, retry), { count: retry.count + 1 }) - }); - } } -var FocusContext = F(void 0); -function FocusProvider(props2) { - var navigation = useNavigation(); - var modifiers = useModifiers(); - var _a2 = h2(), focusedDay = _a2[0], setFocusedDay = _a2[1]; - var _b2 = h2(), lastFocused = _b2[0], setLastFocused = _b2[1]; - var initialFocusTarget = getInitialFocusTarget(navigation.displayMonths, modifiers); - var focusTarget = (focusedDay !== null && focusedDay !== void 0 ? focusedDay : lastFocused && navigation.isDateDisplayed(lastFocused)) ? lastFocused : initialFocusTarget; - var blur = function() { - setLastFocused(focusedDay); - setFocusedDay(void 0); - }; - var focus = function(date) { - setFocusedDay(date); - }; - var context = useDayPicker(); - var moveFocus = function(moveBy, direction) { - if (!focusedDay) - return; - var nextFocused = getNextFocus(focusedDay, { - moveBy, - direction, - context, - modifiers - }); - if (isSameDay(focusedDay, nextFocused)) - return void 0; - navigation.goToDate(nextFocused, focusedDay); - focus(nextFocused); - }; - var value = { - focusedDay, - focusTarget, - blur, - focus, - focusDayAfter: function() { - return moveFocus("day", "after"); - }, - focusDayBefore: function() { - return moveFocus("day", "before"); - }, - focusWeekAfter: function() { - return moveFocus("week", "after"); - }, - focusWeekBefore: function() { - return moveFocus("week", "before"); - }, - focusMonthBefore: function() { - return moveFocus("month", "before"); - }, - focusMonthAfter: function() { - return moveFocus("month", "after"); - }, - focusYearBefore: function() { - return moveFocus("year", "before"); - }, - focusYearAfter: function() { - return moveFocus("year", "after"); - }, - focusStartOfWeek: function() { - return moveFocus("startOfWeek", "before"); - }, - focusEndOfWeek: function() { - return moveFocus("endOfWeek", "after"); - } +function parseFromToProps(props2) { + var fromYear = props2.fromYear, toYear = props2.toYear, fromMonth = props2.fromMonth, toMonth = props2.toMonth; + var fromDate = props2.fromDate, toDate2 = props2.toDate; + if (fromMonth) { + fromDate = startOfMonth(fromMonth); + } else if (fromYear) { + fromDate = new Date(fromYear, 0, 1); + } + if (toMonth) { + toDate2 = endOfMonth(toMonth); + } else if (toYear) { + toDate2 = new Date(toYear, 11, 31); + } + return { + fromDate: fromDate ? startOfDay(fromDate) : void 0, + toDate: toDate2 ? startOfDay(toDate2) : void 0 }; - return Cn.createElement(FocusContext.Provider, { value }, props2.children); } -function useFocusContext() { - var context = q2(FocusContext); - if (!context) { - throw new Error("useFocusContext must be used within a FocusProvider"); +var DayPickerContext = F(void 0); +function DayPickerProvider(props2) { + var _a2; + var initialProps = props2.initialProps; + var defaultContextValues = getDefaultContextValues(); + var _b2 = parseFromToProps(initialProps), fromDate = _b2.fromDate, toDate2 = _b2.toDate; + var captionLayout = (_a2 = initialProps.captionLayout) !== null && _a2 !== void 0 ? _a2 : defaultContextValues.captionLayout; + if (captionLayout !== "buttons" && (!fromDate || !toDate2)) { + captionLayout = "buttons"; } - return context; -} -function useActiveModifiers(day, displayMonth) { - var modifiers = useModifiers(); - var activeModifiers = getActiveModifiers(day, modifiers, displayMonth); - return activeModifiers; -} -var SelectSingleContext = F(void 0); -function SelectSingleProvider(props2) { - if (!isDayPickerSingle(props2.initialProps)) { - var emptyContextValue = { - selected: void 0 - }; - return Cn.createElement(SelectSingleContext.Provider, { value: emptyContextValue }, props2.children); + var onSelect; + if (isDayPickerSingle(initialProps) || isDayPickerMultiple(initialProps) || isDayPickerRange(initialProps)) { + onSelect = initialProps.onSelect; } - return Cn.createElement(SelectSingleProviderInternal, { initialProps: props2.initialProps, children: props2.children }); -} -function SelectSingleProviderInternal(_a2) { - var initialProps = _a2.initialProps, children = _a2.children; - var onDayClick = function(day, activeModifiers, e4) { - var _a3, _b2, _c2; - (_a3 = initialProps.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(initialProps, day, activeModifiers, e4); - if (activeModifiers.selected && !initialProps.required) { - (_b2 = initialProps.onSelect) === null || _b2 === void 0 ? void 0 : _b2.call(initialProps, void 0, day, activeModifiers, e4); - return; - } - (_c2 = initialProps.onSelect) === null || _c2 === void 0 ? void 0 : _c2.call(initialProps, day, day, activeModifiers, e4); - }; - var contextValue = { - selected: initialProps.selected, - onDayClick - }; - return Cn.createElement(SelectSingleContext.Provider, { value: contextValue }, children); + var value = __assign(__assign(__assign({}, defaultContextValues), initialProps), { captionLayout, classNames: __assign(__assign({}, defaultContextValues.classNames), initialProps.classNames), components: __assign({}, initialProps.components), formatters: __assign(__assign({}, defaultContextValues.formatters), initialProps.formatters), fromDate, labels: __assign(__assign({}, defaultContextValues.labels), initialProps.labels), mode: initialProps.mode || defaultContextValues.mode, modifiers: __assign(__assign({}, defaultContextValues.modifiers), initialProps.modifiers), modifiersClassNames: __assign(__assign({}, defaultContextValues.modifiersClassNames), initialProps.modifiersClassNames), onSelect, styles: __assign(__assign({}, defaultContextValues.styles), initialProps.styles), toDate: toDate2 }); + return Cn.createElement(DayPickerContext.Provider, { value }, props2.children); } -function useSelectSingle() { - var context = q2(SelectSingleContext); +function useDayPicker() { + var context = q2(DayPickerContext); if (!context) { - throw new Error("useSelectSingle must be used within a SelectSingleProvider"); + throw new Error("useDayPicker must be used within a DayPickerProvider."); } return context; } -function useDayEventHandlers(date, activeModifiers) { +function CaptionLabel(props2) { + var _a2 = useDayPicker(), locale2 = _a2.locale, classNames9 = _a2.classNames, styles2 = _a2.styles, formatCaption2 = _a2.formatters.formatCaption; + return Cn.createElement("div", { className: classNames9.caption_label, style: styles2.caption_label, "aria-live": "polite", role: "presentation", id: props2.id }, formatCaption2(props2.displayMonth, { locale: locale2 })); +} +function IconDropdown(props2) { + return Cn.createElement( + "svg", + __assign({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, props2), + Cn.createElement("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" }) + ); +} +function Dropdown(props2) { + var _a2, _b2; + var onChange = props2.onChange, value = props2.value, children = props2.children, caption = props2.caption, className = props2.className, style = props2.style; var dayPicker = useDayPicker(); - var single = useSelectSingle(); - var multiple = useSelectMultiple(); - var range = useSelectRange(); - var _a2 = useFocusContext(), focusDayAfter = _a2.focusDayAfter, focusDayBefore = _a2.focusDayBefore, focusWeekAfter = _a2.focusWeekAfter, focusWeekBefore = _a2.focusWeekBefore, blur = _a2.blur, focus = _a2.focus, focusMonthBefore = _a2.focusMonthBefore, focusMonthAfter = _a2.focusMonthAfter, focusYearBefore = _a2.focusYearBefore, focusYearAfter = _a2.focusYearAfter, focusStartOfWeek = _a2.focusStartOfWeek, focusEndOfWeek = _a2.focusEndOfWeek; - var onClick = function(e4) { - var _a3, _b2, _c2, _d2; - if (isDayPickerSingle(dayPicker)) { - (_a3 = single.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(single, date, activeModifiers, e4); - } else if (isDayPickerMultiple(dayPicker)) { - (_b2 = multiple.onDayClick) === null || _b2 === void 0 ? void 0 : _b2.call(multiple, date, activeModifiers, e4); - } else if (isDayPickerRange(dayPicker)) { - (_c2 = range.onDayClick) === null || _c2 === void 0 ? void 0 : _c2.call(range, date, activeModifiers, e4); - } else { - (_d2 = dayPicker.onDayClick) === null || _d2 === void 0 ? void 0 : _d2.call(dayPicker, date, activeModifiers, e4); + var IconDropdownComponent = (_b2 = (_a2 = dayPicker.components) === null || _a2 === void 0 ? void 0 : _a2.IconDropdown) !== null && _b2 !== void 0 ? _b2 : IconDropdown; + return Cn.createElement( + "div", + { className, style }, + Cn.createElement("span", { className: dayPicker.classNames.vhidden }, props2["aria-label"]), + Cn.createElement("select", { name: props2.name, "aria-label": props2["aria-label"], className: dayPicker.classNames.dropdown, style: dayPicker.styles.dropdown, value, onChange }, children), + Cn.createElement( + "div", + { className: dayPicker.classNames.caption_label, style: dayPicker.styles.caption_label, "aria-hidden": "true" }, + caption, + Cn.createElement(IconDropdownComponent, { className: dayPicker.classNames.dropdown_icon, style: dayPicker.styles.dropdown_icon }) + ) + ); +} +function MonthsDropdown(props2) { + var _a2; + var _b2 = useDayPicker(), fromDate = _b2.fromDate, toDate2 = _b2.toDate, styles2 = _b2.styles, locale2 = _b2.locale, formatMonthCaption2 = _b2.formatters.formatMonthCaption, classNames9 = _b2.classNames, components = _b2.components, labelMonthDropdown2 = _b2.labels.labelMonthDropdown; + if (!fromDate) + return Cn.createElement(Cn.Fragment, null); + if (!toDate2) + return Cn.createElement(Cn.Fragment, null); + var dropdownMonths = []; + if (isSameYear(fromDate, toDate2)) { + var date = startOfMonth(fromDate); + for (var month = fromDate.getMonth(); month <= toDate2.getMonth(); month++) { + dropdownMonths.push(setMonth(date, month)); } - }; - var onFocus = function(e4) { - var _a3; - focus(date); - (_a3 = dayPicker.onDayFocus) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onBlur = function(e4) { - var _a3; - blur(); - (_a3 = dayPicker.onDayBlur) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onMouseEnter = function(e4) { - var _a3; - (_a3 = dayPicker.onDayMouseEnter) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onMouseLeave = function(e4) { - var _a3; - (_a3 = dayPicker.onDayMouseLeave) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onPointerEnter = function(e4) { - var _a3; - (_a3 = dayPicker.onDayPointerEnter) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onPointerLeave = function(e4) { - var _a3; - (_a3 = dayPicker.onDayPointerLeave) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onTouchCancel = function(e4) { - var _a3; - (_a3 = dayPicker.onDayTouchCancel) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onTouchEnd = function(e4) { - var _a3; - (_a3 = dayPicker.onDayTouchEnd) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onTouchMove = function(e4) { - var _a3; - (_a3 = dayPicker.onDayTouchMove) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onTouchStart = function(e4) { - var _a3; - (_a3 = dayPicker.onDayTouchStart) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onKeyUp = function(e4) { - var _a3; - (_a3 = dayPicker.onDayKeyUp) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var onKeyDown = function(e4) { - var _a3; - switch (e4.key) { - case "ArrowLeft": - e4.preventDefault(); - e4.stopPropagation(); - dayPicker.dir === "rtl" ? focusDayAfter() : focusDayBefore(); - break; - case "ArrowRight": - e4.preventDefault(); - e4.stopPropagation(); - dayPicker.dir === "rtl" ? focusDayBefore() : focusDayAfter(); - break; - case "ArrowDown": - e4.preventDefault(); - e4.stopPropagation(); - focusWeekAfter(); - break; - case "ArrowUp": - e4.preventDefault(); - e4.stopPropagation(); - focusWeekBefore(); - break; - case "PageUp": - e4.preventDefault(); - e4.stopPropagation(); - e4.shiftKey ? focusYearBefore() : focusMonthBefore(); - break; - case "PageDown": - e4.preventDefault(); - e4.stopPropagation(); - e4.shiftKey ? focusYearAfter() : focusMonthAfter(); - break; - case "Home": - e4.preventDefault(); - e4.stopPropagation(); - focusStartOfWeek(); - break; - case "End": - e4.preventDefault(); - e4.stopPropagation(); - focusEndOfWeek(); - break; + } else { + var date = startOfMonth(new Date()); + for (var month = 0; month <= 11; month++) { + dropdownMonths.push(setMonth(date, month)); } - (_a3 = dayPicker.onDayKeyDown) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); - }; - var eventHandlers = { - onClick, - onFocus, - onBlur, - onKeyDown, - onKeyUp, - onMouseEnter, - onMouseLeave, - onPointerEnter, - onPointerLeave, - onTouchCancel, - onTouchEnd, - onTouchMove, - onTouchStart + } + var handleChange = function(e4) { + var selectedMonth = Number(e4.target.value); + var newMonth = setMonth(startOfMonth(props2.displayMonth), selectedMonth); + props2.onChange(newMonth); }; - return eventHandlers; -} -function useSelectedDays() { - var dayPicker = useDayPicker(); - var single = useSelectSingle(); - var multiple = useSelectMultiple(); - var range = useSelectRange(); - var selectedDays = isDayPickerSingle(dayPicker) ? single.selected : isDayPickerMultiple(dayPicker) ? multiple.selected : isDayPickerRange(dayPicker) ? range.selected : void 0; - return selectedDays; + var DropdownComponent2 = (_a2 = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a2 !== void 0 ? _a2 : Dropdown; + return Cn.createElement(DropdownComponent2, { name: "months", "aria-label": labelMonthDropdown2(), className: classNames9.dropdown_month, style: styles2.dropdown_month, onChange: handleChange, value: props2.displayMonth.getMonth(), caption: formatMonthCaption2(props2.displayMonth, { locale: locale2 }) }, dropdownMonths.map(function(m5) { + return Cn.createElement("option", { key: m5.getMonth(), value: m5.getMonth() }, formatMonthCaption2(m5, { locale: locale2 })); + })); } -function isInternalModifier(modifier) { - return Object.values(InternalModifier).includes(modifier); +function YearsDropdown(props2) { + var _a2; + var displayMonth = props2.displayMonth; + var _b2 = useDayPicker(), fromDate = _b2.fromDate, toDate2 = _b2.toDate, locale2 = _b2.locale, styles2 = _b2.styles, classNames9 = _b2.classNames, components = _b2.components, formatYearCaption2 = _b2.formatters.formatYearCaption, labelYearDropdown2 = _b2.labels.labelYearDropdown; + var years = []; + if (!fromDate) + return Cn.createElement(Cn.Fragment, null); + if (!toDate2) + return Cn.createElement(Cn.Fragment, null); + var fromYear = fromDate.getFullYear(); + var toYear = toDate2.getFullYear(); + for (var year = fromYear; year <= toYear; year++) { + years.push(setYear(startOfYear(new Date()), year)); + } + var handleChange = function(e4) { + var newMonth = setYear(startOfMonth(displayMonth), Number(e4.target.value)); + props2.onChange(newMonth); + }; + var DropdownComponent2 = (_a2 = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a2 !== void 0 ? _a2 : Dropdown; + return Cn.createElement(DropdownComponent2, { name: "years", "aria-label": labelYearDropdown2(), className: classNames9.dropdown_year, style: styles2.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption2(displayMonth, { locale: locale2 }) }, years.map(function(year2) { + return Cn.createElement("option", { key: year2.getFullYear(), value: year2.getFullYear() }, formatYearCaption2(year2, { locale: locale2 })); + })); } -function getDayClassNames(dayPicker, activeModifiers) { - var classNames9 = [dayPicker.classNames.day]; - Object.keys(activeModifiers).forEach(function(modifier) { - var customClassName = dayPicker.modifiersClassNames[modifier]; - if (customClassName) { - classNames9.push(customClassName); - } else if (isInternalModifier(modifier)) { - var internalClassName = dayPicker.classNames["day_".concat(modifier)]; - if (internalClassName) { - classNames9.push(internalClassName); - } - } - }); - return classNames9; +function useControlledValue(defaultValue2, controlledValue) { + var _a2 = h2(defaultValue2), uncontrolledValue = _a2[0], setValue = _a2[1]; + var value = controlledValue === void 0 ? uncontrolledValue : controlledValue; + return [value, setValue]; } -function getDayStyle(dayPicker, activeModifiers) { - var style = __assign({}, dayPicker.styles.day); - Object.keys(activeModifiers).forEach(function(modifier) { - var _a2; - style = __assign(__assign({}, style), (_a2 = dayPicker.modifiersStyles) === null || _a2 === void 0 ? void 0 : _a2[modifier]); - }); - return style; +function getInitialMonth(context) { + var month = context.month, defaultMonth = context.defaultMonth, today = context.today; + var initialMonth = month || defaultMonth || today || new Date(); + var toDate2 = context.toDate, fromDate = context.fromDate, _a2 = context.numberOfMonths, numberOfMonths = _a2 === void 0 ? 1 : _a2; + if (toDate2 && differenceInCalendarMonths(toDate2, initialMonth) < 0) { + var offset2 = -1 * (numberOfMonths - 1); + initialMonth = addMonths(toDate2, offset2); + } + if (fromDate && differenceInCalendarMonths(initialMonth, fromDate) < 0) { + initialMonth = fromDate; + } + return startOfMonth(initialMonth); } -function useDayRender(day, displayMonth, buttonRef) { - var _a2; - var _b2, _c2; - var dayPicker = useDayPicker(); - var focusContext = useFocusContext(); - var activeModifiers = useActiveModifiers(day, displayMonth); - var eventHandlers = useDayEventHandlers(day, activeModifiers); - var selectedDays = useSelectedDays(); - var isButton = Boolean(dayPicker.onDayClick || dayPicker.mode !== "default"); - p2(function() { +function useNavigationState() { + var context = useDayPicker(); + var initialMonth = getInitialMonth(context); + var _a2 = useControlledValue(initialMonth, context.month), month = _a2[0], setMonth2 = _a2[1]; + var goToMonth = function(date) { var _a3; - if (activeModifiers.outside) - return; - if (!focusContext.focusedDay) - return; - if (!isButton) + if (context.disableNavigation) return; - if (isSameDay(focusContext.focusedDay, day)) { - (_a3 = buttonRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); - } - }, [ - focusContext.focusedDay, - day, - buttonRef, - isButton, - activeModifiers.outside - ]); - var className = getDayClassNames(dayPicker, activeModifiers).join(" "); - var style = getDayStyle(dayPicker, activeModifiers); - var isHidden = Boolean(activeModifiers.outside && !dayPicker.showOutsideDays || activeModifiers.hidden); - var DayContentComponent = (_c2 = (_b2 = dayPicker.components) === null || _b2 === void 0 ? void 0 : _b2.DayContent) !== null && _c2 !== void 0 ? _c2 : DayContent; - var children = Cn.createElement(DayContentComponent, { date: day, displayMonth, activeModifiers }); - var divProps = { - style, - className, - children, - role: "gridcell" - }; - var isFocusTarget = focusContext.focusTarget && isSameDay(focusContext.focusTarget, day) && !activeModifiers.outside; - var isFocused = focusContext.focusedDay && isSameDay(focusContext.focusedDay, day); - var buttonProps = __assign(__assign(__assign({}, divProps), (_a2 = { disabled: activeModifiers.disabled, role: "gridcell" }, _a2["aria-selected"] = activeModifiers.selected, _a2.tabIndex = isFocused || isFocusTarget ? 0 : -1, _a2)), eventHandlers); - var dayRender = { - isButton, - isHidden, - activeModifiers, - selectedDays, - buttonProps, - divProps + var month2 = startOfMonth(date); + setMonth2(month2); + (_a3 = context.onMonthChange) === null || _a3 === void 0 ? void 0 : _a3.call(context, month2); }; - return dayRender; + return [month, goToMonth]; } -function Day(props2) { - var buttonRef = _2(null); - var dayRender = useDayRender(props2.date, props2.displayMonth, buttonRef); - if (dayRender.isHidden) { - return Cn.createElement("div", { role: "gridcell" }); - } - if (!dayRender.isButton) { - return Cn.createElement("div", __assign({}, dayRender.divProps)); +function getDisplayMonths(month, _a2) { + var reverseMonths = _a2.reverseMonths, numberOfMonths = _a2.numberOfMonths; + var start = startOfMonth(month); + var end = startOfMonth(addMonths(start, numberOfMonths)); + var monthsDiff = differenceInCalendarMonths(end, start); + var months = []; + for (var i4 = 0; i4 < monthsDiff; i4++) { + var nextMonth = addMonths(start, i4); + months.push(nextMonth); } - return Cn.createElement(Button, __assign({ name: "day", ref: buttonRef }, dayRender.buttonProps)); + if (reverseMonths) + months = months.reverse(); + return months; } -function WeekNumber(props2) { - var weekNumber = props2.number, dates = props2.dates; - var _a2 = useDayPicker(), onWeekNumberClick = _a2.onWeekNumberClick, styles2 = _a2.styles, classNames9 = _a2.classNames, locale2 = _a2.locale, labelWeekNumber2 = _a2.labels.labelWeekNumber, formatWeekNumber2 = _a2.formatters.formatWeekNumber; - var content = formatWeekNumber2(Number(weekNumber), { locale: locale2 }); - if (!onWeekNumberClick) { - return Cn.createElement("span", { className: classNames9.weeknumber, style: styles2.weeknumber }, content); +function getNextMonth(startingMonth, options) { + if (options.disableNavigation) { + return void 0; } - var label = labelWeekNumber2(Number(weekNumber), { locale: locale2 }); - var handleClick = function(e4) { - onWeekNumberClick(weekNumber, dates, e4); - }; - return Cn.createElement(Button, { name: "week-number", "aria-label": label, className: classNames9.weeknumber, style: styles2.weeknumber, onClick: handleClick }, content); -} -function Row(props2) { - var _a2, _b2; - var _c2 = useDayPicker(), styles2 = _c2.styles, classNames9 = _c2.classNames, showWeekNumber = _c2.showWeekNumber, components = _c2.components; - var DayComponent = (_a2 = components === null || components === void 0 ? void 0 : components.Day) !== null && _a2 !== void 0 ? _a2 : Day; - var WeeknumberComponent = (_b2 = components === null || components === void 0 ? void 0 : components.WeekNumber) !== null && _b2 !== void 0 ? _b2 : WeekNumber; - var weekNumberCell; - if (showWeekNumber) { - weekNumberCell = Cn.createElement( - "td", - { className: classNames9.cell, style: styles2.cell }, - Cn.createElement(WeeknumberComponent, { number: props2.weekNumber, dates: props2.dates }) - ); + var toDate2 = options.toDate, pagedNavigation = options.pagedNavigation, _a2 = options.numberOfMonths, numberOfMonths = _a2 === void 0 ? 1 : _a2; + var offset2 = pagedNavigation ? numberOfMonths : 1; + var month = startOfMonth(startingMonth); + if (!toDate2) { + return addMonths(month, offset2); } - return Cn.createElement( - "tr", - { className: classNames9.row, style: styles2.row }, - weekNumberCell, - props2.dates.map(function(date) { - return Cn.createElement( - "td", - { className: classNames9.cell, style: styles2.cell, key: getUnixTime(date), role: "presentation" }, - Cn.createElement(DayComponent, { displayMonth: props2.displayMonth, date }) - ); - }) - ); + var monthsDiff = differenceInCalendarMonths(toDate2, startingMonth); + if (monthsDiff < numberOfMonths) { + return void 0; + } + return addMonths(month, offset2); } -function daysToMonthWeeks(fromDate, toDate2, options) { - var toWeek = (options === null || options === void 0 ? void 0 : options.ISOWeek) ? endOfISOWeek(toDate2) : endOfWeek(toDate2, options); - var fromWeek = (options === null || options === void 0 ? void 0 : options.ISOWeek) ? startOfISOWeek(fromDate) : startOfWeek(fromDate, options); - var nOfDays = differenceInCalendarDays(toWeek, fromWeek); - var days = []; - for (var i4 = 0; i4 <= nOfDays; i4++) { - days.push(addDays(fromWeek, i4)); +function getPreviousMonth(startingMonth, options) { + if (options.disableNavigation) { + return void 0; } - var weeksInMonth = days.reduce(function(result, date) { - var weekNumber = (options === null || options === void 0 ? void 0 : options.ISOWeek) ? getISOWeek(date) : getWeek(date, options); - var existingWeek = result.find(function(value) { - return value.weekNumber === weekNumber; + var fromDate = options.fromDate, pagedNavigation = options.pagedNavigation, _a2 = options.numberOfMonths, numberOfMonths = _a2 === void 0 ? 1 : _a2; + var offset2 = pagedNavigation ? numberOfMonths : 1; + var month = startOfMonth(startingMonth); + if (!fromDate) { + return addMonths(month, -offset2); + } + var monthsDiff = differenceInCalendarMonths(month, fromDate); + if (monthsDiff <= 0) { + return void 0; + } + return addMonths(month, -offset2); +} +var NavigationContext = F(void 0); +function NavigationProvider(props2) { + var dayPicker = useDayPicker(); + var _a2 = useNavigationState(), currentMonth = _a2[0], goToMonth = _a2[1]; + var displayMonths = getDisplayMonths(currentMonth, dayPicker); + var nextMonth = getNextMonth(currentMonth, dayPicker); + var previousMonth = getPreviousMonth(currentMonth, dayPicker); + var isDateDisplayed = function(date) { + return displayMonths.some(function(displayMonth) { + return isSameMonth(date, displayMonth); }); - if (existingWeek) { - existingWeek.dates.push(date); - return result; + }; + var goToDate = function(date, refDate) { + if (isDateDisplayed(date)) { + return; } - result.push({ - weekNumber, - dates: [date] - }); - return result; - }, []); - return weeksInMonth; -} -function getMonthWeeks(month, options) { - var weeksInMonth = daysToMonthWeeks(startOfMonth(month), endOfMonth(month), options); - if (options === null || options === void 0 ? void 0 : options.useFixedWeeks) { - var nrOfMonthWeeks = getWeeksInMonth(month, options); - if (nrOfMonthWeeks < 6) { - var lastWeek = weeksInMonth[weeksInMonth.length - 1]; - var lastDate = lastWeek.dates[lastWeek.dates.length - 1]; - var toDate2 = addWeeks(lastDate, 6 - nrOfMonthWeeks); - var extraWeeks = daysToMonthWeeks(addWeeks(lastDate, 1), toDate2, options); - weeksInMonth.push.apply(weeksInMonth, extraWeeks); + if (refDate && isBefore(date, refDate)) { + goToMonth(addMonths(date, 1 + dayPicker.numberOfMonths * -1)); + } else { + goToMonth(date); } + }; + var value = { + currentMonth, + displayMonths, + goToMonth, + goToDate, + previousMonth, + nextMonth, + isDateDisplayed + }; + return Cn.createElement(NavigationContext.Provider, { value }, props2.children); +} +function useNavigation() { + var context = q2(NavigationContext); + if (!context) { + throw new Error("useNavigation must be used within a NavigationProvider"); } - return weeksInMonth; + return context; } -function Table(props2) { - var _a2, _b2, _c2; - var _d2 = useDayPicker(), locale2 = _d2.locale, classNames9 = _d2.classNames, styles2 = _d2.styles, hideHead = _d2.hideHead, fixedWeeks = _d2.fixedWeeks, components = _d2.components, weekStartsOn = _d2.weekStartsOn, firstWeekContainsDate = _d2.firstWeekContainsDate, ISOWeek = _d2.ISOWeek; - var weeks = getMonthWeeks(props2.displayMonth, { - useFixedWeeks: Boolean(fixedWeeks), - ISOWeek, - locale: locale2, - weekStartsOn, - firstWeekContainsDate - }); - var HeadComponent = (_a2 = components === null || components === void 0 ? void 0 : components.Head) !== null && _a2 !== void 0 ? _a2 : Head; - var RowComponent = (_b2 = components === null || components === void 0 ? void 0 : components.Row) !== null && _b2 !== void 0 ? _b2 : Row; - var FooterComponent = (_c2 = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c2 !== void 0 ? _c2 : Footer; +function CaptionDropdowns(props2) { + var _a2; + var _b2 = useDayPicker(), classNames9 = _b2.classNames, styles2 = _b2.styles, components = _b2.components; + var goToMonth = useNavigation().goToMonth; + var handleMonthChange = function(newMonth) { + goToMonth(newMonth); + }; + var CaptionLabelComponent = (_a2 = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a2 !== void 0 ? _a2 : CaptionLabel; + var captionLabel = Cn.createElement(CaptionLabelComponent, { id: props2.id, displayMonth: props2.displayMonth }); return Cn.createElement( - "table", - { className: classNames9.table, style: styles2.table, role: "grid", "aria-labelledby": props2["aria-labelledby"] }, - !hideHead && Cn.createElement(HeadComponent, null), - Cn.createElement("tbody", { className: classNames9.tbody, style: styles2.tbody, role: "rowgroup" }, weeks.map(function(week) { - return Cn.createElement(RowComponent, { displayMonth: props2.displayMonth, key: week.weekNumber, dates: week.dates, weekNumber: week.weekNumber }); - })), - Cn.createElement(FooterComponent, { displayMonth: props2.displayMonth }) + "div", + { className: classNames9.caption_dropdowns, style: styles2.caption_dropdowns }, + Cn.createElement("div", { className: classNames9.vhidden }, captionLabel), + Cn.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props2.displayMonth }), + Cn.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: props2.displayMonth }) ); } -function canUseDOM2() { - return !!(typeof window !== "undefined" && window.document && window.document.createElement); -} -var useIsomorphicLayoutEffect2 = canUseDOM2() ? y2 : p2; -var serverHandoffComplete = false; -var id = 0; -function genId2() { - return "react-day-picker-".concat(++id); +function IconLeft(props2) { + return Cn.createElement( + "svg", + __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props2), + Cn.createElement("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" }) + ); } -function useId(providedId) { - var _a2; - var initialId = providedId !== null && providedId !== void 0 ? providedId : serverHandoffComplete ? genId2() : null; - var _b2 = h2(initialId), id2 = _b2[0], setId = _b2[1]; - useIsomorphicLayoutEffect2(function() { - if (id2 === null) { - setId(genId2()); - } - }, []); - p2(function() { - if (serverHandoffComplete === false) { - serverHandoffComplete = true; - } - }, []); - return (_a2 = providedId !== null && providedId !== void 0 ? providedId : id2) !== null && _a2 !== void 0 ? _a2 : void 0; +function IconRight(props2) { + return Cn.createElement( + "svg", + __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props2), + Cn.createElement("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" }) + ); } -function Month(props2) { - var _a2; - var _b2; - var dayPicker = useDayPicker(); - var dir = dayPicker.dir, classNames9 = dayPicker.classNames, styles2 = dayPicker.styles, components = dayPicker.components; - var displayMonths = useNavigation().displayMonths; - var captionId = useId(dayPicker.id ? "".concat(dayPicker.id, "-").concat(props2.displayIndex) : void 0); - var className = [classNames9.month]; - var style = styles2.month; - var isStart = props2.displayIndex === 0; - var isEnd = props2.displayIndex === displayMonths.length - 1; - var isCenter = !isStart && !isEnd; - if (dir === "rtl") { - _a2 = [isStart, isEnd], isEnd = _a2[0], isStart = _a2[1]; - } - if (isStart) { - className.push(classNames9.caption_start); - style = __assign(__assign({}, style), styles2.caption_start); +var Button = k3(function(props2, ref2) { + var _a2 = useDayPicker(), classNames9 = _a2.classNames, styles2 = _a2.styles; + var classNamesArr = [classNames9.button_reset, classNames9.button]; + if (props2.className) { + classNamesArr.push(props2.className); } - if (isEnd) { - className.push(classNames9.caption_end); - style = __assign(__assign({}, style), styles2.caption_end); + var className = classNamesArr.join(" "); + var style = __assign(__assign({}, styles2.button_reset), styles2.button); + if (props2.style) { + Object.assign(style, props2.style); } - if (isCenter) { - className.push(classNames9.caption_between); - style = __assign(__assign({}, style), styles2.caption_between); + return Cn.createElement("button", __assign({}, props2, { ref: ref2, type: "button", className, style })); +}); +function Navigation(props2) { + var _a2, _b2; + var _c2 = useDayPicker(), dir = _c2.dir, locale2 = _c2.locale, classNames9 = _c2.classNames, styles2 = _c2.styles, _d2 = _c2.labels, labelPrevious2 = _d2.labelPrevious, labelNext2 = _d2.labelNext, components = _c2.components; + if (!props2.nextMonth && !props2.previousMonth) { + return Cn.createElement(Cn.Fragment, null); } - var CaptionComponent = (_b2 = components === null || components === void 0 ? void 0 : components.Caption) !== null && _b2 !== void 0 ? _b2 : Caption; + var previousLabel = labelPrevious2(props2.previousMonth, { locale: locale2 }); + var previousClassName = [ + classNames9.nav_button, + classNames9.nav_button_previous + ].join(" "); + var nextLabel = labelNext2(props2.nextMonth, { locale: locale2 }); + var nextClassName = [ + classNames9.nav_button, + classNames9.nav_button_next + ].join(" "); + var IconRightComponent = (_a2 = components === null || components === void 0 ? void 0 : components.IconRight) !== null && _a2 !== void 0 ? _a2 : IconRight; + var IconLeftComponent = (_b2 = components === null || components === void 0 ? void 0 : components.IconLeft) !== null && _b2 !== void 0 ? _b2 : IconLeft; return Cn.createElement( "div", - { key: props2.displayIndex, className: className.join(" "), style }, - Cn.createElement(CaptionComponent, { id: captionId, displayMonth: props2.displayMonth }), - Cn.createElement(Table, { "aria-labelledby": captionId, displayMonth: props2.displayMonth }) + { className: classNames9.nav, style: styles2.nav }, + !props2.hidePrevious && Cn.createElement(Button, { name: "previous-month", "aria-label": previousLabel, className: previousClassName, style: styles2.nav_button_previous, disabled: !props2.previousMonth, onClick: props2.onPreviousClick }, dir === "rtl" ? Cn.createElement(IconRightComponent, { className: classNames9.nav_icon, style: styles2.nav_icon }) : Cn.createElement(IconLeftComponent, { className: classNames9.nav_icon, style: styles2.nav_icon })), + !props2.hideNext && Cn.createElement(Button, { name: "next-month", "aria-label": nextLabel, className: nextClassName, style: styles2.nav_button_next, disabled: !props2.nextMonth, onClick: props2.onNextClick }, dir === "rtl" ? Cn.createElement(IconLeftComponent, { className: classNames9.nav_icon, style: styles2.nav_icon }) : Cn.createElement(IconRightComponent, { className: classNames9.nav_icon, style: styles2.nav_icon })) ); } -function Root2() { - var dayPicker = useDayPicker(); - var focusContext = useFocusContext(); - var navigation = useNavigation(); - var _a2 = h2(false), hasInitialFocus = _a2[0], setHasInitialFocus = _a2[1]; - p2(function() { - if (!dayPicker.initialFocus) - return; - if (!focusContext.focusTarget) +function CaptionNavigation(props2) { + var _a2; + var _b2 = useDayPicker(), numberOfMonths = _b2.numberOfMonths, dir = _b2.dir; + var _c2 = useNavigation(), previousMonth = _c2.previousMonth, nextMonth = _c2.nextMonth, goToMonth = _c2.goToMonth, displayMonths = _c2.displayMonths; + var displayIndex = displayMonths.findIndex(function(month) { + return isSameMonth(props2.displayMonth, month); + }); + var isFirst = displayIndex === 0; + var isLast = displayIndex === displayMonths.length - 1; + if (dir === "rtl") { + _a2 = [isFirst, isLast], isLast = _a2[0], isFirst = _a2[1]; + } + var hideNext = numberOfMonths > 1 && (isFirst || !isLast); + var hidePrevious = numberOfMonths > 1 && (isLast || !isFirst); + var handlePreviousClick = function() { + if (!previousMonth) return; - if (hasInitialFocus) + goToMonth(previousMonth); + }; + var handleNextClick = function() { + if (!nextMonth) return; - focusContext.focus(focusContext.focusTarget); - setHasInitialFocus(true); - }, [ - dayPicker.initialFocus, - hasInitialFocus, - focusContext.focus, - focusContext.focusTarget, - focusContext - ]); - var classNames9 = [dayPicker.classNames.root, dayPicker.className]; - if (dayPicker.numberOfMonths > 1) { - classNames9.push(dayPicker.classNames.multiple_months); - } - if (dayPicker.showWeekNumber) { - classNames9.push(dayPicker.classNames.with_weeknumber); + goToMonth(nextMonth); + }; + return Cn.createElement(Navigation, { displayMonth: props2.displayMonth, hideNext, hidePrevious, nextMonth, previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick }); +} +function Caption(props2) { + var _a2; + var _b2 = useDayPicker(), classNames9 = _b2.classNames, disableNavigation = _b2.disableNavigation, styles2 = _b2.styles, captionLayout = _b2.captionLayout, components = _b2.components; + var CaptionLabelComponent = (_a2 = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a2 !== void 0 ? _a2 : CaptionLabel; + var caption; + if (disableNavigation) { + caption = Cn.createElement(CaptionLabelComponent, { id: props2.id, displayMonth: props2.displayMonth }); + } else if (captionLayout === "dropdown") { + caption = Cn.createElement(CaptionDropdowns, { displayMonth: props2.displayMonth, id: props2.id }); + } else if (captionLayout === "dropdown-buttons") { + caption = Cn.createElement( + Cn.Fragment, + null, + Cn.createElement(CaptionDropdowns, { displayMonth: props2.displayMonth, id: props2.id }), + Cn.createElement(CaptionNavigation, { displayMonth: props2.displayMonth, id: props2.id }) + ); + } else { + caption = Cn.createElement( + Cn.Fragment, + null, + Cn.createElement(CaptionLabelComponent, { id: props2.id, displayMonth: props2.displayMonth }), + Cn.createElement(CaptionNavigation, { displayMonth: props2.displayMonth, id: props2.id }) + ); } - var style = __assign(__assign({}, dayPicker.styles.root), dayPicker.style); - return Cn.createElement( - "div", - { className: classNames9.join(" "), style, dir: dayPicker.dir }, - Cn.createElement("div", { className: dayPicker.classNames.months, style: dayPicker.styles.months }, navigation.displayMonths.map(function(month, i4) { - return Cn.createElement(Month, { key: i4, displayIndex: i4, displayMonth: month }); - })) - ); + return Cn.createElement("div", { className: classNames9.caption, style: styles2.caption }, caption); } -function RootProvider(props2) { - var children = props2.children, initialProps = __rest(props2, ["children"]); +function Footer(props2) { + var _a2 = useDayPicker(), footer = _a2.footer, styles2 = _a2.styles, tfoot = _a2.classNames.tfoot; + if (!footer) + return Cn.createElement(Cn.Fragment, null); return Cn.createElement( - DayPickerProvider, - { initialProps }, + "tfoot", + { className: tfoot, style: styles2.tfoot }, Cn.createElement( - NavigationProvider, + "tr", null, - Cn.createElement( - SelectSingleProvider, - { initialProps }, - Cn.createElement( - SelectMultipleProvider, - { initialProps }, - Cn.createElement( - SelectRangeProvider, - { initialProps }, - Cn.createElement( - ModifiersProvider, - null, - Cn.createElement(FocusProvider, null, children) - ) - ) - ) - ) + Cn.createElement("td", { colSpan: 8 }, footer) ) ); } -function DayPicker(props2) { +function getWeekdays(locale2, weekStartsOn, ISOWeek) { + var start = ISOWeek ? startOfISOWeek(new Date()) : startOfWeek(new Date(), { locale: locale2, weekStartsOn }); + var days = []; + for (var i4 = 0; i4 < 7; i4++) { + var day = addDays(start, i4); + days.push(day); + } + return days; +} +function HeadRow() { + var _a2 = useDayPicker(), classNames9 = _a2.classNames, styles2 = _a2.styles, showWeekNumber = _a2.showWeekNumber, locale2 = _a2.locale, weekStartsOn = _a2.weekStartsOn, ISOWeek = _a2.ISOWeek, formatWeekdayName2 = _a2.formatters.formatWeekdayName, labelWeekday2 = _a2.labels.labelWeekday; + var weekdays = getWeekdays(locale2, weekStartsOn, ISOWeek); return Cn.createElement( - RootProvider, - __assign({}, props2), - Cn.createElement(Root2, null) + "tr", + { style: styles2.head_row, className: classNames9.head_row }, + showWeekNumber && Cn.createElement("th", { scope: "col", style: styles2.head_cell, className: classNames9.head_cell }), + weekdays.map(function(weekday, i4) { + return Cn.createElement("th", { key: i4, scope: "col", className: classNames9.head_cell, style: styles2.head_cell, "aria-label": labelWeekday2(weekday, { locale: locale2 }) }, formatWeekdayName2(weekday, { locale: locale2 })); + }) ); } - -// src/components/UI/menus/datePickerMenu.tsx -var showDatePickerMenu = (point, value, setValue, format2) => { - const menu = new import_obsidian24.Menu(); - menu.dom.toggleClass("mk-menu", true); - menu.setUseNativeMenu(false); - const frag = document.createDocumentFragment(); - const div = frag.createEl("div"); - div.addEventListener("click", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("mousedown", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("mouseup", (e4) => { - e4.stopImmediatePropagation(); - }); - div.addEventListener("keydown", (e4) => { - }); - const setDate = (date) => { - setValue(date); - menu.hide(); - }; - const root = createRoot(div); - root.render( - /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(DayPicker, { - defaultMonth: value, - mode: "single", - selected: value, - labels: { - labelMonthDropdown: () => void 0, - labelYearDropdown: () => void 0, - labelNext: () => void 0, - labelPrevious: () => void 0, - labelDay: () => void 0, - labelWeekday: () => void 0, - labelWeekNumber: () => void 0 - }, - onSelect: setDate - })) - ); - menu.addItem((item) => { - item.setTitle(frag); - }); - const keys = [...menu.scope.keys]; - for (let i4 = 0; i4 < keys.length; i4++) { - if (keys[i4].key != "Escape") { - menu.scope.unregister(keys[i4]); - } - } - menu.showAtPosition(point); - return menu; -}; - -// src/components/Navigator/SpaceQuery.tsx -var import_obsidian40 = require("obsidian"); - -// src/types/metadata.ts -var fileProps = { - "name": { - label: "File Name", - field: "name", - vType: "text", - type: "fileprop" - }, - "path": { - label: "Path", - field: "path", - vType: "text", - type: "fileprop" - }, - "parent": { - label: "Folder", - field: "parent", - vType: "text", - type: "fileprop" - }, - "sticker": { - label: "Sticker", - field: "sticker", - vType: "text", - type: "fileprop" - }, - "color": { - label: "Color", - field: "color", - vType: "text", - type: "fileprop" - }, - "ctime": { - label: "Created", - field: "ctime", - vType: "date", - type: "fileprop" - }, - "mtime": { - label: "Last Modified", - field: "mtime", - vType: "date", - type: "fileprop" - }, - "extension": { - label: "Extension", - field: "extension", - vType: "text", - type: "fileprop" - }, - "size": { - label: "Size", - field: "size", - vType: "number", - type: "fileprop" - } -}; -var fileMeta = { - "tags": { - label: "Tags", - field: "tags", - vType: "tags-multi", - type: "filemeta" - }, - "inlinks": { - label: "Linked Mentions", - field: "inlinks", - vType: "link-multi", - type: "filemeta" - }, - "outlinks": { - label: "Links", - field: "outlinks", - vType: "link-multi", - type: "filemeta" - } -}; - -// src/utils/contexts/predicate/filterFns/filterFnLabels.ts -var filterFnLabels = { - isEmpty: i18n_default.filterTypes.isEmpty, - isNotEmpty: i18n_default.filterTypes.isNotEmpty, - include: i18n_default.filterTypes.contains, - notInclude: i18n_default.filterTypes.notContains, - is: i18n_default.filterTypes.is, - isNot: i18n_default.filterTypes.isNot, - equal: "=", - isGreatThan: ">", - isLessThan: "<", - isLessThanOrEqual: "\u2264", - isGreatThanOrEqual: "\u2265", - dateBefore: i18n_default.filterTypes.before, - dateAfter: i18n_default.filterTypes.after, - isSameDateAsToday: "today", - isAnyInList: i18n_default.filterTypes.anyOf, - isNoneInList: i18n_default.filterTypes.noneOf, - isTrue: i18n_default.filterTypes.checked, - isFalse: i18n_default.filterTypes.unchecked -}; - -// src/components/SpaceView/Frames/EditorNodes/FrameNodeView.tsx -var import_classnames4 = __toESM(require_classnames()); - -// src/context/FrameEditorContext.tsx -var import_lodash8 = __toESM(require_lodash()); -var import_obsidian25 = require("obsidian"); - -// src/utils/frames/frames.ts -var propFieldFromString = (str, schemaProps) => { - return schemaProps.find((f4) => str == `${f4.schemaId}.props.${f4.name}`); -}; -var nameForField = (field) => { +function Head() { var _a2; - if (!field) - return null; - const parsedValue = parseFieldValue(field.value, field.type); - return (_a2 = parsedValue.alias) != null ? _a2 : field.name; -}; -var stringIsConst = (str) => { - const hasQuotesAtStartEndOnly = /^["'][^"']*["'](?:;)?$/.test(str); - const isNumber = !isNaN(parseFloat(str)) && isFinite(str); - return hasQuotesAtStartEndOnly || isNumber || str == null || str == ""; -}; -var newUniqueNode = (node, parent, otherNodes, schemaId) => { - const id2 = uniqueNameFromString( - node.node.id, - otherNodes.map((f4) => f4.id) + var _b2 = useDayPicker(), classNames9 = _b2.classNames, styles2 = _b2.styles, components = _b2.components; + var HeadRowComponent = (_a2 = components === null || components === void 0 ? void 0 : components.HeadRow) !== null && _a2 !== void 0 ? _a2 : HeadRow; + return Cn.createElement( + "thead", + { style: styles2.head, className: classNames9.head }, + Cn.createElement(HeadRowComponent, null) ); - return { - ...node.node, - id: id2, - schemaId, - parentId: parent - }; -}; - -// src/utils/frames/runner.ts -function extractDependencies(code) { - const dependencies = []; - function visit(node, parts = []) { - if (node.type === "Identifier") { - parts.push(node.name); - return parts; - } else if (node.type === "MemberExpression") { - const objectParts = visit(node.object, parts); - if (objectParts && node.computed) { - if (node.property.type === "Literal") { - objectParts.push(String(node.property.value)); - return objectParts; - } else { - return null; - } - } else if (objectParts) { - return visit(node.property, objectParts); +} +function DayContent(props2) { + var _a2 = useDayPicker(), locale2 = _a2.locale, formatDay2 = _a2.formatters.formatDay; + return Cn.createElement(Cn.Fragment, null, formatDay2(props2.date, { locale: locale2 })); +} +var SelectMultipleContext = F(void 0); +function SelectMultipleProvider(props2) { + if (!isDayPickerMultiple(props2.initialProps)) { + var emptyContextValue = { + selected: void 0, + modifiers: { + disabled: [] } - } else if (node.type === "Literal") { - parts.push(String(node.value)); - return parts; - } - return null; + }; + return Cn.createElement(SelectMultipleContext.Provider, { value: emptyContextValue }, props2.children); } - function explore(node) { - if (node.type === "MemberExpression") { - const parts = visit(node); - if (parts) { - dependencies.push(parts); - } + return Cn.createElement(SelectMultipleProviderInternal, { initialProps: props2.initialProps, children: props2.children }); +} +function SelectMultipleProviderInternal(_a2) { + var initialProps = _a2.initialProps, children = _a2.children; + var selected = initialProps.selected, min3 = initialProps.min, max3 = initialProps.max; + var onDayClick = function(day, activeModifiers, e4) { + var _a3, _b2; + (_a3 = initialProps.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(initialProps, day, activeModifiers, e4); + var isMinSelected = Boolean(activeModifiers.selected && min3 && (selected === null || selected === void 0 ? void 0 : selected.length) === min3); + if (isMinSelected) { return; } - for (const key2 in node) { - if (typeof node[key2] === "object" && node[key2] !== null) { - explore(node[key2]); - } + var isMaxSelected = Boolean(!activeModifiers.selected && max3 && (selected === null || selected === void 0 ? void 0 : selected.length) === max3); + if (isMaxSelected) { + return; + } + var selectedDays = selected ? __spreadArray([], selected, true) : []; + if (activeModifiers.selected) { + var index = selectedDays.findIndex(function(selectedDay) { + return isSameDay(day, selectedDay); + }); + selectedDays.splice(index, 1); + } else { + selectedDays.push(day); } + (_b2 = initialProps.onSelect) === null || _b2 === void 0 ? void 0 : _b2.call(initialProps, selectedDays, day, activeModifiers, e4); + }; + var modifiers = { + disabled: [] + }; + if (selected) { + modifiers.disabled.push(function(day) { + var isMaxSelected = max3 && selected.length > max3 - 1; + var isSelected = selected.some(function(selectedDay) { + return isSameDay(selectedDay, day); + }); + return Boolean(isMaxSelected && !isSelected); + }); } - try { - const ast = parse3(code.replace("return ", ""), { ecmaVersion: 2020 }); - explore(ast); - } catch (e4) { - return []; + var contextValue = { + selected, + onDayClick, + modifiers + }; + return Cn.createElement(SelectMultipleContext.Provider, { value: contextValue }, children); +} +function useSelectMultiple() { + var context = q2(SelectMultipleContext); + if (!context) { + throw new Error("useSelectMultiple must be used within a SelectMultipleProvider"); } - return dependencies; + return context; } -function sortKeysByDependencies(codeBlockStore, identifier) { - const graph = /* @__PURE__ */ new Map(); - const dependencies = /* @__PURE__ */ new Map(); - const allDependencies = /* @__PURE__ */ new Map(); - for (const key2 in codeBlockStore) { - const code = codeBlockStore[key2]; - const extractedDependencies = extractDependencies(code); - const localDependencies = extractedDependencies.filter((dep) => { - return dep.slice(0, -1).join(".") === identifier; - }); - dependencies.set(key2, localDependencies); - allDependencies.set(key2, extractedDependencies); - if (!graph.has(key2)) { - graph.set(key2, /* @__PURE__ */ new Set()); +function addToRange(day, range) { + var _a2 = range || {}, from = _a2.from, to = _a2.to; + if (!from) { + return { from: day, to: void 0 }; + } + if (!to && isSameDay(from, day)) { + return { from, to: day }; + } + if (!to && isBefore(day, from)) { + return { from: day, to: from }; + } + if (!to) { + return { from, to: day }; + } + if (isSameDay(to, day) && isSameDay(from, day)) { + return void 0; + } + if (isSameDay(to, day)) { + return { from: to, to: void 0 }; + } + if (isSameDay(from, day)) { + return void 0; + } + if (isAfter2(from, day)) { + return { from: day, to }; + } + return { from, to: day }; +} +var SelectRangeContext = F(void 0); +function SelectRangeProvider(props2) { + if (!isDayPickerRange(props2.initialProps)) { + var emptyContextValue = { + selected: void 0, + modifiers: { + range_start: [], + range_end: [], + range_middle: [], + disabled: [] + } + }; + return Cn.createElement(SelectRangeContext.Provider, { value: emptyContextValue }, props2.children); + } + return Cn.createElement(SelectRangeProviderInternal, { initialProps: props2.initialProps, children: props2.children }); +} +function SelectRangeProviderInternal(_a2) { + var initialProps = _a2.initialProps, children = _a2.children; + var selected = initialProps.selected; + var _b2 = selected || {}, selectedFrom = _b2.from, selectedTo = _b2.to; + var min3 = initialProps.min; + var max3 = initialProps.max; + var onDayClick = function(day, activeModifiers, e4) { + var _a3, _b3; + (_a3 = initialProps.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(initialProps, day, activeModifiers, e4); + var newRange = addToRange(day, selected); + (_b3 = initialProps.onSelect) === null || _b3 === void 0 ? void 0 : _b3.call(initialProps, newRange, day, activeModifiers, e4); + }; + var modifiers = { + range_start: [], + range_end: [], + range_middle: [], + disabled: [] + }; + if (selectedFrom) { + modifiers.range_start = [selectedFrom]; + if (!selectedTo) { + modifiers.range_end = [selectedFrom]; + } else { + modifiers.range_end = [selectedTo]; + if (!isSameDay(selectedFrom, selectedTo)) { + modifiers.range_middle = [ + { + after: selectedFrom, + before: selectedTo + } + ]; + } } - for (const dep of localDependencies) { - const depStr = dep[dep.length - 1]; - if (depStr === key2) - continue; - graph.get(key2).add(depStr); + } + if (min3) { + if (selectedFrom && !selectedTo) { + modifiers.disabled.push({ + after: subDays(selectedFrom, min3 - 1), + before: addDays(selectedFrom, min3 - 1) + }); + } + if (selectedFrom && selectedTo) { + modifiers.disabled.push({ + after: selectedFrom, + before: addDays(selectedFrom, min3 - 1) + }); } } - const visited = /* @__PURE__ */ new Set(); - const result = []; - const temp = /* @__PURE__ */ new Set(); - const visit = (key2) => { - if (temp.has(key2)) - throw new Error("Circular dependency detected"); - if (!visited.has(key2)) { - temp.add(key2); - const edges = graph.get(key2) || /* @__PURE__ */ new Set(); - for (const dep of edges) { - visit(dep); - } - visited.add(key2); - temp.delete(key2); - result.push(key2); + if (max3) { + if (selectedFrom && !selectedTo) { + modifiers.disabled.push({ + before: addDays(selectedFrom, -max3 + 1) + }); + modifiers.disabled.push({ + after: addDays(selectedFrom, max3 - 1) + }); } - }; - for (const key2 in codeBlockStore) { - if (!visited.has(key2)) { - visit(key2); + if (selectedFrom && selectedTo) { + var selectedCount = differenceInCalendarDays(selectedTo, selectedFrom) + 1; + var offset2 = max3 - selectedCount; + modifiers.disabled.push({ + before: subDays(selectedFrom, offset2) + }); + modifiers.disabled.push({ + after: addDays(selectedTo, offset2) + }); } } - return { sortedKeys: result, dependencies: allDependencies }; + return Cn.createElement(SelectRangeContext.Provider, { value: { selected, onDayClick, modifiers } }, children); } -var executeTreeNode = async (_treeNode, state, api, saveState, root, runID, newState) => { - var _a2, _b2, _c2; - const treeNode = _treeNode; - let execState = await executeNode(treeNode.node, { state, newState }, api); - if (treeNode.node.type == "list") { - let uid = 0; - treeNode.children = parseMultiString(execState.state[treeNode.id].props.value).flatMap((f4, i4) => treeNode.children.map((n2) => { - const [tree, m5] = linkTreeNodes({ ...n2, node: { ...n2.node, props: { ...n2.node.props, value: wrapQuotes(f4) } } }, uid); - uid = m5; - return tree; - })); +function useSelectRange() { + var context = q2(SelectRangeContext); + if (!context) { + throw new Error("useSelectRange must be used within a SelectRangeProvider"); } - if (typeof ((_b2 = (_a2 = execState.state[treeNode.id]) == null ? void 0 : _a2.actions) == null ? void 0 : _b2.onRun) == "function") { - (_c2 = execState.state[treeNode.id].actions) == null ? void 0 : _c2.onRun( - execState, - (s5) => { - saveState(s5, { state: execState.state, root, id: runID }); - }, - api - ); + return context; +} +function matcherToArray(matcher) { + if (Array.isArray(matcher)) { + return __spreadArray([], matcher, true); + } else if (matcher !== void 0) { + return [matcher]; + } else { + return []; } - for (let i4 = 0; i4 < treeNode.children.length; i4++) { - const [newState2, newNode] = await executeTreeNode(treeNode.children[i4], execState.state, api, saveState, root, runID, execState.newState).then((f4) => [{ state: f4.state, newState: f4.newState }, f4.root]); - execState = newState2; - treeNode.children[i4] = newNode; +} +function getCustomModifiers(dayModifiers) { + var customModifiers = {}; + Object.entries(dayModifiers).forEach(function(_a2) { + var modifier = _a2[0], matcher = _a2[1]; + customModifiers[modifier] = matcherToArray(matcher); + }); + return customModifiers; +} +var InternalModifier; +(function(InternalModifier2) { + InternalModifier2["Outside"] = "outside"; + InternalModifier2["Disabled"] = "disabled"; + InternalModifier2["Selected"] = "selected"; + InternalModifier2["Hidden"] = "hidden"; + InternalModifier2["Today"] = "today"; + InternalModifier2["RangeStart"] = "range_start"; + InternalModifier2["RangeEnd"] = "range_end"; + InternalModifier2["RangeMiddle"] = "range_middle"; +})(InternalModifier || (InternalModifier = {})); +var Selected = InternalModifier.Selected; +var Disabled = InternalModifier.Disabled; +var Hidden = InternalModifier.Hidden; +var Today = InternalModifier.Today; +var RangeEnd = InternalModifier.RangeEnd; +var RangeMiddle = InternalModifier.RangeMiddle; +var RangeStart = InternalModifier.RangeStart; +var Outside2 = InternalModifier.Outside; +function getInternalModifiers(dayPicker, selectMultiple, selectRange2) { + var _a2; + var internalModifiers = (_a2 = {}, _a2[Selected] = matcherToArray(dayPicker.selected), _a2[Disabled] = matcherToArray(dayPicker.disabled), _a2[Hidden] = matcherToArray(dayPicker.hidden), _a2[Today] = [dayPicker.today], _a2[RangeEnd] = [], _a2[RangeMiddle] = [], _a2[RangeStart] = [], _a2[Outside2] = [], _a2); + if (dayPicker.fromDate) { + internalModifiers[Disabled].push({ before: dayPicker.fromDate }); } - return { id: runID, root: treeNode, state: execState.state, newState: execState.newState }; -}; -var executeNode = async (node, results, api) => { - const propResults = await executePropsCodeBlocks(node, results, api); - const stylesResults = executeCodeBlocks(node, "styles", propResults); - const actions = executeCodeBlocks(node, "actions", stylesResults); - return actions; -}; -var executePropsCodeBlocks = async (node, results, api) => { - var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k; - const { type, props: props2, id: id2 } = node; - const codeBlockStore = props2 != null ? props2 : {}; - const { sortedKeys, dependencies } = sortKeysByDependencies(codeBlockStore, `${node.id}.props`); - const runKeys = results.newState ? sortedKeys.filter((f4) => { - var _a3, _b3, _c3, _d3, _e3, _f2; - const deps = dependencies.get(f4); - if (f4 in ((_c3 = (_b3 = (_a3 = results.newState) == null ? void 0 : _a3[node.id]) == null ? void 0 : _b3["props"]) != null ? _c3 : {})) { - return true; + if (dayPicker.toDate) { + internalModifiers[Disabled].push({ after: dayPicker.toDate }); + } + if (isDayPickerMultiple(dayPicker)) { + internalModifiers[Disabled] = internalModifiers[Disabled].concat(selectMultiple.modifiers[Disabled]); + } else if (isDayPickerRange(dayPicker)) { + internalModifiers[Disabled] = internalModifiers[Disabled].concat(selectRange2.modifiers[Disabled]); + internalModifiers[RangeStart] = selectRange2.modifiers[RangeStart]; + internalModifiers[RangeMiddle] = selectRange2.modifiers[RangeMiddle]; + internalModifiers[RangeEnd] = selectRange2.modifiers[RangeEnd]; + } + return internalModifiers; +} +var ModifiersContext = F(void 0); +function ModifiersProvider(props2) { + var dayPicker = useDayPicker(); + var selectMultiple = useSelectMultiple(); + var selectRange2 = useSelectRange(); + var internalModifiers = getInternalModifiers(dayPicker, selectMultiple, selectRange2); + var customModifiers = getCustomModifiers(dayPicker.modifiers); + var modifiers = __assign(__assign({}, internalModifiers), customModifiers); + return Cn.createElement(ModifiersContext.Provider, { value: modifiers }, props2.children); +} +function useModifiers() { + var context = q2(ModifiersContext); + if (!context) { + throw new Error("useModifiers must be used within a ModifiersProvider"); + } + return context; +} +function isDateInterval(matcher) { + return Boolean(matcher && typeof matcher === "object" && "before" in matcher && "after" in matcher); +} +function isDateRange(value) { + return Boolean(value && typeof value === "object" && "from" in value); +} +function isDateAfterType(value) { + return Boolean(value && typeof value === "object" && "after" in value); +} +function isDateBeforeType(value) { + return Boolean(value && typeof value === "object" && "before" in value); +} +function isDayOfWeekType(value) { + return Boolean(value && typeof value === "object" && "dayOfWeek" in value); +} +function isDateInRange(date, range) { + var _a2; + var from = range.from, to = range.to; + if (!from) { + return false; + } + if (!to && isSameDay(from, date)) { + return true; + } + if (!to) { + return false; + } + var isRangeInverted = differenceInCalendarDays(to, from) < 0; + if (isRangeInverted) { + _a2 = [to, from], from = _a2[0], to = _a2[1]; + } + var isInRange = differenceInCalendarDays(date, from) >= 0 && differenceInCalendarDays(to, date) >= 0; + return isInRange; +} +function isDateType(value) { + return isDate(value); +} +function isArrayOfDates(value) { + return Array.isArray(value) && value.every(isDate); +} +function isMatch(day, matchers) { + return matchers.some(function(matcher) { + if (typeof matcher === "boolean") { + return matcher; } - for (const dep of deps) { - if (dep[0] == "api") - return true; - if ((_f2 = (_e3 = (_d3 = results.newState) == null ? void 0 : _d3[dep[0]]) == null ? void 0 : _e3[dep[1]]) == null ? void 0 : _f2[dep[2]]) { - return true; + if (isDateType(matcher)) { + return isSameDay(day, matcher); + } + if (isArrayOfDates(matcher)) { + return matcher.includes(day); + } + if (isDateRange(matcher)) { + return isDateInRange(day, matcher); + } + if (isDayOfWeekType(matcher)) { + return matcher.dayOfWeek.includes(day.getDay()); + } + if (isDateInterval(matcher)) { + var diffBefore = differenceInCalendarDays(matcher.before, day); + var diffAfter = differenceInCalendarDays(matcher.after, day); + var isDayBefore = diffBefore > 0; + var isDayAfter = diffAfter < 0; + var isClosedInterval = isAfter2(matcher.before, matcher.after); + if (isClosedInterval) { + return isDayAfter && isDayBefore; + } else { + return isDayBefore || isDayAfter; } } + if (isDateAfterType(matcher)) { + return differenceInCalendarDays(day, matcher.after) > 0; + } + if (isDateBeforeType(matcher)) { + return differenceInCalendarDays(matcher.before, day) > 0; + } + if (typeof matcher === "function") { + return matcher(day); + } return false; - }) : sortedKeys.filter((f4) => { - var _a3; - return ((_a3 = codeBlockStore[f4]) == null ? void 0 : _a3.length) > 0; }); - const environment = results.state; - environment[id2] = { - props: (_b2 = (_a2 = results.state[id2]) == null ? void 0 : _a2.props) != null ? _b2 : {}, - actions: (_d2 = (_c2 = results.state[id2]) == null ? void 0 : _c2.actions) != null ? _d2 : {}, - styles: (_f = (_e2 = results.state[id2]) == null ? void 0 : _e2.styles) != null ? _f : {}, - contexts: (_h = (_g = results.state[id2]) == null ? void 0 : _g.contexts) != null ? _h : {} +} +function getActiveModifiers(day, modifiers, displayMonth) { + var matchedModifiers = Object.keys(modifiers).reduce(function(result, key2) { + var modifier = modifiers[key2]; + if (isMatch(day, modifier)) { + result.push(key2); + } + return result; + }, []); + var activeModifiers = {}; + matchedModifiers.forEach(function(modifier) { + return activeModifiers[modifier] = true; + }); + if (displayMonth && !isSameMonth(day, displayMonth)) { + activeModifiers.outside = true; + } + return activeModifiers; +} +function getInitialFocusTarget(displayMonths, modifiers) { + var firstDayInMonth = startOfMonth(displayMonths[0]); + var lastDayInMonth = endOfMonth(displayMonths[displayMonths.length - 1]); + var firstFocusableDay; + var today; + var date = firstDayInMonth; + while (date <= lastDayInMonth) { + var activeModifiers = getActiveModifiers(date, modifiers); + var isFocusable = !activeModifiers.disabled && !activeModifiers.hidden; + if (!isFocusable) { + date = addDays(date, 1); + continue; + } + if (activeModifiers.selected) { + return date; + } + if (activeModifiers.today && !today) { + today = date; + } + if (!firstFocusableDay) { + firstFocusableDay = date; + } + date = addDays(date, 1); + } + if (today) { + return today; + } else { + return firstFocusableDay; + } +} +var MAX_RETRY = 365; +function getNextFocus(focusedDay, options) { + var moveBy = options.moveBy, direction = options.direction, context = options.context, modifiers = options.modifiers, _a2 = options.retry, retry = _a2 === void 0 ? { count: 0, lastFocused: focusedDay } : _a2; + var weekStartsOn = context.weekStartsOn, fromDate = context.fromDate, toDate2 = context.toDate, locale2 = context.locale; + var moveFns = { + day: addDays, + week: addWeeks, + month: addMonths, + year: addYears, + startOfWeek: function(date) { + return context.ISOWeek ? startOfISOWeek(date) : startOfWeek(date, { locale: locale2, weekStartsOn }); + }, + endOfWeek: function(date) { + return context.ISOWeek ? endOfISOWeek(date) : endOfWeek(date, { locale: locale2, weekStartsOn }); + } + }; + var newFocusedDay = moveFns[moveBy](focusedDay, direction === "after" ? 1 : -1); + if (direction === "before" && fromDate) { + newFocusedDay = max([fromDate, newFocusedDay]); + } else if (direction === "after" && toDate2) { + newFocusedDay = min([toDate2, newFocusedDay]); + } + var isFocusable = true; + if (modifiers) { + var activeModifiers = getActiveModifiers(newFocusedDay, modifiers); + isFocusable = !activeModifiers.disabled && !activeModifiers.hidden; + } + if (isFocusable) { + return newFocusedDay; + } else { + if (retry.count > MAX_RETRY) { + return retry.lastFocused; + } + return getNextFocus(newFocusedDay, { + moveBy, + direction, + context, + modifiers, + retry: __assign(__assign({}, retry), { count: retry.count + 1 }) + }); + } +} +var FocusContext = F(void 0); +function FocusProvider(props2) { + var navigation = useNavigation(); + var modifiers = useModifiers(); + var _a2 = h2(), focusedDay = _a2[0], setFocusedDay = _a2[1]; + var _b2 = h2(), lastFocused = _b2[0], setLastFocused = _b2[1]; + var initialFocusTarget = getInitialFocusTarget(navigation.displayMonths, modifiers); + var focusTarget = (focusedDay !== null && focusedDay !== void 0 ? focusedDay : lastFocused && navigation.isDateDisplayed(lastFocused)) ? lastFocused : initialFocusTarget; + var blur = function() { + setLastFocused(focusedDay); + setFocusedDay(void 0); + }; + var focus = function(date) { + setFocusedDay(date); + }; + var context = useDayPicker(); + var moveFocus = function(moveBy, direction) { + if (!focusedDay) + return; + var nextFocused = getNextFocus(focusedDay, { + moveBy, + direction, + context, + modifiers + }); + if (isSameDay(focusedDay, nextFocused)) + return void 0; + navigation.goToDate(nextFocused, focusedDay); + focus(nextFocused); }; - environment.api = api; - for (const key2 of runKeys) { - try { - let result; - if (key2 in (((_j = (_i = results.newState) == null ? void 0 : _i[node.id]) == null ? void 0 : _j["props"]) || {})) { - result = results.newState[node.id]["props"][key2]; - } else { - const isMultiLine = codeBlockStore[key2].includes("\n"); - const func = isMultiLine ? new Function(`with(this) { ${codeBlockStore[key2]} }`) : new Function(`with(this) { return ${codeBlockStore[key2]}; }`); - result = func.call(environment); - if (result instanceof Promise) { - result = await result; - } - } - environment[id2]["props"][key2] = result; - results.state[id2]["props"][key2] = result; - if (results.newState) { - results.newState[id2] = (_k = results.newState[id2]) != null ? _k : { props: {}, styles: {}, actions: {}, contexts: {} }; - results.newState[id2]["props"][key2] = result; - } - } catch (error) { - console.log(error); + var value = { + focusedDay, + focusTarget, + blur, + focus, + focusDayAfter: function() { + return moveFocus("day", "after"); + }, + focusDayBefore: function() { + return moveFocus("day", "before"); + }, + focusWeekAfter: function() { + return moveFocus("week", "after"); + }, + focusWeekBefore: function() { + return moveFocus("week", "before"); + }, + focusMonthBefore: function() { + return moveFocus("month", "before"); + }, + focusMonthAfter: function() { + return moveFocus("month", "after"); + }, + focusYearBefore: function() { + return moveFocus("year", "before"); + }, + focusYearAfter: function() { + return moveFocus("year", "after"); + }, + focusStartOfWeek: function() { + return moveFocus("startOfWeek", "before"); + }, + focusEndOfWeek: function() { + return moveFocus("endOfWeek", "after"); } + }; + return Cn.createElement(FocusContext.Provider, { value }, props2.children); +} +function useFocusContext() { + var context = q2(FocusContext); + if (!context) { + throw new Error("useFocusContext must be used within a FocusProvider"); } - return results; -}; -function executeCodeBlocks(node, type, results) { - var _a2; - const codeBlockStore = (_a2 = node[type]) != null ? _a2 : {}; - for (const key2 of Object.keys(codeBlockStore)) { - try { - const isMultiLine = typeof codeBlockStore[key2] === "string" || codeBlockStore[key2] instanceof String ? codeBlockStore[key2].includes("\n") : false; - const func = isMultiLine && !(type == "actions") ? new Function(`with(this) { ${codeBlockStore[key2]} }`) : new Function(`with(this) { return ${codeBlockStore[key2]}; }`); - const result = func.call(results.state); - parseKeyResult(results.state[node.id][type], key2, result); - } catch (error) { - console.log(error); - } + return context; +} +function useActiveModifiers(day, displayMonth) { + var modifiers = useModifiers(); + var activeModifiers = getActiveModifiers(day, modifiers, displayMonth); + return activeModifiers; +} +var SelectSingleContext = F(void 0); +function SelectSingleProvider(props2) { + if (!isDayPickerSingle(props2.initialProps)) { + var emptyContextValue = { + selected: void 0 + }; + return Cn.createElement(SelectSingleContext.Provider, { value: emptyContextValue }, props2.children); } - return results; + return Cn.createElement(SelectSingleProviderInternal, { initialProps: props2.initialProps, children: props2.children }); } -var parseKeyResult = (resultStore, key2, result) => { - if (key2 == "layout") { - if (result == "row" || result == "column") { - resultStore["display"] = "flex"; - resultStore["flexDirection"] = result; +function SelectSingleProviderInternal(_a2) { + var initialProps = _a2.initialProps, children = _a2.children; + var onDayClick = function(day, activeModifiers, e4) { + var _a3, _b2, _c2; + (_a3 = initialProps.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(initialProps, day, activeModifiers, e4); + if (activeModifiers.selected && !initialProps.required) { + (_b2 = initialProps.onSelect) === null || _b2 === void 0 ? void 0 : _b2.call(initialProps, void 0, day, activeModifiers, e4); return; } - resultStore["display"] = result; - return; + (_c2 = initialProps.onSelect) === null || _c2 === void 0 ? void 0 : _c2.call(initialProps, day, day, activeModifiers, e4); + }; + var contextValue = { + selected: initialProps.selected, + onDayClick + }; + return Cn.createElement(SelectSingleContext.Provider, { value: contextValue }, children); +} +function useSelectSingle() { + var context = q2(SelectSingleContext); + if (!context) { + throw new Error("useSelectSingle must be used within a SelectSingleProvider"); } - resultStore[key2] = result; -}; - -// src/context/FrameEditorContext.tsx -var FramesEditorContext = F({ - root: null, - runRoot: () => null, - instance: { state: {}, id: null, root: null }, - saveState: () => null, - fastSaveState: () => null, - nodes: [], - properties: [], - dragNode: null, - setDragNode: () => null, - hoverNode: null, - selectableNodeBounds: null, - setHoverNode: () => null, - selectedNodes: [], - selectNodes: () => null, - saveProperty: () => false, - newProperty: () => false, - delProperty: () => null, - groupNodes: () => null, - ungroupNode: () => null, - renameNode: () => null, - addNode: () => null, - deleteNode: () => null, - saveNodes: () => null, - moveUp: () => null, - moveDown: () => null, - moveToRank: () => null, - moveNodeFromSchema: () => null -}); -var FramesEditorProvider = (props2) => { - var _a2; - const { spaceInfo } = q2(SpaceContext); - const editorProps = { editMode: props2.editMode }; - const { - frameSchema, - setFrameSchema: setDBSchema, - saveFrame, - frameSchemas: schemas, - tableData, - getMDBData - } = q2(FramesMDBContext); - const [hoverNode, setHoverNode] = h2(null); - const [dragNode, setDragNode] = h2(null); - const [selectedNodes, setSelectedNodes] = h2([]); - const nodes = F2(() => { - var _a3; - if (!frameSchema) - return []; - const frames2 = (_a3 = tableData == null ? void 0 : tableData.rows.map( - (f4) => f4.id == frameSchema.id ? { - ...frameToNode(f4), - types: tableData.cols.reduce( - (p3, c4) => ({ ...p3, [c4.name]: c4.type }), - {} - ), - propsValue: tableData.cols.reduce( - (p3, c4) => ({ ...p3, [c4.name]: c4.value }), - {} - ) - } : frameToNode(f4) - )) != null ? _a3 : []; - const _root = schemaToRoot(frameSchema); - if (frames2.some((f4) => f4.id == _root.id)) { - return frames2; + return context; +} +function useDayEventHandlers(date, activeModifiers) { + var dayPicker = useDayPicker(); + var single = useSelectSingle(); + var multiple = useSelectMultiple(); + var range = useSelectRange(); + var _a2 = useFocusContext(), focusDayAfter = _a2.focusDayAfter, focusDayBefore = _a2.focusDayBefore, focusWeekAfter = _a2.focusWeekAfter, focusWeekBefore = _a2.focusWeekBefore, blur = _a2.blur, focus = _a2.focus, focusMonthBefore = _a2.focusMonthBefore, focusMonthAfter = _a2.focusMonthAfter, focusYearBefore = _a2.focusYearBefore, focusYearAfter = _a2.focusYearAfter, focusStartOfWeek = _a2.focusStartOfWeek, focusEndOfWeek = _a2.focusEndOfWeek; + var onClick = function(e4) { + var _a3, _b2, _c2, _d2; + if (isDayPickerSingle(dayPicker)) { + (_a3 = single.onDayClick) === null || _a3 === void 0 ? void 0 : _a3.call(single, date, activeModifiers, e4); + } else if (isDayPickerMultiple(dayPicker)) { + (_b2 = multiple.onDayClick) === null || _b2 === void 0 ? void 0 : _b2.call(multiple, date, activeModifiers, e4); + } else if (isDayPickerRange(dayPicker)) { + (_c2 = range.onDayClick) === null || _c2 === void 0 ? void 0 : _c2.call(range, date, activeModifiers, e4); + } else { + (_d2 = dayPicker.onDayClick) === null || _d2 === void 0 ? void 0 : _d2.call(dayPicker, date, activeModifiers, e4); } - return [...frames2, _root]; - }, [tableData, frameSchema]); - const [root, setRoot] = h2(null); - const [instance, setInstance] = h2({ - state: {}, - id: null, - root: null - }); - const activeRunID = _2(null); - const saveState = (newState, instance2) => { - const { root: _root, id: runID, state } = instance2; - if (activeRunID.current != runID) - return; - executeTreeNode( - applyPropsToRoot(_root, props2.props), - state, - props2.plugin.index.api, - saveState, - _root, - runID, - newState - ).then( - (s5) => setInstance((p3) => { - return s5; - }) - ); }; - const selectableNodeBounds = _2({}); - const fastSaveState = (newState) => { - setInstance((p3) => { - return { ...p3, state: newState }; - }); + var onFocus = function(e4) { + var _a3; + focus(date); + (_a3 = dayPicker.onDayFocus) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - p2( - () => () => { - activeRunID.current = null; - }, - [] - ); - const runRoot = () => { + var onBlur = function(e4) { var _a3; - if ((frameSchema == null ? void 0 : frameSchema.type) == "frame" || (frameSchema == null ? void 0 : frameSchema.type) == "listitem") { - const _newRoot = buildRoot( - frameSchema, - (_a3 = tableData == null ? void 0 : tableData.cols) != null ? _a3 : [], - nodes, - props2.plugin, - editorProps - ); - setRoot(_newRoot); - if (_newRoot) { - const newRoot = import_lodash8.default.cloneDeep(_newRoot); - const runID = (0, import_lodash8.uniqueId)(); - activeRunID.current = runID; - executeTreeNode( - applyPropsToRoot(newRoot, props2.props), - {}, - props2.plugin.index.api, - saveState, - newRoot, - runID - ).then((s5) => { - setInstance((p3) => { - return s5; - }); - activeRunID.current = s5.id; - }); - if (selectedNodes.length == 0) { - } else { - setSelectedNodes( - nodes.filter((f4) => selectedNodes.find((g4) => g4.id == f4.id)) - ); - } - } - } + blur(); + (_a3 = dayPicker.onDayBlur) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - const refreshFrame = (e4) => { - if (e4.detail.type == "frames" && e4.detail.name == spaceInfo.path) { - runRoot(); - } + var onMouseEnter = function(e4) { + var _a3; + (_a3 = dayPicker.onDayMouseEnter) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - p2(() => { - window.addEventListener(eventTypes.spacesChange, refreshFrame); - return () => { - window.removeEventListener(eventTypes.spacesChange, refreshFrame); - }; - }, [spaceInfo]); - p2(() => { - runRoot(); - }, [frameSchema, nodes, tableData, props2.props]); - const moveUp = (node) => { - const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank).map((f4, i4) => ({ ...f4, rank: i4 })); - const itemIndex = items.findIndex((item2) => item2.id === node.id); - if (itemIndex <= 0) { - saveNodes(items); - return; - } - const item = items[itemIndex]; - const swappedItem = items[itemIndex - 1]; - [item.rank, swappedItem.rank] = [swappedItem.rank, item.rank]; - saveNodes(items); + var onMouseLeave = function(e4) { + var _a3; + (_a3 = dayPicker.onDayMouseLeave) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - const moveDown = (node) => { - const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank).map((f4, i4) => ({ ...f4, rank: i4 })); - const itemIndex = items.findIndex((item2) => item2.id === node.id); - if (itemIndex < 0 || itemIndex >= items.length - 1) { - saveNodes(items); - return; - } - const item = items[itemIndex]; - const swappedItem = items[itemIndex + 1]; - [item.rank, swappedItem.rank] = [swappedItem.rank, item.rank]; - saveNodes(items.sort((a5, b4) => a5.rank - b4.rank)); + var onPointerEnter = function(e4) { + var _a3; + (_a3 = dayPicker.onDayPointerEnter) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - const ungroupNode = (node) => { - const children = nodes.filter((f4) => f4.parentId == node.id); - const newRank = node.rank; - const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank); - const newItems = insertMulti( - items, - newRank, - children.map((f4) => ({ ...f4, parentId: node.parentId })) - ).filter((f4) => f4.id != node.id).map((f4, i4) => ({ ...f4, rank: i4 })); - return saveNodes(newItems, [node]); + var onPointerLeave = function(e4) { + var _a3; + (_a3 = dayPicker.onDayPointerLeave) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - const moveToRank = (node, newRank) => { - const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank).map((f4, i4) => ({ ...f4, rank: i4 })); - const itemIndex = items.findIndex((item2) => item2.id === node.id); - if (itemIndex < 0 || newRank < 0 || newRank >= items.length) { - saveNodes(items); - return; - } - const item = items[itemIndex]; - item.rank = newRank; - const newItems = arrayMove(items, itemIndex, newRank).map((f4, i4) => ({ - ...f4, - rank: i4 - })); - saveNodes(newItems); + var onTouchCancel = function(e4) { + var _a3; + (_a3 = dayPicker.onDayTouchCancel) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - const groupNodes = (treeNodes, style) => { - const parentId = treeNodes[0].id == frameSchema.id ? "" : treeNodes[0].parentId; - const group = { - ...newUniqueNode(groupNode, parentId, nodes, frameSchema.id) - }; - const newNodes = treeNodes.map((f4) => { - const node = import_lodash8.default.cloneDeep(f4); - node.parentId = group.id; - return node; - }); - saveNodes([ - { ...group, styles: { ...group.styles, ...style } }, - ...newNodes - ]); + var onTouchEnd = function(e4) { + var _a3; + (_a3 = dayPicker.onDayTouchEnd) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - const addNode = (treeNode, target) => { - const id2 = uniqueNameFromString( - treeNode.id, - nodes.map((f4) => f4.id) - ); - let parent = target ? target : selectedNodes.length > 0 ? selectedNodes[0] : root.node; - let rank = target ? target.rank + 1 : parent.rank; - if (!groupableTypes.some((f4) => parent.type == f4)) { - parent = findParent(root, parent.id).node; - } else { - rank = nodes.filter((f4) => f4.parentId == parent.id).length; + var onTouchMove = function(e4) { + var _a3; + (_a3 = dayPicker.onDayTouchMove) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); + }; + var onTouchStart = function(e4) { + var _a3; + (_a3 = dayPicker.onDayTouchStart) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); + }; + var onKeyUp = function(e4) { + var _a3; + (_a3 = dayPicker.onDayKeyUp) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); + }; + var onKeyDown = function(e4) { + var _a3; + switch (e4.key) { + case "ArrowLeft": + e4.preventDefault(); + e4.stopPropagation(); + dayPicker.dir === "rtl" ? focusDayAfter() : focusDayBefore(); + break; + case "ArrowRight": + e4.preventDefault(); + e4.stopPropagation(); + dayPicker.dir === "rtl" ? focusDayBefore() : focusDayAfter(); + break; + case "ArrowDown": + e4.preventDefault(); + e4.stopPropagation(); + focusWeekAfter(); + break; + case "ArrowUp": + e4.preventDefault(); + e4.stopPropagation(); + focusWeekBefore(); + break; + case "PageUp": + e4.preventDefault(); + e4.stopPropagation(); + e4.shiftKey ? focusYearBefore() : focusMonthBefore(); + break; + case "PageDown": + e4.preventDefault(); + e4.stopPropagation(); + e4.shiftKey ? focusYearAfter() : focusMonthAfter(); + break; + case "Home": + e4.preventDefault(); + e4.stopPropagation(); + focusStartOfWeek(); + break; + case "End": + e4.preventDefault(); + e4.stopPropagation(); + focusEndOfWeek(); + break; } - const newTreeNode = { - ...treeNode, - id: id2, - schemaId: frameSchema.id, - parentId: parent.id - }; - const newNodes = insert( - nodes.filter((f4) => f4.parentId == parent.id).sort((a5, b4) => a5.rank - b4.rank), - rank, - newTreeNode - ).map((f4, i4) => ({ ...f4, rank: i4 })); - saveNodes(newNodes).then((f4) => selectNodes([newTreeNode])); + (_a3 = dayPicker.onDayKeyDown) === null || _a3 === void 0 ? void 0 : _a3.call(dayPicker, date, activeModifiers, e4); }; - const saveNodes = async (treeNodes, deleteNodes) => { - var _a3, _b2, _c2; - if (!tableData) { + var eventHandlers = { + onClick, + onFocus, + onBlur, + onKeyDown, + onKeyUp, + onMouseEnter, + onMouseLeave, + onPointerEnter, + onPointerLeave, + onTouchCancel, + onTouchEnd, + onTouchMove, + onTouchStart + }; + return eventHandlers; +} +function useSelectedDays() { + var dayPicker = useDayPicker(); + var single = useSelectSingle(); + var multiple = useSelectMultiple(); + var range = useSelectRange(); + var selectedDays = isDayPickerSingle(dayPicker) ? single.selected : isDayPickerMultiple(dayPicker) ? multiple.selected : isDayPickerRange(dayPicker) ? range.selected : void 0; + return selectedDays; +} +function isInternalModifier(modifier) { + return Object.values(InternalModifier).includes(modifier); +} +function getDayClassNames(dayPicker, activeModifiers) { + var classNames9 = [dayPicker.classNames.day]; + Object.keys(activeModifiers).forEach(function(modifier) { + var customClassName = dayPicker.modifiersClassNames[modifier]; + if (customClassName) { + classNames9.push(customClassName); + } else if (isInternalModifier(modifier)) { + var internalClassName = dayPicker.classNames["day_".concat(modifier)]; + if (internalClassName) { + classNames9.push(internalClassName); + } + } + }); + return classNames9; +} +function getDayStyle(dayPicker, activeModifiers) { + var style = __assign({}, dayPicker.styles.day); + Object.keys(activeModifiers).forEach(function(modifier) { + var _a2; + style = __assign(__assign({}, style), (_a2 = dayPicker.modifiersStyles) === null || _a2 === void 0 ? void 0 : _a2[modifier]); + }); + return style; +} +function useDayRender(day, displayMonth, buttonRef) { + var _a2; + var _b2, _c2; + var dayPicker = useDayPicker(); + var focusContext = useFocusContext(); + var activeModifiers = useActiveModifiers(day, displayMonth); + var eventHandlers = useDayEventHandlers(day, activeModifiers); + var selectedDays = useSelectedDays(); + var isButton = Boolean(dayPicker.onDayClick || dayPicker.mode !== "default"); + p2(function() { + var _a3; + if (activeModifiers.outside) return; - } - const newRows = ((_a3 = tableData == null ? void 0 : tableData.rows) == null ? void 0 : _a3.some((f4) => f4.id == root.id)) ? tableData.rows : [...(_b2 = tableData == null ? void 0 : tableData.rows) != null ? _b2 : [], nodeToFrame(root.node)]; - const insertRows = treeNodes.filter((f4) => !newRows.some((g4) => g4.id == f4.id)).map((f4) => nodeToFrame(f4)); - const modRows = treeNodes.filter((f4) => newRows.some((g4) => g4.id == f4.id)).map((f4) => nodeToFrame(f4)); - const newTable = { - ...tableData, - cols: (_c2 = tableData.cols) != null ? _c2 : [], - rows: [ - ...newRows.map((f4) => { - var _a4; - return (_a4 = modRows.find((g4) => g4.id == f4.id)) != null ? _a4 : f4; - }), - ...insertRows - ].filter( - (f4) => deleteNodes ? !deleteNodes.some((g4) => g4.id == f4.id) : f4 - ) - }; - await saveFrame(newTable); - }; - const moveNodeFromSchema = async (nodeId, schemaId, newParentId, styles2) => { - const oldTable = await getMDBData(); - if (!oldTable[schemaId]) + if (!focusContext.focusedDay) return; - const tableNodes = oldTable[schemaId].rows.map( - (g4) => frameToNode(g4) - ); - const oldSchema = schemas.find((f4) => f4.id == schemaId); - const treeNode = tableNodes.find((f4) => f4.id == nodeId); - if (!oldSchema || !treeNode) + if (!isButton) return; - const tree = buildFrameTree( - treeNode, - tableNodes, - props2.plugin, - 0, - false, - editorProps - )[0]; - const deleteNodes = flattenToFrameNodes(tree); - const newTreeNodes = deleteNodes.map((f4) => ({ - ...f4, - schemaId: frameSchema.id, - styles: f4.id == nodeId && styles2 ? { - ...f4.styles, - ...styles2 - } : f4.styles, - parentId: f4.id == nodeId ? newParentId : f4.parentId - })); - await saveFrame({ - ...oldTable[frameSchema.id], - rows: oldTable[frameSchema.id].rows.filter( - (f4) => !deleteNodes.some((g4) => f4.schemaId == g4.schemaId && f4.id == g4.id) - ) - }); - await saveFrame({ - ...tableData, - rows: [ - ...tableData.rows, - ...newTreeNodes.map((f4) => nodeToFrame(f4)) - ] - }); - }; - const deleteNode = (treeNode) => { - const tree = buildFrameTree( - treeNode, - nodes, - props2.plugin, - 0, - false, - editorProps - )[0]; - const parent = findParent(root, treeNode.id); - const deleteNodes = flattenToFrameNodes(tree); - if (parent) { - if (parent.children.length == 1 && parent.node.type == "column") - deleteNodes.push(parent.node); - const grandParent = findParent(root, parent.id); - if ((grandParent == null ? void 0 : grandParent.children.length) == 1 && grandParent.node.type == "container") { - deleteNodes.push(grandParent.node); - } + if (isSameDay(focusContext.focusedDay, day)) { + (_a3 = buttonRef.current) === null || _a3 === void 0 ? void 0 : _a3.focus(); } - saveFrame({ - ...tableData, - rows: tableData.rows.filter( - (f4) => !deleteNodes.some((g4) => f4.schemaId == g4.schemaId && f4.id == g4.id) - ) - }); - }; - const properties2 = (_a2 = tableData == null ? void 0 : tableData.cols) != null ? _a2 : []; - const selectNodes = (frames2) => { - setSelectedNodes(frames2); - }; - const delProperty = (column) => { - const mdbtable = tableData; - const newFields = mdbtable.cols.filter( - (f4, i4) => f4.name != column.name - ); - const newTable = { - ...mdbtable, - cols: newFields != null ? newFields : [] - }; - saveFrame(newTable); + }, [ + focusContext.focusedDay, + day, + buttonRef, + isButton, + activeModifiers.outside + ]); + var className = getDayClassNames(dayPicker, activeModifiers).join(" "); + var style = getDayStyle(dayPicker, activeModifiers); + var isHidden = Boolean(activeModifiers.outside && !dayPicker.showOutsideDays || activeModifiers.hidden); + var DayContentComponent = (_c2 = (_b2 = dayPicker.components) === null || _b2 === void 0 ? void 0 : _b2.DayContent) !== null && _c2 !== void 0 ? _c2 : DayContent; + var children = Cn.createElement(DayContentComponent, { date: day, displayMonth, activeModifiers }); + var divProps = { + style, + className, + children, + role: "gridcell" }; - const newProperty = (col) => { - return saveProperty(col); + var isFocusTarget = focusContext.focusTarget && isSameDay(focusContext.focusTarget, day) && !activeModifiers.outside; + var isFocused = focusContext.focusedDay && isSameDay(focusContext.focusedDay, day); + var buttonProps = __assign(__assign(__assign({}, divProps), (_a2 = { disabled: activeModifiers.disabled, role: "gridcell" }, _a2["aria-selected"] = activeModifiers.selected, _a2.tabIndex = isFocused || isFocusTarget ? 0 : -1, _a2)), eventHandlers); + var dayRender = { + isButton, + isHidden, + activeModifiers, + selectedDays, + buttonProps, + divProps }; - const renameNode = (node, newName) => { + return dayRender; +} +function Day(props2) { + var buttonRef = _2(null); + var dayRender = useDayRender(props2.date, props2.displayMonth, buttonRef); + if (dayRender.isHidden) { + return Cn.createElement("div", { role: "gridcell" }); + } + if (!dayRender.isButton) { + return Cn.createElement("div", __assign({}, dayRender.divProps)); + } + return Cn.createElement(Button, __assign({ name: "day", ref: buttonRef }, dayRender.buttonProps)); +} +function WeekNumber(props2) { + var weekNumber = props2.number, dates = props2.dates; + var _a2 = useDayPicker(), onWeekNumberClick = _a2.onWeekNumberClick, styles2 = _a2.styles, classNames9 = _a2.classNames, locale2 = _a2.locale, labelWeekNumber2 = _a2.labels.labelWeekNumber, formatWeekNumber2 = _a2.formatters.formatWeekNumber; + var content = formatWeekNumber2(Number(weekNumber), { locale: locale2 }); + if (!onWeekNumberClick) { + return Cn.createElement("span", { className: classNames9.weeknumber, style: styles2.weeknumber }, content); + } + var label = labelWeekNumber2(Number(weekNumber), { locale: locale2 }); + var handleClick = function(e4) { + onWeekNumberClick(weekNumber, dates, e4); }; - const saveProperty = (newColumn, oldColumn) => { - const column = { - ...newColumn, - name: sanitizeColumnName(newColumn.name) - }; - const mdbtable = tableData; - if (column.name == "") { - new import_obsidian25.Notice(i18n_default.notice.noPropertyName); - return false; + return Cn.createElement(Button, { name: "week-number", "aria-label": label, className: classNames9.weeknumber, style: styles2.weeknumber, onClick: handleClick }, content); +} +function Row(props2) { + var _a2, _b2; + var _c2 = useDayPicker(), styles2 = _c2.styles, classNames9 = _c2.classNames, showWeekNumber = _c2.showWeekNumber, components = _c2.components; + var DayComponent = (_a2 = components === null || components === void 0 ? void 0 : components.Day) !== null && _a2 !== void 0 ? _a2 : Day; + var WeeknumberComponent = (_b2 = components === null || components === void 0 ? void 0 : components.WeekNumber) !== null && _b2 !== void 0 ? _b2 : WeekNumber; + var weekNumberCell; + if (showWeekNumber) { + weekNumberCell = Cn.createElement( + "td", + { className: classNames9.cell, style: styles2.cell }, + Cn.createElement(WeeknumberComponent, { number: props2.weekNumber, dates: props2.dates }) + ); + } + return Cn.createElement( + "tr", + { className: classNames9.row, style: styles2.row }, + weekNumberCell, + props2.dates.map(function(date) { + return Cn.createElement( + "td", + { className: classNames9.cell, style: styles2.cell, key: getUnixTime(date), role: "presentation" }, + Cn.createElement(DayComponent, { displayMonth: props2.displayMonth, date }) + ); + }) + ); +} +function daysToMonthWeeks(fromDate, toDate2, options) { + var toWeek = (options === null || options === void 0 ? void 0 : options.ISOWeek) ? endOfISOWeek(toDate2) : endOfWeek(toDate2, options); + var fromWeek = (options === null || options === void 0 ? void 0 : options.ISOWeek) ? startOfISOWeek(fromDate) : startOfWeek(fromDate, options); + var nOfDays = differenceInCalendarDays(toWeek, fromWeek); + var days = []; + for (var i4 = 0; i4 <= nOfDays; i4++) { + days.push(addDays(fromWeek, i4)); + } + var weeksInMonth = days.reduce(function(result, date) { + var weekNumber = (options === null || options === void 0 ? void 0 : options.ISOWeek) ? getISOWeek(date) : getWeek(date, options); + var existingWeek = result.find(function(value) { + return value.weekNumber === weekNumber; + }); + if (existingWeek) { + existingWeek.dates.push(date); + return result; } - if (!oldColumn && mdbtable.cols.find( - (f4) => f4.name.toLowerCase() == column.name.toLowerCase() - ) || oldColumn && oldColumn.name != column.name && mdbtable.cols.find( - (f4) => f4.name.toLowerCase() == column.name.toLowerCase() - )) { - new import_obsidian25.Notice(i18n_default.notice.duplicatePropertyName); - return false; + result.push({ + weekNumber, + dates: [date] + }); + return result; + }, []); + return weeksInMonth; +} +function getMonthWeeks(month, options) { + var weeksInMonth = daysToMonthWeeks(startOfMonth(month), endOfMonth(month), options); + if (options === null || options === void 0 ? void 0 : options.useFixedWeeks) { + var nrOfMonthWeeks = getWeeksInMonth(month, options); + if (nrOfMonthWeeks < 6) { + var lastWeek = weeksInMonth[weeksInMonth.length - 1]; + var lastDate = lastWeek.dates[lastWeek.dates.length - 1]; + var toDate2 = addWeeks(lastDate, 6 - nrOfMonthWeeks); + var extraWeeks = daysToMonthWeeks(addWeeks(lastDate, 1), toDate2, options); + weeksInMonth.push.apply(weeksInMonth, extraWeeks); } - const oldFieldIndex = oldColumn ? mdbtable.cols.findIndex((f4) => f4.name == oldColumn.name) : -1; - const newFields = oldFieldIndex == -1 ? [...mdbtable.cols, column] : mdbtable.cols.map((f4, i4) => i4 == oldFieldIndex ? column : f4); - const newTable = { - ...mdbtable, - cols: newFields != null ? newFields : [] - }; - saveFrame(newTable); - return true; + } + return weeksInMonth; +} +function Table(props2) { + var _a2, _b2, _c2; + var _d2 = useDayPicker(), locale2 = _d2.locale, classNames9 = _d2.classNames, styles2 = _d2.styles, hideHead = _d2.hideHead, fixedWeeks = _d2.fixedWeeks, components = _d2.components, weekStartsOn = _d2.weekStartsOn, firstWeekContainsDate = _d2.firstWeekContainsDate, ISOWeek = _d2.ISOWeek; + var weeks = getMonthWeeks(props2.displayMonth, { + useFixedWeeks: Boolean(fixedWeeks), + ISOWeek, + locale: locale2, + weekStartsOn, + firstWeekContainsDate + }); + var HeadComponent = (_a2 = components === null || components === void 0 ? void 0 : components.Head) !== null && _a2 !== void 0 ? _a2 : Head; + var RowComponent = (_b2 = components === null || components === void 0 ? void 0 : components.Row) !== null && _b2 !== void 0 ? _b2 : Row; + var FooterComponent = (_c2 = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c2 !== void 0 ? _c2 : Footer; + return Cn.createElement( + "table", + { className: classNames9.table, style: styles2.table, role: "grid", "aria-labelledby": props2["aria-labelledby"] }, + !hideHead && Cn.createElement(HeadComponent, null), + Cn.createElement("tbody", { className: classNames9.tbody, style: styles2.tbody, role: "rowgroup" }, weeks.map(function(week) { + return Cn.createElement(RowComponent, { displayMonth: props2.displayMonth, key: week.weekNumber, dates: week.dates, weekNumber: week.weekNumber }); + })), + Cn.createElement(FooterComponent, { displayMonth: props2.displayMonth }) + ); +} +function canUseDOM2() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); +} +var useIsomorphicLayoutEffect2 = canUseDOM2() ? y2 : p2; +var serverHandoffComplete = false; +var id = 0; +function genId2() { + return "react-day-picker-".concat(++id); +} +function useId(providedId) { + var _a2; + var initialId = providedId !== null && providedId !== void 0 ? providedId : serverHandoffComplete ? genId2() : null; + var _b2 = h2(initialId), id2 = _b2[0], setId = _b2[1]; + useIsomorphicLayoutEffect2(function() { + if (id2 === null) { + setId(genId2()); + } + }, []); + p2(function() { + if (serverHandoffComplete === false) { + serverHandoffComplete = true; + } + }, []); + return (_a2 = providedId !== null && providedId !== void 0 ? providedId : id2) !== null && _a2 !== void 0 ? _a2 : void 0; +} +function Month(props2) { + var _a2; + var _b2; + var dayPicker = useDayPicker(); + var dir = dayPicker.dir, classNames9 = dayPicker.classNames, styles2 = dayPicker.styles, components = dayPicker.components; + var displayMonths = useNavigation().displayMonths; + var captionId = useId(dayPicker.id ? "".concat(dayPicker.id, "-").concat(props2.displayIndex) : void 0); + var className = [classNames9.month]; + var style = styles2.month; + var isStart = props2.displayIndex === 0; + var isEnd = props2.displayIndex === displayMonths.length - 1; + var isCenter = !isStart && !isEnd; + if (dir === "rtl") { + _a2 = [isStart, isEnd], isEnd = _a2[0], isStart = _a2[1]; + } + if (isStart) { + className.push(classNames9.caption_start); + style = __assign(__assign({}, style), styles2.caption_start); + } + if (isEnd) { + className.push(classNames9.caption_end); + style = __assign(__assign({}, style), styles2.caption_end); + } + if (isCenter) { + className.push(classNames9.caption_between); + style = __assign(__assign({}, style), styles2.caption_between); + } + var CaptionComponent = (_b2 = components === null || components === void 0 ? void 0 : components.Caption) !== null && _b2 !== void 0 ? _b2 : Caption; + return Cn.createElement( + "div", + { key: props2.displayIndex, className: className.join(" "), style }, + Cn.createElement(CaptionComponent, { id: captionId, displayMonth: props2.displayMonth }), + Cn.createElement(Table, { "aria-labelledby": captionId, displayMonth: props2.displayMonth }) + ); +} +function Root2() { + var dayPicker = useDayPicker(); + var focusContext = useFocusContext(); + var navigation = useNavigation(); + var _a2 = h2(false), hasInitialFocus = _a2[0], setHasInitialFocus = _a2[1]; + p2(function() { + if (!dayPicker.initialFocus) + return; + if (!focusContext.focusTarget) + return; + if (hasInitialFocus) + return; + focusContext.focus(focusContext.focusTarget); + setHasInitialFocus(true); + }, [ + dayPicker.initialFocus, + hasInitialFocus, + focusContext.focus, + focusContext.focusTarget, + focusContext + ]); + var classNames9 = [dayPicker.classNames.root, dayPicker.className]; + if (dayPicker.numberOfMonths > 1) { + classNames9.push(dayPicker.classNames.multiple_months); + } + if (dayPicker.showWeekNumber) { + classNames9.push(dayPicker.classNames.with_weeknumber); + } + var style = __assign(__assign({}, dayPicker.styles.root), dayPicker.style); + return Cn.createElement( + "div", + { className: classNames9.join(" "), style, dir: dayPicker.dir }, + Cn.createElement("div", { className: dayPicker.classNames.months, style: dayPicker.styles.months }, navigation.displayMonths.map(function(month, i4) { + return Cn.createElement(Month, { key: i4, displayIndex: i4, displayMonth: month }); + })) + ); +} +function RootProvider(props2) { + var children = props2.children, initialProps = __rest(props2, ["children"]); + return Cn.createElement( + DayPickerProvider, + { initialProps }, + Cn.createElement( + NavigationProvider, + null, + Cn.createElement( + SelectSingleProvider, + { initialProps }, + Cn.createElement( + SelectMultipleProvider, + { initialProps }, + Cn.createElement( + SelectRangeProvider, + { initialProps }, + Cn.createElement( + ModifiersProvider, + null, + Cn.createElement(FocusProvider, null, children) + ) + ) + ) + ) + ) + ); +} +function DayPicker(props2) { + return Cn.createElement( + RootProvider, + __assign({}, props2), + Cn.createElement(Root2, null) + ); +} + +// src/react/components/UI/Menus/datePickerMenu.tsx +var showDatePickerMenu = (point, value, setValue, format2) => { + const menu = new import_obsidian24.Menu(); + menu.dom.toggleClass("mk-menu", true); + menu.setUseNativeMenu(false); + const frag = document.createDocumentFragment(); + const div = frag.createEl("div"); + div.addEventListener("click", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("mousedown", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("mouseup", (e4) => { + e4.stopImmediatePropagation(); + }); + div.addEventListener("keydown", (e4) => { + }); + const setDate = (date) => { + setValue(date); + menu.hide(); }; - return /* @__PURE__ */ Cn.createElement(FramesEditorContext.Provider, { - value: { - root, - runRoot, - instance, - dragNode, - fastSaveState, - setDragNode, - hoverNode, - setHoverNode, - saveState, - nodes, - properties: properties2, - addNode, - deleteNode, - selectedNodes, - selectNodes, - saveProperty, - newProperty, - selectableNodeBounds, - renameNode, - delProperty, - saveNodes, - ungroupNode, - moveUp, - moveDown, - moveToRank, - moveNodeFromSchema, - groupNodes + const root = createRoot(div); + root.render( + /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement(DayPicker, { + defaultMonth: value, + mode: "single", + selected: value, + labels: { + labelMonthDropdown: () => void 0, + labelYearDropdown: () => void 0, + labelNext: () => void 0, + labelPrevious: () => void 0, + labelDay: () => void 0, + labelWeekday: () => void 0, + labelWeekNumber: () => void 0 + }, + onSelect: setDate + })) + ); + menu.addItem((item) => { + item.setTitle(frag); + }); + const keys = [...menu.scope.keys]; + for (let i4 = 0; i4 < keys.length; i4++) { + if (keys[i4].key != "Escape") { + menu.scope.unregister(keys[i4]); } - }, props2.children); + } + menu.showAtPosition(point); + return menu; +}; + +// src/types/metadata.ts +var fileProps = { + "name": { + label: "File Name", + field: "name", + vType: "text", + type: "fileprop" + }, + "path": { + label: "Path", + field: "path", + vType: "text", + type: "fileprop" + }, + "parent": { + label: "Folder", + field: "parent", + vType: "text", + type: "fileprop" + }, + "sticker": { + label: "Sticker", + field: "sticker", + vType: "text", + type: "fileprop" + }, + "color": { + label: "Color", + field: "color", + vType: "text", + type: "fileprop" + }, + "ctime": { + label: "Created", + field: "ctime", + vType: "date", + type: "fileprop" + }, + "mtime": { + label: "Last Modified", + field: "mtime", + vType: "date", + type: "fileprop" + }, + "extension": { + label: "Extension", + field: "extension", + vType: "text", + type: "fileprop" + }, + "size": { + label: "Size", + field: "size", + vType: "number", + type: "fileprop" + } +}; +var fileMeta = { + "tags": { + label: "Tags", + field: "tags", + vType: "tags-multi", + type: "filemeta" + }, + "inlinks": { + label: "Linked Mentions", + field: "inlinks", + vType: "link-multi", + type: "filemeta" + }, + "outlinks": { + label: "Links", + field: "outlinks", + vType: "link-multi", + type: "filemeta" + } +}; + +// src/utils/contexts/predicate/filterFns/filterFnLabels.ts +var filterFnLabels = { + isEmpty: i18n_default.filterTypes.isEmpty, + isNotEmpty: i18n_default.filterTypes.isNotEmpty, + include: i18n_default.filterTypes.contains, + notInclude: i18n_default.filterTypes.notContains, + is: i18n_default.filterTypes.is, + isNot: i18n_default.filterTypes.isNot, + equal: "=", + isGreatThan: ">", + isLessThan: "<", + isLessThanOrEqual: "\u2264", + isGreatThanOrEqual: "\u2265", + dateBefore: i18n_default.filterTypes.before, + dateAfter: i18n_default.filterTypes.after, + isSameDateAsToday: "today", + isAnyInList: i18n_default.filterTypes.anyOf, + isNoneInList: i18n_default.filterTypes.noneOf, + isTrue: i18n_default.filterTypes.checked, + isFalse: i18n_default.filterTypes.unchecked }; +// src/react/components/SpaceView/Contexts/FilterBar/FilterBar.tsx +var import_obsidian39 = require("obsidian"); + +// src/react/components/UI/Modals/contextEditorModal.tsx +var import_obsidian38 = require("obsidian"); + +// src/react/components/SpaceView/Frames/EditorNodes/FrameNodeView.tsx +var import_classnames4 = __toESM(require_classnames()); + // node_modules/re-resizable/lib/resizer.js var __extends = function() { var extendStatics = function(d5, b4) { @@ -44456,427 +43565,1089 @@ var Resizable = function(_super) { var percent = value / parentSize[key2] * 100; return percent + "%"; } - return getStringSize(_this.state[key2]); - }; - var width = size && typeof size.width !== "undefined" && !this.state.isResizing ? getStringSize(size.width) : getSize("width"); - var height = size && typeof size.height !== "undefined" && !this.state.isResizing ? getStringSize(size.height) : getSize("height"); - return { width, height }; - }, - enumerable: false, - configurable: true - }); - Resizable2.prototype.getParentSize = function() { - if (!this.parentNode) { - if (!this.window) { - return { width: 0, height: 0 }; + return getStringSize(_this.state[key2]); + }; + var width = size && typeof size.width !== "undefined" && !this.state.isResizing ? getStringSize(size.width) : getSize("width"); + var height = size && typeof size.height !== "undefined" && !this.state.isResizing ? getStringSize(size.height) : getSize("height"); + return { width, height }; + }, + enumerable: false, + configurable: true + }); + Resizable2.prototype.getParentSize = function() { + if (!this.parentNode) { + if (!this.window) { + return { width: 0, height: 0 }; + } + return { width: this.window.innerWidth, height: this.window.innerHeight }; + } + var base2 = this.appendBase(); + if (!base2) { + return { width: 0, height: 0 }; + } + var wrapChanged = false; + var wrap = this.parentNode.style.flexWrap; + if (wrap !== "wrap") { + wrapChanged = true; + this.parentNode.style.flexWrap = "wrap"; + } + base2.style.position = "relative"; + base2.style.minWidth = "100%"; + base2.style.minHeight = "100%"; + var size = { + width: base2.offsetWidth, + height: base2.offsetHeight + }; + if (wrapChanged) { + this.parentNode.style.flexWrap = wrap; + } + this.removeBase(base2); + return size; + }; + Resizable2.prototype.bindEvents = function() { + if (this.window) { + this.window.addEventListener("mouseup", this.onMouseUp); + this.window.addEventListener("mousemove", this.onMouseMove); + this.window.addEventListener("mouseleave", this.onMouseUp); + this.window.addEventListener("touchmove", this.onMouseMove, { + capture: true, + passive: false + }); + this.window.addEventListener("touchend", this.onMouseUp); + } + }; + Resizable2.prototype.unbindEvents = function() { + if (this.window) { + this.window.removeEventListener("mouseup", this.onMouseUp); + this.window.removeEventListener("mousemove", this.onMouseMove); + this.window.removeEventListener("mouseleave", this.onMouseUp); + this.window.removeEventListener("touchmove", this.onMouseMove, true); + this.window.removeEventListener("touchend", this.onMouseUp); + } + }; + Resizable2.prototype.componentDidMount = function() { + if (!this.resizable || !this.window) { + return; + } + var computedStyle = this.window.getComputedStyle(this.resizable); + this.setState({ + width: this.state.width || this.size.width, + height: this.state.height || this.size.height, + flexBasis: computedStyle.flexBasis !== "auto" ? computedStyle.flexBasis : void 0 + }); + }; + Resizable2.prototype.componentWillUnmount = function() { + if (this.window) { + this.unbindEvents(); + } + }; + Resizable2.prototype.createSizeForCssProperty = function(newSize, kind) { + var propsSize = this.propsSize && this.propsSize[kind]; + return this.state[kind] === "auto" && this.state.original[kind] === newSize && (typeof propsSize === "undefined" || propsSize === "auto") ? "auto" : newSize; + }; + Resizable2.prototype.calculateNewMaxFromBoundary = function(maxWidth, maxHeight) { + var boundsByDirection = this.props.boundsByDirection; + var direction = this.state.direction; + var widthByDirection = boundsByDirection && hasDirection("left", direction); + var heightByDirection = boundsByDirection && hasDirection("top", direction); + var boundWidth; + var boundHeight; + if (this.props.bounds === "parent") { + var parent_1 = this.parentNode; + if (parent_1) { + boundWidth = widthByDirection ? this.resizableRight - this.parentLeft : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft); + boundHeight = heightByDirection ? this.resizableBottom - this.parentTop : parent_1.offsetHeight + (this.parentTop - this.resizableTop); + } + } else if (this.props.bounds === "window") { + if (this.window) { + boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft; + boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop; + } + } else if (this.props.bounds) { + boundWidth = widthByDirection ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft); + boundHeight = heightByDirection ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop); + } + if (boundWidth && Number.isFinite(boundWidth)) { + maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth; + } + if (boundHeight && Number.isFinite(boundHeight)) { + maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight; + } + return { maxWidth, maxHeight }; + }; + Resizable2.prototype.calculateNewSizeFromDirection = function(clientX, clientY) { + var scale = this.props.scale || 1; + var resizeRatio = this.props.resizeRatio || 1; + var _a2 = this.state, direction = _a2.direction, original = _a2.original; + var _b2 = this.props, lockAspectRatio = _b2.lockAspectRatio, lockAspectRatioExtraHeight = _b2.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b2.lockAspectRatioExtraWidth; + var newWidth = original.width; + var newHeight = original.height; + var extraHeight = lockAspectRatioExtraHeight || 0; + var extraWidth = lockAspectRatioExtraWidth || 0; + if (hasDirection("right", direction)) { + newWidth = original.width + (clientX - original.x) * resizeRatio / scale; + if (lockAspectRatio) { + newHeight = (newWidth - extraWidth) / this.ratio + extraHeight; + } + } + if (hasDirection("left", direction)) { + newWidth = original.width - (clientX - original.x) * resizeRatio / scale; + if (lockAspectRatio) { + newHeight = (newWidth - extraWidth) / this.ratio + extraHeight; + } + } + if (hasDirection("bottom", direction)) { + newHeight = original.height + (clientY - original.y) * resizeRatio / scale; + if (lockAspectRatio) { + newWidth = (newHeight - extraHeight) * this.ratio + extraWidth; + } + } + if (hasDirection("top", direction)) { + newHeight = original.height - (clientY - original.y) * resizeRatio / scale; + if (lockAspectRatio) { + newWidth = (newHeight - extraHeight) * this.ratio + extraWidth; + } + } + return { newWidth, newHeight }; + }; + Resizable2.prototype.calculateNewSizeFromAspectRatio = function(newWidth, newHeight, max3, min3) { + var _a2 = this.props, lockAspectRatio = _a2.lockAspectRatio, lockAspectRatioExtraHeight = _a2.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a2.lockAspectRatioExtraWidth; + var computedMinWidth = typeof min3.width === "undefined" ? 10 : min3.width; + var computedMaxWidth = typeof max3.width === "undefined" || max3.width < 0 ? newWidth : max3.width; + var computedMinHeight = typeof min3.height === "undefined" ? 10 : min3.height; + var computedMaxHeight = typeof max3.height === "undefined" || max3.height < 0 ? newHeight : max3.height; + var extraHeight = lockAspectRatioExtraHeight || 0; + var extraWidth = lockAspectRatioExtraWidth || 0; + if (lockAspectRatio) { + var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth; + var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth; + var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight; + var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight; + var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth); + var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth); + var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight); + var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight); + newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth); + newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight); + } else { + newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth); + newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight); + } + return { newWidth, newHeight }; + }; + Resizable2.prototype.setBoundingClientRect = function() { + if (this.props.bounds === "parent") { + var parent_2 = this.parentNode; + if (parent_2) { + var parentRect = parent_2.getBoundingClientRect(); + this.parentLeft = parentRect.left; + this.parentTop = parentRect.top; + } + } + if (this.props.bounds && typeof this.props.bounds !== "string") { + var targetRect = this.props.bounds.getBoundingClientRect(); + this.targetLeft = targetRect.left; + this.targetTop = targetRect.top; + } + if (this.resizable) { + var _a2 = this.resizable.getBoundingClientRect(), left = _a2.left, top_1 = _a2.top, right = _a2.right, bottom = _a2.bottom; + this.resizableLeft = left; + this.resizableRight = right; + this.resizableTop = top_1; + this.resizableBottom = bottom; + } + }; + Resizable2.prototype.onResizeStart = function(event, direction) { + if (!this.resizable || !this.window) { + return; + } + var clientX = 0; + var clientY = 0; + if (event.nativeEvent && isMouseEvent2(event.nativeEvent)) { + clientX = event.nativeEvent.clientX; + clientY = event.nativeEvent.clientY; + } else if (event.nativeEvent && isTouchEvent2(event.nativeEvent)) { + clientX = event.nativeEvent.touches[0].clientX; + clientY = event.nativeEvent.touches[0].clientY; + } + if (this.props.onResizeStart) { + if (this.resizable) { + var startResize = this.props.onResizeStart(event, direction, this.resizable); + if (startResize === false) { + return; + } + } + } + if (this.props.size) { + if (typeof this.props.size.height !== "undefined" && this.props.size.height !== this.state.height) { + this.setState({ height: this.props.size.height }); + } + if (typeof this.props.size.width !== "undefined" && this.props.size.width !== this.state.width) { + this.setState({ width: this.props.size.width }); + } + } + this.ratio = typeof this.props.lockAspectRatio === "number" ? this.props.lockAspectRatio : this.size.width / this.size.height; + var flexBasis; + var computedStyle = this.window.getComputedStyle(this.resizable); + if (computedStyle.flexBasis !== "auto") { + var parent_3 = this.parentNode; + if (parent_3) { + var dir = this.window.getComputedStyle(parent_3).flexDirection; + this.flexDir = dir.startsWith("row") ? "row" : "column"; + flexBasis = computedStyle.flexBasis; + } + } + this.setBoundingClientRect(); + this.bindEvents(); + var state = { + original: { + x: clientX, + y: clientY, + width: this.size.width, + height: this.size.height + }, + isResizing: true, + backgroundStyle: __assign3(__assign3({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || "auto" }), + direction, + flexBasis + }; + this.setState(state); + }; + Resizable2.prototype.onMouseMove = function(event) { + var _this = this; + if (!this.state.isResizing || !this.resizable || !this.window) { + return; + } + if (this.window.TouchEvent && isTouchEvent2(event)) { + try { + event.preventDefault(); + event.stopPropagation(); + } catch (e4) { + } + } + var _a2 = this.props, maxWidth = _a2.maxWidth, maxHeight = _a2.maxHeight, minWidth = _a2.minWidth, minHeight = _a2.minHeight; + var clientX = isTouchEvent2(event) ? event.touches[0].clientX : event.clientX; + var clientY = isTouchEvent2(event) ? event.touches[0].clientY : event.clientY; + var _b2 = this.state, direction = _b2.direction, original = _b2.original, width = _b2.width, height = _b2.height; + var parentSize = this.getParentSize(); + var max3 = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight); + maxWidth = max3.maxWidth; + maxHeight = max3.maxHeight; + minWidth = max3.minWidth; + minHeight = max3.minHeight; + var _c2 = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c2.newHeight, newWidth = _c2.newWidth; + var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight); + if (this.props.snap && this.props.snap.x) { + newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap); + } + if (this.props.snap && this.props.snap.y) { + newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap); + } + var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight }); + newWidth = newSize.newWidth; + newHeight = newSize.newHeight; + if (this.props.grid) { + var newGridWidth = snap(newWidth, this.props.grid[0]); + var newGridHeight = snap(newHeight, this.props.grid[1]); + var gap = this.props.snapGap || 0; + newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth; + newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight; + } + var delta = { + width: newWidth - original.width, + height: newHeight - original.height + }; + if (width && typeof width === "string") { + if (width.endsWith("%")) { + var percent = newWidth / parentSize.width * 100; + newWidth = percent + "%"; + } else if (width.endsWith("vw")) { + var vw = newWidth / this.window.innerWidth * 100; + newWidth = vw + "vw"; + } else if (width.endsWith("vh")) { + var vh = newWidth / this.window.innerHeight * 100; + newWidth = vh + "vh"; + } + } + if (height && typeof height === "string") { + if (height.endsWith("%")) { + var percent = newHeight / parentSize.height * 100; + newHeight = percent + "%"; + } else if (height.endsWith("vw")) { + var vw = newHeight / this.window.innerWidth * 100; + newHeight = vw + "vw"; + } else if (height.endsWith("vh")) { + var vh = newHeight / this.window.innerHeight * 100; + newHeight = vh + "vh"; + } + } + var newState = { + width: this.createSizeForCssProperty(newWidth, "width"), + height: this.createSizeForCssProperty(newHeight, "height") + }; + if (this.flexDir === "row") { + newState.flexBasis = newState.width; + } else if (this.flexDir === "column") { + newState.flexBasis = newState.height; + } + pn(function() { + _this.setState(newState); + }); + if (this.props.onResize) { + this.props.onResize(event, direction, this.resizable, delta); + } + }; + Resizable2.prototype.onMouseUp = function(event) { + var _a2 = this.state, isResizing = _a2.isResizing, direction = _a2.direction, original = _a2.original; + if (!isResizing || !this.resizable) { + return; + } + var delta = { + width: this.size.width - original.width, + height: this.size.height - original.height + }; + if (this.props.onResizeStop) { + this.props.onResizeStop(event, direction, this.resizable, delta); + } + if (this.props.size) { + this.setState(this.props.size); + } + this.unbindEvents(); + this.setState({ + isResizing: false, + backgroundStyle: __assign3(__assign3({}, this.state.backgroundStyle), { cursor: "auto" }) + }); + }; + Resizable2.prototype.updateSize = function(size) { + this.setState({ width: size.width, height: size.height }); + }; + Resizable2.prototype.renderResizer = function() { + var _this = this; + var _a2 = this.props, enable = _a2.enable, handleStyles = _a2.handleStyles, handleClasses = _a2.handleClasses, handleWrapperStyle = _a2.handleWrapperStyle, handleWrapperClass = _a2.handleWrapperClass, handleComponent = _a2.handleComponent; + if (!enable) { + return null; + } + var resizers = Object.keys(enable).map(function(dir) { + if (enable[dir] !== false) { + return y(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 y("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers); + }; + Resizable2.prototype.render = function() { + var _this = this; + var extendsProps = Object.keys(this.props).reduce(function(acc, key2) { + if (definedProps.indexOf(key2) !== -1) { + return acc; + } + acc[key2] = _this.props[key2]; + return acc; + }, {}); + var style = __assign3(__assign3(__assign3({ position: "relative", userSelect: this.state.isResizing ? "none" : "auto" }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: "border-box", flexShrink: 0 }); + if (this.state.flexBasis) { + style.flexBasis = this.state.flexBasis; + } + var Wrapper = this.props.as || "div"; + return y( + Wrapper, + __assign3({ ref: this.ref, style, className: this.props.className }, extendsProps), + this.state.isResizing && y("div", { style: this.state.backgroundStyle }), + this.props.children, + this.renderResizer() + ); + }; + Resizable2.defaultProps = { + as: "div", + onResizeStart: function() { + }, + onResize: function() { + }, + onResizeStop: function() { + }, + enable: { + top: true, + right: true, + bottom: true, + left: true, + topRight: true, + bottomRight: true, + bottomLeft: true, + topLeft: true + }, + style: {}, + grid: [1, 1], + lockAspectRatio: false, + lockAspectRatioExtraWidth: 0, + lockAspectRatioExtraHeight: 0, + scale: 1, + resizeRatio: 1, + snapGap: 0 + }; + return Resizable2; +}(w3); + +// src/react/context/FrameEditorContext.tsx +var import_lodash8 = __toESM(require_lodash()); +var import_obsidian25 = require("obsidian"); + +// src/utils/frames/frames.ts +var propFieldFromString = (str, schemaProps) => { + return schemaProps.find((f4) => str == `${f4.schemaId}.props.${f4.name}`); +}; +var nameForField = (field) => { + var _a2; + if (!field) + return null; + const parsedValue = parseFieldValue(field.value, field.type); + return (_a2 = parsedValue.alias) != null ? _a2 : field.name; +}; +var stringIsConst = (str) => { + const hasQuotesAtStartEndOnly = /^["'][^"']*["'](?:;)?$/.test(str); + const isNumber = !isNaN(parseFloat(str)) && isFinite(str); + return hasQuotesAtStartEndOnly || isNumber || str == null || str == ""; +}; +var newUniqueNode = (node, parent, otherNodes, schemaId) => { + const id2 = uniqueNameFromString( + node.node.id, + otherNodes.map((f4) => f4.id) + ); + return { + ...node.node, + id: id2, + schemaId, + parentId: parent + }; +}; + +// src/utils/frames/runner.ts +function extractDependencies(code) { + const dependencies = []; + function visit(node, parts = []) { + if (node.type === "Identifier") { + parts.push(node.name); + return parts; + } else if (node.type === "MemberExpression") { + const objectParts = visit(node.object, parts); + if (objectParts && node.computed) { + if (node.property.type === "Literal") { + objectParts.push(String(node.property.value)); + return objectParts; + } else { + return null; + } + } else if (objectParts) { + return visit(node.property, objectParts); } - return { width: this.window.innerWidth, height: this.window.innerHeight }; + } else if (node.type === "Literal") { + parts.push(String(node.value)); + return parts; } - var base2 = this.appendBase(); - if (!base2) { - return { width: 0, height: 0 }; + return null; + } + function explore(node) { + if (node.type === "MemberExpression") { + const parts = visit(node); + if (parts) { + dependencies.push(parts); + } + return; } - var wrapChanged = false; - var wrap = this.parentNode.style.flexWrap; - if (wrap !== "wrap") { - wrapChanged = true; - this.parentNode.style.flexWrap = "wrap"; + for (const key2 in node) { + if (typeof node[key2] === "object" && node[key2] !== null) { + explore(node[key2]); + } } - base2.style.position = "relative"; - base2.style.minWidth = "100%"; - base2.style.minHeight = "100%"; - var size = { - width: base2.offsetWidth, - height: base2.offsetHeight - }; - if (wrapChanged) { - this.parentNode.style.flexWrap = wrap; + } + try { + const ast = parse3(code.replace("return ", ""), { ecmaVersion: 2020 }); + explore(ast); + } catch (e4) { + return []; + } + return dependencies; +} +function sortKeysByDependencies(codeBlockStore, identifier) { + const graph = /* @__PURE__ */ new Map(); + const dependencies = /* @__PURE__ */ new Map(); + const allDependencies = /* @__PURE__ */ new Map(); + for (const key2 in codeBlockStore) { + const code = codeBlockStore[key2]; + const extractedDependencies = extractDependencies(code); + const localDependencies = extractedDependencies.filter((dep) => { + return dep.slice(0, -1).join(".") === identifier; + }); + dependencies.set(key2, localDependencies); + allDependencies.set(key2, extractedDependencies); + if (!graph.has(key2)) { + graph.set(key2, /* @__PURE__ */ new Set()); } - this.removeBase(base2); - return size; - }; - Resizable2.prototype.bindEvents = function() { - if (this.window) { - this.window.addEventListener("mouseup", this.onMouseUp); - this.window.addEventListener("mousemove", this.onMouseMove); - this.window.addEventListener("mouseleave", this.onMouseUp); - this.window.addEventListener("touchmove", this.onMouseMove, { - capture: true, - passive: false - }); - this.window.addEventListener("touchend", this.onMouseUp); + for (const dep of localDependencies) { + const depStr = dep[dep.length - 1]; + if (depStr === key2) + continue; + graph.get(key2).add(depStr); } - }; - Resizable2.prototype.unbindEvents = function() { - if (this.window) { - this.window.removeEventListener("mouseup", this.onMouseUp); - this.window.removeEventListener("mousemove", this.onMouseMove); - this.window.removeEventListener("mouseleave", this.onMouseUp); - this.window.removeEventListener("touchmove", this.onMouseMove, true); - this.window.removeEventListener("touchend", this.onMouseUp); + } + const visited = /* @__PURE__ */ new Set(); + const result = []; + const temp = /* @__PURE__ */ new Set(); + const visit = (key2) => { + if (temp.has(key2)) + throw new Error("Circular dependency detected"); + if (!visited.has(key2)) { + temp.add(key2); + const edges = graph.get(key2) || /* @__PURE__ */ new Set(); + for (const dep of edges) { + visit(dep); + } + visited.add(key2); + temp.delete(key2); + result.push(key2); } }; - Resizable2.prototype.componentDidMount = function() { - if (!this.resizable || !this.window) { - return; + for (const key2 in codeBlockStore) { + if (!visited.has(key2)) { + visit(key2); } - var computedStyle = this.window.getComputedStyle(this.resizable); - this.setState({ - width: this.state.width || this.size.width, - height: this.state.height || this.size.height, - flexBasis: computedStyle.flexBasis !== "auto" ? computedStyle.flexBasis : void 0 - }); - }; - Resizable2.prototype.componentWillUnmount = function() { - if (this.window) { - this.unbindEvents(); + } + return { sortedKeys: result, dependencies: allDependencies }; +} +var executeTreeNode = async (_treeNode, state, api, saveState, root, runID, newState) => { + var _a2, _b2, _c2; + const treeNode = _treeNode; + let execState = await executeNode(treeNode.node, { state, newState }, api); + if (treeNode.node.type == "list") { + let uid = 0; + treeNode.children = parseMultiString(execState.state[treeNode.id].props.value).flatMap((f4, i4) => treeNode.children.map((n2) => { + const [tree, m5] = linkTreeNodes({ ...n2, node: { ...n2.node, props: { ...n2.node.props, value: wrapQuotes(f4) } } }, uid); + uid = m5; + return tree; + })); + } + if (typeof ((_b2 = (_a2 = execState.state[treeNode.id]) == null ? void 0 : _a2.actions) == null ? void 0 : _b2.onRun) == "function") { + (_c2 = execState.state[treeNode.id].actions) == null ? void 0 : _c2.onRun( + execState, + (s5) => { + saveState(s5, { state: execState.state, root, id: runID }); + }, + api + ); + } + for (let i4 = 0; i4 < treeNode.children.length; i4++) { + const [newState2, newNode] = await executeTreeNode(treeNode.children[i4], execState.state, api, saveState, root, runID, execState.newState).then((f4) => [{ state: f4.state, newState: f4.newState }, f4.root]); + execState = newState2; + treeNode.children[i4] = newNode; + } + return { id: runID, root: treeNode, state: execState.state, newState: execState.newState }; +}; +var executeNode = async (node, results, api) => { + const propResults = await executePropsCodeBlocks(node, results, api); + const stylesResults = executeCodeBlocks(node, "styles", propResults); + const actions = executeCodeBlocks(node, "actions", stylesResults); + return actions; +}; +var executePropsCodeBlocks = async (node, results, api) => { + var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k; + const { type, props: props2, id: id2 } = node; + const codeBlockStore = props2 != null ? props2 : {}; + const { sortedKeys, dependencies } = sortKeysByDependencies(codeBlockStore, `${node.id}.props`); + const runKeys = results.newState ? sortedKeys.filter((f4) => { + var _a3, _b3, _c3, _d3, _e3, _f2; + const deps = dependencies.get(f4); + if (f4 in ((_c3 = (_b3 = (_a3 = results.newState) == null ? void 0 : _a3[node.id]) == null ? void 0 : _b3["props"]) != null ? _c3 : {})) { + return true; } - }; - Resizable2.prototype.createSizeForCssProperty = function(newSize, kind) { - var propsSize = this.propsSize && this.propsSize[kind]; - return this.state[kind] === "auto" && this.state.original[kind] === newSize && (typeof propsSize === "undefined" || propsSize === "auto") ? "auto" : newSize; - }; - Resizable2.prototype.calculateNewMaxFromBoundary = function(maxWidth, maxHeight) { - var boundsByDirection = this.props.boundsByDirection; - var direction = this.state.direction; - var widthByDirection = boundsByDirection && hasDirection("left", direction); - var heightByDirection = boundsByDirection && hasDirection("top", direction); - var boundWidth; - var boundHeight; - if (this.props.bounds === "parent") { - var parent_1 = this.parentNode; - if (parent_1) { - boundWidth = widthByDirection ? this.resizableRight - this.parentLeft : parent_1.offsetWidth + (this.parentLeft - this.resizableLeft); - boundHeight = heightByDirection ? this.resizableBottom - this.parentTop : parent_1.offsetHeight + (this.parentTop - this.resizableTop); - } - } else if (this.props.bounds === "window") { - if (this.window) { - boundWidth = widthByDirection ? this.resizableRight : this.window.innerWidth - this.resizableLeft; - boundHeight = heightByDirection ? this.resizableBottom : this.window.innerHeight - this.resizableTop; + for (const dep of deps) { + if (dep[0] == "api") + return true; + if ((_f2 = (_e3 = (_d3 = results.newState) == null ? void 0 : _d3[dep[0]]) == null ? void 0 : _e3[dep[1]]) == null ? void 0 : _f2[dep[2]]) { + return true; } - } else if (this.props.bounds) { - boundWidth = widthByDirection ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft); - boundHeight = heightByDirection ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop); - } - if (boundWidth && Number.isFinite(boundWidth)) { - maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth; - } - if (boundHeight && Number.isFinite(boundHeight)) { - maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight; } - return { maxWidth, maxHeight }; + return false; + }) : sortedKeys.filter((f4) => { + var _a3; + return ((_a3 = codeBlockStore[f4]) == null ? void 0 : _a3.length) > 0; + }); + const environment = results.state; + environment[id2] = { + props: (_b2 = (_a2 = results.state[id2]) == null ? void 0 : _a2.props) != null ? _b2 : {}, + actions: (_d2 = (_c2 = results.state[id2]) == null ? void 0 : _c2.actions) != null ? _d2 : {}, + styles: (_f = (_e2 = results.state[id2]) == null ? void 0 : _e2.styles) != null ? _f : {}, + contexts: (_h = (_g = results.state[id2]) == null ? void 0 : _g.contexts) != null ? _h : {} }; - Resizable2.prototype.calculateNewSizeFromDirection = function(clientX, clientY) { - var scale = this.props.scale || 1; - var resizeRatio = this.props.resizeRatio || 1; - var _a2 = this.state, direction = _a2.direction, original = _a2.original; - var _b2 = this.props, lockAspectRatio = _b2.lockAspectRatio, lockAspectRatioExtraHeight = _b2.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _b2.lockAspectRatioExtraWidth; - var newWidth = original.width; - var newHeight = original.height; - var extraHeight = lockAspectRatioExtraHeight || 0; - var extraWidth = lockAspectRatioExtraWidth || 0; - if (hasDirection("right", direction)) { - newWidth = original.width + (clientX - original.x) * resizeRatio / scale; - if (lockAspectRatio) { - newHeight = (newWidth - extraWidth) / this.ratio + extraHeight; + environment.api = api; + for (const key2 of runKeys) { + try { + let result; + if (key2 in (((_j = (_i = results.newState) == null ? void 0 : _i[node.id]) == null ? void 0 : _j["props"]) || {})) { + result = results.newState[node.id]["props"][key2]; + } else { + const isMultiLine = codeBlockStore[key2].includes("\n"); + const func = isMultiLine ? new Function(`with(this) { ${codeBlockStore[key2]} }`) : new Function(`with(this) { return ${codeBlockStore[key2]}; }`); + result = func.call(environment); + if (result instanceof Promise) { + result = await result; + } } - } - if (hasDirection("left", direction)) { - newWidth = original.width - (clientX - original.x) * resizeRatio / scale; - if (lockAspectRatio) { - newHeight = (newWidth - extraWidth) / this.ratio + extraHeight; + environment[id2]["props"][key2] = result; + results.state[id2]["props"][key2] = result; + if (results.newState) { + results.newState[id2] = (_k = results.newState[id2]) != null ? _k : { props: {}, styles: {}, actions: {}, contexts: {} }; + results.newState[id2]["props"][key2] = result; } + } catch (error) { + console.log(error); } - if (hasDirection("bottom", direction)) { - newHeight = original.height + (clientY - original.y) * resizeRatio / scale; - if (lockAspectRatio) { - newWidth = (newHeight - extraHeight) * this.ratio + extraWidth; - } + } + return results; +}; +function executeCodeBlocks(node, type, results) { + var _a2; + const codeBlockStore = (_a2 = node[type]) != null ? _a2 : {}; + for (const key2 of Object.keys(codeBlockStore)) { + try { + const isMultiLine = typeof codeBlockStore[key2] === "string" || codeBlockStore[key2] instanceof String ? codeBlockStore[key2].includes("\n") : false; + const func = isMultiLine && !(type == "actions") ? new Function(`with(this) { ${codeBlockStore[key2]} }`) : new Function(`with(this) { return ${codeBlockStore[key2]}; }`); + const result = func.call(results.state); + parseKeyResult(results.state[node.id][type], key2, result); + } catch (error) { + console.log(error); } - if (hasDirection("top", direction)) { - newHeight = original.height - (clientY - original.y) * resizeRatio / scale; - if (lockAspectRatio) { - newWidth = (newHeight - extraHeight) * this.ratio + extraWidth; - } + } + return results; +} +var parseKeyResult = (resultStore, key2, result) => { + if (key2 == "layout") { + if (result == "row" || result == "column") { + resultStore["display"] = "flex"; + resultStore["flexDirection"] = result; + return; } - return { newWidth, newHeight }; - }; - Resizable2.prototype.calculateNewSizeFromAspectRatio = function(newWidth, newHeight, max3, min3) { - var _a2 = this.props, lockAspectRatio = _a2.lockAspectRatio, lockAspectRatioExtraHeight = _a2.lockAspectRatioExtraHeight, lockAspectRatioExtraWidth = _a2.lockAspectRatioExtraWidth; - var computedMinWidth = typeof min3.width === "undefined" ? 10 : min3.width; - var computedMaxWidth = typeof max3.width === "undefined" || max3.width < 0 ? newWidth : max3.width; - var computedMinHeight = typeof min3.height === "undefined" ? 10 : min3.height; - var computedMaxHeight = typeof max3.height === "undefined" || max3.height < 0 ? newHeight : max3.height; - var extraHeight = lockAspectRatioExtraHeight || 0; - var extraWidth = lockAspectRatioExtraWidth || 0; - if (lockAspectRatio) { - var extraMinWidth = (computedMinHeight - extraHeight) * this.ratio + extraWidth; - var extraMaxWidth = (computedMaxHeight - extraHeight) * this.ratio + extraWidth; - var extraMinHeight = (computedMinWidth - extraWidth) / this.ratio + extraHeight; - var extraMaxHeight = (computedMaxWidth - extraWidth) / this.ratio + extraHeight; - var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth); - var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth); - var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight); - var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight); - newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth); - newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight); - } else { - newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth); - newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight); + resultStore["display"] = result; + return; + } + resultStore[key2] = result; +}; + +// src/react/context/FrameEditorContext.tsx +var FramesEditorContext = F({ + root: null, + runRoot: () => null, + instance: { state: {}, id: null, root: null }, + saveState: () => null, + fastSaveState: () => null, + nodes: [], + properties: [], + dragNode: null, + setDragNode: () => null, + hoverNode: null, + selectableNodeBounds: null, + setHoverNode: () => null, + selectedNodes: [], + selectNodes: () => null, + saveProperty: () => false, + newProperty: () => false, + delProperty: () => null, + groupNodes: () => null, + ungroupNode: () => null, + renameNode: () => null, + addNode: () => null, + deleteNode: () => null, + saveNodes: () => null, + moveUp: () => null, + moveDown: () => null, + moveToRank: () => null, + moveNodeFromSchema: () => null +}); +var FramesEditorProvider = (props2) => { + var _a2; + const { spaceInfo } = q2(SpaceContext); + const editorProps = { editMode: props2.editMode }; + const { + frameSchema, + setFrameSchema: setDBSchema, + saveFrame, + frameSchemas: schemas, + tableData, + getMDBData + } = q2(FramesMDBContext); + const [hoverNode, setHoverNode] = h2(null); + const [dragNode, setDragNode] = h2(null); + const [selectedNodes, setSelectedNodes] = h2([]); + const nodes = F2(() => { + var _a3; + if (!frameSchema) + return []; + const frames2 = (_a3 = tableData == null ? void 0 : tableData.rows.map( + (f4) => f4.id == frameSchema.id ? { + ...frameToNode(f4), + types: tableData.cols.reduce( + (p3, c4) => ({ ...p3, [c4.name]: c4.type }), + {} + ), + propsValue: tableData.cols.reduce( + (p3, c4) => ({ ...p3, [c4.name]: c4.value }), + {} + ) + } : frameToNode(f4) + )) != null ? _a3 : []; + const _root = schemaToRoot(frameSchema); + if (frames2.some((f4) => f4.id == _root.id)) { + return frames2; } - return { newWidth, newHeight }; + return [...frames2, _root]; + }, [tableData, frameSchema]); + const [root, setRoot] = h2(null); + const [instance, setInstance] = h2({ + state: {}, + id: null, + root: null + }); + const activeRunID = _2(null); + const saveState = (newState, instance2) => { + const { root: _root, id: runID, state } = instance2; + if (activeRunID.current != runID) + return; + executeTreeNode( + applyPropsToRoot(_root, props2.props), + state, + props2.plugin.index.api, + saveState, + _root, + runID, + newState + ).then( + (s5) => setInstance((p3) => { + return s5; + }) + ); }; - Resizable2.prototype.setBoundingClientRect = function() { - if (this.props.bounds === "parent") { - var parent_2 = this.parentNode; - if (parent_2) { - var parentRect = parent_2.getBoundingClientRect(); - this.parentLeft = parentRect.left; - this.parentTop = parentRect.top; + const selectableNodeBounds = _2({}); + const fastSaveState = (newState) => { + setInstance((p3) => { + return { ...p3, state: newState }; + }); + }; + p2( + () => () => { + activeRunID.current = null; + }, + [] + ); + const runRoot = () => { + var _a3; + if ((frameSchema == null ? void 0 : frameSchema.type) == "frame" || (frameSchema == null ? void 0 : frameSchema.type) == "listitem") { + const _newRoot = buildRoot( + frameSchema, + (_a3 = tableData == null ? void 0 : tableData.cols) != null ? _a3 : [], + nodes, + props2.plugin, + editorProps + ); + setRoot(_newRoot); + if (_newRoot) { + const newRoot = import_lodash8.default.cloneDeep(_newRoot); + const runID = (0, import_lodash8.uniqueId)(); + activeRunID.current = runID; + executeTreeNode( + applyPropsToRoot(newRoot, props2.props), + {}, + props2.plugin.index.api, + saveState, + newRoot, + runID + ).then((s5) => { + setInstance((p3) => { + return s5; + }); + activeRunID.current = s5.id; + }); + if (selectedNodes.length == 0) { + } else { + setSelectedNodes( + nodes.filter((f4) => selectedNodes.find((g4) => g4.id == f4.id)) + ); + } } } - if (this.props.bounds && typeof this.props.bounds !== "string") { - var targetRect = this.props.bounds.getBoundingClientRect(); - this.targetLeft = targetRect.left; - this.targetTop = targetRect.top; - } - if (this.resizable) { - var _a2 = this.resizable.getBoundingClientRect(), left = _a2.left, top_1 = _a2.top, right = _a2.right, bottom = _a2.bottom; - this.resizableLeft = left; - this.resizableRight = right; - this.resizableTop = top_1; - this.resizableBottom = bottom; + }; + const refreshFrame = (e4) => { + if (e4.detail.type == "frames" && e4.detail.name == spaceInfo.path) { + runRoot(); } }; - Resizable2.prototype.onResizeStart = function(event, direction) { - if (!this.resizable || !this.window) { + p2(() => { + window.addEventListener(eventTypes.spacesChange, refreshFrame); + return () => { + window.removeEventListener(eventTypes.spacesChange, refreshFrame); + }; + }, [spaceInfo]); + p2(() => { + runRoot(); + }, [frameSchema, nodes, tableData, props2.props]); + const moveUp = (node) => { + const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank).map((f4, i4) => ({ ...f4, rank: i4 })); + const itemIndex = items.findIndex((item2) => item2.id === node.id); + if (itemIndex <= 0) { + saveNodes(items); return; } - var clientX = 0; - var clientY = 0; - if (event.nativeEvent && isMouseEvent2(event.nativeEvent)) { - clientX = event.nativeEvent.clientX; - clientY = event.nativeEvent.clientY; - } else if (event.nativeEvent && isTouchEvent2(event.nativeEvent)) { - clientX = event.nativeEvent.touches[0].clientX; - clientY = event.nativeEvent.touches[0].clientY; - } - if (this.props.onResizeStart) { - if (this.resizable) { - var startResize = this.props.onResizeStart(event, direction, this.resizable); - if (startResize === false) { - return; - } - } - } - if (this.props.size) { - if (typeof this.props.size.height !== "undefined" && this.props.size.height !== this.state.height) { - this.setState({ height: this.props.size.height }); - } - if (typeof this.props.size.width !== "undefined" && this.props.size.width !== this.state.width) { - this.setState({ width: this.props.size.width }); - } - } - this.ratio = typeof this.props.lockAspectRatio === "number" ? this.props.lockAspectRatio : this.size.width / this.size.height; - var flexBasis; - var computedStyle = this.window.getComputedStyle(this.resizable); - if (computedStyle.flexBasis !== "auto") { - var parent_3 = this.parentNode; - if (parent_3) { - var dir = this.window.getComputedStyle(parent_3).flexDirection; - this.flexDir = dir.startsWith("row") ? "row" : "column"; - flexBasis = computedStyle.flexBasis; - } - } - this.setBoundingClientRect(); - this.bindEvents(); - var state = { - original: { - x: clientX, - y: clientY, - width: this.size.width, - height: this.size.height - }, - isResizing: true, - backgroundStyle: __assign3(__assign3({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(event.target).cursor || "auto" }), - direction, - flexBasis - }; - this.setState(state); + const item = items[itemIndex]; + const swappedItem = items[itemIndex - 1]; + [item.rank, swappedItem.rank] = [swappedItem.rank, item.rank]; + saveNodes(items); }; - Resizable2.prototype.onMouseMove = function(event) { - var _this = this; - if (!this.state.isResizing || !this.resizable || !this.window) { + const moveDown = (node) => { + const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank).map((f4, i4) => ({ ...f4, rank: i4 })); + const itemIndex = items.findIndex((item2) => item2.id === node.id); + if (itemIndex < 0 || itemIndex >= items.length - 1) { + saveNodes(items); return; } - if (this.window.TouchEvent && isTouchEvent2(event)) { - try { - event.preventDefault(); - event.stopPropagation(); - } catch (e4) { - } - } - var _a2 = this.props, maxWidth = _a2.maxWidth, maxHeight = _a2.maxHeight, minWidth = _a2.minWidth, minHeight = _a2.minHeight; - var clientX = isTouchEvent2(event) ? event.touches[0].clientX : event.clientX; - var clientY = isTouchEvent2(event) ? event.touches[0].clientY : event.clientY; - var _b2 = this.state, direction = _b2.direction, original = _b2.original, width = _b2.width, height = _b2.height; - var parentSize = this.getParentSize(); - var max3 = calculateNewMax(parentSize, this.window.innerWidth, this.window.innerHeight, maxWidth, maxHeight, minWidth, minHeight); - maxWidth = max3.maxWidth; - maxHeight = max3.maxHeight; - minWidth = max3.minWidth; - minHeight = max3.minHeight; - var _c2 = this.calculateNewSizeFromDirection(clientX, clientY), newHeight = _c2.newHeight, newWidth = _c2.newWidth; - var boundaryMax = this.calculateNewMaxFromBoundary(maxWidth, maxHeight); - if (this.props.snap && this.props.snap.x) { - newWidth = findClosestSnap(newWidth, this.props.snap.x, this.props.snapGap); - } - if (this.props.snap && this.props.snap.y) { - newHeight = findClosestSnap(newHeight, this.props.snap.y, this.props.snapGap); - } - var newSize = this.calculateNewSizeFromAspectRatio(newWidth, newHeight, { width: boundaryMax.maxWidth, height: boundaryMax.maxHeight }, { width: minWidth, height: minHeight }); - newWidth = newSize.newWidth; - newHeight = newSize.newHeight; - if (this.props.grid) { - var newGridWidth = snap(newWidth, this.props.grid[0]); - var newGridHeight = snap(newHeight, this.props.grid[1]); - var gap = this.props.snapGap || 0; - newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth; - newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight; - } - var delta = { - width: newWidth - original.width, - height: newHeight - original.height - }; - if (width && typeof width === "string") { - if (width.endsWith("%")) { - var percent = newWidth / parentSize.width * 100; - newWidth = percent + "%"; - } else if (width.endsWith("vw")) { - var vw = newWidth / this.window.innerWidth * 100; - newWidth = vw + "vw"; - } else if (width.endsWith("vh")) { - var vh = newWidth / this.window.innerHeight * 100; - newWidth = vh + "vh"; - } - } - if (height && typeof height === "string") { - if (height.endsWith("%")) { - var percent = newHeight / parentSize.height * 100; - newHeight = percent + "%"; - } else if (height.endsWith("vw")) { - var vw = newHeight / this.window.innerWidth * 100; - newHeight = vw + "vw"; - } else if (height.endsWith("vh")) { - var vh = newHeight / this.window.innerHeight * 100; - newHeight = vh + "vh"; - } + const item = items[itemIndex]; + const swappedItem = items[itemIndex + 1]; + [item.rank, swappedItem.rank] = [swappedItem.rank, item.rank]; + saveNodes(items.sort((a5, b4) => a5.rank - b4.rank)); + }; + const ungroupNode = (node) => { + const children = nodes.filter((f4) => f4.parentId == node.id); + const newRank = node.rank; + const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank); + const newItems = insertMulti( + items, + newRank, + children.map((f4) => ({ ...f4, parentId: node.parentId })) + ).filter((f4) => f4.id != node.id).map((f4, i4) => ({ ...f4, rank: i4 })); + return saveNodes(newItems, [node]); + }; + const moveToRank = (node, newRank) => { + const items = nodes.filter((f4) => f4.parentId == node.parentId).sort((a5, b4) => a5.rank - b4.rank).map((f4, i4) => ({ ...f4, rank: i4 })); + const itemIndex = items.findIndex((item2) => item2.id === node.id); + if (itemIndex < 0 || newRank < 0 || newRank >= items.length) { + saveNodes(items); + return; } - var newState = { - width: this.createSizeForCssProperty(newWidth, "width"), - height: this.createSizeForCssProperty(newHeight, "height") + const item = items[itemIndex]; + item.rank = newRank; + const newItems = arrayMove(items, itemIndex, newRank).map((f4, i4) => ({ + ...f4, + rank: i4 + })); + saveNodes(newItems); + }; + const groupNodes = (treeNodes, style) => { + const parentId = treeNodes[0].id == frameSchema.id ? "" : treeNodes[0].parentId; + const group = { + ...newUniqueNode(groupNode, parentId, nodes, frameSchema.id) }; - if (this.flexDir === "row") { - newState.flexBasis = newState.width; - } else if (this.flexDir === "column") { - newState.flexBasis = newState.height; - } - pn(function() { - _this.setState(newState); + const newNodes = treeNodes.map((f4) => { + const node = import_lodash8.default.cloneDeep(f4); + node.parentId = group.id; + return node; }); - if (this.props.onResize) { - this.props.onResize(event, direction, this.resizable, delta); + saveNodes([ + { ...group, styles: { ...group.styles, ...style } }, + ...newNodes + ]); + }; + const addNode = (treeNode, target) => { + const id2 = uniqueNameFromString( + treeNode.id, + nodes.map((f4) => f4.id) + ); + let parent = target ? target : selectedNodes.length > 0 ? selectedNodes[0] : root.node; + let rank = target ? target.rank + 1 : parent.rank; + if (!groupableTypes.some((f4) => parent.type == f4)) { + parent = findParent(root, parent.id).node; + } else { + rank = nodes.filter((f4) => f4.parentId == parent.id).length; } + const newTreeNode = { + ...treeNode, + id: id2, + schemaId: frameSchema.id, + parentId: parent.id + }; + const newNodes = insert( + nodes.filter((f4) => f4.parentId == parent.id).sort((a5, b4) => a5.rank - b4.rank), + rank, + newTreeNode + ).map((f4, i4) => ({ ...f4, rank: i4 })); + saveNodes(newNodes).then((f4) => selectNodes([newTreeNode])); }; - Resizable2.prototype.onMouseUp = function(event) { - var _a2 = this.state, isResizing = _a2.isResizing, direction = _a2.direction, original = _a2.original; - if (!isResizing || !this.resizable) { + const saveNodes = async (treeNodes, deleteNodes) => { + var _a3, _b2, _c2; + if (!tableData) { return; } - var delta = { - width: this.size.width - original.width, - height: this.size.height - original.height + const newRows = ((_a3 = tableData == null ? void 0 : tableData.rows) == null ? void 0 : _a3.some((f4) => f4.id == root.id)) ? tableData.rows : [...(_b2 = tableData == null ? void 0 : tableData.rows) != null ? _b2 : [], nodeToFrame(root.node)]; + const insertRows = treeNodes.filter((f4) => !newRows.some((g4) => g4.id == f4.id)).map((f4) => nodeToFrame(f4)); + const modRows = treeNodes.filter((f4) => newRows.some((g4) => g4.id == f4.id)).map((f4) => nodeToFrame(f4)); + const newTable = { + ...tableData, + cols: (_c2 = tableData.cols) != null ? _c2 : [], + rows: [ + ...newRows.map((f4) => { + var _a4; + return (_a4 = modRows.find((g4) => g4.id == f4.id)) != null ? _a4 : f4; + }), + ...insertRows + ].filter( + (f4) => deleteNodes ? !deleteNodes.some((g4) => g4.id == f4.id) : f4 + ) }; - if (this.props.onResizeStop) { - this.props.onResizeStop(event, direction, this.resizable, delta); - } - if (this.props.size) { - this.setState(this.props.size); - } - this.unbindEvents(); - this.setState({ - isResizing: false, - backgroundStyle: __assign3(__assign3({}, this.state.backgroundStyle), { cursor: "auto" }) - }); - }; - Resizable2.prototype.updateSize = function(size) { - this.setState({ width: size.width, height: size.height }); + await saveFrame(newTable); }; - Resizable2.prototype.renderResizer = function() { - var _this = this; - var _a2 = this.props, enable = _a2.enable, handleStyles = _a2.handleStyles, handleClasses = _a2.handleClasses, handleWrapperStyle = _a2.handleWrapperStyle, handleWrapperClass = _a2.handleWrapperClass, handleComponent = _a2.handleComponent; - if (!enable) { - return null; - } - var resizers = Object.keys(enable).map(function(dir) { - if (enable[dir] !== false) { - return y(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null); - } - return null; + const moveNodeFromSchema = async (nodeId, schemaId, newParentId, styles2) => { + const oldTable = await getMDBData(); + if (!oldTable[schemaId]) + return; + const tableNodes = oldTable[schemaId].rows.map( + (g4) => frameToNode(g4) + ); + const oldSchema = schemas.find((f4) => f4.id == schemaId); + const treeNode = tableNodes.find((f4) => f4.id == nodeId); + if (!oldSchema || !treeNode) + return; + const tree = buildFrameTree( + treeNode, + tableNodes, + props2.plugin, + 0, + false, + editorProps + )[0]; + const deleteNodes = flattenToFrameNodes(tree); + const newTreeNodes = deleteNodes.map((f4) => ({ + ...f4, + schemaId: frameSchema.id, + styles: f4.id == nodeId && styles2 ? { + ...f4.styles, + ...styles2 + } : f4.styles, + parentId: f4.id == nodeId ? newParentId : f4.parentId + })); + await saveFrame({ + ...oldTable[frameSchema.id], + rows: oldTable[frameSchema.id].rows.filter( + (f4) => !deleteNodes.some((g4) => f4.schemaId == g4.schemaId && f4.id == g4.id) + ) + }); + await saveFrame({ + ...tableData, + rows: [ + ...tableData.rows, + ...newTreeNodes.map((f4) => nodeToFrame(f4)) + ] }); - return y("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers); }; - Resizable2.prototype.render = function() { - var _this = this; - var extendsProps = Object.keys(this.props).reduce(function(acc, key2) { - if (definedProps.indexOf(key2) !== -1) { - return acc; + const deleteNode = (treeNode) => { + const tree = buildFrameTree( + treeNode, + nodes, + props2.plugin, + 0, + false, + editorProps + )[0]; + const parent = findParent(root, treeNode.id); + const deleteNodes = flattenToFrameNodes(tree); + if (parent) { + if (parent.children.length == 1 && parent.node.type == "column") + deleteNodes.push(parent.node); + const grandParent = findParent(root, parent.id); + if ((grandParent == null ? void 0 : grandParent.children.length) == 1 && grandParent.node.type == "container") { + deleteNodes.push(grandParent.node); } - acc[key2] = _this.props[key2]; - return acc; - }, {}); - var style = __assign3(__assign3(__assign3({ position: "relative", userSelect: this.state.isResizing ? "none" : "auto" }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: "border-box", flexShrink: 0 }); - if (this.state.flexBasis) { - style.flexBasis = this.state.flexBasis; } - var Wrapper = this.props.as || "div"; - return y( - Wrapper, - __assign3({ ref: this.ref, style, className: this.props.className }, extendsProps), - this.state.isResizing && y("div", { style: this.state.backgroundStyle }), - this.props.children, - this.renderResizer() + saveFrame({ + ...tableData, + rows: tableData.rows.filter( + (f4) => !deleteNodes.some((g4) => f4.schemaId == g4.schemaId && f4.id == g4.id) + ) + }); + }; + const properties2 = (_a2 = tableData == null ? void 0 : tableData.cols) != null ? _a2 : []; + const selectNodes = (frames2) => { + setSelectedNodes(frames2); + }; + const delProperty = (column) => { + const mdbtable = tableData; + const newFields = mdbtable.cols.filter( + (f4, i4) => f4.name != column.name ); + const newTable = { + ...mdbtable, + cols: newFields != null ? newFields : [] + }; + saveFrame(newTable); }; - Resizable2.defaultProps = { - as: "div", - onResizeStart: function() { - }, - onResize: function() { - }, - onResizeStop: function() { - }, - enable: { - top: true, - right: true, - bottom: true, - left: true, - topRight: true, - bottomRight: true, - bottomLeft: true, - topLeft: true - }, - style: {}, - grid: [1, 1], - lockAspectRatio: false, - lockAspectRatioExtraWidth: 0, - lockAspectRatioExtraHeight: 0, - scale: 1, - resizeRatio: 1, - snapGap: 0 + const newProperty = (col) => { + return saveProperty(col); }; - return Resizable2; -}(w3); + const renameNode = (node, newName) => { + }; + const saveProperty = (newColumn, oldColumn) => { + const column = { + ...newColumn, + name: sanitizeColumnName(newColumn.name) + }; + const mdbtable = tableData; + if (column.name == "") { + new import_obsidian25.Notice(i18n_default.notice.noPropertyName); + return false; + } + if (!oldColumn && mdbtable.cols.find( + (f4) => f4.name.toLowerCase() == column.name.toLowerCase() + ) || oldColumn && oldColumn.name != column.name && mdbtable.cols.find( + (f4) => f4.name.toLowerCase() == column.name.toLowerCase() + )) { + new import_obsidian25.Notice(i18n_default.notice.duplicatePropertyName); + return false; + } + const oldFieldIndex = oldColumn ? mdbtable.cols.findIndex((f4) => f4.name == oldColumn.name) : -1; + const newFields = oldFieldIndex == -1 ? [...mdbtable.cols, column] : mdbtable.cols.map((f4, i4) => i4 == oldFieldIndex ? column : f4); + const newTable = { + ...mdbtable, + cols: newFields != null ? newFields : [] + }; + saveFrame(newTable); + return true; + }; + return /* @__PURE__ */ Cn.createElement(FramesEditorContext.Provider, { + value: { + root, + runRoot, + instance, + dragNode, + fastSaveState, + setDragNode, + hoverNode, + setHoverNode, + saveState, + nodes, + properties: properties2, + addNode, + deleteNode, + selectedNodes, + selectNodes, + saveProperty, + newProperty, + selectableNodeBounds, + renameNode, + delProperty, + saveNodes, + ungroupNode, + moveUp, + moveDown, + moveToRank, + moveNodeFromSchema, + groupNodes + } + }, props2.children); +}; // src/utils/contexts/mdtable.ts var createTable = (object, columns) => { @@ -44903,7 +44674,7 @@ var createInlineTable = async (plugin, path) => { return "Table"; }; -// src/components/UI/menus/newFrameMenu.tsx +// src/react/components/UI/Menus/newFrameMenu.tsx var showNewFrameMenu = (e4, plugin, space, addNode) => { const offset2 = e4.target.getBoundingClientRect(); const kits = plugin.settings.quickFrames.flatMap((s5) => { @@ -45042,7 +44813,7 @@ var showNewFrameMenu = (e4, plugin, space, addNode) => { ); }; -// src/components/SpaceView/Frames/FrameHoverMenu/FrameHoverMenu.tsx +// src/react/components/SpaceView/Frames/FrameHoverMenu/FrameHoverMenu.tsx var FrameHoverMenu = (props2) => { var _a2, _b2; const { spaceInfo } = q2(SpaceContext); @@ -45081,7 +44852,7 @@ var FrameHoverMenu = (props2) => { })))); }; -// src/components/SpaceView/Frames/FrameHoverMenu/HoverMultiMenu.tsx +// src/react/components/SpaceView/Frames/FrameHoverMenu/HoverMultiMenu.tsx var HoverMultiMenu = (props2) => { const { selectedNodes, groupNodes, selectNodes, saveNodes } = q2(FramesEditorContext); const showSelectNodeMenu = (e4) => { @@ -45130,7 +44901,41 @@ var HoverMultiMenu = (props2) => { })); }; -// src/components/UI/modals/imageModal.tsx +// src/react/components/SpaceView/Frames/FrameHoverMenu/HoverPropsMenu.tsx +var import_obsidian27 = require("obsidian"); + +// src/react/components/UI/Menus/spaceMenu.tsx +var showSpacesMenu = (e4, plugin, saveLink, includeDefaults, canAdd) => { + const offset2 = e4.target.getBoundingClientRect(); + const options = [...plugin.index.allSpaces(true)].filter((f4) => includeDefaults || f4.type != "default").map((f4) => ({ + name: f4.name, + value: f4.path, + icon: f4.sticker, + section: f4.type == "tag" ? "Tag" : f4.type == "folder" ? "Folder" : "", + description: f4.type == "tag" ? f4.name : f4.type == "folder" ? f4.path : f4.name + })); + showSelectMenu( + { x: offset2.left, y: offset2.top + 30 }, + { + plugin, + multi: false, + editable: canAdd, + value: [], + options, + sections: ["Tag", "Folder"], + saveOptions: (_12, value) => { + saveLink(value[0], !options.some((f4) => f4.value == value[0])); + }, + placeholder: i18n_default.labels.spaceSelectPlaceholder, + detail: true, + searchable: true, + showSections: true, + showAll: true + } + ); +}; + +// src/react/components/UI/Modals/imageModal.tsx var import_obsidian26 = require("obsidian"); var imageModal = class extends import_obsidian26.FuzzySuggestModal { constructor(plugin, app2, selectImage) { @@ -45188,9 +44993,6 @@ var imageModal = class extends import_obsidian26.FuzzySuggestModal { } }; -// src/components/SpaceView/Frames/FrameHoverMenu/HoverPropsMenu.tsx -var import_obsidian27 = require("obsidian"); - // src/utils/fonts.ts function listFonts() { const { fonts } = document; @@ -45208,7 +45010,7 @@ function listFonts() { return Array.from(new Set(arr)); } -// src/components/SpaceView/Frames/FrameHoverMenu/HoverPropsMenu.tsx +// src/react/components/SpaceView/Frames/FrameHoverMenu/HoverPropsMenu.tsx var HoverPropsMenu = (props2) => { var _a2; const { deleteFrame, duplicateFrame, fields, saveStyleValue } = props2; @@ -45674,7 +45476,7 @@ var HoverPropsMenu = (props2) => { })) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); }; -// src/components/SpaceView/Frames/Placeholders/ColumnPlaceholder.tsx +// src/react/components/SpaceView/Frames/Placeholders/ColumnPlaceholder.tsx var FrameEditorDropZone = (props2) => { const { frameSchema } = q2(FramesMDBContext); const { setNodeRef } = useDroppable({ @@ -45700,7 +45502,7 @@ var FrameEditorDropZone = (props2) => { })); }; -// src/components/SpaceView/Frames/Placeholders/RowPlaceholder.tsx +// src/react/components/SpaceView/Frames/Placeholders/RowPlaceholder.tsx var RowPlaceholder = (props2) => { const { hoverNode, root, deleteNode, nodes } = q2(FramesEditorContext); const { setNodeRef } = useDroppable({ @@ -45787,16 +45589,16 @@ var RowPlaceholder = (props2) => { })); }; -// src/components/SpaceView/Editor/FlowView.tsx +// src/react/components/SpaceView/Editor/FlowView.tsx var import_obsidian35 = require("obsidian"); // src/utils/flow/flowEditor.ts var import_state5 = require("@codemirror/state"); -// src/cm-extensions/flowEditor/atomic.ts +// src/codemirror/extensions/flowEditor/atomic.ts var import_state4 = require("@codemirror/state"); -// src/cm-extensions/flowEditor/selectiveEditor.ts +// src/codemirror/extensions/flowEditor/selectiveEditor.ts var import_state3 = require("@codemirror/state"); var import_view3 = require("@codemirror/view"); @@ -45834,7 +45636,7 @@ var { __classPrivateFieldIn } = import_tslib.default; -// src/cm-extensions/flowEditor/selectiveEditor.ts +// src/codemirror/extensions/flowEditor/selectiveEditor.ts var combinedRangeFacets = (rangeA, rangeB) => { const startRange = !(rangeA == null ? void 0 : rangeA[0]) ? rangeB[0] : !(rangeB == null ? void 0 : rangeB[0]) ? rangeA[0] : Math.max(rangeA == null ? void 0 : rangeA[0], rangeB == null ? void 0 : rangeB[0]); const endRange = !(rangeA == null ? void 0 : rangeA[1]) ? rangeB[1] : !(rangeB == null ? void 0 : rangeB[1]) ? rangeA[1] : Math.min(rangeA == null ? void 0 : rangeA[1], rangeB == null ? void 0 : rangeB[1]); @@ -46017,7 +45819,7 @@ var editBlockExtensions = () => [ frontmatterFacet ]; -// src/cm-extensions/flowEditor/atomic.ts +// src/codemirror/extensions/flowEditor/atomic.ts var arrowKeyAnnotation = import_state4.Annotation.define(); var atomicSelect = import_state4.EditorState.transactionFilter.of( (tr) => { @@ -46059,13 +45861,16 @@ var atomicSelect = import_state4.EditorState.transactionFilter.of( } ); -// src/components/SpaceView/Editor/EmbedView/EmbedContextView.tsx +// src/utils/flow/flowEditor.ts +var import_obsidian34 = require("obsidian"); + +// src/react/components/SpaceView/Editor/EmbedView/EmbedContextView.tsx var import_obsidian32 = require("obsidian"); -// src/components/SpaceView/Frames/ViewNodes/FrameRoot.tsx +// src/react/components/SpaceView/Frames/ViewNodes/FrameRoot.tsx var import_lodash9 = __toESM(require_lodash()); -// src/components/SpaceView/Frames/EditorNodes/IconNodeView.tsx +// src/react/components/SpaceView/Frames/EditorNodes/IconNodeView.tsx var IconNodeView = (props2) => { var _a2, _b2, _c2; const { saveNodes } = q2(FramesEditorContext); @@ -46091,7 +45896,7 @@ var IconNodeView = (props2) => { }, "Select Icon") : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); }; -// src/components/SpaceView/Frames/EditorNodes/ImageNodeView.tsx +// src/react/components/SpaceView/Frames/EditorNodes/ImageNodeView.tsx var ImageNodeView = (props2) => { var _a2, _b2; const value = props2.instance.state[props2.treeNode.id].props.value; @@ -46109,7 +45914,7 @@ var ImageNodeView = (props2) => { }); }; -// src/components/SpaceView/Frames/EditorNodes/SpaceNodeView.tsx +// src/react/components/SpaceView/Frames/EditorNodes/SpaceNodeView.tsx function parseContent(input) { const regex1 = /!\[!\[(.*?)\]\]/; const regex2 = /!!\[\[(.*?)\]\]/; @@ -46147,7 +45952,7 @@ var SpaceNodeView = (props2) => { }, "Select Space"); }; -// src/components/SpaceView/Frames/EditorNodes/TextNodeView.tsx +// src/react/components/SpaceView/Frames/EditorNodes/TextNodeView.tsx var TextNodeView = (props2) => { var _a2, _b2; const fileNameRef = _2(null); @@ -46208,7 +46013,7 @@ var TextNodeView = (props2) => { }); }; -// src/components/SpaceView/Frames/ViewNodes/FrameView.tsx +// src/react/components/SpaceView/Frames/ViewNodes/FrameView.tsx var FrameView = (props2) => { var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i; const innerComponents = props2.treeNode.node.type == "text" ? /* @__PURE__ */ Cn.createElement(TextNodeView, { @@ -46273,7 +46078,7 @@ var FrameView = (props2) => { ); }; -// src/components/SpaceView/Frames/ViewNodes/FrameRoot.tsx +// src/react/components/SpaceView/Frames/ViewNodes/FrameRoot.tsx var FrameRootView = (props2) => { const [instance, setInstance] = h2({ state: {}, @@ -46337,7 +46142,7 @@ var FrameRootView = (props2) => { }); }; -// src/components/SpaceView/Contexts/CardsView/CardsView.tsx +// src/react/components/SpaceView/Contexts/CardsView/CardsView.tsx var import_classnames3 = __toESM(require_classnames()); // src/utils/ui/selection.ts @@ -46364,7 +46169,7 @@ var selectRange = (currSel, newSel, array) => { return array.filter((f4, i4) => i4 < lastIndex && i4 >= newIndex); }; -// src/components/SpaceView/Contexts/CardsView/CardColumnView.tsx +// src/react/components/SpaceView/Contexts/CardsView/CardColumnView.tsx var import_classnames = __toESM(require_classnames()); // node_modules/@tanstack/table-core/build/lib/index.mjs @@ -49200,7 +49005,7 @@ function useReactTable(options) { return tableRef.current; } -// src/components/SpaceView/Contexts/DataTypeView/OptionCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/OptionCell.tsx var import_lodash10 = __toESM(require_lodash()); var OptionCell = (props2) => { var _a2, _b2, _c2; @@ -49355,7 +49160,7 @@ var OptionCellBase = (props2) => { }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); }; -// src/components/SpaceView/Contexts/DataTypeView/ContextCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/ContextCell.tsx var ContextCell = (props2) => { var _a2, _b2, _c2; const stringValueToLink = (strings) => strings.map((f4) => { @@ -49494,7 +49299,7 @@ var formatDate = (plugin, date, dateFormat) => { return dateString; }; -// src/components/SpaceView/Contexts/DataTypeView/DateCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/DateCell.tsx var DateCell = (props2) => { const [value, setValue] = h2(props2.initialValue); p2(() => { @@ -49567,7 +49372,7 @@ var DateCell = (props2) => { }, date ? formatDate(props2.plugin, date, (format2 == null ? void 0 : format2.length) > 0 ? format2 : null) : value)); }; -// src/components/SpaceView/Contexts/DataTypeView/FileCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/FileCell.tsx var import_obsidian28 = require("obsidian"); var FileCell = (props2) => { const fileOrCleanPath = (f4) => { @@ -49707,7 +49512,7 @@ var FileCell = (props2) => { })); }; -// src/components/SpaceView/Contexts/DataTypeView/FilePropertyCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/FilePropertyCell.tsx var humanFileSize = (bytes, si = false, dp = 1) => { const thresh = si ? 1e3 : 1024; if (Math.abs(bytes) < thresh) { @@ -49757,7 +49562,7 @@ var LookUpCell = (props2) => { }, initialValue); }; -// src/components/SpaceView/Contexts/DataTypeView/NumberCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/NumberCell.tsx var NumberCell = (props2) => { const { initialValue, saveValue } = props2; const [value, setValue] = Cn.useState(initialValue); @@ -49800,7 +49605,7 @@ var NumberCell = (props2) => { }, value); }; -// src/components/SpaceView/Contexts/DataTypeView/TextCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/TextCell.tsx var TextCell = (props2) => { const { initialValue, saveValue } = props2; const [value, setValue] = Cn.useState(initialValue); @@ -49844,11 +49649,11 @@ var TextCell = (props2) => { }, value); }; -// src/components/SpaceView/Contexts/TableView/TableView.tsx +// src/react/components/SpaceView/Contexts/TableView/TableView.tsx var import_lodash11 = __toESM(require_lodash()); var import_obsidian29 = require("obsidian"); -// src/components/SpaceView/Contexts/DataTypeView/ImageCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/ImageCell.tsx var ImageCell = (props2) => { const { initialValue, saveValue } = props2; const [value, setValue] = Cn.useState(initialValue); @@ -49892,7 +49697,7 @@ var ImageCell = (props2) => { })) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); }; -// src/components/SpaceView/Contexts/DataTypeView/LinkCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/LinkCell.tsx var LinkCell = (props2) => { var _a2; const initialValue = (props2.multi ? (_a2 = parseMultiString(props2.initialValue)) != null ? _a2 : [] : [props2.initialValue]).filter((f4) => f4); @@ -49984,7 +49789,7 @@ var LinkCell = (props2) => { }); }; -// src/components/SpaceView/Contexts/DataTypeView/ObjectCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/ObjectCell.tsx var ObjectEditor = (props2) => { const { value, type, saveValue, saveType } = props2; const saveKey = (key2, newKey) => { @@ -50165,7 +49970,7 @@ var ObjectCell = (props2) => { }))); }; -// src/components/SpaceView/Contexts/DataTypeView/SuperCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/SuperCell.tsx var SuperCell = (props2) => { const superProperty = F2(() => { var _a2; @@ -50191,7 +49996,7 @@ var SuperCell = (props2) => { })); }; -// src/components/SpaceView/Contexts/DataTypeView/TagCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/TagCell.tsx var TagCell = (props2) => { var _a2; const initialValue = ((_a2 = parseMultiString(props2.initialValue)) != null ? _a2 : []).filter( @@ -50249,7 +50054,7 @@ var TagCell = (props2) => { }); }; -// src/components/SpaceView/Contexts/TableView/TableView.tsx +// src/react/components/SpaceView/Contexts/TableView/TableView.tsx var TableView = (props2) => { const { spaceInfo, readMode, spaceCache } = q2(SpaceContext); const { @@ -50838,7 +50643,7 @@ var TableView = (props2) => { ))); }; -// src/components/SpaceView/Contexts/DataTypeView/BooleanCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/BooleanCell.tsx var BooleanCell = (props2) => { const { initialValue, saveValue } = props2; const [value, setValue] = Cn.useState(initialValue == "true"); @@ -50877,7 +50682,7 @@ var BooleanCell = (props2) => { })); }; -// src/components/UI/menus/colorPickerMenu.tsx +// src/react/components/UI/Menus/colorPickerMenu.tsx var import_obsidian30 = require("obsidian"); // src/utils/color.ts @@ -50893,7 +50698,7 @@ var colors = [ ["Charcoal", "#4b6584"] ]; -// src/components/UI/menus/colorPickerMenu.tsx +// src/react/components/UI/Menus/colorPickerMenu.tsx var ColorPicker = (props2) => { const [value, setValue] = h2(props2.color); return /* @__PURE__ */ Cn.createElement("div", null, colors.map((c4, i4) => /* @__PURE__ */ Cn.createElement("div", { @@ -50945,7 +50750,7 @@ var showColorPickerMenu = (point, value, setValue) => { return menu; }; -// src/components/SpaceView/Contexts/DataTypeView/ColorCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/ColorCell.tsx var ColorCell = (props2) => { const showMenu = (e4) => { const handleChangeComplete = (color) => { @@ -50969,7 +50774,7 @@ var ColorCell = (props2) => { })); }; -// src/components/SpaceView/Contexts/DataTypeView/IconCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/IconCell.tsx var IconCell = (props2) => { const value = F2( () => { @@ -51006,7 +50811,7 @@ var IconCell = (props2) => { }))); }; -// src/components/SpaceView/Contexts/DataTypeView/SpaceCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/SpaceCell.tsx var SpaceCell = (props2) => { const path = F2( () => uriByString(props2.plugin, props2.initialValue), @@ -51059,7 +50864,7 @@ var SpaceCell = (props2) => { }))); }; -// src/components/SpaceView/Contexts/DataTypeView/DataTypeView.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/DataTypeView.tsx var DataTypeView = (props2) => { const { initialValue, column, row } = props2; const saveValue = (value2) => { @@ -51168,7 +50973,7 @@ var DataTypeView = (props2) => { }); }; -// src/components/SpaceView/Contexts/CardsView/CardColumnView.tsx +// src/react/components/SpaceView/Contexts/CardsView/CardColumnView.tsx var CardColumnView = k3( ({ id: id2, @@ -51243,7 +51048,7 @@ var CardColumnView = k3( CardColumnView.displayName = "CardColumnView"; var CardColumnView_default = CardColumnView; -// src/components/SpaceView/Contexts/CardsView/CardFrame.tsx +// src/react/components/SpaceView/Contexts/CardsView/CardFrame.tsx var CardFrame = (props2) => { const mapFramePropsFromDBRow = (predicate, value) => value && predicate.frameProps ? applyFunctionToObject( replaceKeysByValue(value, predicate.frameProps), @@ -51258,10 +51063,10 @@ var CardFrame = (props2) => { }); }; -// src/components/SpaceView/Contexts/CardsView/CardView.tsx +// src/react/components/SpaceView/Contexts/CardsView/CardView.tsx var import_classnames2 = __toESM(require_classnames()); -// src/components/SpaceView/Contexts/DataTypeView/PreviewCell.tsx +// src/react/components/SpaceView/Contexts/DataTypeView/PreviewCell.tsx var PreviewCell = (props2) => { var _a2; const [vaultItem, setVaultItem] = h2(null); @@ -51312,7 +51117,7 @@ var PreviewCell = (props2) => { })); }; -// src/components/SpaceView/Contexts/CardsView/CardView.tsx +// src/react/components/SpaceView/Contexts/CardsView/CardView.tsx var CardView = Cn.memo( Cn.forwardRef( ({ @@ -51491,7 +51296,7 @@ var CardView = Cn.memo( ) ); -// src/components/SpaceView/Contexts/CardsView/CardsView.tsx +// src/react/components/SpaceView/Contexts/CardsView/CardsView.tsx var animateLayoutChanges = (args) => args.isSorting || args.wasDragging ? defaultAnimateLayoutChanges(args) : true; function DroppableContainer({ children, @@ -51829,7 +51634,7 @@ var CardsView = ({ strategy }, items[Object.keys(items)[parseInt(containerId) * -1]].map( (value, index) => { - return /* @__PURE__ */ Cn.createElement(SortableItem2, { + return /* @__PURE__ */ Cn.createElement(SortableItem, { disabled: isSortingContainer, key: value, id: value, @@ -51933,7 +51738,7 @@ function getColor(id2) { } return void 0; } -function SortableItem2({ +function SortableItem({ disabled, id: id2, plugin, @@ -52001,7 +51806,7 @@ function useMountStatus() { return isMounted; } -// src/components/SpaceView/Contexts/FlowListView/FlowListView.tsx +// src/react/components/SpaceView/Contexts/FlowListView/FlowListView.tsx var import_obsidian31 = require("obsidian"); var FlowListView = (props2) => { const { filteredData: data2 } = q2(ContextEditorContext); @@ -52020,7 +51825,7 @@ var FlowListView = (props2) => { })))); }; -// src/components/SpaceView/Contexts/ContextListView.tsx +// src/react/components/SpaceView/Contexts/ContextListView.tsx var ContextListView = (props2) => { const { predicate } = q2(ContextEditorContext); const { dbSchema } = q2(ContextMDBContext); @@ -52038,7 +51843,7 @@ var ContextListView = (props2) => { }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null), " "); }; -// src/components/SpaceView/Editor/EmbedView/EmbedContextViewComponent.tsx +// src/react/components/SpaceView/Editor/EmbedView/EmbedContextViewComponent.tsx var EmbedFrameView = (props2) => { var _a2, _b2, _c2; const getFileCache = (file) => { @@ -52112,7 +51917,7 @@ var EmbedViewComponent = (props2) => { }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); }; -// src/components/SpaceView/Editor/EmbedView/EmbedContextView.tsx +// src/react/components/SpaceView/Editor/EmbedView/EmbedContextView.tsx var EMBED_CONTEXT_VIEW_TYPE = "make-inline-context"; var EmbedContextView2 = class extends import_obsidian32.ItemView { constructor(leaf, plugin) { @@ -52173,7 +51978,7 @@ var EmbedContextView2 = class extends import_obsidian32.ItemView { } }; -// src/components/SpaceView/Editor/FlowEditor.tsx +// src/react/components/SpaceView/Editor/FlowEditor.tsx var import_obsidian33 = require("obsidian"); var popovers = /* @__PURE__ */ new WeakMap(); var mouseCoords = { x: 0, y: 0 }; @@ -52508,7 +52313,6 @@ var FlowEditor = class extends nosuper(import_obsidian33.HoverPopover) { }; // src/utils/flow/flowEditor.ts -var import_obsidian34 = require("obsidian"); var parseOutReferences = (ostr) => { const str = ostr.split("|")[0]; const refIndex = str.lastIndexOf("#"); @@ -52853,7 +52657,7 @@ var spawnPortal = (plugin, parentLeaf, initiatingEl, fileName, onShowCallback) = ); }; -// src/components/SpaceView/Editor/FlowView.tsx +// src/react/components/SpaceView/Editor/FlowView.tsx var FlowView = k3((props2, ref2) => { var _a2; A2(ref2, () => ({ @@ -52945,7 +52749,7 @@ var FlowView = k3((props2, ref2) => { }); FlowView.displayName = "FlowView"; -// src/components/SpaceView/Frames/EditorNodes/FlowNodeView.tsx +// src/react/components/SpaceView/Frames/EditorNodes/FlowNodeView.tsx function parseContent2(input) { const regex1 = /!\[!\[(.*?)\]\]/; const regex2 = /!!\[\[(.*?)\]\]/; @@ -52983,7 +52787,7 @@ var FlowNodeView = (props2) => { }, "Select Note"); }; -// src/components/SpaceView/Frames/EditorNodes/FrameNodeView.tsx +// src/react/components/SpaceView/Frames/EditorNodes/FrameNodeView.tsx var defaultFrameStyles = { position: "relative" }; @@ -53305,10 +53109,10 @@ var SelectableFrameNode = (props2) => { }, props2.children); }; -// src/components/SpaceView/Frames/FrameEditorView.tsx +// src/react/components/SpaceView/Frames/FrameEditorView.tsx var import_obsidian36 = require("obsidian"); -// src/components/SpaceView/Frames/Setters/CodeEditorSetter.tsx +// src/react/components/SpaceView/Frames/Setters/CodeEditorSetter.tsx var CodeEditorSetter = (props2) => { return /* @__PURE__ */ Cn.createElement("div", { className: "mk-setter-code" @@ -53320,7 +53124,7 @@ var CodeEditorSetter = (props2) => { }, props2.value)); }; -// src/components/SpaceView/Frames/Panels/PropsPanel.tsx +// src/react/components/SpaceView/Frames/Panels/PropsPanel.tsx var PropsPanel = (props2) => { const { spaceInfo } = q2(SpaceContext); const { saveNodes, root, selectedNodes } = q2(FramesEditorContext); @@ -53428,7 +53232,7 @@ var PropsPanel = (props2) => { }))); }; -// src/components/SpaceView/Frames/FrameEditor.tsx +// src/react/components/SpaceView/Frames/FrameEditor.tsx var FrameEditor = (props2) => { var _a2; const activationConstraint = { @@ -53506,7 +53310,7 @@ var FrameEditor = (props2) => { }))))))); }; -// src/components/SpaceView/Frames/FrameEditorView.tsx +// src/react/components/SpaceView/Frames/FrameEditorView.tsx var FRAME_EDITOR_TYPE = "mk-frame-editor"; var openFrameEditor = async (plugin, path, schema) => { const leaf = plugin.app.workspace.getLeaf(false); @@ -53600,7 +53404,7 @@ var FrameEditorView = class extends import_obsidian36.ItemView { } }; -// src/components/UI/modals/saveViewModal.ts +// src/react/components/UI/Modals/saveViewModal.ts var import_obsidian37 = require("obsidian"); var SaveViewModal = class extends import_obsidian37.Modal { constructor(schema, saveSchema, action) { @@ -53659,7 +53463,7 @@ var SaveViewModal = class extends import_obsidian37.Modal { } }; -// src/components/SpaceView/Contexts/ContextBuilder/ContextFrameView.tsx +// src/react/components/SpaceView/Contexts/ContextBuilder/ContextFrameView.tsx var PLACEHOLDER_ID2 = "_placeholder"; var ContextFrameView = (props2) => { const { predicate, savePredicate, cols, data: data2 } = q2(ContextEditorContext); @@ -54010,8 +53814,260 @@ var FrameListView = (props2) => { )); }; -// src/components/UI/modals/contextEditorModal.tsx -var import_obsidian38 = require("obsidian"); +// src/react/components/SpaceView/Contexts/ContextBuilder/SpacePropertyEditor.tsx +var SpacePropertyEditor = (props2) => { + const [activeId, setActiveId] = h2(""); + const items = props2.columns.map((f4) => ({ ...f4, table: "", id: f4.name })); + const [openNodes, setOpenNodes] = h2([]); + const [overId, setOverId] = h2(""); + const contextProperties = F2(() => { + return props2.contexts.reduce((p3, c4) => { + var _a2, _b2; + return { + ...p3, + [c4]: { + space: props2.plugin.index.spacesIndex.get(tagSpacePathFromTag(c4)), + cols: (_b2 = (_a2 = props2.plugin.index.contextsIndex.get(tagSpacePathFromTag(c4))) == null ? void 0 : _a2.cols) != null ? _b2 : [].map((f4) => ({ ...f4, table: c4 })) + } + }; + }, {}); + }, [props2.contexts]); + const sensors = useSensors( + useSensor(MouseSensor, { + activationConstraint: { + distance: 10 + } + }), + useSensor(TouchSensor, { + activationConstraint: { + delay: 250, + tolerance: 5 + } + }), + useSensor(KeyboardSensor, { + coordinateGetter: sortableKeyboardCoordinates + }) + ); + const resetState = () => { + setActiveId(null); + setOverId(null); + }; + const saveNewField = (source, field) => { + props2.saveColumn({ ...field, table: "" }); + }; + const newProperty = (e4) => { + var _a2; + const offset2 = e4.target.getBoundingClientRect(); + showNewPropertyMenu( + props2.plugin, + { x: offset2.left, y: offset2.top + 30 }, + (_a2 = props2.contexts) != null ? _a2 : [], + [], + saveNewField, + "files", + null, + false + ); + }; + const newContexts = (e4) => { + const offset2 = e4.target.getBoundingClientRect(); + const f4 = loadTags(props2.plugin); + const addTag = async (tag) => { + const newTag = tagToTagPath(tag); + props2.saveContexts([ + ...props2.contexts.filter((f5) => f5 != newTag), + newTag + ]); + }; + showSelectMenu( + { x: offset2.left, y: offset2.top + 30 }, + { + plugin: props2.plugin, + multi: false, + editable: true, + value: [], + options: f4.map((m5) => ({ name: m5, value: m5 })), + saveOptions: (_12, value) => addTag(value[0]), + placeholder: i18n_default.labels.contextItemSelectPlaceholder, + searchable: true, + showAll: true + } + ); + }; + return /* @__PURE__ */ Cn.createElement(DndContext, { + sensors, + collisionDetection: closestCenter, + measuring: { + droppable: { + strategy: MeasuringStrategy.Always + } + }, + onDragStart: ({ active }) => { + setActiveId(active.id); + }, + onDragOver: ({ active, over }) => { + const overId2 = over == null ? void 0 : over.id; + if (overId2) + setOverId(overId2); + }, + onDragEnd: ({ active, over }) => { + const overId2 = over == null ? void 0 : over.id; + if (!overId2) { + resetState(); + return; + } + props2.setColumnOrder( + arrayMove( + props2.colsOrder, + props2.colsOrder.findIndex((f4) => f4 == activeId), + props2.colsOrder.findIndex((f4) => f4 == overId2) + ) + ); + resetState(); + }, + onDragCancel: resetState + }, /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor" + }, /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor-context" + }, /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor-context-title" + }, /* @__PURE__ */ Cn.createElement("span", null, "Define Properties for your Space Items"), /* @__PURE__ */ Cn.createElement("button", { + onClick: (e4) => newProperty(e4) + }, "Add Property")), /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor-context-list" + }, /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor-list" + }, /* @__PURE__ */ Cn.createElement(SortableContext, { + items, + strategy: verticalListSortingStrategy + }, items.map((value, index) => { + return /* @__PURE__ */ Cn.createElement(SortableItem2, { + key: index, + id: value.id, + field: value, + plugin: props2.plugin, + saveColumn: (field) => props2.saveColumn(field, value), + cols: items, + colsHidden: props2.colsHidden, + hideColumn: props2.hideColumn, + delColumn: props2.delColumn + }); + }))))), props2.contexts.map((f4, i4) => { + var _a2; + return /* @__PURE__ */ Cn.createElement("div", { + key: i4, + className: "mk-property-editor-context" + }, /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor-context-title" + }, f4, /* @__PURE__ */ Cn.createElement("button", { + className: `mk-collapse mk-inline-button mk-icon-xsmall ${!openNodes.some((g4) => g4 == f4) ? "mk-collapsed" : ""}`, + dangerouslySetInnerHTML: { + __html: stickerFromString("ui//mk-ui-collapse", props2.plugin) + }, + onClick: () => setOpenNodes( + (p3) => p3.some((g4) => g4 == f4) ? p3.filter((o3) => o3 != f4) : [...p3, f4] + ) + }), /* @__PURE__ */ Cn.createElement("span", null), /* @__PURE__ */ Cn.createElement("div", null, /* @__PURE__ */ Cn.createElement("div", { + className: "mk-icon-small", + dangerouslySetInnerHTML: { + __html: uiIconSet["mk-ui-close"] + }, + onClick: (e4) => { + props2.saveContexts(props2.contexts.filter((g4) => g4 != f4)); + } + }))), openNodes.some((g4) => g4 == f4) ? /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor-list" + }, (_a2 = contextProperties[f4]) == null ? void 0 : _a2.cols.filter((f5) => f5.primary != "true").map((g4, h5) => /* @__PURE__ */ Cn.createElement(SortableItem2, { + key: h5, + id: g4.name + "#" + f4, + field: g4, + plugin: props2.plugin, + saveColumn: (field) => props2.saveColumn(field, g4), + cols: contextProperties[f4].cols, + colsHidden: props2.colsHidden, + hideColumn: props2.hideColumn, + delColumn: props2.delColumn + }))) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); + }), /* @__PURE__ */ Cn.createElement("div", { + onClick: (e4) => newContexts(e4), + className: "mk-property-editor-new" + }, "+ Add Context", /* @__PURE__ */ Cn.createElement("span", null, "Contexts lets you connect properties from your tags"))), z3( + /* @__PURE__ */ Cn.createElement(DragOverlay, { + adjustScale: false + }, activeId ? /* @__PURE__ */ Cn.createElement(SortableItem2, { + id: items.find((f4) => f4.id == activeId).id, + field: items.find((f4) => f4.id == activeId), + plugin: props2.plugin, + cols: items, + colsHidden: props2.colsHidden + }) : null), + document.body + )); +}; +function SortableItem2(props2) { + var _a2, _b2; + const { spaceInfo } = q2(SpaceContext); + const { field } = props2; + const saveField = (field2, oldField) => { + if (field2.name.length > 0) { + if (field2.name != oldField.name || field2.type != oldField.type || field2.value != oldField.value || field2.attrs != oldField.attrs) { + const saveResult = props2.saveColumn(field2, oldField); + } + } + }; + const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: props2.id }); + const style = { + transform: CSS.Transform.toString(transform), + transition + }; + const icon = ((_a2 = props2.field.attrs) == null ? void 0 : _a2.length) > 0 ? props2.field.attrs : (_b2 = fieldTypeForType(props2.field.type)) == null ? void 0 : _b2.icon; + const selectedType = (_12, value) => { + const newField = { + ...props2.field, + type: value[0] + }; + props2.saveColumn(newField); + }; + return /* @__PURE__ */ Cn.createElement("div", { + className: "mk-property-editor-property", + ref: setNodeRef, + style, + ...attributes, + ...listeners + }, /* @__PURE__ */ Cn.createElement("div", { + className: "mk-file-context-field-icon", + dangerouslySetInnerHTML: { + __html: stickerFromString(icon, props2.plugin) + }, + onClick: (e4) => { + selectPropertyTypeMenu(e4, props2.plugin, selectedType); + } + }), props2.field.name, /* @__PURE__ */ Cn.createElement("span", null), /* @__PURE__ */ Cn.createElement("div", { + className: "mk-icon-small", + dangerouslySetInnerHTML: { + __html: uiIconSet["mk-ui-options"] + }, + onClick: (e4) => { + const offset2 = e4.target.getBoundingClientRect(); + showPropertyMenu({ + plugin: props2.plugin, + position: { x: offset2.left, y: offset2.top + 30 }, + editable: true, + options: [], + field, + fields: props2.cols, + contextPath: spaceInfo == null ? void 0 : spaceInfo.path, + saveField: (newField) => saveField(newField, field), + hide: props2.hideColumn, + deleteColumn: props2.delColumn, + hidden: props2.colsHidden.includes(field.name + field.table) + }); + } + })); +} + +// src/react/components/UI/Modals/contextEditorModal.tsx var ContextEditorModal = class extends import_obsidian38.Modal { constructor(plugin, space, db, view, type) { super(plugin.app); @@ -54085,10 +54141,7 @@ var SpacePropertyEditorContext = (props2) => { }); }; -// src/components/SpaceView/Contexts/FilterBar/FilterBar.tsx -var import_obsidian39 = require("obsidian"); - -// src/components/SpaceView/Contexts/FilterBar/SearchBar.tsx +// src/react/components/SpaceView/Contexts/FilterBar/SearchBar.tsx var SearchBar = (props2) => { const clearSearch = () => { props2.setSearchString(""); @@ -54107,7 +54160,7 @@ var SearchBar = (props2) => { }))); }; -// src/components/SpaceView/Contexts/FilterBar/FilterBar.tsx +// src/react/components/SpaceView/Contexts/FilterBar/FilterBar.tsx var FilterBar = (props2) => { const ctxRef = _2(null); const { spaceInfo, spaceCache } = q2(SpaceContext); @@ -54741,7 +54794,7 @@ var FilterValueSpan = (props2) => { }, filter.value); }; -// src/components/Navigator/SpaceQuery.tsx +// src/react/components/Navigator/SpaceQuery.tsx var SpaceQuery = (props2) => { const { filters, setFilters } = props2; const selectFilterValue = (e4, filter, i4, k5) => { @@ -55165,9 +55218,17 @@ var DefFilterGroup = (props2) => { })); }; -// src/components/Navigator/SpaceEditor.tsx +// src/react/components/Navigator/SpaceEditor.tsx var SpaceEditor = (props2) => { - var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2; + var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j; + const onKeyDown = (e4) => { + e4.stopPropagation(); + if (e4.key == "Enter") { + saveSpace(); + e4.preventDefault(); + } + }; + const ref2 = _2(null); const [metadata, setMetadata] = h2((_a2 = props2.metadata) != null ? _a2 : {}); const [columns, setColumns] = h2([]); const [predicate, setPredicate] = h2(defaultPredicate); @@ -55191,7 +55252,7 @@ var SpaceEditor = (props2) => { const saveSpace = async () => { var _a3, _b3; const newName = name.replace(/\//g, ""); - const parentPath = (_b3 = (_a3 = props2.space) == null ? void 0 : _a3.parent) != null ? _b3 : props2.parent.path; + const parentPath = ((_b3 = (_a3 = props2.space) == null ? void 0 : _a3.parent) != null ? _b3 : props2.parent.type == "folder") ? props2.parent.path : "/"; const newPath = !parentPath || parentPath == "/" ? newName : parentPath + "/" + newName; if (newName.length == 0) { new import_obsidian41.Notice(i18n_default.notice.newSpaceName); @@ -55223,8 +55284,13 @@ var SpaceEditor = (props2) => { if (!props2.dontOpen) openSpace(newPath, props2.plugin, false); } + props2.close(); }; - const folderContents = ((_d2 = props2.space) == null ? void 0 : _d2.type) == "folder" ? (_f = (_e2 = getAbstractFileAtPath(props2.plugin, props2.space.path)) == null ? void 0 : _e2.children) != null ? _f : [] : []; + p2(() => { + if (ref2.current && name.length == 0) { + ref2.current.focus(); + } + }, []); return /* @__PURE__ */ Cn.createElement(Cn.Fragment, null, /* @__PURE__ */ Cn.createElement("div", { className: "mk-space-editor" }, /* @__PURE__ */ Cn.createElement("div", { @@ -55233,7 +55299,7 @@ var SpaceEditor = (props2) => { className: `mk-file-icon` }, /* @__PURE__ */ Cn.createElement("button", { "aria-label": i18n_default.buttons.changeIcon, - style: ((_g = metadata.color) == null ? void 0 : _g.length) > 0 ? { + style: ((_d2 = metadata.color) == null ? void 0 : _d2.length) > 0 ? { "--label-color": `${metadata.color}`, "--icon-color": `#ffffff` } : { @@ -55244,8 +55310,8 @@ var SpaceEditor = (props2) => { } : { __html: stickerFromString( iconForSpaceType( - (_i = (_h = props2.space) == null ? void 0 : _h.type) != null ? _i : "folder", - (_j = props2.space) == null ? void 0 : _j.path, + (_f = (_e2 = props2.space) == null ? void 0 : _e2.type) != null ? _f : "folder", + (_g = props2.space) == null ? void 0 : _g.path, true ), props2.plugin @@ -55262,15 +55328,16 @@ var SpaceEditor = (props2) => { })), /* @__PURE__ */ Cn.createElement("div", { className: "mk-space-editor-input" }, /* @__PURE__ */ Cn.createElement("input", { - autoFocus: true, + ref: ref2, placeholder: "Space Name", value: name, + onKeyDown: (e4) => onKeyDown(e4), onChange: (e4) => setName(e4.target.value) }))), /* @__PURE__ */ Cn.createElement("div", { className: "mk-space-editor-section" }, /* @__PURE__ */ Cn.createElement("div", { className: "mk-space-editor-title" - }, "Items", /* @__PURE__ */ Cn.createElement("span", null), /* @__PURE__ */ Cn.createElement("button", { + }, "Pinned Items", /* @__PURE__ */ Cn.createElement("span", null), /* @__PURE__ */ Cn.createElement("button", { "aria-label": "Add Smart Search", onClick: (e4) => { var _a3; @@ -55301,15 +55368,9 @@ var SpaceEditor = (props2) => { }); } ) - }, "Add Item")), ((_k = props2.space) == null ? void 0 : _k.type) == "tag" ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null) : /* @__PURE__ */ Cn.createElement("div", { + }, "Add Item")), ((_h = props2.space) == null ? void 0 : _h.type) == "tag" ? /* @__PURE__ */ Cn.createElement(Cn.Fragment, null) : /* @__PURE__ */ Cn.createElement("div", { className: "mk-space-editor-contents" - }, folderContents.map((f4, i4) => /* @__PURE__ */ Cn.createElement("div", { - key: i4, - className: "mk-space-editor-link" - }, /* @__PURE__ */ Cn.createElement(FileStickerContainer, { - plugin: props2.plugin, - path: uriByString(props2.plugin, f4.path) - }), f4.name, /* @__PURE__ */ Cn.createElement("span", null))), linkCaches.map((f4, i4) => /* @__PURE__ */ Cn.createElement("div", { + }, linkCaches.map((f4, i4) => /* @__PURE__ */ Cn.createElement("div", { key: i4, className: "mk-space-editor-link" }, /* @__PURE__ */ Cn.createElement(FileSticker, { @@ -55329,59 +55390,24 @@ var SpaceEditor = (props2) => { ] }); } - }))), ((_l = metadata == null ? void 0 : metadata.filters) == null ? void 0 : _l.length) > 0 && /* @__PURE__ */ Cn.createElement(SpaceQuery, { + }))), ((_i = metadata == null ? void 0 : metadata.filters) == null ? void 0 : _i.length) > 0 && /* @__PURE__ */ Cn.createElement(SpaceQuery, { plugin: props2.plugin, - filters: (_m = metadata.filters) != null ? _m : [], + filters: (_j = metadata.filters) != null ? _j : [], setFilters: saveQuery - }))), !props2.space && /* @__PURE__ */ Cn.createElement("div", { - className: "mk-space-editor-section" - }, /* @__PURE__ */ Cn.createElement("div", { - className: "mk-space-editor-title" - }, "Properties"), /* @__PURE__ */ Cn.createElement(SpacePropertyEditor, { - plugin: props2.plugin, - colsOrder: predicate.colsOrder, - setColumnOrder: function(cols) { - setPredicate({ ...predicate, colsOrder: cols }); - }, - colsHidden: predicate.colsHidden, - columns, - contexts: (_n2 = metadata.contexts) != null ? _n2 : [], - saveContexts: function(contexts) { - setMetadata({ ...metadata, contexts }); - }, - hideColumn: function(col, hidden) { - setPredicate({ - ...predicate, - colsHidden: hidden ? [ - ...predicate.colsHidden.filter((s5) => s5 != col.name), - col.name - ] : predicate.colsHidden.filter((s5) => s5 != col.name) - }); - }, - delColumn: function(column) { - setColumns(columns.filter((f4, i4) => f4.name != column.name)); - }, - saveColumn: function(column, oldColumn) { - const oldFieldIndex = oldColumn ? columns.findIndex((f4) => f4.name == oldColumn.name) : -1; - const newFields = oldFieldIndex == -1 ? [...columns, column] : columns.map((f4, i4) => i4 == oldFieldIndex ? column : f4); - setColumns(newFields); - } - }))), /* @__PURE__ */ Cn.createElement("div", { + })))), /* @__PURE__ */ Cn.createElement("div", { className: "mk-space-editor-controls" }, /* @__PURE__ */ Cn.createElement("button", { className: "mod-cta", onClick: () => { saveSpace(); - props2.close(); } - }, "Save"), /* @__PURE__ */ Cn.createElement("button", { + }, i18n_default.buttons.saveSpace), /* @__PURE__ */ Cn.createElement("button", { onClick: () => props2.close() - }, "Cancel"))); + }, i18n_default.buttons.cancel))); }; var SpaceEditor_default = SpaceEditor; -// src/components/UI/modals/editSpaceModal.tsx -var import_obsidian42 = require("obsidian"); +// src/react/components/UI/Modals/editSpaceModal.tsx var EditSpaceModal = class extends import_obsidian42.Modal { constructor(plugin, space, action, metadata, parent, dontOpen) { super(plugin.app); @@ -55422,10 +55448,48 @@ var EditSpaceModal = class extends import_obsidian42.Modal { } }; -// src/components/UI/menus/fileMenu.tsx +// src/react/components/UI/Modals/deleteModal.tsx var import_obsidian43 = require("obsidian"); +var DeleteModal = class extends import_obsidian43.Modal { + constructor(plugin, confirmAction, title, message) { + super(plugin.app); + this.confirmAction = confirmAction; + this.title = title; + this.message = message; + } + onOpen() { + const { contentEl } = this; + const headerEl = contentEl.createEl("div", { text: this.title }); + headerEl.addClass("modal-title"); + const messageEl = contentEl.createEl("div", { text: this.message }); + messageEl.addClass("modal-subtitle"); + messageEl.style.cssText = "width: 100%; margin-bottom: 10px;"; + const changeButton = contentEl.createEl("button", { + text: i18n_default.buttons.delete + }); + changeButton.addClass("mod-warning"); + const cancelButton = contentEl.createEl("button", { + text: i18n_default.buttons.cancel + }); + cancelButton.style.cssText = "float: right;"; + cancelButton.addEventListener("click", () => { + this.close(); + }); + const onClickAction = async () => { + this.confirmAction(); + this.close(); + }; + changeButton.addEventListener("click", onClickAction); + } + onClose() { + const { contentEl } = this; + contentEl.empty(); + } +}; + +// src/react/components/UI/Menus/fileMenu.tsx var showSpaceAddMenu = (plugin, e4, space, dontOpen) => { - const fileMenu = new import_obsidian43.Menu(); + const fileMenu = new import_obsidian44.Menu(); fileMenu.addItem((menuItem) => { menuItem.setIcon("edit"); menuItem.setTitle(i18n_default.buttons.createNote); @@ -55455,6 +55519,15 @@ var showSpaceAddMenu = (plugin, e4, space, dontOpen) => { vaultChangeModal.open(); }); }); + fileMenu.addItem((menuItem) => { + menuItem.setIcon("pin"); + menuItem.setTitle(i18n_default.buttons.addIntoSpace); + menuItem.onClick((ev) => { + showLinkMenu(e4, plugin, (link) => { + insertSpaceItemAtIndex(plugin, space, link); + }); + }); + }); if (isMouseEvent(e4)) { fileMenu.showAtPosition({ x: e4.pageX, y: e4.pageY }); } else { @@ -55468,259 +55541,264 @@ var showSpaceAddMenu = (plugin, e4, space, dontOpen) => { var triggerSpaceMenu = (plugin, space, e4, activeFile, parentSpace) => { if (!space) return; - const spaceMenu = new import_obsidian43.Menu(); - spaceMenu.addItem((menuItem) => { - menuItem.setIcon("arrow-up-right"); - menuItem.setTitle("Open Space"); - menuItem.onClick((ev) => { - openSpace(space.path, plugin, false); - }); - }); - spaceMenu.addItem((menuItem) => { - menuItem.setIcon("arrow-up-right"); - menuItem.setTitle("Reveal in Finder"); - menuItem.onClick((ev) => { - const file = getAbstractFileAtPath( - plugin, - space.type == "folder" ? space.path : `${plugin.settings.spacesFolder}/${space.name}` - ); - if (file instanceof import_obsidian43.TFolder) { - const leaf = plugin.app.workspace.getLeaf(false); - app.workspace.setActiveLeaf(leaf, { focus: true }); - leaf.openFile(file, { eState: { focus: true } }); - } - }); - }); - spaceMenu.addSeparator(); - spaceMenu.addItem((menuItem) => { - menuItem.setIcon("edit"); - menuItem.setTitle(i18n_default.buttons.createNote); - menuItem.onClick((ev) => { - newFileInSpace(plugin, space, activeFile); - }); - }); - spaceMenu.addItem((menuItem) => { - menuItem.setIcon("layout-dashboard"); - menuItem.setTitle(i18n_default.buttons.createCanvas); - menuItem.onClick((ev) => { - newFileInSpace(plugin, space, activeFile, true); - }); - }); - spaceMenu.addItem((menuItem) => { - menuItem.setIcon("folder-plus"); - menuItem.setTitle(i18n_default.buttons.createFolder); - menuItem.onClick((ev) => { - const vaultChangeModal = new EditSpaceModal( - plugin, - null, - "create", - null, - space - ); - vaultChangeModal.open(); - }); - }); - spaceMenu.addSeparator(); - spaceMenu.addItem((menuItem) => { - menuItem.setIcon("plus-square"); - menuItem.setTitle("Add to Space"); - menuItem.onClick((ev) => { - showSpacesMenu(e4, plugin, (link) => { - movePathsToSpace( - plugin, - [space.path], - plugin.index.spacesIndex.get(link), - -1, - "link" - ); + const spaceMenu = new import_obsidian44.Menu(); + if (space.type != "default") { + spaceMenu.addItem((menuItem) => { + menuItem.setIcon("arrow-up-right"); + menuItem.setTitle(i18n_default.menu.openSpace); + menuItem.onClick((ev) => { + openSpace(space.path, plugin, false); }); }); - }); - spaceMenu.addItem((menuItem) => { - const pinned = plugin.settings.waypoints.some((f4) => f4 == space.path); - menuItem.setTitle(pinned ? i18n_default.menu.unpinSpace : i18n_default.menu.pinSpace); - menuItem.setIcon("pin"); - menuItem.onClick((ev) => { - toggleSpacePin(plugin, space.path, "pinned", pinned); - }); - }); - if (parentSpace && parentSpace != space.parent) { - const spaceCache = plugin.index.spacesIndex.get(parentSpace); - if (spaceCache) { - spaceMenu.addItem((menuItem) => { - menuItem.setIcon("minus-square"); - menuItem.setTitle(i18n_default.menu.removeFromSpace); - menuItem.onClick((ev) => { - removePathsFromSpace(plugin, spaceCache, [space.path]); - }); - }); - } - } - spaceMenu.addSeparator(); - if (plugin.settings.spacesStickers) { spaceMenu.addSeparator(); spaceMenu.addItem((menuItem) => { - menuItem.setIcon("palette"); - disclosureMenuItem( - plugin, - menuItem, - false, - false, - i18n_default.menu.changeColor, - "", - [ - { name: "None", value: "" }, - ...colors.map((f4) => ({ name: f4[0], value: f4[1] })) - ], - (_12, values) => { - saveSpaceColor(plugin, space.path, values[0]); + menuItem.setIcon("arrow-up-right"); + menuItem.setTitle(i18n_default.menu.revealInDefault); + menuItem.onClick((ev) => { + const file = getAbstractFileAtPath( + plugin, + space.type == "folder" ? space.path : `${plugin.settings.spacesFolder}/${space.name}` + ); + if (file instanceof import_obsidian44.TFolder) { + const leaf = plugin.app.workspace.getLeaf(false); + app.workspace.setActiveLeaf(leaf, { focus: true }); + leaf.openFile(file, { eState: { focus: true } }); } - ); + }); }); + spaceMenu.addSeparator(); spaceMenu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.buttons.changeIcon); - menuItem.setIcon("lucide-sticker"); + menuItem.setIcon("pin"); + menuItem.setTitle(i18n_default.buttons.addToSpace); menuItem.onClick((ev) => { - const vaultChangeModal = new stickerModal( - plugin.app, + showSpacesMenu( + e4, plugin, - (emoji) => saveSpaceSticker(plugin, space.path, emoji) + (link) => { + movePathsToSpace( + plugin, + [space.path], + plugin.index.spacesIndex.get(link), + -1, + "link" + ); + }, + true ); - vaultChangeModal.open(); }); }); + spaceMenu.addSeparator(); spaceMenu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.buttons.removeIcon); - menuItem.setIcon("lucide-file-minus"); + menuItem.setIcon("edit"); + menuItem.setTitle(i18n_default.buttons.createNote); menuItem.onClick((ev) => { - removeSpaceIcon(plugin, space.path); + newFileInSpace(plugin, space, activeFile); }); }); - } - spaceMenu.addSeparator(); - spaceMenu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.sortBy); - menuItem.setIcon("sort-desc"); - menuItem.onClick((ev) => { - const sortMenu = new import_obsidian43.Menu(); - sortMenu.addItem((menuItem2) => { - menuItem2.setIcon("arrow-up-down"); - menuItem2.setTitle(i18n_default.menu.groupSpaces); - menuItem2.setChecked(space.metadata.sort.group == true); - menuItem2.onClick((ev2) => { - updateSpaceSort(plugin, space.path, { - field: space.metadata.sort.field, - asc: space.metadata.sort.asc, - group: !space.metadata.sort.group - }); - }); + spaceMenu.addItem((menuItem) => { + menuItem.setIcon("layout-dashboard"); + menuItem.setTitle(i18n_default.buttons.createCanvas); + menuItem.onClick((ev) => { + newFileInSpace(plugin, space, activeFile, true); }); - sortMenu.addSeparator(); - sortMenu.addItem((menuItem2) => { - const sortOption = { - field: "rank", - asc: true, - group: space.metadata.sort.group - }; - menuItem2.setIcon("arrow-up-down"); - menuItem2.setTitle(i18n_default.menu.customSort); - menuItem2.setChecked( - space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc + }); + spaceMenu.addItem((menuItem) => { + menuItem.setIcon("folder-plus"); + menuItem.setTitle(i18n_default.buttons.createFolder); + menuItem.onClick((ev) => { + const vaultChangeModal = new EditSpaceModal( + plugin, + null, + "create", + null, + space ); - menuItem2.onClick((ev2) => { - updateSpaceSort(plugin, space.path, sortOption); - }); + vaultChangeModal.open(); }); - sortMenu.addSeparator(); - sortMenu.addItem((menuItem2) => { - const sortOption = { - field: "name", - asc: true, - group: space.metadata.sort.group - }; - menuItem2.setTitle(i18n_default.menu.fileNameSortAlphaAsc); - menuItem2.setChecked( - space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc + }); + spaceMenu.addSeparator(); + if (plugin.settings.spacesStickers) { + spaceMenu.addSeparator(); + spaceMenu.addItem((menuItem) => { + menuItem.setIcon("palette"); + disclosureMenuItem( + plugin, + menuItem, + false, + false, + i18n_default.menu.changeColor, + "", + [ + { name: "None", value: "" }, + ...colors.map((f4) => ({ name: f4[0], value: f4[1] })) + ], + (_12, values) => { + saveSpaceColor(plugin, space.path, values[0]); + } ); - menuItem2.onClick((ev2) => { - updateSpaceSort(plugin, space.path, sortOption); + }); + spaceMenu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.buttons.changeIcon); + menuItem.setIcon("lucide-sticker"); + menuItem.onClick((ev) => { + const vaultChangeModal = new stickerModal( + plugin.app, + plugin, + (emoji) => saveSpaceSticker(plugin, space.path, emoji) + ); + vaultChangeModal.open(); }); }); - sortMenu.addItem((menuItem2) => { - const sortOption = { - field: "name", - asc: false, - group: space.metadata.sort.group - }; - menuItem2.setTitle(i18n_default.menu.fileNameSortAlphaDesc); - menuItem2.setChecked( - space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc - ); - menuItem2.onClick((ev2) => { - updateSpaceSort(plugin, space.path, sortOption); + spaceMenu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.buttons.removeIcon); + menuItem.setIcon("lucide-file-minus"); + menuItem.onClick((ev) => { + removeSpaceIcon(plugin, space.path); }); }); - sortMenu.addSeparator(); - sortMenu.addItem((menuItem2) => { - const sortOption = { - field: "ctime", - asc: false, - group: space.metadata.sort.group - }; - menuItem2.setTitle(i18n_default.menu.createdTimeSortAsc); - menuItem2.setChecked( - space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc - ); - menuItem2.onClick((ev2) => { - updateSpaceSort(plugin, space.path, sortOption); + } + spaceMenu.addSeparator(); + spaceMenu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.sortBy); + menuItem.setIcon("sort-desc"); + menuItem.onClick((ev) => { + const sortMenu = new import_obsidian44.Menu(); + sortMenu.addItem((menuItem2) => { + menuItem2.setIcon("arrow-up-down"); + menuItem2.setTitle(i18n_default.menu.groupSpaces); + menuItem2.setChecked(space.metadata.sort.group == true); + menuItem2.onClick((ev2) => { + updateSpaceSort(plugin, space.path, { + field: space.metadata.sort.field, + asc: space.metadata.sort.asc, + group: !space.metadata.sort.group + }); + }); + }); + sortMenu.addSeparator(); + sortMenu.addItem((menuItem2) => { + const sortOption = { + field: "rank", + asc: true, + group: space.metadata.sort.group + }; + menuItem2.setIcon("arrow-up-down"); + menuItem2.setTitle(i18n_default.menu.customSort); + menuItem2.setChecked( + space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc + ); + menuItem2.onClick((ev2) => { + updateSpaceSort(plugin, space.path, sortOption); + }); + }); + sortMenu.addSeparator(); + sortMenu.addItem((menuItem2) => { + const sortOption = { + field: "name", + asc: true, + group: space.metadata.sort.group + }; + menuItem2.setTitle(i18n_default.menu.fileNameSortAlphaAsc); + menuItem2.setChecked( + space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc + ); + menuItem2.onClick((ev2) => { + updateSpaceSort(plugin, space.path, sortOption); + }); + }); + sortMenu.addItem((menuItem2) => { + const sortOption = { + field: "name", + asc: false, + group: space.metadata.sort.group + }; + menuItem2.setTitle(i18n_default.menu.fileNameSortAlphaDesc); + menuItem2.setChecked( + space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc + ); + menuItem2.onClick((ev2) => { + updateSpaceSort(plugin, space.path, sortOption); + }); + }); + sortMenu.addSeparator(); + sortMenu.addItem((menuItem2) => { + const sortOption = { + field: "ctime", + asc: false, + group: space.metadata.sort.group + }; + menuItem2.setTitle(i18n_default.menu.createdTimeSortAsc); + menuItem2.setChecked( + space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc + ); + menuItem2.onClick((ev2) => { + updateSpaceSort(plugin, space.path, sortOption); + }); + }); + sortMenu.addItem((menuItem2) => { + const sortOption = { + field: "ctime", + asc: true, + group: space.metadata.sort.group + }; + menuItem2.setTitle(i18n_default.menu.createdTimeSortDesc); + menuItem2.setChecked( + space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc + ); + menuItem2.onClick((ev2) => { + updateSpaceSort(plugin, space.path, sortOption); + }); }); + const offset2 = e4.target.getBoundingClientRect(); + if (isMouseEvent(e4)) { + sortMenu.showAtPosition({ x: offset2.left, y: offset2.top + 30 }); + } else { + sortMenu.showAtPosition({ + x: e4.nativeEvent.locationX, + y: e4.nativeEvent.locationY + }); + } }); - sortMenu.addItem((menuItem2) => { - const sortOption = { - field: "ctime", - asc: true, - group: space.metadata.sort.group - }; - menuItem2.setTitle(i18n_default.menu.createdTimeSortDesc); - menuItem2.setChecked( - space.metadata.sort.field == sortOption.field && space.metadata.sort.asc == sortOption.asc - ); - menuItem2.onClick((ev2) => { - updateSpaceSort(plugin, space.path, sortOption); + }); + spaceMenu.addSeparator(); + if (space.type == "folder") + spaceMenu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.edit); + menuItem.setIcon("pencil"); + menuItem.onClick((ev) => { + const vaultChangeModal = new EditSpaceModal( + plugin, + space, + "rename", + space.metadata + ); + vaultChangeModal.open(); }); }); - const offset2 = e4.target.getBoundingClientRect(); - if (isMouseEvent(e4)) { - sortMenu.showAtPosition({ x: offset2.left, y: offset2.top + 30 }); - } else { - sortMenu.showAtPosition({ - x: e4.nativeEvent.locationX, - y: e4.nativeEvent.locationY + } + if (parentSpace && parentSpace != space.parent) { + const spaceCache = plugin.index.spacesIndex.get(parentSpace); + if (spaceCache) { + spaceMenu.addItem((menuItem) => { + menuItem.setIcon("pin-off"); + menuItem.setTitle(i18n_default.menu.removeFromSpace); + menuItem.onClick((ev) => { + removePathsFromSpace(plugin, spaceCache, [space.path]); }); - } - }); - }); - spaceMenu.addSeparator(); - if (space.type == "folder") - spaceMenu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.edit); - menuItem.setIcon("pencil"); - menuItem.onClick((ev) => { - const vaultChangeModal = new EditSpaceModal( - plugin, - space, - "rename", - space.metadata - ); - vaultChangeModal.open(); }); - }); - if (space.type != "vault") + } + } else if (space.type == "folder" || space.type == "tag") spaceMenu.addItem((menuItem) => { menuItem.setTitle(i18n_default.menu.deleteSpace); menuItem.setIcon("trash"); menuItem.onClick((ev) => { - removeSpace(plugin, space.path); + const deleteModal = new DeleteModal( + plugin, + () => removeSpace(plugin, space.path), + "Delete Space", + "Deleting the space will also delete the folder and its contents." + ); + deleteModal.open(); }); }); if (isMouseEvent(e4)) { @@ -55735,21 +55813,26 @@ var triggerSpaceMenu = (plugin, space, e4, activeFile, parentSpace) => { }; var triggerMultiFileMenu = (plugin, selectedFiles, e4) => { const files = selectedFiles.map((s5) => s5.item.path); - const fileMenu = new import_obsidian43.Menu(); + const fileMenu = new import_obsidian44.Menu(); fileMenu.addSeparator(); fileMenu.addItem((menuItem) => { - menuItem.setIcon("plus"); - menuItem.setTitle("Add to Space"); + menuItem.setIcon("pin"); + menuItem.setTitle(i18n_default.buttons.addToSpace); menuItem.onClick((ev) => { - showSpacesMenu(ev, plugin, (link) => { - movePathsToSpace( - plugin, - selectedFiles.map((f4) => f4.path), - plugin.index.spacesIndex.get(link), - -1, - "link" - ); - }); + showSpacesMenu( + e4, + plugin, + (link) => { + movePathsToSpace( + plugin, + selectedFiles.map((f4) => f4.path), + plugin.index.spacesIndex.get(link), + -1, + "link" + ); + }, + true + ); }); }); if (plugin.settings.spacesStickers) { @@ -55764,7 +55847,7 @@ var triggerMultiFileMenu = (plugin, selectedFiles, e4) => { i18n_default.menu.changeColor, "", [ - { name: "None", value: "" }, + { name: i18n_default.menu.setNone, value: "" }, ...colors.map((f4) => ({ name: f4[0], value: f4[1] })) ], (_12, values) => { @@ -55797,7 +55880,13 @@ var triggerMultiFileMenu = (plugin, selectedFiles, e4) => { menuItem.setTitle(i18n_default.menu.deleteFiles); menuItem.setIcon("trash"); menuItem.onClick((ev) => { - deleteFiles(plugin, files); + const deleteModal = new DeleteModal( + plugin, + () => deleteFiles(plugin, files), + "Delete Files", + `Delete ${files.length} files/folders and their contents?` + ); + deleteModal.open(); }); }); fileMenu.addItem((menuItem) => { @@ -55831,29 +55920,34 @@ var triggerMultiFileMenu = (plugin, selectedFiles, e4) => { }; var triggerFileMenu = (plugin, file, isFolder, e4, space) => { const cache = plugin.index.filesIndex.get(file.path); - const fileMenu = new import_obsidian43.Menu(); + const fileMenu = new import_obsidian44.Menu(); fileMenu.addSeparator(); fileMenu.addItem((menuItem) => { - menuItem.setIcon("plus-square"); - menuItem.setTitle("Add to Space"); + menuItem.setIcon("pin"); + menuItem.setTitle(i18n_default.buttons.addToSpace); menuItem.onClick((ev) => { - showSpacesMenu(ev, plugin, (link) => { - movePathsToSpace( - plugin, - [file.path], - plugin.index.spacesIndex.get(link), - -1, - "link" - ); - }); + showSpacesMenu( + e4, + plugin, + (link) => { + movePathsToSpace( + plugin, + [file.path], + plugin.index.spacesIndex.get(link), + -1, + "link" + ); + }, + true + ); }); }); - if (file instanceof import_obsidian43.TFile && file.extension == "md") + if (file instanceof import_obsidian44.TFile && file.extension == "md") fileMenu.addItem((menuItem) => { menuItem.setTitle(i18n_default.menu.changeToFolderNote); menuItem.setIcon("file-plus-2"); menuItem.onClick((ev) => { - if (file instanceof import_obsidian43.TFile) + if (file instanceof import_obsidian44.TFile) noteToFolderNote(plugin, file, true); }); }); @@ -55869,7 +55963,7 @@ var triggerFileMenu = (plugin, file, isFolder, e4, space) => { i18n_default.menu.changeColor, "", [ - { name: "None", value: "" }, + { name: i18n_default.menu.setNone, value: "" }, ...colors.map((f4) => ({ name: f4[0], value: f4[1] })) ], (_12, values) => { @@ -55960,13 +56054,10 @@ var triggerFileMenu = (plugin, file, isFolder, e4, space) => { return false; }; -// src/components/InlineFileContext/InlineFileContextView.tsx -var import_he = __toESM(require_he()); - -// src/components/UI/menus/fmMenu.tsx -var import_obsidian44 = require("obsidian"); +// src/react/components/UI/Menus/fmMenu.tsx +var import_obsidian45 = require("obsidian"); var showFMMenu = (plugin, position, property, deleteProperty, syncProperty, renameProperty, changeType) => { - const menu = new import_obsidian44.Menu(); + const menu = new import_obsidian45.Menu(); menu.setUseNativeMenu(false); menu.addItem((menuItem) => { var _a2; @@ -56008,7 +56099,7 @@ var showFMMenu = (plugin, position, property, deleteProperty, syncProperty, rena // src/utils/obsidian/obsidian.ts var corePluginEnabled = (app2, plugin) => app2.internalPlugins.getPluginById(plugin) ? true : false; -// src/components/Explorer/FrontmatterView.tsx +// src/react/components/Explorer/FrontmatterView.tsx var FrontmatterView = (props2) => { const { metadataPath, path } = props2; const [values, setValues] = h2({}); @@ -56199,7 +56290,7 @@ var FrontmatterView = (props2) => { }`) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); }; -// src/components/Explorer/ContextPropertiesView.tsx +// src/react/components/Explorer/ContextPropertiesView.tsx var ContextPropertiesView = (props2) => { var _a2; const spaces = F2( @@ -56371,8 +56462,8 @@ var FileContextList = (props2) => { })); }; -// src/components/InlineFileContext/NoteBannerView.tsx -var import_obsidian46 = require("obsidian"); +// src/react/components/MarkdownEditor/ReadingViewHeader.tsx +var import_obsidian47 = require("obsidian"); var NoteBannerView = (props2) => { var _a2; const [banner, setBanner] = h2(null); @@ -56390,7 +56481,7 @@ var NoteBannerView = (props2) => { if (!props2.path || props2.path.type == "file") return; e4.preventDefault(); - const fileMenu = new import_obsidian46.Menu(); + const fileMenu = new import_obsidian47.Menu(); fileMenu.addSeparator(); fileMenu.addItem((menuItem) => { menuItem.setTitle(i18n_default.buttons.changeBanner); @@ -56447,14 +56538,14 @@ var NoteBannerView = (props2) => { }) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null); }; -// src/components/InlineFileContext/InlineFileContextView.tsx +// src/react/components/MarkdownEditor/EditorHeader.tsx var InlineFileContextView = (props2) => { const [metadataFilePath, setMetadataFilePath] = h2(); const refreshCache = (path) => { if (!path) return null; const uri = uriByString(props2.plugin, path); - if (uri.type == "space" || uri.type == "tag") { + if (uri.type == "space" || uri.type == "folder" || uri.type == "tag") { const cache3 = props2.plugin.index.spacesIndex.get(path); if (cache3) { setMetadataFilePath(cache3.space.defPath); @@ -56487,9 +56578,7 @@ var InlineFileContextView = (props2) => { !showHeader ? false : !props2.plugin.settings.inlineContextExpanded ); const spaces = F2( - () => (cache == null ? void 0 : cache.cacheType) == "file" ? spacesFromFileCache(cache, props2.plugin).map( - (f4) => f4.path - ) : [], + () => cache ? [...props2.plugin.index.spacesMap.get(cache.path)].map((f4) => props2.plugin.index.spacesIndex.get(f4)).filter((f4) => f4).map((f4) => f4.path) : [], [cache] ); const banner = cache == null ? void 0 : cache.banner; @@ -56742,24 +56831,21 @@ var InlineFileContextView = (props2) => { }, /* @__PURE__ */ Cn.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: uiIconSet["mk-ui-plus"] } - }), platformIsMobile() ? "Property" : "Property"), /* @__PURE__ */ Cn.createElement("button", { + }), platformIsMobile() ? i18n_default.labels.newPropertyShort : i18n_default.labels.newProperty), /* @__PURE__ */ Cn.createElement("button", { onClick: (e4) => showAddMenu(e4) }, /* @__PURE__ */ Cn.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { - __html: stickerFromString( - "lucide//plus-square", - props2.plugin - ) + __html: stickerFromString("lucide//pin", props2.plugin) } - }), platformIsMobile() ? "Space" : "Space"), cache && /* @__PURE__ */ Cn.createElement("button", { + }), platformIsMobile() ? i18n_default.buttons.addToSpaceShort : i18n_default.buttons.addToSpace), cache && /* @__PURE__ */ Cn.createElement("button", { onClick: (e4) => changeCover(e4) }, /* @__PURE__ */ Cn.createElement("div", { className: "mk-icon-xsmall", dangerouslySetInnerHTML: { __html: uiIconSet["mk-make-image"] } - }), platformIsMobile() ? "Cover" : "Cover"), (cache == null ? void 0 : cache.cacheType) == "space" && /* @__PURE__ */ Cn.createElement("button", { + }), platformIsMobile() ? i18n_default.buttons.changeBannerShort : i18n_default.buttons.changeBanner), (cache == null ? void 0 : cache.cacheType) == "space" && /* @__PURE__ */ Cn.createElement("button", { "aria-label": i18n_default.buttons.moreOptions, className: "mk-icon-xsmall mk-inline-button", onClick: (e4) => { @@ -56788,6 +56874,19 @@ var InlineFileContextView = (props2) => { // src/types/space.ts var FMMetadataKeys = (plugin) => [plugin.settings.fmKeyBanner, plugin.settings.fmKeySticker, plugin.settings.fmKeyColor]; +var waypointsSpace = { + name: "Waypoints", + alias: "Waypoints", + path: "spaces://$waypoints", + metadata: { + contexts: [] + }, + sticker: "lucide//tags", + space: null, + contexts: [], + type: "default", + cacheType: "space" +}; var tagsSpace = { name: "Tags", alias: "Tags", @@ -56903,7 +57002,7 @@ var dropFrame = (activeNode, overNode, root, nodes, newColumn) => { return [saveNodes, deleteNodes]; }; -// src/components/SpaceView/Contexts/SpaceBodyView.tsx +// src/react/components/SpaceView/Contexts/SpaceBodyView.tsx var PLACEHOLDER_ID3 = "_placeholder"; var SpaceBodyView = (props2) => { const { frameSchema } = q2(FramesMDBContext); @@ -57020,7 +57119,7 @@ var SpaceBodyView = (props2) => { )); }; -// src/components/SpaceView/TitleComponent.tsx +// src/react/components/SpaceView/TitleComponent.tsx var TitleComponent = (props2) => { const fileNameRef = _2(null); const name = pathDisplayName(props2.space.space.uri, props2.plugin); @@ -57078,7 +57177,7 @@ var TitleComponent = (props2) => { }))); }; -// src/components/SpaceView/SpaceComponent.tsx +// src/react/components/SpaceView/SpaceComponent.tsx var SpaceComponent = (props2) => { const path = props2.path; const [spaceCache, setSpaceCache] = h2(null); @@ -57235,9 +57334,9 @@ var SpaceOuter = (props2) => { }, props2.children); }; -// src/components/SpaceView/Contexts/SpaceView.tsx +// src/react/components/SpaceView/Contexts/SpaceView.tsx var SPACE_VIEW_TYPE = "mk-space"; -var SpaceView = class extends import_obsidian47.ItemView { +var SpaceView = class extends import_obsidian48.ItemView { constructor(leaf, plugin, viewType) { super(leaf); this.navigation = true; @@ -57323,12 +57422,11 @@ var SpaceView = class extends import_obsidian47.ItemView { }; // src/utils/file.ts -var import_obsidian48 = require("obsidian"); var tFileToAFile = (file) => { var _a2, _b2, _c2; if (!file) return null; - if (file instanceof import_obsidian48.TFile && file.stat) { + if (file instanceof import_obsidian49.TFile && file.stat) { return { isFolder: false, name: file.basename, @@ -57353,7 +57451,7 @@ var defaultNoteFolder = (plugin, activeFile) => { }; var defaultConfigFile = async (plugin) => { return await plugin.app.vault.adapter.read( - (0, import_obsidian48.normalizePath)(plugin.app.vault.configDir + "/app.json") + (0, import_obsidian49.normalizePath)(plugin.app.vault.configDir + "/app.json") ); }; var appendFilesMetaData = (plugin, propType, filesString) => { @@ -57391,11 +57489,9 @@ var moveFile = async (plugin, folder, file) => { }; var copyFile = async (plugin, folder, file) => { const newPath = folder.path + "/" + file.name; - if (file instanceof import_obsidian48.TFolder) { - if (!abstractFileAtPathExists(plugin, newPath)) { - plugin.app.vault.createFolder(newPath); - } - } else if (file instanceof import_obsidian48.TFile) { + if (file instanceof import_obsidian49.TFolder) { + await plugin.files.createFolder(newPath); + } else if (file instanceof import_obsidian49.TFile) { await plugin.app.vault.copy(file, folder.path + "/" + file.name); } }; @@ -57459,7 +57555,7 @@ function getAllAbstractFilesInVault(plugin) { const rootFolder = plugin.app.vault.getRoot(); function recursiveFx(folder) { for (const child of folderChildren(plugin, folder)) { - if (child instanceof import_obsidian48.TFolder) { + if (child instanceof import_obsidian49.TFolder) { const childFolder = child; if (childFolder.children) recursiveFx(childFolder); @@ -57477,7 +57573,7 @@ var getFolderFromPath = (plugin, path) => { const afile = getAbstractFileAtPath(plugin, removeTrailingSlashFromFolder(path)); if (!afile) return null; - return afile instanceof import_obsidian48.TFolder ? afile : afile.parent; + return afile instanceof import_obsidian49.TFolder ? afile : afile.parent; }; var getFolderPathFromString = (plugin, file) => { var _a2; @@ -57589,7 +57685,7 @@ function getAllFoldersInVault(plugin) { folders.push(rootFolder); function recursiveFx(folder) { for (const child of folder.children) { - if (child instanceof import_obsidian48.TFolder) { + if (child instanceof import_obsidian49.TFolder) { const childFolder = child; folders.push(childFolder); if (childFolder.children) @@ -57601,9 +57697,9 @@ function getAllFoldersInVault(plugin) { return folders; } var openAFile = async (file, plugin, newLeaf) => { - if (file instanceof import_obsidian48.TFolder) { + if (file instanceof import_obsidian49.TFolder) { openTFolder(file, plugin, newLeaf); - } else if (file instanceof import_obsidian48.TFile) { + } else if (file instanceof import_obsidian49.TFile) { openTFile(file, plugin, newLeaf); } else { return; @@ -57680,10 +57776,9 @@ var createNewCanvasFile = async (plugin, folder, newFileName, dontOpen) => { }; var createMarkdownFileAtPath = async (plugin, path) => { const folderPath = filePathToFolderPath(path); - let folder = getAbstractFileAtPath(plugin, folderPath); - if (!folder || !(folder instanceof import_obsidian48.TFolder)) { - folder = await plugin.app.vault.createFolder(folderPath); - } + const folder = await plugin.files.createFolder(folderPath); + if (!folder) + return; return plugin.files.newFile(folder.path, folderPathToString(path), "md"); }; var createNewMarkdownFile = async (plugin, folder, newFileName, content, dontOpen) => { @@ -57713,18 +57808,18 @@ var createNewMarkdownFile = async (plugin, folder, newFileName, content, dontOpe return newFile; }; var platformIsMobile = () => { - return import_obsidian48.Platform.isMobile; + return import_obsidian49.Platform.isMobile; }; var noteToFolderNote = async (plugin, file, open) => { const folderPath = fileNameToString(file.path); const folder = getAbstractFileAtPath(plugin, folderPath); - if (folder && folder instanceof import_obsidian48.TFolder) { + if (folder && folder instanceof import_obsidian49.TFolder) { if (open) { openTFolder(folder, plugin, false); } return; } - await plugin.app.vault.createFolder(folderPath); + await plugin.files.createFolder(folderPath); plugin.index.filesIndex.delete(file.path); const newFolderNotePath = folderNotePathFromAFile(plugin.settings, tFileToAFile(getAbstractFileAtPath(plugin, folderPath))); if (newFolderNotePath != file.path) { @@ -57748,7 +57843,7 @@ var folderNoteCache = (plugin, file) => { if (!folderPath) return null; const folder = getAbstractFileAtPath(plugin, folderPath); - if (folder instanceof import_obsidian48.TFolder && folder.name == file.name) { + if (folder instanceof import_obsidian49.TFolder && folder.name == file.name) { return { folderNotePath: file.path, folderPath: folder.path @@ -57775,11 +57870,7 @@ var spaceFolderPathFromSpace = (path, plugin) => { } return path; }; -var folderForSpace = (space, plugin) => getFolderPathFromString(plugin, plugin.settings.spacesFolder) + "/" + space; -var spacesFromFileCache = (cache, plugin) => { - var _a2; - return ((_a2 = cache == null ? void 0 : cache.spaces) != null ? _a2 : []).map((f4) => plugin.index.spacesIndex.get(f4)).filter((f4) => f4).map((f4) => f4.space); -}; +var folderForTagSpace = (space, plugin) => getFolderPathFromString(plugin, plugin.settings.spacesFolder) + "/" + space; // src/utils/contexts/contexts.ts var renamePath = async (plugin, path, newName) => { @@ -57910,7 +58001,7 @@ var linkContextProp = (propType, rows, contextTableRows) => { return serializeMultiString(uniq(contextRows.map((f4) => f4[propType]).filter((f4) => f4))); }; -// src/components/SpaceView/Editor/FlowEditorHover.tsx +// src/react/components/SpaceView/Editor/FlowEditorHover.tsx var FlowEditorHover = (props2) => { var _a2, _b2; const fields = (_b2 = (_a2 = props2.plugin.index.framesIndex.get(props2.path.path)) == null ? void 0 : _a2.frames[props2.path.ref]) == null ? void 0 : _b2.cols; @@ -57996,8 +58087,7 @@ var FlowEditorHover = (props2) => { })), " ")); }; -// src/cm-extensions/flowEditor/flowEditor.tsx -var import_obsidian49 = require("obsidian"); +// src/codemirror/extensions/flowEditor/flowEditor.tsx var toggleFlowEditor = import_state6.Annotation.define(); var cacheFlowEditorHeight = import_state6.Annotation.define(); var preloadFlowEditor = import_state6.EditorState.transactionFilter.of( @@ -58239,8 +58329,8 @@ var FlowEditorSelector = class extends import_view4.WidgetType { const div = document.createElement("div"); div.toggleClass("mk-floweditor-selector", true); const reactEl = createRoot(div); - if (this.info.link && view.state.field(import_obsidian49.editorInfoField, false)) { - const infoField = view.state.field(import_obsidian49.editorInfoField, false); + if (this.info.link && view.state.field(import_obsidian50.editorInfoField, false)) { + const infoField = view.state.field(import_obsidian50.editorInfoField, false); const file = infoField.file; const path = uriByString(this.plugin, this.info.link, file.path); reactEl.render( @@ -58272,7 +58362,7 @@ var flowEditorWidgetDecoration = (info) => import_view4.Decoration.widget({ block: true }); -// src/cm-extensions/flowEditor/flowViewUpdates.ts +// src/codemirror/extensions/flowEditor/flowViewUpdates.ts var import_view5 = require("@codemirror/view"); var flowViewUpdates = (plugin) => import_view5.EditorView.updateListener.of((v3) => { if (v3.heightChanged) { @@ -58314,16 +58404,16 @@ var flowViewUpdates = (plugin) => import_view5.EditorView.updateListener.of((v3) } }); -// src/cm-extensions/inlineStylerView/inlineStyler.tsx +// src/codemirror/extensions/inlineStylerView/inlineStyler.tsx var import_state8 = require("@codemirror/state"); -// src/cm-extensions/inlineStylerView/InlineMenu.tsx +// src/codemirror/extensions/inlineStylerView/InlineMenu.tsx var import_classnames5 = __toESM(require_classnames()); -// src/cm-extensions/inlineStylerView/marks.ts +// src/codemirror/extensions/inlineStylerView/marks.ts var import_state7 = require("@codemirror/state"); -// src/cm-extensions/markSans/obsidianSyntax.ts +// src/codemirror/extensions/markSans/obsidianSyntax.ts var oMarks = [ { mark: "em", @@ -58348,7 +58438,7 @@ var oMarks = [ } ]; -// src/cm-extensions/inlineStylerView/marks.ts +// src/codemirror/extensions/inlineStylerView/marks.ts var toggleMark = import_state7.Annotation.define(); var trimSpace = (pos, moveDirLeft, state) => { if (moveDirLeft && state.sliceDoc(pos, pos + 1) == " ") @@ -58506,7 +58596,7 @@ var toggleMarkExtension = import_state7.EditorState.transactionFilter.of( } ); -// src/cm-extensions/inlineStylerView/Mark.tsx +// src/codemirror/extensions/inlineStylerView/Mark.tsx var Mark = (props2) => { const { i: i4, style, active, toggleMarkAction } = props2; return /* @__PURE__ */ Cn.createElement("div", { @@ -58518,7 +58608,7 @@ var Mark = (props2) => { }); }; -// src/cm-extensions/inlineStylerView/styles/default.ts +// src/codemirror/extensions/inlineStylerView/styles/default.ts var default_default = [ { label: "bold", @@ -58563,12 +58653,12 @@ var default_default = [ } ]; -// src/cm-extensions/inlineStylerView/styles/index.ts +// src/codemirror/extensions/inlineStylerView/styles/index.ts function resolveStyles() { return default_default; } -// src/cm-extensions/inlineStylerView/InlineMenu.tsx +// src/codemirror/extensions/inlineStylerView/InlineMenu.tsx var loadStylerIntoContainer = (el, plugin) => { const root = createRoot(el); root.render( @@ -58759,7 +58849,7 @@ var InlineMenuComponent = (props2) => { }, mode == 0 && props2.mobile ? makeMode() : mode == 2 ? colorsMode() : marksMode()); }; -// src/cm-extensions/inlineStylerView/inlineStyler.tsx +// src/codemirror/extensions/inlineStylerView/inlineStyler.tsx var cursorTooltipField = (plugin) => import_state8.StateField.define({ create: getCursorTooltips(plugin), update(tooltips2, tr) { @@ -58800,7 +58890,7 @@ function cursorTooltip(plugin) { return cursorTooltipField(plugin); } -// src/cm-extensions/placeholder.ts +// src/codemirror/extensions/placeholder.ts var import_state9 = require("@codemirror/state"); var import_view6 = require("@codemirror/view"); var placeholderLine = (plugin) => import_view6.Decoration.line({ @@ -58822,9 +58912,9 @@ var placeholderExtension = (plugin) => import_state9.StateField.define({ provide: (f4) => import_view6.EditorView.decorations.from(f4) }); -// src/cm-extensions/inlineContext/inlineContext.tsx +// src/codemirror/extensions/inlineContext/inlineContext.tsx var import_state10 = require("@codemirror/state"); -var import_obsidian50 = require("obsidian"); +var import_obsidian51 = require("obsidian"); var frontmatterHider = (plugin) => import_state10.EditorState.transactionFilter.of((tr) => { const newTrans = []; const isFM = (typeString) => { @@ -58842,7 +58932,7 @@ var frontmatterHider = (plugin) => import_state10.EditorState.transactionFilter. } } }); - const livePreview = tr.state.field(import_obsidian50.editorLivePreviewField, false); + const livePreview = tr.state.field(import_obsidian51.editorLivePreviewField, false); if (fmStart > 1 && fmStart <= tr.state.doc.lines && plugin.settings.hideFrontmatter && livePreview) { newTrans.push({ annotations: [contentRange.of([fmStart, fmEnd])] @@ -58855,39 +58945,10 @@ var frontmatterHider = (plugin) => import_state10.EditorState.transactionFilter. return [tr, ...newTrans]; }); -// src/cm-extensions/lineNumbers.ts -var import_view7 = require("@codemirror/view"); -var lineNumberExtension = (plugin) => (0, import_view7.lineNumbers)({ - formatNumber: (lineNo, state) => { - if (!plugin.settings.inlineContext) { - return lineNo.toString(); - } - const isFM = (state2, typeString, from, to) => { - if (typeString.contains("hmd-frontmatter")) { - return true; - } - return false; - }; - let fmEnd = 0; - iterateTreeInDocument(state, { - enter: ({ type, from, to }) => { - if (isFM(state, type.name, from, to)) { - fmEnd = to; - } - } - }); - const newLine = fmEnd > 0 ? lineNo - state.doc.lineAt(Math.min(fmEnd, state.doc.length - 1)).number : lineNo; - return newLine > 0 ? newLine.toString() : lineNo.toString(); - } -}); - -// src/cm-extensions/cmExtensions.ts +// src/codemirror/extensions/cmExtensions.ts var cmExtensions = (plugin, mobile) => { const extensions = [...editBlockExtensions()]; if (plugin.settings.makerMode) { - if (plugin.settings.inlineContext && plugin.settings.lineNumbers) { - extensions.push(lineNumberExtension(plugin)); - } if (plugin.settings.inlineContext && plugin.settings.makerMode && !corePluginEnabled(plugin.app, "properties")) extensions.push(...[frontmatterHider(plugin)]); extensions.push( @@ -58917,10 +58978,13 @@ var cmExtensions = (plugin, mobile) => { return extensions; }; -// src/components/SpaceView/Editor/MakeMenu/MakeMenu.tsx -var import_obsidian52 = require("obsidian"); +// src/main.ts +var import_obsidian68 = require("obsidian"); -// src/components/SpaceView/Editor/MakeMenu/commands/default.ts +// src/react/components/SpaceView/Editor/MakeMenu/MakeMenu.tsx +var import_obsidian53 = require("obsidian"); + +// src/react/components/SpaceView/Editor/MakeMenu/commands/default.ts var default_default2 = [ { label: "todo", @@ -59017,7 +59081,7 @@ Type/Paste Your Code } ]; -// src/components/SpaceView/Editor/MakeMenu/commands/index.ts +// src/react/components/SpaceView/Editor/MakeMenu/commands/index.ts function resolveCommands(plugin) { const allFrames = plugin.settings.quickFrames.flatMap((f4) => { var _a2; @@ -59033,8 +59097,8 @@ function resolveCommands(plugin) { return [...default_default2]; } -// src/components/SpaceView/Editor/MakeMenu/MakeMenu.tsx -var MakeMenu = class extends import_obsidian52.EditorSuggest { +// src/react/components/SpaceView/Editor/MakeMenu/MakeMenu.tsx +var MakeMenu = class extends import_obsidian53.EditorSuggest { constructor(app2, plugin) { super(app2); this.inCmd = false; @@ -59127,9 +59191,9 @@ var MakeMenu = class extends import_obsidian52.EditorSuggest { } }; -// src/components/SpaceView/Editor/StickerMenu/StickerMenu.tsx -var import_obsidian53 = require("obsidian"); -var StickerMenu = class extends import_obsidian53.EditorSuggest { +// src/react/components/SpaceView/Editor/StickerMenu/StickerMenu.tsx +var import_obsidian54 = require("obsidian"); +var StickerMenu = class extends import_obsidian54.EditorSuggest { constructor(app2, plugin) { super(app2); this.inCmd = false; @@ -59198,9 +59262,6 @@ var StickerMenu = class extends import_obsidian53.EditorSuggest { } }; -// src/main.ts -var import_obsidian67 = require("obsidian"); - // src/utils/flow/markdownPost.tsx var getCMFromElement = (el, plugin) => { let dom = el; @@ -59295,10 +59356,10 @@ var replaceAllEmbed = (el, ctx, plugin) => { }); }; -// src/components/Navigator/FileTreeView.tsx -var import_obsidian56 = require("obsidian"); +// src/react/components/Navigator/FileTreeView.tsx +var import_obsidian57 = require("obsidian"); -// src/context/SidebarContext.tsx +// src/react/context/SidebarContext.tsx var import_lodash12 = __toESM(require_lodash()); var NavigatorContext = F({ dragPaths: [], @@ -59408,7 +59469,7 @@ var SidebarProvider = (props2) => { }, props2.children); }; -// src/components/Navigator/SpaceTree/SpaceTreeItem.tsx +// src/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx var import_classnames6 = __toESM(require_classnames()); // node_modules/react-dropzone/dist/es/index.js @@ -60570,7 +60631,7 @@ function reducer2(state, action) { function noop2() { } -// src/components/Navigator/SpaceTree/SpaceTreeItem.tsx +// src/react/components/Navigator/SpaceTree/SpaceTreeItem.tsx var eventToModifier = (e4) => e4.altKey ? "copy" : e4.shiftKey ? "link" : "move"; var TreeItem = k3( ({ @@ -60616,9 +60677,6 @@ var TreeItem = k3( return; } if (file.item.cacheType == "space") { - if (plugin.settings.expandFolderOnClick) { - onCollapse(data2, true); - } openSpace( file.item.path, plugin, @@ -60626,27 +60684,18 @@ var TreeItem = k3( ); setActiveFile(uriByString(plugin, file.item.path)); setSelectedFiles([file]); - return; - } - if (!plugin.settings.contextEnabled) { - if (!file.item.isFolder) { - openAFile( - getAbstractFileAtPath(plugin, file.item.path), - plugin, - e4.ctrlKey || e4.metaKey || e4.button == 1 ? e4.altKey ? "split" : "tab" : false - ); - setActiveFile(uriByString(plugin, file.item.path)); - setSelectedFiles([file]); + if (plugin.settings.expandFolderOnClick) { + onCollapse(data2, true); } - } else { - openAFile( - getAbstractFileAtPath(plugin, file.item.path), - plugin, - e4.ctrlKey || e4.metaKey ? e4.altKey ? "split" : "tab" : false - ); - setActiveFile(uriByString(plugin, file.item.path)); - setSelectedFiles([file]); + return; } + openAFile( + getAbstractFileAtPath(plugin, file.item.path), + plugin, + e4.ctrlKey || e4.metaKey || e4.button == 1 ? e4.altKey ? "split" : "tab" : false + ); + setActiveFile(uriByString(plugin, file.item.path)); + setSelectedFiles([file]); }; const onDragStarted = (e4) => { if (selectedFiles.length > 1) { @@ -60748,6 +60797,17 @@ var TreeItem = k3( }; const newAction = (e4) => { const space = data2.item; + if (e4.shiftKey) { + showLinkMenu( + e4, + plugin, + (link) => { + insertSpaceItemAtIndex(plugin, space, link); + }, + "Select a Note or Space to Pin" + ); + return; + } newFileInSpace(plugin, space, space.space.uri); }; const handleRightClick = (e4) => { @@ -60878,13 +60938,10 @@ var TreeItem = k3( fileCache }), /* @__PURE__ */ Cn.createElement("div", { className: `mk-tree-text ${isFolder ? "nav-folder-title-content" : "nav-file-title-content"}` - }, plugin.settings.spacesUseAlias ? fileCache.alias : fileCache.name, isLink && /* @__PURE__ */ Cn.createElement("span", { + }, plugin.settings.spacesUseAlias ? fileCache.alias : fileCache.name, isLink && plugin.settings.showSpacePinIcon && /* @__PURE__ */ Cn.createElement("span", { className: "mk-file-link", dangerouslySetInnerHTML: { - __html: stickerFromString( - "lucide//arrow-up-right", - plugin - ) + __html: stickerFromString("lucide//pin", plugin) } })), !isFolder && extension != "md" && /* @__PURE__ */ Cn.createElement("span", { className: "nav-file-tag" @@ -60913,7 +60970,7 @@ var TreeItem = k3( ); TreeItem.displayName = "TreeItem"; -// src/components/Navigator/SpaceTree/SpaceTreeSectionItem.tsx +// src/react/components/Navigator/SpaceTree/SpaceTreeSectionItem.tsx var TreeSectionItem = k3( ({ childCount, @@ -60948,7 +61005,7 @@ var TreeSectionItem = k3( ); TreeSectionItem.displayName = "TreeSectionItem"; -// src/components/Navigator/SpaceTree/SpaceTreeNodeView.tsx +// src/react/components/Navigator/SpaceTree/SpaceTreeNodeView.tsx var animateLayoutChanges2 = ({ isSorting, wasDragging @@ -61019,7 +61076,7 @@ var SortableTreeItem = ({ }); }; -// src/hooks/ForceUpdate.tsx +// src/react/hooks/ForceUpdate.tsx function useForceUpdate() { const [value, setValue] = h2(0); return () => setValue((value2) => value2 + 1); @@ -61540,7 +61597,7 @@ function calculateRange(_ref4) { }; } -// src/components/Navigator/SpaceTree/SpaceTreeVirtualized.tsx +// src/react/components/Navigator/SpaceTree/SpaceTreeVirtualized.tsx var VirtualizedList = Cn.memo(function VirtualizedList2(props2) { const { flattenedTree, @@ -61675,7 +61732,7 @@ var VirtualizedList = Cn.memo(function VirtualizedList2(props2) { }))); }); -// src/components/Navigator/SpaceTree/SpaceTreeView.tsx +// src/react/components/Navigator/SpaceTree/SpaceTreeView.tsx var FileExplorerComponent = (props2) => { const { plugin } = props2; const indentationWidth = 16; @@ -62106,7 +62163,7 @@ var FileExplorerComponent = (props2) => { e4.dataTransfer.dropEffect = modifier2; if (projected) { plugin.app.dragManager.setAction( - `${projected.reorder && !projected.insert ? "Reorder in" : modifier2 == "move" || !modifier2 ? `Move to` : modifier2 == "link" ? `Add to` : `Copy to`} ${projected.insert ? overName : parentName}` + `${projected.reorder && !projected.insert ? i18n_default.labels.reorderIn : modifier2 == "move" || !modifier2 ? i18n_default.labels.moveTo : modifier2 == "link" ? i18n_default.labels.addTo : i18n_default.labels.copyTo} ${projected.insert ? overName : parentName}` ); } if (dragPaths.length > 1) { @@ -62283,17 +62340,16 @@ var FileExplorerComponent = (props2) => { color: "var(--text-on-accent)", fontSize: "var(--font-ui-smaller)" } - }, /* @__PURE__ */ Cn.createElement("div", null, "Hold", " ", /* @__PURE__ */ Cn.createElement("span", { - style: { fontFamily: "var(--font-monospace)" } - }, "shift"), " ", "to Add and ", normalizedAltName(), " to Copy"))); + }, /* @__PURE__ */ Cn.createElement("div", null, i18n_default.hintText.dragDropModifierKeys.replace("${1}", "shift").replace("${2}", normalizedAltName())))); }; -// src/components/Navigator/MainMenu.tsx +// src/react/components/Navigator/MainMenu.tsx var import_classnames7 = __toESM(require_classnames()); +var import_obsidian56 = require("obsidian"); -// src/components/UI/modals/hiddenFilesModal.tsx -var import_obsidian54 = require("obsidian"); -var HiddenItemsModal = class extends import_obsidian54.Modal { +// src/react/components/UI/Modals/hiddenFilesModal.tsx +var import_obsidian55 = require("obsidian"); +var HiddenItemsModal = class extends import_obsidian55.Modal { constructor(plugin) { super(plugin.app); this.plugin = plugin; @@ -62438,8 +62494,7 @@ var HiddenFiles = (props2) => { }, "+ ", i18n_default.buttons.addFile))); }; -// src/components/Navigator/MainMenu.tsx -var import_obsidian55 = require("obsidian"); +// src/react/components/Navigator/MainMenu.tsx var replaceMobileMainMenu = (plugin) => { if (platformIsMobile()) { const header = app.workspace.containerEl.querySelector( @@ -62527,7 +62582,7 @@ var MainMenu = (props2) => { }; const showMenu = () => { const { spaceActive, leafs } = refreshLeafs(); - const menu = new import_obsidian55.Menu(); + const menu = new import_obsidian56.Menu(); !spaceActive && menu.addItem((menuItem) => { menuItem.setIcon("lucide-arrow-left"); menuItem.setTitle(i18n_default.menu.backToSpace); @@ -62538,14 +62593,60 @@ var MainMenu = (props2) => { } }); }); - menu.addItem((menuItem) => { - menuItem.setTitle("Open Space"); - menuItem.setIcon("layout"); - menuItem.onClick((ev) => { - openSpace(activeViewSpace.path, props2.plugin, false); + if (activeViewSpace.type != "default") { + menu.addItem((menuItem) => { + menuItem.setTitle("Open Space"); + menuItem.setIcon("layout"); + menuItem.onClick((ev) => { + openSpace(activeViewSpace.path, props2.plugin, false); + }); }); - }); + menu.addSeparator(); + menu.addItem((menuItem) => { + menuItem.setIcon("folder-plus"); + menuItem.setTitle(i18n_default.buttons.createFolder); + menuItem.onClick((ev) => { + const vaultChangeModal = new EditSpaceModal( + plugin, + null, + "create", + null, + activeViewSpace + ); + vaultChangeModal.open(); + }); + }); + menu.addItem((menuItem) => { + menuItem.setIcon("pin"); + menuItem.setTitle(i18n_default.buttons.addIntoSpace); + menuItem.onClick((ev) => { + ev.preventDefault(); + ev.stopPropagation(); + showLinkMenu(ev, plugin, (link) => { + insertSpaceItemAtIndex(plugin, activeViewSpace, link); + }); + }); + }); + } menu.addSeparator(); + if (plugin.settings.enableDefaultSpaces) { + if (plugin.settings.enableHomeSpace) + menu.addItem((menuItem) => { + menuItem.setTitle("Home"); + menuItem.setIcon("home"); + menuItem.onClick((ev) => { + setActiveViewSpaceByPath("Spaces/Home"); + }); + }); + if (plugin.settings.enableTagSpaces) + menu.addItem((menuItem) => { + menuItem.setTitle(i18n_default.menu.tags); + menuItem.setIcon("tags"); + menuItem.onClick((ev) => { + setActiveViewSpaceByPath("spaces://$tags"); + }); + }); + } menu.addItem((menuItem) => { menuItem.setTitle("Vault"); menuItem.setIcon("vault"); @@ -62553,13 +62654,6 @@ var MainMenu = (props2) => { setActiveViewSpaceByPath("/"); }); }); - menu.addItem((menuItem) => { - menuItem.setTitle(i18n_default.menu.tags); - menuItem.setIcon("tags"); - menuItem.onClick((ev) => { - setActiveViewSpaceByPath("spaces://$tags"); - }); - }); menu.addSeparator(); menu.addItem((menuItem) => { menuItem.setIcon("lucide-chevrons-down-up"); @@ -62739,7 +62833,7 @@ var MainMenu = (props2) => { })); }; -// src/components/Navigator/Waypoints/Waypoint.tsx +// src/react/components/Navigator/Waypoints/Waypoint.tsx var import_classnames8 = __toESM(require_classnames()); var animateLayoutChanges3 = ({ isSorting, @@ -62825,7 +62919,7 @@ var PinnedSpace = k3( openSpace(pin.path, plugin, false); saveActiveSpace(pin.path); }, - onContextMenu: (e4) => triggerSpaceMenu(plugin, pin, e4, activeFile, null), + onContextMenu: (e4) => triggerSpaceMenu(plugin, pin, e4, activeFile, "spaces://$waypoints"), onDragOver: (e4) => { e4.preventDefault(); setModifier(eventToModifier(e4)); @@ -62887,7 +62981,7 @@ var PinnedSpace = k3( ); PinnedSpace.displayName = "PinnedSpace"; -// src/components/Navigator/Waypoints/Waypoints.tsx +// src/react/components/Navigator/Waypoints/Waypoints.tsx var SpaceSwitcher = (props2) => { const { activeFile, @@ -63093,7 +63187,27 @@ var SpaceSwitcher = (props2) => { dragEnded, dragActive: activeId !== null, ghost: activeId === pin.path - })), overId != null && activeId === null && /* @__PURE__ */ Cn.createElement(SortablePinnedSpaceItem, { + })), /* @__PURE__ */ Cn.createElement("div", { + className: "mk-waypoint-new", + onClick: (e4) => showSpacesMenu( + e4, + props2.plugin, + (link) => { + toggleSpacePin( + props2.plugin, + link, + "waypoints", + false, + waypoints.length + ); + }, + true, + true + ), + dangerouslySetInnerHTML: { + __html: stickerFromString("lucide//plus", props2.plugin) + } + }), overId != null && activeId === null && /* @__PURE__ */ Cn.createElement(SortablePinnedSpaceItem, { id: waypoints.length, plugin: props2.plugin, highlighted: false, @@ -63117,7 +63231,7 @@ var SpaceSwitcher = (props2) => { ))); }; -// src/components/Navigator/MainList.tsx +// src/react/components/Navigator/MainList.tsx var MainList = (props2) => { const { activeViewSpace } = q2(NavigatorContext); const [error, resetError] = P2(); @@ -63154,18 +63268,18 @@ var MainList = (props2) => { })); }; -// src/components/Navigator/FileTreeView.tsx +// src/react/components/Navigator/FileTreeView.tsx var FILE_TREE_VIEW_TYPE = "mk-file-view"; var VIEW_DISPLAY_TEXT = "Spaces"; var ICON = "layout-grid"; -var FileTreeView = class extends import_obsidian56.ItemView { +var FileTreeView = class extends import_obsidian57.ItemView { constructor(leaf, plugin) { super(leaf); this.navigation = false; this.plugin = plugin; } revealInFolder(file) { - if (file instanceof import_obsidian56.TFolder) { + if (file instanceof import_obsidian57.TFolder) { this.plugin.app.workspace.activeLeaf.setViewState({ type: SPACE_VIEW_TYPE, state: { path: file.path } @@ -63219,7 +63333,7 @@ var FileTreeView = class extends import_obsidian56.ItemView { }; // src/settings/settings.ts -var import_obsidian57 = require("obsidian"); +var import_obsidian58 = require("obsidian"); var DEFAULT_SETTINGS = { defaultInitialization: false, filePreviewOnHover: false, @@ -63275,7 +63389,7 @@ var DEFAULT_SETTINGS = { inlineContextSectionsExpanded: true, dataviewInlineContext: false, inlineContextNameLayout: "vertical", - waypoints: [], + waypoints: ["Spaces/Home", "/", "spaces://$tags"], rootSpaces: [], spacesUseAlias: false, fmKeyAlias: "aliases", @@ -63292,9 +63406,13 @@ var DEFAULT_SETTINGS = { readableLineWidth: true, autoAddContextsToSubtags: true, autoMigration08: false, - releaseNotesPrompt: 0.8 + releaseNotesPrompt: 0.8, + enableDefaultSpaces: true, + enableTagSpaces: true, + enableHomeSpace: true, + showSpacePinIcon: true }; -var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { +var MakeMDPluginSettingsTab = class extends import_obsidian58.PluginSettingTab { constructor(app2, plugin) { super(app2, plugin); this.plugin = plugin; @@ -63306,7 +63424,7 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { const { containerEl } = this; containerEl.empty(); containerEl.createEl("h1", { text: i18n_default.settings.sectionSidebar }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.spaces.name).setDesc(i18n_default.settings.spaces.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.spaces.name).setDesc(i18n_default.settings.spaces.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.spacesEnabled).onChange((value) => { this.plugin.settings.spacesEnabled = value; this.plugin.saveSettings(); @@ -63319,56 +63437,78 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }) ); if (this.plugin.settings.spacesEnabled) { + containerEl.createEl("h3", { text: i18n_default.settings.sectionDefault }); + const defaultSpaces = containerEl.createEl("div"); + new import_obsidian58.Setting(defaultSpaces).setName(i18n_default.settings.defaultSpaces.name).setDesc(i18n_default.settings.defaultSpaces.desc).addToggle( + (toggle) => toggle.setValue(this.plugin.settings.enableDefaultSpaces).onChange((value) => { + this.plugin.settings.enableDefaultSpaces = value; + this.plugin.saveSettings(); + }) + ); + if (this.plugin.settings.enableDefaultSpaces) { + new import_obsidian58.Setting(defaultSpaces).setName(i18n_default.settings.homeSpace.name).setDesc(i18n_default.settings.homeSpace.desc).addToggle( + (toggle) => toggle.setValue(this.plugin.settings.enableHomeSpace).onChange((value) => { + this.plugin.settings.enableHomeSpace = value; + this.plugin.saveSettings(); + }) + ); + new import_obsidian58.Setting(defaultSpaces).setName(i18n_default.settings.tagSpaces.name).setDesc(i18n_default.settings.tagSpaces.desc).addToggle( + (toggle) => toggle.setValue(this.plugin.settings.enableTagSpaces).onChange((value) => { + this.plugin.settings.enableTagSpaces = value; + this.plugin.saveSettings(); + }) + ); + } containerEl.createEl("h3", { text: i18n_default.settings.sectionAppearance }); const spaceAppearances = containerEl.createEl("div"); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.sidebarTabs.name).setDesc(i18n_default.settings.sidebarTabs.desc).addToggle( + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.sidebarTabs.name).setDesc(i18n_default.settings.sidebarTabs.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.sidebarTabs).onChange((value) => { this.plugin.settings.sidebarTabs = value; this.plugin.saveSettings(); document.body.classList.toggle("mk-hide-tabs", !value); }) ); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.hideRibbon.name).setDesc(i18n_default.settings.hideRibbon.desc).addToggle( + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.hideRibbon.name).setDesc(i18n_default.settings.hideRibbon.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.showRibbon).onChange((value) => { this.plugin.settings.showRibbon = value; this.plugin.saveSettings(); document.body.classList.toggle("mk-hide-ribbon", !value); }) ); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.folderIndentationLines.name).setDesc(i18n_default.settings.folderIndentationLines.desc).addToggle( + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.folderIndentationLines.name).setDesc(i18n_default.settings.folderIndentationLines.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.folderIndentationLines).onChange((value) => { this.plugin.settings.folderIndentationLines = value; this.plugin.saveSettings(); document.body.classList.toggle("mk-folder-lines", value); }) ); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.spacesStickers.name).setDesc(i18n_default.settings.spacesStickers.desc).addToggle( + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.spacesStickers.name).setDesc(i18n_default.settings.spacesStickers.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.spacesStickers).onChange((value) => { this.plugin.settings.spacesStickers = value; this.plugin.saveSettings(); this.refreshView(); }) ); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.spacesAlias.name).setDesc(i18n_default.settings.spacesAlias.desc).addToggle( + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.spacesAlias.name).setDesc(i18n_default.settings.spacesAlias.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.spacesUseAlias).onChange((value) => { this.plugin.settings.spacesUseAlias = value; this.plugin.saveSettings(); this.refreshView(); }) ); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.readableLineWidth.name).setDesc(i18n_default.settings.readableLineWidth.desc).addToggle( + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.readableLineWidth.name).setDesc(i18n_default.settings.readableLineWidth.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.readableLineWidth).onChange((value) => { this.plugin.settings.readableLineWidth = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.openSpacesOnLaunch.name).setDesc(i18n_default.settings.openSpacesOnLaunch.desc).addToggle( + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.openSpacesOnLaunch.name).setDesc(i18n_default.settings.openSpacesOnLaunch.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.openSpacesOnLaunch).onChange((value) => { this.plugin.settings.openSpacesOnLaunch = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(spaceAppearances).setName(i18n_default.settings.spaceRowHeight.name).setDesc(i18n_default.settings.spaceRowHeight.desc).addText((text2) => { + new import_obsidian58.Setting(spaceAppearances).setName(i18n_default.settings.spaceRowHeight.name).setDesc(i18n_default.settings.spaceRowHeight.desc).addText((text2) => { text2.setValue(this.plugin.settings.spaceRowHeight.toString()).onChange(async (value) => { text2.setValue(parseInt(value).toString()); this.plugin.settings.spaceRowHeight = parseInt(value); @@ -63376,43 +63516,43 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }); }); containerEl.createEl("h3", { text: "Advanced" }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.expandFolder.name).setDesc(i18n_default.settings.expandFolder.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.expandFolder.name).setDesc(i18n_default.settings.expandFolder.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.expandFolderOnClick).onChange((value) => { this.plugin.settings.expandFolderOnClick = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.hoverPreview.name).setDesc(i18n_default.settings.hoverPreview.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.hoverPreview.name).setDesc(i18n_default.settings.hoverPreview.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.filePreviewOnHover).onChange((value) => { this.plugin.settings.filePreviewOnHover = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.activeFile.name).setDesc(i18n_default.settings.activeFile.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.activeFile.name).setDesc(i18n_default.settings.activeFile.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.revealActiveFile).onChange((value) => { this.plugin.settings.revealActiveFile = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.spacesFileExplorerDual.name).setDesc(i18n_default.settings.spacesFileExplorerDual.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.spacesFileExplorerDual.name).setDesc(i18n_default.settings.spacesFileExplorerDual.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.spacesDisablePatch).onChange((value) => { this.plugin.settings.spacesDisablePatch = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.spacesPerformance.name).setDesc(i18n_default.settings.spacesPerformance.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.spacesPerformance.name).setDesc(i18n_default.settings.spacesPerformance.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.spacesPerformance).onChange((value) => { this.plugin.settings.spacesPerformance = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.indexSVG.name).setDesc(i18n_default.settings.indexSVG.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.indexSVG.name).setDesc(i18n_default.settings.indexSVG.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.indexSVG).onChange((value) => { this.plugin.settings.indexSVG = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.spacesDeleteOption.name).setDesc(i18n_default.settings.spacesDeleteOption.desc).addDropdown((dropdown) => { + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.spacesDeleteOption.name).setDesc(i18n_default.settings.spacesDeleteOption.desc).addDropdown((dropdown) => { dropdown.addOption( "permanent", i18n_default.settings.spacesDeleteOptions.permanant @@ -63430,7 +63570,7 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }); } containerEl.createEl("h1", { text: "Context" }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.contexts.name).setDesc(i18n_default.settings.contexts.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.contexts.name).setDesc(i18n_default.settings.contexts.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.contextEnabled).onChange((value) => { this.plugin.settings.contextEnabled = value; this.plugin.saveSettings(); @@ -63438,27 +63578,27 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }) ); containerEl.createEl("h3", { text: i18n_default.settings.sectionAppearance }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.defaultDateFormat.name).setDesc(i18n_default.settings.defaultDateFormat.desc).addText((text2) => { + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.defaultDateFormat.name).setDesc(i18n_default.settings.defaultDateFormat.desc).addText((text2) => { text2.setValue(this.plugin.settings.defaultDateFormat).onChange(async (value) => { this.plugin.settings.defaultDateFormat = value; await this.plugin.saveSettings(); }); }); containerEl.createEl("h3", { text: i18n_default.settings.sectionAdvanced }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.openFileContext.name).setDesc(i18n_default.settings.openFileContext.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.openFileContext.name).setDesc(i18n_default.settings.openFileContext.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.autoOpenFileContext).onChange((value) => { this.plugin.settings.autoOpenFileContext = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.syncContextToFrontmatter.name).setDesc(i18n_default.settings.syncContextToFrontmatter.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.syncContextToFrontmatter.name).setDesc(i18n_default.settings.syncContextToFrontmatter.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.saveAllContextToFrontmatter).onChange((value) => { this.plugin.settings.saveAllContextToFrontmatter = value; this.plugin.saveSettings(); }) ); containerEl.createEl("h1", { text: "Blink" }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.blink.name).setDesc(i18n_default.settings.blink.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.blink.name).setDesc(i18n_default.settings.blink.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.blinkEnabled).onChange(async (value) => { this.plugin.settings.blinkEnabled = value; await this.plugin.saveSettings(); @@ -63466,7 +63606,7 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }) ); containerEl.createEl("h1", { text: i18n_default.settings.sectionFlow }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.editorMakerMode.name).setDesc(i18n_default.settings.editorMakerMode.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.editorMakerMode.name).setDesc(i18n_default.settings.editorMakerMode.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.makerMode).onChange((value) => { this.plugin.settings.makerMode = value; this.plugin.saveSettings(); @@ -63475,27 +63615,27 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { ); if (this.plugin.settings.makerMode) { containerEl.createEl("h3", { text: "Inline Context" }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.inlineContextExplorer.name).setDesc(i18n_default.settings.inlineContextExplorer.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.inlineContextExplorer.name).setDesc(i18n_default.settings.inlineContextExplorer.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.inlineContext).onChange((value) => { this.plugin.settings.inlineContext = value; this.plugin.saveSettings(); this.plugin.reloadExtensions(false); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.lineNumbers.name).setDesc(i18n_default.settings.lineNumbers.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.lineNumbers.name).setDesc(i18n_default.settings.lineNumbers.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.lineNumbers).onChange(async (value) => { this.plugin.settings.lineNumbers = value; await this.plugin.saveSettings(); this.plugin.reloadExtensions(false); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.inlineContextExpanded.name).setDesc(i18n_default.settings.inlineContextExpanded.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.inlineContextExpanded.name).setDesc(i18n_default.settings.inlineContextExpanded.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.inlineContextSectionsExpanded).onChange((value) => { this.plugin.settings.inlineContextSectionsExpanded = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.inlineContextHorizontal.name).setDesc(i18n_default.settings.inlineContextHorizontal.desc).addDropdown((dropdown) => { + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.inlineContextHorizontal.name).setDesc(i18n_default.settings.inlineContextHorizontal.desc).addDropdown((dropdown) => { dropdown.addOption("vertical", i18n_default.settings.layoutVertical); dropdown.addOption("horizontal", i18n_default.settings.layoutHorizontal); dropdown.setValue(this.plugin.settings.inlineContextNameLayout); @@ -63504,20 +63644,20 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { this.plugin.saveSettings(); }); }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.hideFrontmatter.name).setDesc(i18n_default.settings.hideFrontmatter.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.hideFrontmatter.name).setDesc(i18n_default.settings.hideFrontmatter.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.hideFrontmatter).onChange(async (value) => { this.plugin.settings.hideFrontmatter = value; await this.plugin.saveSettings(); this.plugin.reloadExtensions(false); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.dataviewInlineContext.name).setDesc(i18n_default.settings.dataviewInlineContext.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.dataviewInlineContext.name).setDesc(i18n_default.settings.dataviewInlineContext.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.dataviewInlineContext).onChange((value) => { this.plugin.settings.dataviewInlineContext = value; this.plugin.saveSettings(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.inlineBacklinks.name).setDesc(i18n_default.settings.inlineBacklinks.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.inlineBacklinks.name).setDesc(i18n_default.settings.inlineBacklinks.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.inlineBacklinks).onChange(async (value) => { this.plugin.settings.inlineBacklinks = value; await this.plugin.saveSettings(); @@ -63525,21 +63665,21 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }) ); containerEl.createEl("h3", { text: "Flow Block" }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.editorFlowReplace.name).setDesc(i18n_default.settings.editorFlowReplace.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.editorFlowReplace.name).setDesc(i18n_default.settings.editorFlowReplace.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.editorFlow).onChange((value) => { this.plugin.settings.editorFlow = value; this.plugin.saveSettings(); this.refreshView(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.internalLinkFlowEditor.name).setDesc(i18n_default.settings.internalLinkFlowEditor.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.internalLinkFlowEditor.name).setDesc(i18n_default.settings.internalLinkFlowEditor.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.internalLinkClickFlow).onChange(async (value) => { this.plugin.settings.internalLinkClickFlow = value; await this.plugin.saveSettings(); this.plugin.reloadExtensions(false); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.editorFlowStyle.name).setDesc(i18n_default.settings.editorFlowStyle.desc).addDropdown((dropdown) => { + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.editorFlowStyle.name).setDesc(i18n_default.settings.editorFlowStyle.desc).addDropdown((dropdown) => { dropdown.addOption("classic", i18n_default.settings.editorFlowStyle.classic); dropdown.addOption("seamless", i18n_default.settings.editorFlowStyle.seamless); dropdown.addOption("minimal", i18n_default.settings.editorFlowStyle.minimal); @@ -63557,14 +63697,14 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }); }); containerEl.createEl("h3", { text: "Flow Menu" }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.editorMakeMenu.name).setDesc(i18n_default.settings.editorMakeMenu.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.editorMakeMenu.name).setDesc(i18n_default.settings.editorMakeMenu.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.flowMenuEnabled).onChange(async (value) => { this.plugin.settings.flowMenuEnabled = value; await this.plugin.saveSettings(); this.plugin.reloadExtensions(false); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.makeChar.name).setDesc(i18n_default.settings.makeChar.desc).addText((text2) => { + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.makeChar.name).setDesc(i18n_default.settings.makeChar.desc).addText((text2) => { text2.setValue(this.plugin.settings.menuTriggerChar).onChange(async (value) => { if (value.length < 1) { text2.setValue(this.plugin.settings.menuTriggerChar); @@ -63579,7 +63719,7 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { await this.plugin.saveSettings(); }); }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.editorMakePlacholder.name).setDesc(i18n_default.settings.editorMakePlacholder.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.editorMakePlacholder.name).setDesc(i18n_default.settings.editorMakePlacholder.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.makeMenuPlaceholder).onChange(async (value) => { this.plugin.settings.makeMenuPlaceholder = value; await this.plugin.saveSettings(); @@ -63587,28 +63727,28 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { }) ); containerEl.createEl("h3", { text: "Flow Styler" }); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.inlineStyler.name).setDesc(i18n_default.settings.inlineStyler.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.inlineStyler.name).setDesc(i18n_default.settings.inlineStyler.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.inlineStyler).onChange(async (value) => { this.plugin.settings.inlineStyler = value; await this.plugin.saveSettings(); this.plugin.reloadExtensions(false); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.inlineStickerMenu.name).setDesc(i18n_default.settings.inlineStickerMenu.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.inlineStickerMenu.name).setDesc(i18n_default.settings.inlineStickerMenu.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.inlineStickerMenu).onChange(async (value) => { this.plugin.settings.inlineStickerMenu = value; await this.plugin.saveSettings(); this.plugin.reloadExtensions(false); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.inlineStylerColor.name).setDesc(i18n_default.settings.inlineStylerColor.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.inlineStylerColor.name).setDesc(i18n_default.settings.inlineStylerColor.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.inlineStylerColors).onChange((value) => { this.plugin.settings.inlineStylerColors = value; this.plugin.saveSettings(); this.refreshView(); }) ); - new import_obsidian57.Setting(containerEl).setName(i18n_default.settings.mobileMakeBar.name).setDesc(i18n_default.settings.mobileMakeBar.desc).addToggle( + new import_obsidian58.Setting(containerEl).setName(i18n_default.settings.mobileMakeBar.name).setDesc(i18n_default.settings.mobileMakeBar.desc).addToggle( (toggle) => toggle.setValue(this.plugin.settings.mobileMakeBar).onChange((value) => { this.plugin.settings.mobileMakeBar = value; this.plugin.saveSettings(); @@ -63619,10 +63759,10 @@ var MakeMDPluginSettingsTab = class extends import_obsidian57.PluginSettingTab { } }; -// src/components/Blink/Blink.tsx -var import_obsidian58 = require("obsidian"); +// src/react/components/Blink/Blink.tsx +var import_obsidian59 = require("obsidian"); -// src/components/Blink/BlinkComponent.tsx +// src/react/components/Blink/BlinkComponent.tsx var BlinkComponent = Cn.forwardRef( (props2, ref2) => { const [previewPath, setPreviewPath] = h2(null); @@ -63695,8 +63835,8 @@ var BlinkComponent = Cn.forwardRef( BlinkComponent.displayName = "BlinkComponent"; var BlinkComponent_default = BlinkComponent; -// src/components/Blink/Blink.tsx -var Blink = class extends import_obsidian58.Modal { +// src/react/components/Blink/Blink.tsx +var Blink = class extends import_obsidian59.Modal { constructor(app2, plugin) { super(app2); this.ref = Cn.createRef(); @@ -63728,12 +63868,12 @@ var Blink = class extends import_obsidian58.Modal { } }; -// src/components/Explorer/Explorer.tsx -var import_obsidian59 = require("obsidian"); +// src/react/components/Explorer/Explorer.tsx +var import_obsidian60 = require("obsidian"); var FILE_CONTEXT_VIEW_TYPE = "make-context-view"; var ICON2 = "component"; var VIEW_DISPLAY_TEXT2 = "Explorer"; -var ContextExplorerLeafView = class extends import_obsidian59.ItemView { +var ContextExplorerLeafView = class extends import_obsidian60.ItemView { constructor(leaf, plugin) { super(leaf); this.navigation = false; @@ -63790,27 +63930,31 @@ var childrenForNode = (plugin, node, index, depth) => { const metadataTypes = []; metadataTypes.push({ type: "properties", - label: "Properties", + label: i18n_default.labels.properties, sticker: "ui//mk-ui-note" }); if (depth != 0) { metadataTypes.push({ type: "flow", - label: "Content", + label: i18n_default.labels.content, sticker: "ui//mk-ui-note" }); } metadataTypes.push( ...[ - { type: "spaces", label: "Spaces", sticker: "ui//mk-ui-note" }, + { + type: "spaces", + label: i18n_default.labels.spaces, + sticker: "ui//mk-ui-note" + }, { type: "inlinks", - label: "Backlinks", + label: i18n_default.labels.backlinks, sticker: "lucide//links-coming-in" }, { type: "outlinks", - label: "Outgoing Links", + label: i18n_default.labels.outgoingLinks, sticker: "lucide//links-going-out" } ] @@ -64005,7 +64149,6 @@ var ExplorerFlowRow = (props2) => { return spaceCache.space.defPath; return props2.path; }, [props2.path]); - const [collapsed, setCollapsed] = h2(true); const [block, setBlock] = h2([null, null]); const refreshBlock = (path2) => { var _a3, _b2; @@ -64070,10 +64213,10 @@ var ExplorerContextRow = (props2) => { }); }; -// src/components/SpaceView/Contexts/MDBFileViewer.tsx -var import_obsidian60 = require("obsidian"); +// src/react/components/SpaceView/Contexts/MDBFileViewer.tsx +var import_obsidian61 = require("obsidian"); var MDB_FILE_VIEWER_TYPE = "make-mdb-viewer"; -var MDBFileViewer = class extends import_obsidian60.FileView { +var MDBFileViewer = class extends import_obsidian61.FileView { constructor(leaf, plugin) { super(leaf); this.navigation = true; @@ -64209,7 +64352,7 @@ var import_obsidian_dataview = __toESM(require_lib()); // src/superstate/superstate.ts var import_lodash13 = __toESM(require_lodash()); -var import_obsidian62 = require("obsidian"); +var import_obsidian63 = require("obsidian"); // src/types/indexMap.ts var _IndexMap = class { @@ -64440,7 +64583,7 @@ var LocalStorageCache = class { }; // src/superstate/workers/manager.ts -var import_obsidian61 = require("obsidian"); +var import_obsidian62 = require("obsidian"); // inline-worker:__inline-worker function inlineWorker(scriptText) { @@ -64453,11 +64596,11 @@ function inlineWorker(scriptText) { // src/superstate/workers/entry.worker.ts function Worker2() { - return inlineWorker('var qd=Object.create;var ru=Object.defineProperty,$d=Object.defineProperties,kd=Object.getOwnPropertyDescriptor,Hd=Object.getOwnPropertyDescriptors,Kd=Object.getOwnPropertyNames,Uo=Object.getOwnPropertySymbols,zd=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty,Yd=Object.prototype.propertyIsEnumerable;var No=(i,l,m)=>l in i?ru(i,l,{enumerable:!0,configurable:!0,writable:!0,value:m}):i[l]=m,Rt=(i,l)=>{for(var m in l||(l={}))Go.call(l,m)&&No(i,m,l[m]);if(Uo)for(var m of Uo(l))Yd.call(l,m)&&No(i,m,l[m]);return i},Lt=(i,l)=>$d(i,Hd(l));var Zd=(i,l)=>()=>(l||i((l={exports:{}}).exports,l),l.exports);var Xd=(i,l,m,w)=>{if(l&&typeof l=="object"||typeof l=="function")for(let y of Kd(l))!Go.call(i,y)&&y!==m&&ru(i,y,{get:()=>l[y],enumerable:!(w=kd(l,y))||w.enumerable});return i};var Jd=(i,l,m)=>(m=i!=null?qd(zd(i)):{},Xd(l||!i||!i.__esModule?ru(m,"default",{value:i,enumerable:!0}):m,i));var qo=Zd((oe,Me)=>{(function(){var i,l="4.17.21",m=200,w="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",y="Expected a function",O="Invalid `variable` option passed into `_.template`",J="__lodash_hash_undefined__",V=500,Y="__lodash_placeholder__",B=1,an=2,j=4,fn=1,Pn=2,nn=1,q=2,vt=4,hn=8,Bn=16,pn=32,gn=64,yn=128,W=256,dn=512,_n=30,Kn="...",Kt=800,Et=16,zn=1,Le=2,Ee=3,nt=1/0,Yn=9007199254740991,Oe=17976931348623157e292,Ot=0/0,Mn=4294967295,De=Mn-1,Pe=Mn>>>1,Be=[["ary",yn],["bind",nn],["bindKey",q],["curry",hn],["curryRight",Bn],["flip",dn],["partial",pn],["partialRight",gn],["rearg",W]],ft="[object Arguments]",Dt="[object Array]",We="[object AsyncFunction]",mt="[object Boolean]",xt="[object Date]",Ue="[object DOMException]",k="[object Error]",tn="[object Function]",un="[object GeneratorFunction]",K="[object Map]",tt="[object Number]",Ne="[object Null]",Zn="[object Object]",Ge="[object Promise]",zt="[object Proxy]",ae="[object RegExp]",Xn="[object Set]",le="[object String]",qe="[object Symbol]",fs="[object Undefined]",ce="[object WeakMap]",os="[object WeakSet]",he="[object ArrayBuffer]",Yt="[object DataView]",Br="[object Float32Array]",Wr="[object Float64Array]",Ur="[object Int8Array]",Nr="[object Int16Array]",Gr="[object Int32Array]",qr="[object Uint8Array]",$r="[object Uint8ClampedArray]",kr="[object Uint16Array]",Hr="[object Uint32Array]",ss=/\\b__p \\+= \'\';/g,as=/\\b(__p \\+=) \'\' \\+/g,ls=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n\'\';/g,ou=/&(?:amp|lt|gt|quot|#39);/g,su=/[&<>"\']/g,cs=RegExp(ou.source),hs=RegExp(su.source),ps=/<%-([\\s\\S]+?)%>/g,gs=/<%([\\s\\S]+?)%>/g,au=/<%=([\\s\\S]+?)%>/g,ds=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,_s=/^\\w*$/,vs=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Kr=/[\\\\^$.*+?()[\\]{}|]/g,ms=RegExp(Kr.source),zr=/^\\s+/,xs=/\\s/,ys=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,ws=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,As=/,? & /,Ss=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,Ts=/[()=,{}\\[\\]\\/\\s]/,Fs=/\\\\(\\\\)?/g,Cs=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,lu=/\\w*$/,Is=/^[-+]0x[0-9a-f]+$/i,Ms=/^0b[01]+$/i,bs=/^\\[object .+?Constructor\\]$/,Rs=/^0o[0-7]+$/i,Ls=/^(?:0|[1-9]\\d*)$/,Es=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,$e=/($^)/,Os=/[\'\\n\\r\\u2028\\u2029\\\\]/g,ke="\\\\ud800-\\\\udfff",Ds="\\\\u0300-\\\\u036f",Ps="\\\\ufe20-\\\\ufe2f",Bs="\\\\u20d0-\\\\u20ff",cu=Ds+Ps+Bs,hu="\\\\u2700-\\\\u27bf",pu="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",Ws="\\\\xac\\\\xb1\\\\xd7\\\\xf7",Us="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",Ns="\\\\u2000-\\\\u206f",Gs=" \\\\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",gu="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",du="\\\\ufe0e\\\\ufe0f",_u=Ws+Us+Ns+Gs,Yr="[\'\\u2019]",qs="["+ke+"]",vu="["+_u+"]",He="["+cu+"]",mu="\\\\d+",$s="["+hu+"]",xu="["+pu+"]",yu="[^"+ke+_u+mu+hu+pu+gu+"]",Zr="\\\\ud83c[\\\\udffb-\\\\udfff]",ks="(?:"+He+"|"+Zr+")",wu="[^"+ke+"]",Xr="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Jr="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Zt="["+gu+"]",Au="\\\\u200d",Su="(?:"+xu+"|"+yu+")",Hs="(?:"+Zt+"|"+yu+")",Tu="(?:"+Yr+"(?:d|ll|m|re|s|t|ve))?",Fu="(?:"+Yr+"(?:D|LL|M|RE|S|T|VE))?",Cu=ks+"?",Iu="["+du+"]?",Ks="(?:"+Au+"(?:"+[wu,Xr,Jr].join("|")+")"+Iu+Cu+")*",zs="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",Ys="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Mu=Iu+Cu+Ks,Zs="(?:"+[$s,Xr,Jr].join("|")+")"+Mu,Xs="(?:"+[wu+He+"?",He,Xr,Jr,qs].join("|")+")",Js=RegExp(Yr,"g"),Qs=RegExp(He,"g"),Qr=RegExp(Zr+"(?="+Zr+")|"+Xs+Mu,"g"),Vs=RegExp([Zt+"?"+xu+"+"+Tu+"(?="+[vu,Zt,"$"].join("|")+")",Hs+"+"+Fu+"(?="+[vu,Zt+Su,"$"].join("|")+")",Zt+"?"+Su+"+"+Tu,Zt+"+"+Fu,Ys,zs,mu,Zs].join("|"),"g"),js=RegExp("["+Au+ke+cu+du+"]"),na=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ta=["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"],ea=-1,z={};z[Br]=z[Wr]=z[Ur]=z[Nr]=z[Gr]=z[qr]=z[$r]=z[kr]=z[Hr]=!0,z[ft]=z[Dt]=z[he]=z[mt]=z[Yt]=z[xt]=z[k]=z[tn]=z[K]=z[tt]=z[Zn]=z[ae]=z[Xn]=z[le]=z[ce]=!1;var H={};H[ft]=H[Dt]=H[he]=H[Yt]=H[mt]=H[xt]=H[Br]=H[Wr]=H[Ur]=H[Nr]=H[Gr]=H[K]=H[tt]=H[Zn]=H[ae]=H[Xn]=H[le]=H[qe]=H[qr]=H[$r]=H[kr]=H[Hr]=!0,H[k]=H[tn]=H[ce]=!1;var ra={\\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"},ia={"&":"&","<":"<",">":">",\'"\':""","\'":"'"},ua={"&":"&","<":"<",">":">",""":\'"\',"'":"\'"},fa={"\\\\":"\\\\","\'":"\'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},oa=parseFloat,sa=parseInt,bu=typeof global=="object"&&global&&global.Object===Object&&global,aa=typeof self=="object"&&self&&self.Object===Object&&self,ln=bu||aa||Function("return this")(),Vr=typeof oe=="object"&&oe&&!oe.nodeType&&oe,Pt=Vr&&typeof Me=="object"&&Me&&!Me.nodeType&&Me,Ru=Pt&&Pt.exports===Vr,jr=Ru&&bu.process,Wn=function(){try{var c=Pt&&Pt.require&&Pt.require("util").types;return c||jr&&jr.binding&&jr.binding("util")}catch(g){}}(),Lu=Wn&&Wn.isArrayBuffer,Eu=Wn&&Wn.isDate,Ou=Wn&&Wn.isMap,Du=Wn&&Wn.isRegExp,Pu=Wn&&Wn.isSet,Bu=Wn&&Wn.isTypedArray;function bn(c,g,p){switch(p.length){case 0:return c.call(g);case 1:return c.call(g,p[0]);case 2:return c.call(g,p[0],p[1]);case 3:return c.call(g,p[0],p[1],p[2])}return c.apply(g,p)}function la(c,g,p,A){for(var I=-1,U=c==null?0:c.length;++I-1}function ni(c,g,p){for(var A=-1,I=c==null?0:c.length;++A-1;);return p}function Hu(c,g){for(var p=c.length;p--&&Xt(g,c[p],0)>-1;);return p}function xa(c,g){for(var p=c.length,A=0;p--;)c[p]===g&&++A;return A}var ya=ii(ra),wa=ii(ia);function Aa(c){return"\\\\"+fa[c]}function Sa(c,g){return c==null?i:c[g]}function Jt(c){return js.test(c)}function Ta(c){return na.test(c)}function Fa(c){for(var g,p=[];!(g=c.next()).done;)p.push(g.value);return p}function si(c){var g=-1,p=Array(c.size);return c.forEach(function(A,I){p[++g]=[I,A]}),p}function Ku(c,g){return function(p){return c(g(p))}}function At(c,g){for(var p=-1,A=c.length,I=0,U=[];++p-1}function hl(n,t){var e=this.__data__,r=sr(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}ot.prototype.clear=sl,ot.prototype.delete=al,ot.prototype.get=ll,ot.prototype.has=cl,ot.prototype.set=hl;function st(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function qn(n,t,e,r,u,o){var s,a=t&B,h=t&an,d=t&j;if(e&&(s=u?e(n,r,u,o):e(n)),s!==i)return s;if(!X(n))return n;var _=M(n);if(_){if(s=_c(n),!a)return Tn(n,s)}else{var v=xn(n),x=v==tn||v==un;if(bt(n))return Mf(n,a);if(v==Zn||v==ft||x&&!u){if(s=h||x?{}:Yf(n),!a)return h?uc(n,Ml(s,n)):ic(n,rf(s,n))}else{if(!H[v])return u?n:{};s=vc(n,v,a)}}o||(o=new Qn);var S=o.get(n);if(S)return S;o.set(n,s),So(n)?n.forEach(function(C){s.add(qn(C,t,e,C,n,o))}):wo(n)&&n.forEach(function(C,E){s.set(E,qn(C,t,e,E,n,o))});var F=d?h?Di:Oi:h?Cn:cn,R=_?i:F(n);return Un(R||n,function(C,E){R&&(E=C,C=n[E]),xe(s,E,qn(C,t,e,E,n,o))}),s}function bl(n){var t=cn(n);return function(e){return uf(e,n,t)}}function uf(n,t,e){var r=e.length;if(n==null)return!r;for(n=$(n);r--;){var u=e[r],o=t[u],s=n[u];if(s===i&&!(u in n)||!o(s))return!1}return!0}function ff(n,t,e){if(typeof n!="function")throw new Nn(y);return Ce(function(){n.apply(i,e)},t)}function ye(n,t,e,r){var u=-1,o=Ke,s=!0,a=n.length,h=[],d=t.length;if(!a)return h;e&&(t=Z(t,Rn(e))),r?(o=ni,s=!1):t.length>=m&&(o=pe,s=!1,t=new Ut(t));n:for(;++uu?0:u+e),r=r===i||r>u?u:b(r),r<0&&(r+=u),r=e>r?0:Fo(r);e0&&e(a)?t>1?vn(a,t-1,e,r,u):wt(u,a):r||(u[u.length]=a)}return u}var di=Df(),af=Df(!0);function et(n,t){return n&&di(n,t,cn)}function _i(n,t){return n&&af(n,t,cn)}function lr(n,t){return yt(t,function(e){return pt(n[e])})}function Gt(n,t){t=It(t,n);for(var e=0,r=t.length;n!=null&&et}function El(n,t){return n!=null&&G.call(n,t)}function Ol(n,t){return n!=null&&t in $(n)}function Dl(n,t,e){return n>=mn(t,e)&&n=120&&_.length>=120)?new Ut(s&&_):i}_=n[0];var v=-1,x=a[0];n:for(;++v-1;)a!==n&&tr.call(a,h,1),tr.call(n,h,1);return n}function yf(n,t){for(var e=n?t.length:0,r=e-1;e--;){var u=t[e];if(e==r||u!==o){var o=u;ht(u)?tr.call(n,u,1):Ci(n,u)}}return n}function Si(n,t){return n+ir(ju()*(t-n+1))}function Yl(n,t,e,r){for(var u=-1,o=sn(rr((t-n)/(e||1)),0),s=p(o);o--;)s[r?o:++u]=n,n+=e;return s}function Ti(n,t){var e="";if(!n||t<1||t>Yn)return e;do t%2&&(e+=n),t=ir(t/2),t&&(n+=n);while(t);return e}function L(n,t){return qi(Jf(n,t,In),n+"")}function Zl(n){return ef(fe(n))}function Xl(n,t){var e=fe(n);return wr(e,Nt(t,0,e.length))}function Se(n,t,e,r){if(!X(n))return n;t=It(t,n);for(var u=-1,o=t.length,s=o-1,a=n;a!=null&&++uu?0:u+t),e=e>u?u:e,e<0&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var o=p(u);++r>>1,s=n[o];s!==null&&!En(s)&&(e?s<=t:s=m){var d=t?null:ac(n);if(d)return Ye(d);s=!1,u=pe,h=new Ut}else h=t?[]:a;n:for(;++r=r?n:$n(n,t,e)}var If=Ga||function(n){return ln.clearTimeout(n)};function Mf(n,t){if(t)return n.slice();var e=n.length,r=Zu?Zu(e):new n.constructor(e);return n.copy(r),r}function Ri(n){var t=new n.constructor(n.byteLength);return new je(t).set(new je(n)),t}function nc(n,t){var e=t?Ri(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function tc(n){var t=new n.constructor(n.source,lu.exec(n));return t.lastIndex=n.lastIndex,t}function ec(n){return me?$(me.call(n)):{}}function bf(n,t){var e=t?Ri(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Rf(n,t){if(n!==t){var e=n!==i,r=n===null,u=n===n,o=En(n),s=t!==i,a=t===null,h=t===t,d=En(t);if(!a&&!d&&!o&&n>t||o&&s&&h&&!a&&!d||r&&s&&h||!e&&h||!u)return 1;if(!r&&!o&&!d&&n=a)return h;var d=e[r];return h*(d=="desc"?-1:1)}}return n.index-t.index}function Lf(n,t,e,r){for(var u=-1,o=n.length,s=e.length,a=-1,h=t.length,d=sn(o-s,0),_=p(h+d),v=!r;++a1?e[u-1]:i,s=u>2?e[2]:i;for(o=n.length>3&&typeof o=="function"?(u--,o):i,s&&An(e[0],e[1],s)&&(o=u<3?i:o,u=1),t=$(t);++r-1?u[o?t[s]:s]:i}}function Wf(n){return ct(function(t){var e=t.length,r=e,u=Gn.prototype.thru;for(n&&t.reverse();r--;){var o=t[r];if(typeof o!="function")throw new Nn(y);if(u&&!s&&xr(o)=="wrapper")var s=new Gn([],!0)}for(r=s?r:e;++r1&&P.reverse(),_&&ha))return!1;var d=o.get(n),_=o.get(t);if(d&&_)return d==t&&_==n;var v=-1,x=!0,S=e&Pn?new Ut:i;for(o.set(n,t),o.set(t,n);++v1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(ys,`{\n/* [wrapped with `+t+`] */\n`)}function xc(n){return M(n)||kt(n)||!!(Qu&&n&&n[Qu])}function ht(n,t){var e=typeof n;return t=t==null?Yn:t,!!t&&(e=="number"||e!="symbol"&&Ls.test(n))&&n>-1&&n%1==0&&n0){if(++t>=Kt)return arguments[0]}else t=0;return n.apply(i,arguments)}}function wr(n,t){var e=-1,r=n.length,u=r-1;for(t=t===i?r:t;++e1?n[t-1]:i;return e=typeof e=="function"?(n.pop(),e):i,so(n,e)});function ao(n){var t=f(n);return t.__chain__=!0,t}function Rh(n,t){return t(n),n}function Ar(n,t){return t(n)}var Lh=ct(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,u=function(o){return gi(o,n)};return t>1||this.__actions__.length||!(r instanceof D)||!ht(e)?this.thru(u):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:Ar,args:[u],thisArg:i}),new Gn(r,this.__chain__).thru(function(o){return t&&!o.length&&o.push(i),o}))});function Eh(){return ao(this)}function Oh(){return new Gn(this.value(),this.__chain__)}function Dh(){this.__values__===i&&(this.__values__=To(this.value()));var n=this.__index__>=this.__values__.length,t=n?i:this.__values__[this.__index__++];return{done:n,value:t}}function Ph(){return this}function Bh(n){for(var t,e=this;e instanceof or;){var r=eo(e);r.__index__=0,r.__values__=i,t?u.__wrapped__=r:t=r;var u=r;e=e.__wrapped__}return u.__wrapped__=n,t}function Wh(){var n=this.__wrapped__;if(n instanceof D){var t=n;return this.__actions__.length&&(t=new D(this)),t=t.reverse(),t.__actions__.push({func:Ar,args:[$i],thisArg:i}),new Gn(t,this.__chain__)}return this.thru($i)}function Uh(){return Ff(this.__wrapped__,this.__actions__)}var Nh=gr(function(n,t,e){G.call(n,e)?++n[e]:at(n,e,1)});function Gh(n,t,e){var r=M(n)?Wu:Rl;return e&&An(n,t,e)&&(t=i),r(n,T(t,3))}function qh(n,t){var e=M(n)?yt:sf;return e(n,T(t,3))}var $h=Bf(ro),kh=Bf(io);function Hh(n,t){return vn(Sr(n,t),1)}function Kh(n,t){return vn(Sr(n,t),nt)}function zh(n,t,e){return e=e===i?1:b(e),vn(Sr(n,t),e)}function lo(n,t){var e=M(n)?Un:Ft;return e(n,T(t,3))}function co(n,t){var e=M(n)?ca:of;return e(n,T(t,3))}var Yh=gr(function(n,t,e){G.call(n,e)?n[e].push(t):at(n,e,[t])});function Zh(n,t,e,r){n=Fn(n)?n:fe(n),e=e&&!r?b(e):0;var u=n.length;return e<0&&(e=sn(u+e,0)),Mr(n)?e<=u&&n.indexOf(t,e)>-1:!!u&&Xt(n,t,e)>-1}var Xh=L(function(n,t,e){var r=-1,u=typeof t=="function",o=Fn(n)?p(n.length):[];return Ft(n,function(s){o[++r]=u?bn(t,s,e):we(s,t,e)}),o}),Jh=gr(function(n,t,e){at(n,e,t)});function Sr(n,t){var e=M(n)?Z:gf;return e(n,T(t,3))}function Qh(n,t,e,r){return n==null?[]:(M(t)||(t=t==null?[]:[t]),e=r?i:e,M(e)||(e=e==null?[]:[e]),mf(n,t,e))}var Vh=gr(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function jh(n,t,e){var r=M(n)?ti:qu,u=arguments.length<3;return r(n,T(t,4),e,u,Ft)}function np(n,t,e){var r=M(n)?ha:qu,u=arguments.length<3;return r(n,T(t,4),e,u,of)}function tp(n,t){var e=M(n)?yt:sf;return e(n,Cr(T(t,3)))}function ep(n){var t=M(n)?ef:Zl;return t(n)}function rp(n,t,e){(e?An(n,t,e):t===i)?t=1:t=b(t);var r=M(n)?Fl:Xl;return r(n,t)}function ip(n){var t=M(n)?Cl:Ql;return t(n)}function up(n){if(n==null)return 0;if(Fn(n))return Mr(n)?Qt(n):n.length;var t=xn(n);return t==K||t==Xn?n.size:yi(n).length}function fp(n,t,e){var r=M(n)?ei:Vl;return e&&An(n,t,e)&&(t=i),r(n,T(t,3))}var op=L(function(n,t){if(n==null)return[];var e=t.length;return e>1&&An(n,t[0],t[1])?t=[]:e>2&&An(t[0],t[1],t[2])&&(t=[t[0]]),mf(n,vn(t,1),[])}),Tr=qa||function(){return ln.Date.now()};function sp(n,t){if(typeof t!="function")throw new Nn(y);return n=b(n),function(){if(--n<1)return t.apply(this,arguments)}}function ho(n,t,e){return t=e?i:t,t=n&&t==null?n.length:t,lt(n,yn,i,i,i,i,t)}function po(n,t){var e;if(typeof t!="function")throw new Nn(y);return n=b(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=i),e}}var Hi=L(function(n,t,e){var r=nn;if(e.length){var u=At(e,ie(Hi));r|=pn}return lt(n,r,t,e,u)}),go=L(function(n,t,e){var r=nn|q;if(e.length){var u=At(e,ie(go));r|=pn}return lt(t,r,n,e,u)});function _o(n,t,e){t=e?i:t;var r=lt(n,hn,i,i,i,i,i,t);return r.placeholder=_o.placeholder,r}function vo(n,t,e){t=e?i:t;var r=lt(n,Bn,i,i,i,i,i,t);return r.placeholder=vo.placeholder,r}function mo(n,t,e){var r,u,o,s,a,h,d=0,_=!1,v=!1,x=!0;if(typeof n!="function")throw new Nn(y);t=Hn(t)||0,X(e)&&(_=!!e.leading,v="maxWait"in e,o=v?sn(Hn(e.maxWait)||0,t):o,x="trailing"in e?!!e.trailing:x);function S(rn){var jn=r,dt=u;return r=u=i,d=rn,s=n.apply(dt,jn),s}function F(rn){return d=rn,a=Ce(E,t),_?S(rn):s}function R(rn){var jn=rn-h,dt=rn-d,Wo=t-jn;return v?mn(Wo,o-dt):Wo}function C(rn){var jn=rn-h,dt=rn-d;return h===i||jn>=t||jn<0||v&&dt>=o}function E(){var rn=Tr();if(C(rn))return P(rn);a=Ce(E,R(rn))}function P(rn){return a=i,x&&r?S(rn):(r=u=i,s)}function On(){a!==i&&If(a),d=0,r=h=u=a=i}function Sn(){return a===i?s:P(Tr())}function Dn(){var rn=Tr(),jn=C(rn);if(r=arguments,u=this,h=rn,jn){if(a===i)return F(h);if(v)return If(a),a=Ce(E,t),S(h)}return a===i&&(a=Ce(E,t)),s}return Dn.cancel=On,Dn.flush=Sn,Dn}var ap=L(function(n,t){return ff(n,1,t)}),lp=L(function(n,t,e){return ff(n,Hn(t)||0,e)});function cp(n){return lt(n,dn)}function Fr(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new Nn(y);var e=function(){var r=arguments,u=t?t.apply(this,r):r[0],o=e.cache;if(o.has(u))return o.get(u);var s=n.apply(this,r);return e.cache=o.set(u,s)||o,s};return e.cache=new(Fr.Cache||st),e}Fr.Cache=st;function Cr(n){if(typeof n!="function")throw new Nn(y);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function hp(n){return po(2,n)}var pp=jl(function(n,t){t=t.length==1&&M(t[0])?Z(t[0],Rn(T())):Z(vn(t,1),Rn(T()));var e=t.length;return L(function(r){for(var u=-1,o=mn(r.length,e);++u=t}),kt=cf(function(){return arguments}())?cf:function(n){return Q(n)&&G.call(n,"callee")&&!Ju.call(n,"callee")},M=p.isArray,Mp=Lu?Rn(Lu):Bl;function Fn(n){return n!=null&&Ir(n.length)&&!pt(n)}function en(n){return Q(n)&&Fn(n)}function bp(n){return n===!0||n===!1||Q(n)&&wn(n)==mt}var bt=ka||eu,Rp=Eu?Rn(Eu):Wl;function Lp(n){return Q(n)&&n.nodeType===1&&!Ie(n)}function Ep(n){if(n==null)return!0;if(Fn(n)&&(M(n)||typeof n=="string"||typeof n.splice=="function"||bt(n)||ue(n)||kt(n)))return!n.length;var t=xn(n);if(t==K||t==Xn)return!n.size;if(Fe(n))return!yi(n).length;for(var e in n)if(G.call(n,e))return!1;return!0}function Op(n,t){return Ae(n,t)}function Dp(n,t,e){e=typeof e=="function"?e:i;var r=e?e(n,t):i;return r===i?Ae(n,t,i,e):!!r}function zi(n){if(!Q(n))return!1;var t=wn(n);return t==k||t==Ue||typeof n.message=="string"&&typeof n.name=="string"&&!Ie(n)}function Pp(n){return typeof n=="number"&&Vu(n)}function pt(n){if(!X(n))return!1;var t=wn(n);return t==tn||t==un||t==We||t==zt}function yo(n){return typeof n=="number"&&n==b(n)}function Ir(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Yn}function X(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function Q(n){return n!=null&&typeof n=="object"}var wo=Ou?Rn(Ou):Nl;function Bp(n,t){return n===t||xi(n,t,Bi(t))}function Wp(n,t,e){return e=typeof e=="function"?e:i,xi(n,t,Bi(t),e)}function Up(n){return Ao(n)&&n!=+n}function Np(n){if(Ac(n))throw new I(w);return hf(n)}function Gp(n){return n===null}function qp(n){return n==null}function Ao(n){return typeof n=="number"||Q(n)&&wn(n)==tt}function Ie(n){if(!Q(n)||wn(n)!=Zn)return!1;var t=nr(n);if(t===null)return!0;var e=G.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Je.call(e)==Wa}var Yi=Du?Rn(Du):Gl;function $p(n){return yo(n)&&n>=-Yn&&n<=Yn}var So=Pu?Rn(Pu):ql;function Mr(n){return typeof n=="string"||!M(n)&&Q(n)&&wn(n)==le}function En(n){return typeof n=="symbol"||Q(n)&&wn(n)==qe}var ue=Bu?Rn(Bu):$l;function kp(n){return n===i}function Hp(n){return Q(n)&&xn(n)==ce}function Kp(n){return Q(n)&&wn(n)==os}var zp=mr(wi),Yp=mr(function(n,t){return n<=t});function To(n){if(!n)return[];if(Fn(n))return Mr(n)?Jn(n):Tn(n);if(ge&&n[ge])return Fa(n[ge]());var t=xn(n),e=t==K?si:t==Xn?Ye:fe;return e(n)}function gt(n){if(!n)return n===0?n:0;if(n=Hn(n),n===nt||n===-nt){var t=n<0?-1:1;return t*Oe}return n===n?n:0}function b(n){var t=gt(n),e=t%1;return t===t?e?t-e:t:0}function Fo(n){return n?Nt(b(n),0,Mn):0}function Hn(n){if(typeof n=="number")return n;if(En(n))return Ot;if(X(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=X(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=$u(n);var e=Ms.test(n);return e||Rs.test(n)?sa(n.slice(2),e?2:8):Is.test(n)?Ot:+n}function Co(n){return rt(n,Cn(n))}function Zp(n){return n?Nt(b(n),-Yn,Yn):n===0?n:0}function N(n){return n==null?"":Ln(n)}var Xp=ee(function(n,t){if(Fe(t)||Fn(t)){rt(t,cn(t),n);return}for(var e in t)G.call(t,e)&&xe(n,e,t[e])}),Io=ee(function(n,t){rt(t,Cn(t),n)}),br=ee(function(n,t,e,r){rt(t,Cn(t),n,r)}),Jp=ee(function(n,t,e,r){rt(t,cn(t),n,r)}),Qp=ct(gi);function Vp(n,t){var e=te(n);return t==null?e:rf(e,t)}var jp=L(function(n,t){n=$(n);var e=-1,r=t.length,u=r>2?t[2]:i;for(u&&An(t[0],t[1],u)&&(r=1);++e1),o}),rt(n,Di(n),e),r&&(e=qn(e,B|an|j,lc));for(var u=t.length;u--;)Ci(e,t[u]);return e});function vg(n,t){return bo(n,Cr(T(t)))}var mg=ct(function(n,t){return n==null?{}:Kl(n,t)});function bo(n,t){if(n==null)return{};var e=Z(Di(n),function(r){return[r]});return t=T(t),xf(n,e,function(r,u){return t(r,u[0])})}function xg(n,t,e){t=It(t,n);var r=-1,u=t.length;for(u||(u=1,n=i);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var u=ju();return mn(n+u*(t-n+oa("1e-"+((u+"").length-1))),t)}return Si(n,t)}var Rg=re(function(n,t,e){return t=t.toLowerCase(),n+(e?Eo(t):t)});function Eo(n){return Ji(N(n).toLowerCase())}function Oo(n){return n=N(n),n&&n.replace(Es,ya).replace(Qs,"")}function Lg(n,t,e){n=N(n),t=Ln(t);var r=n.length;e=e===i?r:Nt(b(e),0,r);var u=e;return e-=t.length,e>=0&&n.slice(e,u)==t}function Eg(n){return n=N(n),n&&hs.test(n)?n.replace(su,wa):n}function Og(n){return n=N(n),n&&ms.test(n)?n.replace(Kr,"\\\\$&"):n}var Dg=re(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),Pg=re(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),Bg=Pf("toLowerCase");function Wg(n,t,e){n=N(n),t=b(t);var r=t?Qt(n):0;if(!t||r>=t)return n;var u=(t-r)/2;return vr(ir(u),e)+n+vr(rr(u),e)}function Ug(n,t,e){n=N(n),t=b(t);var r=t?Qt(n):0;return t&&r>>0,e?(n=N(n),n&&(typeof t=="string"||t!=null&&!Yi(t))&&(t=Ln(t),!t&&Jt(n))?Mt(Jn(n),0,e):n.split(t,e)):[]}var Kg=re(function(n,t,e){return n+(e?" ":"")+Ji(t)});function zg(n,t,e){return n=N(n),e=e==null?0:Nt(b(e),0,n.length),t=Ln(t),n.slice(e,e+t.length)==t}function Yg(n,t,e){var r=f.templateSettings;e&&An(n,t,e)&&(t=i),n=N(n),t=br({},t,r,$f);var u=br({},t.imports,r.imports,$f),o=cn(u),s=oi(u,o),a,h,d=0,_=t.interpolate||$e,v="__p += \'",x=ai((t.escape||$e).source+"|"+_.source+"|"+(_===au?Cs:$e).source+"|"+(t.evaluate||$e).source+"|$","g"),S="//# sourceURL="+(G.call(t,"sourceURL")?(t.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++ea+"]")+`\n`;n.replace(x,function(C,E,P,On,Sn,Dn){return P||(P=On),v+=n.slice(d,Dn).replace(Os,Aa),E&&(a=!0,v+=`\' +\n__e(`+E+`) +\n\'`),Sn&&(h=!0,v+=`\';\n`+Sn+`;\n__p += \'`),P&&(v+=`\' +\n((__t = (`+P+`)) == null ? \'\' : __t) +\n\'`),d=Dn+C.length,C}),v+=`\';\n`;var F=G.call(t,"variable")&&t.variable;if(!F)v=`with (obj) {\n`+v+`\n}\n`;else if(Ts.test(F))throw new I(O);v=(h?v.replace(ss,""):v).replace(as,"$1").replace(ls,"$1;"),v="function("+(F||"obj")+`) {\n`+(F?"":`obj || (obj = {});\n`)+"var __t, __p = \'\'"+(a?", __e = _.escape":"")+(h?`, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, \'\') }\n`:`;\n`)+v+`return __p\n}`;var R=Po(function(){return U(o,S+"return "+v).apply(i,s)});if(R.source=v,zi(R))throw R;return R}function Zg(n){return N(n).toLowerCase()}function Xg(n){return N(n).toUpperCase()}function Jg(n,t,e){if(n=N(n),n&&(e||t===i))return $u(n);if(!n||!(t=Ln(t)))return n;var r=Jn(n),u=Jn(t),o=ku(r,u),s=Hu(r,u)+1;return Mt(r,o,s).join("")}function Qg(n,t,e){if(n=N(n),n&&(e||t===i))return n.slice(0,zu(n)+1);if(!n||!(t=Ln(t)))return n;var r=Jn(n),u=Hu(r,Jn(t))+1;return Mt(r,0,u).join("")}function Vg(n,t,e){if(n=N(n),n&&(e||t===i))return n.replace(zr,"");if(!n||!(t=Ln(t)))return n;var r=Jn(n),u=ku(r,Jn(t));return Mt(r,u).join("")}function jg(n,t){var e=_n,r=Kn;if(X(t)){var u="separator"in t?t.separator:u;e="length"in t?b(t.length):e,r="omission"in t?Ln(t.omission):r}n=N(n);var o=n.length;if(Jt(n)){var s=Jn(n);o=s.length}if(e>=o)return n;var a=e-Qt(r);if(a<1)return r;var h=s?Mt(s,0,a).join(""):n.slice(0,a);if(u===i)return h+r;if(s&&(a+=h.length-a),Yi(u)){if(n.slice(a).search(u)){var d,_=h;for(u.global||(u=ai(u.source,N(lu.exec(u))+"g")),u.lastIndex=0;d=u.exec(_);)var v=d.index;h=h.slice(0,v===i?a:v)}}else if(n.indexOf(Ln(u),a)!=a){var x=h.lastIndexOf(u);x>-1&&(h=h.slice(0,x))}return h+r}function nd(n){return n=N(n),n&&cs.test(n)?n.replace(ou,ba):n}var td=re(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),Ji=Pf("toUpperCase");function Do(n,t,e){return n=N(n),t=e?i:t,t===i?Ta(n)?Ea(n):da(n):n.match(t)||[]}var Po=L(function(n,t){try{return bn(n,i,t)}catch(e){return zi(e)?e:new I(e)}}),ed=ct(function(n,t){return Un(t,function(e){e=it(e),at(n,e,Hi(n[e],n))}),n});function rd(n){var t=n==null?0:n.length,e=T();return n=t?Z(n,function(r){if(typeof r[1]!="function")throw new Nn(y);return[e(r[0]),r[1]]}):[],L(function(r){for(var u=-1;++uYn)return[];var e=Mn,r=mn(n,Mn);t=T(t),n-=Mn;for(var u=fi(r,t);++e0||t<0)?new D(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==i&&(t=b(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},D.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},D.prototype.toArray=function(){return this.take(Mn)},et(D.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),u=f[r?"take"+(t=="last"?"Right":""):t],o=r||/^find/.test(t);!u||(f.prototype[t]=function(){var s=this.__wrapped__,a=r?[1]:arguments,h=s instanceof D,d=a[0],_=h||M(s),v=function(E){var P=u.apply(f,wt([E],a));return r&&x?P[0]:P};_&&e&&typeof d=="function"&&d.length!=1&&(h=_=!1);var x=this.__chain__,S=!!this.__actions__.length,F=o&&!x,R=h&&!S;if(!o&&_){s=R?s:new D(this);var C=n.apply(s,a);return C.__actions__.push({func:Ar,args:[v],thisArg:i}),new Gn(C,x)}return F&&R?n.apply(this,a):(C=this.thru(v),F?r?C.value()[0]:C.value():C)})}),Un(["pop","push","shift","sort","splice","unshift"],function(n){var t=Ze[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(M(o)?o:[],u)}return this[e](function(s){return t.apply(M(s)?s:[],u)})}}),et(D.prototype,function(n,t){var e=f[t];if(e){var r=e.name+"";G.call(ne,r)||(ne[r]=[]),ne[r].push({name:t,func:e})}}),ne[dr(i,q).name]=[{name:"wrapper",func:i}],D.prototype.clone=nl,D.prototype.reverse=tl,D.prototype.value=el,f.prototype.at=Lh,f.prototype.chain=Eh,f.prototype.commit=Oh,f.prototype.next=Dh,f.prototype.plant=Bh,f.prototype.reverse=Wh,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=Uh,f.prototype.first=f.prototype.head,ge&&(f.prototype[ge]=Ph),f},St=Oa();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ln._=St,define(function(){return St})):Pt?((Pt.exports=St)._=St,Vr._=St):ln._=St}).call(oe)});var Pr=Jd(qo());var _t=i=>[...new Set(i)],$o=i=>[...new Map(i.map(l=>[l.toLowerCase(),l])).values()];var ko=(i,l)=>{if(!i)return l?"ui//mk-ui-folder-solid":"ui//mk-ui-folder";switch(i){case"png":case"jpg":case"jpeg":case"svg":return"ui//mk-make-image";case"mov":case"webm":return"ui//mk-ui-video";case"canvas":return"ui//mk-ui-canvas";default:return l?"ui//mk-ui-file-solid":"ui//mk-ui-file"}};function Ho(i){return Array.isArray(i)?i:[]}var Ko=(i,l)=>l.indexOf(i)>0?l.indexOf(i):l.length;var Rr=i=>"spaces://"+i;var ut=i=>{var l;return(l=i==null?void 0:i.match(/(\\\\.|[^,])+/g))!=null?l:[]},Ht=i=>{if(!i)return"";let l=/\\[\\[(.*?)\\]\\]/g.exec(i),m=(l==null?void 0:l.length)>1?l[1].substring(0,Ko("|",l[1])):i;return m||i};var be=(i,l)=>{if(typeof i=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(i)||i.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(i))return"date";if(l=="tag"||l=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(i))return"link"}else{if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(i)if(Array.isArray(i)||typeof i=="string"&&i.indexOf(",")>-1){let m=Array.isArray(i)?i:[];if(typeof i=="string"&&i.indexOf(",")>-1&&(m=ut(i)),l=="tag"||l=="tags")return"tag-multi";if(m.length==1&&Array.isArray(m[0])&&m[0].length==1&&typeof m[0][0]=="string")return"link";let w=_t(m.map(y=>be(y,l)));return w.length==1&&w[0]=="link"?"link-multi":"option-multi"}else{if(i.isLuxonDateTime)return"date";if(i.isLuxonDuration)return"duration";if(i.type=="file")return"link";if(typeof i=="object"&&!Array.isArray(i)&&i!==null)return"object"}else return"unknown"}return"text"};var zo=i=>Object.keys(i!=null?i:{}).filter(l=>l!="position").filter(l=>l!="tag"&&l!="tags");var se=i=>i.join(","),Yo=i=>i.join(", ");var Lr=(i,l)=>{switch(be(l,i)){case"object":return JSON.stringify(l);case"number":return l.toString();case"boolean":return l?"true":"false";case"date":return l;case"duration":return Yo(Object.keys(l.values).reduce((w,y)=>[...w,...l.values[y]>0?[l.values[y]+" "+y]:[]],[]));case"option-multi":case"link-multi":return typeof l=="string"?Ht(l):se(l.map(w=>w?typeof w=="string"?Ht(w):w.path?w.path:Array.isArray(l)&&w.length==1&&Array.isArray(w[0])&&w[0].length==1&&typeof w[0][0]=="string"?w[0][0]:JSON.stringify(w):""));case"link":return Array.isArray(l)&&l.length==1&&Array.isArray(l[0])&&l[0].length==1&&typeof l[0][0]=="string"?l[0][0]:typeof l=="string"?Ht(l):l.path;case"text":case"tag":case"image":return l}return""};var Zo=i=>{switch(i){case"duration":return"text";case"unknown":return"text"}return i};var Er=(i,l)=>i==l,iu=(i,l)=>(i!=null?i:"").length==0,uu=(i,l)=>(i!=null?i:"").toLowerCase().includes((l!=null?l:"").toLowerCase()),Or=(i,l)=>parseFloat(i)>parseFloat(l),Dr=(i,l)=>parseInt(i)>parseInt(l),fu=(i,l)=>{let m=i?ut(i):[];return(l?ut(l):[]).some(y=>m.some(O=>O==y))},Xo=i=>{let l=new Date(`${i}T00:00`),m=new Date;return l.getMonth()===m.getMonth()&&l.getDate()===m.getDate()};var Re={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(i,l)=>!iu(i,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(i,l)=>iu(i,""),valueType:"none"},include:{fn:(i,l)=>uu(i,l),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(i,l)=>!uu(i,l),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(i,l)=>Er(i,l),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(i,l)=>!Er(i,l),valueType:"text"},equal:{type:["number"],fn:(i,l)=>Er(i,l),valueType:"number"},isGreatThan:{type:["number"],fn:(i,l)=>Or(i,l),valueType:"number"},isLessThan:{type:["number"],fn:(i,l)=>Dr(i,l),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(i,l)=>!Or(i,l),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(i,l)=>!Dr(i,l),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(i,l)=>Dr(i,l),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(i,l)=>Or(i,l),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(i,l)=>Xo(i,l),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(i,l)=>fu(i,l),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(i,l)=>!fu(i,l),valueType:"list"},isTrue:{type:["boolean"],fn:(i,l)=>i=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(i,l)=>i!="true",valueType:"none"}};var Qd=(i,l)=>l.reduce((w,y)=>{let[O,J]=w,V=y.type=="fileprop"?Vo(J,y):y.type=="filemeta"?Qo(J,y):y.type=="frontmatter"?Jo(J,y):[],Y=J.filter(B=>!V.includes(B));return[[...O,...V],Y]},[[],i])[0],Vd=(i,l)=>l.reduce((m,w)=>w.type=="fileprop"?Vo(m,w):w.type=="filemeta"?Qo(m,w):w.type=="frontmatter"?Jo(m,w):[],i),Jo=(i,l)=>i.filter(m=>{let w=m.frontmatter;if(!w||!w[l.field])return!1;let y=Re[l.fn],O=!0;return y&&(O=y.fn(Lr(l.field,w[l.field]),l.value)),O}),Qo=(i,l)=>i.filter(m=>{let w="";l.field=="outlinks"?w=se(m.outlinks):l.field=="inlinks"?w=se(m.inlinks):l.field=="tags"&&(w=se(m.tags));let y=Re[l.fn],O=!0;return y&&(O=y.fn(w,l.value)),O}),Vo=(i,l)=>i.filter(m=>{if(["name","path","sticker","color","isFolder","extension","ctime","mtime","size","parent"].includes(l.field)){let y=Re[l.fn],O=!0;return y&&(O=y.fn(m[l.field],l.value)),O}return!0}),jo=(i,l)=>i.reduce((w,y)=>!w||y.filters.length==0?w:y.type=="any"?Qd([l],y.filters).length>0:Vd([l],y.filters).length>0,!0);var ns=(i,l,m)=>{if(!l)return{changed:!1,cache:{path:i.path,frames:{},schemas:[],listitems:{}}};let w=l.schemas,y=w.filter(Y=>Y.type=="frame").reduce((Y,B)=>{var an,j;return Lt(Rt({},Y),{[B.id]:{schema:B,cols:l.fields.filter(fn=>fn.schemaId==B.id),rows:(j=(an=l.tables[B.id])==null?void 0:an.rows)!=null?j:[]}})},{}),O=w.filter(Y=>Y.type=="listitem").reduce((Y,B)=>{var an,j;return Lt(Rt({},Y),{[B.id]:{schema:B,cols:l.fields.filter(fn=>fn.schemaId==B.id),rows:(j=(an=l.tables[B.id])==null?void 0:an.rows)!=null?j:[]}})},{}),J={path:i.path,frames:y,schemas:w,listitems:O},V=!0;return m&&Pr.default.isEqual(J,m)&&(V=!1),{changed:V,cache:J}},ts=(i,l,m)=>{var Pn,nn,q,vt,hn,Bn,pn,gn,yn;let w={};if(!l)return{changed:!1,cache:{cols:[],path:i.path,schemas:[],outlinks:[],contexts:[],files:[],tables:{},space:i,spaceMap:w}};let y=l.schemas.find(W=>W.primary=="true"),O={schema:y,cols:l.fields.filter(W=>W.schemaId==y.id),rows:(nn=(Pn=l.tables[y.id])==null?void 0:Pn.rows)!=null?nn:[]},J=l.schemas.filter(W=>W.type=="db").reduce((W,dn)=>{var _n,Kn;return Lt(Rt({},W),{[dn.id]:{schema:dn,cols:l.fields.filter(Kt=>Kt.schemaId==dn.id),rows:(Kn=(_n=l.tables[dn.id])==null?void 0:_n.rows)!=null?Kn:[]}})},{}),V=(vt=(q=O.cols)==null?void 0:q.filter(W=>W.type.startsWith("context")))!=null?vt:[],Y=(Bn=(hn=O.cols)==null?void 0:hn.filter(W=>W.type.startsWith("link")))!=null?Bn:[],B=_t(V.map(W=>W.value));V.forEach(W=>{w[W.name]={},O.rows.forEach(dn=>{ut(dn[W.name]).forEach(_n=>{var Kn;return w[W.name][_n]=[...(Kn=w[W.name][_n])!=null?Kn:[],dn.File]})})});let an=_t(O.rows.reduce((W,dn)=>_t([...W,...[...V,...Y].flatMap(_n=>ut(dn[_n.name]).map(Kn=>Ht(Kn)))]),[])),j={cols:l.fields.filter(W=>W.schemaId==y.id),path:i.path,contexts:B,outlinks:an,files:(yn=(gn=(pn=J.files)==null?void 0:pn.rows)==null?void 0:gn.map(W=>W.File))!=null?yn:[],tables:J,schemas:l.schemas,space:i,spaceMap:w},fn=!0;return m&&Pr.default.isEqual(j,m)&&(fn=!0),{changed:fn,cache:j}},jd=i=>{var m,w,y,O,J,V,Y,B,an,j,fn,Pn,nn;let l=[];return i&&i.tags&&l.push(...(w=(m=i.tags)==null?void 0:m.map(q=>q.tag))!=null?w:[]),i&&((y=i.frontmatter)==null?void 0:y.tags)&&l.push(...(typeof((O=i.frontmatter)==null?void 0:O.tags)=="string"?ut(i.frontmatter.tags.replace(/ /g,"")):Array.isArray((J=i.frontmatter)==null?void 0:J.tags)?(Y=(V=i.frontmatter)==null?void 0:V.tags)!=null?Y:[]:[]).filter(q=>typeof q=="string").map(q=>"#"+q)),i&&((B=i.frontmatter)==null?void 0:B.tag)&&l.push(...(typeof((an=i.frontmatter)==null?void 0:an.tag)=="string"?ut(i.frontmatter.tag.replace(/ /g,"")):Array.isArray((j=i.frontmatter)==null?void 0:j.tag)?(Pn=(fn=i.frontmatter)==null?void 0:fn.tag)!=null?Pn:[]:[]).filter(q=>typeof q=="string").map(q=>"#"+q)),(nn=_t(l))!=null?nn:[]};var es=(i,l,m,w,y,O,J,V,Y)=>{var Oe,Ot,Mn,De,Pe,Be,ft,Dt,We,mt,xt,Ue;let B={cacheType:"file",path:i.path,name:i.name,filename:i.filename};i.stat&&(B.ctime=i.stat.ctime,B.mtime=i.stat.mtime,B.size=i.stat.size,B.extension=i.extension);let an=[],j=jd(O),fn=(k,tn,un=new Set)=>{var tt,Ne;let K=[];for(let Zn of tn){let Ge=(Ne=(tt=k.get(Zn))==null?void 0:tt.contexts)!=null?Ne:[];for(let zt of Ge)un.has(zt)||(K.push(zt),un.add(zt),K.push(...fn(k,[Rr(zt)],un)))}return K};if(m.has(i.parent))for(let k of(Oe=m.get(i.parent).contexts)!=null?Oe:[])an.push(k);an.push(...j);let Pn=i.name,nn=i.name,q=(Ot=y==null?void 0:y.sticker)!=null?Ot:"",vt=(Mn=y==null?void 0:y.color)!=null?Mn:"",hn=(De=y==null?void 0:y.folder)!=null?De:"";hn=="true"&&(hn="");let Bn=i.parent,pn=i.isFolder,gn={},yn={},W=[],dn=[],_n=O==null?void 0:O.frontmatter;O!=null&&O.links&&dn.push(...O.links.map(k=>k.link));let Kn=V&&pn?V.folderNotePath:i.path;for(let k of Object.keys(J))Kn in J[k]&&W.push(k);let Kt="";if(_n){let tn=$o(zo(_n)).reduce((un,K)=>Lt(Rt({},un),{[K]:{name:K,type:Zo(be(_n[K],K))}}),{});Object.keys(tn).forEach(un=>{gn[un]=Lr(un,_n[un]),yn[un]=tn[un].type,tn[un].type.startsWith("link")&&dn.push(Ht(gn[un]))}),Kt=(Pe=gn[l.fmKeyBanner])!=null?Pe:"",gn[l.fmKeySticker]&&(q=_n[l.fmKeySticker]),gn[l.fmKeyColor]&&(vt=_n[l.fmKeyColor]),gn[l.fmKeyAlias]&&(nn=(Be=Ho(_n[l.fmKeyAlias]))==null?void 0:Be[0])}q=(q==null?void 0:q.length)>0?q:ko(B.extension,!1);let Et=Lt(Rt({},B),{name:Pn,tags:_t(an),alias:nn,fileTags:j,folderNote:V,sticker:q,color:vt,parent:Bn,banner:Kt,isFolder:pn,sortBy:hn,frontmatter:gn,frontmatterTypes:yn,inlinks:W,outlinks:dn}),zn=[],Le={};for(let k of an)zn.push(Rr(k));for(let[k,tn]of m){if(tn.space&&tn.space.folderPath==Bn&&tn.space.defPath!=i.path){zn.push(k);continue}if(((Dt=(ft=tn.metadata)==null?void 0:ft.filters)==null?void 0:Dt.length)>0&&jo(tn.metadata.filters,Et)){zn.push(k);continue}if(((mt=(We=tn.metadata)==null?void 0:We.links)==null?void 0:mt.length)>0&&((Ue=(xt=tn.metadata)==null?void 0:xt.links)!=null?Ue:[]).find(K=>K==Et.path)){zn.push(k);continue}}let Ee=fn(m,zn);zn.push(...Ee.map(k=>Rr(k))),zn.forEach(k=>{var tn,un,K;Le[k]=(K=(un=(tn=w.get(k))==null?void 0:tn.tables)==null?void 0:un.files)==null?void 0:K.rows.findIndex(tt=>tt.File==i.path)}),Et.tags.push(...Ee);let nt=V&&!pn?Lt(Rt({},Et),{spaces:[],contexts:[]}):Lt(Rt({},Et),{spaces:_t(zn),spaceRanks:Le}),Yn=!0;return Y&&Pr.default.isEqual(nt,Y)&&(Yn=!1),{changed:Yn,cache:nt}};function rs(i){let{file:l,settings:m,spacesCache:w,vaultItem:y,metadataCache:O,contextsCache:J,resolvedLinks:V,folderNote:Y,oldMetadata:B}=i;return es(l,m,w,J,y,O,V,Y,B)}function is(i){let{space:l,mdb:m,oldCache:w}=i;return ts(l,m,w)}function us(i){let{space:l,mdb:m,oldCache:w}=i;return ns(l,m,w)}var n_=self;n_.onmessage=async i=>{let{payload:l,job:m}=i.data,w;m.type=="file"?w=rs(l):m.type=="context"?w=is(l):m.type=="frames"&&(w=us(l));try{postMessage({job:m,result:w})}catch(y){console.log(y),postMessage({job:m,result:{$error:`Failed to index ${m.type} ${m.path}: ${y}`}})}};\n/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n'); + return inlineWorker('var qd=Object.create;var ru=Object.defineProperty,kd=Object.defineProperties,$d=Object.getOwnPropertyDescriptor,Hd=Object.getOwnPropertyDescriptors,Kd=Object.getOwnPropertyNames,Uo=Object.getOwnPropertySymbols,zd=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty,Yd=Object.prototype.propertyIsEnumerable;var No=(i,l,m)=>l in i?ru(i,l,{enumerable:!0,configurable:!0,writable:!0,value:m}):i[l]=m,Rt=(i,l)=>{for(var m in l||(l={}))Go.call(l,m)&&No(i,m,l[m]);if(Uo)for(var m of Uo(l))Yd.call(l,m)&&No(i,m,l[m]);return i},Lt=(i,l)=>kd(i,Hd(l));var Zd=(i,l)=>()=>(l||i((l={exports:{}}).exports,l),l.exports);var Xd=(i,l,m,w)=>{if(l&&typeof l=="object"||typeof l=="function")for(let y of Kd(l))!Go.call(i,y)&&y!==m&&ru(i,y,{get:()=>l[y],enumerable:!(w=$d(l,y))||w.enumerable});return i};var Jd=(i,l,m)=>(m=i!=null?qd(zd(i)):{},Xd(l||!i||!i.__esModule?ru(m,"default",{value:i,enumerable:!0}):m,i));var qo=Zd((oe,Me)=>{(function(){var i,l="4.17.21",m=200,w="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",y="Expected a function",O="Invalid `variable` option passed into `_.template`",J="__lodash_hash_undefined__",V=500,Y="__lodash_placeholder__",P=1,an=2,j=4,fn=1,Pn=2,nn=1,q=2,vt=4,hn=8,Bn=16,pn=32,gn=64,yn=128,W=256,dn=512,_n=30,Kn="...",Kt=800,Et=16,zn=1,Le=2,Ee=3,nt=1/0,Yn=9007199254740991,Oe=17976931348623157e292,Ot=0/0,Mn=4294967295,De=Mn-1,Pe=Mn>>>1,Be=[["ary",yn],["bind",nn],["bindKey",q],["curry",hn],["curryRight",Bn],["flip",dn],["partial",pn],["partialRight",gn],["rearg",W]],ft="[object Arguments]",Dt="[object Array]",We="[object AsyncFunction]",mt="[object Boolean]",xt="[object Date]",Ue="[object DOMException]",$="[object Error]",tn="[object Function]",un="[object GeneratorFunction]",K="[object Map]",tt="[object Number]",Ne="[object Null]",Zn="[object Object]",Ge="[object Promise]",zt="[object Proxy]",ae="[object RegExp]",Xn="[object Set]",le="[object String]",qe="[object Symbol]",fs="[object Undefined]",ce="[object WeakMap]",os="[object WeakSet]",he="[object ArrayBuffer]",Yt="[object DataView]",Br="[object Float32Array]",Wr="[object Float64Array]",Ur="[object Int8Array]",Nr="[object Int16Array]",Gr="[object Int32Array]",qr="[object Uint8Array]",kr="[object Uint8ClampedArray]",$r="[object Uint16Array]",Hr="[object Uint32Array]",ss=/\\b__p \\+= \'\';/g,as=/\\b(__p \\+=) \'\' \\+/g,ls=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n\'\';/g,ou=/&(?:amp|lt|gt|quot|#39);/g,su=/[&<>"\']/g,cs=RegExp(ou.source),hs=RegExp(su.source),ps=/<%-([\\s\\S]+?)%>/g,gs=/<%([\\s\\S]+?)%>/g,au=/<%=([\\s\\S]+?)%>/g,ds=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,_s=/^\\w*$/,vs=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Kr=/[\\\\^$.*+?()[\\]{}|]/g,ms=RegExp(Kr.source),zr=/^\\s+/,xs=/\\s/,ys=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,ws=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,As=/,? & /,Ss=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,Ts=/[()=,{}\\[\\]\\/\\s]/,Fs=/\\\\(\\\\)?/g,Cs=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,lu=/\\w*$/,Is=/^[-+]0x[0-9a-f]+$/i,Ms=/^0b[01]+$/i,bs=/^\\[object .+?Constructor\\]$/,Rs=/^0o[0-7]+$/i,Ls=/^(?:0|[1-9]\\d*)$/,Es=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,ke=/($^)/,Os=/[\'\\n\\r\\u2028\\u2029\\\\]/g,$e="\\\\ud800-\\\\udfff",Ds="\\\\u0300-\\\\u036f",Ps="\\\\ufe20-\\\\ufe2f",Bs="\\\\u20d0-\\\\u20ff",cu=Ds+Ps+Bs,hu="\\\\u2700-\\\\u27bf",pu="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",Ws="\\\\xac\\\\xb1\\\\xd7\\\\xf7",Us="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",Ns="\\\\u2000-\\\\u206f",Gs=" \\\\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",gu="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",du="\\\\ufe0e\\\\ufe0f",_u=Ws+Us+Ns+Gs,Yr="[\'\\u2019]",qs="["+$e+"]",vu="["+_u+"]",He="["+cu+"]",mu="\\\\d+",ks="["+hu+"]",xu="["+pu+"]",yu="[^"+$e+_u+mu+hu+pu+gu+"]",Zr="\\\\ud83c[\\\\udffb-\\\\udfff]",$s="(?:"+He+"|"+Zr+")",wu="[^"+$e+"]",Xr="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Jr="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Zt="["+gu+"]",Au="\\\\u200d",Su="(?:"+xu+"|"+yu+")",Hs="(?:"+Zt+"|"+yu+")",Tu="(?:"+Yr+"(?:d|ll|m|re|s|t|ve))?",Fu="(?:"+Yr+"(?:D|LL|M|RE|S|T|VE))?",Cu=$s+"?",Iu="["+du+"]?",Ks="(?:"+Au+"(?:"+[wu,Xr,Jr].join("|")+")"+Iu+Cu+")*",zs="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",Ys="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Mu=Iu+Cu+Ks,Zs="(?:"+[ks,Xr,Jr].join("|")+")"+Mu,Xs="(?:"+[wu+He+"?",He,Xr,Jr,qs].join("|")+")",Js=RegExp(Yr,"g"),Qs=RegExp(He,"g"),Qr=RegExp(Zr+"(?="+Zr+")|"+Xs+Mu,"g"),Vs=RegExp([Zt+"?"+xu+"+"+Tu+"(?="+[vu,Zt,"$"].join("|")+")",Hs+"+"+Fu+"(?="+[vu,Zt+Su,"$"].join("|")+")",Zt+"?"+Su+"+"+Tu,Zt+"+"+Fu,Ys,zs,mu,Zs].join("|"),"g"),js=RegExp("["+Au+$e+cu+du+"]"),na=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ta=["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"],ea=-1,z={};z[Br]=z[Wr]=z[Ur]=z[Nr]=z[Gr]=z[qr]=z[kr]=z[$r]=z[Hr]=!0,z[ft]=z[Dt]=z[he]=z[mt]=z[Yt]=z[xt]=z[$]=z[tn]=z[K]=z[tt]=z[Zn]=z[ae]=z[Xn]=z[le]=z[ce]=!1;var H={};H[ft]=H[Dt]=H[he]=H[Yt]=H[mt]=H[xt]=H[Br]=H[Wr]=H[Ur]=H[Nr]=H[Gr]=H[K]=H[tt]=H[Zn]=H[ae]=H[Xn]=H[le]=H[qe]=H[qr]=H[kr]=H[$r]=H[Hr]=!0,H[$]=H[tn]=H[ce]=!1;var ra={\\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"},ia={"&":"&","<":"<",">":">",\'"\':""","\'":"'"},ua={"&":"&","<":"<",">":">",""":\'"\',"'":"\'"},fa={"\\\\":"\\\\","\'":"\'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},oa=parseFloat,sa=parseInt,bu=typeof global=="object"&&global&&global.Object===Object&&global,aa=typeof self=="object"&&self&&self.Object===Object&&self,ln=bu||aa||Function("return this")(),Vr=typeof oe=="object"&&oe&&!oe.nodeType&&oe,Pt=Vr&&typeof Me=="object"&&Me&&!Me.nodeType&&Me,Ru=Pt&&Pt.exports===Vr,jr=Ru&&bu.process,Wn=function(){try{var c=Pt&&Pt.require&&Pt.require("util").types;return c||jr&&jr.binding&&jr.binding("util")}catch(g){}}(),Lu=Wn&&Wn.isArrayBuffer,Eu=Wn&&Wn.isDate,Ou=Wn&&Wn.isMap,Du=Wn&&Wn.isRegExp,Pu=Wn&&Wn.isSet,Bu=Wn&&Wn.isTypedArray;function bn(c,g,p){switch(p.length){case 0:return c.call(g);case 1:return c.call(g,p[0]);case 2:return c.call(g,p[0],p[1]);case 3:return c.call(g,p[0],p[1],p[2])}return c.apply(g,p)}function la(c,g,p,A){for(var I=-1,U=c==null?0:c.length;++I-1}function ni(c,g,p){for(var A=-1,I=c==null?0:c.length;++A-1;);return p}function Hu(c,g){for(var p=c.length;p--&&Xt(g,c[p],0)>-1;);return p}function xa(c,g){for(var p=c.length,A=0;p--;)c[p]===g&&++A;return A}var ya=ii(ra),wa=ii(ia);function Aa(c){return"\\\\"+fa[c]}function Sa(c,g){return c==null?i:c[g]}function Jt(c){return js.test(c)}function Ta(c){return na.test(c)}function Fa(c){for(var g,p=[];!(g=c.next()).done;)p.push(g.value);return p}function si(c){var g=-1,p=Array(c.size);return c.forEach(function(A,I){p[++g]=[I,A]}),p}function Ku(c,g){return function(p){return c(g(p))}}function At(c,g){for(var p=-1,A=c.length,I=0,U=[];++p-1}function hl(n,t){var e=this.__data__,r=sr(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}ot.prototype.clear=sl,ot.prototype.delete=al,ot.prototype.get=ll,ot.prototype.has=cl,ot.prototype.set=hl;function st(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function qn(n,t,e,r,u,o){var s,a=t&P,h=t&an,d=t&j;if(e&&(s=u?e(n,r,u,o):e(n)),s!==i)return s;if(!X(n))return n;var _=M(n);if(_){if(s=_c(n),!a)return Tn(n,s)}else{var v=xn(n),x=v==tn||v==un;if(bt(n))return Mf(n,a);if(v==Zn||v==ft||x&&!u){if(s=h||x?{}:Yf(n),!a)return h?uc(n,Ml(s,n)):ic(n,rf(s,n))}else{if(!H[v])return u?n:{};s=vc(n,v,a)}}o||(o=new Qn);var S=o.get(n);if(S)return S;o.set(n,s),So(n)?n.forEach(function(C){s.add(qn(C,t,e,C,n,o))}):wo(n)&&n.forEach(function(C,E){s.set(E,qn(C,t,e,E,n,o))});var F=d?h?Di:Oi:h?Cn:cn,R=_?i:F(n);return Un(R||n,function(C,E){R&&(E=C,C=n[E]),xe(s,E,qn(C,t,e,E,n,o))}),s}function bl(n){var t=cn(n);return function(e){return uf(e,n,t)}}function uf(n,t,e){var r=e.length;if(n==null)return!r;for(n=k(n);r--;){var u=e[r],o=t[u],s=n[u];if(s===i&&!(u in n)||!o(s))return!1}return!0}function ff(n,t,e){if(typeof n!="function")throw new Nn(y);return Ce(function(){n.apply(i,e)},t)}function ye(n,t,e,r){var u=-1,o=Ke,s=!0,a=n.length,h=[],d=t.length;if(!a)return h;e&&(t=Z(t,Rn(e))),r?(o=ni,s=!1):t.length>=m&&(o=pe,s=!1,t=new Ut(t));n:for(;++uu?0:u+e),r=r===i||r>u?u:b(r),r<0&&(r+=u),r=e>r?0:Fo(r);e0&&e(a)?t>1?vn(a,t-1,e,r,u):wt(u,a):r||(u[u.length]=a)}return u}var di=Df(),af=Df(!0);function et(n,t){return n&&di(n,t,cn)}function _i(n,t){return n&&af(n,t,cn)}function lr(n,t){return yt(t,function(e){return pt(n[e])})}function Gt(n,t){t=It(t,n);for(var e=0,r=t.length;n!=null&&et}function El(n,t){return n!=null&&G.call(n,t)}function Ol(n,t){return n!=null&&t in k(n)}function Dl(n,t,e){return n>=mn(t,e)&&n=120&&_.length>=120)?new Ut(s&&_):i}_=n[0];var v=-1,x=a[0];n:for(;++v-1;)a!==n&&tr.call(a,h,1),tr.call(n,h,1);return n}function yf(n,t){for(var e=n?t.length:0,r=e-1;e--;){var u=t[e];if(e==r||u!==o){var o=u;ht(u)?tr.call(n,u,1):Ci(n,u)}}return n}function Si(n,t){return n+ir(ju()*(t-n+1))}function Yl(n,t,e,r){for(var u=-1,o=sn(rr((t-n)/(e||1)),0),s=p(o);o--;)s[r?o:++u]=n,n+=e;return s}function Ti(n,t){var e="";if(!n||t<1||t>Yn)return e;do t%2&&(e+=n),t=ir(t/2),t&&(n+=n);while(t);return e}function L(n,t){return qi(Jf(n,t,In),n+"")}function Zl(n){return ef(fe(n))}function Xl(n,t){var e=fe(n);return wr(e,Nt(t,0,e.length))}function Se(n,t,e,r){if(!X(n))return n;t=It(t,n);for(var u=-1,o=t.length,s=o-1,a=n;a!=null&&++uu?0:u+t),e=e>u?u:e,e<0&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var o=p(u);++r>>1,s=n[o];s!==null&&!En(s)&&(e?s<=t:s=m){var d=t?null:ac(n);if(d)return Ye(d);s=!1,u=pe,h=new Ut}else h=t?[]:a;n:for(;++r=r?n:kn(n,t,e)}var If=Ga||function(n){return ln.clearTimeout(n)};function Mf(n,t){if(t)return n.slice();var e=n.length,r=Zu?Zu(e):new n.constructor(e);return n.copy(r),r}function Ri(n){var t=new n.constructor(n.byteLength);return new je(t).set(new je(n)),t}function nc(n,t){var e=t?Ri(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function tc(n){var t=new n.constructor(n.source,lu.exec(n));return t.lastIndex=n.lastIndex,t}function ec(n){return me?k(me.call(n)):{}}function bf(n,t){var e=t?Ri(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Rf(n,t){if(n!==t){var e=n!==i,r=n===null,u=n===n,o=En(n),s=t!==i,a=t===null,h=t===t,d=En(t);if(!a&&!d&&!o&&n>t||o&&s&&h&&!a&&!d||r&&s&&h||!e&&h||!u)return 1;if(!r&&!o&&!d&&n=a)return h;var d=e[r];return h*(d=="desc"?-1:1)}}return n.index-t.index}function Lf(n,t,e,r){for(var u=-1,o=n.length,s=e.length,a=-1,h=t.length,d=sn(o-s,0),_=p(h+d),v=!r;++a1?e[u-1]:i,s=u>2?e[2]:i;for(o=n.length>3&&typeof o=="function"?(u--,o):i,s&&An(e[0],e[1],s)&&(o=u<3?i:o,u=1),t=k(t);++r-1?u[o?t[s]:s]:i}}function Wf(n){return ct(function(t){var e=t.length,r=e,u=Gn.prototype.thru;for(n&&t.reverse();r--;){var o=t[r];if(typeof o!="function")throw new Nn(y);if(u&&!s&&xr(o)=="wrapper")var s=new Gn([],!0)}for(r=s?r:e;++r1&&B.reverse(),_&&ha))return!1;var d=o.get(n),_=o.get(t);if(d&&_)return d==t&&_==n;var v=-1,x=!0,S=e&Pn?new Ut:i;for(o.set(n,t),o.set(t,n);++v1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(ys,`{\n/* [wrapped with `+t+`] */\n`)}function xc(n){return M(n)||$t(n)||!!(Qu&&n&&n[Qu])}function ht(n,t){var e=typeof n;return t=t==null?Yn:t,!!t&&(e=="number"||e!="symbol"&&Ls.test(n))&&n>-1&&n%1==0&&n0){if(++t>=Kt)return arguments[0]}else t=0;return n.apply(i,arguments)}}function wr(n,t){var e=-1,r=n.length,u=r-1;for(t=t===i?r:t;++e1?n[t-1]:i;return e=typeof e=="function"?(n.pop(),e):i,so(n,e)});function ao(n){var t=f(n);return t.__chain__=!0,t}function Rh(n,t){return t(n),n}function Ar(n,t){return t(n)}var Lh=ct(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,u=function(o){return gi(o,n)};return t>1||this.__actions__.length||!(r instanceof D)||!ht(e)?this.thru(u):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:Ar,args:[u],thisArg:i}),new Gn(r,this.__chain__).thru(function(o){return t&&!o.length&&o.push(i),o}))});function Eh(){return ao(this)}function Oh(){return new Gn(this.value(),this.__chain__)}function Dh(){this.__values__===i&&(this.__values__=To(this.value()));var n=this.__index__>=this.__values__.length,t=n?i:this.__values__[this.__index__++];return{done:n,value:t}}function Ph(){return this}function Bh(n){for(var t,e=this;e instanceof or;){var r=eo(e);r.__index__=0,r.__values__=i,t?u.__wrapped__=r:t=r;var u=r;e=e.__wrapped__}return u.__wrapped__=n,t}function Wh(){var n=this.__wrapped__;if(n instanceof D){var t=n;return this.__actions__.length&&(t=new D(this)),t=t.reverse(),t.__actions__.push({func:Ar,args:[ki],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(ki)}function Uh(){return Ff(this.__wrapped__,this.__actions__)}var Nh=gr(function(n,t,e){G.call(n,e)?++n[e]:at(n,e,1)});function Gh(n,t,e){var r=M(n)?Wu:Rl;return e&&An(n,t,e)&&(t=i),r(n,T(t,3))}function qh(n,t){var e=M(n)?yt:sf;return e(n,T(t,3))}var kh=Bf(ro),$h=Bf(io);function Hh(n,t){return vn(Sr(n,t),1)}function Kh(n,t){return vn(Sr(n,t),nt)}function zh(n,t,e){return e=e===i?1:b(e),vn(Sr(n,t),e)}function lo(n,t){var e=M(n)?Un:Ft;return e(n,T(t,3))}function co(n,t){var e=M(n)?ca:of;return e(n,T(t,3))}var Yh=gr(function(n,t,e){G.call(n,e)?n[e].push(t):at(n,e,[t])});function Zh(n,t,e,r){n=Fn(n)?n:fe(n),e=e&&!r?b(e):0;var u=n.length;return e<0&&(e=sn(u+e,0)),Mr(n)?e<=u&&n.indexOf(t,e)>-1:!!u&&Xt(n,t,e)>-1}var Xh=L(function(n,t,e){var r=-1,u=typeof t=="function",o=Fn(n)?p(n.length):[];return Ft(n,function(s){o[++r]=u?bn(t,s,e):we(s,t,e)}),o}),Jh=gr(function(n,t,e){at(n,e,t)});function Sr(n,t){var e=M(n)?Z:gf;return e(n,T(t,3))}function Qh(n,t,e,r){return n==null?[]:(M(t)||(t=t==null?[]:[t]),e=r?i:e,M(e)||(e=e==null?[]:[e]),mf(n,t,e))}var Vh=gr(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function jh(n,t,e){var r=M(n)?ti:qu,u=arguments.length<3;return r(n,T(t,4),e,u,Ft)}function np(n,t,e){var r=M(n)?ha:qu,u=arguments.length<3;return r(n,T(t,4),e,u,of)}function tp(n,t){var e=M(n)?yt:sf;return e(n,Cr(T(t,3)))}function ep(n){var t=M(n)?ef:Zl;return t(n)}function rp(n,t,e){(e?An(n,t,e):t===i)?t=1:t=b(t);var r=M(n)?Fl:Xl;return r(n,t)}function ip(n){var t=M(n)?Cl:Ql;return t(n)}function up(n){if(n==null)return 0;if(Fn(n))return Mr(n)?Qt(n):n.length;var t=xn(n);return t==K||t==Xn?n.size:yi(n).length}function fp(n,t,e){var r=M(n)?ei:Vl;return e&&An(n,t,e)&&(t=i),r(n,T(t,3))}var op=L(function(n,t){if(n==null)return[];var e=t.length;return e>1&&An(n,t[0],t[1])?t=[]:e>2&&An(t[0],t[1],t[2])&&(t=[t[0]]),mf(n,vn(t,1),[])}),Tr=qa||function(){return ln.Date.now()};function sp(n,t){if(typeof t!="function")throw new Nn(y);return n=b(n),function(){if(--n<1)return t.apply(this,arguments)}}function ho(n,t,e){return t=e?i:t,t=n&&t==null?n.length:t,lt(n,yn,i,i,i,i,t)}function po(n,t){var e;if(typeof t!="function")throw new Nn(y);return n=b(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=i),e}}var Hi=L(function(n,t,e){var r=nn;if(e.length){var u=At(e,ie(Hi));r|=pn}return lt(n,r,t,e,u)}),go=L(function(n,t,e){var r=nn|q;if(e.length){var u=At(e,ie(go));r|=pn}return lt(t,r,n,e,u)});function _o(n,t,e){t=e?i:t;var r=lt(n,hn,i,i,i,i,i,t);return r.placeholder=_o.placeholder,r}function vo(n,t,e){t=e?i:t;var r=lt(n,Bn,i,i,i,i,i,t);return r.placeholder=vo.placeholder,r}function mo(n,t,e){var r,u,o,s,a,h,d=0,_=!1,v=!1,x=!0;if(typeof n!="function")throw new Nn(y);t=Hn(t)||0,X(e)&&(_=!!e.leading,v="maxWait"in e,o=v?sn(Hn(e.maxWait)||0,t):o,x="trailing"in e?!!e.trailing:x);function S(rn){var jn=r,dt=u;return r=u=i,d=rn,s=n.apply(dt,jn),s}function F(rn){return d=rn,a=Ce(E,t),_?S(rn):s}function R(rn){var jn=rn-h,dt=rn-d,Wo=t-jn;return v?mn(Wo,o-dt):Wo}function C(rn){var jn=rn-h,dt=rn-d;return h===i||jn>=t||jn<0||v&&dt>=o}function E(){var rn=Tr();if(C(rn))return B(rn);a=Ce(E,R(rn))}function B(rn){return a=i,x&&r?S(rn):(r=u=i,s)}function On(){a!==i&&If(a),d=0,r=h=u=a=i}function Sn(){return a===i?s:B(Tr())}function Dn(){var rn=Tr(),jn=C(rn);if(r=arguments,u=this,h=rn,jn){if(a===i)return F(h);if(v)return If(a),a=Ce(E,t),S(h)}return a===i&&(a=Ce(E,t)),s}return Dn.cancel=On,Dn.flush=Sn,Dn}var ap=L(function(n,t){return ff(n,1,t)}),lp=L(function(n,t,e){return ff(n,Hn(t)||0,e)});function cp(n){return lt(n,dn)}function Fr(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new Nn(y);var e=function(){var r=arguments,u=t?t.apply(this,r):r[0],o=e.cache;if(o.has(u))return o.get(u);var s=n.apply(this,r);return e.cache=o.set(u,s)||o,s};return e.cache=new(Fr.Cache||st),e}Fr.Cache=st;function Cr(n){if(typeof n!="function")throw new Nn(y);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function hp(n){return po(2,n)}var pp=jl(function(n,t){t=t.length==1&&M(t[0])?Z(t[0],Rn(T())):Z(vn(t,1),Rn(T()));var e=t.length;return L(function(r){for(var u=-1,o=mn(r.length,e);++u=t}),$t=cf(function(){return arguments}())?cf:function(n){return Q(n)&&G.call(n,"callee")&&!Ju.call(n,"callee")},M=p.isArray,Mp=Lu?Rn(Lu):Bl;function Fn(n){return n!=null&&Ir(n.length)&&!pt(n)}function en(n){return Q(n)&&Fn(n)}function bp(n){return n===!0||n===!1||Q(n)&&wn(n)==mt}var bt=$a||eu,Rp=Eu?Rn(Eu):Wl;function Lp(n){return Q(n)&&n.nodeType===1&&!Ie(n)}function Ep(n){if(n==null)return!0;if(Fn(n)&&(M(n)||typeof n=="string"||typeof n.splice=="function"||bt(n)||ue(n)||$t(n)))return!n.length;var t=xn(n);if(t==K||t==Xn)return!n.size;if(Fe(n))return!yi(n).length;for(var e in n)if(G.call(n,e))return!1;return!0}function Op(n,t){return Ae(n,t)}function Dp(n,t,e){e=typeof e=="function"?e:i;var r=e?e(n,t):i;return r===i?Ae(n,t,i,e):!!r}function zi(n){if(!Q(n))return!1;var t=wn(n);return t==$||t==Ue||typeof n.message=="string"&&typeof n.name=="string"&&!Ie(n)}function Pp(n){return typeof n=="number"&&Vu(n)}function pt(n){if(!X(n))return!1;var t=wn(n);return t==tn||t==un||t==We||t==zt}function yo(n){return typeof n=="number"&&n==b(n)}function Ir(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Yn}function X(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function Q(n){return n!=null&&typeof n=="object"}var wo=Ou?Rn(Ou):Nl;function Bp(n,t){return n===t||xi(n,t,Bi(t))}function Wp(n,t,e){return e=typeof e=="function"?e:i,xi(n,t,Bi(t),e)}function Up(n){return Ao(n)&&n!=+n}function Np(n){if(Ac(n))throw new I(w);return hf(n)}function Gp(n){return n===null}function qp(n){return n==null}function Ao(n){return typeof n=="number"||Q(n)&&wn(n)==tt}function Ie(n){if(!Q(n)||wn(n)!=Zn)return!1;var t=nr(n);if(t===null)return!0;var e=G.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Je.call(e)==Wa}var Yi=Du?Rn(Du):Gl;function kp(n){return yo(n)&&n>=-Yn&&n<=Yn}var So=Pu?Rn(Pu):ql;function Mr(n){return typeof n=="string"||!M(n)&&Q(n)&&wn(n)==le}function En(n){return typeof n=="symbol"||Q(n)&&wn(n)==qe}var ue=Bu?Rn(Bu):kl;function $p(n){return n===i}function Hp(n){return Q(n)&&xn(n)==ce}function Kp(n){return Q(n)&&wn(n)==os}var zp=mr(wi),Yp=mr(function(n,t){return n<=t});function To(n){if(!n)return[];if(Fn(n))return Mr(n)?Jn(n):Tn(n);if(ge&&n[ge])return Fa(n[ge]());var t=xn(n),e=t==K?si:t==Xn?Ye:fe;return e(n)}function gt(n){if(!n)return n===0?n:0;if(n=Hn(n),n===nt||n===-nt){var t=n<0?-1:1;return t*Oe}return n===n?n:0}function b(n){var t=gt(n),e=t%1;return t===t?e?t-e:t:0}function Fo(n){return n?Nt(b(n),0,Mn):0}function Hn(n){if(typeof n=="number")return n;if(En(n))return Ot;if(X(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=X(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=ku(n);var e=Ms.test(n);return e||Rs.test(n)?sa(n.slice(2),e?2:8):Is.test(n)?Ot:+n}function Co(n){return rt(n,Cn(n))}function Zp(n){return n?Nt(b(n),-Yn,Yn):n===0?n:0}function N(n){return n==null?"":Ln(n)}var Xp=ee(function(n,t){if(Fe(t)||Fn(t)){rt(t,cn(t),n);return}for(var e in t)G.call(t,e)&&xe(n,e,t[e])}),Io=ee(function(n,t){rt(t,Cn(t),n)}),br=ee(function(n,t,e,r){rt(t,Cn(t),n,r)}),Jp=ee(function(n,t,e,r){rt(t,cn(t),n,r)}),Qp=ct(gi);function Vp(n,t){var e=te(n);return t==null?e:rf(e,t)}var jp=L(function(n,t){n=k(n);var e=-1,r=t.length,u=r>2?t[2]:i;for(u&&An(t[0],t[1],u)&&(r=1);++e1),o}),rt(n,Di(n),e),r&&(e=qn(e,P|an|j,lc));for(var u=t.length;u--;)Ci(e,t[u]);return e});function vg(n,t){return bo(n,Cr(T(t)))}var mg=ct(function(n,t){return n==null?{}:Kl(n,t)});function bo(n,t){if(n==null)return{};var e=Z(Di(n),function(r){return[r]});return t=T(t),xf(n,e,function(r,u){return t(r,u[0])})}function xg(n,t,e){t=It(t,n);var r=-1,u=t.length;for(u||(u=1,n=i);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var u=ju();return mn(n+u*(t-n+oa("1e-"+((u+"").length-1))),t)}return Si(n,t)}var Rg=re(function(n,t,e){return t=t.toLowerCase(),n+(e?Eo(t):t)});function Eo(n){return Ji(N(n).toLowerCase())}function Oo(n){return n=N(n),n&&n.replace(Es,ya).replace(Qs,"")}function Lg(n,t,e){n=N(n),t=Ln(t);var r=n.length;e=e===i?r:Nt(b(e),0,r);var u=e;return e-=t.length,e>=0&&n.slice(e,u)==t}function Eg(n){return n=N(n),n&&hs.test(n)?n.replace(su,wa):n}function Og(n){return n=N(n),n&&ms.test(n)?n.replace(Kr,"\\\\$&"):n}var Dg=re(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),Pg=re(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),Bg=Pf("toLowerCase");function Wg(n,t,e){n=N(n),t=b(t);var r=t?Qt(n):0;if(!t||r>=t)return n;var u=(t-r)/2;return vr(ir(u),e)+n+vr(rr(u),e)}function Ug(n,t,e){n=N(n),t=b(t);var r=t?Qt(n):0;return t&&r>>0,e?(n=N(n),n&&(typeof t=="string"||t!=null&&!Yi(t))&&(t=Ln(t),!t&&Jt(n))?Mt(Jn(n),0,e):n.split(t,e)):[]}var Kg=re(function(n,t,e){return n+(e?" ":"")+Ji(t)});function zg(n,t,e){return n=N(n),e=e==null?0:Nt(b(e),0,n.length),t=Ln(t),n.slice(e,e+t.length)==t}function Yg(n,t,e){var r=f.templateSettings;e&&An(n,t,e)&&(t=i),n=N(n),t=br({},t,r,kf);var u=br({},t.imports,r.imports,kf),o=cn(u),s=oi(u,o),a,h,d=0,_=t.interpolate||ke,v="__p += \'",x=ai((t.escape||ke).source+"|"+_.source+"|"+(_===au?Cs:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),S="//# sourceURL="+(G.call(t,"sourceURL")?(t.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++ea+"]")+`\n`;n.replace(x,function(C,E,B,On,Sn,Dn){return B||(B=On),v+=n.slice(d,Dn).replace(Os,Aa),E&&(a=!0,v+=`\' +\n__e(`+E+`) +\n\'`),Sn&&(h=!0,v+=`\';\n`+Sn+`;\n__p += \'`),B&&(v+=`\' +\n((__t = (`+B+`)) == null ? \'\' : __t) +\n\'`),d=Dn+C.length,C}),v+=`\';\n`;var F=G.call(t,"variable")&&t.variable;if(!F)v=`with (obj) {\n`+v+`\n}\n`;else if(Ts.test(F))throw new I(O);v=(h?v.replace(ss,""):v).replace(as,"$1").replace(ls,"$1;"),v="function("+(F||"obj")+`) {\n`+(F?"":`obj || (obj = {});\n`)+"var __t, __p = \'\'"+(a?", __e = _.escape":"")+(h?`, __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, \'\') }\n`:`;\n`)+v+`return __p\n}`;var R=Po(function(){return U(o,S+"return "+v).apply(i,s)});if(R.source=v,zi(R))throw R;return R}function Zg(n){return N(n).toLowerCase()}function Xg(n){return N(n).toUpperCase()}function Jg(n,t,e){if(n=N(n),n&&(e||t===i))return ku(n);if(!n||!(t=Ln(t)))return n;var r=Jn(n),u=Jn(t),o=$u(r,u),s=Hu(r,u)+1;return Mt(r,o,s).join("")}function Qg(n,t,e){if(n=N(n),n&&(e||t===i))return n.slice(0,zu(n)+1);if(!n||!(t=Ln(t)))return n;var r=Jn(n),u=Hu(r,Jn(t))+1;return Mt(r,0,u).join("")}function Vg(n,t,e){if(n=N(n),n&&(e||t===i))return n.replace(zr,"");if(!n||!(t=Ln(t)))return n;var r=Jn(n),u=$u(r,Jn(t));return Mt(r,u).join("")}function jg(n,t){var e=_n,r=Kn;if(X(t)){var u="separator"in t?t.separator:u;e="length"in t?b(t.length):e,r="omission"in t?Ln(t.omission):r}n=N(n);var o=n.length;if(Jt(n)){var s=Jn(n);o=s.length}if(e>=o)return n;var a=e-Qt(r);if(a<1)return r;var h=s?Mt(s,0,a).join(""):n.slice(0,a);if(u===i)return h+r;if(s&&(a+=h.length-a),Yi(u)){if(n.slice(a).search(u)){var d,_=h;for(u.global||(u=ai(u.source,N(lu.exec(u))+"g")),u.lastIndex=0;d=u.exec(_);)var v=d.index;h=h.slice(0,v===i?a:v)}}else if(n.indexOf(Ln(u),a)!=a){var x=h.lastIndexOf(u);x>-1&&(h=h.slice(0,x))}return h+r}function nd(n){return n=N(n),n&&cs.test(n)?n.replace(ou,ba):n}var td=re(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),Ji=Pf("toUpperCase");function Do(n,t,e){return n=N(n),t=e?i:t,t===i?Ta(n)?Ea(n):da(n):n.match(t)||[]}var Po=L(function(n,t){try{return bn(n,i,t)}catch(e){return zi(e)?e:new I(e)}}),ed=ct(function(n,t){return Un(t,function(e){e=it(e),at(n,e,Hi(n[e],n))}),n});function rd(n){var t=n==null?0:n.length,e=T();return n=t?Z(n,function(r){if(typeof r[1]!="function")throw new Nn(y);return[e(r[0]),r[1]]}):[],L(function(r){for(var u=-1;++uYn)return[];var e=Mn,r=mn(n,Mn);t=T(t),n-=Mn;for(var u=fi(r,t);++e0||t<0)?new D(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==i&&(t=b(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},D.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},D.prototype.toArray=function(){return this.take(Mn)},et(D.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),u=f[r?"take"+(t=="last"?"Right":""):t],o=r||/^find/.test(t);!u||(f.prototype[t]=function(){var s=this.__wrapped__,a=r?[1]:arguments,h=s instanceof D,d=a[0],_=h||M(s),v=function(E){var B=u.apply(f,wt([E],a));return r&&x?B[0]:B};_&&e&&typeof d=="function"&&d.length!=1&&(h=_=!1);var x=this.__chain__,S=!!this.__actions__.length,F=o&&!x,R=h&&!S;if(!o&&_){s=R?s:new D(this);var C=n.apply(s,a);return C.__actions__.push({func:Ar,args:[v],thisArg:i}),new Gn(C,x)}return F&&R?n.apply(this,a):(C=this.thru(v),F?r?C.value()[0]:C.value():C)})}),Un(["pop","push","shift","sort","splice","unshift"],function(n){var t=Ze[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(M(o)?o:[],u)}return this[e](function(s){return t.apply(M(s)?s:[],u)})}}),et(D.prototype,function(n,t){var e=f[t];if(e){var r=e.name+"";G.call(ne,r)||(ne[r]=[]),ne[r].push({name:t,func:e})}}),ne[dr(i,q).name]=[{name:"wrapper",func:i}],D.prototype.clone=nl,D.prototype.reverse=tl,D.prototype.value=el,f.prototype.at=Lh,f.prototype.chain=Eh,f.prototype.commit=Oh,f.prototype.next=Dh,f.prototype.plant=Bh,f.prototype.reverse=Wh,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=Uh,f.prototype.first=f.prototype.head,ge&&(f.prototype[ge]=Ph),f},St=Oa();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ln._=St,define(function(){return St})):Pt?((Pt.exports=St)._=St,Vr._=St):ln._=St}).call(oe)});var Pr=Jd(qo());var _t=i=>[...new Set(i)],ko=i=>[...new Map(i.map(l=>[l.toLowerCase(),l])).values()];var $o=(i,l,m)=>{if(i=="Spaces/Home")return"ui//mk-ui-spaces";if(!l)return m?"ui//mk-ui-folder-solid":"ui//mk-ui-folder";switch(l){case"png":case"jpg":case"jpeg":case"svg":return"ui//mk-make-image";case"mov":case"webm":return"ui//mk-ui-video";case"canvas":return"ui//mk-ui-canvas";default:return m?"ui//mk-ui-file-solid":"ui//mk-ui-file"}};function Ho(i){return Array.isArray(i)?i:[]}var Ko=(i,l)=>l.indexOf(i)>0?l.indexOf(i):l.length;var Rr=i=>"spaces://"+i;var ut=i=>{var l;return(l=i==null?void 0:i.match(/(\\\\.|[^,])+/g))!=null?l:[]},Ht=i=>{if(!i)return"";let l=/\\[\\[(.*?)\\]\\]/g.exec(i),m=(l==null?void 0:l.length)>1?l[1].substring(0,Ko("|",l[1])):i;return m||i};var be=(i,l)=>{if(typeof i=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(i)||i.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(i))return"date";if(l=="tag"||l=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(i))return"link"}else{if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(i)if(Array.isArray(i)||typeof i=="string"&&i.indexOf(",")>-1){let m=Array.isArray(i)?i:[];if(typeof i=="string"&&i.indexOf(",")>-1&&(m=ut(i)),l=="tag"||l=="tags")return"tag-multi";if(m.length==1&&Array.isArray(m[0])&&m[0].length==1&&typeof m[0][0]=="string")return"link";let w=_t(m.map(y=>be(y,l)));return w.length==1&&w[0]=="link"?"link-multi":"option-multi"}else{if(i.isLuxonDateTime)return"date";if(i.isLuxonDuration)return"duration";if(i.type=="file")return"link";if(typeof i=="object"&&!Array.isArray(i)&&i!==null)return"object"}else return"unknown"}return"text"};var zo=i=>Object.keys(i!=null?i:{}).filter(l=>l!="position").filter(l=>l!="tag"&&l!="tags");var se=i=>i.join(","),Yo=i=>i.join(", ");var Lr=(i,l)=>{switch(be(l,i)){case"object":return JSON.stringify(l);case"number":return l.toString();case"boolean":return l?"true":"false";case"date":return l;case"duration":return Yo(Object.keys(l.values).reduce((w,y)=>[...w,...l.values[y]>0?[l.values[y]+" "+y]:[]],[]));case"option-multi":case"link-multi":return typeof l=="string"?Ht(l):se(l.map(w=>w?typeof w=="string"?Ht(w):w.path?w.path:Array.isArray(l)&&w.length==1&&Array.isArray(w[0])&&w[0].length==1&&typeof w[0][0]=="string"?w[0][0]:JSON.stringify(w):""));case"link":return Array.isArray(l)&&l.length==1&&Array.isArray(l[0])&&l[0].length==1&&typeof l[0][0]=="string"?l[0][0]:typeof l=="string"?Ht(l):l.path;case"text":case"tag":case"image":return l}return""};var Zo=i=>{switch(i){case"duration":return"text";case"unknown":return"text"}return i};var Er=(i,l)=>i==l,iu=(i,l)=>(i!=null?i:"").length==0,uu=(i,l)=>(i!=null?i:"").toLowerCase().includes((l!=null?l:"").toLowerCase()),Or=(i,l)=>parseFloat(i)>parseFloat(l),Dr=(i,l)=>parseInt(i)>parseInt(l),fu=(i,l)=>{let m=i?ut(i):[];return(l?ut(l):[]).some(y=>m.some(O=>O==y))},Xo=i=>{let l=new Date(`${i}T00:00`),m=new Date;return l.getMonth()===m.getMonth()&&l.getDate()===m.getDate()};var Re={isNotEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(i,l)=>!iu(i,""),valueType:"none"},isEmpty:{type:["text","file","link","link-multi","fileprop","image"],fn:(i,l)=>iu(i,""),valueType:"none"},include:{fn:(i,l)=>uu(i,l),type:["text","file","link","link-multi","fileprop","image"],valueType:"text"},notInclude:{type:["text","file","link","link-multi","fileprop","image"],fn:(i,l)=>!uu(i,l),valueType:"text"},is:{type:["text","file","link","context","fileprop"],fn:(i,l)=>Er(i,l),valueType:"text"},isNot:{type:["text","file","link","context","fileprop"],fn:(i,l)=>!Er(i,l),valueType:"text"},equal:{type:["number"],fn:(i,l)=>Er(i,l),valueType:"number"},isGreatThan:{type:["number"],fn:(i,l)=>Or(i,l),valueType:"number"},isLessThan:{type:["number"],fn:(i,l)=>Dr(i,l),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(i,l)=>!Or(i,l),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(i,l)=>!Dr(i,l),valueType:"number"},dateBefore:{type:["date","fileprop"],fn:(i,l)=>Dr(i,l),valueType:"date"},dateAfter:{type:["date","fileprop"],fn:(i,l)=>Or(i,l),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(i,l)=>Xo(i,l),valueType:"none"},isAnyInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(i,l)=>fu(i,l),valueType:"list"},isNoneInList:{type:["option","context","option-multi","context-multi","tags-multi","tags"],fn:(i,l)=>!fu(i,l),valueType:"list"},isTrue:{type:["boolean"],fn:(i,l)=>i=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(i,l)=>i!="true",valueType:"none"}};var Qd=(i,l)=>l.reduce((w,y)=>{let[O,J]=w,V=y.type=="fileprop"?Vo(J,y):y.type=="filemeta"?Qo(J,y):y.type=="frontmatter"?Jo(J,y):[],Y=J.filter(P=>!V.includes(P));return[[...O,...V],Y]},[[],i])[0],Vd=(i,l)=>l.reduce((m,w)=>w.type=="fileprop"?Vo(m,w):w.type=="filemeta"?Qo(m,w):w.type=="frontmatter"?Jo(m,w):[],i),Jo=(i,l)=>i.filter(m=>{let w=m.frontmatter;if(!w||!w[l.field])return!1;let y=Re[l.fn],O=!0;return y&&(O=y.fn(Lr(l.field,w[l.field]),l.value)),O}),Qo=(i,l)=>i.filter(m=>{let w="";l.field=="outlinks"?w=se(m.outlinks):l.field=="inlinks"?w=se(m.inlinks):l.field=="tags"&&(w=se(m.tags));let y=Re[l.fn],O=!0;return y&&(O=y.fn(w,l.value)),O}),Vo=(i,l)=>i.filter(m=>{if(["name","path","sticker","color","isFolder","extension","ctime","mtime","size","parent"].includes(l.field)){let y=Re[l.fn],O=!0;return y&&(O=y.fn(m[l.field],l.value)),O}return!0}),jo=(i,l)=>i.reduce((w,y)=>!w||y.filters.length==0?w:y.type=="any"?Qd([l],y.filters).length>0:Vd([l],y.filters).length>0,!0);var ns=(i,l,m)=>{if(!l)return{changed:!1,cache:{path:i.path,frames:{},schemas:[],listitems:{}}};let w=l.schemas,y=w.filter(Y=>Y.type=="frame").reduce((Y,P)=>{var an,j;return Lt(Rt({},Y),{[P.id]:{schema:P,cols:l.fields.filter(fn=>fn.schemaId==P.id),rows:(j=(an=l.tables[P.id])==null?void 0:an.rows)!=null?j:[]}})},{}),O=w.filter(Y=>Y.type=="listitem").reduce((Y,P)=>{var an,j;return Lt(Rt({},Y),{[P.id]:{schema:P,cols:l.fields.filter(fn=>fn.schemaId==P.id),rows:(j=(an=l.tables[P.id])==null?void 0:an.rows)!=null?j:[]}})},{}),J={path:i.path,frames:y,schemas:w,listitems:O},V=!0;return m&&Pr.default.isEqual(J,m)&&(V=!1),{changed:V,cache:J}},ts=(i,l,m)=>{var Pn,nn,q,vt,hn,Bn,pn,gn,yn;let w={};if(!l)return{changed:!1,cache:{cols:[],path:i.path,schemas:[],outlinks:[],contexts:[],files:[],tables:{},space:i,spaceMap:w}};let y=l.schemas.find(W=>W.primary=="true"),O={schema:y,cols:l.fields.filter(W=>W.schemaId==y.id),rows:(nn=(Pn=l.tables[y.id])==null?void 0:Pn.rows)!=null?nn:[]},J=l.schemas.filter(W=>W.type=="db").reduce((W,dn)=>{var _n,Kn;return Lt(Rt({},W),{[dn.id]:{schema:dn,cols:l.fields.filter(Kt=>Kt.schemaId==dn.id),rows:(Kn=(_n=l.tables[dn.id])==null?void 0:_n.rows)!=null?Kn:[]}})},{}),V=(vt=(q=O.cols)==null?void 0:q.filter(W=>W.type.startsWith("context")))!=null?vt:[],Y=(Bn=(hn=O.cols)==null?void 0:hn.filter(W=>W.type.startsWith("link")))!=null?Bn:[],P=_t(V.map(W=>W.value));V.forEach(W=>{w[W.name]={},O.rows.forEach(dn=>{ut(dn[W.name]).forEach(_n=>{var Kn;return w[W.name][_n]=[...(Kn=w[W.name][_n])!=null?Kn:[],dn.File]})})});let an=_t(O.rows.reduce((W,dn)=>_t([...W,...[...V,...Y].flatMap(_n=>ut(dn[_n.name]).map(Kn=>Ht(Kn)))]),[])),j={cols:l.fields.filter(W=>W.schemaId==y.id),path:i.path,contexts:P,outlinks:an,files:(yn=(gn=(pn=J.files)==null?void 0:pn.rows)==null?void 0:gn.map(W=>W.File))!=null?yn:[],tables:J,schemas:l.schemas,space:i,spaceMap:w},fn=!0;return m&&Pr.default.isEqual(j,m)&&(fn=!0),{changed:fn,cache:j}},jd=i=>{var m,w,y,O,J,V,Y,P,an,j,fn,Pn,nn;let l=[];return i&&i.tags&&l.push(...(w=(m=i.tags)==null?void 0:m.map(q=>q.tag))!=null?w:[]),i&&((y=i.frontmatter)==null?void 0:y.tags)&&l.push(...(typeof((O=i.frontmatter)==null?void 0:O.tags)=="string"?ut(i.frontmatter.tags.replace(/ /g,"")):Array.isArray((J=i.frontmatter)==null?void 0:J.tags)?(Y=(V=i.frontmatter)==null?void 0:V.tags)!=null?Y:[]:[]).filter(q=>typeof q=="string").map(q=>"#"+q)),i&&((P=i.frontmatter)==null?void 0:P.tag)&&l.push(...(typeof((an=i.frontmatter)==null?void 0:an.tag)=="string"?ut(i.frontmatter.tag.replace(/ /g,"")):Array.isArray((j=i.frontmatter)==null?void 0:j.tag)?(Pn=(fn=i.frontmatter)==null?void 0:fn.tag)!=null?Pn:[]:[]).filter(q=>typeof q=="string").map(q=>"#"+q)),(nn=_t(l))!=null?nn:[]};var es=(i,l,m,w,y,O,J,V,Y)=>{var Oe,Ot,Mn,De,Pe,Be,ft,Dt,We,mt,xt,Ue;let P={cacheType:"file",path:i.path,name:i.name,filename:i.filename};i.stat&&(P.ctime=i.stat.ctime,P.mtime=i.stat.mtime,P.size=i.stat.size,P.extension=i.extension);let an=[],j=jd(O),fn=($,tn,un=new Set)=>{var tt,Ne;let K=[];for(let Zn of tn){let Ge=(Ne=(tt=$.get(Zn))==null?void 0:tt.contexts)!=null?Ne:[];for(let zt of Ge)un.has(zt)||(K.push(zt),un.add(zt),K.push(...fn($,[Rr(zt)],un)))}return K};if(m.has(i.parent))for(let $ of(Oe=m.get(i.parent).contexts)!=null?Oe:[])an.push($);an.push(...j);let Pn=i.name,nn=i.name,q=(Ot=y==null?void 0:y.sticker)!=null?Ot:"",vt=(Mn=y==null?void 0:y.color)!=null?Mn:"",hn=(De=y==null?void 0:y.folder)!=null?De:"";hn=="true"&&(hn="");let Bn=i.parent,pn=i.isFolder,gn={},yn={},W=[],dn=[],_n=O==null?void 0:O.frontmatter;O!=null&&O.links&&dn.push(...O.links.map($=>$.link));let Kn=V&&pn?V.folderNotePath:i.path;for(let $ of Object.keys(J))Kn in J[$]&&W.push($);let Kt="";if(_n){let tn=ko(zo(_n)).reduce((un,K)=>Lt(Rt({},un),{[K]:{name:K,type:Zo(be(_n[K],K))}}),{});Object.keys(tn).forEach(un=>{gn[un]=Lr(un,_n[un]),yn[un]=tn[un].type,tn[un].type.startsWith("link")&&dn.push(Ht(gn[un]))}),Kt=(Pe=gn[l.fmKeyBanner])!=null?Pe:"",gn[l.fmKeySticker]&&(q=_n[l.fmKeySticker]),gn[l.fmKeyColor]&&(vt=_n[l.fmKeyColor]),gn[l.fmKeyAlias]&&(nn=(Be=Ho(_n[l.fmKeyAlias]))==null?void 0:Be[0])}q=(q==null?void 0:q.length)>0?q:$o(P.path,P.extension,!1);let Et=Lt(Rt({},P),{name:Pn,tags:_t(an),alias:nn,fileTags:j,folderNote:V,sticker:q,color:vt,parent:Bn,banner:Kt,isFolder:pn,sortBy:hn,frontmatter:gn,frontmatterTypes:yn,inlinks:W,outlinks:dn}),zn=[],Le={};for(let $ of an)zn.push(Rr($));for(let[$,tn]of m){if(tn.space&&tn.space.folderPath==Bn&&tn.space.defPath!=i.path){zn.push($);continue}if(((Dt=(ft=tn.metadata)==null?void 0:ft.filters)==null?void 0:Dt.length)>0&&jo(tn.metadata.filters,Et)){zn.push($);continue}if(((mt=(We=tn.metadata)==null?void 0:We.links)==null?void 0:mt.length)>0&&((Ue=(xt=tn.metadata)==null?void 0:xt.links)!=null?Ue:[]).find(K=>K==Et.path)){zn.push($);continue}}let Ee=fn(m,zn);zn.push(...Ee.map($=>Rr($))),zn.forEach($=>{var tn,un,K;Le[$]=(K=(un=(tn=w.get($))==null?void 0:tn.tables)==null?void 0:un.files)==null?void 0:K.rows.findIndex(tt=>tt.File==i.path)}),Et.tags.push(...Ee);let nt=V&&!pn?Lt(Rt({},Et),{spaces:[],contexts:[]}):Lt(Rt({},Et),{spaces:_t(zn),spaceRanks:Le}),Yn=!0;return Y&&Pr.default.isEqual(nt,Y)&&(Yn=!1),{changed:Yn,cache:nt}};function rs(i){let{file:l,settings:m,spacesCache:w,vaultItem:y,metadataCache:O,contextsCache:J,resolvedLinks:V,folderNote:Y,oldMetadata:P}=i;return es(l,m,w,J,y,O,V,Y,P)}function is(i){let{space:l,mdb:m,oldCache:w}=i;return ts(l,m,w)}function us(i){let{space:l,mdb:m,oldCache:w}=i;return ns(l,m,w)}var n_=self;n_.onmessage=async i=>{let{payload:l,job:m}=i.data,w;m.type=="file"?w=rs(l):m.type=="context"?w=is(l):m.type=="frames"&&(w=us(l));try{postMessage({job:m,result:w})}catch(y){console.log(y),postMessage({job:m,result:{$error:`Failed to index ${m.type} ${m.path}: ${y}`}})}};\n/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n'); } // src/superstate/workers/manager.ts -var Manager = class extends import_obsidian61.Component { +var Manager = class extends import_obsidian62.Component { constructor(numWorkers, cache) { super(); this.numWorkers = numWorkers; @@ -64586,7 +64729,7 @@ var loadSpaces = (plugin) => { getFolderPathFromString(plugin2, plugin2.settings.spacesFolder) ); const allcontexts = (_b2 = uniq([...Object.keys(plugin2.app.metadataCache.getTags()), ...(_a2 = folder == null ? void 0 : folder.children.filter( - (f4) => f4 instanceof import_obsidian62.TFolder && f4.name.charAt(0) == "#" + (f4) => f4 instanceof import_obsidian63.TFolder && f4.name.charAt(0) == "#" ).map((g4) => g4.name)) != null ? _a2 : []]).map((f4) => spaceFromTag(plugin2, tagPathToTag(f4)))) != null ? _b2 : []; return allcontexts; }; @@ -64595,7 +64738,7 @@ var loadSpaces = (plugin) => { const rootFolder = plugin2.app.vault.getRoot(); function recursiveFx(folder) { for (const child of folder.children) { - if (child instanceof import_obsidian62.TFolder) { + if (child instanceof import_obsidian63.TFolder) { if (!child.path.startsWith(plugin2.settings.spacesFolder + "/#")) { const childFolder = child; folders.push(child); @@ -64608,11 +64751,11 @@ var loadSpaces = (plugin) => { recursiveFx(rootFolder); return folders.map((f4) => spaceFromFolder(plugin2, f4.path)); }; - const allTagSpaces = getAllTagContextFiles(plugin); + const allTagSpaces = plugin.settings.enableTagSpaces && plugin.settings.enableDefaultSpaces ? getAllTagContextFiles(plugin) : []; const allFolders = getAllFolderContextFiles(plugin); return [...allTagSpaces, ...allFolders]; }; -var Superstate = class extends import_obsidian62.Component { +var Superstate = class extends import_obsidian63.Component { constructor(app2, indexVersion, onChange, plugin) { super(); this.app = app2; @@ -64676,8 +64819,9 @@ var Superstate = class extends import_obsidian62.Component { this.contextStoreQueue = this.contextStoreQueue.then(operation).catch(() => { }); } - async migrate08(db) { + async migrate08() { var _a2, _b2, _c2, _d2; + const db = await getDB(this.plugin, await this.plugin.sqlJS(), this.plugin.spacesDBPath); const currentSpaces = (_b2 = (_a2 = selectDB(db, "spaces")) == null ? void 0 : _a2.rows) != null ? _b2 : []; const currentSpaceItems = (_d2 = (_c2 = selectDB(db, "spaceItems")) == null ? void 0 : _c2.rows) != null ? _d2 : []; const oldSpaceDefToSpaceMetadata = (name, oldDef) => { @@ -64724,9 +64868,9 @@ var Superstate = class extends import_obsidian62.Component { } }); const spaceFolder = getAbstractFileAtPath(this.plugin, "Context"); - if (spaceFolder instanceof import_obsidian62.TFolder) { + if (spaceFolder instanceof import_obsidian63.TFolder) { promises.push(...spaceFolder.children.map((f4) => { - if (f4 instanceof import_obsidian62.TFile && f4.extension == "mdb") { + if (f4 instanceof import_obsidian63.TFile && f4.extension == "mdb") { const folderPath = `${this.plugin.settings.spacesFolder}/${f4.basename}/.space`; return this.plugin.app.vault.adapter.exists(folderPath).then((g4) => { if (!g4) @@ -64741,7 +64885,7 @@ var Superstate = class extends import_obsidian62.Component { function recursiveFx(folder) { for (const child of folder.children) { if (!folder.path.startsWith(plugin.settings.spacesFolder)) { - if (child instanceof import_obsidian62.TFolder) { + if (child instanceof import_obsidian63.TFolder) { const childFolder = child; folders.push(child); if (childFolder.children) @@ -64755,39 +64899,37 @@ var Superstate = class extends import_obsidian62.Component { }; promises.push(...getAllFolders(this.plugin).map((f4) => { const folderPath = f4.path == "/" ? ".space" : `${f4.path}/.space`; - return this.plugin.app.vault.adapter.exists(folderPath).then((f5) => { - if (!f5) - return this.plugin.app.vault.createFolder(folderPath); - }).then((g4) => this.plugin.app.vault.rename(getAbstractFileAtPath(this.plugin, f4.path == "/" ? "context.mdb" : `${f4.path}/context.mdb`), folderPath + "/context.mdb")); + return this.plugin.files.createFolder(folderPath).then((g4) => this.plugin.app.vault.rename(getAbstractFileAtPath(this.plugin, f4.path == "/" ? "context.mdb" : `${f4.path}/context.mdb`), folderPath + "/context.mdb")); })); await Promise.all(promises); await insertSpaceAtIndex(this.plugin, this.plugin.settings.spacesFolder + "/Home", { links: homeSpaces, sticker: "lucide//home" }); - this.plugin.settings.waypoints = [this.plugin.settings.spacesFolder + "/Home", "/", "spaces://$tags", ...pinnedSpaces]; + this.plugin.settings.waypoints = uniq([this.plugin.settings.spacesFolder + "/Home", "/", "spaces://$tags", ...pinnedSpaces]); this.plugin.settings.activeView = "/"; - this.plugin.settings.autoMigration08 = true; this.plugin.saveSettings(); - return; + db.close(); } async loadSpacesDatabaseFromDisk() { var _a2, _b2; const db = await getDB(this.plugin, await this.plugin.sqlJS(), this.plugin.spacesDBPath); - const tables = dbResultsToDBTables( - db.exec( - "SELECT name FROM sqlite_schema WHERE type ='table' AND name NOT LIKE 'sqlite_%';" - ) - ); + let tables; + try { + tables = dbResultsToDBTables( + db.exec( + "SELECT name FROM sqlite_schema WHERE type ='table' AND name NOT LIKE 'sqlite_%';" + ) + ); + } catch (e4) { + console.log(e4); + tables = []; + } if (tables.length == 0) { initiateDB(db); await saveDBToPath(this.plugin, this.plugin.spacesDBPath, { vault: vaultSchema }); - } else { - if (!this.plugin.settings.autoMigration08) { - await this.migrate08(db); - } } this.vaultDBCache = (_b2 = (_a2 = selectDB(db, "vault")) == null ? void 0 : _a2.rows) != null ? _b2 : []; db.close(); @@ -64795,7 +64937,7 @@ var Superstate = class extends import_obsidian62.Component { rebuildIndex(this.plugin, true); } async saveSpacesDatabaseToDisk(tables, save = true) { - if (await this.plugin.app.vault.adapter.exists((0, import_obsidian62.normalizePath)(this.plugin.spacesDBPath)) && !this.spacesDBLoaded) { + if (await this.plugin.app.vault.adapter.exists((0, import_obsidian63.normalizePath)(this.plugin.spacesDBPath)) && !this.spacesDBLoaded) { return; } this.spacesDBLoaded = true; @@ -64817,7 +64959,12 @@ var Superstate = class extends import_obsidian62.Component { } async initializeSpaces() { this.spacesIndex = /* @__PURE__ */ new Map(); - this.spacesIndex.set(tagsSpace.path, tagsSpace); + if (this.plugin.settings.enableDefaultSpaces) { + if (this.plugin.settings.enableTagSpaces) { + this.spacesIndex.set(tagsSpace.path, tagsSpace); + } + } + this.spacesIndex.set(waypointsSpace.path, waypointsSpace); const promises = loadSpaces(this.plugin).map((f4) => this.reloadSpace(f4, null, true)); await Promise.all(promises); } @@ -64879,7 +65026,7 @@ var Superstate = class extends import_obsidian62.Component { async loadFromCache() { const allFiles = getAllAbstractFilesInVault(this.plugin); if (this.plugin.settings.indexSVG) { - const cacheIcons = allFiles.filter((f4) => f4 instanceof import_obsidian62.TFile && f4.extension == "svg").map((s5) => this.persister.load(s5.path, "icon").then((string) => { + const cacheIcons = allFiles.filter((f4) => f4 instanceof import_obsidian63.TFile && f4.extension == "svg").map((s5) => this.persister.load(s5.path, "icon").then((string) => { if ((string == null ? void 0 : string.length) > 0) this.iconsCache.set(s5.path, string); })); @@ -64917,7 +65064,7 @@ var Superstate = class extends import_obsidian62.Component { this.broadcast("vault"); } async renameTag(tag, newTag) { - await renameSpaceFolder(this.plugin, tag, newTag); + await renameTagSpaceFolder(this.plugin, tag, newTag); const oldPath = spacePathFromName(tag); const newSpaceInfo = spaceFromTag(this.plugin, newTag); await this.spaceRenamed(oldPath, newSpaceInfo); @@ -64954,13 +65101,16 @@ var Superstate = class extends import_obsidian62.Component { this.fileReloaded(file.path); this.broadcast("file", "change", file.path); } - deleteTag(tag) { + async deleteTag(tag) { this.tagsMap.getInverse(tag).forEach((file) => { const tFile = getAbstractFileAtPath(this.plugin, file); if (tFile) this.deleteTagInFile(tag, tFile); }); - deleteSpaceFolder(this.plugin, tag); + const spacePath = folderForTagSpace(tag, this.plugin); + if (getAbstractFileAtPath(this.plugin, spacePath)) { + await deleteFile(this.plugin, getAbstractFileAtPath(this.plugin, spacePath)); + } this.plugin.index.deleteSpace(tagSpacePathFromTag(tag)); for (const [contextPath, spaceCache] of this.spacesIndex) { if (spaceCache.metadata.contexts.includes(tag)) { @@ -65101,7 +65251,7 @@ var Superstate = class extends import_obsidian62.Component { } async createFile(path) { const file = getAbstractFileAtPath(this.plugin, path); - if (file instanceof import_obsidian62.TFolder) { + if (file instanceof import_obsidian63.TFolder) { await this.reloadSpace(spaceFromFolder(this.plugin, path)); } await this.reloadFile(file); @@ -65112,17 +65262,8 @@ var Superstate = class extends import_obsidian62.Component { this.addToContextStoreQueue(() => updateContextValue(this.plugin, context, row, field, value).then((f4) => this.reloadContext(context))); } deleteFile(path) { - var _a2; const fileCache = this.filesIndex.get(path); if (!fileCache) { - if (path.startsWith(this.plugin.settings.spacesFolder)) { - for (const [contextPath, spaceCache] of this.spacesIndex) { - if (((_a2 = spaceCache.space) == null ? void 0 : _a2.folderPath) == path) { - this.deleteSpace(spaceCache.path); - break; - } - } - } return; } if (fileCache.isFolder) { @@ -65396,7 +65537,10 @@ var Superstate = class extends import_obsidian62.Component { } }; -// src/components/InlineFileContext/FileHeaderContextView.tsx +// src/utils/contexts/markdownPost.tsx +var import_obsidian64 = require("obsidian"); + +// src/react/components/MarkdownEditor/FileHeaderContextView.tsx var FileHeaderContextView = (props2) => { var _a2; const { name, fm } = props2; @@ -65473,7 +65617,7 @@ var FileHeaderContextView = (props2) => { })))))))) : /* @__PURE__ */ Cn.createElement(Cn.Fragment, null)); }; -// src/components/InlineFileContext/ReadingModeHeader.tsx +// src/react/components/MarkdownEditor/ReadingModeHeader.tsx var ReadingModeHeader = (props2) => { const [path, setPath] = h2(props2.filePath); const ref2 = _2(null); @@ -65503,7 +65647,6 @@ var ReadingModeHeader = (props2) => { }; // src/utils/contexts/markdownPost.tsx -var import_obsidian63 = require("obsidian"); var replaceInlineContext = (plugin, el, ctx) => { replaceMarkdownForReadingMode(el, async (dom) => { let element = dom.querySelector(".mod-header"); @@ -65521,7 +65664,7 @@ var replaceInlineContext = (plugin, el, ctx) => { element.setAttribute("data-path", ctx.sourcePath); element.toggleClass("mk-inline-context", true); const reactEl = createRoot(element); - ctx.addChild(new import_obsidian63.MarkdownRenderChild(element)); + ctx.addChild(new import_obsidian64.MarkdownRenderChild(element)); if (ctx.sourcePath.match(urlRegex)) { reactEl.render( /* @__PURE__ */ Cn.createElement(FileHeaderContextView, { @@ -65562,7 +65705,7 @@ var loadSQL = async () => { }; // src/middleware/filesystem.ts -var import_obsidian64 = require("obsidian"); +var import_obsidian65 = require("obsidian"); var FilesystemMiddleware = class { constructor(type, plugin) { this.type = type; @@ -65592,7 +65735,7 @@ var FilesystemMiddleware = class { if (type == "md") { const parentFolder = getAbstractFileAtPath(this.plugin, parent); return this.plugin.app.fileManager.createNewMarkdownFile( - parentFolder instanceof import_obsidian64.TFolder ? parentFolder : parentFolder.parent, + parentFolder instanceof import_obsidian65.TFolder ? parentFolder : parentFolder.parent, name ); } else if (type == "canvas") { @@ -65605,11 +65748,22 @@ var FilesystemMiddleware = class { } } } - fileExists() { + async createFolder(path) { + if (this.type == 0 /* Obsidian */) { + if (!await this.fileExists(path)) { + return await this.plugin.app.vault.createFolder(path); + } else { + return this.getFile(path); + } + } + return null; + } + async fileExists(path) { if (this.type == 0 /* Obsidian */) { + return this.plugin.app.vault.adapter.exists(path); } } - getFile() { + getFile(path) { if (this.type == 0 /* Obsidian */) { } } @@ -65620,7 +65774,7 @@ var FilesystemMiddleware = class { }; // src/middleware/metadata.ts -var import_obsidian65 = require("obsidian"); +var import_obsidian66 = require("obsidian"); var MetadataMiddleware = class { constructor(type, plugin) { this.type = type; @@ -65638,7 +65792,7 @@ var MetadataMiddleware = class { async processFrontMatter(path, fn2) { if (this.type == 0 /* Obsidian */) { const afile = getAbstractFileAtPath(this.plugin, path); - if (afile && afile instanceof import_obsidian65.TFile) { + if (afile && afile instanceof import_obsidian66.TFile) { if (this.plugin.app.fileManager.processFrontMatter) { return this.plugin.app.fileManager.processFrontMatter(afile, fn2); } @@ -65685,10 +65839,10 @@ function around1(obj, method, createWrapper) { } // src/utils/spaces/patches.ts -var import_obsidian66 = require("obsidian"); +var import_obsidian67 = require("obsidian"); var patchFilesPlugin = (plugin) => { plugin.register( - around(import_obsidian66.Workspace.prototype, { + around(import_obsidian67.Workspace.prototype, { getLeavesOfType(old) { return function(type) { if (type == "file-explorer") { @@ -65702,7 +65856,7 @@ var patchFilesPlugin = (plugin) => { }; var patchWorkspace = (plugin) => { let layoutChanging = false; - const uninstaller = around(import_obsidian66.Workspace.prototype, { + const uninstaller = around(import_obsidian67.Workspace.prototype, { changeLayout(old) { return async function(workspace) { layoutChanging = true; @@ -65723,7 +65877,7 @@ var patchWorkspace = (plugin) => { return false; if (layoutChanging) return false; - if (parent === plugin.app.workspace.rootSplit || import_obsidian66.WorkspaceContainer && parent instanceof import_obsidian66.WorkspaceContainer) { + if (parent === plugin.app.workspace.rootSplit || import_obsidian67.WorkspaceContainer && parent instanceof import_obsidian67.WorkspaceContainer) { for (const popover of FlowEditor.popoversForWindow( parent.win )) { @@ -65775,7 +65929,7 @@ var patchWorkspace = (plugin) => { plugin.register(uninstaller); }; -// src/components/FileContextView/Backlinks.tsx +// src/react/components/MarkdownEditor/Backlinks.tsx var BacklinkItem = (props2) => { const file = F2( () => getAbstractFileAtPath(props2.plugin, props2.path), @@ -65946,7 +66100,7 @@ var modifyFlowDom = (plugin) => { // src/main.ts var makeMDVersion = 0.804; -var MakeMDPlugin = class extends import_obsidian67.Plugin { +var MakeMDPlugin = class extends import_obsidian68.Plugin { constructor() { super(...arguments); this.dataViewAPI = () => (0, import_obsidian_dataview.getAPI)(); @@ -65958,20 +66112,20 @@ var MakeMDPlugin = class extends import_obsidian67.Plugin { this.onCreate = async (file) => { if (!file) return; - this.index.addToVaultQueue(() => onFileCreated(this, file.path, file instanceof import_obsidian67.TFolder)); + this.index.addToVaultQueue(() => onFileCreated(this, file.path, file instanceof import_obsidian68.TFolder)); }; this.onDelete = async (file) => { - if (file instanceof import_obsidian67.TFile && file.extension != "mdb") { + if (file instanceof import_obsidian68.TFile && file.extension != "mdb") { this.index.addToVaultQueue(() => onFileDeleted(this, file.path)); - } else if (file instanceof import_obsidian67.TFolder) { + } else if (file instanceof import_obsidian68.TFolder) { this.index.addToVaultQueue(() => onFolderDeleted(this, file.path)); } this.activeFileChange(); }; this.onRename = async (file, oldPath) => { - if (file instanceof import_obsidian67.TFile && file.extension != "mdb") { + if (file instanceof import_obsidian68.TFile && file.extension != "mdb") { this.index.addToVaultQueue(() => onFileChanged(this, oldPath, file.path)); - } else if (file instanceof import_obsidian67.TFolder) { + } else if (file instanceof import_obsidian68.TFolder) { this.index.addToVaultQueue(() => onFolderChanged(this, oldPath, file.path)); } this.activeFileChange(); @@ -66118,7 +66272,7 @@ var MakeMDPlugin = class extends import_obsidian67.Plugin { "dataview:metadata-change", (type, file, oldPath) => { if (type === "update" && this.app.metadataCache.fileCache[file.path].mtime >= this.loadTime && this.dataViewAPI().index.revision !== this.dataViewLastIndex && this.dataViewReady) { - if (file instanceof import_obsidian67.TFile) { + if (file instanceof import_obsidian68.TFile) { this.metadataChange(file); } this.dataViewLastIndex = this.dataViewAPI().index.revision; @@ -66154,18 +66308,18 @@ var MakeMDPlugin = class extends import_obsidian67.Plugin { convertFolderNote() { const activeLeaf = this.app.workspace.activeLeaf; if ((activeLeaf == null ? void 0 : activeLeaf.view.getViewType()) == "markdown") { - const view = this.app.workspace.getActiveViewOfType(import_obsidian67.MarkdownView); - if (view instanceof import_obsidian67.MarkdownView && view.file instanceof import_obsidian67.TFile) { + const view = this.app.workspace.getActiveViewOfType(import_obsidian68.MarkdownView); + if (view instanceof import_obsidian68.MarkdownView && view.file instanceof import_obsidian68.TFile) { noteToFolderNote(this, view.file, true); } } else { - new import_obsidian67.Notice("The view is not a note"); + new import_obsidian68.Notice("The view is not a note"); } } getActiveFile() { var _a2, _b2, _c2; let filePath = null; - let leaf = (_a2 = this.app.workspace.getActiveViewOfType(import_obsidian67.MarkdownView)) == null ? void 0 : _a2.leaf; + let leaf = (_a2 = this.app.workspace.getActiveViewOfType(import_obsidian68.MarkdownView)) == null ? void 0 : _a2.leaf; if (!leaf) { leaf = (_b2 = this.app.workspace.getActiveViewOfType(SpaceView)) == null ? void 0 : _b2.leaf; } @@ -66222,9 +66376,9 @@ var MakeMDPlugin = class extends import_obsidian67.Plugin { } }); this.addCommand({ - id: "mk-spaces-reload", + id: "mk-spaces-migrate", name: i18n_default.commandPalette.reloadSpaces, - callback: () => this.index.loadSpacesDatabaseFromDisk() + callback: () => this.index.migrate08() }); this.addCommand({ id: "mk-spaces", @@ -66297,11 +66451,11 @@ var MakeMDPlugin = class extends import_obsidian67.Plugin { return new FrameEditorView(leaf, this, FRAME_EDITOR_TYPE); }); this.app.workspace.onLayoutReady(async () => { - if (!getAbstractFileAtPath( - this, - getFolderPathFromString(this, this.settings.spacesFolder) - )) { - this.app.vault.createFolder(this.settings.spacesFolder); + if (this.settings.enableDefaultSpaces) { + await this.files.createFolder(getFolderPathFromString(this, this.settings.spacesFolder)); + if (this.settings.enableHomeSpace) { + await this.files.createFolder(this.settings.spacesFolder + "/Home"); + } } }); this.registerView(FILE_CONTEXT_VIEW_TYPE, (leaf) => { @@ -66385,14 +66539,14 @@ var MakeMDPlugin = class extends import_obsidian67.Plugin { this.loadTime = Date.now(); this.metadata = MetadataMiddleware.create(this, 0 /* Obsidian */); this.files = FilesystemMiddleware.create(this, 0 /* Obsidian */); - (0, import_obsidian67.addIcon)("mk-logo", mkLogo); + (0, import_obsidian68.addIcon)("mk-logo", mkLogo); await this.loadSettings(); this.index = this.addChild( Superstate.create(this.app, "0.9", () => { this.debouncedRefresh(); }, this) ); - this.spacesDBPath = (0, import_obsidian67.normalizePath)( + this.spacesDBPath = (0, import_obsidian68.normalizePath)( this.app.vault.configDir + "/plugins/make-md/Spaces.mdb" ); this.loadSuperState(); diff --git a/manifest.json b/manifest.json index 94a23f6..31f033a 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "make-md", "name": "MAKE.md", - "version": "0.8.4", + "version": "0.8.5", "minAppVersion": "0.16.0", "description": "Make.md brings you features that supercharges Obsidian. Sort your files in custom order and add file icons using Spaces. Edit inline embeds with Flow Editor. And style your text and add new markdown blocks without writing markdown using Maker Mode.", "author": "MAKE.md", diff --git a/styles.css b/styles.css index ac38aff..4d79a42 100644 --- a/styles.css +++ b/styles.css @@ -1,3 +1,246 @@ +/* src/css/SpaceView.css */ +.mk-space-scroller { + display: flex !important; + flex-direction: column; + align-items: flex-start !important; + line-height: 1.4; + height: 100%; + overflow-x: auto; + position: relative; + z-index: 0; + padding-bottom: 0; +} +.mk-context-selector { + font-size: var(--font-ui-small); + --tag-background: var(--background-secondary); + position: relative; + display: flex; +} +.mk-context-selector-menu { +} +.mk-context-header { + margin: var(--file-margins); + margin-bottom: 0; +} +.mk-title-container { + display: flex; + align-items: center; + gap: 4px; +} +.mk-title-container .mk-title-prefix { + display: flex; + font-size: var(--inline-title-size); + font-weight: var(--inline-title-weight); +} +.mk-title-container span { + flex: 1; +} +.mk-context-header { + display: flex; + flex-direction: column; + max-width: var(--file-line-width); + width: 100%; +} +.markdown-source-view.mod-cm6.is-readable-line-width .mk-space-outer { + padding: var(--file-margins); + max-width: 100%; + width: 100%; + margin-left: auto; + margin-right: auto; +} +.mk-space-title { + position: relative; +} +.mk-space-header { + margin-left: auto; + margin-right: auto; + margin-bottom: 16px; + width: 100%; + max-width: var(--file-line-width); +} +body:not(.is-mobile) .markdown-source-view.mod-cm6.is-readable-line-width .mk-space-header .inline-title { + flex-grow: 1; + margin-bottom: 0; + margin-left: 0 !important; + margin-right: 0; + width: inherit; + max-width: inherit; +} +.mk-space-sizer { + display: flex; + flex-direction: column; + align-items: stretch; + margin-left: auto; + margin-right: auto; +} +.mk-file-table-header { + margin-top: 24px; + color: var(--text-faint); +} +.mk-file-table { + border-collapse: collapse; + table-layout: fixed; + width: 100%; +} +.mk-space-body { + padding-bottom: 100px; +} +.mk-space-body > .mk-f { + max-width: var(--file-line-width); + margin: 0 auto; +} +.mk-f-main > div { + max-width: var(--file-line-width); + margin: 0 auto; + padding-bottom: 8px; +} +.mk-space-body .cm-content { + padding-bottom: 0px !important; +} +.mk-space-body > .mk-frame { + align-items: flex-start; + display: flex; + flex-direction: column; + gap: 8px; +} +.mk-file-row { +} +.mk-file-row:hover { + background: var(--background-modifier-hover) !important; +} +.mk-file-table tr:nth-child(even) { + background: var(--color-base-10); +} +.mk-file-row td { + padding: 10px 10px; +} +.mk-file-row .mk-column-file { + width: 99%; +} +.mk-file-row p { + text-overflow: ellipsis; + overflow: hidden; + font-size: var(--font-ui-smaller); + color: var(--text-faint); + margin: 0; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + display: -webkit-box; +} +.mk-file-row .mk-file-name { + font-weight: var(--font-medium); +} +.mk-file-date { + font-size: var(--font-ui-smaller); + color: var(--text-muted); + width: 100px; +} +.mk-column-icon { + width: 40px; +} +.mk-column-icon svg { + width: 16px; + height: 16px; + color: var(--text-muted); +} +.mk-flowspace-title svg { + width: 16px; + height: 16px; + color: var(--text-muted); +} +.mk-flowspace-title p { + margin: 0; + padding: 0; + margin-left: 8px; +} +.mk-flowspace-title .mk-flowspace-date { + font-size: var(--font-ui-smaller); + color: var(--text-muted); +} +.mk-flowspace-title { + display: flex; + align-items: center; + padding: 8px 12px; + border-top: 1px solid var(--divider-color); +} +.mk-flowspace-editor { + padding: 0px 12px; + width: 100%; +} +.mk-flowspace-editor:not(.mk-flow-node, .mk-file-context-flow) .mk-floweditor { + padding: 12px 0px; +} +.mk-frame-view .mk-flowspace-editor:not(.mk-flow-node, .mk-file-context-flow) .mk-floweditor { + padding: 0; +} +.mk-flowspace-editor.mk-foldernote { + width: var(--file-line-width); + max-width: 100%; + margin-left: auto; + margin-right: auto; +} +.mk-foldernote .mk-floweditor { + height: 100% !important; +} +.mk-flowspace-title span { + flex-grow: 1; +} +.mk-flowspace-title button { + padding: 8px; + margin-left: 8px; + width: unset; +} +.mk-flowspace-title button.mk-open { + background: var(--icon-color-active); +} +.mk-flowspace-title:hover { + background: var(--color-base-10); +} +.mk-space-empty { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + font-size: var(--font-ui-small); + font-style: italic; +} +.mk-flow-container { + width: 100%; +} +.mk-flow-container > div { + border-bottom: thin dotted var(--divider-color); +} +.mk-flow-container > div > span { + font-size: var(--font-smallest); + padding: var(--size-4-1) var(--context-padding); + color: var(--text-faint); +} +.mk-space-scroller .mk-flowspace-editor { + padding: 0; +} +.mk-space-scroller .cm-sizer { +} +.mk-smart-note-view { + display: flex; +} +.mk-smart-note-view div { + padding: 4px; +} +.mk-context-type-selector { + max-width: 100%; + width: 100%; + padding-top: 4px; + margin-left: auto; + margin-right: auto; +} +.mk-context-type-selector button { + background: rgba(var(--nav-item-background-active), 0.3); + border: none; + box-shadow: none; + color: var(--text-faint); +} + /* src/css/Menu.css */ .mk-suggestion { display: flex; @@ -537,313 +780,451 @@ border: none; } -/* src/css/FrameProps.css */ -body:not(.is-mobile) .mk-frame-props-editor { -} -.mk-frame-props-editor { +/* src/css/FilterBar.css */ +.mk-view-selector { + margin-right: 0; display: flex; - position: absolute; - top: -40px; - padding: 0; - z-index: var(--layer-popover); - background: var(--background-primary); - max-height: unset; + align-items: center; + gap: 16px; + min-height: 48px; + max-width: 100%; + overflow-x: auto; + font-size: var(--font-ui-medium); } -.is-mobile .mk-frame-props-editor svg { - width: 32px; - height: 32px; +.mk-view-selector-spacer { + min-width: var(--context-padding); + width: var(--file-margins); } -.is-mobile .mk-frame-props-editor { - --mobile-toolbar-height: 48px; - border-radius: 0; - width: 100%; - margin-top: 0; - overflow-x: auto; - justify-content: center; - height: var(--mobile-toolbar-height); - border-top: var(--divider-width) solid var(--divider-color); +.mk-table-selector, +.mk-frame-selector { + display: flex; + flex-direction: column; } -.mk-frame-props-editor .mk-mark { - margin: 4px; - padding: 4px; - border-radius: 4px; +.mk-view-selector::-webkit-scrollbar { + display: none; +} +.mk-view-selector > div > .mk-collapse { + padding-right: 8px; + padding-left: 0px; +} +.mk-view-selector .mk-collapse.mk-icon-xsmall svg { + color: unset; +} +.mk-view-selector > div > button:not(:last-child) { + padding-right: 0px; +} +.mk-view-selector > div, +.mk-view-selector > button { + border-radius: 0; + margin: 4px -8px; display: flex; - font-size: var(--font-ui-small); align-items: center; - gap: 4px; + border-bottom: thin solid transparent; + height: 100%; } -.mk-frame-props-editor .mk-mark:hover { - background: var(--background-modifier-hover); +.mk-view-config .mk-is-active button { + color: var(--text-normal); } -.mk-frame-props-editor .mk-mark-active { - background: var(--background-modifier-hover); +.mk-view-config .mk-is-active { + color: var(--text-normal); + background: none !important; } -.mk-frame-props-editor svg { - color: var(--text-muted); - width: 16px; - height: 16px; +.mk-table-selector button, +.mk-view-config button { + font-size: max(var(--font-ui-small), 1em); + font-weight: var(--font-medium); + background: rgba(var(--nav-item-background-active), 0.3); + border: none; + box-shadow: none; + color: var(--text-faint); } -.mk-divider { - border-left: thin solid var(--background-modifier-hover); - width: 1px; +body:not(.is-mobile) .mk-view-config .mk-view-options, +body:not(.is-mobile) .mk-view-config .mk-view-selector > *:not(.mk-is-active) { + opacity: 0; } -mark { - color: unset; - border-radius: 2px; - margin: 0px 2px; - padding: 0px 2px; +body:not(.is-mobile) .mk-view-config:hover .mk-view-options, +body:not(.is-mobile) .mk-view-config:hover .mk-view-selector > *:not(.mk-is-active) { + opacity: 1; } - -/* src/css/SpaceView.css */ -.mk-space-scroller { - display: flex !important; - flex-direction: column; - align-items: flex-start !important; - line-height: 1.4; - height: 100%; - overflow-x: auto; - position: relative; - z-index: 0; - padding-bottom: 0; +.mk-view-config button:hover { + color: var(--text-normal); } -.mk-context-selector { - font-size: var(--font-ui-small); - --tag-background: var(--background-secondary); - position: relative; +.mk-view-config { + width: 100%; display: flex; + color: var(--text-faint); + align-items: center; + border-bottom: thin solid var(--divider-color); + flex-wrap: wrap; } -.mk-context-selector-menu { +.mk-view-config input { + background: none; + border: none; + flex-grow: 1; } -.mk-context-header { - margin: var(--file-margins); - margin-bottom: 0; +.is-phone .mk-view-config { + flex-wrap: wrap; } -.mk-title-container { +.is-phone .mk-view-config button { + width: unset; +} +.mk-view-search { + background: var(--background-modifier-form-field); + border: var(--input-border-width) solid var(--background-modifier-border); display: flex; + border-radius: 8px; align-items: center; - gap: 4px; + flex-grow: 1; } -.mk-title-container .mk-title-prefix { - display: flex; - font-size: var(--inline-title-size); - font-weight: var(--inline-title-weight); +.mk-view-search button:hover { + background: unset !important; } -.mk-title-container span { - flex: 1; +.mk-view-search button { + margin: 0 !important; + padding: var(--size-4-1) var(--size-4-2) !important; } -.mk-context-header { +.is-phone .mk-view-options { + margin-top: 8px; + margin-bottom: 8px; +} +.mk-view-options { display: flex; - flex-direction: column; - max-width: var(--file-line-width); - width: 100%; + align-items: center; + color: var(--text-normal) !important; + min-height: 48px; + padding-left: var(--context-padding); } -.markdown-source-view.mod-cm6.is-readable-line-width .mk-space-outer { - padding: var(--file-margins); - max-width: 100%; - width: 100%; - margin-left: auto; - margin-right: auto; +.mk-view-config span { + flex-grow: 10; } -.mk-space-title { - position: relative; +.mk-view-config svg { + width: 14px; + height: 14px; } -.mk-space-header { - margin-left: auto; - margin-right: auto; - margin-bottom: 16px; +.mk-filter-bar { + display: flex; + padding: 8px 4px; + gap: 8px; width: 100%; - max-width: var(--file-line-width); + border-bottom: 1px solid var(--divider-color); } -body:not(.is-mobile) .markdown-source-view.mod-cm6.is-readable-line-width .mk-space-header .inline-title { +.mk-filter-bar span { flex-grow: 1; - margin-bottom: 0; - margin-left: 0 !important; - margin-right: 0; - width: inherit; - max-width: inherit; } -.mk-space-sizer { - display: flex; - flex-direction: column; - align-items: stretch; - margin-left: auto; - margin-right: auto; +.mk-view-config .mk-is-active, +.mk-table-selector .mk-is-active { + color: var(--text-normal) !important; } -.mk-file-table-header { - margin-top: 24px; - color: var(--text-faint); +.mk-filter { + display: flex; + font-size: var(--font-ui-smaller); + color: var(--text-muted); + padding: 0px; } -.mk-file-table { - border-collapse: collapse; - table-layout: fixed; - width: 100%; +.mk-query .mk-filter > span { + background: var(--background-primary); } -.mk-space-body { - padding-bottom: 100px; +.mk-filter > span, +.mk-filter > div { + background: var(--interactive-normal); } -.mk-space-body > .mk-f { - max-width: var(--file-line-width); - margin: 0 auto; +.mk-filter > span:hover, +.mk-filter > div:hover { + background: var(--interactive-hover); } -.mk-f-main > div { - max-width: var(--file-line-width); - margin: 0 auto; - padding-bottom: 8px; +.mk-filter > *:first-child { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + padding-left: 10px; } -.mk-space-body .cm-content { - padding-bottom: 0px !important; +.mk-filter > *:last-child { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + padding-right: 6px; } -.mk-space-body > .mk-frame { - align-items: flex-start; +.mk-filter > span { + border-right: thin solid var(--background-primary); + padding: 4px 8px; display: flex; - flex-direction: column; - gap: 8px; + align-items: center; } -.mk-file-row { +.mk-filter div { + display: flex; + align-items: center; } -.mk-file-row:hover { - background: var(--background-modifier-hover) !important; +.mk-filter div svg { + width: 14px; + height: 14px; } -.mk-file-table tr:nth-child(even) { - background: var(--color-base-10); +.mk-query { + display: flex; + flex-direction: column; + gap: 16px; + padding: 8px; + border-radius: 6px; } -.mk-file-row td { - padding: 10px 10px; +.mk-query-filters { + flex-wrap: wrap; + padding: 0; + border-bottom: none; } -.mk-file-row .mk-column-file { - width: 99%; +.mk-query-filter, +.mk-query-group-type { + display: flex; } -.mk-file-row p { - text-overflow: ellipsis; - overflow: hidden; - font-size: var(--font-ui-smaller); - color: var(--text-faint); - margin: 0; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - display: -webkit-box; +.mk-query-group { + display: flex; } -.mk-file-row .mk-file-name { - font-weight: var(--font-medium); +.mk-query-group-type { + width: 32px; + padding-bottom: 4px; } -.mk-file-date { - font-size: var(--font-ui-smaller); - color: var(--text-muted); - width: 100px; +.mk-query-group button { + background-color: unset; + box-shadow: none; + width: unset; } -.mk-column-icon { - width: 40px; +.is-phone .mk-query-group button { + background-color: var(--interative-normal); } -.mk-column-icon svg { - width: 16px; - height: 16px; - color: var(--text-muted); +.mk-query-group-type > span, +.mk-query-filter > span { + display: flex; + flex-grow: 1; } -.mk-flowspace-title svg { - width: 16px; - height: 16px; +.mk-filter-add { + border: thin solid var(--divider-color) !important; + border-radius: 4px; + box-shadow: none !important; + background: none !important; + display: flex; + align-items: center; + padding: 4px; + font-size: var(--font-ui-small); color: var(--text-muted); + gap: 4px; } -.mk-flowspace-title p { - margin: 0; - padding: 0; - margin-left: 8px; +.mk-filter-add div { + display: flex; } -.mk-flowspace-title .mk-flowspace-date { +.mk-search-bar { +} +.mk-tag-selector { + display: flex; + gap: 4px; + margin-top: 8px; + margin-bottom: 8px; + flex-wrap: wrap; +} +.mk-tag-selector svg { + color: var(--tag-color) !important; +} +.mk-tag-selector div { + cursor: var(--cursor-link); font-size: var(--font-ui-smaller); - color: var(--text-muted); + display: flex; } -.mk-flowspace-title { +.mk-tag-selector span { display: flex; align-items: center; - padding: 8px 12px; - border-top: 1px solid var(--divider-color); -} -.mk-flowspace-editor { - padding: 0px 12px; - width: 100%; } -.mk-flowspace-editor:not(.mk-flow-node, .mk-file-context-flow) .mk-floweditor { - padding: 12px 0px; +.mk-tag-selector button { + height: auto; + border-radius: var(--tag-radius); + color: var(--tag-color); + background-color: var(--tag-background); + border: var(--tag-border-width) solid var(--tag-border-color); + box-shadow: none !important; + font-size: var(--tag-size); + vertical-align: baseline; + border-left: none; + border-right: none; + padding-top: var(--tag-padding-y) !important; + padding-bottom: var(--tag-padding-y) !important; } -.mk-frame-view .mk-flowspace-editor:not(.mk-flow-node, .mk-file-context-flow) .mk-floweditor { - padding: 0; + +/* src/css/ContextBuilder.css */ +.is-phone .mk-context-maker { + max-height: 100vh; } -.mk-flowspace-editor.mk-foldernote { - width: var(--file-line-width); - max-width: 100%; - margin-left: auto; - margin-right: auto; +.mk-context-maker-container { + height: 100%; + display: flex; + flex-direction: column; } -.mk-foldernote .mk-floweditor { - height: 100% !important; +.mk-context-maker .modal-content { + height: var(--dialog-max-height); + overflow-y: scroll; } -.mk-flowspace-title span { +.mk-context-maker-preview { + display: flex; + flex-wrap: wrap; + gap: 4px; + margin-bottom: 16px; + padding: var(--size-4-4); flex-grow: 1; + overflow: scroll; + padding-bottom: 0; } -.mk-flowspace-title button { +.mk-context-maker-item { + background: rgba(var(--mono-rgb-100), 0.025); + border-radius: 4px; + overflow: hidden; + display: flex; + align-items: center; + gap: 2px; padding: 8px; - margin-left: 8px; - width: unset; } -.mk-flowspace-title button.mk-open { - background: var(--icon-color-active); +.mk-context-maker-selector { + font-size: var(--font-ui-small); + height: 240px; + overflow-y: scroll; + background: rgba(var(--mono-rgb-100), 0.025); + padding: var(--size-4-4); + border-radius: 4px; } -.mk-flowspace-title:hover { - background: var(--color-base-10); +.mk-context-maker-selector .mk-cell-option { + margin-bottom: 8px; } -.mk-space-empty { - width: 100%; - height: 100%; +.mk-context-maker-builder { + min-height: 60px; display: flex; - align-items: center; - justify-content: center; - font-size: var(--font-ui-small); - font-style: italic; + flex-wrap: wrap; + padding: 8px; + gap: 4px; } -.mk-flow-container { - width: 100%; +.mk-property-editor-context-title { + display: flex; + font-size: var(--font-ui-small); + font-weight: var(--font-normal); + padding: var(--size-4-2) var(--size-4-1); } -.mk-flow-container > div { - border-bottom: thin dotted var(--divider-color); +.mk-property-editor-context-title span { + flex: 1; } -.mk-flow-container > div > span { - font-size: var(--font-smallest); - padding: var(--size-4-1) var(--context-padding); - color: var(--text-faint); +.mk-property-editor-context-tag { + display: flex; + gap: 4px; + align-items: center; } -.mk-space-scroller .mk-flowspace-editor { +.mk-property-editor { padding: 0; + display: flex; + flex-direction: column; + height: 100%; + gap: 8px; } -.mk-space-scroller .cm-sizer { +.mk-property-editor-property { + display: flex; + padding: 8px; + font-size: var(--font-ui-small); + color: var(--text-muted); + gap: 6px; + align-items: center; + background: var(--background-modifier-cover); + border-radius: 6px; } -.mk-smart-note-view { +.mk-property-editor-new:hover { + color: var(--text-normal); +} +.mk-property-editor-new span { + font-size: var(--font-ui-smaller); +} +.mk-property-editor-new { + color: var(--text-faint); display: flex; + flex-direction: column; + padding: var(--size-4-2) var(--size-4-2); + border: thin solid var(--divider-color); + border-radius: 8px; } -.mk-smart-note-view div { - padding: 4px; +.mk-property-editor-context-title { + font-size: var(--font-ui-medium); + font-weight: var(--font-semibold); + line-height: var(--line-height-tight); + padding: var(--size-4-2) var(--size-4-1); + display: flex; + align-items: center; + gap: 8px; } -.mk-context-type-selector { - max-width: 100%; - width: 100%; - padding-top: 4px; - margin-left: auto; - margin-right: auto; +.mk-property-editor-list { + display: flex; + flex-direction: column; + gap: 4px; } -.mk-context-type-selector button { - background: rgba(var(--nav-item-background-active), 0.3); - border: none; - box-shadow: none; +.mk-property-editor-context-title span, +.mk-property-editor-list span { + font-size: var(--font-ui-smaller); color: var(--text-faint); + flex: 1; +} +.mk-context-properties-new { } -/* src/css/CardsView.css */ -.mk-space-scroller > .mk-cards-container { - padding-bottom: 60px; +/* src/css/FrameProps.css */ +body:not(.is-mobile) .mk-frame-props-editor { } -.mk-cards-container { - width: 100%; - height: 100%; +.mk-frame-props-editor { + display: flex; + position: absolute; + top: -40px; + padding: 0; + z-index: var(--layer-popover); + background: var(--background-primary); + max-height: unset; +} +.is-mobile .mk-frame-props-editor svg { + width: 32px; + height: 32px; +} +.is-mobile .mk-frame-props-editor { + --mobile-toolbar-height: 48px; + border-radius: 0; + width: 100%; + margin-top: 0; + overflow-x: auto; + justify-content: center; + height: var(--mobile-toolbar-height); + border-top: var(--divider-width) solid var(--divider-color); +} +.mk-frame-props-editor .mk-mark { + margin: 4px; + padding: 4px; + border-radius: 4px; + display: flex; + font-size: var(--font-ui-small); + align-items: center; + gap: 4px; +} +.mk-frame-props-editor .mk-mark:hover { + background: var(--background-modifier-hover); +} +.mk-frame-props-editor .mk-mark-active { + background: var(--background-modifier-hover); +} +.mk-frame-props-editor svg { + color: var(--text-muted); + width: 16px; + height: 16px; +} +.mk-divider { + border-left: thin solid var(--background-modifier-hover); + width: 1px; +} +mark { + color: unset; + border-radius: 2px; + margin: 0px 2px; + padding: 0px 2px; +} + +/* src/css/CardsView.css */ +.mk-space-scroller > .mk-cards-container { + padding-bottom: 60px; +} +.mk-cards-container { + width: 100%; + height: 100%; overflow-x: auto; overflow-y: visible; } @@ -875,7 +1256,7 @@ body:not(.is-mobile) .markdown-source-view.mod-cm6.is-readable-line-width .mk-sp width: 200px; } .mk-cards-grid .mk-list-item { - width: 250px; + width: calc((var(--file-line-width) / 3) - 7px); } .mk-cards-container .mk-file-icon svg { display: none; @@ -2050,478 +2431,97 @@ div:not(.mk-flowspace-editor) > .mk-floweditor .cm-content { .mk-frame-label { position: absolute; font-size: 9px; - background-color: var(--color-accent); - top: -10px; - left: 0; -} -.mk-frame-schema { - display: flex; - padding: 4px 8px; - font-size: var(--font-ui-small); -} -.mk-frame-layer { - margin-left: var(--spacing); - padding: 4px 8px; - font-size: var(--font-ui-small); - display: flex; -} -.mk-frame-layer.is-selected { - background-color: var(--nav-item-background-active); -} -.mk-frame-schema.is-selected { - background-color: var(--nav-item-background-active); -} -.mk-frame-sidebar-title { - display: flex; - padding: 4px 8px; - font-size: var(--font-ui-small); - font-weight: var(--bold-weight); - background: var(--background-primary-alt); -} -.mk-frame-text { - min-height: 40px; -} -.mk-frame-text[placeholder]:empty::before { - content: attr(placeholder); - color: var(--text-faint); -} -.mk-frame-text[placeholder]:empty:focus::before { - content: ""; -} -.mk-button { - -webkit-app-region: no-drag; - display: inline-flex; - align-items: center; - justify-content: center; - color: var(--text-normal); - font-size: var(--font-ui-small); - border-radius: var(--button-radius); - border: 0; - padding: var(--size-4-1) var(--size-4-3); - height: var(--input-height); - font-weight: var(--input-font-weight); - cursor: var(--cursor); - font-family: inherit; - outline: none; - user-select: none; - white-space: nowrap; - background-color: var(--interactive-normal); - box-shadow: var(--input-shadow); -} -.mk-a { - color: var(--link-color); - outline: none; - text-decoration-line: var(--link-decoration); - text-decoration-thickness: var(--link-decoration-thickness); - cursor: var(--cursor-link); -} -.mk-t-h1 { - --font-text-size: var(--h1-size); - --text-normal: var(--h1-color); - --font-normal: var(--h1-weight); -} -.mk-t-h2 { - --font-text-size: var(--h2-size); - --text-normal: var(--h2-color); - --font-normal: var(--h2-weight); -} -.mk-t-h3 { - --font-text-size: var(--h3-size); - --text-normal: var(--h3-color); - --font-normal: var(--h3-weight); -} -.mk-t-h4 { - --font-text-size: var(--h4-size); - --text-normal: var(--h4-color); - --font-normal: var(--h4-weight); -} -.mk-t-h5 { - --font-text-size: var(--h5-size); - --text-normal: var(--h5-color); - --font-normal: var(--h5-weight); -} -.mk-t-p { -} - -/* src/css/ContextBuilder.css */ -.is-phone .mk-context-maker { - max-height: 100vh; -} -.mk-context-maker-container { - height: 100%; - display: flex; - flex-direction: column; -} -.mk-context-maker .modal-content { - height: var(--dialog-max-height); - overflow-y: scroll; -} -.mk-context-maker-preview { - display: flex; - flex-wrap: wrap; - gap: 4px; - margin-bottom: 16px; - padding: var(--size-4-4); - flex-grow: 1; - overflow: scroll; - padding-bottom: 0; -} -.mk-context-maker-item { - background: rgba(var(--mono-rgb-100), 0.025); - border-radius: 4px; - overflow: hidden; - display: flex; - align-items: center; - gap: 2px; - padding: 8px; -} -.mk-context-maker-selector { - font-size: var(--font-ui-small); - height: 240px; - overflow-y: scroll; - background: rgba(var(--mono-rgb-100), 0.025); - padding: var(--size-4-4); - border-radius: 4px; -} -.mk-context-maker-selector .mk-cell-option { - margin-bottom: 8px; -} -.mk-context-maker-builder { - min-height: 60px; - display: flex; - flex-wrap: wrap; - padding: 8px; - gap: 4px; -} -.mk-property-editor-context-title { - display: flex; - font-size: var(--font-ui-small); - font-weight: var(--font-normal); - padding: var(--size-4-2) var(--size-4-1); -} -.mk-property-editor-context-title span { - flex: 1; -} -.mk-property-editor-context-tag { - display: flex; - gap: 4px; - align-items: center; -} -.mk-property-editor { - padding: 0; - display: flex; - flex-direction: column; - height: 100%; - gap: 8px; -} -.mk-property-editor-property { - display: flex; - padding: 8px; - font-size: var(--font-ui-small); - color: var(--text-muted); - gap: 6px; - align-items: center; - background: var(--background-modifier-cover); - border-radius: 6px; -} -.mk-property-editor-new:hover { - color: var(--text-normal); -} -.mk-property-editor-new span { - font-size: var(--font-ui-smaller); -} -.mk-property-editor-new { - color: var(--text-faint); - display: flex; - flex-direction: column; - padding: var(--size-4-2) var(--size-4-2); - border: thin solid var(--divider-color); - border-radius: 8px; -} -.mk-property-editor-context-title { - font-size: var(--font-ui-medium); - font-weight: var(--font-semibold); - line-height: var(--line-height-tight); - padding: var(--size-4-2) var(--size-4-1); - display: flex; - align-items: center; - gap: 8px; -} -.mk-property-editor-list { - display: flex; - flex-direction: column; - gap: 4px; -} -.mk-property-editor-context-title span, -.mk-property-editor-list span { - font-size: var(--font-ui-smaller); - color: var(--text-faint); - flex: 1; -} -.mk-context-properties-new { -} - -/* src/css/FilterBar.css */ -.mk-view-selector { - margin-right: 0; - display: flex; - align-items: center; - gap: 16px; - min-height: 48px; - max-width: 100%; - overflow-x: auto; - font-size: var(--font-ui-medium); -} -.mk-view-selector-spacer { - min-width: var(--context-padding); - width: var(--file-margins); -} -.mk-table-selector, -.mk-frame-selector { - display: flex; - flex-direction: column; -} -.mk-view-selector::-webkit-scrollbar { - display: none; -} -.mk-view-selector > div > .mk-collapse { - padding-right: 8px; - padding-left: 0px; -} -.mk-view-selector .mk-collapse.mk-icon-xsmall svg { - color: unset; -} -.mk-view-selector > div > button:not(:last-child) { - padding-right: 0px; -} -.mk-view-selector > div, -.mk-view-selector > button { - border-radius: 0; - margin: 4px -8px; - display: flex; - align-items: center; - border-bottom: thin solid transparent; - height: 100%; -} -.mk-view-config .mk-is-active button { - color: var(--text-normal); -} -.mk-view-config .mk-is-active { - color: var(--text-normal); - background: none !important; -} -.mk-table-selector button, -.mk-view-config button { - font-size: max(var(--font-ui-small), 1em); - font-weight: var(--font-medium); - background: rgba(var(--nav-item-background-active), 0.3); - border: none; - box-shadow: none; - color: var(--text-faint); -} -body:not(.is-mobile) .mk-view-config .mk-view-options, -body:not(.is-mobile) .mk-view-config .mk-view-selector > *:not(.mk-is-active) { - opacity: 0; -} -body:not(.is-mobile) .mk-view-config:hover .mk-view-options, -body:not(.is-mobile) .mk-view-config:hover .mk-view-selector > *:not(.mk-is-active) { - opacity: 1; -} -.mk-view-config button:hover { - color: var(--text-normal); -} -.mk-view-config { - width: 100%; - display: flex; - color: var(--text-faint); - align-items: center; - border-bottom: thin solid var(--divider-color); - flex-wrap: wrap; -} -.mk-view-config input { - background: none; - border: none; - flex-grow: 1; -} -.is-phone .mk-view-config { - flex-wrap: wrap; -} -.is-phone .mk-view-config button { - width: unset; -} -.mk-view-search { - background: var(--background-modifier-form-field); - border: var(--input-border-width) solid var(--background-modifier-border); - display: flex; - border-radius: 8px; - align-items: center; - flex-grow: 1; -} -.mk-view-search button:hover { - background: unset !important; -} -.mk-view-search button { - margin: 0 !important; - padding: var(--size-4-1) var(--size-4-2) !important; -} -.is-phone .mk-view-options { - margin-top: 8px; - margin-bottom: 8px; -} -.mk-view-options { - display: flex; - align-items: center; - color: var(--text-normal) !important; - min-height: 48px; - padding-left: var(--context-padding); -} -.mk-view-config span { - flex-grow: 10; -} -.mk-view-config svg { - width: 14px; - height: 14px; -} -.mk-filter-bar { - display: flex; - padding: 8px 4px; - gap: 8px; - width: 100%; - border-bottom: 1px solid var(--divider-color); -} -.mk-filter-bar span { - flex-grow: 1; -} -.mk-view-config .mk-is-active, -.mk-table-selector .mk-is-active { - color: var(--text-normal) !important; -} -.mk-filter { - display: flex; - font-size: var(--font-ui-smaller); - color: var(--text-muted); - padding: 0px; -} -.mk-query .mk-filter > span { - background: var(--background-primary); -} -.mk-filter > span, -.mk-filter > div { - background: var(--interactive-normal); -} -.mk-filter > span:hover, -.mk-filter > div:hover { - background: var(--interactive-hover); -} -.mk-filter > *:first-child { - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - padding-left: 10px; -} -.mk-filter > *:last-child { - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - padding-right: 6px; -} -.mk-filter > span { - border-right: thin solid var(--background-primary); - padding: 4px 8px; - display: flex; - align-items: center; -} -.mk-filter div { - display: flex; - align-items: center; -} -.mk-filter div svg { - width: 14px; - height: 14px; -} -.mk-query { - display: flex; - flex-direction: column; - gap: 16px; - padding: 8px; - border-radius: 6px; -} -.mk-query-filters { - flex-wrap: wrap; - padding: 0; - border-bottom: none; + background-color: var(--color-accent); + top: -10px; + left: 0; } -.mk-query-filter, -.mk-query-group-type { +.mk-frame-schema { display: flex; + padding: 4px 8px; + font-size: var(--font-ui-small); } -.mk-query-group { +.mk-frame-layer { + margin-left: var(--spacing); + padding: 4px 8px; + font-size: var(--font-ui-small); display: flex; } -.mk-query-group-type { - width: 32px; - padding-bottom: 4px; -} -.mk-query-group button { - background-color: unset; - box-shadow: none; - width: unset; +.mk-frame-layer.is-selected { + background-color: var(--nav-item-background-active); } -.is-phone .mk-query-group button { - background-color: var(--interative-normal); +.mk-frame-schema.is-selected { + background-color: var(--nav-item-background-active); } -.mk-query-group-type > span, -.mk-query-filter > span { +.mk-frame-sidebar-title { display: flex; - flex-grow: 1; + padding: 4px 8px; + font-size: var(--font-ui-small); + font-weight: var(--bold-weight); + background: var(--background-primary-alt); } -.mk-filter-add { - border: thin solid var(--divider-color) !important; - border-radius: 4px; - box-shadow: none !important; - background: none !important; - display: flex; +.mk-frame-text { + min-height: 40px; +} +.mk-frame-text[placeholder]:empty::before { + content: attr(placeholder); + color: var(--text-faint); +} +.mk-frame-text[placeholder]:empty:focus::before { + content: ""; +} +.mk-button { + -webkit-app-region: no-drag; + display: inline-flex; align-items: center; - padding: 4px; + justify-content: center; + color: var(--text-normal); font-size: var(--font-ui-small); - color: var(--text-muted); - gap: 4px; + border-radius: var(--button-radius); + border: 0; + padding: var(--size-4-1) var(--size-4-3); + height: var(--input-height); + font-weight: var(--input-font-weight); + cursor: var(--cursor); + font-family: inherit; + outline: none; + user-select: none; + white-space: nowrap; + background-color: var(--interactive-normal); + box-shadow: var(--input-shadow); } -.mk-filter-add div { - display: flex; +.mk-a { + color: var(--link-color); + outline: none; + text-decoration-line: var(--link-decoration); + text-decoration-thickness: var(--link-decoration-thickness); + cursor: var(--cursor-link); } -.mk-search-bar { +.mk-t-h1 { + --font-text-size: var(--h1-size); + --text-normal: var(--h1-color); + --font-normal: var(--h1-weight); } -.mk-tag-selector { - display: flex; - gap: 4px; - margin-top: 8px; - margin-bottom: 8px; - flex-wrap: wrap; +.mk-t-h2 { + --font-text-size: var(--h2-size); + --text-normal: var(--h2-color); + --font-normal: var(--h2-weight); } -.mk-tag-selector svg { - color: var(--tag-color) !important; +.mk-t-h3 { + --font-text-size: var(--h3-size); + --text-normal: var(--h3-color); + --font-normal: var(--h3-weight); } -.mk-tag-selector div { - cursor: var(--cursor-link); - font-size: var(--font-ui-smaller); - display: flex; +.mk-t-h4 { + --font-text-size: var(--h4-size); + --text-normal: var(--h4-color); + --font-normal: var(--h4-weight); } -.mk-tag-selector span { - display: flex; - align-items: center; +.mk-t-h5 { + --font-text-size: var(--h5-size); + --text-normal: var(--h5-color); + --font-normal: var(--h5-weight); } -.mk-tag-selector button { - height: auto; - border-radius: var(--tag-radius); - color: var(--tag-color); - background-color: var(--tag-background); - border: var(--tag-border-width) solid var(--tag-border-color); - box-shadow: none !important; - font-size: var(--tag-size); - vertical-align: baseline; - border-left: none; - border-right: none; - padding-top: var(--tag-padding-y) !important; - padding-bottom: var(--tag-padding-y) !important; +.mk-t-p { } /* src/css/FileContext.css */ @@ -3059,6 +3059,65 @@ mark { padding: 0px 2px; } +/* src/css/makerMode.css */ +.mk-mark-sans .cm-s-obsidian span.cm-hmd-escape-backslash, +.mk-mark-sans .cm-s-obsidian .HyperMD-header:not(.mk-reset) span.cm-formatting-header { + display: inline; + position: absolute; + right: 100%; + white-space: nowrap; + color: transparent; +} +.mk-mark-sans .cm-s-obsidian .HyperMD-header.mk-reset span.cm-formatting-header { + color: unset; +} +.mk-mark-sans .mk-reset .cm-fold-indicator { + display: none !important; +} +.mk-mark-sans div[class*=HyperMD-header-].mk-reset { + font-variant: unset; + letter-spacing: unset; + line-height: unset; + font-size: unset; + color: unset; + font-weight: unset; + font-style: unset; + font-family: unset; +} +.mk-mark-sans .HyperMD-quote-lazy:before { + content: none !important; +} +.mk-mark-sans .cm-s-obsidian span.cm-formatting-quote:not(.cm-hmd-callout) { + color: transparent; +} +.mk-mark-sans .cm-s-obsidian span.cm-hmd-escape-backslash::selection, +.mk-mark-sans .cm-s-obsidian span.cm-formatting-header::selection { + background: transparent; +} +.mk-flow-replace .mk-new-file { + background: var(--color-base-10); + border-bottom: thin solid #333; +} +.mk-flow-replace .mk-new-file:hover { + background: var(--color-base-10); + border-bottom: thin solid #333; +} +.mobile-toolbar-options-container { + border-top: var(--divider-width) solid var(--divider-color); +} +.mk-mark-sans .markdown-source-view.mod-cm6 .HyperMD-quote:not(.HyperMD-callout):before, +.mk-mark-sans .markdown-source-view.mod-cm6 .cm-blockquote-border:before { + left: 0; + content: "\200b"; + display: block; + width: 1px; + border-left: var(--blockquote-border-thickness) solid var(--blockquote-border-color); + color: transparent; + position: absolute; + top: 0; + bottom: 0; +} + /* src/css/MakeMenu.css */ .mk-slash-item { display: flex; @@ -3139,69 +3198,13 @@ mark { stroke-width: var(--icon-stroke); } -/* src/css/makerMode.css */ -.mk-mark-sans .cm-s-obsidian span.cm-hmd-escape-backslash, -.mk-mark-sans .cm-s-obsidian .HyperMD-header:not(.mk-reset) span.cm-formatting-header { - display: inline; - position: absolute; - right: 100%; - white-space: nowrap; - color: transparent; -} -.mk-mark-sans .cm-s-obsidian .HyperMD-header.mk-reset span.cm-formatting-header { - color: unset; -} -.mk-mark-sans .mk-reset .cm-fold-indicator { - display: none !important; -} -.mk-mark-sans div[class*=HyperMD-header-].mk-reset { - font-variant: unset; - letter-spacing: unset; - line-height: unset; - font-size: unset; - color: unset; - font-weight: unset; - font-style: unset; - font-family: unset; -} -.mk-mark-sans .HyperMD-quote-lazy:before { - content: none !important; -} -.mk-mark-sans .cm-s-obsidian span.cm-formatting-quote:not(.cm-hmd-callout) { - color: transparent; -} -.mk-mark-sans .cm-s-obsidian span.cm-hmd-escape-backslash::selection, -.mk-mark-sans .cm-s-obsidian span.cm-formatting-header::selection { - background: transparent; -} -.mk-flow-replace .mk-new-file { - background: var(--color-base-10); - border-bottom: thin solid #333; -} -.mk-flow-replace .mk-new-file:hover { - background: var(--color-base-10); - border-bottom: thin solid #333; -} -.mobile-toolbar-options-container { - border-top: var(--divider-width) solid var(--divider-color); -} -.mk-mark-sans .markdown-source-view.mod-cm6 .HyperMD-quote:not(.HyperMD-callout):before, -.mk-mark-sans .markdown-source-view.mod-cm6 .cm-blockquote-border:before { - left: 0; - content: "\200b"; - display: block; - width: 1px; - border-left: var(--blockquote-border-thickness) solid var(--blockquote-border-color); - color: transparent; - position: absolute; - top: 0; - bottom: 0; -} - /* src/css/FileTree.css */ .mk-hide-tabs .mod-left-split .mod-top-left-space .workspace-tab-header-container-inner { visibility: hidden; } +.is-phone .mod-root .workspace-tabs:not(.mod-visible) { + display: flex !important; +} .mk-spaces-enabled.is-mobile.mk-hide-ribbon .workspace-drawer.mod-left .workspace-drawer-inner { padding-left: 0 !important; } @@ -3497,6 +3500,7 @@ body:not(.is-mobile) .mk-tree-wrapper .mk-folder-buttons { .mk-file-link svg { width: 12px; height: 10px; + transform: rotate(45deg); } .mk-disable-interaction { pointer-events: none; @@ -3696,6 +3700,15 @@ body:not(.is-mobile) .mk-main-menu-button:hover { .mk-waypoint { display: flex; } +.mk-waypoint-new { + display: flex; + align-items: center; + color: var(--text-muted); + opacity: .5; +} +.mk-waypoint-new:hover { + opacity: 1; +} .mk-waypoint .mk-waypoints-item { display: flex; justify-content: center;