* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
var zw, Bw = Array.prototype, qw = Object.prototype.hasOwnProperty, Fw = Hs ? Hs.iterator : void 0, Vw = Math.max, Ww = Math.min, Hw = function(e18) {
return function(t2, n2, r2) {
if (null == r2) {
var i2 = du(n2), o2 = i2 && jl(n2), a2 = o2 && o2.length && Rp(n2, o2);
(a2 ? a2.length : i2) || (r2 = n2, n2 = t2, t2 = this);
}
return e18(t2, n2, r2);
};
}(Sg);
ac.after = Cw.after, ac.ary = Cw.ary, ac.assign = Aw.assign, ac.assignIn = Aw.assignIn, ac.assignInWith = Aw.assignInWith, ac.assignWith = Aw.assignWith, ac.at = Aw.at, ac.before = Cw.before, ac.bind = Cw.bind, ac.bindAll = Nw.bindAll, ac.bindKey = Cw.bindKey, ac.castArray = $w.castArray, ac.chain = Tw.chain, ac.chunk = xw.chunk, ac.compact = xw.compact, ac.concat = xw.concat, ac.cond = Nw.cond, ac.conforms = Nw.conforms, ac.constant = Nw.constant, ac.countBy = Sw.countBy, ac.create = Aw.create, ac.curry = Cw.curry, ac.curryRight = Cw.curryRight, ac.debounce = Cw.debounce, ac.defaults = Aw.defaults, ac.defaultsDeep = Aw.defaultsDeep, ac.defer = Cw.defer, ac.delay = Cw.delay, ac.difference = xw.difference, ac.differenceBy = xw.differenceBy, ac.differenceWith = xw.differenceWith, ac.drop = xw.drop, ac.dropRight = xw.dropRight, ac.dropRightWhile = xw.dropRightWhile, ac.dropWhile = xw.dropWhile, ac.fill = xw.fill, ac.filter = Sw.filter, ac.flatMap = Sw.flatMap, ac.flatMapDeep = Sw.flatMapDeep, ac.flatMapDepth = Sw.flatMapDepth, ac.flatten = xw.flatten, ac.flattenDeep = xw.flattenDeep, ac.flattenDepth = xw.flattenDepth, ac.flip = Cw.flip, ac.flow = Nw.flow, ac.flowRight = Nw.flowRight, ac.fromPairs = xw.fromPairs, ac.functions = Aw.functions, ac.functionsIn = Aw.functionsIn, ac.groupBy = Sw.groupBy, ac.initial = xw.initial, ac.intersection = xw.intersection, ac.intersectionBy = xw.intersectionBy, ac.intersectionWith = xw.intersectionWith, ac.invert = Aw.invert, ac.invertBy = Aw.invertBy, ac.invokeMap = Sw.invokeMap, ac.iteratee = Nw.iteratee, ac.keyBy = Sw.keyBy, ac.keys = jl, ac.keysIn = Aw.keysIn, ac.map = Sw.map, ac.mapKeys = Aw.mapKeys, ac.mapValues = Aw.mapValues, ac.matches = Nw.matches, ac.matchesProperty = Nw.matchesProperty, ac.memoize = Cw.memoize, ac.merge = Aw.merge, ac.mergeWith = Aw.mergeWith, ac.method = Nw.method, ac.methodOf = Nw.methodOf, ac.mixin = Hw, ac.negate = Cg, ac.nthArg = Nw.nthArg, ac.omit = Aw.omit, ac.omitBy = Aw.omitBy, ac.once = Cw.once, ac.orderBy = Sw.orderBy, ac.over = Nw.over, ac.overArgs = Cw.overArgs, ac.overEvery = Nw.overEvery, ac.overSome = Nw.overSome, ac.partial = Cw.partial, ac.partialRight = Cw.partialRight, ac.partition = Sw.partition, ac.pick = Aw.pick, ac.pickBy = Aw.pickBy, ac.property = Nw.property, ac.propertyOf = Nw.propertyOf, ac.pull = xw.pull, ac.pullAll = xw.pullAll, ac.pullAllBy = xw.pullAllBy, ac.pullAllWith = xw.pullAllWith, ac.pullAt = xw.pullAt, ac.range = Nw.range, ac.rangeRight = Nw.rangeRight, ac.rearg = Cw.rearg, ac.reject = Sw.reject, ac.remove = xw.remove, ac.rest = Cw.rest, ac.reverse = xw.reverse, ac.sampleSize = Sw.sampleSize, ac.set = Aw.set, ac.setWith = Aw.setWith, ac.shuffle = Sw.shuffle, ac.slice = xw.slice, ac.sortBy = Sw.sortBy, ac.sortedUniq = xw.sortedUniq, ac.sortedUniqBy = xw.sortedUniqBy, ac.split = Iw.split, ac.spread = Cw.spread, ac.tail = xw.tail, ac.take = xw.take, ac.takeRight = xw.takeRight, ac.takeRightWhile = xw.takeRightWhile, ac.takeWhile = xw.takeWhile, ac.tap = Tw.tap, ac.throttle = Cw.throttle, ac.thru = kk, ac.toArray = $w.toArray, ac.toPairs = Aw.toPairs, ac.toPairsIn = Aw.toPairsIn, ac.toPath = Nw.toPath, ac.toPlainObject = $w.toPlainObject, ac.transform = Aw.transform, ac.unary = Cw.unary, ac.union = xw.union, ac.unionBy = xw.unionBy, ac.unionWith = xw.unionWith, ac.uniq = xw.uniq, ac.uniqBy = xw.uniqBy, ac.uniqWith = xw.uniqWith, ac.unset = Aw.unset, ac.unzip = xw.unzip, ac.unzipWith = xw.unzipWith, ac.update = Aw.update, ac.updateWith = Aw.updateWith, ac.values = Aw.values, ac.valuesIn = Aw.valuesIn, ac.without = xw.without, ac.words = Iw.words, ac.wrap = Cw.wrap, ac.xor = xw.xor, ac.xorBy = xw.xorBy, ac.xorWith = xw.xorWith, ac.zip = xw.zip, ac.zipObject = xw.zipObject, ac.zipObjectDeep = xw.zipObjectDeep, ac.zipWith = xw.zipWith, ac.entries = Aw.toPairs, ac.entriesIn = Aw.toPairsIn, ac.extend = Aw.assignIn, ac.extendWith = Aw.assignInWith, Hw(ac, ac), ac.add = Ow.add, ac.attempt = Nw.attempt, ac.camelCase = Iw.camelCase, ac.capitalize = Iw.capitalize, ac.ceil = Ow.ceil, ac.clamp = Mw, ac.clone = $w.clone, ac.cloneDeep = $w.cloneDeep, ac.cloneDeepWith = $w.cloneDeepWith, ac.cloneWith = $w.cloneWith, ac.conformsTo = $w.conformsTo, ac.deburr = Iw.deburr, ac.defaultTo = Nw.defaultTo, ac.divide = Ow.divide, ac.endsWith = Iw.endsWith, ac.eq = $w.eq, ac.escape = Iw.escape, ac.escapeRegExp = Iw.escapeRegExp, ac.every = Sw.every, ac.find = Sw.find, ac.findIndex = xw.findIndex, ac.findKey = Aw.findKey, ac.findLast = Sw.findLast, ac.findLastIndex = xw.findLastIndex, ac.findLastKey = Aw.findLastKey, ac.floor = Ow.floor, ac.forEach = Sw.forEach, ac.forEachRight = Sw.forEachRight, ac.forIn = Aw.forIn, ac.forInRight = Aw.forInRight, ac.forOwn = Aw.forOwn, ac.forOwnRight = Aw.forOwnRight, ac.get = Aw.get, ac.gt = $w.gt, ac.gte = $w.gte, ac.has = Aw.has, ac.hasIn = Aw.hasIn, ac.head = xw.head, ac.identity = ju, ac.includes = Sw.includes, ac.indexOf = xw.indexOf, ac.inRange = Ew, ac.invoke = Aw.invoke, ac.isArguments = $w.isArguments, ac.isArray = ru, ac.isArrayBuffer = $w.isArrayBuffer, ac.isArrayLike = $w.isArrayLike, ac.isArrayLikeObject = $w.isArrayLikeObject, ac.isBoolean = $w.isBoolean, ac.isBuffer = $w.isBuffer, ac.isDate = $w.isDate, ac.isElement = $w.isElement, ac.isEmpty = $w.isEmpty, ac.isEqual = $w.isEqual, ac.isEqualWith = $w.isEqualWith, ac.isError = $w.isError, ac.isFinite = $w.isFinite, ac.isFunction = $w.isFunction, ac.isInteger = $w.isInteger, ac.isLength = $w.isLength, ac.isMap = $w.isMap, ac.isMatch = $w.isMatch, ac.isMatchWith = $w.isMatchWith, ac.isNaN = $w.isNaN, ac.isNative = $w.isNative, ac.isNil = $w.isNil, ac.isNull = $w.isNull, ac.isNumber = $w.isNumber, ac.isObject = du, ac.isObjectLike = $w.isObjectLike, ac.isPlainObject = $w.isPlainObject, ac.isRegExp = $w.isRegExp, ac.isSafeInteger = $w.isSafeInteger, ac.isSet = $w.isSet, ac.isString = $w.isString, ac.isSymbol = $w.isSymbol, ac.isTypedArray = $w.isTypedArray, ac.isUndefined = $w.isUndefined, ac.isWeakMap = $w.isWeakMap, ac.isWeakSet = $w.isWeakSet, ac.join = xw.join, ac.kebabCase = Iw.kebabCase, ac.last = $v, ac.lastIndexOf = xw.lastIndexOf, ac.lowerCase = Iw.lowerCase, ac.lowerFirst = Iw.lowerFirst, ac.lt = $w.lt, ac.lte = $w.lte, ac.max = Ow.max, ac.maxBy = Ow.maxBy, ac.mean = Ow.mean, ac.meanBy = Ow.meanBy, ac.min = Ow.min, ac.minBy = Ow.minBy, ac.stubArray = Nw.stubArray, ac.stubFalse = Nw.stubFalse, ac.stubObject = Nw.stubObject, ac.stubString = Nw.stubString, ac.stubTrue = Nw.stubTrue, ac.multiply = Ow.multiply, ac.nth = xw.nth, ac.noop = Nw.noop, ac.now = _w, ac.pad = Iw.pad, ac.padEnd = Iw.padEnd, ac.padStart = Iw.padStart, ac.parseInt = Iw.parseInt, ac.random = Pw, ac.reduce = Sw.reduce, ac.reduceRight = Sw.reduceRight, ac.repeat = Iw.repeat, ac.replace = Iw.replace, ac.result = Aw.result, ac.round = Ow.round, ac.sample = Sw.sample, ac.size = Sw.size, ac.snakeCase = Iw.snakeCase, ac.some = Sw.some, ac.sortedIndex = xw.sortedIndex, ac.sortedIndexBy = xw.sortedIndexBy, ac.sortedIndexOf = xw.sortedIndexOf, ac.sortedLastIndex = xw.sortedLastIndex, ac.sortedLastIndexBy = xw.sortedLastIndexBy, ac.sortedLastIndexOf = xw.sortedLastIndexOf, ac.startCase = Iw.startCase, ac.startsWith = Iw.startsWith, ac.subtract = Ow.subtract, ac.sum = Ow.sum, ac.sumBy = Ow.sumBy, ac.template = Iw.template, ac.times = Nw.times, ac.toFinite = $w.toFinite, ac.toInteger = ku, ac.toLength = $w.toLength, ac.toLower = Iw.toLower, ac.toNumber = $w.toNumber, ac.toSafeInteger = $w.toSafeInteger, ac.toString = $w.toString, ac.toUpper = Iw.toUpper, ac.trim = Iw.trim, ac.trimEnd = Iw.trimEnd, ac.trimStart = Iw.trimStart, ac.truncate = Iw.truncate, ac.unescape = Iw.unescape, ac.uniqueId = Nw.uniqueId, ac.upperCase = Iw.upperCase, ac.upperFirst = Iw.upperFirst, ac.each = Sw.forEach, ac.eachRight = Sw.forEachRight, ac.first = xw.head, Hw(ac, (zw = {}, Gd(ac, function(e18, t2) {
qw.call(ac.prototype, t2) || (zw[t2] = e18);
}), zw), { chain: false }), ac.VERSION = "4.17.21", (ac.templateSettings = Iw.templateSettings).imports._ = ac, yc(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e18) {
ac[e18].placeholder = ac;
}), yc(["drop", "take"], function(e18, t2) {
Qu.prototype[e18] = function(n2) {
n2 = void 0 === n2 ? 1 : Vw(ku(n2), 0);
var r2 = this.__filtered__ && !t2 ? new Qu(this) : this.clone();
return r2.__filtered__ ? r2.__takeCount__ = Ww(n2, r2.__takeCount__) : r2.__views__.push({ size: Ww(n2, 4294967295), type: e18 + (r2.__dir__ < 0 ? "Right" : "") }), r2;
}, Qu.prototype[e18 + "Right"] = function(t3) {
return this.reverse()[e18](t3).reverse();
};
}), yc(["filter", "map", "takeWhile"], function(e18, t2) {
var n2 = t2 + 1, r2 = 1 == n2 || 3 == n2;
Qu.prototype[e18] = function(e19) {
var t3 = this.clone();
return t3.__iteratees__.push({ iteratee: qd(e19), type: n2 }), t3.__filtered__ = t3.__filtered__ || r2, t3;
};
}), yc(["head", "last"], function(e18, t2) {
var n2 = "take" + (t2 ? "Right" : "");
Qu.prototype[e18] = function() {
return this[n2](1).value()[0];
};
}), yc(["initial", "tail"], function(e18, t2) {
var n2 = "drop" + (t2 ? "" : "Right");
Qu.prototype[e18] = function() {
return this.__filtered__ ? new Qu(this) : this[n2](1);
};
}), Qu.prototype.compact = function() {
return this.filter(ju);
}, Qu.prototype.find = function(e18) {
return this.filter(e18).head();
}, Qu.prototype.findLast = function(e18) {
return this.reverse().find(e18);
}, Qu.prototype.invokeMap = Wc(function(e18, t2) {
return "function" == typeof e18 ? new Qu(this) : this.map(function(n2) {
return bm(n2, e18, t2);
});
}), Qu.prototype.reject = function(e18) {
return this.filter(Cg(qd(e18)));
}, Qu.prototype.slice = function(e18, t2) {
e18 = ku(e18);
var n2 = this;
return n2.__filtered__ && (e18 > 0 || t2 < 0) ? new Qu(n2) : (e18 < 0 ? n2 = n2.takeRight(-e18) : e18 && (n2 = n2.drop(e18)), void 0 !== t2 && (n2 = (t2 = ku(t2)) < 0 ? n2.dropRight(-t2) : n2.take(t2 - e18)), n2);
}, Qu.prototype.takeRightWhile = function(e18) {
return this.reverse().takeWhile(e18).reverse();
}, Qu.prototype.toArray = function() {
return this.take(4294967295);
}, Gd(Qu.prototype, function(e18, t2) {
var n2 = /^(?:filter|find|map|reject)|While$/.test(t2), r2 = /^(?:head|last)$/.test(t2), i2 = ac[r2 ? "take" + ("last" == t2 ? "Right" : "") : t2], o2 = r2 || /^find/.test(t2);
i2 && (ac.prototype[t2] = function() {
var t3 = this.__wrapped__, a2 = r2 ? [1] : arguments, s2 = t3 instanceof Qu, u2 = a2[0], c2 = s2 || ru(t3), l2 = function(e19) {
var t4 = i2.apply(ac, ef([e19], a2));
return r2 && f2 ? t4[0] : t4;
};
c2 && n2 && "function" == typeof u2 && 1 != u2.length && (s2 = c2 = false);
var f2 = this.__chain__, h2 = !!this.__actions__.length, d2 = o2 && !f2, v2 = s2 && !h2;
if (!o2 && c2) {
t3 = v2 ? t3 : new Qu(this);
var p2 = e18.apply(t3, a2);
return p2.__actions__.push({ func: kk, args: [l2], thisArg: void 0 }), new nc(p2, f2);
}
return d2 && v2 ? e18.apply(this, a2) : (p2 = this.thru(l2), d2 ? r2 ? p2.value()[0] : p2.value() : p2);
});
}), yc(["pop", "push", "shift", "sort", "splice", "unshift"], function(e18) {
var t2 = Bw[e18], n2 = /^(?:push|sort|unshift)$/.test(e18) ? "tap" : "thru", r2 = /^(?:pop|shift)$/.test(e18);
ac.prototype[e18] = function() {
var e19 = arguments;
if (r2 && !this.__chain__) {
var i2 = this.value();
return t2.apply(ru(i2) ? i2 : [], e19);
}
return this[n2](function(n3) {
return t2.apply(ru(n3) ? n3 : [], e19);
});
};
}), Gd(Qu.prototype, function(e18, t2) {
var n2 = ac[t2];
if (n2) {
var r2 = n2.name + "";
qw.call(Xu, r2) || (Xu[r2] = []), Xu[r2].push({ name: t2, func: n2 });
}
}), Xu[Ac(void 0, 2).name] = [{ name: "wrapper", func: void 0 }], Qu.prototype.clone = function() {
var e18 = new Qu(this.__wrapped__);
return e18.__actions__ = rc(this.__actions__), e18.__dir__ = this.__dir__, e18.__filtered__ = this.__filtered__, e18.__iteratees__ = rc(this.__iteratees__), e18.__takeCount__ = this.__takeCount__, e18.__views__ = rc(this.__views__), e18;
}, Qu.prototype.reverse = function() {
if (this.__filtered__) {
var e18 = new Qu(this);
e18.__dir__ = -1, e18.__filtered__ = true;
} else
(e18 = this.clone()).__dir__ *= -1;
return e18;
}, Qu.prototype.value = function() {
var e18 = this.__wrapped__.value(), t2 = this.__dir__, n2 = ru(e18), r2 = t2 < 0, i2 = n2 ? e18.length : 0, o2 = function(e19, t3, n3) {
for (var r3 = -1, i3 = n3.length; ++r3 < i3; ) {
var o3 = n3[r3], a3 = o3.size;
switch (o3.type) {
case "drop":
e19 += a3;
break;
case "dropRight":
t3 -= a3;
break;
case "take":
t3 = Dw(t3, e19 + a3);
break;
case "takeRight":
e19 = Rw(e19, t3 - a3);
}
}
return { start: e19, end: t3 };
}(0, i2, this.__views__), a2 = o2.start, s2 = o2.end, u2 = s2 - a2, c2 = r2 ? s2 : a2 - 1, l2 = this.__iteratees__, f2 = l2.length, h2 = 0, d2 = Lw(u2, this.__takeCount__);
if (!n2 || !r2 && i2 == u2 && d2 == u2)
return Sk(e18, this.__actions__);
var v2 = [];
e:
for (; u2-- && h2 < d2; ) {
for (var p2 = -1, m2 = e18[c2 += t2]; ++p2 < f2; ) {
var g2 = l2[p2], y2 = g2.iteratee, b2 = g2.type, k2 = y2(m2);
if (2 == b2)
m2 = k2;
else if (!k2) {
if (1 == b2)
continue e;
break e;
}
}
v2[h2++] = m2;
}
return v2;
}, ac.prototype.at = Tw.at, ac.prototype.chain = Tw.wrapperChain, ac.prototype.commit = Tw.commit, ac.prototype.next = Tw.next, ac.prototype.plant = Tw.plant, ac.prototype.reverse = Tw.reverse, ac.prototype.toJSON = ac.prototype.valueOf = ac.prototype.value = Tw.value, ac.prototype.first = ac.prototype.head, Fw && (ac.prototype[Fw] = Tw.toIterator);
var Jw = Object.freeze({ __proto__: null, add: uu, after: wu, ary: Rc, assign: Sl, assignIn: Ol, assignInWith: Ml, assignWith: El, at: sf, attempt: mf, before: gf, bind: yf, bindAll: bf, bindKey: kf, camelCase: fh, capitalize: Lf, castArray: hh, ceil: mh, chain: gh, chunk: kh, clamp: jh, clone: ld, cloneDeep: fd, cloneDeepWith: hd, cloneWith: dd, commit: vd, compact: pd, concat: md, cond: Fd, conforms: Wd, conformsTo: Hd, constant: vc, countBy: tv, create: nv, curry: rv, curryRight: iv, debounce: uv, deburr: Wf, defaultTo: cv, defaults: hv, defaultsDeep: kv, defer: jv, delay: xv, difference: Cv, differenceBy: Ov, differenceWith: Mv, divide: Ev, drop: Pv, dropRight: Av, dropRightWhile: Iv, dropWhile: Nv, each: Dv, eachRight: Fv, endsWith: Vv, entries: Hv, entriesIn: Jv, eq: Lc, escape: Qv, escapeRegExp: Xv, every: np, extend: Ol, extendWith: Ml, fill: ip, filter: ap, find: lp, findIndex: cp, findKey: hp, findLast: mp, findLastIndex: pp, findLastKey: gp, first: yp, flatMap: wp, flatMapDeep: jp, flatMapDepth: xp, flatten: of, flattenDeep: Sp, flattenDepth: _p, flip: Cp, floor: $p, flow: Mp, flowRight: Ep, forEach: Dv, forEachRight: Fv, forIn: Pp, forInRight: Ap, forOwn: Tp, forOwnRight: Ip, fromPairs: Np, functions: Dp, functionsIn: Lp, get: Zl, groupBy: Bp, gt: Vp, gte: Wp, has: Up, hasIn: Dd, head: yp, identity: ju, inRange: Qp, includes: tm, indexOf: rm, initial: im, intersection: um, intersectionBy: cm, intersectionWith: lm, invert: dm, invertBy: gm, invoke: km, invokeMap: wm, isArguments: nl, isArray: ru, isArrayBuffer: xm, isArrayLike: Jc, isArrayLikeObject: vv, isBoolean: Sm, isBuffer: sl, isDate: Cm, isElement: $m, isEmpty: Mm, isEqual: Em, isEqualWith: Pm, isError: pf, isFinite: Tm, isFunction: xu, isInteger: Im, isLength: Hc, isMap: od, isMatch: Nm, isMatchWith: Rm, isNaN: Lm, isNative: Bm, isNil: qm, isNull: Fm, isNumber: Dm, isObject: du, isObjectLike: Xs, isPlainObject: vf, isRegExp: Wm, isSafeInteger: Hm, isSet: sd, isString: Yp, isSymbol: eu, isTypedArray: pl, isUndefined: Jm, isWeakMap: Um, isWeakSet: Km, iteratee: Gm, join: Ym, kebabCase: Zm, keyBy: Xm, keys: jl, keysIn: $l, last: $v, lastIndexOf: ng, lodash: ac, lowerCase: rg, lowerFirst: ig, lt: ag, lte: sg, map: kp, mapKeys: ug, mapValues: cg, matches: lg, matchesProperty: fg, max: dg, maxBy: vg, mean: gg, meanBy: yg, memoize: Wl, merge: bg, mergeWith: bv, method: kg, methodOf: wg, min: jg, minBy: xg, mixin: Sg, multiply: _g, negate: Cg, next: Mg, noop: Yu, now: ov, nth: Pg, nthArg: Ag, omit: Ng, omitBy: zg, once: Bg, orderBy: Vg, over: Hg, overArgs: Kg, overEvery: Gg, overSome: Qg, pad: py, padEnd: my, padStart: gy, parseInt: ky, partial: wy, partialRight: jy, partition: xy, pick: Sy, pickBy: Lg, plant: _y, property: Bd, propertyOf: Cy, pull: Py, pullAll: Ey, pullAllBy: Ay, pullAllWith: Ty, pullAt: Ry, random: Vy, range: Uy, rangeRight: Ky, rearg: Gy, reduce: Yy, reduceRight: Xy, reject: eb, remove: tb, repeat: nb, replace: rb, rest: ib, result: ob, reverse: sb, round: ub, sample: fb, sampleSize: pb, set: mb, setWith: gb, shuffle: kb, size: wb, slice: jb, snakeCase: xb, some: _b, sortBy: Cb, sortedIndex: Pb, sortedIndexBy: Ab, sortedIndexOf: Tb, sortedLastIndex: Ib, sortedLastIndexBy: Nb, sortedLastIndexOf: Rb, sortedUniq: Lb, sortedUniqBy: zb, split: Bb, spread: Fb, startCase: Vb, startsWith: Wb, stubArray: Ph, stubFalse: rl, stubObject: Hb, stubString: Jb, stubTrue: Ub, subtract: Kb, sum: Gb, sumBy: Qb, tail: Yb, take: Zb, takeRight: Xb, takeRightWhile: ek, takeWhile: tk, tap: nk, template: yk, templateSettings: ck, throttle: bk, thru: kk, times: jk, toArray: Og, toFinite: bu, toInteger: ku, toIterator: xk, toJSON: _k, toLength: rp, toLower: Ck, toNumber: yu, toPairs: Hv, toPairsIn: Jv, toPath: $k, toPlainObject: mv, toSafeInteger: Ok, toString: Kl, toUpper: Mk, transform: Ek, trim: Tk, trimEnd: Ik, trimStart: Rk, truncate: Lk, unary: zk, unescape: Vk, union: Jk, unionBy: Uk, unionWith: Kk, uniq: Gk, uniqBy: Qk, uniqWith: Yk, uniqueId: Xk, unset: ew, unzip: nw, unzipWith: rw, update: ow, updateWith: aw, upperCase: sw, upperFirst: Df, value: _k, valueOf: _k, values: Xp, valuesIn: uw, without: cw, words: uh, wrap: lw, wrapperAt: fw, wrapperChain: hw, wrapperCommit: vd, wrapperLodash: ac, wrapperNext: Mg, wrapperPlant: _y, wrapperReverse: dw, wrapperToIterator: xk, wrapperValue: _k, xor: pw, xorBy: mw, xorWith: gw, zip: yw, zipObject: kw, zipObjectDeep: ww, zipWith: jw, default: ac }), Uw = [];
function Kw(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n2 = {};
if (!Array.isArray(e18))
throw new TypeError("Array expected");
function r2(e19, i3) {
(!Array.isArray(e19) && !As(e19) || t2 && i3.length > 0) && (n2[fs.exports.compileJSONPointer(i3)] = true), As(e19) && Object.keys(e19).forEach(function(t3) {
r2(e19[t3], i3.concat(t3));
});
}
for (var i2 = Math.min(e18.length, 1e4), o2 = 0; o2 < i2; o2++) {
var a2 = e18[o2];
r2(a2, Uw);
}
var s2 = Object.keys(n2).sort();
return s2.map(fs.exports.parseJSONPointer);
}
function Gw(e18, t2, n2) {
if (!(t2 <= e18))
for (var r2 = e18; r2 < t2; r2++)
n2(r2);
}
function Qw(e18, t2) {
return e18.length > t2 ? e18.slice(0, t2) : e18;
}
function Yw(e18) {
return ji({}, e18);
}
function Zw(e18) {
return Object.values(e18);
}
function Xw(e18, t2, n2, r2) {
var i2 = e18.slice(0), o2 = i2.splice(t2, n2);
return i2.splice.apply(i2, [t2 + r2, 0].concat(Ti(o2))), i2;
}
function ej(e18, t2) {
try {
return t2.parse(e18);
} catch (n2) {
return t2.parse(Os(e18));
}
}
function tj(e18, t2) {
try {
return ej(e18, t2);
} catch (e19) {
return;
}
}
function nj(e18, t2) {
e18 = e18.replace(ij, "");
try {
return t2(e18);
} catch (e19) {
}
try {
return t2("[" + e18 + "]");
} catch (e19) {
}
try {
return t2("{" + e18 + "}");
} catch (e19) {
}
throw new Error("Failed to parse partial JSON");
}
function rj(e18) {
e18 = e18.replace(ij, "");
try {
return Os(e18);
} catch (e19) {
}
try {
var t2 = Os("[" + e18 + "]");
return t2.substring(1, t2.length - 1);
} catch (e19) {
}
try {
var n2 = Os("{" + e18 + "}");
return n2.substring(1, n2.length - 1);
} catch (e19) {
}
throw new Error("Failed to repair partial JSON");
}
var ij = /,\s*$/;
function oj(e18, t2) {
var n2 = mj.exec(t2);
if (n2) {
var r2 = Ms(n2[2]), i2 = function(e19, t3) {
for (var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r3 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : e19.length, i3 = 0, o3 = n3; o3 < r3; o3++)
e19.charAt(o3) === t3 && i3++;
return i3;
}(e18, "\n", 0, r2), o2 = r2 - e18.lastIndexOf("\n", r2) - 1;
return { position: r2, line: i2, column: o2, message: t2.replace(mj, function() {
return "line ".concat(i2 + 1, " column ").concat(o2 + 1);
}) };
}
var a2 = gj.exec(t2), s2 = a2 ? Ms(a2[1]) : null, u2 = null !== s2 ? s2 - 1 : null, c2 = yj.exec(t2), l2 = c2 ? Ms(c2[1]) : null, f2 = null !== l2 ? l2 - 1 : null, h2 = null !== u2 && null !== f2 ? function(e19, t3, n3) {
var r3 = e19.indexOf("\n"), i3 = 1;
for (; i3 < t3 && -1 !== r3; )
r3 = e19.indexOf("\n", r3 + 1), i3++;
return -1 !== r3 ? r3 + n3 + 1 : null;
}(e18, u2, f2) : null;
return { position: h2, line: u2, column: f2, message: t2.replace(/^JSON.parse: /, "").replace(/ of the JSON data$/, "") };
}
function aj(e18) {
return As(e18) ? void 0 !== e18.json ? void 0 !== e18.text ? 'Content must contain either a property "json" or a property "text" but not both' : null : void 0 === e18.text ? 'Content must contain either a property "json" or a property "text"' : "string" != typeof e18.text ? 'Content "text" property must be string' : null : "Content must be an object";
}
function sj(e18) {
return "string" == typeof e18.text;
}
function uj(e18, t2, n2) {
return sj(e18) ? e18.text : n2.stringify(e18.json, null, t2);
}
function cj(e18, t2) {
return lj(e18, t2) > t2;
}
function lj(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 / 0;
if (sj(e18))
return e18.text.length;
var n2 = e18.json, r2 = 0;
function i2(e19) {
if (Array.isArray(e19)) {
if ((r2 += e19.length - 1 + 2) > t2)
return r2;
for (var n3 = 0; n3 < e19.length; n3++) {
if (i2(e19[n3]), r2 > t2)
return r2;
}
} else if (As(e19)) {
var o2 = Object.keys(e19);
r2 += 2 + o2.length + (o2.length - 1);
for (var a2 = 0; a2 < o2.length; a2++) {
var s2 = o2[a2], u2 = e19[s2];
r2 += s2.length + 2, i2(u2);
}
} else
r2 += "string" == typeof e19 ? e19.length + 2 : String(e19).length;
}
return i2(n2), r2;
}
var fj, hj, dj, vj, pj, mj = /(position|char) (\d+)/, gj = /line (\d+)/, yj = /column (\d+)/;
function bj(e18, t2) {
return e18.parse === t2.parse && e18.stringify === t2.stringify;
}
function kj(e18) {
var t2 = e18.escapeControlCharacters, n2 = e18.escapeUnicodeCharacters;
return t2 ? n2 ? wj : jj : n2 ? xj : Sj;
}
!function(e18) {
e18.text = "text", e18.tree = "tree";
}(fj || (fj = {})), function(e18) {
e18.after = "after", e18.inside = "inside", e18.key = "key", e18.value = "value", e18.multi = "multi";
}(hj || (hj = {})), function(e18) {
e18.after = "after", e18.key = "key", e18.value = "value", e18.inside = "inside";
}(dj || (dj = {})), function(e18) {
e18.info = "info", e18.warning = "warning", e18.error = "error";
}(vj || (vj = {})), function(e18) {
e18.key = "key", e18.value = "value";
}(pj || (pj = {}));
var wj = { escapeValue: function(e18) {
return _j(Mj(String(e18)));
}, unescapeValue: function(e18) {
return Ej(Cj(e18));
} }, jj = { escapeValue: function(e18) {
return Mj(String(e18));
}, unescapeValue: function(e18) {
return Ej(e18);
} }, xj = { escapeValue: function(e18) {
return _j(String(e18));
}, unescapeValue: function(e18) {
return Cj(e18);
} }, Sj = { escapeValue: function(e18) {
return String(e18);
}, unescapeValue: function(e18) {
return e18;
} };
function _j(e18) {
return e18.replace(/[^\x20-\x7F]/g, function(e19) {
return "\b" === e19 || "\f" === e19 || "\n" === e19 || "\r" === e19 || " " === e19 ? e19 : "\\u" + ("000" + e19.codePointAt(0).toString(16)).slice(-4);
});
}
function Cj(e18) {
return e18.replace(/\\u[a-fA-F0-9]{4}/g, function(e19) {
try {
var t2 = JSON.parse('"' + e19 + '"');
return $j[t2] || t2;
} catch (t3) {
return e19;
}
});
}
var $j = { '"': '\\"', "\\": "\\\\", "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t" }, Oj = { '\\"': '"', "\\\\": "\\", "\\/": "/", "\\b": "\b", "\\f": "\f", "\\n": "\n", "\\r": "\r", "\\t": " " };
function Mj(e18) {
return e18.replace(/["\b\f\n\r\t\\]/g, function(e19) {
return $j[e19] || e19;
});
}
function Ej(e18) {
return e18.replace(/\\["bfnrt\\]/g, function(e19) {
return Oj[e19] || e19;
});
}
function Pj(e18) {
return "string" != typeof e18 ? String(e18) : e18.endsWith("\n") ? e18 + "\n" : e18;
}
function Aj(e18, t2) {
return Ij(e18, function(e19) {
return e19.nodeName.toUpperCase() === t2.toUpperCase();
});
}
function Tj(e18, t2, n2) {
return Ij(e18, function(e19) {
return function(e20, t3, n3) {
return "function" == typeof e20.getAttribute && e20.getAttribute(t3) === n3;
}(e19, t2, n2);
});
}
function Ij(e18, t2) {
return !!Nj(e18, t2);
}
function Nj(e18, t2) {
for (var n2 = e18; n2 && !t2(n2); )
n2 = n2.parentNode;
return n2 || void 0;
}
function Rj(e18) {
if (null != e18.firstChild) {
var t2 = document.createRange(), n2 = window.getSelection();
t2.setStart(e18, 1), t2.collapse(true), n2.removeAllRanges(), n2.addRange(t2);
} else
e18.focus();
}
function Dj(e18) {
return e18 && e18.ownerDocument && e18.ownerDocument.defaultView;
}
function Lj(e18) {
return Ij(Dj(e18).document.activeElement, function(t2) {
return t2 === e18;
});
}
function zj(e18, t2) {
return Nj(e18, function(e19) {
return e19.nodeName === t2;
});
}
function Bj(e18) {
return Tj(e18, "data-type", "selectable-key") ? hj.key : Tj(e18, "data-type", "selectable-value") ? hj.value : Tj(e18, "data-type", "insert-selection-area-inside") ? hj.inside : Tj(e18, "data-type", "insert-selection-area-after") ? hj.after : hj.multi;
}
function qj(e18) {
return encodeURIComponent(fs.exports.compileJSONPointer(e18));
}
function Fj(e18) {
var t2, n2 = Nj(e18, function(e19) {
return e19.hasAttribute("data-path");
});
return n2 ? (t2 = n2.getAttribute("data-path"), fs.exports.parseJSONPointer(decodeURIComponent(t2))) : null;
}
function Vj(e18) {
var t2 = e18.allElements, n2 = e18.currentElement, r2 = e18.direction, i2 = e18.hasPrio, o2 = void 0 === i2 ? function() {
return true;
} : i2, a2 = e18.margin, s2 = void 0 === a2 ? 10 : a2, u2 = kp(t2.filter(function(e19) {
var t3 = e19.getBoundingClientRect();
return t3.width > 0 && t3.height > 0;
}), l2), c2 = l2(n2);
function l2(e19) {
var t3 = e19.getBoundingClientRect();
return { x: t3.left + t3.width / 2, y: t3.top + t3.height / 2, rect: t3, element: e19 };
}
function f2(e19, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, r3 = e19.x - t3.x, i3 = (e19.y - t3.y) * n3;
return Math.sqrt(r3 * r3 + i3 * i3);
}
var h2 = function(e19) {
return f2(e19, c2);
};
if ("Left" === r2 || "Right" === r2) {
var d2 = "Left" === r2 ? u2.filter(function(e19) {
return t3 = c2, e19.rect.left + s2 < t3.rect.left;
var t3;
}) : u2.filter(function(e19) {
return t3 = c2, e19.rect.right > t3.rect.right + s2;
var t3;
}), v2 = xg(d2.filter(function(e19) {
return t3 = e19, n3 = c2, Math.abs(t3.y - n3.y) < s2;
var t3, n3;
}), h2) || xg(d2, function(e19) {
return f2(e19, c2, 10);
});
return null == v2 ? void 0 : v2.element;
}
if ("Up" === r2 || "Down" === r2) {
var p2 = "Up" === r2 ? u2.filter(function(e19) {
return t3 = c2, e19.y + s2 < t3.y;
var t3;
}) : u2.filter(function(e19) {
return t3 = c2, e19.y > t3.y + s2;
var t3;
}), m2 = xg(p2.filter(function(e19) {
return o2(e19.element);
}), h2) || xg(p2, h2);
return null == m2 ? void 0 : m2.element;
}
}
var Wj = "undefined" != typeof navigator && navigator.platform.toUpperCase().indexOf("MAC") >= 0;
function Hj(e18) {
var t2 = [];
e18.ctrlKey && t2.push("Ctrl"), e18.metaKey && t2.push("Command"), e18.altKey && t2.push(Wj ? "Option" : "Alt"), e18.shiftKey && t2.push("Shift");
var n2 = function(e19) {
return Uj[e19] || "";
}(e18.which);
return Jj[n2] || t2.push(n2), t2.join("+");
}
var Jj = { Ctrl: true, Command: true, Alt: true, Option: true, Shift: true }, Uj = { 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause_Break", 20: "Caps_Lock", 27: "Escape", 33: "Page_Up", 34: "Page_Down", 35: "End", 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 45: "Insert", 46: "Delete", 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 65: "A", 66: "B", 67: "C", 68: "D", 69: "E", 70: "F", 71: "G", 72: "H", 73: "I", 74: "J", 75: "K", 76: "L", 77: "M", 78: "N", 79: "O", 80: "P", 81: "Q", 82: "R", 83: "S", 84: "T", 85: "U", 86: "V", 87: "W", 88: "X", 89: "Y", 90: "Z", 91: "Left_Window_Key", 92: "Right_Window_Key", 93: "Select_Key", 96: "Numpad_0", 97: "Numpad_1", 98: "Numpad_2", 99: "Numpad_3", 100: "Numpad_4", 101: "Numpad_5", 102: "Numpad_6", 103: "Numpad_7", 104: "Numpad_8", 105: "Numpad_9", 106: "Numpad_*", 107: "Numpad_+", 109: "Numpad_-", 110: "Numpad_.", 111: "Numpad_/", 112: "F1", 113: "F2", 114: "F3", 115: "F4", 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 144: "Num_Lock", 145: "Scroll_Lock", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'" }, Kj = ja.window;
function Gj(e18) {
co(e18, "svelte-1r8q3m8", ".jse-absolute-popup.svelte-1r8q3m8.svelte-1r8q3m8{position:relative;left:0;top:0;width:0;height:0;z-index:1001}.jse-absolute-popup.svelte-1r8q3m8 .jse-hidden-input.svelte-1r8q3m8{position:fixed;left:0;top:0;width:0;height:0;padding:0;margin:0;border:none;outline:none;overflow:hidden}.jse-absolute-popup.svelte-1r8q3m8 .jse-absolute-popup-content.svelte-1r8q3m8{position:absolute}");
}
function Qj(e18) {
var t2, n2, r2, i2, o2, a2, s2 = [e18[0].props], u2 = e18[0].component;
function c2(e19) {
for (var t3 = {}, n3 = 0; n3 < s2.length; n3 += 1)
t3 = Fi(t3, s2[n3]);
return { props: t3 };
}
return u2 && (i2 = new u2(c2())), { c: function() {
t2 = go("div"), n2 = go("input"), r2 = ko(), i2 && Ma(i2.$$.fragment), So(n2, "type", "text"), n2.readOnly = "readonly", So(n2, "tabindex", "-1"), So(n2, "class", "jse-hidden-input svelte-1r8q3m8"), So(t2, "class", "jse-absolute-popup-content svelte-1r8q3m8"), So(t2, "style", o2 = Xj(e18[1], e18[0].options));
}, m: function(o3, s3) {
vo(o3, t2, s3), uo(t2, n2), e18[7](n2), uo(t2, r2), i2 && Ea(i2, t2, null), a2 = true;
}, p: function(e19, n3) {
var r3 = 1 & n3 ? Ca(s2, [$a(e19[0].props)]) : {};
if (u2 !== (u2 = e19[0].component)) {
if (i2) {
ma();
var l2 = i2;
ba(l2.$$.fragment, 1, 0, function() {
Pa(l2, 1);
}), ga();
}
u2 ? (Ma((i2 = new u2(c2())).$$.fragment), ya(i2.$$.fragment, 1), Ea(i2, t2, null)) : i2 = null;
} else
u2 && i2.$set(r3);
(!a2 || 3 & n3 && o2 !== (o2 = Xj(e19[1], e19[0].options))) && So(t2, "style", o2);
}, i: function(e19) {
a2 || (i2 && ya(i2.$$.fragment, e19), a2 = true);
}, o: function(e19) {
i2 && ba(i2.$$.fragment, e19), a2 = false;
}, d: function(n3) {
n3 && po(t2), e18[7](null), i2 && Pa(i2);
} };
}
function Yj(e18) {
var t2, n2, r2, i2, o2 = e18[1] && Qj(e18);
return { c: function() {
t2 = go("div"), o2 && o2.c(), So(t2, "class", "jse-absolute-popup svelte-1r8q3m8");
}, m: function(a2, s2) {
vo(a2, t2, s2), o2 && o2.m(t2, null), e18[8](t2), n2 = true, r2 || (i2 = [jo(Kj, "mousedown", e18[3], true), jo(Kj, "keydown", e18[4], true), jo(Kj, "wheel", e18[5], true), jo(t2, "mousedown", Zj), jo(t2, "keydown", e18[4])], r2 = true);
}, p: function(e19, n3) {
var r3 = ki(n3, 1)[0];
e19[1] ? o2 ? (o2.p(e19, r3), 2 & r3 && ya(o2, 1)) : ((o2 = Qj(e19)).c(), ya(o2, 1), o2.m(t2, null)) : o2 && (ma(), ba(o2, 1, 1, function() {
o2 = null;
}), ga());
}, i: function(e19) {
n2 || (ya(o2), n2 = true);
}, o: function(e19) {
ba(o2), n2 = false;
}, d: function(n3) {
n3 && po(t2), o2 && o2.d(), e18[8](null), r2 = false, Hi(i2);
} };
}
function Zj(e18) {
e18.stopPropagation();
}
function Xj(e18, t2) {
var n2 = e18.getBoundingClientRect(), r2 = function() {
if (t2.anchor) {
var e19 = t2.anchor, n3 = t2.width, r3 = void 0 === n3 ? 0 : n3, i3 = t2.height, o3 = void 0 === i3 ? 0 : i3, a3 = t2.offsetTop, s3 = void 0 === a3 ? 0 : a3, u2 = t2.offsetLeft, c2 = void 0 === u2 ? 0 : u2, l2 = t2.position, f2 = e19.getBoundingClientRect(), h2 = f2.left, d2 = f2.top, v2 = f2.bottom, p2 = f2.right, m2 = "top" === l2 || d2 + o3 > window.innerHeight && d2 > o3, g2 = "left" === l2 || h2 + r3 > window.innerWidth && h2 > r3;
return { left: g2 ? p2 - c2 : h2 + c2, top: m2 ? d2 - s3 : v2 + s3, positionAbove: m2, positionLeft: g2 };
}
if ("number" == typeof t2.left && "number" == typeof t2.top) {
var y2 = t2.left, b2 = t2.top, k2 = t2.width, w2 = void 0 === k2 ? 0 : k2, j2 = t2.height, x2 = void 0 === j2 ? 0 : j2;
return { left: y2, top: b2, positionAbove: b2 + x2 > window.innerHeight && b2 > x2, positionLeft: y2 + w2 > window.innerWidth && y2 > w2 };
}
throw new Error('Invalid config: pass either "left" and "top", or pass "anchor"');
}(), i2 = r2.left, o2 = r2.top, a2 = r2.positionAbove, s2 = r2.positionLeft;
return (a2 ? "bottom: ".concat(n2.top - o2, "px;") : "top: ".concat(o2 - n2.top, "px;")) + (s2 ? "right: ".concat(n2.left - i2, "px;") : "left: ".concat(i2 - n2.left, "px;"));
}
function ex(e18, t2, n2) {
var r2, i2, o2 = t2.popup, a2 = t2.closeAbsolutePopup;
function s2(e19) {
o2.options && o2.options.closeOnOuterClick && !Ij(e19.target, function(e20) {
return e20 === r2;
}) && a2(o2.id);
}
return Uo(function() {
i2 && i2.focus();
}), e18.$$set = function(e19) {
"popup" in e19 && n2(0, o2 = e19.popup), "closeAbsolutePopup" in e19 && n2(6, a2 = e19.closeAbsolutePopup);
}, [o2, r2, i2, function(e19) {
s2(e19);
}, function(e19) {
"Escape" === Hj(e19) && a2(o2.id);
}, function(e19) {
s2(e19);
}, a2, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(2, i2 = e19);
});
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(1, r2 = e19);
});
}];
}
var tx = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, ex, Yj, Ui, { popup: 0, closeAbsolutePopup: 6 }, Gj), r2;
}
return Li(n2);
}();
function nx(e18, t2, n2) {
var r2 = e18.slice();
return r2[6] = t2[n2], r2;
}
function rx(e18) {
var t2, n2;
return t2 = new tx({ props: { popup: e18[6], closeAbsolutePopup: e18[1] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
1 & n3 && (r2.popup = e19[6]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function ix(e18) {
for (var t2, n2, r2 = e18[0], i2 = [], o2 = 0; o2 < r2.length; o2 += 1)
i2[o2] = rx(nx(e18, r2, o2));
var a2 = function(e19) {
return ba(i2[e19], 1, 1, function() {
i2[e19] = null;
});
}, s2 = e18[3].default, u2 = Gi(s2, e18, e18[2], null);
return { c: function() {
for (var e19 = 0; e19 < i2.length; e19 += 1)
i2[e19].c();
t2 = ko(), u2 && u2.c();
}, m: function(e19, r3) {
for (var o3 = 0; o3 < i2.length; o3 += 1)
i2[o3].m(e19, r3);
vo(e19, t2, r3), u2 && u2.m(e19, r3), n2 = true;
}, p: function(e19, o3) {
var c2 = ki(o3, 1)[0];
if (3 & c2) {
var l2;
for (r2 = e19[0], l2 = 0; l2 < r2.length; l2 += 1) {
var f2 = nx(e19, r2, l2);
i2[l2] ? (i2[l2].p(f2, c2), ya(i2[l2], 1)) : (i2[l2] = rx(f2), i2[l2].c(), ya(i2[l2], 1), i2[l2].m(t2.parentNode, t2));
}
for (ma(), l2 = r2.length; l2 < i2.length; l2 += 1)
a2(l2);
ga();
}
u2 && u2.p && (!n2 || 4 & c2) && Zi(u2, s2, e19, e19[2], n2 ? Yi(s2, e19[2], c2, null) : Xi(e19[2]), null);
}, i: function(e19) {
if (!n2) {
for (var t3 = 0; t3 < r2.length; t3 += 1)
ya(i2[t3]);
ya(u2, e19), n2 = true;
}
}, o: function(e19) {
i2 = i2.filter(Boolean);
for (var t3 = 0; t3 < i2.length; t3 += 1)
ba(i2[t3]);
ba(u2, e19), n2 = false;
}, d: function(e19) {
mo(i2, e19), e19 && po(t2), u2 && u2.d(e19);
} };
}
function ox(e18, t2, n2) {
var r2 = t2.$$slots, i2 = void 0 === r2 ? {} : r2, o2 = t2.$$scope, a2 = Da("jsoneditor:AbsolutePopup"), s2 = [];
function u2(e19) {
var t3 = s2.findIndex(function(t4) {
return t4.id === e19;
});
if (-1 !== t3) {
var r3 = s2[t3];
r3.options.onClose && r3.options.onClose(), n2(0, s2 = s2.filter(function(t4) {
return t4.id !== e19;
}));
}
}
return Qo("absolute-popup", { openAbsolutePopup: function(e19, t3, r3) {
a2("open...", t3, r3);
var i3 = { id: cs(), component: e19, props: t3 || {}, options: r3 || {} };
return n2(0, s2 = [].concat(Ti(s2), [i3])), i3.id;
}, closeAbsolutePopup: u2 }), e18.$$set = function(e19) {
"$$scope" in e19 && n2(2, o2 = e19.$$scope);
}, e18.$$.update = function() {
1 & e18.$$.dirty && a2("popups", s2);
}, [s2, u2, o2, i2];
}
var ax = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, ox, ix, Ki, {}), r2;
}
return Li(n2);
}(), sx = { prefix: "fas", iconName: "caret-right", icon: [256, 512, [], "f0da", "M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"] }, ux = { prefix: "fas", iconName: "paste", icon: [512, 512, ["file-clipboard"], "f0ea", "M160 0c-23.7 0-44.4 12.9-55.4 32H48C21.5 32 0 53.5 0 80V400c0 26.5 21.5 48 48 48H192V176c0-44.2 35.8-80 80-80h48V80c0-26.5-21.5-48-48-48H215.4C204.4 12.9 183.7 0 160 0zM272 128c-26.5 0-48 21.5-48 48V448v16c0 26.5 21.5 48 48 48H464c26.5 0 48-21.5 48-48V256H416c-17.7 0-32-14.3-32-32V128H320 272zM160 88c-13.3 0-24-10.7-24-24s10.7-24 24-24s24 10.7 24 24s-10.7 24-24 24zm256 40v96h96l-96-96z"] }, cx = { prefix: "fas", iconName: "circle-notch", icon: [512, 512, [], "f1ce", "M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z"] }, lx = { prefix: "fas", iconName: "scissors", icon: [512, 512, [9984, 9986, 9988, "cut"], "f0c4", "M256 192l-39.5-39.5c4.9-12.6 7.5-26.2 7.5-40.5C224 50.1 173.9 0 112 0S0 50.1 0 112s50.1 112 112 112c14.3 0 27.9-2.7 40.5-7.5L192 256l-39.5 39.5c-12.6-4.9-26.2-7.5-40.5-7.5C50.1 288 0 338.1 0 400s50.1 112 112 112s112-50.1 112-112c0-14.3-2.7-27.9-7.5-40.5L499.2 76.8c7.1-7.1 7.1-18.5 0-25.6c-28.3-28.3-74.1-28.3-102.4 0L256 192zm22.6 150.6L396.8 460.8c28.3 28.3 74.1 28.3 102.4 0c7.1-7.1 7.1-18.5 0-25.6L342.6 278.6l-64 64zM160 112c0 26.5-21.5 48-48 48s-48-21.5-48-48s21.5-48 48-48s48 21.5 48 48zM112 448c-26.5 0-48-21.5-48-48s21.5-48 48-48s48 21.5 48 48s-21.5 48-48 48z"] }, fx = { prefix: "fas", iconName: "square-caret-down", icon: [448, 512, ["caret-square-down"], "f150", "M384 480c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0zM224 352c-6.7 0-13-2.8-17.6-7.7l-104-112c-6.5-7-8.2-17.2-4.4-25.9s12.5-14.4 22-14.4l208 0c9.5 0 18.2 5.7 22 14.4s2.1 18.9-4.4 25.9l-104 112c-4.5 4.9-10.9 7.7-17.6 7.7z"] }, hx = { prefix: "fas", iconName: "chevron-up", icon: [512, 512, [], "f077", "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"] }, dx = { prefix: "fas", iconName: "angle-right", icon: [320, 512, [8250], "f105", "M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"] }, vx = { prefix: "fas", iconName: "square-caret-up", icon: [448, 512, ["caret-square-up"], "f151", "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM224 160c6.7 0 13 2.8 17.6 7.7l104 112c6.5 7 8.2 17.2 4.4 25.9s-12.5 14.4-22 14.4H120c-9.5 0-18.2-5.7-22-14.4s-2.1-18.9 4.4-25.9l104-112c4.5-4.9 10.9-7.7 17.6-7.7z"] }, px = { prefix: "fas", iconName: "filter", icon: [512, 512, [], "f0b0", "M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"] }, mx = { prefix: "fas", iconName: "code", icon: [640, 512, [], "f121", "M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"] }, gx = { prefix: "fas", iconName: "wrench", icon: [512, 512, [128295], "f0ad", "M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7H336c-8.8 0-16-7.2-16-16V118.6c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 456c-13.3 0-24-10.7-24-24s10.7-24 24-24s24 10.7 24 24s-10.7 24-24 24z"] }, yx = { prefix: "fas", iconName: "pen", icon: [512, 512, [128394], "f304", "M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"] }, bx = { prefix: "fas", iconName: "arrow-rotate-right", icon: [512, 512, [8635, "arrow-right-rotate", "arrow-rotate-forward", "redo"], "f01e", "M386.3 160H336c-17.7 0-32 14.3-32 32s14.3 32 32 32H464c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"] }, kx = { prefix: "fas", iconName: "arrow-rotate-left", icon: [512, 512, [8634, "arrow-left-rotate", "arrow-rotate-back", "arrow-rotate-backward", "undo"], "f0e2", "M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"] }, wx = { prefix: "fas", iconName: "crop-simple", icon: [512, 512, ["crop-alt"], "f565", "M128 32c0-17.7-14.3-32-32-32S64 14.3 64 32V64H32C14.3 64 0 78.3 0 96s14.3 32 32 32H64V384c0 35.3 28.7 64 64 64H352V384H128V32zM384 480c0 17.7 14.3 32 32 32s32-14.3 32-32V448h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H448l0-256c0-35.3-28.7-64-64-64L160 64v64l224 0 0 352z"] }, jx = { prefix: "fas", iconName: "gear", icon: [512, 512, [9881, "cog"], "f013", "M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336c44.2 0 80-35.8 80-80s-35.8-80-80-80s-80 35.8-80 80s35.8 80 80 80z"] }, xx = { prefix: "fas", iconName: "caret-down", icon: [320, 512, [], "f0d7", "M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"] }, Sx = { prefix: "fas", iconName: "ellipsis-vertical", icon: [128, 512, ["ellipsis-v"], "f142", "M64 360c30.9 0 56 25.1 56 56s-25.1 56-56 56s-56-25.1-56-56s25.1-56 56-56zm0-160c30.9 0 56 25.1 56 56s-25.1 56-56 56s-56-25.1-56-56s25.1-56 56-56zM120 96c0 30.9-25.1 56-56 56S8 126.9 8 96S33.1 40 64 40s56 25.1 56 56z"] }, _x = { prefix: "fas", iconName: "arrow-down-short-wide", icon: [576, 512, ["sort-amount-desc", "sort-amount-down-alt"], "f884", "M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 128H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32s14.3-32 32-32z"] }, Cx = { prefix: "fas", iconName: "angle-down", icon: [448, 512, [8964], "f107", "M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"] }, $x = { prefix: "fas", iconName: "arrow-down", icon: [384, 512, [8595], "f063", "M169.4 470.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 370.8 224 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L54.6 265.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"] }, Ox = { prefix: "fas", iconName: "magnifying-glass", icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352c79.5 0 144-64.5 144-144s-64.5-144-144-144S64 128.5 64 208s64.5 144 144 144z"] }, Mx = { prefix: "fas", iconName: "chevron-down", icon: [512, 512, [], "f078", "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"] }, Ex = { prefix: "fas", iconName: "copy", icon: [512, 512, [], "f0c5", "M224 0c-35.3 0-64 28.7-64 64V288c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H224zM64 160c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H288c35.3 0 64-28.7 64-64V384H288v64H64V224h64V160H64z"] }, Px = { prefix: "fas", iconName: "xmark", icon: [320, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"] }, Ax = { prefix: "fas", iconName: "clone", icon: [512, 512, [], "f24d", "M0 448c0 35.3 28.7 64 64 64H288c35.3 0 64-28.7 64-64V384H224c-53 0-96-43-96-96V160H64c-35.3 0-64 28.7-64 64V448zm224-96H448c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H224c-35.3 0-64 28.7-64 64V288c0 35.3 28.7 64 64 64z"] }, Tx = { prefix: "fas", iconName: "check", icon: [512, 512, [10003, 10004], "f00c", "M470.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L192 338.7 425.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"] }, Ix = { prefix: "fas", iconName: "triangle-exclamation", icon: [512, 512, [9888, "exclamation-triangle", "warning"], "f071", "M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32z"] };
function Nx(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1e3;
if (e18 < 0.9 * t2)
return e18.toFixed() + " B";
var n2 = e18 / t2;
if (n2 < 0.9 * t2)
return n2.toFixed(1) + " KB";
var r2 = n2 / t2;
if (r2 < 0.9 * t2)
return r2.toFixed(1) + " MB";
var i2 = r2 / t2;
if (i2 < 0.9 * t2)
return i2.toFixed(1) + " GB";
var o2 = i2 / t2;
return o2.toFixed(1) + " TB";
}
var Rx = Da("jsoneditor:FocusTracker");
function Dx(e18) {
var t2, n2 = e18.onMount, r2 = e18.onDestroy, i2 = e18.getWindow, o2 = e18.hasFocus, a2 = e18.onFocus, s2 = e18.onBlur, u2 = false;
function c2() {
var e19 = o2();
e19 && (clearTimeout(t2), u2 || (Rx("focus"), a2(), u2 = e19));
}
function l2() {
u2 && (clearTimeout(t2), t2 = setTimeout(function() {
Rx("blur"), u2 = false, s2();
}));
}
n2(function() {
Rx("mount FocusTracker");
var e19 = i2();
e19 && (e19.addEventListener("focusin", c2, true), e19.addEventListener("focusout", l2, true));
}), r2(function() {
Rx("destroy FocusTracker");
var e19 = i2();
e19 && (e19.removeEventListener("focusin", c2, true), e19.removeEventListener("focusout", l2, true));
});
}
function Lx(e18) {
for (var t2, n2, r2 = [{ id: n2 = "path-" + e18[0] }, e18[1]], i2 = {}, o2 = 0; o2 < r2.length; o2 += 1)
i2 = Fi(i2, r2[o2]);
return { c: function() {
Co(t2 = yo("path"), i2);
}, m: function(e19, n3) {
vo(e19, t2, n3);
}, p: function(e19, o3) {
var a2 = ki(o3, 1)[0];
Co(t2, i2 = Ca(r2, [1 & a2 && n2 !== (n2 = "path-" + e19[0]) && { id: n2 }, 2 & a2 && e19[1]]));
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function zx(e18, t2, n2) {
var r2 = t2.id, i2 = t2.data, o2 = void 0 === i2 ? {} : i2;
return e18.$$set = function(e19) {
"id" in e19 && n2(0, r2 = e19.id), "data" in e19 && n2(1, o2 = e19.data);
}, [r2, o2];
}
var Bx = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, zx, Lx, Ui, { id: 0, data: 1 }), r2;
}
return Li(n2);
}();
function qx(e18) {
for (var t2, n2, r2 = [{ id: n2 = "polygon-" + e18[0] }, e18[1]], i2 = {}, o2 = 0; o2 < r2.length; o2 += 1)
i2 = Fi(i2, r2[o2]);
return { c: function() {
Co(t2 = yo("polygon"), i2);
}, m: function(e19, n3) {
vo(e19, t2, n3);
}, p: function(e19, o3) {
var a2 = ki(o3, 1)[0];
Co(t2, i2 = Ca(r2, [1 & a2 && n2 !== (n2 = "polygon-" + e19[0]) && { id: n2 }, 2 & a2 && e19[1]]));
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function Fx(e18, t2, n2) {
var r2 = t2.id, i2 = t2.data, o2 = void 0 === i2 ? {} : i2;
return e18.$$set = function(e19) {
"id" in e19 && n2(0, r2 = e19.id), "data" in e19 && n2(1, o2 = e19.data);
}, [r2, o2];
}
var Vx = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, Fx, qx, Ui, { id: 0, data: 1 }), r2;
}
return Li(n2);
}();
function Wx(e18) {
var t2;
return { c: function() {
t2 = yo("g");
}, m: function(n2, r2) {
vo(n2, t2, r2), t2.innerHTML = e18[0];
}, p: function(e19, n2) {
1 & ki(n2, 1)[0] && (t2.innerHTML = e19[0]);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function Hx(e18, t2, n2) {
var r2, i2 = 870711;
var o2 = t2.data;
function a2(e19) {
if (!e19 || !e19.raw)
return null;
var t3 = e19.raw, n3 = {};
return t3 = t3.replace(/\s(?:xml:)?id=["']?([^"')\s]+)/g, function(e20, t4) {
var r3 = "fa-".concat((i2 += 1).toString(16));
return n3[t4] = r3, ' id="'.concat(r3, '"');
}), t3 = t3.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g, function(e20, t4, r3, i3) {
var o3 = t4 || i3;
return o3 && n3[o3] ? "#".concat(n3[o3]) : e20;
}), t3;
}
return e18.$$set = function(e19) {
"data" in e19 && n2(1, o2 = e19.data);
}, e18.$$.update = function() {
2 & e18.$$.dirty && n2(0, r2 = a2(o2));
}, [r2, o2];
}
var Jx = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, Hx, Wx, Ui, { data: 1 }), r2;
}
return Li(n2);
}();
function Ux(e18) {
co(e18, "svelte-1dof0an", ".fa-icon.svelte-1dof0an{display:inline-block;fill:currentColor}.fa-flip-horizontal.svelte-1dof0an{transform:scale(-1, 1)}.fa-flip-vertical.svelte-1dof0an{transform:scale(1, -1)}.fa-spin.svelte-1dof0an{animation:svelte-1dof0an-fa-spin 1s 0s infinite linear}.fa-inverse.svelte-1dof0an{color:#fff}.fa-pulse.svelte-1dof0an{animation:svelte-1dof0an-fa-spin 1s infinite steps(8)}@keyframes svelte-1dof0an-fa-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}");
}
function Kx(e18) {
var t2, n2, r2, i2, o2 = e18[13].default, a2 = Gi(o2, e18, e18[12], null);
return { c: function() {
t2 = yo("svg"), a2 && a2.c(), So(t2, "version", "1.1"), So(t2, "class", n2 = "fa-icon " + e18[0] + " svelte-1dof0an"), So(t2, "x", e18[8]), So(t2, "y", e18[9]), So(t2, "width", e18[1]), So(t2, "height", e18[2]), So(t2, "aria-label", e18[11]), So(t2, "role", r2 = e18[11] ? "img" : "presentation"), So(t2, "viewBox", e18[3]), So(t2, "style", e18[10]), Io(t2, "fa-spin", e18[4]), Io(t2, "fa-pulse", e18[6]), Io(t2, "fa-inverse", e18[5]), Io(t2, "fa-flip-horizontal", "horizontal" === e18[7]), Io(t2, "fa-flip-vertical", "vertical" === e18[7]);
}, m: function(e19, n3) {
vo(e19, t2, n3), a2 && a2.m(t2, null), i2 = true;
}, p: function(e19, s2) {
var u2 = ki(s2, 1)[0];
a2 && a2.p && (!i2 || 4096 & u2) && Zi(a2, o2, e19, e19[12], i2 ? Yi(o2, e19[12], u2, null) : Xi(e19[12]), null), (!i2 || 1 & u2 && n2 !== (n2 = "fa-icon " + e19[0] + " svelte-1dof0an")) && So(t2, "class", n2), (!i2 || 256 & u2) && So(t2, "x", e19[8]), (!i2 || 512 & u2) && So(t2, "y", e19[9]), (!i2 || 2 & u2) && So(t2, "width", e19[1]), (!i2 || 4 & u2) && So(t2, "height", e19[2]), (!i2 || 2048 & u2) && So(t2, "aria-label", e19[11]), (!i2 || 2048 & u2 && r2 !== (r2 = e19[11] ? "img" : "presentation")) && So(t2, "role", r2), (!i2 || 8 & u2) && So(t2, "viewBox", e19[3]), (!i2 || 1024 & u2) && So(t2, "style", e19[10]), (!i2 || 17 & u2) && Io(t2, "fa-spin", e19[4]), (!i2 || 65 & u2) && Io(t2, "fa-pulse", e19[6]), (!i2 || 33 & u2) && Io(t2, "fa-inverse", e19[5]), (!i2 || 129 & u2) && Io(t2, "fa-flip-horizontal", "horizontal" === e19[7]), (!i2 || 129 & u2) && Io(t2, "fa-flip-vertical", "vertical" === e19[7]);
}, i: function(e19) {
i2 || (ya(a2, e19), i2 = true);
}, o: function(e19) {
ba(a2, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), a2 && a2.d(e19);
} };
}
function Gx(e18, t2, n2) {
var r2 = t2.$$slots, i2 = void 0 === r2 ? {} : r2, o2 = t2.$$scope, a2 = t2.class, s2 = t2.width, u2 = t2.height, c2 = t2.box, l2 = t2.spin, f2 = void 0 !== l2 && l2, h2 = t2.inverse, d2 = void 0 !== h2 && h2, v2 = t2.pulse, p2 = void 0 !== v2 && v2, m2 = t2.flip, g2 = void 0 === m2 ? null : m2, y2 = t2.x, b2 = void 0 === y2 ? void 0 : y2, k2 = t2.y, w2 = void 0 === k2 ? void 0 : k2, j2 = t2.style, x2 = void 0 === j2 ? void 0 : j2, S2 = t2.label, _2 = void 0 === S2 ? void 0 : S2;
return e18.$$set = function(e19) {
"class" in e19 && n2(0, a2 = e19.class), "width" in e19 && n2(1, s2 = e19.width), "height" in e19 && n2(2, u2 = e19.height), "box" in e19 && n2(3, c2 = e19.box), "spin" in e19 && n2(4, f2 = e19.spin), "inverse" in e19 && n2(5, d2 = e19.inverse), "pulse" in e19 && n2(6, p2 = e19.pulse), "flip" in e19 && n2(7, g2 = e19.flip), "x" in e19 && n2(8, b2 = e19.x), "y" in e19 && n2(9, w2 = e19.y), "style" in e19 && n2(10, x2 = e19.style), "label" in e19 && n2(11, _2 = e19.label), "$$scope" in e19 && n2(12, o2 = e19.$$scope);
}, [a2, s2, u2, c2, f2, d2, p2, g2, b2, w2, x2, _2, o2, i2];
}
var Qx = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, Gx, Kx, Ui, { class: 0, width: 1, height: 2, box: 3, spin: 4, inverse: 5, pulse: 6, flip: 7, x: 8, y: 9, style: 10, label: 11 }, Ux), r2;
}
return Li(n2);
}();
function Yx(e18, t2, n2) {
var r2 = e18.slice();
return r2[24] = t2[n2], r2[26] = n2, r2;
}
function Zx(e18, t2, n2) {
var r2 = e18.slice();
return r2[27] = t2[n2], r2[26] = n2, r2;
}
function Xx(e18) {
var t2, n2, r2, i2, o2 = e18[6].paths && eS(e18), a2 = e18[6].polygons && nS(e18), s2 = e18[6].raw && iS(e18);
return { c: function() {
o2 && o2.c(), t2 = ko(), a2 && a2.c(), n2 = ko(), s2 && s2.c(), r2 = wo();
}, m: function(e19, u2) {
o2 && o2.m(e19, u2), vo(e19, t2, u2), a2 && a2.m(e19, u2), vo(e19, n2, u2), s2 && s2.m(e19, u2), vo(e19, r2, u2), i2 = true;
}, p: function(e19, i3) {
e19[6].paths ? o2 ? (o2.p(e19, i3), 64 & i3 && ya(o2, 1)) : ((o2 = eS(e19)).c(), ya(o2, 1), o2.m(t2.parentNode, t2)) : o2 && (ma(), ba(o2, 1, 1, function() {
o2 = null;
}), ga()), e19[6].polygons ? a2 ? (a2.p(e19, i3), 64 & i3 && ya(a2, 1)) : ((a2 = nS(e19)).c(), ya(a2, 1), a2.m(n2.parentNode, n2)) : a2 && (ma(), ba(a2, 1, 1, function() {
a2 = null;
}), ga()), e19[6].raw ? s2 ? (s2.p(e19, i3), 64 & i3 && ya(s2, 1)) : ((s2 = iS(e19)).c(), ya(s2, 1), s2.m(r2.parentNode, r2)) : s2 && (ma(), ba(s2, 1, 1, function() {
s2 = null;
}), ga());
}, i: function(e19) {
i2 || (ya(o2), ya(a2), ya(s2), i2 = true);
}, o: function(e19) {
ba(o2), ba(a2), ba(s2), i2 = false;
}, d: function(e19) {
o2 && o2.d(e19), e19 && po(t2), a2 && a2.d(e19), e19 && po(n2), s2 && s2.d(e19), e19 && po(r2);
} };
}
function eS(e18) {
for (var t2, n2, r2 = e18[6].paths, i2 = [], o2 = 0; o2 < r2.length; o2 += 1)
i2[o2] = tS(Zx(e18, r2, o2));
var a2 = function(e19) {
return ba(i2[e19], 1, 1, function() {
i2[e19] = null;
});
};
return { c: function() {
for (var e19 = 0; e19 < i2.length; e19 += 1)
i2[e19].c();
t2 = wo();
}, m: function(e19, r3) {
for (var o3 = 0; o3 < i2.length; o3 += 1)
i2[o3].m(e19, r3);
vo(e19, t2, r3), n2 = true;
}, p: function(e19, n3) {
if (64 & n3) {
var o3;
for (r2 = e19[6].paths, o3 = 0; o3 < r2.length; o3 += 1) {
var s2 = Zx(e19, r2, o3);
i2[o3] ? (i2[o3].p(s2, n3), ya(i2[o3], 1)) : (i2[o3] = tS(s2), i2[o3].c(), ya(i2[o3], 1), i2[o3].m(t2.parentNode, t2));
}
for (ma(), o3 = r2.length; o3 < i2.length; o3 += 1)
a2(o3);
ga();
}
}, i: function(e19) {
if (!n2) {
for (var t3 = 0; t3 < r2.length; t3 += 1)
ya(i2[t3]);
n2 = true;
}
}, o: function(e19) {
i2 = i2.filter(Boolean);
for (var t3 = 0; t3 < i2.length; t3 += 1)
ba(i2[t3]);
n2 = false;
}, d: function(e19) {
mo(i2, e19), e19 && po(t2);
} };
}
function tS(e18) {
var t2, n2;
return t2 = new Bx({ props: { id: e18[26], data: e18[27] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
64 & n3 && (r2.data = e19[27]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function nS(e18) {
for (var t2, n2, r2 = e18[6].polygons, i2 = [], o2 = 0; o2 < r2.length; o2 += 1)
i2[o2] = rS(Yx(e18, r2, o2));
var a2 = function(e19) {
return ba(i2[e19], 1, 1, function() {
i2[e19] = null;
});
};
return { c: function() {
for (var e19 = 0; e19 < i2.length; e19 += 1)
i2[e19].c();
t2 = wo();
}, m: function(e19, r3) {
for (var o3 = 0; o3 < i2.length; o3 += 1)
i2[o3].m(e19, r3);
vo(e19, t2, r3), n2 = true;
}, p: function(e19, n3) {
if (64 & n3) {
var o3;
for (r2 = e19[6].polygons, o3 = 0; o3 < r2.length; o3 += 1) {
var s2 = Yx(e19, r2, o3);
i2[o3] ? (i2[o3].p(s2, n3), ya(i2[o3], 1)) : (i2[o3] = rS(s2), i2[o3].c(), ya(i2[o3], 1), i2[o3].m(t2.parentNode, t2));
}
for (ma(), o3 = r2.length; o3 < i2.length; o3 += 1)
a2(o3);
ga();
}
}, i: function(e19) {
if (!n2) {
for (var t3 = 0; t3 < r2.length; t3 += 1)
ya(i2[t3]);
n2 = true;
}
}, o: function(e19) {
i2 = i2.filter(Boolean);
for (var t3 = 0; t3 < i2.length; t3 += 1)
ba(i2[t3]);
n2 = false;
}, d: function(e19) {
mo(i2, e19), e19 && po(t2);
} };
}
function rS(e18) {
var t2, n2;
return t2 = new Vx({ props: { id: e18[26], data: e18[24] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
64 & n3 && (r2.data = e19[24]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function iS(e18) {
var t2, n2, r2;
function i2(t3) {
e18[15](t3);
}
var o2 = {};
return void 0 !== e18[6] && (o2.data = e18[6]), t2 = new Jx({ props: o2 }), Xo.push(function() {
return Oa(t2, "data", i2);
}), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, n3) {
Ea(t2, e19, n3), r2 = true;
}, p: function(e19, r3) {
var i3 = {};
!n2 && 64 & r3 && (n2 = true, i3.data = e19[6], sa(function() {
return n2 = false;
})), t2.$set(i3);
}, i: function(e19) {
r2 || (ya(t2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function oS(e18) {
var t2, n2 = e18[14].default, r2 = Gi(n2, e18, e18[16], null), i2 = r2 || function(e19) {
var t3, n3, r3 = e19[6] && Xx(e19);
return { c: function() {
r3 && r3.c(), t3 = wo();
}, m: function(e20, i3) {
r3 && r3.m(e20, i3), vo(e20, t3, i3), n3 = true;
}, p: function(e20, n4) {
e20[6] ? r3 ? (r3.p(e20, n4), 64 & n4 && ya(r3, 1)) : ((r3 = Xx(e20)).c(), ya(r3, 1), r3.m(t3.parentNode, t3)) : r3 && (ma(), ba(r3, 1, 1, function() {
r3 = null;
}), ga());
}, i: function(e20) {
n3 || (ya(r3), n3 = true);
}, o: function(e20) {
ba(r3), n3 = false;
}, d: function(e20) {
r3 && r3.d(e20), e20 && po(t3);
} };
}(e18);
return { c: function() {
i2 && i2.c();
}, m: function(e19, n3) {
i2 && i2.m(e19, n3), t2 = true;
}, p: function(e19, o2) {
r2 ? r2.p && (!t2 || 65536 & o2) && Zi(r2, n2, e19, e19[16], t2 ? Yi(n2, e19[16], o2, null) : Xi(e19[16]), null) : i2 && i2.p && (!t2 || 64 & o2) && i2.p(e19, t2 ? o2 : -1);
}, i: function(e19) {
t2 || (ya(i2, e19), t2 = true);
}, o: function(e19) {
ba(i2, e19), t2 = false;
}, d: function(e19) {
i2 && i2.d(e19);
} };
}
function aS(e18) {
var t2, n2;
return t2 = new Qx({ props: { label: e18[5], width: e18[7], height: e18[8], box: e18[10], style: e18[9], spin: e18[1], flip: e18[4], inverse: e18[2], pulse: e18[3], class: e18[0], $$slots: { default: [oS] }, $$scope: { ctx: e18 } } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = ki(n3, 1)[0], i2 = {};
32 & r2 && (i2.label = e19[5]), 128 & r2 && (i2.width = e19[7]), 256 & r2 && (i2.height = e19[8]), 1024 & r2 && (i2.box = e19[10]), 512 & r2 && (i2.style = e19[9]), 2 & r2 && (i2.spin = e19[1]), 16 & r2 && (i2.flip = e19[4]), 4 & r2 && (i2.inverse = e19[2]), 8 & r2 && (i2.pulse = e19[3]), 1 & r2 && (i2.class = e19[0]), 65600 & r2 && (i2.$$scope = { dirty: r2, ctx: e19 }), t2.$set(i2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function sS(e18, t2, n2) {
var r2, i2, o2, a2, s2 = t2.$$slots, u2 = void 0 === s2 ? {} : s2, c2 = t2.$$scope, l2 = t2.class, f2 = void 0 === l2 ? "" : l2, h2 = t2.data, d2 = t2.scale, v2 = void 0 === d2 ? 1 : d2, p2 = t2.spin, m2 = void 0 !== p2 && p2, g2 = t2.inverse, y2 = void 0 !== g2 && g2, b2 = t2.pulse, k2 = void 0 !== b2 && b2, w2 = t2.flip, j2 = void 0 === w2 ? null : w2, x2 = t2.label, S2 = void 0 === x2 ? null : x2, _2 = null, C2 = t2.style, $2 = void 0 === C2 ? null : C2;
function O2() {
var e19 = 1;
return void 0 !== v2 && (e19 = Number(v2)), isNaN(e19) || e19 <= 0 ? (console.warn('Invalid prop: prop "scale" should be a number over 0.'), 1) : 1 * e19;
}
function M2() {
return _2 ? Math.max(_2.width, _2.height) / 16 : 1;
}
return e18.$$set = function(e19) {
"class" in e19 && n2(0, f2 = e19.class), "data" in e19 && n2(11, h2 = e19.data), "scale" in e19 && n2(12, v2 = e19.scale), "spin" in e19 && n2(1, m2 = e19.spin), "inverse" in e19 && n2(2, y2 = e19.inverse), "pulse" in e19 && n2(3, k2 = e19.pulse), "flip" in e19 && n2(4, j2 = e19.flip), "label" in e19 && n2(5, S2 = e19.label), "style" in e19 && n2(13, $2 = e19.style), "$$scope" in e19 && n2(16, c2 = e19.$$scope);
}, e18.$$.update = function() {
14336 & e18.$$.dirty && (!function() {
if (void 0 !== h2) {
var e19 = function(e20) {
if ("iconName" in e20 && "icon" in e20) {
var t4 = {}, n3 = e20.icon, r3 = e20.iconName, i3 = { width: n3[0], height: n3[1], paths: [{ d: n3[4] }] };
return t4[r3] = i3, t4;
}
return e20;
}(h2), t3 = e19[ki(Object.keys(e19), 1)[0]];
t3.paths || (t3.paths = []), t3.d && t3.paths.push({ d: t3.d }), t3.polygons || (t3.polygons = []), t3.points && t3.polygons.push({ points: t3.points }), n2(6, _2 = t3);
}
}(), n2(7, r2 = _2 ? _2.width / M2() * O2() : 0), n2(8, i2 = _2 ? _2.height / M2() * O2() : 0), n2(9, o2 = function() {
var e19 = "";
null !== $2 && (e19 += $2);
var t3 = O2();
if (1 === t3) {
if (0 === e19.length)
return;
return e19;
}
return "" === e19 || e19.endsWith(";") || (e19 += "; "), "".concat(e19, "font-size: ").concat(t3, "em");
}()), n2(10, a2 = _2 ? "0 0 ".concat(_2.width, " ").concat(_2.height) : "0 0 ".concat(r2, " ").concat(i2)));
}, [f2, m2, y2, k2, j2, S2, _2, r2, i2, o2, a2, h2, v2, $2, u2, function(e19) {
n2(6, _2 = e19);
}, c2];
}
var uS = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, sS, aS, Ui, { class: 0, data: 11, scale: 12, spin: 1, inverse: 2, pulse: 3, flip: 4, label: 5, style: 13 }), r2;
}
return Li(n2);
}();
function cS(e18) {
co(e18, "svelte-kvi5ls", ".jse-message.svelte-kvi5ls.svelte-kvi5ls{font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);padding:var(--jse-padding);display:flex;gap:var(--jse-padding);flex-wrap:wrap;align-items:center}.jse-message.jse-success.svelte-kvi5ls.svelte-kvi5ls{background:var(--jse-message-success-background);color:var(--jse-message-success-color)}.jse-message.svelte-kvi5ls .jse-text.svelte-kvi5ls{flex:1;min-width:60%}.jse-message.svelte-kvi5ls .jse-text.jse-clickable.svelte-kvi5ls{cursor:pointer}.jse-message.svelte-kvi5ls .jse-text.jse-clickable.svelte-kvi5ls:hover{background-color:rgba(255, 255, 255, 0.1)}.jse-message.jse-error.svelte-kvi5ls.svelte-kvi5ls{background:var(--jse-message-error-background);color:var(--jse-message-error-color)}.jse-message.jse-warning.svelte-kvi5ls.svelte-kvi5ls{background:var(--jse-message-warning-background);color:var(--jse-message-warning-color)}.jse-message.jse-info.svelte-kvi5ls.svelte-kvi5ls{background:var(--jse-message-info-background);color:var(--jse-message-info-color)}.jse-message.svelte-kvi5ls .jse-actions.svelte-kvi5ls{display:flex;gap:var(--jse-padding)}.jse-message.svelte-kvi5ls .jse-actions button.jse-action.svelte-kvi5ls{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;background:var(--jse-message-action-background);color:inherit;padding:calc(0.5 * var(--jse-padding)) var(--jse-padding)}.jse-message.svelte-kvi5ls .jse-actions button.jse-action.svelte-kvi5ls:hover{background:var(--jse-message-action-background-highlight)}");
}
function lS(e18, t2, n2) {
var r2 = e18.slice();
return r2[8] = t2[n2], r2;
}
function fS(e18) {
var t2, n2;
return t2 = new uS({ props: { data: e18[1] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
2 & n3 && (r2.data = e19[1]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function hS(e18) {
var t2, n2;
return t2 = new uS({ props: { data: e18[8].icon } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
8 & n3 && (r2.data = e19[8].icon), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function dS(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2 = e18[8].text + "", f2 = e18[8].icon && hS(e18);
function h2() {
return e18[6](e18[8]);
}
function d2() {
return e18[7](e18[8]);
}
return { c: function() {
t2 = go("button"), f2 && f2.c(), n2 = ko(), r2 = bo(l2), i2 = ko(), So(t2, "type", "button"), So(t2, "class", "jse-button jse-action jse-primary svelte-kvi5ls"), So(t2, "title", o2 = e18[8].title), t2.disabled = a2 = e18[8].disabled;
}, m: function(e19, o3) {
vo(e19, t2, o3), f2 && f2.m(t2, null), uo(t2, n2), uo(t2, r2), uo(t2, i2), s2 = true, u2 || (c2 = [jo(t2, "click", h2), jo(t2, "mousedown", d2)], u2 = true);
}, p: function(i3, u3) {
(e18 = i3)[8].icon ? f2 ? (f2.p(e18, u3), 8 & u3 && ya(f2, 1)) : ((f2 = hS(e18)).c(), ya(f2, 1), f2.m(t2, n2)) : f2 && (ma(), ba(f2, 1, 1, function() {
f2 = null;
}), ga()), (!s2 || 8 & u3) && l2 !== (l2 = e18[8].text + "") && Mo(r2, l2), (!s2 || 8 & u3 && o2 !== (o2 = e18[8].title)) && So(t2, "title", o2), (!s2 || 8 & u3 && a2 !== (a2 = e18[8].disabled)) && (t2.disabled = a2);
}, i: function(e19) {
s2 || (ya(f2), s2 = true);
}, o: function(e19) {
ba(f2), s2 = false;
}, d: function(e19) {
e19 && po(t2), f2 && f2.d(), u2 = false, Hi(c2);
} };
}
function vS(e18) {
for (var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2 = e18[1] && fS(e18), h2 = e18[3], d2 = [], v2 = 0; v2 < h2.length; v2 += 1)
d2[v2] = dS(lS(e18, h2, v2));
var p2 = function(e19) {
return ba(d2[e19], 1, 1, function() {
d2[e19] = null;
});
};
return { c: function() {
t2 = go("div"), n2 = go("div"), f2 && f2.c(), r2 = ko(), i2 = bo(e18[2]), o2 = ko(), a2 = go("div");
for (var u3 = 0; u3 < d2.length; u3 += 1)
d2[u3].c();
So(n2, "class", "jse-text svelte-kvi5ls"), Io(n2, "jse-clickable", null !== e18[4]), So(a2, "class", "jse-actions svelte-kvi5ls"), So(t2, "class", s2 = "jse-message jse-" + e18[0] + " svelte-kvi5ls");
}, m: function(s3, h3) {
vo(s3, t2, h3), uo(t2, n2), f2 && f2.m(n2, null), uo(n2, r2), uo(n2, i2), uo(t2, o2), uo(t2, a2);
for (var v3 = 0; v3 < d2.length; v3 += 1)
d2[v3].m(a2, null);
u2 = true, c2 || (l2 = jo(n2, "click", e18[5]), c2 = true);
}, p: function(e19, o3) {
var c3 = ki(o3, 1)[0];
if (e19[1] ? f2 ? (f2.p(e19, c3), 2 & c3 && ya(f2, 1)) : ((f2 = fS(e19)).c(), ya(f2, 1), f2.m(n2, r2)) : f2 && (ma(), ba(f2, 1, 1, function() {
f2 = null;
}), ga()), (!u2 || 4 & c3) && Mo(i2, e19[2]), (!u2 || 16 & c3) && Io(n2, "jse-clickable", null !== e19[4]), 8 & c3) {
var l3;
for (h2 = e19[3], l3 = 0; l3 < h2.length; l3 += 1) {
var v3 = lS(e19, h2, l3);
d2[l3] ? (d2[l3].p(v3, c3), ya(d2[l3], 1)) : (d2[l3] = dS(v3), d2[l3].c(), ya(d2[l3], 1), d2[l3].m(a2, null));
}
for (ma(), l3 = h2.length; l3 < d2.length; l3 += 1)
p2(l3);
ga();
}
(!u2 || 1 & c3 && s2 !== (s2 = "jse-message jse-" + e19[0] + " svelte-kvi5ls")) && So(t2, "class", s2);
}, i: function(e19) {
if (!u2) {
ya(f2);
for (var t3 = 0; t3 < h2.length; t3 += 1)
ya(d2[t3]);
u2 = true;
}
}, o: function(e19) {
ba(f2), d2 = d2.filter(Boolean);
for (var t3 = 0; t3 < d2.length; t3 += 1)
ba(d2[t3]);
u2 = false;
}, d: function(e19) {
e19 && po(t2), f2 && f2.d(), mo(d2, e19), c2 = false, l2();
} };
}
function pS(e18, t2, n2) {
var r2 = t2.type, i2 = void 0 === r2 ? "success" : r2, o2 = t2.icon, a2 = void 0 === o2 ? void 0 : o2, s2 = t2.message, u2 = void 0 === s2 ? void 0 : s2, c2 = t2.actions, l2 = void 0 === c2 ? [] : c2, f2 = t2.onClick, h2 = void 0 === f2 ? void 0 : f2;
return e18.$$set = function(e19) {
"type" in e19 && n2(0, i2 = e19.type), "icon" in e19 && n2(1, a2 = e19.icon), "message" in e19 && n2(2, u2 = e19.message), "actions" in e19 && n2(3, l2 = e19.actions), "onClick" in e19 && n2(4, h2 = e19.onClick);
}, [i2, a2, u2, l2, h2, function() {
h2 && h2();
}, function(e19) {
e19.onClick && e19.onClick();
}, function(e19) {
e19.onMouseDown && e19.onMouseDown();
}];
}
var mS = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, pS, vS, Ki, { type: 0, icon: 1, message: 2, actions: 3, onClick: 4 }, cS), r2;
}
return Li(n2);
}();
function gS(e18) {
return e18.map(yS).join("");
}
function yS(e18) {
return wS.test(e18) ? "[" + e18 + "]" : kS.test(e18) ? "." + e18 : "[" + JSON.stringify(e18) + "]";
}
function bS(e18) {
return e18.map(function(e19) {
return wS.test(e19) ? "?.[".concat(e19, "]") : kS.test(e19) ? "?.".concat(e19) : "?.[".concat(JSON.stringify(e19), "]");
}).join("");
}
var kS = /^[A-z$_][A-z$_\d]*$/i, wS = /^\d+$/;
function jS(e18) {
co(e18, "svelte-1oe8e8r", ".jse-validation-errors-overview.svelte-1oe8e8r.svelte-1oe8e8r{font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);background:var(--jse-message-warning-background);color:var(--jse-message-warning-color);overflow:auto;max-height:25%}.jse-validation-errors-overview.svelte-1oe8e8r table.svelte-1oe8e8r{border-collapse:collapse;width:100%}.jse-validation-errors-overview.svelte-1oe8e8r table tr.svelte-1oe8e8r{cursor:pointer}.jse-validation-errors-overview.svelte-1oe8e8r table tr.svelte-1oe8e8r:hover{background-color:rgba(255, 255, 255, 0.1)}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.svelte-1oe8e8r{padding:4px var(--jse-padding);vertical-align:middle}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-icon.svelte-1oe8e8r{width:36px;box-sizing:border-box}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-action.svelte-1oe8e8r{width:36px;box-sizing:border-box;padding:0}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-action button.jse-validation-errors-collapse.svelte-1oe8e8r{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;width:36px;height:26px;cursor:pointer}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-action button.jse-validation-errors-collapse.svelte-1oe8e8r:hover{background-color:rgba(255, 255, 255, 0.2)}.jse-validation-errors-overview.svelte-1oe8e8r table tr td div.jse-validation-errors-expand.svelte-1oe8e8r{display:inline-block;position:relative;top:3px}");
}
function xS(e18, t2, n2) {
var r2 = e18.slice();
return r2[6] = t2[n2], r2[8] = n2, r2;
}
function SS(e18) {
var t2, n2, r2, i2, o2 = [CS, _S], a2 = [];
function s2(e19, t3) {
return e19[2] || 1 === e19[0].length ? 0 : 1;
}
return n2 = s2(e18), r2 = a2[n2] = o2[n2](e18), { c: function() {
t2 = go("div"), r2.c(), So(t2, "class", "jse-validation-errors-overview svelte-1oe8e8r");
}, m: function(e19, r3) {
vo(e19, t2, r3), a2[n2].m(t2, null), i2 = true;
}, p: function(e19, i3) {
var u2 = n2;
(n2 = s2(e19)) === u2 ? a2[n2].p(e19, i3) : (ma(), ba(a2[u2], 1, 1, function() {
a2[u2] = null;
}), ga(), (r2 = a2[n2]) ? r2.p(e19, i3) : (r2 = a2[n2] = o2[n2](e19)).c(), ya(r2, 1), r2.m(t2, null));
}, i: function(e19) {
i2 || (ya(r2), i2 = true);
}, o: function(e19) {
ba(r2), i2 = false;
}, d: function(e19) {
e19 && po(t2), a2[n2].d();
} };
}
function _S(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2 = e18[0].length + "";
return o2 = new uS({ props: { data: Ix } }), f2 = new uS({ props: { data: dx } }), { c: function() {
t2 = go("table"), n2 = go("tbody"), r2 = go("tr"), i2 = go("td"), Ma(o2.$$.fragment), a2 = ko(), s2 = go("td"), u2 = bo(p2), c2 = bo(" validation errors\n "), l2 = go("div"), Ma(f2.$$.fragment), So(i2, "class", "jse-validation-error-icon svelte-1oe8e8r"), So(l2, "class", "jse-validation-errors-expand svelte-1oe8e8r"), So(s2, "class", "svelte-1oe8e8r"), So(r2, "class", "jse-validation-error svelte-1oe8e8r"), So(t2, "class", "svelte-1oe8e8r");
}, m: function(p3, m2) {
vo(p3, t2, m2), uo(t2, n2), uo(n2, r2), uo(r2, i2), Ea(o2, i2, null), uo(r2, a2), uo(r2, s2), uo(s2, u2), uo(s2, c2), uo(s2, l2), Ea(f2, l2, null), h2 = true, d2 || (v2 = jo(r2, "click", e18[4]), d2 = true);
}, p: function(e19, t3) {
(!h2 || 1 & t3) && p2 !== (p2 = e19[0].length + "") && Mo(u2, p2);
}, i: function(e19) {
h2 || (ya(o2.$$.fragment, e19), ya(f2.$$.fragment, e19), h2 = true);
}, o: function(e19) {
ba(o2.$$.fragment, e19), ba(f2.$$.fragment, e19), h2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(o2), Pa(f2), d2 = false, v2();
} };
}
function CS(e18) {
for (var t2, n2, r2, i2 = e18[0], o2 = [], a2 = 0; a2 < i2.length; a2 += 1)
o2[a2] = OS(xS(e18, i2, a2));
var s2 = function(e19) {
return ba(o2[e19], 1, 1, function() {
o2[e19] = null;
});
};
return { c: function() {
t2 = go("table"), n2 = go("tbody");
for (var e19 = 0; e19 < o2.length; e19 += 1)
o2[e19].c();
So(t2, "class", "svelte-1oe8e8r");
}, m: function(e19, i3) {
vo(e19, t2, i3), uo(t2, n2);
for (var a3 = 0; a3 < o2.length; a3 += 1)
o2[a3].m(n2, null);
r2 = true;
}, p: function(e19, t3) {
if (11 & t3) {
var r3;
for (i2 = e19[0], r3 = 0; r3 < i2.length; r3 += 1) {
var a3 = xS(e19, i2, r3);
o2[r3] ? (o2[r3].p(a3, t3), ya(o2[r3], 1)) : (o2[r3] = OS(a3), o2[r3].c(), ya(o2[r3], 1), o2[r3].m(n2, null));
}
for (ma(), r3 = i2.length; r3 < o2.length; r3 += 1)
s2(r3);
ga();
}
}, i: function(e19) {
if (!r2) {
for (var t3 = 0; t3 < i2.length; t3 += 1)
ya(o2[t3]);
r2 = true;
}
}, o: function(e19) {
o2 = o2.filter(Boolean);
for (var t3 = 0; t3 < o2.length; t3 += 1)
ba(o2[t3]);
r2 = false;
}, d: function(e19) {
e19 && po(t2), mo(o2, e19);
} };
}
function $S(e18) {
var t2, n2, r2, i2, o2;
return n2 = new uS({ props: { data: Cx } }), { c: function() {
t2 = go("button"), Ma(n2.$$.fragment), So(t2, "type", "button"), So(t2, "class", "jse-validation-errors-collapse svelte-1oe8e8r"), So(t2, "title", "Collapse validation errors");
}, m: function(a2, s2) {
vo(a2, t2, s2), Ea(n2, t2, null), r2 = true, i2 || (o2 = jo(t2, "click", xo(e18[3])), i2 = true);
}, p: Bi, i: function(e19) {
r2 || (ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), i2 = false, o2();
} };
}
function OS(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2 = gS(e18[6].path) + "", g2 = e18[6].message + "";
r2 = new uS({ props: { data: Ix } });
var y2 = 0 === e18[8] && e18[0].length > 1 && $S(e18);
function b2() {
return e18[5](e18[6]);
}
return { c: function() {
t2 = go("tr"), n2 = go("td"), Ma(r2.$$.fragment), i2 = ko(), o2 = go("td"), a2 = bo(m2), s2 = ko(), u2 = go("td"), c2 = bo(g2), l2 = ko(), f2 = go("td"), y2 && y2.c(), h2 = ko(), So(n2, "class", "jse-validation-error-icon svelte-1oe8e8r"), So(o2, "class", "svelte-1oe8e8r"), So(u2, "class", "svelte-1oe8e8r"), So(f2, "class", "jse-validation-error-action svelte-1oe8e8r"), So(t2, "class", "jse-validation-error svelte-1oe8e8r");
}, m: function(e19, m3) {
vo(e19, t2, m3), uo(t2, n2), Ea(r2, n2, null), uo(t2, i2), uo(t2, o2), uo(o2, a2), uo(t2, s2), uo(t2, u2), uo(u2, c2), uo(t2, l2), uo(t2, f2), y2 && y2.m(f2, null), uo(t2, h2), d2 = true, v2 || (p2 = jo(t2, "click", b2), v2 = true);
}, p: function(t3, n3) {
e18 = t3, (!d2 || 1 & n3) && m2 !== (m2 = gS(e18[6].path) + "") && Mo(a2, m2), (!d2 || 1 & n3) && g2 !== (g2 = e18[6].message + "") && Mo(c2, g2), 0 === e18[8] && e18[0].length > 1 ? y2 ? (y2.p(e18, n3), 1 & n3 && ya(y2, 1)) : ((y2 = $S(e18)).c(), ya(y2, 1), y2.m(f2, null)) : y2 && (ma(), ba(y2, 1, 1, function() {
y2 = null;
}), ga());
}, i: function(e19) {
d2 || (ya(r2.$$.fragment, e19), ya(y2), d2 = true);
}, o: function(e19) {
ba(r2.$$.fragment, e19), ba(y2), d2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(r2), y2 && y2.d(), v2 = false, p2();
} };
}
function MS(e18) {
var t2, n2, r2 = !Mm(e18[0]), i2 = r2 && SS(e18);
return { c: function() {
i2 && i2.c(), t2 = wo();
}, m: function(e19, r3) {
i2 && i2.m(e19, r3), vo(e19, t2, r3), n2 = true;
}, p: function(e19, n3) {
var o2 = ki(n3, 1)[0];
1 & o2 && (r2 = !Mm(e19[0])), r2 ? i2 ? (i2.p(e19, o2), 1 & o2 && ya(i2, 1)) : ((i2 = SS(e19)).c(), ya(i2, 1), i2.m(t2.parentNode, t2)) : i2 && (ma(), ba(i2, 1, 1, function() {
i2 = null;
}), ga());
}, i: function(e19) {
n2 || (ya(i2), n2 = true);
}, o: function(e19) {
ba(i2), n2 = false;
}, d: function(e19) {
i2 && i2.d(e19), e19 && po(t2);
} };
}
function ES(e18, t2, n2) {
var r2 = t2.validationErrors, i2 = t2.selectError, o2 = true;
return e18.$$set = function(e19) {
"validationErrors" in e19 && n2(0, r2 = e19.validationErrors), "selectError" in e19 && n2(1, i2 = e19.selectError);
}, [r2, i2, o2, function() {
n2(2, o2 = false);
}, function() {
n2(2, o2 = true);
}, function(e19) {
setTimeout(function() {
return i2(e19);
});
}];
}
var PS = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, ES, MS, Ki, { validationErrors: 0, selectError: 1 }, jS), r2;
}
return Li(n2);
}(), AS = { prefix: "fas", iconName: "jsoneditor-expand", icon: [512, 512, [], null, "M 0,448 V 512 h 512 v -64 z M 0,0 V 64 H 512 V 0 Z M 256,96 128,224 h 256 z M 256,416 384,288 H 128 Z"] }, TS = { prefix: "fas", iconName: "jsoneditor-collapse", icon: [512, 512, [], null, "m 0,224 v 64 h 512 v -64 z M 256,192 384,64 H 128 Z M 256,320 128,448 h 256 z"] }, IS = { prefix: "fas", iconName: "jsoneditor-format", icon: [512, 512, [], null, "M 0,32 v 64 h 416 v -64 z M 160,160 v 64 h 352 v -64 z M 160,288 v 64 h 288 v -64 z M 0,416 v 64 h 320 v -64 z"] }, NS = { prefix: "fas", iconName: "jsoneditor-compact", icon: [512, 512, [], null, "M 0,32 v 64 h 512 v -64 z M 0,160 v 64 h 512 v -64 z M 0,288 v 64 h 352 v -64 z"] };
function RS(e18) {
co(e18, "svelte-v4jelk", ".jse-menu.svelte-v4jelk.svelte-v4jelk{background:var(--jse-theme-color);border-bottom:1px solid var(--jse-theme-color);color:var(--jse-menu-color);display:flex;flex-wrap:wrap;align-items:center;position:relative}.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk{width:var(--jse-menu-button-size);height:var(--jse-menu-button-size);border:none;background:transparent;color:inherit;cursor:pointer;padding:calc(0.5 * var(--jse-padding));margin:0;border-radius:0}.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk:hover,.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk:focus{background:var(--jse-theme-color-highlight)}.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk:disabled{color:var(--jse-menu-color);opacity:0.5;background:transparent}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk{border:1px solid var(--jse-menu-color);padding:0;margin:calc(0.5 * var(--jse-padding)) 0;height:calc(var(--jse-menu-button-size) - var(--jse-padding));width:40px}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk:not(.jse-last){border-right:none}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.jse-first.svelte-v4jelk{margin-left:calc(0.5 * var(--jse-padding))}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.jse-last.svelte-v4jelk{margin-right:calc(0.5 * var(--jse-padding))}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk:hover,.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk:focus{background:var(--jse-theme-color-highlight)}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.jse-selected.svelte-v4jelk{background:var(--jse-menu-color);color:var(--jse-theme-color)}.jse-menu.svelte-v4jelk .jse-space.svelte-v4jelk{flex:1}.jse-menu.svelte-v4jelk .jse-separator.svelte-v4jelk{background:var(--jse-menu-color);opacity:0.3;box-sizing:border-box;width:1px;height:calc(var(--jse-menu-button-size) - 6px);margin:3px}");
}
var DS = function(e18) {
return {};
}, LS = function(e18) {
return {};
};
function zS(e18, t2, n2) {
var r2 = e18.slice();
return r2[3] = t2[n2], r2;
}
var BS = function(e18) {
return {};
}, qS = function(e18) {
return {};
};
function FS(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2 = e18[3].icon && HS(e18), l2 = e18[3].text && JS(e18);
return { c: function() {
t2 = go("button"), c2 && c2.c(), n2 = ko(), l2 && l2.c(), So(t2, "type", "button"), So(t2, "class", r2 = "jse-button " + e18[3].className + " svelte-v4jelk"), So(t2, "title", i2 = e18[3].title), t2.disabled = o2 = e18[3].disabled || false;
}, m: function(r3, i3) {
vo(r3, t2, i3), c2 && c2.m(t2, null), uo(t2, n2), l2 && l2.m(t2, null), a2 = true, s2 || (u2 = jo(t2, "click", function() {
Ji(e18[3].onClick) && e18[3].onClick.apply(this, arguments);
}), s2 = true);
}, p: function(s3, u3) {
(e18 = s3)[3].icon ? c2 ? (c2.p(e18, u3), 1 & u3 && ya(c2, 1)) : ((c2 = HS(e18)).c(), ya(c2, 1), c2.m(t2, n2)) : c2 && (ma(), ba(c2, 1, 1, function() {
c2 = null;
}), ga()), e18[3].text ? l2 ? l2.p(e18, u3) : ((l2 = JS(e18)).c(), l2.m(t2, null)) : l2 && (l2.d(1), l2 = null), (!a2 || 1 & u3 && r2 !== (r2 = "jse-button " + e18[3].className + " svelte-v4jelk")) && So(t2, "class", r2), (!a2 || 1 & u3 && i2 !== (i2 = e18[3].title)) && So(t2, "title", i2), (!a2 || 1 & u3 && o2 !== (o2 = e18[3].disabled || false)) && (t2.disabled = o2);
}, i: function(e19) {
a2 || (ya(c2), a2 = true);
}, o: function(e19) {
ba(c2), a2 = false;
}, d: function(e19) {
e19 && po(t2), c2 && c2.d(), l2 && l2.d(), s2 = false, u2();
} };
}
function VS(e18) {
var t2;
return { c: function() {
So(t2 = go("div"), "class", "jse-space svelte-v4jelk");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, p: Bi, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function WS(e18) {
var t2;
return { c: function() {
So(t2 = go("div"), "class", "jse-separator svelte-v4jelk");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, p: Bi, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function HS(e18) {
var t2, n2;
return t2 = new uS({ props: { data: e18[3].icon } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
1 & n3 && (r2.data = e19[3].icon), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function JS(e18) {
var t2, n2 = e18[3].text + "";
return { c: function() {
t2 = bo(n2);
}, m: function(e19, n3) {
vo(e19, t2, n3);
}, p: function(e19, r2) {
1 & r2 && n2 !== (n2 = e19[3].text + "") && Mo(t2, n2);
}, d: function(e19) {
e19 && po(t2);
} };
}
function US(e18) {
var t2, n2, r2, i2, o2 = [WS, VS, FS], a2 = [];
function s2(e19, t3) {
return true === e19[3].separator ? 0 : true === e19[3].space ? 1 : 2;
}
return t2 = s2(e18), n2 = a2[t2] = o2[t2](e18), { c: function() {
n2.c(), r2 = wo();
}, m: function(e19, n3) {
a2[t2].m(e19, n3), vo(e19, r2, n3), i2 = true;
}, p: function(e19, i3) {
var u2 = t2;
(t2 = s2(e19)) === u2 ? a2[t2].p(e19, i3) : (ma(), ba(a2[u2], 1, 1, function() {
a2[u2] = null;
}), ga(), (n2 = a2[t2]) ? n2.p(e19, i3) : (n2 = a2[t2] = o2[t2](e19)).c(), ya(n2, 1), n2.m(r2.parentNode, r2));
}, i: function(e19) {
i2 || (ya(n2), i2 = true);
}, o: function(e19) {
ba(n2), i2 = false;
}, d: function(e19) {
a2[t2].d(e19), e19 && po(r2);
} };
}
function KS(e18) {
for (var t2, n2, r2, i2, o2 = e18[2].left, a2 = Gi(o2, e18, e18[1], qS), s2 = e18[0], u2 = [], c2 = 0; c2 < s2.length; c2 += 1)
u2[c2] = US(zS(e18, s2, c2));
var l2 = function(e19) {
return ba(u2[e19], 1, 1, function() {
u2[e19] = null;
});
}, f2 = e18[2].right, h2 = Gi(f2, e18, e18[1], LS);
return { c: function() {
t2 = go("div"), a2 && a2.c(), n2 = ko();
for (var e19 = 0; e19 < u2.length; e19 += 1)
u2[e19].c();
r2 = ko(), h2 && h2.c(), So(t2, "class", "jse-menu svelte-v4jelk");
}, m: function(e19, o3) {
vo(e19, t2, o3), a2 && a2.m(t2, null), uo(t2, n2);
for (var s3 = 0; s3 < u2.length; s3 += 1)
u2[s3].m(t2, null);
uo(t2, r2), h2 && h2.m(t2, null), i2 = true;
}, p: function(e19, n3) {
var c3 = ki(n3, 1)[0];
if (a2 && a2.p && (!i2 || 2 & c3) && Zi(a2, o2, e19, e19[1], i2 ? Yi(o2, e19[1], c3, BS) : Xi(e19[1]), qS), 1 & c3) {
var d2;
for (s2 = e19[0], d2 = 0; d2 < s2.length; d2 += 1) {
var v2 = zS(e19, s2, d2);
u2[d2] ? (u2[d2].p(v2, c3), ya(u2[d2], 1)) : (u2[d2] = US(v2), u2[d2].c(), ya(u2[d2], 1), u2[d2].m(t2, r2));
}
for (ma(), d2 = s2.length; d2 < u2.length; d2 += 1)
l2(d2);
ga();
}
h2 && h2.p && (!i2 || 2 & c3) && Zi(h2, f2, e19, e19[1], i2 ? Yi(f2, e19[1], c3, DS) : Xi(e19[1]), LS);
}, i: function(e19) {
if (!i2) {
ya(a2, e19);
for (var t3 = 0; t3 < s2.length; t3 += 1)
ya(u2[t3]);
ya(h2, e19), i2 = true;
}
}, o: function(e19) {
ba(a2, e19), u2 = u2.filter(Boolean);
for (var t3 = 0; t3 < u2.length; t3 += 1)
ba(u2[t3]);
ba(h2, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), a2 && a2.d(e19), mo(u2, e19), h2 && h2.d(e19);
} };
}
function GS(e18, t2, n2) {
var r2 = t2.$$slots, i2 = void 0 === r2 ? {} : r2, o2 = t2.$$scope, a2 = t2.items, s2 = void 0 === a2 ? [] : a2;
return e18.$$set = function(e19) {
"items" in e19 && n2(0, s2 = e19.items), "$$scope" in e19 && n2(1, o2 = e19.$$scope);
}, [s2, o2, i2];
}
var QS = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, GS, KS, Ki, { items: 0 }, RS), r2;
}
return Li(n2);
}();
function YS(e18) {
var t2, n2;
return t2 = new QS({ props: { items: e18[0] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
1 & ki(n3, 1)[0] && (r2.items = e19[0]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function ZS(e18, t2, n2) {
var r2, i2, o2 = t2.readOnly, a2 = void 0 !== o2 && o2, s2 = t2.onFormat, u2 = t2.onCompact, c2 = t2.onSort, l2 = t2.onTransform, f2 = t2.onToggleSearch, h2 = t2.onUndo, d2 = t2.onRedo, v2 = t2.canUndo, p2 = t2.canRedo, m2 = t2.canFormat, g2 = t2.canCompact, y2 = t2.canSort, b2 = t2.canTransform, k2 = t2.onRenderMenu, w2 = void 0 === k2 ? Yu : k2;
return e18.$$set = function(e19) {
"readOnly" in e19 && n2(1, a2 = e19.readOnly), "onFormat" in e19 && n2(2, s2 = e19.onFormat), "onCompact" in e19 && n2(3, u2 = e19.onCompact), "onSort" in e19 && n2(4, c2 = e19.onSort), "onTransform" in e19 && n2(5, l2 = e19.onTransform), "onToggleSearch" in e19 && n2(6, f2 = e19.onToggleSearch), "onUndo" in e19 && n2(7, h2 = e19.onUndo), "onRedo" in e19 && n2(8, d2 = e19.onRedo), "canUndo" in e19 && n2(9, v2 = e19.canUndo), "canRedo" in e19 && n2(10, p2 = e19.canRedo), "canFormat" in e19 && n2(11, m2 = e19.canFormat), "canCompact" in e19 && n2(12, g2 = e19.canCompact), "canSort" in e19 && n2(13, y2 = e19.canSort), "canTransform" in e19 && n2(14, b2 = e19.canTransform), "onRenderMenu" in e19 && n2(15, w2 = e19.onRenderMenu);
}, e18.$$.update = function() {
32766 & e18.$$.dirty && n2(16, r2 = a2 ? [{ space: true }] : [{ icon: IS, title: "Format JSON: add proper indentation and new lines (Ctrl+I)", className: "jse-format", onClick: s2, disabled: a2 || !m2 }, { icon: NS, title: "Compact JSON: remove all white spacing and new lines (Ctrl+Shift+I)", className: "jse-compact", onClick: u2, disabled: a2 || !g2 }, { separator: true }, { icon: _x, title: "Sort", className: "jse-sort", onClick: c2, disabled: a2 || !y2 }, { icon: px, title: "Transform contents (filter, sort, project)", className: "jse-transform", onClick: l2, disabled: a2 || !b2 }, { icon: Ox, title: "Search (Ctrl+F)", className: "jse-search", onClick: f2 }, { separator: true }, { icon: kx, title: "Undo (Ctrl+Z)", className: "jse-undo", onClick: h2, disabled: !v2 }, { icon: bx, title: "Redo (Ctrl+Shift+Z)", className: "jse-redo", onClick: d2, disabled: !p2 }, { space: true }]), 98304 & e18.$$.dirty && n2(0, i2 = w2("text", r2) || r2);
}, [i2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2, g2, y2, b2, w2, r2];
}
var XS = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, ZS, YS, Ki, { readOnly: 1, onFormat: 2, onCompact: 3, onSort: 4, onTransform: 5, onToggleSearch: 6, onUndo: 7, onRedo: 8, canUndo: 9, canRedo: 10, canFormat: 11, canCompact: 12, canSort: 13, canTransform: 14, onRenderMenu: 15 }), r2;
}
return Li(n2);
}(), e_ = function() {
function e18() {
Ri(this, e18);
}
return Li(e18, [{ key: "lineAt", value: function(e19) {
if (e19 < 0 || e19 > this.length)
throw new RangeError("Invalid position ".concat(e19, " in document of length ").concat(this.length));
return this.lineInner(e19, false, 1, 0);
} }, { key: "line", value: function(e19) {
if (e19 < 1 || e19 > this.lines)
throw new RangeError("Invalid line number ".concat(e19, " in ").concat(this.lines, "-line document"));
return this.lineInner(e19, true, 1, 0);
} }, { key: "replace", value: function(e19, t2, n2) {
var r2 = [];
return this.decompose(0, e19, r2, 2), n2.length && n2.decompose(0, n2.length, r2, 3), this.decompose(t2, this.length, r2, 1), n_.from(r2, this.length - (t2 - e19) + n2.length);
} }, { key: "append", value: function(e19) {
return this.replace(this.length, this.length, e19);
} }, { key: "slice", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length, n2 = [];
return this.decompose(e19, t2, n2, 0), n_.from(n2, t2 - e19);
} }, { key: "eq", value: function(e19) {
if (e19 == this)
return true;
if (e19.length != this.length || e19.lines != this.lines)
return false;
for (var t2 = this.scanIdentical(e19, 1), n2 = this.length - this.scanIdentical(e19, -1), r2 = new a_(this), i2 = new a_(e19), o2 = t2, a2 = t2; ; ) {
if (r2.next(o2), i2.next(o2), o2 = 0, r2.lineBreak != i2.lineBreak || r2.done != i2.done || r2.value != i2.value)
return false;
if (a2 += r2.value.length, r2.done || a2 >= n2)
return true;
}
} }, { key: "iter", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1;
return new a_(this, e19);
} }, { key: "iterRange", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length;
return new s_(this, e19, t2);
} }, { key: "iterLines", value: function(e19, t2) {
var n2;
if (null == e19)
n2 = this.iter();
else {
null == t2 && (t2 = this.lines + 1);
var r2 = this.line(e19).from;
n2 = this.iterRange(r2, Math.max(r2, t2 == this.lines + 1 ? this.length : t2 <= 1 ? 0 : this.line(t2 - 1).to));
}
return new u_(n2);
} }, { key: "toString", value: function() {
return this.sliceString(0);
} }, { key: "toJSON", value: function() {
var e19 = [];
return this.flatten(e19), e19;
} }], [{ key: "of", value: function(t2) {
if (0 == t2.length)
throw new RangeError("A document must have at least one line");
return 1 != t2.length || t2[0] ? t2.length <= 32 ? new t_(t2) : n_.from(t_.split(t2, [])) : e18.empty;
} }]), e18;
}(), t_ = function(e18) {
Ci(n2, e_);
var t2 = Oi(n2);
function n2(e19) {
var r2, i2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : r_(e19);
return Ri(this, n2), (r2 = t2.call(this)).text = e19, r2.length = i2, r2;
}
return Li(n2, [{ key: "lines", get: function() {
return this.text.length;
} }, { key: "children", get: function() {
return null;
} }, { key: "lineInner", value: function(e19, t3, n3, r2) {
for (var i2 = 0; ; i2++) {
var o2 = this.text[i2], a2 = r2 + o2.length;
if ((t3 ? n3 : a2) >= e19)
return new c_(r2, a2, n3, o2);
r2 = a2 + 1, n3++;
}
} }, { key: "decompose", value: function(e19, t3, r2, i2) {
var o2 = e19 <= 0 && t3 >= this.length ? this : new n2(o_(this.text, e19, t3), Math.min(t3, this.length) - Math.max(0, e19));
if (1 & i2) {
var a2 = r2.pop(), s2 = i_(o2.text, a2.text.slice(), 0, o2.length);
if (s2.length <= 32)
r2.push(new n2(s2, a2.length + o2.length));
else {
var u2 = s2.length >> 1;
r2.push(new n2(s2.slice(0, u2)), new n2(s2.slice(u2)));
}
} else
r2.push(o2);
} }, { key: "replace", value: function(e19, t3, r2) {
if (!(r2 instanceof n2))
return Si(Ai(n2.prototype), "replace", this).call(this, e19, t3, r2);
var i2 = i_(this.text, i_(r2.text, o_(this.text, 0, e19)), t3), o2 = this.length + r2.length - (t3 - e19);
return i2.length <= 32 ? new n2(i2, o2) : n_.from(n2.split(i2, []), o2);
} }, { key: "sliceString", value: function(e19) {
for (var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length, n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "\n", r2 = "", i2 = 0, o2 = 0; i2 <= t3 && o2 < this.text.length; o2++) {
var a2 = this.text[o2], s2 = i2 + a2.length;
i2 > e19 && o2 && (r2 += n3), e19 < s2 && t3 > i2 && (r2 += a2.slice(Math.max(0, e19 - i2), t3 - i2)), i2 = s2 + 1;
}
return r2;
} }, { key: "flatten", value: function(e19) {
var t3, n3 = bi(this.text);
try {
for (n3.s(); !(t3 = n3.n()).done; ) {
var r2 = t3.value;
e19.push(r2);
}
} catch (e20) {
n3.e(e20);
} finally {
n3.f();
}
} }, { key: "scanIdentical", value: function() {
return 0;
} }], [{ key: "split", value: function(e19, t3) {
var r2, i2 = [], o2 = -1, a2 = bi(e19);
try {
for (a2.s(); !(r2 = a2.n()).done; ) {
var s2 = r2.value;
i2.push(s2), o2 += s2.length + 1, 32 == i2.length && (t3.push(new n2(i2, o2)), i2 = [], o2 = -1);
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
return o2 > -1 && t3.push(new n2(i2, o2)), t3;
} }]), n2;
}(), n_ = function(e18) {
Ci(n2, e_);
var t2 = Oi(n2);
function n2(e19, r2) {
var i2;
Ri(this, n2), (i2 = t2.call(this)).children = e19, i2.length = r2, i2.lines = 0;
var o2, a2 = bi(e19);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
i2.lines += s2.lines;
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
return i2;
}
return Li(n2, [{ key: "lineInner", value: function(e19, t3, n3, r2) {
for (var i2 = 0; ; i2++) {
var o2 = this.children[i2], a2 = r2 + o2.length, s2 = n3 + o2.lines - 1;
if ((t3 ? s2 : a2) >= e19)
return o2.lineInner(e19, t3, n3, r2);
r2 = a2 + 1, n3 = s2 + 1;
}
} }, { key: "decompose", value: function(e19, t3, n3, r2) {
for (var i2 = 0, o2 = 0; o2 <= t3 && i2 < this.children.length; i2++) {
var a2 = this.children[i2], s2 = o2 + a2.length;
if (e19 <= s2 && t3 >= o2) {
var u2 = r2 & ((o2 <= e19 ? 1 : 0) | (s2 >= t3 ? 2 : 0));
o2 >= e19 && s2 <= t3 && !u2 ? n3.push(a2) : a2.decompose(e19 - o2, t3 - o2, n3, u2);
}
o2 = s2 + 1;
}
} }, { key: "replace", value: function(e19, t3, r2) {
if (r2.lines < this.lines)
for (var i2 = 0, o2 = 0; i2 < this.children.length; i2++) {
var a2 = this.children[i2], s2 = o2 + a2.length;
if (e19 >= o2 && t3 <= s2) {
var u2 = a2.replace(e19 - o2, t3 - o2, r2), c2 = this.lines - a2.lines + u2.lines;
if (u2.lines < c2 >> 4 && u2.lines > c2 >> 6) {
var l2 = this.children.slice();
return l2[i2] = u2, new n2(l2, this.length - (t3 - e19) + r2.length);
}
return Si(Ai(n2.prototype), "replace", this).call(this, o2, s2, u2);
}
o2 = s2 + 1;
}
return Si(Ai(n2.prototype), "replace", this).call(this, e19, t3, r2);
} }, { key: "sliceString", value: function(e19) {
for (var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.length, n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "\n", r2 = "", i2 = 0, o2 = 0; i2 < this.children.length && o2 <= t3; i2++) {
var a2 = this.children[i2], s2 = o2 + a2.length;
o2 > e19 && i2 && (r2 += n3), e19 < s2 && t3 > o2 && (r2 += a2.sliceString(e19 - o2, t3 - o2, n3)), o2 = s2 + 1;
}
return r2;
} }, { key: "flatten", value: function(e19) {
var t3, n3 = bi(this.children);
try {
for (n3.s(); !(t3 = n3.n()).done; ) {
t3.value.flatten(e19);
}
} catch (e20) {
n3.e(e20);
} finally {
n3.f();
}
} }, { key: "scanIdentical", value: function(e19, t3) {
if (!(e19 instanceof n2))
return 0;
for (var r2 = 0, i2 = ki(t3 > 0 ? [0, 0, this.children.length, e19.children.length] : [this.children.length - 1, e19.children.length - 1, -1, -1], 4), o2 = i2[0], a2 = i2[1], s2 = i2[2], u2 = i2[3]; ; o2 += t3, a2 += t3) {
if (o2 == s2 || a2 == u2)
return r2;
var c2 = this.children[o2], l2 = e19.children[a2];
if (c2 != l2)
return r2 + c2.scanIdentical(l2, t3);
r2 += c2.length + 1;
}
} }], [{ key: "from", value: function(e19) {
var t3, r2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19.reduce(function(e20, t4) {
return e20 + t4.length + 1;
}, -1), i2 = 0, o2 = bi(e19);
try {
for (o2.s(); !(t3 = o2.n()).done; ) {
var a2 = t3.value;
i2 += a2.lines;
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
if (i2 < 32) {
var s2, u2 = [], c2 = bi(e19);
try {
for (c2.s(); !(s2 = c2.n()).done; ) {
var l2 = s2.value;
l2.flatten(u2);
}
} catch (e20) {
c2.e(e20);
} finally {
c2.f();
}
return new t_(u2, r2);
}
var f2 = Math.max(32, i2 >> 5), h2 = f2 << 1, d2 = f2 >> 1, v2 = [], p2 = 0, m2 = -1, g2 = [];
function y2(e20) {
var t4;
if (e20.lines > h2 && e20 instanceof n2) {
var r3, i3 = bi(e20.children);
try {
for (i3.s(); !(r3 = i3.n()).done; ) {
y2(r3.value);
}
} catch (e21) {
i3.e(e21);
} finally {
i3.f();
}
} else
e20.lines > d2 && (p2 > d2 || !p2) ? (b2(), v2.push(e20)) : e20 instanceof t_ && p2 && (t4 = g2[g2.length - 1]) instanceof t_ && e20.lines + t4.lines <= 32 ? (p2 += e20.lines, m2 += e20.length + 1, g2[g2.length - 1] = new t_(t4.text.concat(e20.text), t4.length + 1 + e20.length)) : (p2 + e20.lines > f2 && b2(), p2 += e20.lines, m2 += e20.length + 1, g2.push(e20));
}
function b2() {
0 != p2 && (v2.push(1 == g2.length ? g2[0] : n2.from(g2, m2)), m2 = -1, p2 = g2.length = 0);
}
var k2, w2 = bi(e19);
try {
for (w2.s(); !(k2 = w2.n()).done; ) {
var j2 = k2.value;
y2(j2);
}
} catch (e20) {
w2.e(e20);
} finally {
w2.f();
}
return b2(), 1 == v2.length ? v2[0] : new n2(v2, r2);
} }]), n2;
}();
function r_(e18) {
var t2, n2 = -1, r2 = bi(e18);
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
n2 += t2.value.length + 1;
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
return n2;
}
function i_(e18, t2) {
for (var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e9, i2 = 0, o2 = 0, a2 = true; o2 < e18.length && i2 <= r2; o2++) {
var s2 = e18[o2], u2 = i2 + s2.length;
u2 >= n2 && (u2 > r2 && (s2 = s2.slice(0, r2 - i2)), i2 < n2 && (s2 = s2.slice(n2 - i2)), a2 ? (t2[t2.length - 1] += s2, a2 = false) : t2.push(s2)), i2 = u2 + 1;
}
return t2;
}
function o_(e18, t2, n2) {
return i_(e18, [""], t2, n2);
}
e_.empty = new t_([""], 0);
var a_ = function() {
function e18(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
Ri(this, e18), this.dir = n2, this.done = false, this.lineBreak = false, this.value = "", this.nodes = [t2], this.offsets = [n2 > 0 ? 1 : (t2 instanceof t_ ? t2.text.length : t2.children.length) << 1];
}
return Li(e18, [{ key: "nextInner", value: function(e19, t2) {
for (this.done = this.lineBreak = false; ; ) {
var n2 = this.nodes.length - 1, r2 = this.nodes[n2], i2 = this.offsets[n2], o2 = i2 >> 1, a2 = r2 instanceof t_ ? r2.text.length : r2.children.length;
if (o2 == (t2 > 0 ? a2 : 0)) {
if (0 == n2)
return this.done = true, this.value = "", this;
t2 > 0 && this.offsets[n2 - 1]++, this.nodes.pop(), this.offsets.pop();
} else if ((1 & i2) == (t2 > 0 ? 0 : 1)) {
if (this.offsets[n2] += t2, 0 == e19)
return this.lineBreak = true, this.value = "\n", this;
e19--;
} else if (r2 instanceof t_) {
var s2 = r2.text[o2 + (t2 < 0 ? -1 : 0)];
if (this.offsets[n2] += t2, s2.length > Math.max(0, e19))
return this.value = 0 == e19 ? s2 : t2 > 0 ? s2.slice(e19) : s2.slice(0, s2.length - e19), this;
e19 -= s2.length;
} else {
var u2 = r2.children[o2 + (t2 < 0 ? -1 : 0)];
e19 > u2.length ? (e19 -= u2.length, this.offsets[n2] += t2) : (t2 < 0 && this.offsets[n2]--, this.nodes.push(u2), this.offsets.push(t2 > 0 ? 1 : (u2 instanceof t_ ? u2.text.length : u2.children.length) << 1));
}
}
} }, { key: "next", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return e19 < 0 && (this.nextInner(-e19, -this.dir), e19 = this.value.length), this.nextInner(e19, this.dir);
} }]), e18;
}(), s_ = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.value = "", this.done = false, this.cursor = new a_(t2, n2 > r2 ? -1 : 1), this.pos = n2 > r2 ? t2.length : 0, this.from = Math.min(n2, r2), this.to = Math.max(n2, r2);
}
return Li(e18, [{ key: "nextInner", value: function(e19, t2) {
if (t2 < 0 ? this.pos <= this.from : this.pos >= this.to)
return this.value = "", this.done = true, this;
e19 += Math.max(0, t2 < 0 ? this.pos - this.to : this.from - this.pos);
var n2 = t2 < 0 ? this.pos - this.from : this.to - this.pos;
e19 > n2 && (e19 = n2), n2 -= e19;
var r2 = this.cursor.next(e19).value;
return this.pos += (r2.length + e19) * t2, this.value = r2.length <= n2 ? r2 : t2 < 0 ? r2.slice(r2.length - n2) : r2.slice(0, n2), this.done = !this.value, this;
} }, { key: "next", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return e19 < 0 ? e19 = Math.max(e19, this.from - this.pos) : e19 > 0 && (e19 = Math.min(e19, this.to - this.pos)), this.nextInner(e19, this.cursor.dir);
} }, { key: "lineBreak", get: function() {
return this.cursor.lineBreak && "" != this.value;
} }]), e18;
}(), u_ = function() {
function e18(t2) {
Ri(this, e18), this.inner = t2, this.afterBreak = true, this.value = "", this.done = false;
}
return Li(e18, [{ key: "next", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, t2 = this.inner.next(e19), n2 = t2.done, r2 = t2.lineBreak, i2 = t2.value;
return n2 ? (this.done = true, this.value = "") : r2 ? this.afterBreak ? this.value = "" : (this.afterBreak = true, this.next()) : (this.value = i2, this.afterBreak = false), this;
} }, { key: "lineBreak", get: function() {
return false;
} }]), e18;
}();
"undefined" != typeof Symbol && (e_.prototype[Symbol.iterator] = function() {
return this.iter();
}, a_.prototype[Symbol.iterator] = s_.prototype[Symbol.iterator] = u_.prototype[Symbol.iterator] = function() {
return this;
});
for (var c_ = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.from = t2, this.to = n2, this.number = r2, this.text = i2;
}
return Li(e18, [{ key: "length", get: function() {
return this.to - this.from;
} }]), e18;
}(), l_ = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function(e18) {
return e18 ? parseInt(e18, 36) : 1;
}), f_ = 1; f_ < l_.length; f_++)
l_[f_] += l_[f_ - 1];
function h_(e18) {
for (var t2 = 1; t2 < l_.length; t2 += 2)
if (l_[t2] > e18)
return l_[t2 - 1] <= e18;
return false;
}
function d_(e18) {
return e18 >= 127462 && e18 <= 127487;
}
function v_(e18, t2) {
var n2 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r2 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3];
return (n2 ? p_ : m_)(e18, t2, r2);
}
function p_(e18, t2, n2) {
if (t2 == e18.length)
return t2;
t2 && g_(e18.charCodeAt(t2)) && y_(e18.charCodeAt(t2 - 1)) && t2--;
var r2 = b_(e18, t2);
for (t2 += w_(r2); t2 < e18.length; ) {
var i2 = b_(e18, t2);
if (8205 == r2 || 8205 == i2 || n2 && h_(i2))
t2 += w_(i2), r2 = i2;
else {
if (!d_(i2))
break;
for (var o2 = 0, a2 = t2 - 2; a2 >= 0 && d_(b_(e18, a2)); )
o2++, a2 -= 2;
if (o2 % 2 == 0)
break;
t2 += 2;
}
}
return t2;
}
function m_(e18, t2, n2) {
for (; t2 > 0; ) {
var r2 = p_(e18, t2 - 2, n2);
if (r2 < t2)
return r2;
t2--;
}
return 0;
}
function g_(e18) {
return e18 >= 56320 && e18 < 57344;
}
function y_(e18) {
return e18 >= 55296 && e18 < 56320;
}
function b_(e18, t2) {
var n2 = e18.charCodeAt(t2);
if (!y_(n2) || t2 + 1 == e18.length)
return n2;
var r2 = e18.charCodeAt(t2 + 1);
return g_(r2) ? r2 - 56320 + (n2 - 55296 << 10) + 65536 : n2;
}
function k_(e18) {
return e18 <= 65535 ? String.fromCharCode(e18) : (e18 -= 65536, String.fromCharCode(55296 + (e18 >> 10), 56320 + (1023 & e18)));
}
function w_(e18) {
return e18 < 65536 ? 1 : 2;
}
var j_ = /\r\n?|\n/, x_ = function(e18) {
return e18[e18.Simple = 0] = "Simple", e18[e18.TrackDel = 1] = "TrackDel", e18[e18.TrackBefore = 2] = "TrackBefore", e18[e18.TrackAfter = 3] = "TrackAfter", e18;
}(x_ || (x_ = {})), S_ = function() {
function e18(t2) {
Ri(this, e18), this.sections = t2;
}
return Li(e18, [{ key: "length", get: function() {
for (var e19 = 0, t2 = 0; t2 < this.sections.length; t2 += 2)
e19 += this.sections[t2];
return e19;
} }, { key: "newLength", get: function() {
for (var e19 = 0, t2 = 0; t2 < this.sections.length; t2 += 2) {
var n2 = this.sections[t2 + 1];
e19 += n2 < 0 ? this.sections[t2] : n2;
}
return e19;
} }, { key: "empty", get: function() {
return 0 == this.sections.length || 2 == this.sections.length && this.sections[1] < 0;
} }, { key: "iterGaps", value: function(e19) {
for (var t2 = 0, n2 = 0, r2 = 0; t2 < this.sections.length; ) {
var i2 = this.sections[t2++], o2 = this.sections[t2++];
o2 < 0 ? (e19(n2, r2, i2), r2 += i2) : r2 += o2, n2 += i2;
}
} }, { key: "iterChangedRanges", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
O_(this, e19, t2);
} }, { key: "invertedDesc", get: function() {
for (var t2 = [], n2 = 0; n2 < this.sections.length; ) {
var r2 = this.sections[n2++], i2 = this.sections[n2++];
i2 < 0 ? t2.push(r2, i2) : t2.push(i2, r2);
}
return new e18(t2);
} }, { key: "composeDesc", value: function(e19) {
return this.empty ? e19 : e19.empty ? this : E_(this, e19);
} }, { key: "mapDesc", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return e19.empty ? this : M_(this, e19, t2);
} }, { key: "mapPos", value: function(e19) {
for (var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : x_.Simple, r2 = 0, i2 = 0, o2 = 0; o2 < this.sections.length; ) {
var a2 = this.sections[o2++], s2 = this.sections[o2++], u2 = r2 + a2;
if (s2 < 0) {
if (u2 > e19)
return i2 + (e19 - r2);
i2 += a2;
} else {
if (n2 != x_.Simple && u2 >= e19 && (n2 == x_.TrackDel && r2 < e19 && u2 > e19 || n2 == x_.TrackBefore && r2 < e19 || n2 == x_.TrackAfter && u2 > e19))
return null;
if (u2 > e19 || u2 == e19 && t2 < 0 && !a2)
return e19 == r2 || t2 < 0 ? i2 : i2 + s2;
i2 += s2;
}
r2 = u2;
}
if (e19 > r2)
throw new RangeError("Position ".concat(e19, " is out of range for changeset of length ").concat(r2));
return i2;
} }, { key: "touchesRange", value: function(e19) {
for (var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19, n2 = 0, r2 = 0; n2 < this.sections.length && r2 <= t2; ) {
var i2 = this.sections[n2++], o2 = this.sections[n2++], a2 = r2 + i2;
if (o2 >= 0 && r2 <= t2 && a2 >= e19)
return !(r2 < e19 && a2 > t2) || "cover";
r2 = a2;
}
return false;
} }, { key: "toString", value: function() {
for (var e19 = "", t2 = 0; t2 < this.sections.length; ) {
var n2 = this.sections[t2++], r2 = this.sections[t2++];
e19 += (e19 ? " " : "") + n2 + (r2 >= 0 ? ":" + r2 : "");
}
return e19;
} }, { key: "toJSON", value: function() {
return this.sections;
} }], [{ key: "fromJSON", value: function(t2) {
if (!Array.isArray(t2) || t2.length % 2 || t2.some(function(e19) {
return "number" != typeof e19;
}))
throw new RangeError("Invalid JSON representation of ChangeDesc");
return new e18(t2);
} }, { key: "create", value: function(t2) {
return new e18(t2);
} }]), e18;
}(), __ = function(e18) {
Ci(n2, S_);
var t2 = Oi(n2);
function n2(e19, r2) {
var i2;
return Ri(this, n2), (i2 = t2.call(this, e19)).inserted = r2, i2;
}
return Li(n2, [{ key: "apply", value: function(e19) {
if (this.length != e19.length)
throw new RangeError("Applying change set to a document with the wrong length");
return O_(this, function(t3, n3, r2, i2, o2) {
return e19 = e19.replace(r2, r2 + (n3 - t3), o2);
}, false), e19;
} }, { key: "mapDesc", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return M_(this, e19, t3, true);
} }, { key: "invert", value: function(e19) {
for (var t3 = this.sections.slice(), r2 = [], i2 = 0, o2 = 0; i2 < t3.length; i2 += 2) {
var a2 = t3[i2], s2 = t3[i2 + 1];
if (s2 >= 0) {
t3[i2] = s2, t3[i2 + 1] = a2;
for (var u2 = i2 >> 1; r2.length < u2; )
r2.push(e_.empty);
r2.push(a2 ? e19.slice(o2, o2 + a2) : e_.empty);
}
o2 += a2;
}
return new n2(t3, r2);
} }, { key: "compose", value: function(e19) {
return this.empty ? e19 : e19.empty ? this : E_(this, e19, true);
} }, { key: "map", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return e19.empty ? this : M_(this, e19, t3, true);
} }, { key: "iterChanges", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
O_(this, e19, t3);
} }, { key: "desc", get: function() {
return S_.create(this.sections);
} }, { key: "filter", value: function(e19) {
var t3 = [], r2 = [], i2 = [], o2 = new P_(this);
e:
for (var a2 = 0, s2 = 0; ; ) {
for (var u2 = a2 == e19.length ? 1e9 : e19[a2++]; s2 < u2 || s2 == u2 && 0 == o2.len; ) {
if (o2.done)
break e;
var c2 = Math.min(o2.len, u2 - s2);
C_(i2, c2, -1);
var l2 = -1 == o2.ins ? -1 : 0 == o2.off ? o2.ins : 0;
C_(t3, c2, l2), l2 > 0 && $_(r2, t3, o2.text), o2.forward(c2), s2 += c2;
}
for (var f2 = e19[a2++]; s2 < f2; ) {
if (o2.done)
break e;
var h2 = Math.min(o2.len, f2 - s2);
C_(t3, h2, -1), C_(i2, h2, -1 == o2.ins ? -1 : 0 == o2.off ? o2.ins : 0), o2.forward(h2), s2 += h2;
}
}
return { changes: new n2(t3, r2), filtered: S_.create(i2) };
} }, { key: "toJSON", value: function() {
for (var e19 = [], t3 = 0; t3 < this.sections.length; t3 += 2) {
var n3 = this.sections[t3], r2 = this.sections[t3 + 1];
r2 < 0 ? e19.push(n3) : 0 == r2 ? e19.push([n3]) : e19.push([n3].concat(this.inserted[t3 >> 1].toJSON()));
}
return e19;
} }], [{ key: "of", value: function(e19, t3, r2) {
var i2 = [], o2 = [], a2 = 0, s2 = null;
function u2() {
var e20 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (e20 || i2.length) {
a2 < t3 && C_(i2, t3 - a2, -1);
var r3 = new n2(i2, o2);
s2 = s2 ? s2.compose(r3.map(s2)) : r3, i2 = [], o2 = [], a2 = 0;
}
}
return function e20(c2) {
if (Array.isArray(c2)) {
var l2, f2 = bi(c2);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
e20(l2.value);
}
} catch (e21) {
f2.e(e21);
} finally {
f2.f();
}
} else if (c2 instanceof n2) {
if (c2.length != t3)
throw new RangeError("Mismatched change set length (got ".concat(c2.length, ", expected ").concat(t3, ")"));
u2(), s2 = s2 ? s2.compose(c2.map(s2)) : c2;
} else {
var h2 = c2.from, d2 = c2.to, v2 = void 0 === d2 ? h2 : d2, p2 = c2.insert;
if (h2 > v2 || h2 < 0 || v2 > t3)
throw new RangeError("Invalid change range ".concat(h2, " to ").concat(v2, " (in doc of length ").concat(t3, ")"));
var m2 = p2 ? "string" == typeof p2 ? e_.of(p2.split(r2 || j_)) : p2 : e_.empty, g2 = m2.length;
if (h2 == v2 && 0 == g2)
return;
h2 < a2 && u2(), h2 > a2 && C_(i2, h2 - a2, -1), C_(i2, v2 - h2, g2), $_(o2, i2, m2), a2 = v2;
}
}(e19), u2(!s2), s2;
} }, { key: "empty", value: function(e19) {
return new n2(e19 ? [e19, -1] : [], []);
} }, { key: "fromJSON", value: function(e19) {
if (!Array.isArray(e19))
throw new RangeError("Invalid JSON representation of ChangeSet");
for (var t3 = [], r2 = [], i2 = 0; i2 < e19.length; i2++) {
var o2 = e19[i2];
if ("number" == typeof o2)
t3.push(o2, -1);
else {
if (!Array.isArray(o2) || "number" != typeof o2[0] || o2.some(function(e20, t4) {
return t4 && "string" != typeof e20;
}))
throw new RangeError("Invalid JSON representation of ChangeSet");
if (1 == o2.length)
t3.push(o2[0], 0);
else {
for (; r2.length < i2; )
r2.push(e_.empty);
r2[i2] = e_.of(o2.slice(1)), t3.push(o2[0], r2[i2].length);
}
}
}
return new n2(t3, r2);
} }, { key: "createSet", value: function(e19, t3) {
return new n2(e19, t3);
} }]), n2;
}();
function C_(e18, t2, n2) {
var r2 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
if (!(0 == t2 && n2 <= 0)) {
var i2 = e18.length - 2;
i2 >= 0 && n2 <= 0 && n2 == e18[i2 + 1] ? e18[i2] += t2 : 0 == t2 && 0 == e18[i2] ? e18[i2 + 1] += n2 : r2 ? (e18[i2] += t2, e18[i2 + 1] += n2) : e18.push(t2, n2);
}
}
function $_(e18, t2, n2) {
if (0 != n2.length) {
var r2 = t2.length - 2 >> 1;
if (r2 < e18.length)
e18[e18.length - 1] = e18[e18.length - 1].append(n2);
else {
for (; e18.length < r2; )
e18.push(e_.empty);
e18.push(n2);
}
}
}
function O_(e18, t2, n2) {
for (var r2 = e18.inserted, i2 = 0, o2 = 0, a2 = 0; a2 < e18.sections.length; ) {
var s2 = e18.sections[a2++], u2 = e18.sections[a2++];
if (u2 < 0)
i2 += s2, o2 += s2;
else {
for (var c2 = i2, l2 = o2, f2 = e_.empty; c2 += s2, l2 += u2, u2 && r2 && (f2 = f2.append(r2[a2 - 2 >> 1])), !(n2 || a2 == e18.sections.length || e18.sections[a2 + 1] < 0); )
s2 = e18.sections[a2++], u2 = e18.sections[a2++];
t2(i2, c2, o2, l2, f2), i2 = c2, o2 = l2;
}
}
}
function M_(e18, t2, n2) {
for (var r2 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i2 = [], o2 = r2 ? [] : null, a2 = new P_(e18), s2 = new P_(t2), u2 = -1; ; )
if (-1 == a2.ins && -1 == s2.ins) {
var c2 = Math.min(a2.len, s2.len);
C_(i2, c2, -1), a2.forward(c2), s2.forward(c2);
} else if (s2.ins >= 0 && (a2.ins < 0 || u2 == a2.i || 0 == a2.off && (s2.len < a2.len || s2.len == a2.len && !n2))) {
var l2 = s2.len;
for (C_(i2, s2.ins, -1); l2; ) {
var f2 = Math.min(a2.len, l2);
a2.ins >= 0 && u2 < a2.i && a2.len <= f2 && (C_(i2, 0, a2.ins), o2 && $_(o2, i2, a2.text), u2 = a2.i), a2.forward(f2), l2 -= f2;
}
s2.next();
} else {
if (!(a2.ins >= 0)) {
if (a2.done && s2.done)
return o2 ? __.createSet(i2, o2) : S_.create(i2);
throw new Error("Mismatched change set lengths");
}
for (var h2 = 0, d2 = a2.len; d2; )
if (-1 == s2.ins) {
var v2 = Math.min(d2, s2.len);
h2 += v2, d2 -= v2, s2.forward(v2);
} else {
if (!(0 == s2.ins && s2.len < d2))
break;
d2 -= s2.len, s2.next();
}
C_(i2, h2, u2 < a2.i ? a2.ins : 0), o2 && u2 < a2.i && $_(o2, i2, a2.text), u2 = a2.i, a2.forward(a2.len - d2);
}
}
function E_(e18, t2) {
for (var n2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r2 = [], i2 = n2 ? [] : null, o2 = new P_(e18), a2 = new P_(t2), s2 = false; ; ) {
if (o2.done && a2.done)
return i2 ? __.createSet(r2, i2) : S_.create(r2);
if (0 == o2.ins)
C_(r2, o2.len, 0, s2), o2.next();
else if (0 != a2.len || a2.done) {
if (o2.done || a2.done)
throw new Error("Mismatched change set lengths");
var u2 = Math.min(o2.len2, a2.len), c2 = r2.length;
if (-1 == o2.ins) {
var l2 = -1 == a2.ins ? -1 : a2.off ? 0 : a2.ins;
C_(r2, u2, l2, s2), i2 && l2 && $_(i2, r2, a2.text);
} else
-1 == a2.ins ? (C_(r2, o2.off ? 0 : o2.len, u2, s2), i2 && $_(i2, r2, o2.textBit(u2))) : (C_(r2, o2.off ? 0 : o2.len, a2.off ? 0 : a2.ins, s2), i2 && !a2.off && $_(i2, r2, a2.text));
s2 = (o2.ins > u2 || a2.ins >= 0 && a2.len > u2) && (s2 || r2.length > c2), o2.forward2(u2), a2.forward(u2);
} else
C_(r2, 0, a2.ins, s2), i2 && $_(i2, r2, a2.text), a2.next();
}
}
var P_ = function() {
function e18(t2) {
Ri(this, e18), this.set = t2, this.i = 0, this.next();
}
return Li(e18, [{ key: "next", value: function() {
var e19 = this.set.sections;
this.i < e19.length ? (this.len = e19[this.i++], this.ins = e19[this.i++]) : (this.len = 0, this.ins = -2), this.off = 0;
} }, { key: "done", get: function() {
return -2 == this.ins;
} }, { key: "len2", get: function() {
return this.ins < 0 ? this.len : this.ins;
} }, { key: "text", get: function() {
var e19 = this.set.inserted, t2 = this.i - 2 >> 1;
return t2 >= e19.length ? e_.empty : e19[t2];
} }, { key: "textBit", value: function(e19) {
var t2 = this.set.inserted, n2 = this.i - 2 >> 1;
return n2 >= t2.length && !e19 ? e_.empty : t2[n2].slice(this.off, null == e19 ? void 0 : this.off + e19);
} }, { key: "forward", value: function(e19) {
e19 == this.len ? this.next() : (this.len -= e19, this.off += e19);
} }, { key: "forward2", value: function(e19) {
-1 == this.ins ? this.forward(e19) : e19 == this.ins ? this.next() : (this.ins -= e19, this.off += e19);
} }]), e18;
}(), A_ = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.from = t2, this.to = n2, this.flags = r2;
}
return Li(e18, [{ key: "anchor", get: function() {
return 16 & this.flags ? this.to : this.from;
} }, { key: "head", get: function() {
return 16 & this.flags ? this.from : this.to;
} }, { key: "empty", get: function() {
return this.from == this.to;
} }, { key: "assoc", get: function() {
return 4 & this.flags ? -1 : 8 & this.flags ? 1 : 0;
} }, { key: "bidiLevel", get: function() {
var e19 = 3 & this.flags;
return 3 == e19 ? null : e19;
} }, { key: "goalColumn", get: function() {
var e19 = this.flags >> 5;
return 33554431 == e19 ? void 0 : e19;
} }, { key: "map", value: function(t2) {
var n2, r2, i2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1;
return this.empty ? n2 = r2 = t2.mapPos(this.from, i2) : (n2 = t2.mapPos(this.from, 1), r2 = t2.mapPos(this.to, -1)), n2 == this.from && r2 == this.to ? this : new e18(n2, r2, this.flags);
} }, { key: "extend", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19;
if (e19 <= this.anchor && t2 >= this.anchor)
return T_.range(e19, t2);
var n2 = Math.abs(e19 - this.anchor) > Math.abs(t2 - this.anchor) ? e19 : t2;
return T_.range(this.anchor, n2);
} }, { key: "eq", value: function(e19) {
return this.anchor == e19.anchor && this.head == e19.head;
} }, { key: "toJSON", value: function() {
return { anchor: this.anchor, head: this.head };
} }], [{ key: "fromJSON", value: function(e19) {
if (!e19 || "number" != typeof e19.anchor || "number" != typeof e19.head)
throw new RangeError("Invalid JSON representation for SelectionRange");
return T_.range(e19.anchor, e19.head);
} }, { key: "create", value: function(t2, n2, r2) {
return new e18(t2, n2, r2);
} }]), e18;
}(), T_ = function() {
function e18(t2, n2) {
Ri(this, e18), this.ranges = t2, this.mainIndex = n2;
}
return Li(e18, [{ key: "map", value: function(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1;
return t2.empty ? this : e18.create(this.ranges.map(function(e19) {
return e19.map(t2, n2);
}), this.mainIndex);
} }, { key: "eq", value: function(e19) {
if (this.ranges.length != e19.ranges.length || this.mainIndex != e19.mainIndex)
return false;
for (var t2 = 0; t2 < this.ranges.length; t2++)
if (!this.ranges[t2].eq(e19.ranges[t2]))
return false;
return true;
} }, { key: "main", get: function() {
return this.ranges[this.mainIndex];
} }, { key: "asSingle", value: function() {
return 1 == this.ranges.length ? this : new e18([this.main], 0);
} }, { key: "addRange", value: function(t2) {
var n2 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
return e18.create([t2].concat(this.ranges), n2 ? 0 : this.mainIndex + 1);
} }, { key: "replaceRange", value: function(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.mainIndex, r2 = this.ranges.slice();
return r2[n2] = t2, e18.create(r2, this.mainIndex);
} }, { key: "toJSON", value: function() {
return { ranges: this.ranges.map(function(e19) {
return e19.toJSON();
}), main: this.mainIndex };
} }], [{ key: "fromJSON", value: function(t2) {
if (!t2 || !Array.isArray(t2.ranges) || "number" != typeof t2.main || t2.main >= t2.ranges.length)
throw new RangeError("Invalid JSON representation for EditorSelection");
return new e18(t2.ranges.map(function(e19) {
return A_.fromJSON(e19);
}), t2.main);
} }, { key: "single", value: function(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t2;
return new e18([e18.range(t2, n2)], 0);
} }, { key: "create", value: function(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
if (0 == t2.length)
throw new RangeError("A selection needs at least one range");
for (var r2 = 0, i2 = 0; i2 < t2.length; i2++) {
var o2 = t2[i2];
if (o2.empty ? o2.from <= r2 : o2.from < r2)
return e18.normalized(t2.slice(), n2);
r2 = o2.to;
}
return new e18(t2, n2);
} }, { key: "cursor", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n2 = arguments.length > 2 ? arguments[2] : void 0, r2 = arguments.length > 3 ? arguments[3] : void 0;
return A_.create(e19, e19, (0 == t2 ? 0 : t2 < 0 ? 4 : 8) | (null == n2 ? 3 : Math.min(2, n2)) | (null != r2 ? r2 : 33554431) << 5);
} }, { key: "range", value: function(e19, t2, n2) {
var r2 = (null != n2 ? n2 : 33554431) << 5;
return t2 < e19 ? A_.create(t2, e19, 24 | r2) : A_.create(e19, t2, r2 | (t2 > e19 ? 4 : 0));
} }, { key: "normalized", value: function(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r2 = t2[n2];
t2.sort(function(e19, t3) {
return e19.from - t3.from;
}), n2 = t2.indexOf(r2);
for (var i2 = 1; i2 < t2.length; i2++) {
var o2 = t2[i2], a2 = t2[i2 - 1];
if (o2.empty ? o2.from <= a2.to : o2.from < a2.to) {
var s2 = a2.from, u2 = Math.max(o2.to, a2.to);
i2 <= n2 && n2--, t2.splice(--i2, 2, o2.anchor > o2.head ? e18.range(u2, s2) : e18.range(s2, u2));
}
}
return new e18(t2, n2);
} }]), e18;
}();
function I_(e18, t2) {
var n2, r2 = bi(e18.ranges);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
if (n2.value.to > t2)
throw new RangeError("Selection points outside of document");
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
}
var N_ = 0, R_ = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.combine = t2, this.compareInput = n2, this.compare = r2, this.isStatic = i2, this.id = N_++, this.default = t2([]), this.extensions = "function" == typeof o2 ? o2(this) : o2;
}
return Li(e18, [{ key: "of", value: function(e19) {
return new L_([], this, 0, e19);
} }, { key: "compute", value: function(e19, t2) {
if (this.isStatic)
throw new Error("Can't compute a static facet");
return new L_(e19, this, 1, t2);
} }, { key: "computeN", value: function(e19, t2) {
if (this.isStatic)
throw new Error("Can't compute a static facet");
return new L_(e19, this, 2, t2);
} }, { key: "from", value: function(e19, t2) {
return t2 || (t2 = function(e20) {
return e20;
}), this.compute([e19], function(n2) {
return t2(n2.field(e19));
});
} }], [{ key: "define", value: function() {
var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return new e18(t2.combine || function(e19) {
return e19;
}, t2.compareInput || function(e19, t3) {
return e19 === t3;
}, t2.compare || (t2.combine ? function(e19, t3) {
return e19 === t3;
} : D_), !!t2.static, t2.enables);
} }]), e18;
}();
function D_(e18, t2) {
return e18 == t2 || e18.length == t2.length && e18.every(function(e19, n2) {
return e19 === t2[n2];
});
}
var L_ = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.dependencies = t2, this.facet = n2, this.type = r2, this.value = i2, this.id = N_++;
}
return Li(e18, [{ key: "dynamicSlot", value: function(e19) {
var t2, n2, r2 = this, i2 = this.value, o2 = this.facet.compareInput, a2 = this.id, s2 = e19[a2] >> 1, u2 = 2 == this.type, c2 = false, l2 = false, f2 = [], h2 = bi(this.dependencies);
try {
for (h2.s(); !(n2 = h2.n()).done; ) {
var d2 = n2.value;
"doc" == d2 ? c2 = true : "selection" == d2 ? l2 = true : 0 == (1 & (null !== (t2 = e19[d2.id]) && void 0 !== t2 ? t2 : 1)) && f2.push(e19[d2.id]);
}
} catch (e20) {
h2.e(e20);
} finally {
h2.f();
}
return { create: function(e20) {
return e20.values[s2] = i2(e20), 1;
}, update: function(e20, t3) {
if (c2 && t3.docChanged || l2 && (t3.docChanged || t3.selection) || B_(e20, f2)) {
var n3 = i2(e20);
if (u2 ? !z_(n3, e20.values[s2], o2) : !o2(n3, e20.values[s2]))
return e20.values[s2] = n3, 1;
}
return 0;
}, reconfigure: function(e20, t3) {
var n3 = i2(e20), c3 = t3.config.address[a2];
if (null != c3) {
var l3 = eC(t3, c3);
if (r2.dependencies.every(function(n4) {
return n4 instanceof R_ ? t3.facet(n4) === e20.facet(n4) : !(n4 instanceof F_) || t3.field(n4, false) == e20.field(n4, false);
}) || (u2 ? z_(n3, l3, o2) : o2(n3, l3)))
return e20.values[s2] = l3, 0;
}
return e20.values[s2] = n3, 1;
} };
} }]), e18;
}();
function z_(e18, t2, n2) {
if (e18.length != t2.length)
return false;
for (var r2 = 0; r2 < e18.length; r2++)
if (!n2(e18[r2], t2[r2]))
return false;
return true;
}
function B_(e18, t2) {
var n2, r2 = false, i2 = bi(t2);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
1 & X_(e18, n2.value) && (r2 = true);
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return r2;
}
var q_ = R_.define({ static: true }), F_ = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.id = t2, this.createF = n2, this.updateF = r2, this.compareF = i2, this.spec = o2, this.provides = void 0;
}
return Li(e18, [{ key: "create", value: function(e19) {
var t2 = this, n2 = e19.facet(q_).find(function(e20) {
return e20.field == t2;
});
return ((null == n2 ? void 0 : n2.create) || this.createF)(e19);
} }, { key: "slot", value: function(e19) {
var t2 = this, n2 = e19[this.id] >> 1;
return { create: function(e20) {
return e20.values[n2] = t2.create(e20), 1;
}, update: function(e20, r2) {
var i2 = e20.values[n2], o2 = t2.updateF(i2, r2);
return t2.compareF(i2, o2) ? 0 : (e20.values[n2] = o2, 1);
}, reconfigure: function(e20, r2) {
return null != r2.config.address[t2.id] ? (e20.values[n2] = r2.field(t2), 0) : (e20.values[n2] = t2.create(e20), 1);
} };
} }, { key: "init", value: function(e19) {
return [this, q_.of({ field: this, create: e19 })];
} }, { key: "extension", get: function() {
return this;
} }], [{ key: "define", value: function(t2) {
var n2 = new e18(N_++, t2.create, t2.update, t2.compare || function(e19, t3) {
return e19 === t3;
}, t2);
return t2.provide && (n2.provides = t2.provide(n2)), n2;
} }]), e18;
}(), V_ = 4, W_ = 3, H_ = 2, J_ = 1;
function U_(e18) {
return function(t2) {
return new G_(t2, e18);
};
}
var K_ = { highest: U_(0), high: U_(J_), default: U_(H_), low: U_(W_), lowest: U_(V_) }, G_ = Li(function e2(t2, n2) {
Ri(this, e2), this.inner = t2, this.prec = n2;
}), Q_ = function() {
function e18() {
Ri(this, e18);
}
return Li(e18, [{ key: "of", value: function(e19) {
return new Y_(this, e19);
} }, { key: "reconfigure", value: function(t2) {
return e18.reconfigure.of({ compartment: this, extension: t2 });
} }, { key: "get", value: function(e19) {
return e19.config.compartments.get(this);
} }]), e18;
}(), Y_ = Li(function e3(t2, n2) {
Ri(this, e3), this.compartment = t2, this.inner = n2;
}), Z_ = function() {
function e18(t2, n2, r2, i2, o2, a2) {
for (Ri(this, e18), this.base = t2, this.compartments = n2, this.dynamicSlots = r2, this.address = i2, this.staticValues = o2, this.facets = a2, this.statusTemplate = []; this.statusTemplate.length < r2.length; )
this.statusTemplate.push(0);
}
return Li(e18, [{ key: "staticFacet", value: function(e19) {
var t2 = this.address[e19.id];
return null == t2 ? e19.default : this.staticValues[t2 >> 1];
} }], [{ key: "resolve", value: function(t2, n2, r2) {
var i2, o2 = [], a2 = /* @__PURE__ */ Object.create(null), s2 = /* @__PURE__ */ new Map(), u2 = bi(function(e19, t3, n3) {
var r3 = [[], [], [], [], []], i3 = /* @__PURE__ */ new Map();
function o3(e20, a3) {
var s3 = i3.get(e20);
if (null != s3) {
if (s3 <= a3)
return;
var u3 = r3[s3].indexOf(e20);
u3 > -1 && r3[s3].splice(u3, 1), e20 instanceof Y_ && n3.delete(e20.compartment);
}
if (i3.set(e20, a3), Array.isArray(e20)) {
var c3, l3 = bi(e20);
try {
for (l3.s(); !(c3 = l3.n()).done; ) {
o3(c3.value, a3);
}
} catch (e21) {
l3.e(e21);
} finally {
l3.f();
}
} else if (e20 instanceof Y_) {
if (n3.has(e20.compartment))
throw new RangeError("Duplicate use of compartment in extensions");
var f3 = t3.get(e20.compartment) || e20.inner;
n3.set(e20.compartment, f3), o3(f3, a3);
} else if (e20 instanceof G_)
o3(e20.inner, e20.prec);
else if (e20 instanceof F_)
r3[a3].push(e20), e20.provides && o3(e20.provides, a3);
else if (e20 instanceof L_)
r3[a3].push(e20), e20.facet.extensions && o3(e20.facet.extensions, H_);
else {
var h3 = e20.extension;
if (!h3)
throw new Error("Unrecognized extension value in extension set (".concat(e20, "). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));
o3(h3, a3);
}
}
return o3(e19, H_), r3.reduce(function(e20, t4) {
return e20.concat(t4);
});
}(t2, n2, s2));
try {
for (u2.s(); !(i2 = u2.n()).done; ) {
var c2 = i2.value;
c2 instanceof F_ ? o2.push(c2) : (a2[c2.facet.id] || (a2[c2.facet.id] = [])).push(c2);
}
} catch (e19) {
u2.e(e19);
} finally {
u2.f();
}
for (var l2 = /* @__PURE__ */ Object.create(null), f2 = [], h2 = [], d2 = function() {
var e19 = p2[v2];
l2[e19.id] = h2.length << 1, h2.push(function(t3) {
return e19.slot(t3);
});
}, v2 = 0, p2 = o2; v2 < p2.length; v2++)
d2();
var m2 = null == r2 ? void 0 : r2.config.facets, g2 = function(e19) {
var t3 = a2[e19], n3 = t3[0].facet, i3 = m2 && m2[e19] || [];
if (t3.every(function(e20) {
return 0 == e20.type;
}))
if (l2[n3.id] = f2.length << 1 | 1, D_(i3, t3))
f2.push(r2.facet(n3));
else {
var o3 = n3.combine(t3.map(function(e20) {
return e20.value;
}));
f2.push(r2 && n3.compare(o3, r2.facet(n3)) ? r2.facet(n3) : o3);
}
else {
var s3, u3 = bi(t3);
try {
var c3 = function() {
var e20 = s3.value;
0 == e20.type ? (l2[e20.id] = f2.length << 1 | 1, f2.push(e20.value)) : (l2[e20.id] = h2.length << 1, h2.push(function(t4) {
return e20.dynamicSlot(t4);
}));
};
for (u3.s(); !(s3 = u3.n()).done; )
c3();
} catch (e20) {
u3.e(e20);
} finally {
u3.f();
}
l2[n3.id] = h2.length << 1, h2.push(function(e20) {
return function(e21, t4, n4) {
var r3 = n4.map(function(t5) {
return e21[t5.id];
}), i4 = n4.map(function(e22) {
return e22.type;
}), o4 = r3.filter(function(e22) {
return !(1 & e22);
}), a3 = e21[t4.id] >> 1;
function s4(e22) {
for (var n5 = [], o5 = 0; o5 < r3.length; o5++) {
var a4 = eC(e22, r3[o5]);
if (2 == i4[o5]) {
var s5, u4 = bi(a4);
try {
for (u4.s(); !(s5 = u4.n()).done; ) {
var c4 = s5.value;
n5.push(c4);
}
} catch (e23) {
u4.e(e23);
} finally {
u4.f();
}
} else
n5.push(a4);
}
return t4.combine(n5);
}
return { create: function(e22) {
var t5, n5 = bi(r3);
try {
for (n5.s(); !(t5 = n5.n()).done; )
X_(e22, t5.value);
} catch (e23) {
n5.e(e23);
} finally {
n5.f();
}
return e22.values[a3] = s4(e22), 1;
}, update: function(e22, n5) {
if (!B_(e22, o4))
return 0;
var r4 = s4(e22);
return t4.compare(r4, e22.values[a3]) ? 0 : (e22.values[a3] = r4, 1);
}, reconfigure: function(e22, i5) {
var o5 = B_(e22, r3), u4 = i5.config.facets[t4.id], c4 = i5.facet(t4);
if (u4 && !o5 && D_(n4, u4))
return e22.values[a3] = c4, 0;
var l3 = s4(e22);
return t4.compare(l3, c4) ? (e22.values[a3] = c4, 0) : (e22.values[a3] = l3, 1);
} };
}(e20, n3, t3);
});
}
};
for (var y2 in a2)
g2(y2);
return new e18(t2, s2, h2.map(function(e19) {
return e19(l2);
}), l2, f2, a2);
} }]), e18;
}();
function X_(e18, t2) {
if (1 & t2)
return 2;
var n2 = t2 >> 1, r2 = e18.status[n2];
if (4 == r2)
throw new Error("Cyclic dependency between fields and/or facets");
if (2 & r2)
return r2;
e18.status[n2] = 4;
var i2 = e18.computeSlot(e18, e18.config.dynamicSlots[n2]);
return e18.status[n2] = 2 | i2;
}
function eC(e18, t2) {
return 1 & t2 ? e18.config.staticValues[t2 >> 1] : e18.values[t2 >> 1];
}
var tC = R_.define(), nC = R_.define({ combine: function(e18) {
return e18.some(function(e19) {
return e19;
});
}, static: true }), rC = R_.define({ combine: function(e18) {
return e18.length ? e18[0] : void 0;
}, static: true }), iC = R_.define(), oC = R_.define(), aC = R_.define(), sC = R_.define({ combine: function(e18) {
return !!e18.length && e18[0];
} }), uC = function() {
function e18(t2, n2) {
Ri(this, e18), this.type = t2, this.value = n2;
}
return Li(e18, null, [{ key: "define", value: function() {
return new cC();
} }]), e18;
}(), cC = function() {
function e18() {
Ri(this, e18);
}
return Li(e18, [{ key: "of", value: function(e19) {
return new uC(this, e19);
} }]), e18;
}(), lC = function() {
function e18(t2) {
Ri(this, e18), this.map = t2;
}
return Li(e18, [{ key: "of", value: function(e19) {
return new fC(this, e19);
} }]), e18;
}(), fC = function() {
function e18(t2, n2) {
Ri(this, e18), this.type = t2, this.value = n2;
}
return Li(e18, [{ key: "map", value: function(t2) {
var n2 = this.type.map(this.value, t2);
return void 0 === n2 ? void 0 : n2 == this.value ? this : new e18(this.type, n2);
} }, { key: "is", value: function(e19) {
return this.type == e19;
} }], [{ key: "define", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return new lC(e19.map || function(e20) {
return e20;
});
} }, { key: "mapEffects", value: function(e19, t2) {
if (!e19.length)
return e19;
var n2, r2 = [], i2 = bi(e19);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value.map(t2);
o2 && r2.push(o2);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return r2;
} }]), e18;
}();
fC.reconfigure = fC.define(), fC.appendConfig = fC.define();
var hC = function() {
function e18(t2, n2, r2, i2, o2, a2) {
Ri(this, e18), this.startState = t2, this.changes = n2, this.selection = r2, this.effects = i2, this.annotations = o2, this.scrollIntoView = a2, this._doc = null, this._state = null, r2 && I_(r2, n2.newLength), o2.some(function(t3) {
return t3.type == e18.time;
}) || (this.annotations = o2.concat(e18.time.of(Date.now())));
}
return Li(e18, [{ key: "newDoc", get: function() {
return this._doc || (this._doc = this.changes.apply(this.startState.doc));
} }, { key: "newSelection", get: function() {
return this.selection || this.startState.selection.map(this.changes);
} }, { key: "state", get: function() {
return this._state || this.startState.applyTransaction(this), this._state;
} }, { key: "annotation", value: function(e19) {
var t2, n2 = bi(this.annotations);
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
var r2 = t2.value;
if (r2.type == e19)
return r2.value;
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
} }, { key: "docChanged", get: function() {
return !this.changes.empty;
} }, { key: "reconfigured", get: function() {
return this.startState.config != this.state.config;
} }, { key: "isUserEvent", value: function(t2) {
var n2 = this.annotation(e18.userEvent);
return !(!n2 || !(n2 == t2 || n2.length > t2.length && n2.slice(0, t2.length) == t2 && "." == n2[t2.length]));
} }], [{ key: "create", value: function(t2, n2, r2, i2, o2, a2) {
return new e18(t2, n2, r2, i2, o2, a2);
} }]), e18;
}();
function dC(e18, t2) {
for (var n2 = [], r2 = 0, i2 = 0; ; ) {
var o2 = void 0, a2 = void 0;
if (r2 < e18.length && (i2 == t2.length || t2[i2] >= e18[r2]))
o2 = e18[r2++], a2 = e18[r2++];
else {
if (!(i2 < t2.length))
return n2;
o2 = t2[i2++], a2 = t2[i2++];
}
!n2.length || n2[n2.length - 1] < o2 ? n2.push(o2, a2) : n2[n2.length - 1] < a2 && (n2[n2.length - 1] = a2);
}
}
function vC(e18, t2, n2) {
var r2, i2, o2, a2;
return n2 ? (i2 = t2.changes, o2 = __.empty(t2.changes.length), a2 = e18.changes.compose(t2.changes)) : (i2 = t2.changes.map(e18.changes), o2 = e18.changes.mapDesc(t2.changes, true), a2 = e18.changes.compose(i2)), { changes: a2, selection: t2.selection ? t2.selection.map(o2) : null === (r2 = e18.selection) || void 0 === r2 ? void 0 : r2.map(i2), effects: fC.mapEffects(e18.effects, i2).concat(fC.mapEffects(t2.effects, o2)), annotations: e18.annotations.length ? e18.annotations.concat(t2.annotations) : t2.annotations, scrollIntoView: e18.scrollIntoView || t2.scrollIntoView };
}
function pC(e18, t2, n2) {
var r2 = t2.selection, i2 = yC(t2.annotations);
return t2.userEvent && (i2 = i2.concat(hC.userEvent.of(t2.userEvent))), { changes: t2.changes instanceof __ ? t2.changes : __.of(t2.changes || [], n2, e18.facet(rC)), selection: r2 && (r2 instanceof T_ ? r2 : T_.single(r2.anchor, r2.head)), effects: yC(t2.effects), annotations: i2, scrollIntoView: !!t2.scrollIntoView };
}
function mC(e18, t2, n2) {
var r2 = pC(e18, t2.length ? t2[0] : {}, e18.doc.length);
t2.length && false === t2[0].filter && (n2 = false);
for (var i2 = 1; i2 < t2.length; i2++) {
false === t2[i2].filter && (n2 = false);
var o2 = !!t2[i2].sequential;
r2 = vC(r2, pC(e18, t2[i2], o2 ? r2.changes.newLength : e18.doc.length), o2);
}
var a2 = hC.create(e18, r2.changes, r2.selection, r2.effects, r2.annotations, r2.scrollIntoView);
return function(e19) {
for (var t3 = e19.startState, n3 = t3.facet(aC), r3 = e19, i3 = n3.length - 1; i3 >= 0; i3--) {
var o3 = n3[i3](e19);
o3 && Object.keys(o3).length && (r3 = vC(r3, pC(t3, o3, e19.changes.newLength), true));
}
return r3 == e19 ? e19 : hC.create(t3, e19.changes, e19.selection, r3.effects, r3.annotations, r3.scrollIntoView);
}(n2 ? function(e19) {
var t3, n3 = e19.startState, r3 = true, i3 = bi(n3.facet(iC));
try {
for (i3.s(); !(t3 = i3.n()).done; ) {
var o3 = (0, t3.value)(e19);
if (false === o3) {
r3 = false;
break;
}
Array.isArray(o3) && (r3 = true === r3 ? o3 : dC(r3, o3));
}
} catch (e20) {
i3.e(e20);
} finally {
i3.f();
}
if (true !== r3) {
var a3, s2;
if (false === r3)
s2 = e19.changes.invertedDesc, a3 = __.empty(n3.doc.length);
else {
var u2 = e19.changes.filter(r3);
a3 = u2.changes, s2 = u2.filtered.mapDesc(u2.changes).invertedDesc;
}
e19 = hC.create(n3, a3, e19.selection && e19.selection.map(s2), fC.mapEffects(e19.effects, s2), e19.annotations, e19.scrollIntoView);
}
for (var c2 = n3.facet(oC), l2 = c2.length - 1; l2 >= 0; l2--) {
var f2 = c2[l2](e19);
e19 = f2 instanceof hC ? f2 : Array.isArray(f2) && 1 == f2.length && f2[0] instanceof hC ? f2[0] : mC(n3, yC(f2), false);
}
return e19;
}(a2) : a2);
}
hC.time = uC.define(), hC.userEvent = uC.define(), hC.addToHistory = uC.define(), hC.remote = uC.define();
var gC = [];
function yC(e18) {
return null == e18 ? gC : Array.isArray(e18) ? e18 : [e18];
}
var bC, kC = function(e18) {
return e18[e18.Word = 0] = "Word", e18[e18.Space = 1] = "Space", e18[e18.Other = 2] = "Other", e18;
}(kC || (kC = {})), wC = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
try {
bC = new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u");
} catch (Jw2) {
}
function jC(e18) {
return function(t2) {
if (!/\S/.test(t2))
return kC.Space;
if (function(e19) {
if (bC)
return bC.test(e19);
for (var t3 = 0; t3 < e19.length; t3++) {
var n3 = e19[t3];
if (/\w/.test(n3) || n3 > "\x80" && (n3.toUpperCase() != n3.toLowerCase() || wC.test(n3)))
return true;
}
return false;
}(t2))
return kC.Word;
for (var n2 = 0; n2 < e18.length; n2++)
if (t2.indexOf(e18[n2]) > -1)
return kC.Word;
return kC.Other;
};
}
var xC = function() {
function e18(t2, n2, r2, i2, o2, a2) {
Ri(this, e18), this.config = t2, this.doc = n2, this.selection = r2, this.values = i2, this.status = t2.statusTemplate.slice(), this.computeSlot = o2, a2 && (a2._state = this);
for (var s2 = 0; s2 < this.config.dynamicSlots.length; s2++)
X_(this, s2 << 1);
this.computeSlot = null;
}
return Li(e18, [{ key: "field", value: function(e19) {
var t2 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n2 = this.config.address[e19.id];
if (null != n2)
return X_(this, n2), eC(this, n2);
if (t2)
throw new RangeError("Field is not present in this state");
} }, { key: "update", value: function() {
for (var e19 = arguments.length, t2 = new Array(e19), n2 = 0; n2 < e19; n2++)
t2[n2] = arguments[n2];
return mC(this, t2, true);
} }, { key: "applyTransaction", value: function(t2) {
var n2, r2, i2 = this, o2 = this.config, a2 = o2, s2 = a2.base, u2 = a2.compartments, c2 = bi(t2.effects);
try {
for (c2.s(); !(n2 = c2.n()).done; ) {
var l2 = n2.value;
l2.is(Q_.reconfigure) ? (o2 && (u2 = /* @__PURE__ */ new Map(), o2.compartments.forEach(function(e19, t3) {
return u2.set(t3, e19);
}), o2 = null), u2.set(l2.value.compartment, l2.value.extension)) : l2.is(fC.reconfigure) ? (o2 = null, s2 = l2.value) : l2.is(fC.appendConfig) && (o2 = null, s2 = yC(s2).concat(l2.value));
}
} catch (e19) {
c2.e(e19);
} finally {
c2.f();
}
o2 ? r2 = t2.startState.values.slice() : r2 = new e18(o2 = Z_.resolve(s2, u2, this), this.doc, this.selection, o2.dynamicSlots.map(function() {
return null;
}), function(e19, t3) {
return t3.reconfigure(e19, i2);
}, null).values;
new e18(o2, t2.newDoc, t2.newSelection, r2, function(e19, n3) {
return n3.update(e19, t2);
}, t2);
} }, { key: "replaceSelection", value: function(e19) {
return "string" == typeof e19 && (e19 = this.toText(e19)), this.changeByRange(function(t2) {
return { changes: { from: t2.from, to: t2.to, insert: e19 }, range: T_.cursor(t2.from + e19.length) };
});
} }, { key: "changeByRange", value: function(e19) {
for (var t2 = this.selection, n2 = e19(t2.ranges[0]), r2 = this.changes(n2.changes), i2 = [n2.range], o2 = yC(n2.effects), a2 = 1; a2 < t2.ranges.length; a2++) {
for (var s2 = e19(t2.ranges[a2]), u2 = this.changes(s2.changes), c2 = u2.map(r2), l2 = 0; l2 < a2; l2++)
i2[l2] = i2[l2].map(c2);
var f2 = r2.mapDesc(u2, true);
i2.push(s2.range.map(f2)), r2 = r2.compose(c2), o2 = fC.mapEffects(o2, c2).concat(fC.mapEffects(yC(s2.effects), f2));
}
return { changes: r2, selection: T_.create(i2, t2.mainIndex), effects: o2 };
} }, { key: "changes", value: function() {
var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
return t2 instanceof __ ? t2 : __.of(t2, this.doc.length, this.facet(e18.lineSeparator));
} }, { key: "toText", value: function(t2) {
return e_.of(t2.split(this.facet(e18.lineSeparator) || j_));
} }, { key: "sliceDoc", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0, t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.doc.length;
return this.doc.sliceString(e19, t2, this.lineBreak);
} }, { key: "facet", value: function(e19) {
var t2 = this.config.address[e19.id];
return null == t2 ? e19.default : (X_(this, t2), eC(this, t2));
} }, { key: "toJSON", value: function(e19) {
var t2 = { doc: this.sliceDoc(), selection: this.selection.toJSON() };
if (e19)
for (var n2 in e19) {
var r2 = e19[n2];
r2 instanceof F_ && null != this.config.address[r2.id] && (t2[n2] = r2.spec.toJSON(this.field(e19[n2]), this));
}
return t2;
} }, { key: "tabSize", get: function() {
return this.facet(e18.tabSize);
} }, { key: "lineBreak", get: function() {
return this.facet(e18.lineSeparator) || "\n";
} }, { key: "readOnly", get: function() {
return this.facet(sC);
} }, { key: "phrase", value: function(t2) {
for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), i2 = 1; i2 < n2; i2++)
r2[i2 - 1] = arguments[i2];
var o2, a2 = bi(this.facet(e18.phrases));
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
if (Object.prototype.hasOwnProperty.call(s2, t2)) {
t2 = s2[t2];
break;
}
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
return r2.length && (t2 = t2.replace(/\$(\$|\d*)/g, function(e19, t3) {
if ("$" == t3)
return "$";
var n3 = +(t3 || 1);
return !n3 || n3 > r2.length ? e19 : r2[n3 - 1];
})), t2;
} }, { key: "languageDataAt", value: function(e19, t2) {
var n2, r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1, i2 = [], o2 = bi(this.facet(tC));
try {
for (o2.s(); !(n2 = o2.n()).done; ) {
var a2, s2 = n2.value, u2 = bi(s2(this, t2, r2));
try {
for (u2.s(); !(a2 = u2.n()).done; ) {
var c2 = a2.value;
Object.prototype.hasOwnProperty.call(c2, e19) && i2.push(c2[e19]);
}
} catch (e20) {
u2.e(e20);
} finally {
u2.f();
}
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
return i2;
} }, { key: "charCategorizer", value: function(e19) {
return jC(this.languageDataAt("wordChars", e19).join(""));
} }, { key: "wordAt", value: function(e19) {
for (var t2 = this.doc.lineAt(e19), n2 = t2.text, r2 = t2.from, i2 = t2.length, o2 = this.charCategorizer(e19), a2 = e19 - r2, s2 = e19 - r2; a2 > 0; ) {
var u2 = v_(n2, a2, false);
if (o2(n2.slice(u2, a2)) != kC.Word)
break;
a2 = u2;
}
for (; s2 < i2; ) {
var c2 = v_(n2, s2);
if (o2(n2.slice(s2, c2)) != kC.Word)
break;
s2 = c2;
}
return a2 == s2 ? null : T_.range(a2 + r2, s2 + r2);
} }], [{ key: "fromJSON", value: function(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r2 = arguments.length > 2 ? arguments[2] : void 0;
if (!t2 || "string" != typeof t2.doc)
throw new RangeError("Invalid JSON representation for EditorState");
var i2 = [];
if (r2)
for (var o2 in r2)
Object.prototype.hasOwnProperty.call(t2, o2) && function() {
var e19 = r2[o2], n3 = t2[o2];
i2.push(e19.init(function(t3) {
return e19.spec.fromJSON(n3, t3);
}));
}();
return e18.create({ doc: t2.doc, selection: T_.fromJSON(t2.selection), extensions: n2.extensions ? i2.concat([n2.extensions]) : i2 });
} }, { key: "create", value: function() {
var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, n2 = Z_.resolve(t2.extensions || [], /* @__PURE__ */ new Map()), r2 = t2.doc instanceof e_ ? t2.doc : e_.of((t2.doc || "").split(n2.staticFacet(e18.lineSeparator) || j_)), i2 = t2.selection ? t2.selection instanceof T_ ? t2.selection : T_.single(t2.selection.anchor, t2.selection.head) : T_.single(0);
return I_(i2, r2.length), n2.staticFacet(nC) || (i2 = i2.asSingle()), new e18(n2, r2, i2, n2.dynamicSlots.map(function() {
return null;
}), function(e19, t3) {
return t3.create(e19);
}, null);
} }]), e18;
}();
function SC(e18, t2) {
var n2, r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i2 = {}, o2 = bi(e18);
try {
for (o2.s(); !(n2 = o2.n()).done; )
for (var a2 = n2.value, s2 = 0, u2 = Object.keys(a2); s2 < u2.length; s2++) {
var c2 = u2[s2], l2 = a2[c2], f2 = i2[c2];
if (void 0 === f2)
i2[c2] = l2;
else if (f2 === l2 || void 0 === l2)
;
else {
if (!Object.hasOwnProperty.call(r2, c2))
throw new Error("Config merge conflict for field " + c2);
i2[c2] = r2[c2](f2, l2);
}
}
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
for (var h2 in t2)
void 0 === i2[h2] && (i2[h2] = t2[h2]);
return i2;
}
xC.allowMultipleSelections = nC, xC.tabSize = R_.define({ combine: function(e18) {
return e18.length ? e18[0] : 4;
} }), xC.lineSeparator = rC, xC.readOnly = sC, xC.phrases = R_.define({ compare: function(e18, t2) {
var n2 = Object.keys(e18), r2 = Object.keys(t2);
return n2.length == r2.length && n2.every(function(n3) {
return e18[n3] == t2[n3];
});
} }), xC.languageData = tC, xC.changeFilter = iC, xC.transactionFilter = oC, xC.transactionExtender = aC, Q_.reconfigure = fC.define();
var _C = function() {
function e18() {
Ri(this, e18);
}
return Li(e18, [{ key: "eq", value: function(e19) {
return this == e19;
} }, { key: "range", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19;
return CC.create(e19, t2, this);
} }]), e18;
}();
_C.prototype.startSide = _C.prototype.endSide = 0, _C.prototype.point = false, _C.prototype.mapMode = x_.TrackDel;
var CC = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.from = t2, this.to = n2, this.value = r2;
}
return Li(e18, null, [{ key: "create", value: function(t2, n2, r2) {
return new e18(t2, n2, r2);
} }]), e18;
}();
function $C(e18, t2) {
return e18.from - t2.from || e18.value.startSide - t2.value.startSide;
}
var OC = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.from = t2, this.to = n2, this.value = r2, this.maxPoint = i2;
}
return Li(e18, [{ key: "length", get: function() {
return this.to[this.to.length - 1];
} }, { key: "findIndex", value: function(e19, t2, n2) {
for (var r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, i2 = n2 ? this.to : this.from, o2 = r2, a2 = i2.length; ; ) {
if (o2 == a2)
return o2;
var s2 = o2 + a2 >> 1, u2 = i2[s2] - e19 || (n2 ? this.value[s2].endSide : this.value[s2].startSide) - t2;
if (s2 == o2)
return u2 >= 0 ? o2 : a2;
u2 >= 0 ? a2 = s2 : o2 = s2 + 1;
}
} }, { key: "between", value: function(e19, t2, n2, r2) {
for (var i2 = this.findIndex(t2, -1e9, true), o2 = this.findIndex(n2, 1e9, false, i2); i2 < o2; i2++)
if (false === r2(this.from[i2] + e19, this.to[i2] + e19, this.value[i2]))
return false;
} }, { key: "map", value: function(t2, n2) {
for (var r2 = [], i2 = [], o2 = [], a2 = -1, s2 = -1, u2 = 0; u2 < this.value.length; u2++) {
var c2 = this.value[u2], l2 = this.from[u2] + t2, f2 = this.to[u2] + t2, h2 = void 0, d2 = void 0;
if (l2 == f2) {
var v2 = n2.mapPos(l2, c2.startSide, c2.mapMode);
if (null == v2)
continue;
if (h2 = d2 = v2, c2.startSide != c2.endSide && (d2 = n2.mapPos(l2, c2.endSide)) < h2)
continue;
} else if ((h2 = n2.mapPos(l2, c2.startSide)) > (d2 = n2.mapPos(f2, c2.endSide)) || h2 == d2 && c2.startSide > 0 && c2.endSide <= 0)
continue;
(d2 - h2 || c2.endSide - c2.startSide) < 0 || (a2 < 0 && (a2 = h2), c2.point && (s2 = Math.max(s2, d2 - h2)), r2.push(c2), i2.push(h2 - a2), o2.push(d2 - a2));
}
return { mapped: r2.length ? new e18(i2, o2, r2, s2) : null, pos: a2 };
} }]), e18;
}(), MC = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.chunkPos = t2, this.chunk = n2, this.nextLayer = r2, this.maxPoint = i2;
}
return Li(e18, [{ key: "length", get: function() {
var e19 = this.chunk.length - 1;
return e19 < 0 ? 0 : Math.max(this.chunkEnd(e19), this.nextLayer.length);
} }, { key: "size", get: function() {
if (this.isEmpty)
return 0;
var e19, t2 = this.nextLayer.size, n2 = bi(this.chunk);
try {
for (n2.s(); !(e19 = n2.n()).done; ) {
t2 += e19.value.value.length;
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
return t2;
} }, { key: "chunkEnd", value: function(e19) {
return this.chunkPos[e19] + this.chunk[e19].length;
} }, { key: "update", value: function(t2) {
var n2 = t2.add, r2 = void 0 === n2 ? [] : n2, i2 = t2.sort, o2 = void 0 !== i2 && i2, a2 = t2.filterFrom, s2 = void 0 === a2 ? 0 : a2, u2 = t2.filterTo, c2 = void 0 === u2 ? this.length : u2, l2 = t2.filter;
if (0 == r2.length && !l2)
return this;
if (o2 && (r2 = r2.slice().sort($C)), this.isEmpty)
return r2.length ? e18.of(r2) : this;
for (var f2 = new TC(this, null, -1).goto(0), h2 = 0, d2 = [], v2 = new PC(); f2.value || h2 < r2.length; )
if (h2 < r2.length && (f2.from - r2[h2].from || f2.startSide - r2[h2].value.startSide) >= 0) {
var p2 = r2[h2++];
v2.addInner(p2.from, p2.to, p2.value) || d2.push(p2);
} else
1 == f2.rangeIndex && f2.chunkIndex < this.chunk.length && (h2 == r2.length || this.chunkEnd(f2.chunkIndex) < r2[h2].from) && (!l2 || s2 > this.chunkEnd(f2.chunkIndex) || c2 < this.chunkPos[f2.chunkIndex]) && v2.addChunk(this.chunkPos[f2.chunkIndex], this.chunk[f2.chunkIndex]) ? f2.nextChunk() : ((!l2 || s2 > f2.to || c2 < f2.from || l2(f2.from, f2.to, f2.value)) && (v2.addInner(f2.from, f2.to, f2.value) || d2.push(CC.create(f2.from, f2.to, f2.value))), f2.next());
return v2.finishInner(this.nextLayer.isEmpty && !d2.length ? e18.empty : this.nextLayer.update({ add: d2, filter: l2, filterFrom: s2, filterTo: c2 }));
} }, { key: "map", value: function(t2) {
if (t2.empty || this.isEmpty)
return this;
for (var n2 = [], r2 = [], i2 = -1, o2 = 0; o2 < this.chunk.length; o2++) {
var a2 = this.chunkPos[o2], s2 = this.chunk[o2], u2 = t2.touchesRange(a2, a2 + s2.length);
if (false === u2)
i2 = Math.max(i2, s2.maxPoint), n2.push(s2), r2.push(t2.mapPos(a2));
else if (true === u2) {
var c2 = s2.map(a2, t2), l2 = c2.mapped, f2 = c2.pos;
l2 && (i2 = Math.max(i2, l2.maxPoint), n2.push(l2), r2.push(f2));
}
}
var h2 = this.nextLayer.map(t2);
return 0 == n2.length ? h2 : new e18(r2, n2, h2 || e18.empty, i2);
} }, { key: "between", value: function(e19, t2, n2) {
if (!this.isEmpty) {
for (var r2 = 0; r2 < this.chunk.length; r2++) {
var i2 = this.chunkPos[r2], o2 = this.chunk[r2];
if (t2 >= i2 && e19 <= i2 + o2.length && false === o2.between(i2, e19 - i2, t2 - i2, n2))
return;
}
this.nextLayer.between(e19, t2, n2);
}
} }, { key: "iter", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return IC.from([this]).goto(e19);
} }, { key: "isEmpty", get: function() {
return this.nextLayer == this;
} }], [{ key: "create", value: function(t2, n2, r2, i2) {
return new e18(t2, n2, r2, i2);
} }, { key: "iter", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return IC.from(e19).goto(t2);
} }, { key: "compare", value: function(e19, t2, n2, r2) {
var i2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : -1, o2 = e19.filter(function(e20) {
return e20.maxPoint > 0 || !e20.isEmpty && e20.maxPoint >= i2;
}), a2 = t2.filter(function(e20) {
return e20.maxPoint > 0 || !e20.isEmpty && e20.maxPoint >= i2;
}), s2 = AC(o2, a2, n2), u2 = new RC(o2, s2, i2), c2 = new RC(a2, s2, i2);
n2.iterGaps(function(e20, t3, n3) {
return DC(u2, e20, c2, t3, n3, r2);
}), n2.empty && 0 == n2.length && DC(u2, 0, c2, 0, 0, r2);
} }, { key: "eq", value: function(e19, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r2 = arguments.length > 3 ? arguments[3] : void 0;
null == r2 && (r2 = 1e9);
var i2 = e19.filter(function(e20) {
return !e20.isEmpty && t2.indexOf(e20) < 0;
}), o2 = t2.filter(function(t3) {
return !t3.isEmpty && e19.indexOf(t3) < 0;
});
if (i2.length != o2.length)
return false;
if (!i2.length)
return true;
for (var a2 = AC(i2, o2), s2 = new RC(i2, a2, 0).goto(n2), u2 = new RC(o2, a2, 0).goto(n2); ; ) {
if (s2.to != u2.to || !LC(s2.active, u2.active) || s2.point && (!u2.point || !s2.point.eq(u2.point)))
return false;
if (s2.to > r2)
return true;
s2.next(), u2.next();
}
} }, { key: "spans", value: function(e19, t2, n2, r2) {
for (var i2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : -1, o2 = new RC(e19, null, i2).goto(t2), a2 = t2, s2 = o2.openStart; ; ) {
var u2 = Math.min(o2.to, n2);
if (o2.point ? (r2.point(a2, u2, o2.point, o2.activeForPoint(o2.to), s2, o2.pointRank), s2 = o2.openEnd(u2) + (o2.to > u2 ? 1 : 0)) : u2 > a2 && (r2.span(a2, u2, o2.active, s2), s2 = o2.openEnd(u2)), o2.to > n2)
break;
a2 = o2.to, o2.next();
}
return s2;
} }, { key: "of", value: function(e19) {
var t2, n2 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r2 = new PC(), i2 = bi(e19 instanceof CC ? [e19] : n2 ? EC(e19) : e19);
try {
for (i2.s(); !(t2 = i2.n()).done; ) {
var o2 = t2.value;
r2.add(o2.from, o2.to, o2.value);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return r2.finish();
} }]), e18;
}();
function EC(e18) {
if (e18.length > 1)
for (var t2 = e18[0], n2 = 1; n2 < e18.length; n2++) {
var r2 = e18[n2];
if ($C(t2, r2) > 0)
return e18.slice().sort($C);
t2 = r2;
}
return e18;
}
MC.empty = new MC([], [], null, -1), MC.empty.nextLayer = MC.empty;
var PC = function() {
function e18() {
Ri(this, e18), this.chunks = [], this.chunkPos = [], this.chunkStart = -1, this.last = null, this.lastFrom = -1e9, this.lastTo = -1e9, this.from = [], this.to = [], this.value = [], this.maxPoint = -1, this.setMaxPoint = -1, this.nextLayer = null;
}
return Li(e18, [{ key: "finishChunk", value: function(e19) {
this.chunks.push(new OC(this.from, this.to, this.value, this.maxPoint)), this.chunkPos.push(this.chunkStart), this.chunkStart = -1, this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint), this.maxPoint = -1, e19 && (this.from = [], this.to = [], this.value = []);
} }, { key: "add", value: function(t2, n2, r2) {
this.addInner(t2, n2, r2) || (this.nextLayer || (this.nextLayer = new e18())).add(t2, n2, r2);
} }, { key: "addInner", value: function(e19, t2, n2) {
var r2 = e19 - this.lastTo || n2.startSide - this.last.endSide;
if (r2 <= 0 && (e19 - this.lastFrom || n2.startSide - this.last.startSide) < 0)
throw new Error("Ranges must be added sorted by `from` position and `startSide`");
return !(r2 < 0) && (250 == this.from.length && this.finishChunk(true), this.chunkStart < 0 && (this.chunkStart = e19), this.from.push(e19 - this.chunkStart), this.to.push(t2 - this.chunkStart), this.last = n2, this.lastFrom = e19, this.lastTo = t2, this.value.push(n2), n2.point && (this.maxPoint = Math.max(this.maxPoint, t2 - e19)), true);
} }, { key: "addChunk", value: function(e19, t2) {
if ((e19 - this.lastTo || t2.value[0].startSide - this.last.endSide) < 0)
return false;
this.from.length && this.finishChunk(true), this.setMaxPoint = Math.max(this.setMaxPoint, t2.maxPoint), this.chunks.push(t2), this.chunkPos.push(e19);
var n2 = t2.value.length - 1;
return this.last = t2.value[n2], this.lastFrom = t2.from[n2] + e19, this.lastTo = t2.to[n2] + e19, true;
} }, { key: "finish", value: function() {
return this.finishInner(MC.empty);
} }, { key: "finishInner", value: function(e19) {
if (this.from.length && this.finishChunk(false), 0 == this.chunks.length)
return e19;
var t2 = MC.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(e19) : e19, this.setMaxPoint);
return this.from = null, t2;
} }]), e18;
}();
function AC(e18, t2, n2) {
var r2, i2 = /* @__PURE__ */ new Map(), o2 = bi(e18);
try {
for (o2.s(); !(r2 = o2.n()).done; )
for (var a2 = r2.value, s2 = 0; s2 < a2.chunk.length; s2++)
a2.chunk[s2].maxPoint <= 0 && i2.set(a2.chunk[s2], a2.chunkPos[s2]);
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
var u2, c2 = /* @__PURE__ */ new Set(), l2 = bi(t2);
try {
for (l2.s(); !(u2 = l2.n()).done; )
for (var f2 = u2.value, h2 = 0; h2 < f2.chunk.length; h2++) {
var d2 = i2.get(f2.chunk[h2]);
null == d2 || (n2 ? n2.mapPos(d2) : d2) != f2.chunkPos[h2] || (null == n2 ? void 0 : n2.touchesRange(d2, d2 + f2.chunk[h2].length)) || c2.add(f2.chunk[h2]);
}
} catch (e19) {
l2.e(e19);
} finally {
l2.f();
}
return c2;
}
var TC = function() {
function e18(t2, n2, r2) {
var i2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
Ri(this, e18), this.layer = t2, this.skip = n2, this.minPoint = r2, this.rank = i2;
}
return Li(e18, [{ key: "startSide", get: function() {
return this.value ? this.value.startSide : 0;
} }, { key: "endSide", get: function() {
return this.value ? this.value.endSide : 0;
} }, { key: "goto", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1e9;
return this.chunkIndex = this.rangeIndex = 0, this.gotoInner(e19, t2, false), this;
} }, { key: "gotoInner", value: function(e19, t2, n2) {
for (; this.chunkIndex < this.layer.chunk.length; ) {
var r2 = this.layer.chunk[this.chunkIndex];
if (!(this.skip && this.skip.has(r2) || this.layer.chunkEnd(this.chunkIndex) < e19 || r2.maxPoint < this.minPoint))
break;
this.chunkIndex++, n2 = false;
}
if (this.chunkIndex < this.layer.chunk.length) {
var i2 = this.layer.chunk[this.chunkIndex].findIndex(e19 - this.layer.chunkPos[this.chunkIndex], t2, true);
(!n2 || this.rangeIndex < i2) && this.setRangeIndex(i2);
}
this.next();
} }, { key: "forward", value: function(e19, t2) {
(this.to - e19 || this.endSide - t2) < 0 && this.gotoInner(e19, t2, true);
} }, { key: "next", value: function() {
for (; ; ) {
if (this.chunkIndex == this.layer.chunk.length) {
this.from = this.to = 1e9, this.value = null;
break;
}
var e19 = this.layer.chunkPos[this.chunkIndex], t2 = this.layer.chunk[this.chunkIndex], n2 = e19 + t2.from[this.rangeIndex];
if (this.from = n2, this.to = e19 + t2.to[this.rangeIndex], this.value = t2.value[this.rangeIndex], this.setRangeIndex(this.rangeIndex + 1), this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)
break;
}
} }, { key: "setRangeIndex", value: function(e19) {
if (e19 == this.layer.chunk[this.chunkIndex].value.length) {
if (this.chunkIndex++, this.skip)
for (; this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]); )
this.chunkIndex++;
this.rangeIndex = 0;
} else
this.rangeIndex = e19;
} }, { key: "nextChunk", value: function() {
this.chunkIndex++, this.rangeIndex = 0, this.next();
} }, { key: "compare", value: function(e19) {
return this.from - e19.from || this.startSide - e19.startSide || this.rank - e19.rank || this.to - e19.to || this.endSide - e19.endSide;
} }]), e18;
}(), IC = function() {
function e18(t2) {
Ri(this, e18), this.heap = t2;
}
return Li(e18, [{ key: "startSide", get: function() {
return this.value ? this.value.startSide : 0;
} }, { key: "goto", value: function(e19) {
var t2, n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1e9, r2 = bi(this.heap);
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
var i2 = t2.value;
i2.goto(e19, n2);
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
for (var o2 = this.heap.length >> 1; o2 >= 0; o2--)
NC(this.heap, o2);
return this.next(), this;
} }, { key: "forward", value: function(e19, t2) {
var n2, r2 = bi(this.heap);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
n2.value.forward(e19, t2);
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
for (var i2 = this.heap.length >> 1; i2 >= 0; i2--)
NC(this.heap, i2);
(this.to - e19 || this.value.endSide - t2) < 0 && this.next();
} }, { key: "next", value: function() {
if (0 == this.heap.length)
this.from = this.to = 1e9, this.value = null, this.rank = -1;
else {
var e19 = this.heap[0];
this.from = e19.from, this.to = e19.to, this.value = e19.value, this.rank = e19.rank, e19.value && e19.next(), NC(this.heap, 0);
}
} }], [{ key: "from", value: function(t2) {
for (var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1, i2 = [], o2 = 0; o2 < t2.length; o2++)
for (var a2 = t2[o2]; !a2.isEmpty; a2 = a2.nextLayer)
a2.maxPoint >= r2 && i2.push(new TC(a2, n2, r2, o2));
return 1 == i2.length ? i2[0] : new e18(i2);
} }]), e18;
}();
function NC(e18, t2) {
for (var n2 = e18[t2]; ; ) {
var r2 = 1 + (t2 << 1);
if (r2 >= e18.length)
break;
var i2 = e18[r2];
if (r2 + 1 < e18.length && i2.compare(e18[r2 + 1]) >= 0 && (i2 = e18[r2 + 1], r2++), n2.compare(i2) < 0)
break;
e18[r2] = n2, e18[t2] = i2, t2 = r2;
}
}
var RC = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.minPoint = r2, this.active = [], this.activeTo = [], this.activeRank = [], this.minActive = -1, this.point = null, this.pointFrom = 0, this.pointRank = 0, this.to = -1e9, this.endSide = 0, this.openStart = -1, this.cursor = IC.from(t2, n2, r2);
}
return Li(e18, [{ key: "goto", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : -1e9;
return this.cursor.goto(e19, t2), this.active.length = this.activeTo.length = this.activeRank.length = 0, this.minActive = -1, this.to = e19, this.endSide = t2, this.openStart = -1, this.next(), this;
} }, { key: "forward", value: function(e19, t2) {
for (; this.minActive > -1 && (this.activeTo[this.minActive] - e19 || this.active[this.minActive].endSide - t2) < 0; )
this.removeActive(this.minActive);
this.cursor.forward(e19, t2);
} }, { key: "removeActive", value: function(e19) {
zC(this.active, e19), zC(this.activeTo, e19), zC(this.activeRank, e19), this.minActive = qC(this.active, this.activeTo);
} }, { key: "addActive", value: function(e19) {
for (var t2 = 0, n2 = this.cursor, r2 = n2.value, i2 = n2.to, o2 = n2.rank; t2 < this.activeRank.length && this.activeRank[t2] <= o2; )
t2++;
BC(this.active, t2, r2), BC(this.activeTo, t2, i2), BC(this.activeRank, t2, o2), e19 && BC(e19, t2, this.cursor.from), this.minActive = qC(this.active, this.activeTo);
} }, { key: "next", value: function() {
var e19 = this.to, t2 = this.point;
this.point = null;
for (var n2 = this.openStart < 0 ? [] : null, r2 = 0; ; ) {
var i2 = this.minActive;
if (i2 > -1 && (this.activeTo[i2] - this.cursor.from || this.active[i2].endSide - this.cursor.startSide) < 0) {
if (this.activeTo[i2] > e19) {
this.to = this.activeTo[i2], this.endSide = this.active[i2].endSide;
break;
}
this.removeActive(i2), n2 && zC(n2, i2);
} else {
if (!this.cursor.value) {
this.to = this.endSide = 1e9;
break;
}
if (this.cursor.from > e19) {
this.to = this.cursor.from, this.endSide = this.cursor.startSide;
break;
}
var o2 = this.cursor.value;
if (o2.point) {
if (!(t2 && this.cursor.to == this.to && this.cursor.from < this.cursor.to)) {
this.point = o2, this.pointFrom = this.cursor.from, this.pointRank = this.cursor.rank, this.to = this.cursor.to, this.endSide = o2.endSide, this.cursor.from < e19 && (r2 = 1), this.cursor.next(), this.forward(this.to, this.endSide);
break;
}
this.cursor.next();
} else
this.addActive(n2), this.cursor.from < e19 && this.cursor.to > e19 && r2++, this.cursor.next();
}
}
if (n2) {
for (var a2 = 0; a2 < n2.length && n2[a2] < e19; )
a2++;
this.openStart = a2 + r2;
}
} }, { key: "activeForPoint", value: function(e19) {
if (!this.active.length)
return this.active;
for (var t2 = [], n2 = this.active.length - 1; n2 >= 0 && !(this.activeRank[n2] < this.pointRank); n2--)
(this.activeTo[n2] > e19 || this.activeTo[n2] == e19 && this.active[n2].endSide >= this.point.endSide) && t2.push(this.active[n2]);
return t2.reverse();
} }, { key: "openEnd", value: function(e19) {
for (var t2 = 0, n2 = this.activeTo.length - 1; n2 >= 0 && this.activeTo[n2] > e19; n2--)
t2++;
return t2;
} }]), e18;
}();
function DC(e18, t2, n2, r2, i2, o2) {
e18.goto(t2), n2.goto(r2);
for (var a2 = r2 + i2, s2 = r2, u2 = r2 - t2; ; ) {
var c2 = e18.to + u2 - n2.to || e18.endSide - n2.endSide, l2 = c2 < 0 ? e18.to + u2 : n2.to, f2 = Math.min(l2, a2);
if (e18.point || n2.point ? e18.point && n2.point && (e18.point == n2.point || e18.point.eq(n2.point)) && LC(e18.activeForPoint(e18.to + u2), n2.activeForPoint(n2.to)) || o2.comparePoint(s2, f2, e18.point, n2.point) : f2 > s2 && !LC(e18.active, n2.active) && o2.compareRange(s2, f2, e18.active, n2.active), l2 > a2)
break;
s2 = l2, c2 <= 0 && e18.next(), c2 >= 0 && n2.next();
}
}
function LC(e18, t2) {
if (e18.length != t2.length)
return false;
for (var n2 = 0; n2 < e18.length; n2++)
if (e18[n2] != t2[n2] && !e18[n2].eq(t2[n2]))
return false;
return true;
}
function zC(e18, t2) {
for (var n2 = t2, r2 = e18.length - 1; n2 < r2; n2++)
e18[n2] = e18[n2 + 1];
e18.pop();
}
function BC(e18, t2, n2) {
for (var r2 = e18.length - 1; r2 >= t2; r2--)
e18[r2 + 1] = e18[r2];
e18[t2] = n2;
}
function qC(e18, t2) {
for (var n2 = -1, r2 = 1e9, i2 = 0; i2 < t2.length; i2++)
(t2[i2] - r2 || e18[i2].endSide - e18[n2].endSide) < 0 && (n2 = i2, r2 = t2[i2]);
return n2;
}
function FC(e18, t2) {
for (var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : e18.length, r2 = 0, i2 = 0; i2 < n2; )
9 == e18.charCodeAt(i2) ? (r2 += t2 - r2 % t2, i2++) : (r2++, i2 = v_(e18, i2));
return r2;
}
function VC(e18, t2, n2, r2) {
for (var i2 = 0, o2 = 0; ; ) {
if (o2 >= t2)
return i2;
if (i2 == e18.length)
break;
o2 += 9 == e18.charCodeAt(i2) ? n2 - o2 % n2 : 1, i2 = v_(e18, i2);
}
return true === r2 ? -1 : e18.length;
}
var WC = "undefined" == typeof Symbol ? "__\u037C" : Symbol.for("\u037C"), HC = "undefined" == typeof Symbol ? "__styleSet" + Math.floor(1e8 * Math.random()) : Symbol("styleSet"), JC = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : {}, UC = function() {
function e18(t2, n2) {
Ri(this, e18), this.rules = [];
var r2 = (n2 || {}).finish;
function i2(e19) {
return /^@/.test(e19) ? [e19] : e19.split(/,\s*/);
}
function o2(e19, t3, n3, a3) {
var s2 = [], u2 = /^@(\w+)\b/.exec(e19[0]), c2 = u2 && "keyframes" == u2[1];
if (u2 && null == t3)
return n3.push(e19[0] + ";");
for (var l2 in t3) {
var f2 = t3[l2];
if (/&/.test(l2))
o2(l2.split(/,\s*/).map(function(t4) {
return e19.map(function(e20) {
return t4.replace(/&/, e20);
});
}).reduce(function(e20, t4) {
return e20.concat(t4);
}), f2, n3);
else if (f2 && "object" == zi(f2)) {
if (!u2)
throw new RangeError("The value of a property (" + l2 + ") should be a primitive value.");
o2(i2(l2), f2, s2, c2);
} else
null != f2 && s2.push(l2.replace(/_.*/, "").replace(/[A-Z]/g, function(e20) {
return "-" + e20.toLowerCase();
}) + ": " + f2 + ";");
}
(s2.length || c2) && n3.push((!r2 || u2 || a3 ? e19 : e19.map(r2)).join(", ") + " {" + s2.join(" ") + "}");
}
for (var a2 in t2)
o2(i2(a2), t2[a2], this.rules);
}
return Li(e18, [{ key: "getRules", value: function() {
return this.rules.join("\n");
} }], [{ key: "newName", value: function() {
var e19 = JC[WC] || 1;
return JC[WC] = e19 + 1, "\u037C" + e19.toString(36);
} }, { key: "mount", value: function(e19, t2) {
(e19[HC] || new GC(e19)).mount(Array.isArray(t2) ? t2 : [t2]);
} }]), e18;
}(), KC = null, GC = function() {
function e18(t2) {
if (Ri(this, e18), !t2.head && t2.adoptedStyleSheets && "undefined" != typeof CSSStyleSheet) {
if (KC)
return t2.adoptedStyleSheets = [KC.sheet].concat(t2.adoptedStyleSheets), t2[HC] = KC;
this.sheet = new CSSStyleSheet(), t2.adoptedStyleSheets = [this.sheet].concat(t2.adoptedStyleSheets), KC = this;
} else {
this.styleTag = (t2.ownerDocument || t2).createElement("style");
var n2 = t2.head || t2;
n2.insertBefore(this.styleTag, n2.firstChild);
}
this.modules = [], t2[HC] = this;
}
return Li(e18, [{ key: "mount", value: function(e19) {
for (var t2 = this.sheet, n2 = 0, r2 = 0, i2 = 0; i2 < e19.length; i2++) {
var o2 = e19[i2], a2 = this.modules.indexOf(o2);
if (a2 < r2 && a2 > -1 && (this.modules.splice(a2, 1), r2--, a2 = -1), -1 == a2) {
if (this.modules.splice(r2++, 0, o2), t2)
for (var s2 = 0; s2 < o2.rules.length; s2++)
t2.insertRule(o2.rules[s2], n2++);
} else {
for (; r2 < a2; )
n2 += this.modules[r2++].rules.length;
n2 += o2.rules.length, r2++;
}
}
if (!t2) {
for (var u2 = "", c2 = 0; c2 < this.modules.length; c2++)
u2 += this.modules[c2].getRules() + "\n";
this.styleTag.textContent = u2;
}
} }]), e18;
}(), QC = { 8: "Backspace", 9: "Tab", 10: "Enter", 12: "NumLock", 13: "Enter", 16: "Shift", 17: "Control", 18: "Alt", 20: "CapsLock", 27: "Escape", 32: " ", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 44: "PrintScreen", 45: "Insert", 46: "Delete", 59: ";", 61: "=", 91: "Meta", 92: "Meta", 106: "*", 107: "+", 108: ",", 109: "-", 110: ".", 111: "/", 144: "NumLock", 145: "ScrollLock", 160: "Shift", 161: "Shift", 162: "Control", 163: "Control", 164: "Alt", 165: "Alt", 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'" }, YC = { 48: ")", 49: "!", 50: "@", 51: "#", 52: "$", 53: "%", 54: "^", 55: "&", 56: "*", 57: "(", 59: ":", 61: "+", 173: "_", 186: ":", 187: "+", 188: "<", 189: "_", 190: ">", 191: "?", 192: "~", 219: "{", 220: "|", 221: "}", 222: '"' }, ZC = "undefined" != typeof navigator && /Chrome\/(\d+)/.exec(navigator.userAgent);
"undefined" != typeof navigator && /Gecko\/\d+/.test(navigator.userAgent);
for (var XC = "undefined" != typeof navigator && /Mac/.test(navigator.platform), e$ = "undefined" != typeof navigator && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent), t$ = XC || ZC && +ZC[1] < 57, n$ = 0; n$ < 10; n$++)
QC[48 + n$] = QC[96 + n$] = String(n$);
for (n$ = 1; n$ <= 24; n$++)
QC[n$ + 111] = "F" + n$;
for (n$ = 65; n$ <= 90; n$++)
QC[n$] = String.fromCharCode(n$ + 32), YC[n$] = String.fromCharCode(n$);
for (var r$ in QC)
YC.hasOwnProperty(r$) || (YC[r$] = QC[r$]);
function i$(e18) {
return (11 == e18.nodeType ? e18.getSelection ? e18 : e18.ownerDocument : e18).getSelection();
}
function o$(e18, t2) {
return !!t2 && (e18 == t2 || e18.contains(1 != t2.nodeType ? t2.parentNode : t2));
}
function a$(e18, t2) {
if (!t2.anchorNode)
return false;
try {
return o$(e18, t2.anchorNode);
} catch (e19) {
return false;
}
}
function s$(e18) {
return 3 == e18.nodeType ? b$(e18, 0, e18.nodeValue.length).getClientRects() : 1 == e18.nodeType ? e18.getClientRects() : [];
}
function u$(e18, t2, n2, r2) {
return !!n2 && (l$(e18, t2, n2, r2, -1) || l$(e18, t2, n2, r2, 1));
}
function c$(e18) {
for (var t2 = 0; ; t2++)
if (!(e18 = e18.previousSibling))
return t2;
}
function l$(e18, t2, n2, r2, i2) {
for (; ; ) {
if (e18 == n2 && t2 == r2)
return true;
if (t2 == (i2 < 0 ? 0 : f$(e18))) {
if ("DIV" == e18.nodeName)
return false;
var o2 = e18.parentNode;
if (!o2 || 1 != o2.nodeType)
return false;
t2 = c$(e18) + (i2 < 0 ? 0 : 1), e18 = o2;
} else {
if (1 != e18.nodeType)
return false;
if (1 == (e18 = e18.childNodes[t2 + (i2 < 0 ? -1 : 0)]).nodeType && "false" == e18.contentEditable)
return false;
t2 = i2 < 0 ? f$(e18) : 0;
}
}
}
function f$(e18) {
return 3 == e18.nodeType ? e18.nodeValue.length : e18.childNodes.length;
}
var h$ = { left: 0, right: 0, top: 0, bottom: 0 };
function d$(e18, t2) {
var n2 = t2 ? e18.left : e18.right;
return { left: n2, right: n2, top: e18.top, bottom: e18.bottom };
}
function v$(e18) {
return { left: 0, right: e18.innerWidth, top: 0, bottom: e18.innerHeight };
}
var p$, m$ = function() {
function e18() {
Ri(this, e18), this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
}
return Li(e18, [{ key: "eq", value: function(e19) {
return this.anchorNode == e19.anchorNode && this.anchorOffset == e19.anchorOffset && this.focusNode == e19.focusNode && this.focusOffset == e19.focusOffset;
} }, { key: "setRange", value: function(e19) {
this.set(e19.anchorNode, e19.anchorOffset, e19.focusNode, e19.focusOffset);
} }, { key: "set", value: function(e19, t2, n2, r2) {
this.anchorNode = e19, this.anchorOffset = t2, this.focusNode = n2, this.focusOffset = r2;
} }]), e18;
}(), g$ = null;
function y$(e18) {
if (e18.setActive)
return e18.setActive();
if (g$)
return e18.focus(g$);
for (var t2 = [], n2 = e18; n2 && (t2.push(n2, n2.scrollTop, n2.scrollLeft), n2 != n2.ownerDocument); n2 = n2.parentNode)
;
if (e18.focus(null == g$ ? { get preventScroll() {
return g$ = { preventScroll: true }, true;
} } : void 0), !g$) {
g$ = false;
for (var r2 = 0; r2 < t2.length; ) {
var i2 = t2[r2++], o2 = t2[r2++], a2 = t2[r2++];
i2.scrollTop != o2 && (i2.scrollTop = o2), i2.scrollLeft != a2 && (i2.scrollLeft = a2);
}
}
}
function b$(e18, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t2, r2 = p$ || (p$ = document.createRange());
return r2.setEnd(e18, n2), r2.setStart(e18, t2), r2;
}
function k$(e18, t2, n2) {
var r2 = { key: t2, code: t2, keyCode: n2, which: n2, cancelable: true }, i2 = new KeyboardEvent("keydown", r2);
i2.synthetic = true, e18.dispatchEvent(i2);
var o2 = new KeyboardEvent("keyup", r2);
return o2.synthetic = true, e18.dispatchEvent(o2), i2.defaultPrevented || o2.defaultPrevented;
}
function w$(e18) {
for (; e18; ) {
if (e18 && (9 == e18.nodeType || 11 == e18.nodeType && e18.host))
return e18;
e18 = e18.assignedSlot || e18.parentNode;
}
return null;
}
function j$(e18) {
for (; e18.attributes.length; )
e18.removeAttributeNode(e18.attributes[0]);
}
var x$ = function() {
function e18(t2, n2) {
var r2 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
Ri(this, e18), this.node = t2, this.offset = n2, this.precise = r2;
}
return Li(e18, null, [{ key: "before", value: function(t2, n2) {
return new e18(t2.parentNode, c$(t2), n2);
} }, { key: "after", value: function(t2, n2) {
return new e18(t2.parentNode, c$(t2) + 1, n2);
} }]), e18;
}(), S$ = [], _$ = function() {
function e18() {
Ri(this, e18), this.parent = null, this.dom = null, this.dirty = 2;
}
return Li(e18, [{ key: "editorView", get: function() {
if (!this.parent)
throw new Error("Accessing view in orphan content view");
return this.parent.editorView;
} }, { key: "overrideDOMText", get: function() {
return null;
} }, { key: "posAtStart", get: function() {
return this.parent ? this.parent.posBefore(this) : 0;
} }, { key: "posAtEnd", get: function() {
return this.posAtStart + this.length;
} }, { key: "posBefore", value: function(e19) {
var t2, n2 = this.posAtStart, r2 = bi(this.children);
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
var i2 = t2.value;
if (i2 == e19)
return n2;
n2 += i2.length + i2.breakAfter;
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
throw new RangeError("Invalid child in posBefore");
} }, { key: "posAfter", value: function(e19) {
return this.posBefore(e19) + e19.length;
} }, { key: "coordsAt", value: function(e19, t2) {
return null;
} }, { key: "sync", value: function(t2) {
if (2 & this.dirty) {
var n2, r2, i2 = this.dom, o2 = null, a2 = bi(this.children);
try {
for (a2.s(); !(r2 = a2.n()).done; ) {
var s2 = r2.value;
if (s2.dirty) {
if (!s2.dom && (n2 = o2 ? o2.nextSibling : i2.firstChild)) {
var u2 = e18.get(n2);
(!u2 || !u2.parent && u2.canReuseDOM(s2)) && s2.reuseDOM(n2);
}
s2.sync(t2), s2.dirty = 0;
}
if (n2 = o2 ? o2.nextSibling : i2.firstChild, t2 && !t2.written && t2.node == i2 && n2 != s2.dom && (t2.written = true), s2.dom.parentNode == i2)
for (; n2 && n2 != s2.dom; )
n2 = C$(n2);
else
i2.insertBefore(s2.dom, n2);
o2 = s2.dom;
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
for ((n2 = o2 ? o2.nextSibling : i2.firstChild) && t2 && t2.node == i2 && (t2.written = true); n2; )
n2 = C$(n2);
} else if (1 & this.dirty) {
var c2, l2 = bi(this.children);
try {
for (l2.s(); !(c2 = l2.n()).done; ) {
var f2 = c2.value;
f2.dirty && (f2.sync(t2), f2.dirty = 0);
}
} catch (e19) {
l2.e(e19);
} finally {
l2.f();
}
}
} }, { key: "reuseDOM", value: function(e19) {
} }, { key: "localPosFromDOM", value: function(t2, n2) {
var r2;
if (t2 == this.dom)
r2 = this.dom.childNodes[n2];
else {
for (var i2 = 0 == f$(t2) ? 0 : 0 == n2 ? -1 : 1; ; ) {
var o2 = t2.parentNode;
if (o2 == this.dom)
break;
0 == i2 && o2.firstChild != o2.lastChild && (i2 = t2 == o2.firstChild ? -1 : 1), t2 = o2;
}
r2 = i2 < 0 ? t2 : t2.nextSibling;
}
if (r2 == this.dom.firstChild)
return 0;
for (; r2 && !e18.get(r2); )
r2 = r2.nextSibling;
if (!r2)
return this.length;
for (var a2 = 0, s2 = 0; ; a2++) {
var u2 = this.children[a2];
if (u2.dom == r2)
return s2;
s2 += u2.length + u2.breakAfter;
}
} }, { key: "domBoundsAround", value: function(e19, t2) {
for (var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r2 = -1, i2 = -1, o2 = -1, a2 = -1, s2 = 0, u2 = n2, c2 = n2; s2 < this.children.length; s2++) {
var l2 = this.children[s2], f2 = u2 + l2.length;
if (u2 < e19 && f2 > t2)
return l2.domBoundsAround(e19, t2, u2);
if (f2 >= e19 && -1 == r2 && (r2 = s2, i2 = u2), u2 > t2 && l2.dom.parentNode == this.dom) {
o2 = s2, a2 = c2;
break;
}
c2 = f2, u2 = f2 + l2.breakAfter;
}
return { from: i2, to: a2 < 0 ? n2 + this.length : a2, startDOM: (r2 ? this.children[r2 - 1].dom.nextSibling : null) || this.dom.firstChild, endDOM: o2 < this.children.length && o2 >= 0 ? this.children[o2].dom : null };
} }, { key: "markDirty", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
this.dirty |= 2, this.markParentsDirty(e19);
} }, { key: "markParentsDirty", value: function(e19) {
for (var t2 = this.parent; t2; t2 = t2.parent) {
if (e19 && (t2.dirty |= 2), 1 & t2.dirty)
return;
t2.dirty |= 1, e19 = false;
}
} }, { key: "setParent", value: function(e19) {
this.parent != e19 && (this.parent = e19, this.dirty && this.markParentsDirty(true));
} }, { key: "setDOM", value: function(e19) {
this.dom && (this.dom.cmView = null), this.dom = e19, e19.cmView = this;
} }, { key: "rootView", get: function() {
for (var e19 = this; ; ) {
var t2 = e19.parent;
if (!t2)
return e19;
e19 = t2;
}
} }, { key: "replaceChildren", value: function(e19, t2) {
var n2, r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : S$;
this.markDirty();
for (var i2 = e19; i2 < t2; i2++) {
var o2 = this.children[i2];
o2.parent == this && o2.destroy();
}
(n2 = this.children).splice.apply(n2, [e19, t2 - e19].concat(Ti(r2)));
for (var a2 = 0; a2 < r2.length; a2++)
r2[a2].setParent(this);
} }, { key: "ignoreMutation", value: function(e19) {
return false;
} }, { key: "ignoreEvent", value: function(e19) {
return false;
} }, { key: "childCursor", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.length;
return new $$(this.children, e19, this.children.length);
} }, { key: "childPos", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
return this.childCursor().findPos(e19, t2);
} }, { key: "toString", value: function() {
var e19 = this.constructor.name.replace("View", "");
return e19 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + ("Text" == e19 ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : "");
} }, { key: "isEditable", get: function() {
return true;
} }, { key: "merge", value: function(e19, t2, n2, r2, i2, o2) {
return false;
} }, { key: "become", value: function(e19) {
return false;
} }, { key: "canReuseDOM", value: function(e19) {
return e19.constructor == this.constructor;
} }, { key: "getSide", value: function() {
return 0;
} }, { key: "destroy", value: function() {
this.parent = null;
} }], [{ key: "get", value: function(e19) {
return e19.cmView;
} }]), e18;
}();
function C$(e18) {
var t2 = e18.nextSibling;
return e18.parentNode.removeChild(e18), t2;
}
_$.prototype.breakAfter = 0;
var $$ = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.children = t2, this.pos = n2, this.i = r2, this.off = 0;
}
return Li(e18, [{ key: "findPos", value: function(e19) {
for (var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; ; ) {
if (e19 > this.pos || e19 == this.pos && (t2 > 0 || 0 == this.i || this.children[this.i - 1].breakAfter))
return this.off = e19 - this.pos, this;
var n2 = this.children[--this.i];
this.pos -= n2.length + n2.breakAfter;
}
} }]), e18;
}();
function O$(e18, t2, n2, r2, i2, o2, a2, s2, u2) {
var c2 = e18.children, l2 = c2.length ? c2[t2] : null, f2 = o2.length ? o2[o2.length - 1] : null, h2 = f2 ? f2.breakAfter : a2;
if (!(t2 == r2 && l2 && !a2 && !h2 && o2.length < 2 && l2.merge(n2, i2, o2.length ? f2 : null, 0 == n2, s2, u2))) {
if (r2 < c2.length) {
var d2 = c2[r2];
d2 && i2 < d2.length ? (t2 == r2 && (d2 = d2.split(i2), i2 = 0), !h2 && f2 && d2.merge(0, i2, f2, true, 0, u2) ? o2[o2.length - 1] = d2 : (i2 && d2.merge(0, i2, null, false, 0, u2), o2.push(d2))) : (null == d2 ? void 0 : d2.breakAfter) && (f2 ? f2.breakAfter = 1 : a2 = 1), r2++;
}
for (l2 && (l2.breakAfter = a2, n2 > 0 && (!a2 && o2.length && l2.merge(n2, l2.length, o2[0], false, s2, 0) ? l2.breakAfter = o2.shift().breakAfter : (n2 < l2.length || l2.children.length && 0 == l2.children[l2.children.length - 1].length) && l2.merge(n2, l2.length, null, false, s2, 0), t2++)); t2 < r2 && o2.length; )
if (c2[r2 - 1].become(o2[o2.length - 1]))
r2--, o2.pop(), u2 = o2.length ? 0 : s2;
else {
if (!c2[t2].become(o2[0]))
break;
t2++, o2.shift(), s2 = o2.length ? 0 : u2;
}
!o2.length && t2 && r2 < c2.length && !c2[t2 - 1].breakAfter && c2[r2].merge(0, 0, c2[t2 - 1], false, s2, u2) && t2--, (t2 < r2 || o2.length) && e18.replaceChildren(t2, r2, o2);
}
}
function M$(e18, t2, n2, r2, i2, o2) {
var a2, s2 = e18.childCursor(), u2 = s2.findPos(n2, 1), c2 = u2.i, l2 = u2.off, f2 = s2.findPos(t2, -1), h2 = f2.i, d2 = f2.off, v2 = t2 - n2, p2 = bi(r2);
try {
for (p2.s(); !(a2 = p2.n()).done; ) {
v2 += a2.value.length;
}
} catch (e19) {
p2.e(e19);
} finally {
p2.f();
}
e18.length += v2, O$(e18, h2, d2, c2, l2, r2, 0, i2, o2);
}
var E$ = "undefined" != typeof navigator ? navigator : { userAgent: "", vendor: "", platform: "" }, P$ = "undefined" != typeof document ? document : { documentElement: { style: {} } }, A$ = /Edge\/(\d+)/.exec(E$.userAgent), T$ = /MSIE \d/.test(E$.userAgent), I$ = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(E$.userAgent), N$ = !!(T$ || I$ || A$), R$ = !N$ && /gecko\/(\d+)/i.test(E$.userAgent), D$ = !N$ && /Chrome\/(\d+)/.exec(E$.userAgent), L$ = "webkitFontSmoothing" in P$.documentElement.style, z$ = !N$ && /Apple Computer/.test(E$.vendor), B$ = z$ && (/Mobile\/\w+/.test(E$.userAgent) || E$.maxTouchPoints > 2), q$ = { mac: B$ || /Mac/.test(E$.platform), windows: /Win/.test(E$.platform), linux: /Linux|X11/.test(E$.platform), ie: N$, ie_version: T$ ? P$.documentMode || 6 : I$ ? +I$[1] : A$ ? +A$[1] : 0, gecko: R$, gecko_version: R$ ? +(/Firefox\/(\d+)/.exec(E$.userAgent) || [0, 0])[1] : 0, chrome: !!D$, chrome_version: D$ ? +D$[1] : 0, ios: B$, android: /Android\b/.test(E$.userAgent), webkit: L$, safari: z$, webkit_version: L$ ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0, tabSize: null != P$.documentElement.style.tabSize ? "tab-size" : "-moz-tab-size" }, F$ = function(e18) {
Ci(n2, _$);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).text = e19, r2;
}
return Li(n2, [{ key: "length", get: function() {
return this.text.length;
} }, { key: "createDOM", value: function(e19) {
this.setDOM(e19 || document.createTextNode(this.text));
} }, { key: "sync", value: function(e19) {
this.dom || this.createDOM(), this.dom.nodeValue != this.text && (e19 && e19.node == this.dom && (e19.written = true), this.dom.nodeValue = this.text);
} }, { key: "reuseDOM", value: function(e19) {
3 == e19.nodeType && this.createDOM(e19);
} }, { key: "merge", value: function(e19, t3, r2) {
return (!r2 || r2 instanceof n2 && !(this.length - (t3 - e19) + r2.length > 256)) && (this.text = this.text.slice(0, e19) + (r2 ? r2.text : "") + this.text.slice(t3), this.markDirty(), true);
} }, { key: "split", value: function(e19) {
var t3 = new n2(this.text.slice(e19));
return this.text = this.text.slice(0, e19), this.markDirty(), t3;
} }, { key: "localPosFromDOM", value: function(e19, t3) {
return e19 == this.dom ? t3 : t3 ? this.text.length : 0;
} }, { key: "domAtPos", value: function(e19) {
return new x$(this.dom, e19);
} }, { key: "domBoundsAround", value: function(e19, t3, n3) {
return { from: n3, to: n3 + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling };
} }, { key: "coordsAt", value: function(e19, t3) {
return W$(this.dom, e19, t3);
} }]), n2;
}(), V$ = function(e18) {
Ci(n2, _$);
var t2 = Oi(n2);
function n2(e19) {
var r2, i2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], o2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
Ri(this, n2), (r2 = t2.call(this)).mark = e19, r2.children = i2, r2.length = o2;
var a2, s2 = bi(i2);
try {
for (s2.s(); !(a2 = s2.n()).done; ) {
var u2 = a2.value;
u2.setParent(Ei(r2));
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
return r2;
}
return Li(n2, [{ key: "setAttrs", value: function(e19) {
if (j$(e19), this.mark.class && (e19.className = this.mark.class), this.mark.attrs)
for (var t3 in this.mark.attrs)
e19.setAttribute(t3, this.mark.attrs[t3]);
return e19;
} }, { key: "reuseDOM", value: function(e19) {
e19.nodeName == this.mark.tagName.toUpperCase() && (this.setDOM(e19), this.dirty |= 6);
} }, { key: "sync", value: function(e19) {
this.dom ? 4 & this.dirty && this.setAttrs(this.dom) : this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))), Si(Ai(n2.prototype), "sync", this).call(this, e19);
} }, { key: "merge", value: function(e19, t3, r2, i2, o2, a2) {
return (!r2 || !(!(r2 instanceof n2 && r2.mark.eq(this.mark)) || e19 && o2 <= 0 || t3 < this.length && a2 <= 0)) && (M$(this, e19, t3, r2 ? r2.children : [], o2 - 1, a2 - 1), this.markDirty(), true);
} }, { key: "split", value: function(e19) {
var t3, r2 = [], i2 = 0, o2 = -1, a2 = 0, s2 = bi(this.children);
try {
for (s2.s(); !(t3 = s2.n()).done; ) {
var u2 = t3.value, c2 = i2 + u2.length;
c2 > e19 && r2.push(i2 < e19 ? u2.split(e19 - i2) : u2), o2 < 0 && i2 >= e19 && (o2 = a2), i2 = c2, a2++;
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
var l2 = this.length - e19;
return this.length = e19, o2 > -1 && (this.children.length = o2, this.markDirty()), new n2(this.mark, r2, l2);
} }, { key: "domAtPos", value: function(e19) {
return Q$(this, e19);
} }, { key: "coordsAt", value: function(e19, t3) {
return Z$(this, e19, t3);
} }]), n2;
}();
function W$(e18, t2, n2) {
var r2 = e18.nodeValue.length;
t2 > r2 && (t2 = r2);
var i2 = t2, o2 = t2, a2 = 0;
0 == t2 && n2 < 0 || t2 == r2 && n2 >= 0 ? q$.chrome || q$.gecko || (t2 ? (i2--, a2 = 1) : o2 < r2 && (o2++, a2 = -1)) : n2 < 0 ? i2-- : o2 < r2 && o2++;
var s2 = b$(e18, i2, o2).getClientRects();
if (!s2.length)
return h$;
var u2 = s2[(a2 ? a2 < 0 : n2 >= 0) ? 0 : s2.length - 1];
return q$.safari && !a2 && 0 == u2.width && (u2 = Array.prototype.find.call(s2, function(e19) {
return e19.width;
}) || u2), a2 ? d$(u2, a2 < 0) : u2 || null;
}
var H$ = function(e18) {
Ci(n2, _$);
var t2 = Oi(n2);
function n2(e19, r2, i2) {
var o2;
return Ri(this, n2), (o2 = t2.call(this)).widget = e19, o2.length = r2, o2.side = i2, o2.prevWidget = null, o2;
}
return Li(n2, [{ key: "split", value: function(e19) {
var t3 = n2.create(this.widget, this.length - e19, this.side);
return this.length -= e19, t3;
} }, { key: "sync", value: function() {
this.dom && this.widget.updateDOM(this.dom) || (this.dom && this.prevWidget && this.prevWidget.destroy(this.dom), this.prevWidget = null, this.setDOM(this.widget.toDOM(this.editorView)), this.dom.contentEditable = "false");
} }, { key: "getSide", value: function() {
return this.side;
} }, { key: "merge", value: function(e19, t3, r2, i2, o2, a2) {
return !(r2 && (!(r2 instanceof n2 && this.widget.compare(r2.widget)) || e19 > 0 && o2 <= 0 || t3 < this.length && a2 <= 0)) && (this.length = e19 + (r2 ? r2.length : 0) + (this.length - t3), true);
} }, { key: "become", value: function(e19) {
return e19.length == this.length && e19 instanceof n2 && e19.side == this.side && this.widget.constructor == e19.widget.constructor && (this.widget.eq(e19.widget) || this.markDirty(true), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e19.widget, true);
} }, { key: "ignoreMutation", value: function() {
return true;
} }, { key: "ignoreEvent", value: function(e19) {
return this.widget.ignoreEvent(e19);
} }, { key: "overrideDOMText", get: function() {
if (0 == this.length)
return e_.empty;
for (var e19 = this; e19.parent; )
e19 = e19.parent;
var t3 = e19.editorView, n3 = t3 && t3.state.doc, r2 = this.posAtStart;
return n3 ? n3.slice(r2, r2 + this.length) : e_.empty;
} }, { key: "domAtPos", value: function(e19) {
return 0 == e19 ? x$.before(this.dom) : x$.after(this.dom, e19 == this.length);
} }, { key: "domBoundsAround", value: function() {
return null;
} }, { key: "coordsAt", value: function(e19, t3) {
var n3 = this.dom.getClientRects(), r2 = null;
if (!n3.length)
return h$;
for (var i2 = e19 > 0 ? n3.length - 1 : 0; r2 = n3[i2], !(e19 > 0 ? 0 == i2 : i2 == n3.length - 1 || r2.top < r2.bottom); i2 += e19 > 0 ? -1 : 1)
;
return 0 == e19 && t3 > 0 || e19 == this.length && t3 <= 0 ? r2 : d$(r2, 0 == e19);
} }, { key: "isEditable", get: function() {
return false;
} }, { key: "destroy", value: function() {
Si(Ai(n2.prototype), "destroy", this).call(this), this.dom && this.widget.destroy(this.dom);
} }], [{ key: "create", value: function(e19, t3, r2) {
return new (e19.customView || n2)(e19, t3, r2);
} }]), n2;
}(), J$ = function(e18) {
Ci(n2, H$);
var t2 = Oi(n2);
function n2() {
return Ri(this, n2), t2.apply(this, arguments);
}
return Li(n2, [{ key: "domAtPos", value: function(e19) {
var t3 = this.widget, n3 = t3.topView, r2 = t3.text;
return n3 ? U$(e19, 0, n3, r2, function(e20, t4) {
return e20.domAtPos(t4);
}, function(e20) {
return new x$(r2, Math.min(e20, r2.nodeValue.length));
}) : new x$(r2, Math.min(e19, r2.nodeValue.length));
} }, { key: "sync", value: function() {
this.setDOM(this.widget.toDOM());
} }, { key: "localPosFromDOM", value: function(e19, t3) {
var n3 = this.widget, r2 = n3.topView, i2 = n3.text;
return r2 ? K$(e19, t3, r2, i2) : Math.min(t3, this.length);
} }, { key: "ignoreMutation", value: function() {
return false;
} }, { key: "overrideDOMText", get: function() {
return null;
} }, { key: "coordsAt", value: function(e19, t3) {
var n3 = this.widget, r2 = n3.topView, i2 = n3.text;
return r2 ? U$(e19, t3, r2, i2, function(e20, t4, n4) {
return e20.coordsAt(t4, n4);
}, function(e20, t4) {
return W$(i2, e20, t4);
}) : W$(i2, e19, t3);
} }, { key: "destroy", value: function() {
var e19;
Si(Ai(n2.prototype), "destroy", this).call(this), null === (e19 = this.widget.topView) || void 0 === e19 || e19.destroy();
} }, { key: "isEditable", get: function() {
return true;
} }, { key: "canReuseDOM", value: function() {
return true;
} }]), n2;
}();
function U$(e18, t2, n2, r2, i2, o2) {
if (n2 instanceof V$) {
for (var a2 = n2.dom.firstChild; a2; a2 = a2.nextSibling) {
var s2 = _$.get(a2);
if (!s2)
return o2(e18, t2);
var u2 = o$(a2, r2), c2 = s2.length + (u2 ? r2.nodeValue.length : 0);
if (e18 < c2 || e18 == c2 && s2.getSide() <= 0)
return u2 ? U$(e18, t2, s2, r2, i2, o2) : i2(s2, e18, t2);
e18 -= c2;
}
return i2(n2, n2.length, -1);
}
return n2.dom == r2 ? o2(e18, t2) : i2(n2, e18, t2);
}
function K$(e18, t2, n2, r2) {
if (n2 instanceof V$) {
var i2, o2 = bi(n2.children);
try {
for (o2.s(); !(i2 = o2.n()).done; ) {
var a2 = i2.value, s2 = 0, u2 = o$(a2.dom, r2);
if (o$(a2.dom, e18))
return s2 + (u2 ? K$(e18, t2, a2, r2) : a2.localPosFromDOM(e18, t2));
s2 += u2 ? r2.nodeValue.length : a2.length;
}
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
} else if (n2.dom == r2)
return Math.min(t2, r2.nodeValue.length);
return n2.localPosFromDOM(e18, t2);
}
var G$ = function(e18) {
Ci(n2, _$);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).side = e19, r2;
}
return Li(n2, [{ key: "length", get: function() {
return 0;
} }, { key: "merge", value: function() {
return false;
} }, { key: "become", value: function(e19) {
return e19 instanceof n2 && e19.side == this.side;
} }, { key: "split", value: function() {
return new n2(this.side);
} }, { key: "sync", value: function() {
if (!this.dom) {
var e19 = document.createElement("img");
e19.className = "cm-widgetBuffer", e19.setAttribute("aria-hidden", "true"), this.setDOM(e19);
}
} }, { key: "getSide", value: function() {
return this.side;
} }, { key: "domAtPos", value: function(e19) {
return x$.before(this.dom);
} }, { key: "localPosFromDOM", value: function() {
return 0;
} }, { key: "domBoundsAround", value: function() {
return null;
} }, { key: "coordsAt", value: function(e19) {
var t3 = this.dom.getBoundingClientRect(), n3 = function(e20, t4) {
var n4 = e20.parent, r2 = n4 ? n4.children.indexOf(e20) : -1;
for (; n4 && r2 >= 0; )
if (t4 < 0 ? r2 > 0 : r2 < n4.children.length) {
var i2 = n4.children[r2 + t4];
if (i2 instanceof F$) {
var o2 = i2.coordsAt(t4 < 0 ? i2.length : 0, t4);
if (o2)
return o2;
}
r2 += t4;
} else {
if (!(n4 instanceof V$ && n4.parent)) {
var a2 = n4.dom.lastChild;
if (a2 && "BR" == a2.nodeName)
return a2.getClientRects()[0];
break;
}
r2 = n4.parent.children.indexOf(n4) + (t4 < 0 ? 0 : 1), n4 = n4.parent;
}
return;
}(this, this.side > 0 ? -1 : 1);
return n3 && n3.top < t3.bottom && n3.bottom > t3.top ? { left: t3.left, right: t3.right, top: n3.top, bottom: n3.bottom } : t3;
} }, { key: "overrideDOMText", get: function() {
return e_.empty;
} }]), n2;
}();
function Q$(e18, t2) {
for (var n2 = e18.dom, r2 = e18.children, i2 = 0, o2 = 0; i2 < r2.length; i2++) {
var a2 = r2[i2], s2 = o2 + a2.length;
if (!(s2 == o2 && a2.getSide() <= 0)) {
if (t2 > o2 && t2 < s2 && a2.dom.parentNode == n2)
return a2.domAtPos(t2 - o2);
if (t2 <= o2)
break;
o2 = s2;
}
}
for (var u2 = i2; u2 > 0; u2--) {
var c2 = r2[u2 - 1];
if (c2.dom.parentNode == n2)
return c2.domAtPos(c2.length);
}
for (var l2 = i2; l2 < r2.length; l2++) {
var f2 = r2[l2];
if (f2.dom.parentNode == n2)
return f2.domAtPos(0);
}
return new x$(n2, 0);
}
function Y$(e18, t2, n2) {
var r2, i2 = e18.children;
n2 > 0 && t2 instanceof V$ && i2.length && (r2 = i2[i2.length - 1]) instanceof V$ && r2.mark.eq(t2.mark) ? Y$(r2, t2.children[0], n2 - 1) : (i2.push(t2), t2.setParent(e18)), e18.length += t2.length;
}
function Z$(e18, t2, n2) {
for (var r2 = 0, i2 = 0; i2 < e18.children.length; i2++) {
var o2 = e18.children[i2], a2 = r2 + o2.length, s2 = void 0;
if ((n2 <= 0 || a2 == e18.length || o2.getSide() > 0 ? a2 >= t2 : a2 > t2) && (t2 < a2 || i2 + 1 == e18.children.length || (s2 = e18.children[i2 + 1]).length || s2.getSide() > 0)) {
var u2 = 0;
if (a2 == r2) {
if (o2.getSide() <= 0)
continue;
u2 = n2 = -o2.getSide();
}
var c2 = o2.coordsAt(Math.max(0, t2 - r2), n2);
return u2 && c2 ? d$(c2, n2 < 0) : c2;
}
r2 = a2;
}
var l2 = e18.dom.lastChild;
if (!l2)
return e18.dom.getBoundingClientRect();
var f2 = s$(l2);
return f2[f2.length - 1] || null;
}
function X$(e18, t2) {
for (var n2 in e18)
"class" == n2 && t2.class ? t2.class += " " + e18.class : "style" == n2 && t2.style ? t2.style += ";" + e18.style : t2[n2] = e18[n2];
return t2;
}
function eO(e18, t2) {
if (e18 == t2)
return true;
if (!e18 || !t2)
return false;
var n2 = Object.keys(e18), r2 = Object.keys(t2);
if (n2.length != r2.length)
return false;
for (var i2 = 0, o2 = n2; i2 < o2.length; i2++) {
var a2 = o2[i2];
if (-1 == r2.indexOf(a2) || e18[a2] !== t2[a2])
return false;
}
return true;
}
function tO(e18, t2, n2) {
var r2 = null;
if (t2)
for (var i2 in t2)
n2 && i2 in n2 || e18.removeAttribute(r2 = i2);
if (n2)
for (var o2 in n2)
t2 && t2[o2] == n2[o2] || e18.setAttribute(r2 = o2, n2[o2]);
return !!r2;
}
F$.prototype.children = H$.prototype.children = G$.prototype.children = S$;
var nO = function() {
function e18() {
Ri(this, e18);
}
return Li(e18, [{ key: "eq", value: function(e19) {
return false;
} }, { key: "updateDOM", value: function(e19) {
return false;
} }, { key: "compare", value: function(e19) {
return this == e19 || this.constructor == e19.constructor && this.eq(e19);
} }, { key: "estimatedHeight", get: function() {
return -1;
} }, { key: "ignoreEvent", value: function(e19) {
return true;
} }, { key: "customView", get: function() {
return null;
} }, { key: "destroy", value: function(e19) {
} }]), e18;
}(), rO = function(e18) {
return e18[e18.Text = 0] = "Text", e18[e18.WidgetBefore = 1] = "WidgetBefore", e18[e18.WidgetAfter = 2] = "WidgetAfter", e18[e18.WidgetRange = 3] = "WidgetRange", e18;
}(rO || (rO = {})), iO = function(e18) {
Ci(n2, _C);
var t2 = Oi(n2);
function n2(e19, r2, i2, o2) {
var a2;
return Ri(this, n2), (a2 = t2.call(this)).startSide = e19, a2.endSide = r2, a2.widget = i2, a2.spec = o2, a2;
}
return Li(n2, [{ key: "heightRelevant", get: function() {
return false;
} }, { key: "hasHeight", value: function() {
return !!this.widget && this.widget.estimatedHeight > -1;
} }], [{ key: "mark", value: function(e19) {
return new oO(e19);
} }, { key: "widget", value: function(e19) {
var t3 = e19.side || 0, n3 = !!e19.block;
return new sO(e19, t3 += n3 ? t3 > 0 ? 3e8 : -4e8 : t3 > 0 ? 1e8 : -1e8, t3, n3, e19.widget || null, false);
} }, { key: "replace", value: function(e19) {
var t3, n3, r2 = !!e19.block;
if (e19.isBlockGap)
t3 = -5e8, n3 = 4e8;
else {
var i2 = uO(e19, r2);
t3 = (i2.start ? r2 ? -3e8 : -1 : 5e8) - 1, n3 = 1 + (i2.end ? r2 ? 2e8 : 1 : -6e8);
}
return new sO(e19, t3, n3, r2, e19.widget || null, true);
} }, { key: "line", value: function(e19) {
return new aO(e19);
} }, { key: "set", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
return MC.of(e19, t3);
} }]), n2;
}();
iO.none = MC.empty;
var oO = function(e18) {
Ci(n2, iO);
var t2 = Oi(n2);
function n2(e19) {
var r2;
Ri(this, n2);
var i2 = uO(e19), o2 = i2.start, a2 = i2.end;
return (r2 = t2.call(this, o2 ? -1 : 5e8, a2 ? 1 : -6e8, null, e19)).tagName = e19.tagName || "span", r2.class = e19.class || "", r2.attrs = e19.attributes || null, r2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return this == e19 || e19 instanceof n2 && this.tagName == e19.tagName && this.class == e19.class && eO(this.attrs, e19.attrs);
} }, { key: "range", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19;
if (e19 >= t3)
throw new RangeError("Mark decorations may not be empty");
return Si(Ai(n2.prototype), "range", this).call(this, e19, t3);
} }]), n2;
}();
oO.prototype.point = false;
var aO = function(e18) {
Ci(n2, iO);
var t2 = Oi(n2);
function n2(e19) {
return Ri(this, n2), t2.call(this, -2e8, -2e8, null, e19);
}
return Li(n2, [{ key: "eq", value: function(e19) {
return e19 instanceof n2 && eO(this.spec.attributes, e19.spec.attributes);
} }, { key: "range", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19;
if (t3 != e19)
throw new RangeError("Line decoration ranges must be zero-length");
return Si(Ai(n2.prototype), "range", this).call(this, e19, t3);
} }]), n2;
}();
aO.prototype.mapMode = x_.TrackBefore, aO.prototype.point = true;
var sO = function(e18) {
Ci(n2, iO);
var t2 = Oi(n2);
function n2(e19, r2, i2, o2, a2, s2) {
var u2;
return Ri(this, n2), (u2 = t2.call(this, r2, i2, a2, e19)).block = o2, u2.isReplace = s2, u2.mapMode = o2 ? r2 <= 0 ? x_.TrackBefore : x_.TrackAfter : x_.TrackDel, u2;
}
return Li(n2, [{ key: "type", get: function() {
return this.startSide < this.endSide ? rO.WidgetRange : this.startSide <= 0 ? rO.WidgetBefore : rO.WidgetAfter;
} }, { key: "heightRelevant", get: function() {
return this.block || !!this.widget && this.widget.estimatedHeight >= 5;
} }, { key: "eq", value: function(e19) {
return e19 instanceof n2 && (t3 = this.widget, r2 = e19.widget, t3 == r2 || !!(t3 && r2 && t3.compare(r2))) && this.block == e19.block && this.startSide == e19.startSide && this.endSide == e19.endSide;
var t3, r2;
} }, { key: "range", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19;
if (this.isReplace && (e19 > t3 || e19 == t3 && this.startSide > 0 && this.endSide <= 0))
throw new RangeError("Invalid range for replacement decoration");
if (!this.isReplace && t3 != e19)
throw new RangeError("Widget decorations can only have zero-length ranges");
return Si(Ai(n2.prototype), "range", this).call(this, e19, t3);
} }]), n2;
}();
function uO(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n2 = e18.inclusiveStart, r2 = e18.inclusiveEnd;
return null == n2 && (n2 = e18.inclusive), null == r2 && (r2 = e18.inclusive), { start: null != n2 ? n2 : t2, end: null != r2 ? r2 : t2 };
}
function cO(e18, t2, n2) {
var r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, i2 = n2.length - 1;
i2 >= 0 && n2[i2] + r2 >= e18 ? n2[i2] = Math.max(n2[i2], t2) : n2.push(e18, t2);
}
sO.prototype.point = true;
var lO = function(e18) {
Ci(n2, _$);
var t2 = Oi(n2);
function n2() {
var e19;
return Ri(this, n2), (e19 = t2.apply(this, arguments)).children = [], e19.length = 0, e19.prevAttrs = void 0, e19.attrs = null, e19.breakAfter = 0, e19;
}
return Li(n2, [{ key: "merge", value: function(e19, t3, r2, i2, o2, a2) {
if (r2) {
if (!(r2 instanceof n2))
return false;
this.dom || r2.transferDOM(this);
}
return i2 && this.setDeco(r2 ? r2.attrs : null), M$(this, e19, t3, r2 ? r2.children : [], o2, a2), true;
} }, { key: "split", value: function(e19) {
var t3 = new n2();
if (t3.breakAfter = this.breakAfter, 0 == this.length)
return t3;
var r2 = this.childPos(e19), i2 = r2.i, o2 = r2.off;
o2 && (t3.append(this.children[i2].split(o2), 0), this.children[i2].merge(o2, this.children[i2].length, null, false, 0, 0), i2++);
for (var a2 = i2; a2 < this.children.length; a2++)
t3.append(this.children[a2], 0);
for (; i2 > 0 && 0 == this.children[i2 - 1].length; )
this.children[--i2].destroy();
return this.children.length = i2, this.markDirty(), this.length = e19, t3;
} }, { key: "transferDOM", value: function(e19) {
this.dom && (this.markDirty(), e19.setDOM(this.dom), e19.prevAttrs = void 0 === this.prevAttrs ? this.attrs : this.prevAttrs, this.prevAttrs = void 0, this.dom = null);
} }, { key: "setDeco", value: function(e19) {
eO(this.attrs, e19) || (this.dom && (this.prevAttrs = this.attrs, this.markDirty()), this.attrs = e19);
} }, { key: "append", value: function(e19, t3) {
Y$(this, e19, t3);
} }, { key: "addLineDeco", value: function(e19) {
var t3 = e19.spec.attributes, n3 = e19.spec.class;
t3 && (this.attrs = X$(t3, this.attrs || {})), n3 && (this.attrs = X$({ class: n3 }, this.attrs || {}));
} }, { key: "domAtPos", value: function(e19) {
return Q$(this, e19);
} }, { key: "reuseDOM", value: function(e19) {
"DIV" == e19.nodeName && (this.setDOM(e19), this.dirty |= 6);
} }, { key: "sync", value: function(e19) {
var t3;
this.dom ? 4 & this.dirty && (j$(this.dom), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0) : (this.setDOM(document.createElement("div")), this.dom.className = "cm-line", this.prevAttrs = this.attrs ? null : void 0), void 0 !== this.prevAttrs && (tO(this.dom, this.prevAttrs, this.attrs), this.dom.classList.add("cm-line"), this.prevAttrs = void 0), Si(Ai(n2.prototype), "sync", this).call(this, e19);
for (var r2 = this.dom.lastChild; r2 && _$.get(r2) instanceof V$; )
r2 = r2.lastChild;
if (!(r2 && this.length && ("BR" == r2.nodeName || 0 != (null === (t3 = _$.get(r2)) || void 0 === t3 ? void 0 : t3.isEditable) || q$.ios && this.children.some(function(e20) {
return e20 instanceof F$;
})))) {
var i2 = document.createElement("BR");
i2.cmIgnore = true, this.dom.appendChild(i2);
}
} }, { key: "measureTextSize", value: function() {
if (0 == this.children.length || this.length > 20)
return null;
var e19, t3 = 0, n3 = bi(this.children);
try {
for (n3.s(); !(e19 = n3.n()).done; ) {
var r2 = e19.value;
if (!(r2 instanceof F$) || /[^ -~]/.test(r2.text))
return null;
var i2 = s$(r2.dom);
if (1 != i2.length)
return null;
t3 += i2[0].width;
}
} catch (e20) {
n3.e(e20);
} finally {
n3.f();
}
return t3 ? { lineHeight: this.dom.getBoundingClientRect().height, charWidth: t3 / this.length } : null;
} }, { key: "coordsAt", value: function(e19, t3) {
return Z$(this, e19, t3);
} }, { key: "become", value: function(e19) {
return false;
} }, { key: "type", get: function() {
return rO.Text;
} }], [{ key: "find", value: function(e19, t3) {
for (var r2 = 0, i2 = 0; r2 < e19.children.length; r2++) {
var o2 = e19.children[r2], a2 = i2 + o2.length;
if (a2 >= t3) {
if (o2 instanceof n2)
return o2;
if (a2 > t3)
break;
}
i2 = a2 + o2.breakAfter;
}
return null;
} }]), n2;
}(), fO = function(e18) {
Ci(n2, _$);
var t2 = Oi(n2);
function n2(e19, r2, i2) {
var o2;
return Ri(this, n2), (o2 = t2.call(this)).widget = e19, o2.length = r2, o2.type = i2, o2.breakAfter = 0, o2.prevWidget = null, o2;
}
return Li(n2, [{ key: "merge", value: function(e19, t3, r2, i2, o2, a2) {
return !(r2 && (!(r2 instanceof n2 && this.widget.compare(r2.widget)) || e19 > 0 && o2 <= 0 || t3 < this.length && a2 <= 0)) && (this.length = e19 + (r2 ? r2.length : 0) + (this.length - t3), true);
} }, { key: "domAtPos", value: function(e19) {
return 0 == e19 ? x$.before(this.dom) : x$.after(this.dom, e19 == this.length);
} }, { key: "split", value: function(e19) {
var t3 = this.length - e19;
this.length = e19;
var r2 = new n2(this.widget, t3, this.type);
return r2.breakAfter = this.breakAfter, r2;
} }, { key: "children", get: function() {
return S$;
} }, { key: "sync", value: function() {
this.dom && this.widget.updateDOM(this.dom) || (this.dom && this.prevWidget && this.prevWidget.destroy(this.dom), this.prevWidget = null, this.setDOM(this.widget.toDOM(this.editorView)), this.dom.contentEditable = "false");
} }, { key: "overrideDOMText", get: function() {
return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : e_.empty;
} }, { key: "domBoundsAround", value: function() {
return null;
} }, { key: "become", value: function(e19) {
return e19 instanceof n2 && e19.type == this.type && e19.widget.constructor == this.widget.constructor && (e19.widget.eq(this.widget) || this.markDirty(true), this.dom && !this.prevWidget && (this.prevWidget = this.widget), this.widget = e19.widget, this.length = e19.length, this.breakAfter = e19.breakAfter, true);
} }, { key: "ignoreMutation", value: function() {
return true;
} }, { key: "ignoreEvent", value: function(e19) {
return this.widget.ignoreEvent(e19);
} }, { key: "destroy", value: function() {
Si(Ai(n2.prototype), "destroy", this).call(this), this.dom && this.widget.destroy(this.dom);
} }]), n2;
}(), hO = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.doc = t2, this.pos = n2, this.end = r2, this.disallowBlockEffectsFor = i2, this.content = [], this.curLine = null, this.breakAtStart = 0, this.pendingBuffer = 0, this.atCursorPos = true, this.openStart = -1, this.openEnd = -1, this.text = "", this.textOff = 0, this.cursor = t2.iter(), this.skip = n2;
}
return Li(e18, [{ key: "posCovered", value: function() {
if (0 == this.content.length)
return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos;
var e19 = this.content[this.content.length - 1];
return !(e19.breakAfter || e19 instanceof fO && e19.type == rO.WidgetBefore);
} }, { key: "getLine", value: function() {
return this.curLine || (this.content.push(this.curLine = new lO()), this.atCursorPos = true), this.curLine;
} }, { key: "flushBuffer", value: function(e19) {
this.pendingBuffer && (this.curLine.append(dO(new G$(-1), e19), e19.length), this.pendingBuffer = 0);
} }, { key: "addBlockWidget", value: function(e19) {
this.flushBuffer([]), this.curLine = null, this.content.push(e19);
} }, { key: "finish", value: function(e19) {
e19 ? this.pendingBuffer = 0 : this.flushBuffer([]), this.posCovered() || this.getLine();
} }, { key: "buildText", value: function(e19, t2, n2) {
for (; e19 > 0; ) {
if (this.textOff == this.text.length) {
var r2 = this.cursor.next(this.skip), i2 = r2.value, o2 = r2.lineBreak, a2 = r2.done;
if (this.skip = 0, a2)
throw new Error("Ran out of text content when drawing inline views");
if (o2) {
this.posCovered() || this.getLine(), this.content.length ? this.content[this.content.length - 1].breakAfter = 1 : this.breakAtStart = 1, this.flushBuffer([]), this.curLine = null, e19--;
continue;
}
this.text = i2, this.textOff = 0;
}
var s2 = Math.min(this.text.length - this.textOff, e19, 512);
this.flushBuffer(t2.slice(0, n2)), this.getLine().append(dO(new F$(this.text.slice(this.textOff, this.textOff + s2)), t2), n2), this.atCursorPos = true, this.textOff += s2, e19 -= s2, n2 = 0;
}
} }, { key: "span", value: function(e19, t2, n2, r2) {
this.buildText(t2 - e19, n2, r2), this.pos = t2, this.openStart < 0 && (this.openStart = r2);
} }, { key: "point", value: function(e19, t2, n2, r2, i2, o2) {
if (this.disallowBlockEffectsFor[o2] && n2 instanceof sO) {
if (n2.block)
throw new RangeError("Block decorations may not be specified via plugins");
if (t2 > this.doc.lineAt(this.pos).to)
throw new RangeError("Decorations that replace line breaks may not be specified via plugins");
}
var a2 = t2 - e19;
if (n2 instanceof sO)
if (n2.block) {
var s2 = n2.type;
s2 != rO.WidgetAfter || this.posCovered() || this.getLine(), this.addBlockWidget(new fO(n2.widget || new vO("div"), a2, s2));
} else {
var u2 = H$.create(n2.widget || new vO("span"), a2, n2.startSide), c2 = this.atCursorPos && !u2.isEditable && i2 <= r2.length && (e19 < t2 || n2.startSide > 0), l2 = !u2.isEditable && (e19 < t2 || n2.startSide <= 0), f2 = this.getLine();
2 != this.pendingBuffer || c2 || (this.pendingBuffer = 0), this.flushBuffer(r2), c2 && (f2.append(dO(new G$(1), r2), i2), i2 = r2.length + Math.max(0, i2 - r2.length)), f2.append(dO(u2, r2), i2), this.atCursorPos = l2, this.pendingBuffer = l2 ? e19 < t2 ? 1 : 2 : 0;
}
else
this.doc.lineAt(this.pos).from == this.pos && this.getLine().addLineDeco(n2);
a2 && (this.textOff + a2 <= this.text.length ? this.textOff += a2 : (this.skip += a2 - (this.text.length - this.textOff), this.text = "", this.textOff = 0), this.pos = t2), this.openStart < 0 && (this.openStart = i2);
} }], [{ key: "build", value: function(t2, n2, r2, i2, o2) {
var a2 = new e18(t2, n2, r2, o2);
return a2.openEnd = MC.spans(i2, n2, r2, a2), a2.openStart < 0 && (a2.openStart = a2.openEnd), a2.finish(a2.openEnd), a2;
} }]), e18;
}();
function dO(e18, t2) {
var n2, r2 = bi(t2);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
e18 = new V$(i2, [e18], e18.length);
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
return e18;
}
var vO = function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).tag = e19, r2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return e19.tag == this.tag;
} }, { key: "toDOM", value: function() {
return document.createElement(this.tag);
} }, { key: "updateDOM", value: function(e19) {
return e19.nodeName.toLowerCase() == this.tag;
} }]), n2;
}(), pO = R_.define(), mO = R_.define(), gO = R_.define(), yO = R_.define(), bO = R_.define(), kO = R_.define(), wO = R_.define({ combine: function(e18) {
return e18.some(function(e19) {
return e19;
});
} }), jO = function() {
function e18(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "nearest", r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "nearest", i2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 5, o2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 5;
Ri(this, e18), this.range = t2, this.y = n2, this.x = r2, this.yMargin = i2, this.xMargin = o2;
}
return Li(e18, [{ key: "map", value: function(t2) {
return t2.empty ? this : new e18(this.range.map(t2), this.y, this.x, this.yMargin, this.xMargin);
} }]), e18;
}(), xO = fC.define({ map: function(e18, t2) {
return e18.map(t2);
} });
function SO(e18, t2, n2) {
var r2 = e18.facet(yO);
r2.length ? r2[0](t2) : window.onerror ? window.onerror(String(t2), n2, void 0, void 0, t2) : n2 ? console.error(n2 + ":", t2) : console.error(t2);
}
var _O = R_.define({ combine: function(e18) {
return !e18.length || e18[0];
} }), CO = 0, $O = R_.define(), OO = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.id = t2, this.create = n2, this.domEventHandlers = r2, this.extension = i2(this);
}
return Li(e18, null, [{ key: "define", value: function(t2, n2) {
var r2 = n2 || {}, i2 = r2.eventHandlers, o2 = r2.provide, a2 = r2.decorations;
return new e18(CO++, t2, i2, function(e19) {
var t3 = [$O.of(e19)];
return a2 && t3.push(AO.of(function(t4) {
var n3 = t4.plugin(e19);
return n3 ? a2(n3) : iO.none;
})), o2 && t3.push(o2(e19)), t3;
});
} }, { key: "fromClass", value: function(t2, n2) {
return e18.define(function(e19) {
return new t2(e19);
}, n2);
} }]), e18;
}(), MO = function() {
function e18(t2) {
Ri(this, e18), this.spec = t2, this.mustUpdate = null, this.value = null;
}
return Li(e18, [{ key: "update", value: function(e19) {
if (this.value) {
if (this.mustUpdate) {
var t2 = this.mustUpdate;
if (this.mustUpdate = null, this.value.update)
try {
this.value.update(t2);
} catch (e20) {
if (SO(t2.state, e20, "CodeMirror plugin crashed"), this.value.destroy)
try {
this.value.destroy();
} catch (e21) {
}
this.deactivate();
}
}
} else if (this.spec)
try {
this.value = this.spec.create(e19);
} catch (t3) {
SO(e19.state, t3, "CodeMirror plugin crashed"), this.deactivate();
}
return this;
} }, { key: "destroy", value: function(e19) {
var t2;
if (null === (t2 = this.value) || void 0 === t2 ? void 0 : t2.destroy)
try {
this.value.destroy();
} catch (t3) {
SO(e19.state, t3, "CodeMirror plugin crashed");
}
} }, { key: "deactivate", value: function() {
this.spec = this.value = null;
} }]), e18;
}(), EO = R_.define(), PO = R_.define(), AO = R_.define(), TO = R_.define(), IO = R_.define(), NO = R_.define(), RO = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.fromA = t2, this.toA = n2, this.fromB = r2, this.toB = i2;
}
return Li(e18, [{ key: "join", value: function(t2) {
return new e18(Math.min(this.fromA, t2.fromA), Math.max(this.toA, t2.toA), Math.min(this.fromB, t2.fromB), Math.max(this.toB, t2.toB));
} }, { key: "addToSet", value: function(e19) {
for (var t2 = e19.length, n2 = this; t2 > 0; t2--) {
var r2 = e19[t2 - 1];
if (!(r2.fromA > n2.toA)) {
if (r2.toA < n2.fromA)
break;
n2 = n2.join(r2), e19.splice(t2 - 1, 1);
}
}
return e19.splice(t2, 0, n2), e19;
} }], [{ key: "extendWithRanges", value: function(t2, n2) {
if (0 == n2.length)
return t2;
for (var r2 = [], i2 = 0, o2 = 0, a2 = 0, s2 = 0; ; i2++) {
for (var u2 = i2 == t2.length ? null : t2[i2], c2 = a2 - s2, l2 = u2 ? u2.fromB : 1e9; o2 < n2.length && n2[o2] < l2; ) {
var f2 = n2[o2], h2 = n2[o2 + 1], d2 = Math.max(s2, f2), v2 = Math.min(l2, h2);
if (d2 <= v2 && new e18(d2 + c2, v2 + c2, d2, v2).addToSet(r2), h2 > l2)
break;
o2 += 2;
}
if (!u2)
return r2;
new e18(u2.fromA, u2.toA, u2.fromB, u2.toB).addToSet(r2), a2 = u2.toA, s2 = u2.toB;
}
} }]), e18;
}(), DO = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.view = t2, this.state = n2, this.transactions = r2, this.flags = 0, this.startState = t2.state, this.changes = __.empty(this.startState.doc.length);
var i2, o2 = bi(r2);
try {
for (o2.s(); !(i2 = o2.n()).done; ) {
var a2 = i2.value;
this.changes = this.changes.compose(a2.changes);
}
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
var s2 = [];
this.changes.iterChangedRanges(function(e19, t3, n3, r3) {
return s2.push(new RO(e19, t3, n3, r3));
}), this.changedRanges = s2;
var u2 = t2.hasFocus;
u2 != t2.inputState.notifiedFocused && (t2.inputState.notifiedFocused = u2, this.flags |= 1);
}
return Li(e18, [{ key: "viewportChanged", get: function() {
return (4 & this.flags) > 0;
} }, { key: "heightChanged", get: function() {
return (2 & this.flags) > 0;
} }, { key: "geometryChanged", get: function() {
return this.docChanged || (10 & this.flags) > 0;
} }, { key: "focusChanged", get: function() {
return (1 & this.flags) > 0;
} }, { key: "docChanged", get: function() {
return !this.changes.empty;
} }, { key: "selectionSet", get: function() {
return this.transactions.some(function(e19) {
return e19.selection;
});
} }, { key: "empty", get: function() {
return 0 == this.flags && 0 == this.transactions.length;
} }], [{ key: "create", value: function(t2, n2, r2) {
return new e18(t2, n2, r2);
} }]), e18;
}(), LO = function(e18) {
return e18[e18.LTR = 0] = "LTR", e18[e18.RTL = 1] = "RTL", e18;
}(LO || (LO = {})), zO = LO.LTR, BO = LO.RTL;
function qO(e18) {
for (var t2 = [], n2 = 0; n2 < e18.length; n2++)
t2.push(1 << +e18[n2]);
return t2;
}
for (var FO = qO("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"), VO = qO("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"), WO = /* @__PURE__ */ Object.create(null), HO = [], JO = 0, UO = ["()", "[]", "{}"]; JO < UO.length; JO++) {
var KO = UO[JO], GO = KO.charCodeAt(0), QO = KO.charCodeAt(1);
WO[GO] = QO, WO[QO] = -GO;
}
function YO(e18) {
return e18 <= 247 ? FO[e18] : 1424 <= e18 && e18 <= 1524 ? 2 : 1536 <= e18 && e18 <= 1785 ? VO[e18 - 1536] : 1774 <= e18 && e18 <= 2220 ? 4 : 8192 <= e18 && e18 <= 8203 ? 256 : 64336 <= e18 && e18 <= 65023 ? 4 : 8204 == e18 ? 256 : 1;
}
var ZO = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/, XO = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.from = t2, this.to = n2, this.level = r2;
}
return Li(e18, [{ key: "dir", get: function() {
return this.level % 2 ? BO : zO;
} }, { key: "side", value: function(e19, t2) {
return this.dir == t2 == e19 ? this.to : this.from;
} }], [{ key: "find", value: function(e19, t2, n2, r2) {
for (var i2 = -1, o2 = 0; o2 < e19.length; o2++) {
var a2 = e19[o2];
if (a2.from <= t2 && a2.to >= t2) {
if (a2.level == n2)
return o2;
(i2 < 0 || (0 != r2 ? r2 < 0 ? a2.from < t2 : a2.to > t2 : e19[i2].level > a2.level)) && (i2 = o2);
}
}
if (i2 < 0)
throw new RangeError("Index out of range");
return i2;
} }]), e18;
}(), eM = [];
function tM(e18) {
return [new XO(0, e18, 0)];
}
var nM = "";
function rM(e18, t2, n2, r2, i2) {
var o2, a2 = r2.head - e18.from, s2 = -1;
if (0 == a2) {
if (!i2 || !e18.length)
return null;
t2[0].level != n2 && (a2 = t2[0].side(false, n2), s2 = 0);
} else if (a2 == e18.length) {
if (i2)
return null;
var u2 = t2[t2.length - 1];
u2.level != n2 && (a2 = u2.side(true, n2), s2 = t2.length - 1);
}
s2 < 0 && (s2 = XO.find(t2, a2, null !== (o2 = r2.bidiLevel) && void 0 !== o2 ? o2 : -1, r2.assoc));
var c2 = t2[s2];
a2 == c2.side(i2, n2) && (a2 = (c2 = t2[s2 += i2 ? 1 : -1]).side(!i2, n2));
var l2 = i2 == (c2.dir == n2), f2 = v_(e18.text, a2, l2);
if (nM = e18.text.slice(Math.min(a2, f2), Math.max(a2, f2)), f2 != c2.side(i2, n2))
return T_.cursor(f2 + e18.from, l2 ? -1 : 1, c2.level);
var h2 = s2 == (i2 ? t2.length - 1 : 0) ? null : t2[s2 + (i2 ? 1 : -1)];
return h2 || c2.level == n2 ? h2 && h2.level < c2.level ? T_.cursor(h2.side(!i2, n2) + e18.from, i2 ? 1 : -1, h2.level) : T_.cursor(f2 + e18.from, i2 ? -1 : 1, c2.level) : T_.cursor(i2 ? e18.to : e18.from, i2 ? -1 : 1, n2);
}
var iM = function() {
function e18(t2, n2) {
Ri(this, e18), this.points = t2, this.text = "", this.lineSeparator = n2.facet(xC.lineSeparator);
}
return Li(e18, [{ key: "append", value: function(e19) {
this.text += e19;
} }, { key: "lineBreak", value: function() {
this.text += "\uFFFF";
} }, { key: "readRange", value: function(e19, t2) {
if (!e19)
return this;
for (var n2 = e19.parentNode, r2 = e19; ; ) {
this.findPointBefore(n2, r2), this.readNode(r2);
var i2 = r2.nextSibling;
if (i2 == t2)
break;
var o2 = _$.get(r2), a2 = _$.get(i2);
(o2 && a2 ? o2.breakAfter : (o2 ? o2.breakAfter : oM(r2)) || oM(i2) && ("BR" != r2.nodeName || r2.cmIgnore)) && this.lineBreak(), r2 = i2;
}
return this.findPointBefore(n2, t2), this;
} }, { key: "readTextNode", value: function(e19) {
var t2, n2 = e19.nodeValue, r2 = bi(this.points);
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
var i2 = t2.value;
i2.node == e19 && (i2.pos = this.text.length + Math.min(i2.offset, n2.length));
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
for (var o2 = 0, a2 = this.lineSeparator ? null : /\r\n?|\n/g; ; ) {
var s2 = -1, u2 = 1, c2 = void 0;
if (this.lineSeparator ? (s2 = n2.indexOf(this.lineSeparator, o2), u2 = this.lineSeparator.length) : (c2 = a2.exec(n2)) && (s2 = c2.index, u2 = c2[0].length), this.append(n2.slice(o2, s2 < 0 ? n2.length : s2)), s2 < 0)
break;
if (this.lineBreak(), u2 > 1) {
var l2, f2 = bi(this.points);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
var h2 = l2.value;
h2.node == e19 && h2.pos > this.text.length && (h2.pos -= u2 - 1);
}
} catch (e20) {
f2.e(e20);
} finally {
f2.f();
}
}
o2 = s2 + u2;
}
} }, { key: "readNode", value: function(e19) {
if (!e19.cmIgnore) {
var t2 = _$.get(e19), n2 = t2 && t2.overrideDOMText;
if (null != n2) {
this.findPointInside(e19, n2.length);
for (var r2 = n2.iter(); !r2.next().done; )
r2.lineBreak ? this.lineBreak() : this.append(r2.value);
} else
3 == e19.nodeType ? this.readTextNode(e19) : "BR" == e19.nodeName ? e19.nextSibling && this.lineBreak() : 1 == e19.nodeType && this.readRange(e19.firstChild, null);
}
} }, { key: "findPointBefore", value: function(e19, t2) {
var n2, r2 = bi(this.points);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
i2.node == e19 && e19.childNodes[i2.offset] == t2 && (i2.pos = this.text.length);
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
} }, { key: "findPointInside", value: function(e19, t2) {
var n2, r2 = bi(this.points);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
(3 == e19.nodeType ? i2.node == e19 : e19.contains(i2.node)) && (i2.pos = this.text.length + Math.min(t2, i2.offset));
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
} }]), e18;
}();
function oM(e18) {
return 1 == e18.nodeType && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e18.nodeName);
}
var aM = Li(function e4(t2, n2) {
Ri(this, e4), this.node = t2, this.offset = n2, this.pos = -1;
}), sM = function(e18) {
Ci(n2, _$);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).view = e19, r2.compositionDeco = iO.none, r2.decorations = [], r2.dynamicDecorationMap = [], r2.minWidth = 0, r2.minWidthFrom = 0, r2.minWidthTo = 0, r2.impreciseAnchor = null, r2.impreciseHead = null, r2.forceSelection = false, r2.lastUpdate = Date.now(), r2.setDOM(e19.contentDOM), r2.children = [new lO()], r2.children[0].setParent(Ei(r2)), r2.updateDeco(), r2.updateInner([new RO(0, 0, 0, e19.state.doc.length)], 0), r2;
}
return Li(n2, [{ key: "editorView", get: function() {
return this.view;
} }, { key: "length", get: function() {
return this.view.state.doc.length;
} }, { key: "update", value: function(e19) {
var t3 = this, n3 = e19.changedRanges;
this.minWidth > 0 && n3.length && (n3.every(function(e20) {
var n4 = e20.fromA;
return e20.toA < t3.minWidthFrom || n4 > t3.minWidthTo;
}) ? (this.minWidthFrom = e19.changes.mapPos(this.minWidthFrom, 1), this.minWidthTo = e19.changes.mapPos(this.minWidthTo, 1)) : this.minWidth = this.minWidthFrom = this.minWidthTo = 0), this.view.inputState.composing < 0 ? this.compositionDeco = iO.none : (e19.transactions.length || this.dirty) && (this.compositionDeco = function(e20, t4) {
var n4 = lM(e20);
if (!n4)
return iO.none;
var r3 = n4.from, i3 = n4.to, o3 = n4.node, a3 = n4.text, s3 = t4.mapPos(r3, 1), u3 = Math.max(s3, t4.mapPos(i3, -1)), c3 = e20.state, l2 = 3 == o3.nodeType ? o3.nodeValue : new iM([], c3).readRange(o3.firstChild, null).text;
if (u3 - s3 < l2.length)
if (c3.doc.sliceString(s3, Math.min(c3.doc.length, s3 + l2.length), "\uFFFF") == l2)
u3 = s3 + l2.length;
else {
if (c3.doc.sliceString(Math.max(0, u3 - l2.length), u3, "\uFFFF") != l2)
return iO.none;
s3 = u3 - l2.length;
}
else if (c3.doc.sliceString(s3, u3, "\uFFFF") != l2)
return iO.none;
var f2 = _$.get(o3);
f2 instanceof J$ ? f2 = f2.widget.topView : f2 && (f2.parent = null);
return iO.set(iO.replace({ widget: new fM(o3, a3, f2), inclusive: true }).range(s3, u3));
}(this.view, e19.changes)), (q$.ie || q$.chrome) && !this.compositionDeco.size && e19 && e19.state.doc.lines != e19.startState.doc.lines && (this.forceSelection = true);
var r2, i2, o2, a2, s2 = this.decorations, u2 = this.updateDeco(), c2 = (r2 = s2, i2 = u2, o2 = e19.changes, a2 = new vM(), MC.compare(r2, i2, o2, a2), a2.changes);
return n3 = RO.extendWithRanges(n3, c2), (0 != this.dirty || 0 != n3.length) && (this.updateInner(n3, e19.startState.doc.length), e19.transactions.length && (this.lastUpdate = Date.now()), true);
} }, { key: "updateInner", value: function(e19, t3) {
var n3 = this;
this.view.viewState.mustMeasureContent = true, this.updateChildren(e19, t3);
var r2 = this.view.observer;
r2.ignore(function() {
n3.dom.style.height = n3.view.viewState.contentHeight + "px", n3.dom.style.flexBasis = n3.minWidth ? n3.minWidth + "px" : "";
var e20 = q$.chrome || q$.ios ? { node: r2.selectionRange.focusNode, written: false } : void 0;
n3.sync(e20), n3.dirty = 0, e20 && (e20.written || r2.selectionRange.focusNode != e20.node) && (n3.forceSelection = true), n3.dom.style.height = "";
});
var i2 = [];
if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) {
var o2, a2 = bi(this.children);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
s2 instanceof fO && s2.widget instanceof cM && i2.push(s2.dom);
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
}
r2.updateGaps(i2);
} }, { key: "updateChildren", value: function(e19, t3) {
for (var n3 = this.childCursor(t3), r2 = e19.length - 1; ; r2--) {
var i2 = r2 >= 0 ? e19[r2] : null;
if (!i2)
break;
var o2 = i2.fromA, a2 = i2.toA, s2 = i2.fromB, u2 = i2.toB, c2 = hO.build(this.view.state.doc, s2, u2, this.decorations, this.dynamicDecorationMap), l2 = c2.content, f2 = c2.breakAtStart, h2 = c2.openStart, d2 = c2.openEnd, v2 = n3.findPos(a2, 1), p2 = v2.i, m2 = v2.off, g2 = n3.findPos(o2, -1);
O$(this, g2.i, g2.off, p2, m2, l2, f2, h2, d2);
}
} }, { key: "updateSelection", value: function() {
var e19 = this, t3 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], n3 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
if (!t3 && this.view.observer.selectionRange.focusNode || this.view.observer.readSelectionRange(), n3 || this.mayControlSelection()) {
var r2 = this.forceSelection;
this.forceSelection = false;
var i2 = this.view.state.selection.main, o2 = this.domAtPos(i2.anchor), a2 = i2.empty ? o2 : this.domAtPos(i2.head);
if (q$.gecko && i2.empty && uM(o2)) {
var s2 = document.createTextNode("");
this.view.observer.ignore(function() {
return o2.node.insertBefore(s2, o2.node.childNodes[o2.offset] || null);
}), o2 = a2 = new x$(s2, 0), r2 = true;
}
var u2 = this.view.observer.selectionRange;
!r2 && u2.focusNode && u$(o2.node, o2.offset, u2.anchorNode, u2.anchorOffset) && u$(a2.node, a2.offset, u2.focusNode, u2.focusOffset) || (this.view.observer.ignore(function() {
q$.android && q$.chrome && e19.dom.contains(u2.focusNode) && pM(u2.focusNode, e19.dom) && (e19.dom.blur(), e19.dom.focus({ preventScroll: true }));
var t4 = i$(e19.view.root);
if (t4)
if (i2.empty) {
if (q$.gecko) {
var n4 = dM(o2.node, o2.offset);
if (n4 && 3 != n4) {
var r3 = hM(o2.node, o2.offset, 1 == n4 ? 1 : -1);
r3 && (o2 = new x$(r3, 1 == n4 ? 0 : r3.nodeValue.length));
}
}
t4.collapse(o2.node, o2.offset), null != i2.bidiLevel && null != u2.cursorBidiLevel && (u2.cursorBidiLevel = i2.bidiLevel);
} else if (t4.extend) {
t4.collapse(o2.node, o2.offset);
try {
t4.extend(a2.node, a2.offset);
} catch (e20) {
}
} else {
var s3 = document.createRange();
if (i2.anchor > i2.head) {
var c2 = [a2, o2];
o2 = c2[0], a2 = c2[1];
}
s3.setEnd(a2.node, a2.offset), s3.setStart(o2.node, o2.offset), t4.removeAllRanges(), t4.addRange(s3);
}
}), this.view.observer.setSelectionRange(o2, a2)), this.impreciseAnchor = o2.precise ? null : new x$(u2.anchorNode, u2.anchorOffset), this.impreciseHead = a2.precise ? null : new x$(u2.focusNode, u2.focusOffset);
}
} }, { key: "enforceCursorAssoc", value: function() {
if (!this.compositionDeco.size) {
var e19 = this.view.state.selection.main, t3 = i$(this.view.root);
if (t3 && e19.empty && e19.assoc && t3.modify) {
var n3 = lO.find(this, e19.head);
if (n3) {
var r2 = n3.posAtStart;
if (e19.head != r2 && e19.head != r2 + n3.length) {
var i2 = this.coordsAt(e19.head, -1), o2 = this.coordsAt(e19.head, 1);
if (i2 && o2 && !(i2.bottom > o2.top)) {
var a2 = this.domAtPos(e19.head + e19.assoc);
t3.collapse(a2.node, a2.offset), t3.modify("move", e19.assoc < 0 ? "forward" : "backward", "lineboundary");
}
}
}
}
}
} }, { key: "mayControlSelection", value: function() {
var e19 = this.view.root.activeElement;
return e19 == this.dom || a$(this.dom, this.view.observer.selectionRange) && !(e19 && this.dom.contains(e19));
} }, { key: "nearest", value: function(e19) {
for (var t3 = e19; t3; ) {
var n3 = _$.get(t3);
if (n3 && n3.rootView == this)
return n3;
t3 = t3.parentNode;
}
return null;
} }, { key: "posFromDOM", value: function(e19, t3) {
var n3 = this.nearest(e19);
if (!n3)
throw new RangeError("Trying to find position for a DOM position outside of the document");
return n3.localPosFromDOM(e19, t3) + n3.posAtStart;
} }, { key: "domAtPos", value: function(e19) {
for (var t3 = this.childCursor().findPos(e19, -1), n3 = t3.i, r2 = t3.off; n3 < this.children.length - 1; ) {
var i2 = this.children[n3];
if (r2 < i2.length || i2 instanceof lO)
break;
n3++, r2 = 0;
}
return this.children[n3].domAtPos(r2);
} }, { key: "coordsAt", value: function(e19, t3) {
for (var n3 = this.length, r2 = this.children.length - 1; ; r2--) {
var i2 = this.children[r2], o2 = n3 - i2.breakAfter - i2.length;
if (e19 > o2 || e19 == o2 && i2.type != rO.WidgetBefore && i2.type != rO.WidgetAfter && (!r2 || 2 == t3 || this.children[r2 - 1].breakAfter || this.children[r2 - 1].type == rO.WidgetBefore && t3 > -2))
return i2.coordsAt(e19 - o2, t3);
n3 = o2;
}
} }, { key: "measureVisibleLineHeights", value: function(e19) {
for (var t3 = [], n3 = e19.from, r2 = e19.to, i2 = this.view.contentDOM.clientWidth, o2 = i2 > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1, a2 = -1, s2 = this.view.textDirection == LO.LTR, u2 = 0, c2 = 0; c2 < this.children.length; c2++) {
var l2 = this.children[c2], f2 = u2 + l2.length;
if (f2 > r2)
break;
if (u2 >= n3) {
var h2 = l2.dom.getBoundingClientRect();
if (t3.push(h2.height), o2) {
var d2 = l2.dom.lastChild, v2 = d2 ? s$(d2) : [];
if (v2.length) {
var p2 = v2[v2.length - 1], m2 = s2 ? p2.right - h2.left : h2.right - p2.left;
m2 > a2 && (a2 = m2, this.minWidth = i2, this.minWidthFrom = u2, this.minWidthTo = f2);
}
}
}
u2 = f2 + l2.breakAfter;
}
return t3;
} }, { key: "textDirectionAt", value: function(e19) {
var t3 = this.childPos(e19, 1).i;
return "rtl" == getComputedStyle(this.children[t3].dom).direction ? LO.RTL : LO.LTR;
} }, { key: "measureTextSize", value: function() {
var e19, t3 = this, n3 = bi(this.children);
try {
for (n3.s(); !(e19 = n3.n()).done; ) {
var r2 = e19.value;
if (r2 instanceof lO) {
var i2 = r2.measureTextSize();
if (i2)
return i2;
}
}
} catch (e20) {
n3.e(e20);
} finally {
n3.f();
}
var o2, a2, s2 = document.createElement("div");
return s2.className = "cm-line", s2.style.width = "99999px", s2.textContent = "abc def ghi jkl mno pqr stu", this.view.observer.ignore(function() {
t3.dom.appendChild(s2);
var e20 = s$(s2.firstChild)[0];
o2 = s2.getBoundingClientRect().height, a2 = e20 ? e20.width / 27 : 7, s2.remove();
}), { lineHeight: o2, charWidth: a2 };
} }, { key: "childCursor", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.length, t3 = this.children.length;
return t3 && (e19 -= this.children[--t3].length), new $$(this.children, e19, t3);
} }, { key: "computeBlockGapDeco", value: function() {
for (var e19 = [], t3 = this.view.viewState, n3 = 0, r2 = 0; ; r2++) {
var i2 = r2 == t3.viewports.length ? null : t3.viewports[r2], o2 = i2 ? i2.from - 1 : this.length;
if (o2 > n3) {
var a2 = t3.lineBlockAt(o2).bottom - t3.lineBlockAt(n3).top;
e19.push(iO.replace({ widget: new cM(a2), block: true, inclusive: true, isBlockGap: true }).range(n3, o2));
}
if (!i2)
break;
n3 = i2.to + 1;
}
return iO.set(e19);
} }, { key: "updateDeco", value: function() {
for (var e19 = this, t3 = this.view.state.facet(AO).map(function(t4, n4) {
return (e19.dynamicDecorationMap[n4] = "function" == typeof t4) ? t4(e19.view) : t4;
}), n3 = t3.length; n3 < t3.length + 3; n3++)
this.dynamicDecorationMap[n3] = false;
return this.decorations = [].concat(Ti(t3), [this.compositionDeco, this.computeBlockGapDeco(), this.view.viewState.lineGapDeco]);
} }, { key: "scrollIntoView", value: function(e19) {
var t3, n3 = this, r2 = e19.range, i2 = this.coordsAt(r2.head, r2.empty ? r2.assoc : r2.head > r2.anchor ? -1 : 1);
if (i2) {
!r2.empty && (t3 = this.coordsAt(r2.anchor, r2.anchor > r2.head ? -1 : 1)) && (i2 = { left: Math.min(i2.left, t3.left), top: Math.min(i2.top, t3.top), right: Math.max(i2.right, t3.right), bottom: Math.max(i2.bottom, t3.bottom) });
var o2, a2 = 0, s2 = 0, u2 = 0, c2 = 0, l2 = bi(this.view.state.facet(IO).map(function(e20) {
return e20(n3.view);
}));
try {
for (l2.s(); !(o2 = l2.n()).done; ) {
var f2 = o2.value;
if (f2) {
var h2 = f2.left, d2 = f2.right, v2 = f2.top, p2 = f2.bottom;
null != h2 && (a2 = Math.max(a2, h2)), null != d2 && (s2 = Math.max(s2, d2)), null != v2 && (u2 = Math.max(u2, v2)), null != p2 && (c2 = Math.max(c2, p2));
}
}
} catch (e20) {
l2.e(e20);
} finally {
l2.f();
}
var m2 = { left: i2.left - a2, top: i2.top - u2, right: i2.right + s2, bottom: i2.bottom + c2 };
!function(e20, t4, n4, r3, i3, o3, a3, s3) {
for (var u3 = e20.ownerDocument, c3 = u3.defaultView || window, l3 = e20; l3; )
if (1 == l3.nodeType) {
var f3 = void 0, h3 = l3 == u3.body;
if (h3)
f3 = v$(c3);
else {
if (l3.scrollHeight <= l3.clientHeight && l3.scrollWidth <= l3.clientWidth) {
l3 = l3.assignedSlot || l3.parentNode;
continue;
}
var d3 = l3.getBoundingClientRect();
f3 = { left: d3.left, right: d3.left + l3.clientWidth, top: d3.top, bottom: d3.top + l3.clientHeight };
}
var v3 = 0, p3 = 0;
if ("nearest" == i3)
t4.top < f3.top ? (p3 = -(f3.top - t4.top + a3), n4 > 0 && t4.bottom > f3.bottom + p3 && (p3 = t4.bottom - f3.bottom + p3 + a3)) : t4.bottom > f3.bottom && (p3 = t4.bottom - f3.bottom + a3, n4 < 0 && t4.top - p3 < f3.top && (p3 = -(f3.top + p3 - t4.top + a3)));
else {
var m3 = t4.bottom - t4.top, g2 = f3.bottom - f3.top;
p3 = ("center" == i3 && m3 <= g2 ? t4.top + m3 / 2 - g2 / 2 : "start" == i3 || "center" == i3 && n4 < 0 ? t4.top - a3 : t4.bottom - g2 + a3) - f3.top;
}
if ("nearest" == r3 ? t4.left < f3.left ? (v3 = -(f3.left - t4.left + o3), n4 > 0 && t4.right > f3.right + v3 && (v3 = t4.right - f3.right + v3 + o3)) : t4.right > f3.right && (v3 = t4.right - f3.right + o3, n4 < 0 && t4.left < f3.left + v3 && (v3 = -(f3.left + v3 - t4.left + o3))) : v3 = ("center" == r3 ? t4.left + (t4.right - t4.left) / 2 - (f3.right - f3.left) / 2 : "start" == r3 == s3 ? t4.left - o3 : t4.right - (f3.right - f3.left) + o3) - f3.left, v3 || p3)
if (h3)
c3.scrollBy(v3, p3);
else {
var y2 = 0, b2 = 0;
if (p3) {
var k2 = l3.scrollTop;
l3.scrollTop += p3, b2 = l3.scrollTop - k2;
}
if (v3) {
var w2 = l3.scrollLeft;
l3.scrollLeft += v3, y2 = l3.scrollLeft - w2;
}
t4 = { left: t4.left - y2, top: t4.top - b2, right: t4.right - y2, bottom: t4.bottom - b2 }, y2 && Math.abs(y2 - v3) < 1 && (r3 = "nearest"), b2 && Math.abs(b2 - p3) < 1 && (i3 = "nearest");
}
if (h3)
break;
l3 = l3.assignedSlot || l3.parentNode;
} else {
if (11 != l3.nodeType)
break;
l3 = l3.host;
}
}(this.view.scrollDOM, m2, r2.head < r2.anchor ? -1 : 1, e19.x, e19.y, e19.xMargin, e19.yMargin, this.view.textDirection == LO.LTR);
}
} }]), n2;
}();
function uM(e18) {
return 1 == e18.node.nodeType && e18.node.firstChild && (0 == e18.offset || "false" == e18.node.childNodes[e18.offset - 1].contentEditable) && (e18.offset == e18.node.childNodes.length || "false" == e18.node.childNodes[e18.offset].contentEditable);
}
var cM = function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).height = e19, r2;
}
return Li(n2, [{ key: "toDOM", value: function() {
var e19 = document.createElement("div");
return this.updateDOM(e19), e19;
} }, { key: "eq", value: function(e19) {
return e19.height == this.height;
} }, { key: "updateDOM", value: function(e19) {
return e19.style.height = this.height + "px", true;
} }, { key: "estimatedHeight", get: function() {
return this.height;
} }]), n2;
}();
function lM(e18) {
var t2 = e18.observer.selectionRange, n2 = t2.focusNode && hM(t2.focusNode, t2.focusOffset, 0);
if (!n2)
return null;
var r2 = e18.docView.nearest(n2);
if (!r2)
return null;
if (r2 instanceof lO) {
for (var i2 = n2; i2.parentNode != r2.dom; )
i2 = i2.parentNode;
for (var o2 = i2.previousSibling; o2 && !_$.get(o2); )
o2 = o2.previousSibling;
var a2 = o2 ? _$.get(o2).posAtEnd : r2.posAtStart;
return { from: a2, to: a2, node: i2, text: n2 };
}
for (; ; ) {
var s2 = r2.parent;
if (!s2)
return null;
if (s2 instanceof lO)
break;
r2 = s2;
}
var u2 = r2.posAtStart;
return { from: u2, to: u2 + r2.length, node: r2.dom, text: n2 };
}
var fM = function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2(e19, r2, i2) {
var o2;
return Ri(this, n2), (o2 = t2.call(this)).top = e19, o2.text = r2, o2.topView = i2, o2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return this.top == e19.top && this.text == e19.text;
} }, { key: "toDOM", value: function() {
return this.top;
} }, { key: "ignoreEvent", value: function() {
return false;
} }, { key: "customView", get: function() {
return J$;
} }]), n2;
}();
function hM(e18, t2, n2) {
for (; ; ) {
if (3 == e18.nodeType)
return e18;
if (1 == e18.nodeType && t2 > 0 && n2 <= 0)
t2 = f$(e18 = e18.childNodes[t2 - 1]);
else {
if (!(1 == e18.nodeType && t2 < e18.childNodes.length && n2 >= 0))
return null;
e18 = e18.childNodes[t2], t2 = 0;
}
}
}
function dM(e18, t2) {
return 1 != e18.nodeType ? 0 : (t2 && "false" == e18.childNodes[t2 - 1].contentEditable ? 1 : 0) | (t2 < e18.childNodes.length && "false" == e18.childNodes[t2].contentEditable ? 2 : 0);
}
var vM = function() {
function e18() {
Ri(this, e18), this.changes = [];
}
return Li(e18, [{ key: "compareRange", value: function(e19, t2) {
cO(e19, t2, this.changes);
} }, { key: "comparePoint", value: function(e19, t2) {
cO(e19, t2, this.changes);
} }]), e18;
}();
function pM(e18, t2) {
for (var n2 = e18; n2 && n2 != t2; n2 = n2.assignedSlot || n2.parentNode)
if (1 == n2.nodeType && "false" == n2.contentEditable)
return true;
return false;
}
function mM(e18, t2) {
return t2.left > e18 ? t2.left - e18 : Math.max(0, e18 - t2.right);
}
function gM(e18, t2) {
return t2.top > e18 ? t2.top - e18 : Math.max(0, e18 - t2.bottom);
}
function yM(e18, t2) {
return e18.top < t2.bottom - 1 && e18.bottom > t2.top + 1;
}
function bM(e18, t2) {
return t2 < e18.top ? { top: t2, left: e18.left, right: e18.right, bottom: e18.bottom } : e18;
}
function kM(e18, t2) {
return t2 > e18.bottom ? { top: e18.top, left: e18.left, right: e18.right, bottom: t2 } : e18;
}
function wM(e18, t2, n2) {
for (var r2, i2, o2, a2, s2, u2, c2, l2, f2 = false, h2 = e18.firstChild; h2; h2 = h2.nextSibling)
for (var d2 = s$(h2), v2 = 0; v2 < d2.length; v2++) {
var p2 = d2[v2];
i2 && yM(i2, p2) && (p2 = bM(kM(p2, i2.bottom), i2.top));
var m2 = mM(t2, p2), g2 = gM(n2, p2);
if (0 == m2 && 0 == g2)
return 3 == h2.nodeType ? jM(h2, t2, n2) : wM(h2, t2, n2);
(!r2 || a2 > g2 || a2 == g2 && o2 > m2) && (r2 = h2, i2 = p2, o2 = m2, a2 = g2, f2 = !m2 || (m2 > 0 ? v2 < d2.length - 1 : v2 > 0)), 0 == m2 ? n2 > p2.bottom && (!c2 || c2.bottom < p2.bottom) ? (s2 = h2, c2 = p2) : n2 < p2.top && (!l2 || l2.top > p2.top) && (u2 = h2, l2 = p2) : c2 && yM(c2, p2) ? c2 = kM(c2, p2.bottom) : l2 && yM(l2, p2) && (l2 = bM(l2, p2.top));
}
if (c2 && c2.bottom >= n2 ? (r2 = s2, i2 = c2) : l2 && l2.top <= n2 && (r2 = u2, i2 = l2), !r2)
return { node: e18, offset: 0 };
var y2 = Math.max(i2.left, Math.min(i2.right, t2));
return 3 == r2.nodeType ? jM(r2, y2, n2) : f2 && "false" != r2.contentEditable ? wM(r2, y2, n2) : { node: e18, offset: Array.prototype.indexOf.call(e18.childNodes, r2) + (t2 >= (i2.left + i2.right) / 2 ? 1 : 0) };
}
function jM(e18, t2, n2) {
for (var r2 = e18.nodeValue.length, i2 = -1, o2 = 1e9, a2 = 0, s2 = 0; s2 < r2; s2++)
for (var u2 = b$(e18, s2, s2 + 1).getClientRects(), c2 = 0; c2 < u2.length; c2++) {
var l2 = u2[c2];
if (l2.top != l2.bottom) {
a2 || (a2 = t2 - l2.left);
var f2 = (l2.top > n2 ? l2.top - n2 : n2 - l2.bottom) - 1;
if (l2.left - 1 <= t2 && l2.right + 1 >= t2 && f2 < o2) {
var h2 = t2 >= (l2.left + l2.right) / 2, d2 = h2;
if (q$.chrome || q$.gecko)
b$(e18, s2).getBoundingClientRect().left == l2.right && (d2 = !h2);
if (f2 <= 0)
return { node: e18, offset: s2 + (d2 ? 1 : 0) };
i2 = s2 + (d2 ? 1 : 0), o2 = f2;
}
}
}
return { node: e18, offset: i2 > -1 ? i2 : a2 > 0 ? e18.nodeValue.length : 0 };
}
function xM(e18, t2, n2) {
var r2, i2, o2 = t2.x, a2 = t2.y, s2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : -1, u2 = e18.contentDOM.getBoundingClientRect(), c2 = u2.top + e18.viewState.paddingTop, l2 = e18.viewState.docHeight, f2 = a2 - c2;
if (f2 < 0)
return 0;
if (f2 > l2)
return e18.state.doc.length;
for (var h2 = e18.defaultLineHeight / 2, d2 = false; (i2 = e18.elementAtHeight(f2)).type != rO.Text; )
for (; !((f2 = s2 > 0 ? i2.bottom + h2 : i2.top - h2) >= 0 && f2 <= l2); ) {
if (d2)
return n2 ? null : 0;
d2 = true, s2 = -s2;
}
a2 = c2 + f2;
var v2 = i2.from;
if (v2 < e18.viewport.from)
return 0 == e18.viewport.from ? 0 : n2 ? null : SM(e18, u2, i2, o2, a2);
if (v2 > e18.viewport.to)
return e18.viewport.to == e18.state.doc.length ? e18.state.doc.length : n2 ? null : SM(e18, u2, i2, o2, a2);
var p2 = e18.dom.ownerDocument, m2 = e18.root.elementFromPoint ? e18.root : p2, g2 = m2.elementFromPoint(o2, a2);
g2 && !e18.contentDOM.contains(g2) && (g2 = null), g2 || (o2 = Math.max(u2.left + 1, Math.min(u2.right - 1, o2)), (g2 = m2.elementFromPoint(o2, a2)) && !e18.contentDOM.contains(g2) && (g2 = null));
var y2, b2 = -1;
if (g2 && 0 != (null === (r2 = e18.docView.nearest(g2)) || void 0 === r2 ? void 0 : r2.isEditable)) {
if (p2.caretPositionFromPoint) {
var k2 = p2.caretPositionFromPoint(o2, a2);
k2 && (y2 = k2.offsetNode, b2 = k2.offset);
} else if (p2.caretRangeFromPoint) {
var w2 = p2.caretRangeFromPoint(o2, a2);
w2 && (y2 = w2.startContainer, b2 = w2.startOffset, (!e18.contentDOM.contains(y2) || q$.safari && _M(y2, b2, o2) || q$.chrome && CM(y2, b2, o2)) && (y2 = void 0));
}
}
if (!y2 || !e18.docView.dom.contains(y2)) {
var j2 = lO.find(e18.docView, v2);
if (!j2)
return f2 > i2.top + i2.height / 2 ? i2.to : i2.from;
var x2 = wM(j2.dom, o2, a2);
y2 = x2.node, b2 = x2.offset;
}
return e18.docView.posFromDOM(y2, b2);
}
function SM(e18, t2, n2, r2, i2) {
var o2 = Math.round((r2 - t2.left) * e18.defaultCharacterWidth);
e18.lineWrapping && n2.height > 1.5 * e18.defaultLineHeight && (o2 += Math.floor((i2 - n2.top) / e18.defaultLineHeight) * e18.viewState.heightOracle.lineLength);
var a2 = e18.state.sliceDoc(n2.from, n2.to);
return n2.from + VC(a2, o2, e18.state.tabSize);
}
function _M(e18, t2, n2) {
var r2;
if (3 != e18.nodeType || t2 != (r2 = e18.nodeValue.length))
return false;
for (var i2 = e18.nextSibling; i2; i2 = i2.nextSibling)
if (1 != i2.nodeType || "BR" != i2.nodeName)
return false;
return b$(e18, r2 - 1, r2).getBoundingClientRect().left > n2;
}
function CM(e18, t2, n2) {
if (0 != t2)
return false;
for (var r2 = e18; ; ) {
var i2 = r2.parentNode;
if (!i2 || 1 != i2.nodeType || i2.firstChild != r2)
return false;
if (i2.classList.contains("cm-line"))
break;
r2 = i2;
}
return n2 - (1 == e18.nodeType ? e18.getBoundingClientRect() : b$(e18, 0, Math.max(e18.nodeValue.length, 1)).getBoundingClientRect()).left > 5;
}
function $M(e18, t2, n2, r2) {
var i2 = e18.state.doc.lineAt(t2.head), o2 = r2 && e18.lineWrapping ? e18.coordsAtPos(t2.assoc < 0 && t2.head > i2.from ? t2.head - 1 : t2.head) : null;
if (o2) {
var a2 = e18.dom.getBoundingClientRect(), s2 = e18.textDirectionAt(i2.from), u2 = e18.posAtCoords({ x: n2 == (s2 == LO.LTR) ? a2.right - 1 : a2.left + 1, y: (o2.top + o2.bottom) / 2 });
if (null != u2)
return T_.cursor(u2, n2 ? -1 : 1);
}
var c2 = lO.find(e18.docView, t2.head), l2 = c2 ? n2 ? c2.posAtEnd : c2.posAtStart : n2 ? i2.to : i2.from;
return T_.cursor(l2, n2 ? -1 : 1);
}
function OM(e18, t2, n2, r2) {
for (var i2 = e18.state.doc.lineAt(t2.head), o2 = e18.bidiSpans(i2), a2 = e18.textDirectionAt(i2.from), s2 = t2, u2 = null; ; ) {
var c2 = rM(i2, o2, a2, s2, n2), l2 = nM;
if (!c2) {
if (i2.number == (n2 ? e18.state.doc.lines : 1))
return s2;
l2 = "\n", i2 = e18.state.doc.line(i2.number + (n2 ? 1 : -1)), o2 = e18.bidiSpans(i2), c2 = T_.cursor(n2 ? i2.from : i2.to);
}
if (u2) {
if (!u2(l2))
return s2;
} else {
if (!r2)
return c2;
u2 = r2(l2);
}
s2 = c2;
}
}
function MM(e18, t2, n2) {
for (var r2 = e18.state.facet(TO).map(function(t3) {
return t3(e18);
}); ; ) {
var i2, o2 = false, a2 = bi(r2);
try {
for (a2.s(); !(i2 = a2.n()).done; ) {
i2.value.between(n2.from - 1, n2.from + 1, function(e19, r3, i3) {
n2.from > e19 && n2.from < r3 && (n2 = t2.head > n2.from ? T_.cursor(e19, 1) : T_.cursor(r3, -1), o2 = true);
});
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
if (!o2)
return n2;
}
}
var EM = function() {
function e18(t2) {
var n2 = this;
Ri(this, e18), this.lastKeyCode = 0, this.lastKeyTime = 0, this.lastTouchTime = 0, this.lastFocusTime = 0, this.lastScrollTop = 0, this.lastScrollLeft = 0, this.chromeScrollHack = -1, this.pendingIOSKey = void 0, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastEscPress = 0, this.lastContextMenu = 0, this.scrollHandlers = [], this.registeredEvents = [], this.customHandlers = [], this.composing = -1, this.compositionFirstChange = null, this.compositionEndedAt = 0, this.mouseSelection = null;
var r2 = function(e19) {
var r3 = RM[e19];
t2.contentDOM.addEventListener(e19, function(i3) {
NM(t2, i3) && !n2.ignoreDuringComposition(i3) && ("keydown" == e19 && n2.keydown(t2, i3) || (n2.mustFlushObserver(i3) && t2.observer.forceFlush(), n2.runCustomHandlers(e19, t2, i3) ? i3.preventDefault() : r3(t2, i3)));
}, DM[e19]), n2.registeredEvents.push(e19);
};
for (var i2 in RM)
r2(i2);
q$.chrome && 102 == q$.chrome_version && t2.scrollDOM.addEventListener("wheel", function() {
n2.chromeScrollHack < 0 ? t2.contentDOM.style.pointerEvents = "none" : window.clearTimeout(n2.chromeScrollHack), n2.chromeScrollHack = setTimeout(function() {
n2.chromeScrollHack = -1, t2.contentDOM.style.pointerEvents = "";
}, 100);
}, { passive: true }), this.notifiedFocused = t2.hasFocus, q$.safari && t2.contentDOM.addEventListener("input", function() {
return null;
});
}
return Li(e18, [{ key: "setSelectionOrigin", value: function(e19) {
this.lastSelectionOrigin = e19, this.lastSelectionTime = Date.now();
} }, { key: "ensureHandlers", value: function(e19, t2) {
var n2, r2, i2 = this;
this.customHandlers = [];
var o2, a2 = bi(t2);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
if (r2 = null === (n2 = s2.update(e19).spec) || void 0 === n2 ? void 0 : n2.domEventHandlers) {
this.customHandlers.push({ plugin: s2.value, handlers: r2 });
var u2 = function(t3) {
i2.registeredEvents.indexOf(t3) < 0 && "scroll" != t3 && (i2.registeredEvents.push(t3), e19.contentDOM.addEventListener(t3, function(n3) {
NM(e19, n3) && i2.runCustomHandlers(t3, e19, n3) && n3.preventDefault();
}));
};
for (var c2 in r2)
u2(c2);
}
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
} }, { key: "runCustomHandlers", value: function(e19, t2, n2) {
var r2, i2 = bi(this.customHandlers);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value, a2 = o2.handlers[e19];
if (a2)
try {
if (a2.call(o2.plugin, n2, t2) || n2.defaultPrevented)
return true;
} catch (e20) {
SO(t2.state, e20);
}
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return false;
} }, { key: "runScrollHandlers", value: function(e19, t2) {
this.lastScrollTop = e19.scrollDOM.scrollTop, this.lastScrollLeft = e19.scrollDOM.scrollLeft;
var n2, r2 = bi(this.customHandlers);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value, o2 = i2.handlers.scroll;
if (o2)
try {
o2.call(i2.plugin, t2, e19);
} catch (t3) {
SO(e19.state, t3);
}
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
} }, { key: "keydown", value: function(e19, t2) {
var n2, r2 = this;
return this.lastKeyCode = t2.keyCode, this.lastKeyTime = Date.now(), 9 == t2.keyCode && Date.now() < this.lastEscPress + 2e3 || (!q$.android || !q$.chrome || t2.synthetic || 13 != t2.keyCode && 8 != t2.keyCode ? !(!q$.ios || t2.synthetic || t2.altKey || t2.metaKey || !((n2 = PM.find(function(e20) {
return e20.keyCode == t2.keyCode;
})) && !t2.ctrlKey || AM.indexOf(t2.key) > -1 && t2.ctrlKey && !t2.shiftKey)) && (this.pendingIOSKey = n2 || t2, setTimeout(function() {
return r2.flushIOSKey(e19);
}, 250), true) : (e19.observer.delayAndroidKey(t2.key, t2.keyCode), true));
} }, { key: "flushIOSKey", value: function(e19) {
var t2 = this.pendingIOSKey;
return !!t2 && (this.pendingIOSKey = void 0, k$(e19.contentDOM, t2.key, t2.keyCode));
} }, { key: "ignoreDuringComposition", value: function(e19) {
return !!/^key/.test(e19.type) && (this.composing > 0 || !!(q$.safari && !q$.ios && Date.now() - this.compositionEndedAt < 100) && (this.compositionEndedAt = 0, true));
} }, { key: "mustFlushObserver", value: function(e19) {
return "keydown" == e19.type && 229 != e19.keyCode;
} }, { key: "startMouseSelection", value: function(e19) {
this.mouseSelection && this.mouseSelection.destroy(), this.mouseSelection = e19;
} }, { key: "update", value: function(e19) {
this.mouseSelection && this.mouseSelection.update(e19), e19.transactions.length && (this.lastKeyCode = this.lastSelectionTime = 0);
} }, { key: "destroy", value: function() {
this.mouseSelection && this.mouseSelection.destroy();
} }]), e18;
}(), PM = [{ key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" }, { key: "Enter", keyCode: 13, inputType: "insertParagraph" }, { key: "Delete", keyCode: 46, inputType: "deleteContentForward" }], AM = "dthko", TM = [16, 17, 18, 20, 91, 92, 224, 225], IM = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.view = t2, this.style = r2, this.mustSelect = i2, this.lastEvent = n2;
var o2 = t2.contentDOM.ownerDocument;
o2.addEventListener("mousemove", this.move = this.move.bind(this)), o2.addEventListener("mouseup", this.up = this.up.bind(this)), this.extend = n2.shiftKey, this.multiple = t2.state.facet(xC.allowMultipleSelections) && function(e19, t3) {
var n3 = e19.state.facet(pO);
return n3.length ? n3[0](t3) : q$.mac ? t3.metaKey : t3.ctrlKey;
}(t2, n2), this.dragMove = function(e19, t3) {
var n3 = e19.state.facet(mO);
return n3.length ? n3[0](t3) : q$.mac ? !t3.altKey : !t3.ctrlKey;
}(t2, n2), this.dragging = !(!function(e19, t3) {
if (e19.state.selection.main.empty)
return false;
var n3 = i$(e19.root);
if (!n3 || 0 == n3.rangeCount)
return true;
for (var r3 = n3.getRangeAt(0).getClientRects(), i3 = 0; i3 < r3.length; i3++) {
var o3 = r3[i3];
if (o3.left <= t3.clientX && o3.right >= t3.clientX && o3.top <= t3.clientY && o3.bottom >= t3.clientY)
return true;
}
return false;
}(t2, n2) || 1 != GM(n2)) && null, false === this.dragging && (n2.preventDefault(), this.select(n2));
}
return Li(e18, [{ key: "move", value: function(e19) {
if (0 == e19.buttons)
return this.destroy();
false === this.dragging && this.select(this.lastEvent = e19);
} }, { key: "up", value: function(e19) {
null == this.dragging && this.select(this.lastEvent), this.dragging || e19.preventDefault(), this.destroy();
} }, { key: "destroy", value: function() {
var e19 = this.view.contentDOM.ownerDocument;
e19.removeEventListener("mousemove", this.move), e19.removeEventListener("mouseup", this.up), this.view.inputState.mouseSelection = null;
} }, { key: "select", value: function(e19) {
var t2 = this.style.get(e19, this.extend, this.multiple);
!this.mustSelect && t2.eq(this.view.state.selection) && t2.main.assoc == this.view.state.selection.main.assoc || this.view.dispatch({ selection: t2, userEvent: "select.pointer", scrollIntoView: true }), this.mustSelect = false;
} }, { key: "update", value: function(e19) {
var t2 = this;
e19.docChanged && this.dragging && (this.dragging = this.dragging.map(e19.changes)), this.style.update(e19) && setTimeout(function() {
return t2.select(t2.lastEvent);
}, 20);
} }]), e18;
}();
function NM(e18, t2) {
if (!t2.bubbles)
return true;
if (t2.defaultPrevented)
return false;
for (var n2, r2 = t2.target; r2 != e18.contentDOM; r2 = r2.parentNode)
if (!r2 || 11 == r2.nodeType || (n2 = _$.get(r2)) && n2.ignoreEvent(t2))
return false;
return true;
}
var RM = /* @__PURE__ */ Object.create(null), DM = /* @__PURE__ */ Object.create(null), LM = q$.ie && q$.ie_version < 15 || q$.ios && q$.webkit_version < 604;
function zM(e18, t2) {
var n2, r2 = e18.state, i2 = 1, o2 = r2.toText(t2), a2 = o2.lines == r2.selection.ranges.length, s2 = null != YM && r2.selection.ranges.every(function(e19) {
return e19.empty;
}) && YM == o2.toString();
if (s2) {
var u2 = -1;
n2 = r2.changeByRange(function(e19) {
var n3 = r2.doc.lineAt(e19.from);
if (n3.from == u2)
return { range: e19 };
u2 = n3.from;
var s3 = r2.toText((a2 ? o2.line(i2++).text : t2) + r2.lineBreak);
return { changes: { from: n3.from, insert: s3 }, range: T_.cursor(e19.from + s3.length) };
});
} else
n2 = a2 ? r2.changeByRange(function(e19) {
var t3 = o2.line(i2++);
return { changes: { from: e19.from, to: e19.to, insert: t3.text }, range: T_.cursor(e19.from + t3.length) };
}) : r2.replaceSelection(o2);
e18.dispatch(n2, { userEvent: "input.paste", scrollIntoView: true });
}
function BM(e18, t2, n2, r2) {
if (1 == r2)
return T_.cursor(t2, n2);
if (2 == r2)
return function(e19, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1, r3 = e19.charCategorizer(t3), i3 = e19.doc.lineAt(t3), o3 = t3 - i3.from;
if (0 == i3.length)
return T_.cursor(t3);
0 == o3 ? n3 = 1 : o3 == i3.length && (n3 = -1);
var a3 = o3, s3 = o3;
n3 < 0 ? a3 = v_(i3.text, o3, false) : s3 = v_(i3.text, o3);
for (var u2 = r3(i3.text.slice(a3, s3)); a3 > 0; ) {
var c2 = v_(i3.text, a3, false);
if (r3(i3.text.slice(c2, a3)) != u2)
break;
a3 = c2;
}
for (; s3 < i3.length; ) {
var l2 = v_(i3.text, s3);
if (r3(i3.text.slice(s3, l2)) != u2)
break;
s3 = l2;
}
return T_.range(a3 + i3.from, s3 + i3.from);
}(e18.state, t2, n2);
var i2 = lO.find(e18.docView, t2), o2 = e18.state.doc.lineAt(i2 ? i2.posAtEnd : t2), a2 = i2 ? i2.posAtStart : o2.from, s2 = i2 ? i2.posAtEnd : o2.to;
return s2 < e18.state.doc.length && s2 == o2.to && s2++, T_.range(a2, s2);
}
RM.keydown = function(e18, t2) {
e18.inputState.setSelectionOrigin("select"), 27 == t2.keyCode ? e18.inputState.lastEscPress = Date.now() : TM.indexOf(t2.keyCode) < 0 && (e18.inputState.lastEscPress = 0);
}, RM.touchstart = function(e18, t2) {
e18.inputState.lastTouchTime = Date.now(), e18.inputState.setSelectionOrigin("select.pointer");
}, RM.touchmove = function(e18) {
e18.inputState.setSelectionOrigin("select.pointer");
}, DM.touchstart = DM.touchmove = { passive: true }, RM.mousedown = function(e18, t2) {
if (e18.observer.flush(), !(e18.inputState.lastTouchTime > Date.now() - 2e3)) {
var n2, r2 = null, i2 = bi(e18.state.facet(gO));
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
if (r2 = (0, n2.value)(e18, t2))
break;
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
if (r2 || 0 != t2.button || (r2 = function(e19, t3) {
var n3 = WM(e19, t3), r3 = GM(t3), i3 = e19.state.selection, o3 = n3, a2 = t3;
return { update: function(e20) {
e20.docChanged && (n3.pos = e20.changes.mapPos(n3.pos), i3 = i3.map(e20.changes), a2 = null);
}, get: function(t4, s2, u2) {
var c2;
a2 && t4.clientX == a2.clientX && t4.clientY == a2.clientY ? c2 = o3 : (c2 = o3 = WM(e19, t4), a2 = t4);
var l2 = BM(e19, c2.pos, c2.bias, r3);
if (n3.pos != c2.pos && !s2) {
var f2 = BM(e19, n3.pos, n3.bias, r3), h2 = Math.min(f2.from, l2.from), d2 = Math.max(f2.to, l2.to);
l2 = h2 < l2.from ? T_.range(h2, d2) : T_.range(d2, h2);
}
return s2 ? i3.replaceRange(i3.main.extend(l2.from, l2.to)) : u2 && i3.ranges.length > 1 && i3.ranges.some(function(e20) {
return e20.eq(l2);
}) ? function(e20, t5) {
for (var n4 = 0; ; n4++)
if (e20.ranges[n4].eq(t5))
return T_.create(e20.ranges.slice(0, n4).concat(e20.ranges.slice(n4 + 1)), e20.mainIndex == n4 ? 0 : e20.mainIndex - (e20.mainIndex > n4 ? 1 : 0));
}(i3, l2) : u2 ? i3.addRange(l2) : T_.create([l2]);
} };
}(e18, t2)), r2) {
var o2 = e18.root.activeElement != e18.contentDOM;
o2 && e18.observer.ignore(function() {
return y$(e18.contentDOM);
}), e18.inputState.startMouseSelection(new IM(e18, t2, r2, o2));
}
}
};
var qM = function(e18, t2) {
return e18 >= t2.top && e18 <= t2.bottom;
}, FM = function(e18, t2, n2) {
return qM(t2, n2) && e18 >= n2.left && e18 <= n2.right;
};
function VM(e18, t2, n2, r2) {
var i2 = lO.find(e18.docView, t2);
if (!i2)
return 1;
var o2 = t2 - i2.posAtStart;
if (0 == o2)
return 1;
if (o2 == i2.length)
return -1;
var a2 = i2.coordsAt(o2, -1);
if (a2 && FM(n2, r2, a2))
return -1;
var s2 = i2.coordsAt(o2, 1);
return s2 && FM(n2, r2, s2) ? 1 : a2 && qM(r2, a2) ? -1 : 1;
}
function WM(e18, t2) {
var n2 = e18.posAtCoords({ x: t2.clientX, y: t2.clientY }, false);
return { pos: n2, bias: VM(e18, n2, t2.clientX, t2.clientY) };
}
var HM = q$.ie && q$.ie_version <= 11, JM = null, UM = 0, KM = 0;
function GM(e18) {
if (!HM)
return e18.detail;
var t2 = JM, n2 = KM;
return JM = e18, KM = Date.now(), UM = !t2 || n2 > Date.now() - 400 && Math.abs(t2.clientX - e18.clientX) < 2 && Math.abs(t2.clientY - e18.clientY) < 2 ? (UM + 1) % 3 : 1;
}
function QM(e18, t2, n2, r2) {
if (n2) {
var i2 = e18.posAtCoords({ x: t2.clientX, y: t2.clientY }, false);
t2.preventDefault();
var o2 = e18.inputState.mouseSelection, a2 = r2 && o2 && o2.dragging && o2.dragMove ? { from: o2.dragging.from, to: o2.dragging.to } : null, s2 = { from: i2, insert: n2 }, u2 = e18.state.changes(a2 ? [a2, s2] : s2);
e18.focus(), e18.dispatch({ changes: u2, selection: { anchor: u2.mapPos(i2, -1), head: u2.mapPos(i2, 1) }, userEvent: a2 ? "move.drop" : "input.drop" });
}
}
RM.dragstart = function(e18, t2) {
var n2 = e18.state.selection.main, r2 = e18.inputState.mouseSelection;
r2 && (r2.dragging = n2), t2.dataTransfer && (t2.dataTransfer.setData("Text", e18.state.sliceDoc(n2.from, n2.to)), t2.dataTransfer.effectAllowed = "copyMove");
}, RM.drop = function(e18, t2) {
if (t2.dataTransfer) {
if (e18.state.readOnly)
return t2.preventDefault();
var n2 = t2.dataTransfer.files;
n2 && n2.length ? function() {
t2.preventDefault();
for (var r2 = Array(n2.length), i2 = 0, o2 = function() {
++i2 == n2.length && QM(e18, t2, r2.filter(function(e19) {
return null != e19;
}).join(e18.state.lineBreak), false);
}, a2 = function(e19) {
var t3 = new FileReader();
t3.onerror = o2, t3.onload = function() {
/[\x00-\x08\x0e-\x1f]{2}/.test(t3.result) || (r2[e19] = t3.result), o2();
}, t3.readAsText(n2[e19]);
}, s2 = 0; s2 < n2.length; s2++)
a2(s2);
}() : QM(e18, t2, t2.dataTransfer.getData("Text"), true);
}
}, RM.paste = function(e18, t2) {
if (e18.state.readOnly)
return t2.preventDefault();
e18.observer.flush();
var n2 = LM ? null : t2.clipboardData;
n2 ? (zM(e18, n2.getData("text/plain")), t2.preventDefault()) : function(e19) {
var t3 = e19.dom.parentNode;
if (t3) {
var n3 = t3.appendChild(document.createElement("textarea"));
n3.style.cssText = "position: fixed; left: -10000px; top: 10px", n3.focus(), setTimeout(function() {
e19.focus(), n3.remove(), zM(e19, n3.value);
}, 50);
}
}(e18);
};
var YM = null;
function ZM(e18) {
setTimeout(function() {
e18.hasFocus != e18.inputState.notifiedFocused && e18.update([]);
}, 10);
}
RM.copy = RM.cut = function(e18, t2) {
var n2 = function(e19) {
var t3, n3 = [], r3 = [], i3 = false, o3 = bi(e19.selection.ranges);
try {
for (o3.s(); !(t3 = o3.n()).done; ) {
var a3 = t3.value;
a3.empty || (n3.push(e19.sliceDoc(a3.from, a3.to)), r3.push(a3));
}
} catch (e20) {
o3.e(e20);
} finally {
o3.f();
}
if (!n3.length) {
var s2, u2 = -1, c2 = bi(e19.selection.ranges);
try {
for (c2.s(); !(s2 = c2.n()).done; ) {
var l2 = s2.value.from, f2 = e19.doc.lineAt(l2);
f2.number > u2 && (n3.push(f2.text), r3.push({ from: f2.from, to: Math.min(e19.doc.length, f2.to + 1) })), u2 = f2.number;
}
} catch (e20) {
c2.e(e20);
} finally {
c2.f();
}
i3 = true;
}
return { text: n3.join(e19.lineBreak), ranges: r3, linewise: i3 };
}(e18.state), r2 = n2.text, i2 = n2.ranges, o2 = n2.linewise;
if (r2 || o2) {
YM = o2 ? r2 : null;
var a2 = LM ? null : t2.clipboardData;
a2 ? (t2.preventDefault(), a2.clearData(), a2.setData("text/plain", r2)) : function(e19, t3) {
var n3 = e19.dom.parentNode;
if (n3) {
var r3 = n3.appendChild(document.createElement("textarea"));
r3.style.cssText = "position: fixed; left: -10000px; top: 10px", r3.value = t3, r3.focus(), r3.selectionEnd = t3.length, r3.selectionStart = 0, setTimeout(function() {
r3.remove(), e19.focus();
}, 50);
}
}(e18, r2), "cut" != t2.type || e18.state.readOnly || e18.dispatch({ changes: i2, scrollIntoView: true, userEvent: "delete.cut" });
}
}, RM.focus = function(e18) {
e18.inputState.lastFocusTime = Date.now(), e18.scrollDOM.scrollTop || !e18.inputState.lastScrollTop && !e18.inputState.lastScrollLeft || (e18.scrollDOM.scrollTop = e18.inputState.lastScrollTop, e18.scrollDOM.scrollLeft = e18.inputState.lastScrollLeft), ZM(e18);
}, RM.blur = function(e18) {
e18.observer.clearSelectionRange(), ZM(e18);
}, RM.compositionstart = RM.compositionupdate = function(e18) {
null == e18.inputState.compositionFirstChange && (e18.inputState.compositionFirstChange = true), e18.inputState.composing < 0 && (e18.inputState.composing = 0);
}, RM.compositionend = function(e18) {
e18.inputState.composing = -1, e18.inputState.compositionEndedAt = Date.now(), e18.inputState.compositionFirstChange = null, q$.chrome && q$.android && e18.observer.flushSoon(), setTimeout(function() {
e18.inputState.composing < 0 && e18.docView.compositionDeco.size && e18.update([]);
}, 50);
}, RM.contextmenu = function(e18) {
e18.inputState.lastContextMenu = Date.now();
}, RM.beforeinput = function(e18, t2) {
var n2, r2;
if (q$.chrome && q$.android && (r2 = PM.find(function(e19) {
return e19.inputType == t2.inputType;
})) && (e18.observer.delayAndroidKey(r2.key, r2.keyCode), "Backspace" == r2.key || "Delete" == r2.key)) {
var i2 = (null === (n2 = window.visualViewport) || void 0 === n2 ? void 0 : n2.height) || 0;
setTimeout(function() {
var t3;
((null === (t3 = window.visualViewport) || void 0 === t3 ? void 0 : t3.height) || 0) > i2 + 10 && e18.hasFocus && (e18.contentDOM.blur(), e18.focus());
}, 100);
}
};
var XM = ["pre-wrap", "normal", "pre-line", "break-spaces"], eE = function() {
function e18() {
Ri(this, e18), this.doc = e_.empty, this.lineWrapping = false, this.heightSamples = {}, this.lineHeight = 14, this.charWidth = 7, this.lineLength = 30, this.heightChanged = false;
}
return Li(e18, [{ key: "heightForGap", value: function(e19, t2) {
var n2 = this.doc.lineAt(t2).number - this.doc.lineAt(e19).number + 1;
return this.lineWrapping && (n2 += Math.ceil((t2 - e19 - n2 * this.lineLength * 0.5) / this.lineLength)), this.lineHeight * n2;
} }, { key: "heightForLine", value: function(e19) {
return this.lineWrapping ? (1 + Math.max(0, Math.ceil((e19 - this.lineLength) / (this.lineLength - 5)))) * this.lineHeight : this.lineHeight;
} }, { key: "setDoc", value: function(e19) {
return this.doc = e19, this;
} }, { key: "mustRefreshForWrapping", value: function(e19) {
return XM.indexOf(e19) > -1 != this.lineWrapping;
} }, { key: "mustRefreshForHeights", value: function(e19) {
for (var t2 = false, n2 = 0; n2 < e19.length; n2++) {
var r2 = e19[n2];
r2 < 0 ? n2++ : this.heightSamples[Math.floor(10 * r2)] || (t2 = true, this.heightSamples[Math.floor(10 * r2)] = true);
}
return t2;
} }, { key: "refresh", value: function(e19, t2, n2, r2, i2) {
var o2 = XM.indexOf(e19) > -1, a2 = Math.round(t2) != Math.round(this.lineHeight) || this.lineWrapping != o2;
if (this.lineWrapping = o2, this.lineHeight = t2, this.charWidth = n2, this.lineLength = r2, a2) {
this.heightSamples = {};
for (var s2 = 0; s2 < i2.length; s2++) {
var u2 = i2[s2];
u2 < 0 ? s2++ : this.heightSamples[Math.floor(10 * u2)] = true;
}
}
return a2;
} }]), e18;
}(), tE = function() {
function e18(t2, n2) {
Ri(this, e18), this.from = t2, this.heights = n2, this.index = 0;
}
return Li(e18, [{ key: "more", get: function() {
return this.index < this.heights.length;
} }]), e18;
}(), nE = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.from = t2, this.length = n2, this.top = r2, this.height = i2, this.type = o2;
}
return Li(e18, [{ key: "to", get: function() {
return this.from + this.length;
} }, { key: "bottom", get: function() {
return this.top + this.height;
} }, { key: "join", value: function(t2) {
var n2 = (Array.isArray(this.type) ? this.type : [this]).concat(Array.isArray(t2.type) ? t2.type : [t2]);
return new e18(this.from, this.length + t2.length, this.top, this.height + t2.height, n2);
} }]), e18;
}(), rE = function(e18) {
return e18[e18.ByPos = 0] = "ByPos", e18[e18.ByHeight = 1] = "ByHeight", e18[e18.ByPosNoHeight = 2] = "ByPosNoHeight", e18;
}(rE || (rE = {})), iE = function() {
function e18(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 2;
Ri(this, e18), this.length = t2, this.height = n2, this.flags = r2;
}
return Li(e18, [{ key: "outdated", get: function() {
return (2 & this.flags) > 0;
}, set: function(e19) {
this.flags = (e19 ? 2 : 0) | -3 & this.flags;
} }, { key: "setHeight", value: function(e19, t2) {
this.height != t2 && (Math.abs(this.height - t2) > 1e-3 && (e19.heightChanged = true), this.height = t2);
} }, { key: "replace", value: function(t2, n2, r2) {
return e18.of(r2);
} }, { key: "decomposeLeft", value: function(e19, t2) {
t2.push(this);
} }, { key: "decomposeRight", value: function(e19, t2) {
t2.push(this);
} }, { key: "applyChanges", value: function(e19, t2, n2, r2) {
for (var i2 = this, o2 = r2.length - 1; o2 >= 0; o2--) {
var a2 = r2[o2], s2 = a2.fromA, u2 = a2.toA, c2 = a2.fromB, l2 = a2.toB, f2 = i2.lineAt(s2, rE.ByPosNoHeight, t2, 0, 0), h2 = f2.to >= u2 ? f2 : i2.lineAt(u2, rE.ByPosNoHeight, t2, 0, 0);
for (l2 += h2.to - u2, u2 = h2.to; o2 > 0 && f2.from <= r2[o2 - 1].toA; )
s2 = r2[o2 - 1].fromA, c2 = r2[o2 - 1].fromB, o2--, s2 < f2.from && (f2 = i2.lineAt(s2, rE.ByPosNoHeight, t2, 0, 0));
c2 += f2.from - s2, s2 = f2.from;
var d2 = lE.build(n2, e19, c2, l2);
i2 = i2.replace(s2, u2, d2);
}
return i2.updateHeight(n2, 0);
} }], [{ key: "empty", value: function() {
return new aE(0, 0);
} }, { key: "of", value: function(t2) {
if (1 == t2.length)
return t2[0];
for (var n2 = 0, r2 = t2.length, i2 = 0, o2 = 0; ; )
if (n2 == r2)
if (i2 > 2 * o2) {
var a2 = t2[n2 - 1];
a2.break ? t2.splice(--n2, 1, a2.left, null, a2.right) : t2.splice(--n2, 1, a2.left, a2.right), r2 += 1 + a2.break, i2 -= a2.size;
} else {
if (!(o2 > 2 * i2))
break;
var s2 = t2[r2];
s2.break ? t2.splice(r2, 1, s2.left, null, s2.right) : t2.splice(r2, 1, s2.left, s2.right), r2 += 2 + s2.break, o2 -= s2.size;
}
else if (i2 < o2) {
var u2 = t2[n2++];
u2 && (i2 += u2.size);
} else {
var c2 = t2[--r2];
c2 && (o2 += c2.size);
}
var l2 = 0;
return null == t2[n2 - 1] ? (l2 = 1, n2--) : null == t2[n2] && (l2 = 1, r2++), new uE(e18.of(t2.slice(0, n2)), l2, e18.of(t2.slice(r2)));
} }]), e18;
}();
iE.prototype.size = 1;
var oE = function(e18) {
Ci(n2, iE);
var t2 = Oi(n2);
function n2(e19, r2, i2) {
var o2;
return Ri(this, n2), (o2 = t2.call(this, e19, r2)).type = i2, o2;
}
return Li(n2, [{ key: "blockAt", value: function(e19, t3, n3, r2) {
return new nE(r2, this.length, n3, this.height, this.type);
} }, { key: "lineAt", value: function(e19, t3, n3, r2, i2) {
return this.blockAt(0, n3, r2, i2);
} }, { key: "forEachLine", value: function(e19, t3, n3, r2, i2, o2) {
e19 <= i2 + this.length && t3 >= i2 && o2(this.blockAt(0, n3, r2, i2));
} }, { key: "updateHeight", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n3 = arguments.length > 3 ? arguments[3] : void 0;
return n3 && n3.from <= t3 && n3.more && this.setHeight(e19, n3.heights[n3.index++]), this.outdated = false, this;
} }, { key: "toString", value: function() {
return "block(".concat(this.length, ")");
} }]), n2;
}(), aE = function(e18) {
Ci(n2, oE);
var t2 = Oi(n2);
function n2(e19, r2) {
var i2;
return Ri(this, n2), (i2 = t2.call(this, e19, r2, rO.Text)).collapsed = 0, i2.widgetHeight = 0, i2;
}
return Li(n2, [{ key: "replace", value: function(e19, t3, r2) {
var i2 = r2[0];
return 1 == r2.length && (i2 instanceof n2 || i2 instanceof sE && 4 & i2.flags) && Math.abs(this.length - i2.length) < 10 ? (i2 instanceof sE ? i2 = new n2(i2.length, this.height) : i2.height = this.height, this.outdated || (i2.outdated = false), i2) : iE.of(r2);
} }, { key: "updateHeight", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n3 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r2 = arguments.length > 3 ? arguments[3] : void 0;
return r2 && r2.from <= t3 && r2.more ? this.setHeight(e19, r2.heights[r2.index++]) : (n3 || this.outdated) && this.setHeight(e19, Math.max(this.widgetHeight, e19.heightForLine(this.length - this.collapsed))), this.outdated = false, this;
} }, { key: "toString", value: function() {
return "line(".concat(this.length).concat(this.collapsed ? -this.collapsed : "").concat(this.widgetHeight ? ":" + this.widgetHeight : "", ")");
} }]), n2;
}(), sE = function(e18) {
Ci(n2, iE);
var t2 = Oi(n2);
function n2(e19) {
return Ri(this, n2), t2.call(this, e19, 0);
}
return Li(n2, [{ key: "lines", value: function(e19, t3) {
var n3 = e19.lineAt(t3).number, r2 = e19.lineAt(t3 + this.length).number;
return { firstLine: n3, lastLine: r2, lineHeight: this.height / (r2 - n3 + 1) };
} }, { key: "blockAt", value: function(e19, t3, n3, r2) {
var i2 = this.lines(t3, r2), o2 = i2.firstLine, a2 = i2.lastLine, s2 = i2.lineHeight, u2 = Math.max(0, Math.min(a2 - o2, Math.floor((e19 - n3) / s2))), c2 = t3.line(o2 + u2), l2 = c2.from, f2 = c2.length;
return new nE(l2, f2, n3 + s2 * u2, s2, rO.Text);
} }, { key: "lineAt", value: function(e19, t3, n3, r2, i2) {
if (t3 == rE.ByHeight)
return this.blockAt(e19, n3, r2, i2);
if (t3 == rE.ByPosNoHeight) {
var o2 = n3.lineAt(e19), a2 = o2.from, s2 = o2.to;
return new nE(a2, s2 - a2, 0, 0, rO.Text);
}
var u2 = this.lines(n3, i2), c2 = u2.firstLine, l2 = u2.lineHeight, f2 = n3.lineAt(e19), h2 = f2.from, d2 = f2.length, v2 = f2.number;
return new nE(h2, d2, r2 + l2 * (v2 - c2), l2, rO.Text);
} }, { key: "forEachLine", value: function(e19, t3, n3, r2, i2, o2) {
for (var a2 = this.lines(n3, i2), s2 = a2.firstLine, u2 = a2.lineHeight, c2 = Math.max(e19, i2), l2 = Math.min(i2 + this.length, t3); c2 <= l2; ) {
var f2 = n3.lineAt(c2);
c2 == e19 && (r2 += u2 * (f2.number - s2)), o2(new nE(f2.from, f2.length, r2, u2, rO.Text)), r2 += u2, c2 = f2.to + 1;
}
} }, { key: "replace", value: function(e19, t3, r2) {
var i2 = this.length - t3;
if (i2 > 0) {
var o2 = r2[r2.length - 1];
o2 instanceof n2 ? r2[r2.length - 1] = new n2(o2.length + i2) : r2.push(null, new n2(i2 - 1));
}
if (e19 > 0) {
var a2 = r2[0];
a2 instanceof n2 ? r2[0] = new n2(e19 + a2.length) : r2.unshift(new n2(e19 - 1), null);
}
return iE.of(r2);
} }, { key: "decomposeLeft", value: function(e19, t3) {
t3.push(new n2(e19 - 1), null);
} }, { key: "decomposeRight", value: function(e19, t3) {
t3.push(null, new n2(this.length - e19 - 1));
} }, { key: "updateHeight", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], i2 = arguments.length > 3 ? arguments[3] : void 0, o2 = t3 + this.length;
if (i2 && i2.from <= t3 + this.length && i2.more) {
var a2 = [], s2 = Math.max(t3, i2.from), u2 = -1, c2 = e19.heightChanged;
for (i2.from > t3 && a2.push(new n2(i2.from - t3 - 1).updateHeight(e19, t3)); s2 <= o2 && i2.more; ) {
var l2 = e19.doc.lineAt(s2).length;
a2.length && a2.push(null);
var f2 = i2.heights[i2.index++];
-1 == u2 ? u2 = f2 : Math.abs(f2 - u2) >= 1e-3 && (u2 = -2);
var h2 = new aE(l2, f2);
h2.outdated = false, a2.push(h2), s2 += l2 + 1;
}
s2 <= o2 && a2.push(null, new n2(o2 - s2).updateHeight(e19, s2));
var d2 = iE.of(a2);
return e19.heightChanged = c2 || u2 < 0 || Math.abs(d2.height - this.height) >= 1e-3 || Math.abs(u2 - this.lines(e19.doc, t3).lineHeight) >= 1e-3, d2;
}
return (r2 || this.outdated) && (this.setHeight(e19, e19.heightForGap(t3, t3 + this.length)), this.outdated = false), this;
} }, { key: "toString", value: function() {
return "gap(".concat(this.length, ")");
} }]), n2;
}(), uE = function(e18) {
Ci(n2, iE);
var t2 = Oi(n2);
function n2(e19, r2, i2) {
var o2;
return Ri(this, n2), (o2 = t2.call(this, e19.length + r2 + i2.length, e19.height + i2.height, r2 | (e19.outdated || i2.outdated ? 2 : 0))).left = e19, o2.right = i2, o2.size = e19.size + i2.size, o2;
}
return Li(n2, [{ key: "break", get: function() {
return 1 & this.flags;
} }, { key: "blockAt", value: function(e19, t3, n3, r2) {
var i2 = n3 + this.left.height;
return e19 < i2 ? this.left.blockAt(e19, t3, n3, r2) : this.right.blockAt(e19, t3, i2, r2 + this.left.length + this.break);
} }, { key: "lineAt", value: function(e19, t3, n3, r2, i2) {
var o2 = r2 + this.left.height, a2 = i2 + this.left.length + this.break, s2 = t3 == rE.ByHeight ? e19 < o2 : e19 < a2, u2 = s2 ? this.left.lineAt(e19, t3, n3, r2, i2) : this.right.lineAt(e19, t3, n3, o2, a2);
if (this.break || (s2 ? u2.to < a2 : u2.from > a2))
return u2;
var c2 = t3 == rE.ByPosNoHeight ? rE.ByPosNoHeight : rE.ByPos;
return s2 ? u2.join(this.right.lineAt(a2, c2, n3, o2, a2)) : this.left.lineAt(a2, c2, n3, r2, i2).join(u2);
} }, { key: "forEachLine", value: function(e19, t3, n3, r2, i2, o2) {
var a2 = r2 + this.left.height, s2 = i2 + this.left.length + this.break;
if (this.break)
e19 < s2 && this.left.forEachLine(e19, t3, n3, r2, i2, o2), t3 >= s2 && this.right.forEachLine(e19, t3, n3, a2, s2, o2);
else {
var u2 = this.lineAt(s2, rE.ByPos, n3, r2, i2);
e19 < u2.from && this.left.forEachLine(e19, u2.from - 1, n3, r2, i2, o2), u2.to >= e19 && u2.from <= t3 && o2(u2), t3 > u2.to && this.right.forEachLine(u2.to + 1, t3, n3, a2, s2, o2);
}
} }, { key: "replace", value: function(e19, t3, n3) {
var r2 = this.left.length + this.break;
if (t3 < r2)
return this.balanced(this.left.replace(e19, t3, n3), this.right);
if (e19 > this.left.length)
return this.balanced(this.left, this.right.replace(e19 - r2, t3 - r2, n3));
var i2 = [];
e19 > 0 && this.decomposeLeft(e19, i2);
var o2, a2 = i2.length, s2 = bi(n3);
try {
for (s2.s(); !(o2 = s2.n()).done; ) {
var u2 = o2.value;
i2.push(u2);
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
if (e19 > 0 && cE(i2, a2 - 1), t3 < this.length) {
var c2 = i2.length;
this.decomposeRight(t3, i2), cE(i2, c2);
}
return iE.of(i2);
} }, { key: "decomposeLeft", value: function(e19, t3) {
var n3 = this.left.length;
if (e19 <= n3)
return this.left.decomposeLeft(e19, t3);
t3.push(this.left), this.break && e19 >= ++n3 && t3.push(null), e19 > n3 && this.right.decomposeLeft(e19 - n3, t3);
} }, { key: "decomposeRight", value: function(e19, t3) {
var n3 = this.left.length, r2 = n3 + this.break;
if (e19 >= r2)
return this.right.decomposeRight(e19 - r2, t3);
e19 < n3 && this.left.decomposeRight(e19, t3), this.break && e19 < r2 && t3.push(null), t3.push(this.right);
} }, { key: "balanced", value: function(e19, t3) {
return e19.size > 2 * t3.size || t3.size > 2 * e19.size ? iE.of(this.break ? [e19, null, t3] : [e19, t3]) : (this.left = e19, this.right = t3, this.height = e19.height + t3.height, this.outdated = e19.outdated || t3.outdated, this.size = e19.size + t3.size, this.length = e19.length + this.break + t3.length, this);
} }, { key: "updateHeight", value: function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n3 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r2 = arguments.length > 3 ? arguments[3] : void 0, i2 = this.left, o2 = this.right, a2 = t3 + i2.length + this.break, s2 = null;
return r2 && r2.from <= t3 + i2.length && r2.more ? s2 = i2 = i2.updateHeight(e19, t3, n3, r2) : i2.updateHeight(e19, t3, n3), r2 && r2.from <= a2 + o2.length && r2.more ? s2 = o2 = o2.updateHeight(e19, a2, n3, r2) : o2.updateHeight(e19, a2, n3), s2 ? this.balanced(i2, o2) : (this.height = this.left.height + this.right.height, this.outdated = false, this);
} }, { key: "toString", value: function() {
return this.left + (this.break ? " " : "-") + this.right;
} }]), n2;
}();
function cE(e18, t2) {
var n2, r2;
null == e18[t2] && (n2 = e18[t2 - 1]) instanceof sE && (r2 = e18[t2 + 1]) instanceof sE && e18.splice(t2 - 1, 3, new sE(n2.length + 1 + r2.length));
}
var lE = function() {
function e18(t2, n2) {
Ri(this, e18), this.pos = t2, this.oracle = n2, this.nodes = [], this.lineStart = -1, this.lineEnd = -1, this.covering = null, this.writtenTo = t2;
}
return Li(e18, [{ key: "isCovered", get: function() {
return this.covering && this.nodes[this.nodes.length - 1] == this.covering;
} }, { key: "span", value: function(e19, t2) {
if (this.lineStart > -1) {
var n2 = Math.min(t2, this.lineEnd), r2 = this.nodes[this.nodes.length - 1];
r2 instanceof aE ? r2.length += n2 - this.pos : (n2 > this.pos || !this.isCovered) && this.nodes.push(new aE(n2 - this.pos, -1)), this.writtenTo = n2, t2 > n2 && (this.nodes.push(null), this.writtenTo++, this.lineStart = -1);
}
this.pos = t2;
} }, { key: "point", value: function(e19, t2, n2) {
if (e19 < t2 || n2.heightRelevant) {
var r2 = n2.widget ? n2.widget.estimatedHeight : 0;
r2 < 0 && (r2 = this.oracle.lineHeight);
var i2 = t2 - e19;
n2.block ? this.addBlock(new oE(i2, r2, n2.type)) : (i2 || r2 >= 5) && this.addLineDeco(r2, i2);
} else
t2 > e19 && this.span(e19, t2);
this.lineEnd > -1 && this.lineEnd < this.pos && (this.lineEnd = this.oracle.doc.lineAt(this.pos).to);
} }, { key: "enterLine", value: function() {
if (!(this.lineStart > -1)) {
var e19 = this.oracle.doc.lineAt(this.pos), t2 = e19.from, n2 = e19.to;
this.lineStart = t2, this.lineEnd = n2, this.writtenTo < t2 && ((this.writtenTo < t2 - 1 || null == this.nodes[this.nodes.length - 1]) && this.nodes.push(this.blankContent(this.writtenTo, t2 - 1)), this.nodes.push(null)), this.pos > t2 && this.nodes.push(new aE(this.pos - t2, -1)), this.writtenTo = this.pos;
}
} }, { key: "blankContent", value: function(e19, t2) {
var n2 = new sE(t2 - e19);
return this.oracle.doc.lineAt(e19).to == t2 && (n2.flags |= 4), n2;
} }, { key: "ensureLine", value: function() {
this.enterLine();
var e19 = this.nodes.length ? this.nodes[this.nodes.length - 1] : null;
if (e19 instanceof aE)
return e19;
var t2 = new aE(0, -1);
return this.nodes.push(t2), t2;
} }, { key: "addBlock", value: function(e19) {
this.enterLine(), e19.type != rO.WidgetAfter || this.isCovered || this.ensureLine(), this.nodes.push(e19), this.writtenTo = this.pos = this.pos + e19.length, e19.type != rO.WidgetBefore && (this.covering = e19);
} }, { key: "addLineDeco", value: function(e19, t2) {
var n2 = this.ensureLine();
n2.length += t2, n2.collapsed += t2, n2.widgetHeight = Math.max(n2.widgetHeight, e19), this.writtenTo = this.pos = this.pos + t2;
} }, { key: "finish", value: function(e19) {
var t2 = 0 == this.nodes.length ? null : this.nodes[this.nodes.length - 1];
!(this.lineStart > -1) || t2 instanceof aE || this.isCovered ? (this.writtenTo < this.pos || null == t2) && this.nodes.push(this.blankContent(this.writtenTo, this.pos)) : this.nodes.push(new aE(0, -1));
var n2, r2 = e19, i2 = bi(this.nodes);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value;
o2 instanceof aE && o2.updateHeight(this.oracle, r2), r2 += o2 ? o2.length : 1;
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return this.nodes;
} }], [{ key: "build", value: function(t2, n2, r2, i2) {
var o2 = new e18(r2, t2);
return MC.spans(n2, r2, i2, o2, 0), o2.finish(r2);
} }]), e18;
}();
function fE(e18, t2, n2) {
var r2 = new hE();
return MC.compare(e18, t2, n2, r2, 0), r2.changes;
}
var hE = function() {
function e18() {
Ri(this, e18), this.changes = [];
}
return Li(e18, [{ key: "compareRange", value: function() {
} }, { key: "comparePoint", value: function(e19, t2, n2, r2) {
(e19 < t2 || n2 && n2.heightRelevant || r2 && r2.heightRelevant) && cO(e19, t2, this.changes, 5);
} }]), e18;
}();
function dE(e18, t2) {
for (var n2 = e18.getBoundingClientRect(), r2 = e18.ownerDocument, i2 = r2.defaultView || window, o2 = Math.max(0, n2.left), a2 = Math.min(i2.innerWidth, n2.right), s2 = Math.max(0, n2.top), u2 = Math.min(i2.innerHeight, n2.bottom), c2 = e18.parentNode; c2 && c2 != r2.body; )
if (1 == c2.nodeType) {
var l2 = c2, f2 = window.getComputedStyle(l2);
if ((l2.scrollHeight > l2.clientHeight || l2.scrollWidth > l2.clientWidth) && "visible" != f2.overflow) {
var h2 = l2.getBoundingClientRect();
o2 = Math.max(o2, h2.left), a2 = Math.min(a2, h2.right), s2 = Math.max(s2, h2.top), u2 = c2 == e18.parentNode ? h2.bottom : Math.min(u2, h2.bottom);
}
c2 = "absolute" == f2.position || "fixed" == f2.position ? l2.offsetParent : l2.parentNode;
} else {
if (11 != c2.nodeType)
break;
c2 = c2.host;
}
return { left: o2 - n2.left, right: Math.max(o2, a2) - n2.left, top: s2 - (n2.top + t2), bottom: Math.max(s2, u2) - (n2.top + t2) };
}
function vE(e18, t2) {
var n2 = e18.getBoundingClientRect();
return { left: 0, right: n2.right - n2.left, top: t2, bottom: n2.bottom - (n2.top + t2) };
}
var pE = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.from = t2, this.to = n2, this.size = r2;
}
return Li(e18, [{ key: "draw", value: function(e19) {
return iO.replace({ widget: new mE(this.size, e19) }).range(this.from, this.to);
} }], [{ key: "same", value: function(e19, t2) {
if (e19.length != t2.length)
return false;
for (var n2 = 0; n2 < e19.length; n2++) {
var r2 = e19[n2], i2 = t2[n2];
if (r2.from != i2.from || r2.to != i2.to || r2.size != i2.size)
return false;
}
return true;
} }]), e18;
}(), mE = function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2(e19, r2) {
var i2;
return Ri(this, n2), (i2 = t2.call(this)).size = e19, i2.vertical = r2, i2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return e19.size == this.size && e19.vertical == this.vertical;
} }, { key: "toDOM", value: function() {
var e19 = document.createElement("div");
return this.vertical ? e19.style.height = this.size + "px" : (e19.style.width = this.size + "px", e19.style.height = "2px", e19.style.display = "inline-block"), e19;
} }, { key: "estimatedHeight", get: function() {
return this.vertical ? this.size : -1;
} }]), n2;
}(), gE = function() {
function e18(t2) {
Ri(this, e18), this.state = t2, this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 }, this.inView = true, this.paddingTop = 0, this.paddingBottom = 0, this.contentDOMWidth = 0, this.contentDOMHeight = 0, this.editorHeight = 0, this.editorWidth = 0, this.heightOracle = new eE(), this.scaler = jE, this.scrollTarget = null, this.printing = false, this.mustMeasureContent = true, this.defaultTextDirection = LO.RTL, this.visibleRanges = [], this.mustEnforceCursorAssoc = false, this.stateDeco = t2.facet(AO).filter(function(e19) {
return "function" != typeof e19;
}), this.heightMap = iE.empty().applyChanges(this.stateDeco, e_.empty, this.heightOracle.setDoc(t2.doc), [new RO(0, 0, 0, t2.doc.length)]), this.viewport = this.getViewport(0, null), this.updateViewportLines(), this.updateForViewport(), this.lineGaps = this.ensureLineGaps([]), this.lineGapDeco = iO.set(this.lineGaps.map(function(e19) {
return e19.draw(false);
})), this.computeVisibleRanges();
}
return Li(e18, [{ key: "updateForViewport", value: function() {
for (var e19 = this, t2 = [this.viewport], n2 = this.state.selection.main, r2 = function(r3) {
var i3 = r3 ? n2.head : n2.anchor;
if (!t2.some(function(e20) {
var t3 = e20.from, n3 = e20.to;
return i3 >= t3 && i3 <= n3;
})) {
var o2 = e19.lineBlockAt(i3), a2 = o2.from, s2 = o2.to;
t2.push(new yE(a2, s2));
}
}, i2 = 0; i2 <= 1; i2++)
r2(i2);
this.viewports = t2.sort(function(e20, t3) {
return e20.from - t3.from;
}), this.scaler = this.heightMap.height <= 7e6 ? jE : new xE(this.heightOracle.doc, this.heightMap, this.viewports);
} }, { key: "updateViewportLines", value: function() {
var e19 = this;
this.viewportLines = [], this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.state.doc, 0, 0, function(t2) {
e19.viewportLines.push(1 == e19.scaler.scale ? t2 : SE(t2, e19.scaler));
});
} }, { key: "update", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
this.state = e19.state;
var n2 = this.stateDeco;
this.stateDeco = this.state.facet(AO).filter(function(e20) {
return "function" != typeof e20;
});
var r2 = e19.changedRanges, i2 = RO.extendWithRanges(r2, fE(n2, this.stateDeco, e19 ? e19.changes : __.empty(this.state.doc.length))), o2 = this.heightMap.height;
this.heightMap = this.heightMap.applyChanges(this.stateDeco, e19.startState.doc, this.heightOracle.setDoc(this.state.doc), i2), this.heightMap.height != o2 && (e19.flags |= 2);
var a2 = i2.length ? this.mapViewport(this.viewport, e19.changes) : this.viewport;
(t2 && (t2.range.head < a2.from || t2.range.head > a2.to) || !this.viewportIsAppropriate(a2)) && (a2 = this.getViewport(0, t2));
var s2 = !e19.changes.empty || 2 & e19.flags || a2.from != this.viewport.from || a2.to != this.viewport.to;
this.viewport = a2, this.updateForViewport(), s2 && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) && this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, e19.changes))), e19.flags |= this.computeVisibleRanges(), t2 && (this.scrollTarget = t2), !this.mustEnforceCursorAssoc && e19.selectionSet && e19.view.lineWrapping && e19.state.selection.main.empty && e19.state.selection.main.assoc && (this.mustEnforceCursorAssoc = true);
} }, { key: "measure", value: function(e19) {
var t2 = e19.contentDOM, n2 = window.getComputedStyle(t2), r2 = this.heightOracle, i2 = n2.whiteSpace;
this.defaultTextDirection = "rtl" == n2.direction ? LO.RTL : LO.LTR;
var o2 = this.heightOracle.mustRefreshForWrapping(i2), a2 = o2 || this.mustMeasureContent || this.contentDOMHeight != t2.clientHeight;
this.contentDOMHeight = t2.clientHeight, this.mustMeasureContent = false;
var s2 = 0, u2 = 0, c2 = parseInt(n2.paddingTop) || 0, l2 = parseInt(n2.paddingBottom) || 0;
this.paddingTop == c2 && this.paddingBottom == l2 || (this.paddingTop = c2, this.paddingBottom = l2, s2 |= 10), this.editorWidth != e19.scrollDOM.clientWidth && (r2.lineWrapping && (a2 = true), this.editorWidth = e19.scrollDOM.clientWidth, s2 |= 8);
var f2 = (this.printing ? vE : dE)(t2, this.paddingTop), h2 = f2.top - this.pixelViewport.top, d2 = f2.bottom - this.pixelViewport.bottom;
this.pixelViewport = f2;
var v2 = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left;
if (v2 != this.inView && (this.inView = v2, v2 && (a2 = true)), !this.inView && !this.scrollTarget)
return 0;
var p2 = t2.clientWidth;
if (this.contentDOMWidth == p2 && this.editorHeight == e19.scrollDOM.clientHeight || (this.contentDOMWidth = p2, this.editorHeight = e19.scrollDOM.clientHeight, s2 |= 8), a2) {
var m2 = e19.docView.measureVisibleLineHeights(this.viewport);
if (r2.mustRefreshForHeights(m2) && (o2 = true), o2 || r2.lineWrapping && Math.abs(p2 - this.contentDOMWidth) > r2.charWidth) {
var g2 = e19.docView.measureTextSize(), y2 = g2.lineHeight, b2 = g2.charWidth;
(o2 = r2.refresh(i2, y2, b2, p2 / b2, m2)) && (e19.docView.minWidth = 0, s2 |= 8);
}
h2 > 0 && d2 > 0 ? u2 = Math.max(h2, d2) : h2 < 0 && d2 < 0 && (u2 = Math.min(h2, d2)), r2.heightChanged = false;
var k2, w2 = bi(this.viewports);
try {
for (w2.s(); !(k2 = w2.n()).done; ) {
var j2 = k2.value, x2 = j2.from == this.viewport.from ? m2 : e19.docView.measureVisibleLineHeights(j2);
this.heightMap = this.heightMap.updateHeight(r2, 0, o2, new tE(j2.from, x2));
}
} catch (e20) {
w2.e(e20);
} finally {
w2.f();
}
r2.heightChanged && (s2 |= 2);
}
var S2 = !this.viewportIsAppropriate(this.viewport, u2) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
return S2 && (this.viewport = this.getViewport(u2, this.scrollTarget)), this.updateForViewport(), (2 & s2 || S2) && this.updateViewportLines(), (this.lineGaps.length || this.viewport.to - this.viewport.from > 4e3) && this.updateLineGaps(this.ensureLineGaps(o2 ? [] : this.lineGaps, e19)), s2 |= this.computeVisibleRanges(), this.mustEnforceCursorAssoc && (this.mustEnforceCursorAssoc = false, e19.docView.enforceCursorAssoc()), s2;
} }, { key: "visibleTop", get: function() {
return this.scaler.fromDOM(this.pixelViewport.top);
} }, { key: "visibleBottom", get: function() {
return this.scaler.fromDOM(this.pixelViewport.bottom);
} }, { key: "getViewport", value: function(e19, t2) {
var n2 = 0.5 - Math.max(-0.5, Math.min(0.5, e19 / 1e3 / 2)), r2 = this.heightMap, i2 = this.state.doc, o2 = this.visibleTop, a2 = this.visibleBottom, s2 = new yE(r2.lineAt(o2 - 1e3 * n2, rE.ByHeight, i2, 0, 0).from, r2.lineAt(a2 + 1e3 * (1 - n2), rE.ByHeight, i2, 0, 0).to);
if (t2) {
var u2 = t2.range.head;
if (u2 < s2.from || u2 > s2.to) {
var c2, l2 = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top), f2 = r2.lineAt(u2, rE.ByPos, i2, 0, 0);
c2 = "center" == t2.y ? (f2.top + f2.bottom) / 2 - l2 / 2 : "start" == t2.y || "nearest" == t2.y && u2 < s2.from ? f2.top : f2.bottom - l2, s2 = new yE(r2.lineAt(c2 - 500, rE.ByHeight, i2, 0, 0).from, r2.lineAt(c2 + l2 + 500, rE.ByHeight, i2, 0, 0).to);
}
}
return s2;
} }, { key: "mapViewport", value: function(e19, t2) {
var n2 = t2.mapPos(e19.from, -1), r2 = t2.mapPos(e19.to, 1);
return new yE(this.heightMap.lineAt(n2, rE.ByPos, this.state.doc, 0, 0).from, this.heightMap.lineAt(r2, rE.ByPos, this.state.doc, 0, 0).to);
} }, { key: "viewportIsAppropriate", value: function(e19) {
var t2 = e19.from, n2 = e19.to, r2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
if (!this.inView)
return true;
var i2 = this.heightMap.lineAt(t2, rE.ByPos, this.state.doc, 0, 0), o2 = i2.top, a2 = this.heightMap.lineAt(n2, rE.ByPos, this.state.doc, 0, 0), s2 = a2.bottom, u2 = this.visibleTop, c2 = this.visibleBottom;
return (0 == t2 || o2 <= u2 - Math.max(10, Math.min(-r2, 250))) && (n2 == this.state.doc.length || s2 >= c2 + Math.max(10, Math.min(r2, 250))) && o2 > u2 - 2e3 && s2 < c2 + 2e3;
} }, { key: "mapLineGaps", value: function(e19, t2) {
if (!e19.length || t2.empty)
return e19;
var n2, r2 = [], i2 = bi(e19);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value;
t2.touchesRange(o2.from, o2.to) || r2.push(new pE(t2.mapPos(o2.from), t2.mapPos(o2.to), o2.size));
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return r2;
} }, { key: "ensureLineGaps", value: function(e19, t2) {
var n2 = this, r2 = this.heightOracle.lineWrapping, i2 = r2 ? 1e4 : 2e3, o2 = i2 >> 1, a2 = i2 << 1;
if (this.defaultTextDirection != LO.LTR && !r2)
return [];
var s2, u2 = [], c2 = function i3(a3, s3, c3, l3) {
if (!(s3 - a3 < o2)) {
var f3 = n2.state.selection.main, h3 = [f3.from];
f3.empty || h3.push(f3.to);
for (var d3 = 0, v3 = h3; d3 < v3.length; d3++) {
var p3 = v3[d3];
if (p3 > a3 && p3 < s3)
return i3(a3, p3 - 10, c3, l3), void i3(p3 + 10, s3, c3, l3);
}
var m3 = function(e20, t3) {
var n3, r3 = bi(e20);
try {
for (r3.s(); !(n3 = r3.n()).done; ) {
var i4 = n3.value;
if (t3(i4))
return i4;
}
} catch (e21) {
r3.e(e21);
} finally {
r3.f();
}
return;
}(e19, function(e20) {
return e20.from >= c3.from && e20.to <= c3.to && Math.abs(e20.from - a3) < o2 && Math.abs(e20.to - s3) < o2 && !h3.some(function(t3) {
return e20.from < t3 && e20.to > t3;
});
});
if (!m3) {
if (s3 < c3.to && t2 && r2 && t2.visibleRanges.some(function(e20) {
return e20.from <= s3 && e20.to >= s3;
})) {
var g3 = t2.moveToLineBoundary(T_.cursor(s3), false, true).head;
g3 > a3 && (s3 = g3);
}
m3 = new pE(a3, s3, n2.gapSize(c3, a3, s3, l3));
}
u2.push(m3);
}
}, l2 = bi(this.viewportLines);
try {
for (l2.s(); !(s2 = l2.n()).done; ) {
var f2 = s2.value;
if (!(f2.length < a2)) {
var h2 = bE(f2.from, f2.to, this.stateDeco);
if (!(h2.total < a2)) {
var d2 = this.scrollTarget ? this.scrollTarget.range.head : null, v2 = void 0, p2 = void 0;
if (r2) {
var m2 = i2 / this.heightOracle.lineLength * this.heightOracle.lineHeight, g2 = void 0, y2 = void 0;
null != d2 ? (g2 = Math.max(f2.from, d2 - i2), y2 = Math.min(f2.to, d2 + i2)) : (g2 = (this.visibleTop - f2.top - m2) / f2.height, y2 = (this.visibleBottom - f2.top + m2) / f2.height), v2 = kE(h2, g2), p2 = kE(h2, y2);
} else {
var b2 = void 0, k2 = void 0;
if (null != d2)
b2 = Math.max(f2.from, d2 - a2), k2 = Math.min(f2.to, d2 + a2);
else {
var w2 = h2.total * this.heightOracle.charWidth, j2 = i2 * this.heightOracle.charWidth;
b2 = (this.pixelViewport.left - j2) / w2, k2 = (this.pixelViewport.right + j2) / w2;
}
v2 = kE(h2, b2), p2 = kE(h2, k2);
}
v2 > f2.from && c2(f2.from, v2, f2, h2), p2 < f2.to && c2(p2, f2.to, f2, h2);
}
}
}
} catch (e20) {
l2.e(e20);
} finally {
l2.f();
}
return u2;
} }, { key: "gapSize", value: function(e19, t2, n2, r2) {
var i2 = wE(r2, n2) - wE(r2, t2);
return this.heightOracle.lineWrapping ? e19.height * i2 : r2.total * this.heightOracle.charWidth * i2;
} }, { key: "updateLineGaps", value: function(e19) {
var t2 = this;
pE.same(e19, this.lineGaps) || (this.lineGaps = e19, this.lineGapDeco = iO.set(e19.map(function(e20) {
return e20.draw(t2.heightOracle.lineWrapping);
})));
} }, { key: "computeVisibleRanges", value: function() {
var e19 = this.stateDeco;
this.lineGaps.length && (e19 = e19.concat(this.lineGapDeco));
var t2 = [];
MC.spans(e19, this.viewport.from, this.viewport.to, { span: function(e20, n3) {
t2.push({ from: e20, to: n3 });
}, point: function() {
} }, 20);
var n2 = t2.length != this.visibleRanges.length || this.visibleRanges.some(function(e20, n3) {
return e20.from != t2[n3].from || e20.to != t2[n3].to;
});
return this.visibleRanges = t2, n2 ? 4 : 0;
} }, { key: "lineBlockAt", value: function(e19) {
return e19 >= this.viewport.from && e19 <= this.viewport.to && this.viewportLines.find(function(t2) {
return t2.from <= e19 && t2.to >= e19;
}) || SE(this.heightMap.lineAt(e19, rE.ByPos, this.state.doc, 0, 0), this.scaler);
} }, { key: "lineBlockAtHeight", value: function(e19) {
return SE(this.heightMap.lineAt(this.scaler.fromDOM(e19), rE.ByHeight, this.state.doc, 0, 0), this.scaler);
} }, { key: "elementAtHeight", value: function(e19) {
return SE(this.heightMap.blockAt(this.scaler.fromDOM(e19), this.state.doc, 0, 0), this.scaler);
} }, { key: "docHeight", get: function() {
return this.scaler.toDOM(this.heightMap.height);
} }, { key: "contentHeight", get: function() {
return this.docHeight + this.paddingTop + this.paddingBottom;
} }]), e18;
}(), yE = Li(function e5(t2, n2) {
Ri(this, e5), this.from = t2, this.to = n2;
});
function bE(e18, t2, n2) {
var r2 = [], i2 = e18, o2 = 0;
return MC.spans(n2, e18, t2, { span: function() {
}, point: function(e19, t3) {
e19 > i2 && (r2.push({ from: i2, to: e19 }), o2 += e19 - i2), i2 = t3;
} }, 20), i2 < t2 && (r2.push({ from: i2, to: t2 }), o2 += t2 - i2), { total: o2, ranges: r2 };
}
function kE(e18, t2) {
var n2 = e18.total, r2 = e18.ranges;
if (t2 <= 0)
return r2[0].from;
if (t2 >= 1)
return r2[r2.length - 1].to;
for (var i2 = Math.floor(n2 * t2), o2 = 0; ; o2++) {
var a2 = r2[o2], s2 = a2.from, u2 = a2.to - s2;
if (i2 <= u2)
return s2 + i2;
i2 -= u2;
}
}
function wE(e18, t2) {
var n2, r2 = 0, i2 = bi(e18.ranges);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value, a2 = o2.from, s2 = o2.to;
if (t2 <= s2) {
r2 += t2 - a2;
break;
}
r2 += s2 - a2;
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return r2 / e18.total;
}
var jE = { toDOM: function(e18) {
return e18;
}, fromDOM: function(e18) {
return e18;
}, scale: 1 }, xE = function() {
function e18(t2, n2, r2) {
Ri(this, e18);
var i2 = 0, o2 = 0, a2 = 0;
this.viewports = r2.map(function(e19) {
var r3 = e19.from, o3 = e19.to, a3 = n2.lineAt(r3, rE.ByPos, t2, 0, 0).top, s3 = n2.lineAt(o3, rE.ByPos, t2, 0, 0).bottom;
return i2 += s3 - a3, { from: r3, to: o3, top: a3, bottom: s3, domTop: 0, domBottom: 0 };
}), this.scale = (7e6 - i2) / (n2.height - i2);
var s2, u2 = bi(this.viewports);
try {
for (u2.s(); !(s2 = u2.n()).done; ) {
var c2 = s2.value;
c2.domTop = a2 + (c2.top - o2) * this.scale, a2 = c2.domBottom = c2.domTop + (c2.bottom - c2.top), o2 = c2.bottom;
}
} catch (e19) {
u2.e(e19);
} finally {
u2.f();
}
}
return Li(e18, [{ key: "toDOM", value: function(e19) {
for (var t2 = 0, n2 = 0, r2 = 0; ; t2++) {
var i2 = t2 < this.viewports.length ? this.viewports[t2] : null;
if (!i2 || e19 < i2.top)
return r2 + (e19 - n2) * this.scale;
if (e19 <= i2.bottom)
return i2.domTop + (e19 - i2.top);
n2 = i2.bottom, r2 = i2.domBottom;
}
} }, { key: "fromDOM", value: function(e19) {
for (var t2 = 0, n2 = 0, r2 = 0; ; t2++) {
var i2 = t2 < this.viewports.length ? this.viewports[t2] : null;
if (!i2 || e19 < i2.domTop)
return n2 + (e19 - r2) / this.scale;
if (e19 <= i2.domBottom)
return i2.top + (e19 - i2.domTop);
n2 = i2.bottom, r2 = i2.domBottom;
}
} }]), e18;
}();
function SE(e18, t2) {
if (1 == t2.scale)
return e18;
var n2 = t2.toDOM(e18.top), r2 = t2.toDOM(e18.bottom);
return new nE(e18.from, e18.length, n2, r2 - n2, Array.isArray(e18.type) ? e18.type.map(function(e19) {
return SE(e19, t2);
}) : e18.type);
}
var _E = R_.define({ combine: function(e18) {
return e18.join(" ");
} }), CE = R_.define({ combine: function(e18) {
return e18.indexOf(true) > -1;
} }), $E = UC.newName(), OE = UC.newName(), ME = UC.newName(), EE = { "&light": "." + OE, "&dark": "." + ME };
function PE(e18, t2, n2) {
return new UC(t2, { finish: function(t3) {
return /&/.test(t3) ? t3.replace(/&\w*/, function(t4) {
if ("&" == t4)
return e18;
if (!n2 || !n2[t4])
throw new RangeError("Unsupported selector: ".concat(t4));
return n2[t4];
}) : e18 + " " + t3;
} });
}
var AE = PE("." + $E, { "&.cm-editor": { position: "relative !important", boxSizing: "border-box", "&.cm-focused": { outline: "1px dotted #212121" }, display: "flex !important", flexDirection: "column" }, ".cm-scroller": { display: "flex !important", alignItems: "flex-start !important", fontFamily: "monospace", lineHeight: 1.4, height: "100%", overflowX: "auto", position: "relative", zIndex: 0 }, ".cm-content": { margin: 0, flexGrow: 2, flexShrink: 0, minHeight: "100%", display: "block", whiteSpace: "pre", wordWrap: "normal", boxSizing: "border-box", padding: "4px 0", outline: "none", "&[contenteditable=true]": { WebkitUserModify: "read-write-plaintext-only" } }, ".cm-lineWrapping": { whiteSpace_fallback: "pre-wrap", whiteSpace: "break-spaces", wordBreak: "break-word", overflowWrap: "anywhere", flexShrink: 1 }, "&light .cm-content": { caretColor: "black" }, "&dark .cm-content": { caretColor: "white" }, ".cm-line": { display: "block", padding: "0 2px 0 4px" }, ".cm-selectionLayer": { zIndex: -1, contain: "size style" }, ".cm-selectionBackground": { position: "absolute" }, "&light .cm-selectionBackground": { background: "#d9d9d9" }, "&dark .cm-selectionBackground": { background: "#222" }, "&light.cm-focused .cm-selectionBackground": { background: "#d7d4f0" }, "&dark.cm-focused .cm-selectionBackground": { background: "#233" }, ".cm-cursorLayer": { zIndex: 100, contain: "size style", pointerEvents: "none" }, "&.cm-focused .cm-cursorLayer": { animation: "steps(1) cm-blink 1.2s infinite" }, "@keyframes cm-blink": { "0%": {}, "50%": { opacity: 0 }, "100%": {} }, "@keyframes cm-blink2": { "0%": {}, "50%": { opacity: 0 }, "100%": {} }, ".cm-cursor, .cm-dropCursor": { position: "absolute", borderLeft: "1.2px solid black", marginLeft: "-0.6px", pointerEvents: "none" }, ".cm-cursor": { display: "none" }, "&dark .cm-cursor": { borderLeftColor: "#444" }, "&.cm-focused .cm-cursor": { display: "block" }, "&light .cm-activeLine": { backgroundColor: "#cceeff44" }, "&dark .cm-activeLine": { backgroundColor: "#99eeff33" }, "&light .cm-specialChar": { color: "red" }, "&dark .cm-specialChar": { color: "#f78" }, ".cm-gutters": { flexShrink: 0, display: "flex", height: "100%", boxSizing: "border-box", left: 0, zIndex: 200 }, "&light .cm-gutters": { backgroundColor: "#f5f5f5", color: "#6c6c6c", borderRight: "1px solid #ddd" }, "&dark .cm-gutters": { backgroundColor: "#333338", color: "#ccc" }, ".cm-gutter": { display: "flex !important", flexDirection: "column", flexShrink: 0, boxSizing: "border-box", minHeight: "100%", overflow: "hidden" }, ".cm-gutterElement": { boxSizing: "border-box" }, ".cm-lineNumbers .cm-gutterElement": { padding: "0 3px 0 5px", minWidth: "20px", textAlign: "right", whiteSpace: "nowrap" }, "&light .cm-activeLineGutter": { backgroundColor: "#e2f2ff" }, "&dark .cm-activeLineGutter": { backgroundColor: "#222227" }, ".cm-panels": { boxSizing: "border-box", position: "sticky", left: 0, right: 0 }, "&light .cm-panels": { backgroundColor: "#f5f5f5", color: "black" }, "&light .cm-panels-top": { borderBottom: "1px solid #ddd" }, "&light .cm-panels-bottom": { borderTop: "1px solid #ddd" }, "&dark .cm-panels": { backgroundColor: "#333338", color: "white" }, ".cm-tab": { display: "inline-block", overflow: "hidden", verticalAlign: "bottom" }, ".cm-widgetBuffer": { verticalAlign: "text-top", height: "1em", width: 0, display: "inline" }, ".cm-placeholder": { color: "#888", display: "inline-block", verticalAlign: "top" }, ".cm-button": { verticalAlign: "middle", color: "inherit", fontSize: "70%", padding: ".2em 1em", borderRadius: "1px" }, "&light .cm-button": { backgroundImage: "linear-gradient(#eff1f5, #d9d9df)", border: "1px solid #888", "&:active": { backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)" } }, "&dark .cm-button": { backgroundImage: "linear-gradient(#393939, #111)", border: "1px solid #888", "&:active": { backgroundImage: "linear-gradient(#111, #333)" } }, ".cm-textfield": { verticalAlign: "middle", color: "inherit", fontSize: "70%", border: "1px solid silver", padding: ".2em .5em" }, "&light .cm-textfield": { backgroundColor: "white" }, "&dark .cm-textfield": { border: "1px solid #555", backgroundColor: "inherit" } }, EE), TE = { childList: true, characterData: true, subtree: true, attributes: true, characterDataOldValue: true }, IE = q$.ie && q$.ie_version <= 11, NE = function() {
function e18(t2, n2, r2) {
var i2 = this;
Ri(this, e18), this.view = t2, this.onChange = n2, this.onScrollChanged = r2, this.active = false, this.selectionRange = new m$(), this.selectionChanged = false, this.delayedFlush = -1, this.resizeTimeout = -1, this.queue = [], this.delayedAndroidKey = null, this.lastChange = 0, this.scrollTargets = [], this.intersection = null, this.resize = null, this.intersecting = false, this.gapIntersection = null, this.gaps = [], this.parentCheck = -1, this.dom = t2.contentDOM, this.observer = new MutationObserver(function(e19) {
var n3, r3 = bi(e19);
try {
for (r3.s(); !(n3 = r3.n()).done; ) {
var o2 = n3.value;
i2.queue.push(o2);
}
} catch (e20) {
r3.e(e20);
} finally {
r3.f();
}
(q$.ie && q$.ie_version <= 11 || q$.ios && t2.composing) && e19.some(function(e20) {
return "childList" == e20.type && e20.removedNodes.length || "characterData" == e20.type && e20.oldValue.length > e20.target.nodeValue.length;
}) ? i2.flushSoon() : i2.flush();
}), IE && (this.onCharData = function(e19) {
i2.queue.push({ target: e19.target, type: "characterData", oldValue: e19.prevValue }), i2.flushSoon();
}), this.onSelectionChange = this.onSelectionChange.bind(this), this.onResize = this.onResize.bind(this), this.onPrint = this.onPrint.bind(this), this.onScroll = this.onScroll.bind(this), "function" == typeof ResizeObserver && (this.resize = new ResizeObserver(function() {
i2.view.docView.lastUpdate < Date.now() - 75 && i2.onResize();
}), this.resize.observe(t2.scrollDOM)), this.addWindowListeners(this.win = t2.win), this.start(), "function" == typeof IntersectionObserver && (this.intersection = new IntersectionObserver(function(e19) {
i2.parentCheck < 0 && (i2.parentCheck = setTimeout(i2.listenForScroll.bind(i2), 1e3)), e19.length > 0 && e19[e19.length - 1].intersectionRatio > 0 != i2.intersecting && (i2.intersecting = !i2.intersecting, i2.intersecting != i2.view.inView && i2.onScrollChanged(document.createEvent("Event")));
}, {}), this.intersection.observe(this.dom), this.gapIntersection = new IntersectionObserver(function(e19) {
e19.length > 0 && e19[e19.length - 1].intersectionRatio > 0 && i2.onScrollChanged(document.createEvent("Event"));
}, {})), this.listenForScroll(), this.readSelectionRange();
}
return Li(e18, [{ key: "onScroll", value: function(e19) {
this.intersecting && this.flush(false), this.onScrollChanged(e19);
} }, { key: "onResize", value: function() {
var e19 = this;
this.resizeTimeout < 0 && (this.resizeTimeout = setTimeout(function() {
e19.resizeTimeout = -1, e19.view.requestMeasure();
}, 50));
} }, { key: "onPrint", value: function() {
var e19 = this;
this.view.viewState.printing = true, this.view.measure(), setTimeout(function() {
e19.view.viewState.printing = false, e19.view.requestMeasure();
}, 500);
} }, { key: "updateGaps", value: function(e19) {
if (this.gapIntersection && (e19.length != this.gaps.length || this.gaps.some(function(t3, n3) {
return t3 != e19[n3];
}))) {
this.gapIntersection.disconnect();
var t2, n2 = bi(e19);
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
var r2 = t2.value;
this.gapIntersection.observe(r2);
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
this.gaps = e19;
}
} }, { key: "onSelectionChange", value: function(e19) {
var t2 = this.selectionChanged;
if (this.readSelectionRange() && !this.delayedAndroidKey) {
var n2 = this.view, r2 = this.selectionRange;
if (n2.state.facet(_O) ? n2.root.activeElement == this.dom : a$(n2.dom, r2)) {
var i2 = r2.anchorNode && n2.docView.nearest(r2.anchorNode);
i2 && i2.ignoreEvent(e19) ? t2 || (this.selectionChanged = false) : (q$.ie && q$.ie_version <= 11 || q$.android && q$.chrome) && !n2.state.selection.main.empty && r2.focusNode && u$(r2.focusNode, r2.focusOffset, r2.anchorNode, r2.anchorOffset) ? this.flushSoon() : this.flush(false);
}
}
} }, { key: "readSelectionRange", value: function() {
var e19 = this.view, t2 = q$.safari && 11 == e19.root.nodeType && function(e20) {
for (var t3 = e20.activeElement; t3 && t3.shadowRoot; )
t3 = t3.shadowRoot.activeElement;
return t3;
}(this.dom.ownerDocument) == this.dom && function(e20) {
var t3 = null;
function n3(e21) {
e21.preventDefault(), e21.stopImmediatePropagation(), t3 = e21.getTargetRanges()[0];
}
if (e20.contentDOM.addEventListener("beforeinput", n3, true), e20.dom.ownerDocument.execCommand("indent"), e20.contentDOM.removeEventListener("beforeinput", n3, true), !t3)
return null;
var r2 = t3.startContainer, i2 = t3.startOffset, o2 = t3.endContainer, a2 = t3.endOffset, s2 = e20.docView.domAtPos(e20.state.selection.main.anchor);
if (u$(s2.node, s2.offset, o2, a2)) {
var u2 = [o2, a2, r2, i2];
r2 = u2[0], i2 = u2[1], o2 = u2[2], a2 = u2[3];
}
return { anchorNode: r2, anchorOffset: i2, focusNode: o2, focusOffset: a2 };
}(this.view) || i$(e19.root);
if (!t2 || this.selectionRange.eq(t2))
return false;
var n2 = a$(this.dom, t2);
return n2 && !this.selectionChanged && e19.inputState.lastFocusTime > Date.now() - 200 && e19.inputState.lastTouchTime < Date.now() - 300 && function(e20, t3) {
var n3 = t3.focusNode, r2 = t3.focusOffset;
if (!n3 || t3.anchorNode != n3 || t3.anchorOffset != r2)
return false;
for (; ; )
if (r2) {
if (1 != n3.nodeType)
return false;
var i2 = n3.childNodes[r2 - 1];
"false" == i2.contentEditable ? r2-- : r2 = f$(n3 = i2);
} else {
if (n3 == e20)
return true;
r2 = c$(n3), n3 = n3.parentNode;
}
}(this.dom, t2) ? (this.view.inputState.lastFocusTime = 0, e19.docView.updateSelection(), false) : (this.selectionRange.setRange(t2), n2 && (this.selectionChanged = true), true);
} }, { key: "setSelectionRange", value: function(e19, t2) {
this.selectionRange.set(e19.node, e19.offset, t2.node, t2.offset), this.selectionChanged = false;
} }, { key: "clearSelectionRange", value: function() {
this.selectionRange.set(null, 0, null, 0);
} }, { key: "listenForScroll", value: function() {
this.parentCheck = -1;
for (var e19 = 0, t2 = null, n2 = this.dom; n2; )
if (1 == n2.nodeType)
!t2 && e19 < this.scrollTargets.length && this.scrollTargets[e19] == n2 ? e19++ : t2 || (t2 = this.scrollTargets.slice(0, e19)), t2 && t2.push(n2), n2 = n2.assignedSlot || n2.parentNode;
else {
if (11 != n2.nodeType)
break;
n2 = n2.host;
}
if (e19 < this.scrollTargets.length && !t2 && (t2 = this.scrollTargets.slice(0, e19)), t2) {
var r2, i2 = bi(this.scrollTargets);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
r2.value.removeEventListener("scroll", this.onScroll);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
var o2, a2 = bi(this.scrollTargets = t2);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
o2.value.addEventListener("scroll", this.onScroll);
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
}
} }, { key: "ignore", value: function(e19) {
if (!this.active)
return e19();
try {
return this.stop(), e19();
} finally {
this.start(), this.clear();
}
} }, { key: "start", value: function() {
this.active || (this.observer.observe(this.dom, TE), IE && this.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.active = true);
} }, { key: "stop", value: function() {
this.active && (this.active = false, this.observer.disconnect(), IE && this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData));
} }, { key: "clear", value: function() {
this.processRecords(), this.queue.length = 0, this.selectionChanged = false;
} }, { key: "delayAndroidKey", value: function(e19, t2) {
var n2, r2 = this;
this.delayedAndroidKey || this.view.win.requestAnimationFrame(function() {
var e20 = r2.delayedAndroidKey;
r2.delayedAndroidKey = null, r2.delayedFlush = -1, !r2.flush() && e20.force && k$(r2.dom, e20.key, e20.keyCode);
}), this.delayedAndroidKey && "Enter" != e19 || (this.delayedAndroidKey = { key: e19, keyCode: t2, force: this.lastChange < Date.now() - 50 || !!(null === (n2 = this.delayedAndroidKey) || void 0 === n2 ? void 0 : n2.force) });
} }, { key: "flushSoon", value: function() {
var e19 = this;
this.delayedFlush < 0 && (this.delayedFlush = this.view.win.requestAnimationFrame(function() {
e19.delayedFlush = -1, e19.flush();
}));
} }, { key: "forceFlush", value: function() {
this.delayedFlush >= 0 && (this.view.win.cancelAnimationFrame(this.delayedFlush), this.delayedFlush = -1), this.flush();
} }, { key: "processRecords", value: function() {
var e19, t2 = this.queue, n2 = bi(this.observer.takeRecords());
try {
for (n2.s(); !(e19 = n2.n()).done; ) {
var r2 = e19.value;
t2.push(r2);
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
t2.length && (this.queue = []);
var i2, o2 = -1, a2 = -1, s2 = false, u2 = bi(t2);
try {
for (u2.s(); !(i2 = u2.n()).done; ) {
var c2 = i2.value, l2 = this.readMutation(c2);
l2 && (l2.typeOver && (s2 = true), -1 == o2 ? (o2 = l2.from, a2 = l2.to) : (o2 = Math.min(l2.from, o2), a2 = Math.max(l2.to, a2)));
}
} catch (e20) {
u2.e(e20);
} finally {
u2.f();
}
return { from: o2, to: a2, typeOver: s2 };
} }, { key: "flush", value: function() {
var e19 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
if (this.delayedFlush >= 0 || this.delayedAndroidKey)
return false;
e19 && this.readSelectionRange();
var t2 = this.processRecords(), n2 = t2.from, r2 = t2.to, i2 = t2.typeOver, o2 = this.selectionChanged && a$(this.dom, this.selectionRange);
if (n2 < 0 && !o2)
return false;
n2 > -1 && (this.lastChange = Date.now()), this.view.inputState.lastFocusTime = 0, this.selectionChanged = false;
var a2 = this.view.state, s2 = this.onChange(n2, r2, i2);
return this.view.state == a2 && this.view.update([]), s2;
} }, { key: "readMutation", value: function(e19) {
var t2 = this.view.docView.nearest(e19.target);
if (!t2 || t2.ignoreMutation(e19))
return null;
if (t2.markDirty("attributes" == e19.type), "attributes" == e19.type && (t2.dirty |= 4), "childList" == e19.type) {
var n2 = RE(t2, e19.previousSibling || e19.target.previousSibling, -1), r2 = RE(t2, e19.nextSibling || e19.target.nextSibling, 1);
return { from: n2 ? t2.posAfter(n2) : t2.posAtStart, to: r2 ? t2.posBefore(r2) : t2.posAtEnd, typeOver: false };
}
return "characterData" == e19.type ? { from: t2.posAtStart, to: t2.posAtEnd, typeOver: e19.target.nodeValue == e19.oldValue } : null;
} }, { key: "setWindow", value: function(e19) {
e19 != this.win && (this.removeWindowListeners(this.win), this.win = e19, this.addWindowListeners(this.win));
} }, { key: "addWindowListeners", value: function(e19) {
e19.addEventListener("resize", this.onResize), e19.addEventListener("beforeprint", this.onPrint), e19.addEventListener("scroll", this.onScroll), e19.document.addEventListener("selectionchange", this.onSelectionChange);
} }, { key: "removeWindowListeners", value: function(e19) {
e19.removeEventListener("scroll", this.onScroll), e19.removeEventListener("resize", this.onResize), e19.removeEventListener("beforeprint", this.onPrint), e19.document.removeEventListener("selectionchange", this.onSelectionChange);
} }, { key: "destroy", value: function() {
var e19, t2, n2;
this.stop(), null === (e19 = this.intersection) || void 0 === e19 || e19.disconnect(), null === (t2 = this.gapIntersection) || void 0 === t2 || t2.disconnect(), null === (n2 = this.resize) || void 0 === n2 || n2.disconnect();
var r2, i2 = bi(this.scrollTargets);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
r2.value.removeEventListener("scroll", this.onScroll);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
this.removeWindowListeners(this.win), clearTimeout(this.parentCheck), clearTimeout(this.resizeTimeout);
} }]), e18;
}();
function RE(e18, t2, n2) {
for (; t2; ) {
var r2 = _$.get(t2);
if (r2 && r2.parent == e18)
return r2;
var i2 = t2.parentNode;
t2 = i2 != e18.dom ? i2 : n2 > 0 ? t2.nextSibling : t2.previousSibling;
}
return null;
}
function DE(e18, t2, n2, r2) {
var i2, o2, a2 = e18.state.selection.main;
if (t2 > -1) {
var s2 = e18.docView.domBoundsAround(t2, n2, 0);
if (!s2 || e18.state.readOnly)
return false;
var u2 = s2.from, c2 = s2.to, l2 = e18.docView.impreciseHead || e18.docView.impreciseAnchor ? [] : function(e19) {
var t3 = [];
if (e19.root.activeElement != e19.contentDOM)
return t3;
var n3 = e19.observer.selectionRange, r3 = n3.anchorNode, i3 = n3.anchorOffset, o3 = n3.focusNode, a3 = n3.focusOffset;
r3 && (t3.push(new aM(r3, i3)), o3 == r3 && a3 == i3 || t3.push(new aM(o3, a3)));
return t3;
}(e18), f2 = new iM(l2, e18.state);
f2.readRange(s2.startDOM, s2.endDOM);
var h2 = a2.from, d2 = null;
(8 === e18.inputState.lastKeyCode && e18.inputState.lastKeyTime > Date.now() - 100 || q$.android && f2.text.length < c2 - u2) && (h2 = a2.to, d2 = "end");
var v2 = function(e19, t3, n3, r3) {
var i3 = Math.min(e19.length, t3.length), o3 = 0;
for (; o3 < i3 && e19.charCodeAt(o3) == t3.charCodeAt(o3); )
o3++;
if (o3 == i3 && e19.length == t3.length)
return null;
var a3 = e19.length, s3 = t3.length;
for (; a3 > 0 && s3 > 0 && e19.charCodeAt(a3 - 1) == t3.charCodeAt(s3 - 1); )
a3--, s3--;
if ("end" == r3) {
n3 -= a3 + Math.max(0, o3 - Math.min(a3, s3)) - o3;
}
if (a3 < o3 && e19.length < t3.length) {
s3 = (o3 -= n3 <= o3 && n3 >= a3 ? o3 - n3 : 0) + (s3 - a3), a3 = o3;
} else if (s3 < o3) {
a3 = (o3 -= n3 <= o3 && n3 >= s3 ? o3 - n3 : 0) + (a3 - s3), s3 = o3;
}
return { from: o3, toA: a3, toB: s3 };
}(e18.state.doc.sliceString(u2, c2, "\uFFFF"), f2.text, h2 - u2, d2);
v2 && (q$.chrome && 13 == e18.inputState.lastKeyCode && v2.toB == v2.from + 2 && "\uFFFF\uFFFF" == f2.text.slice(v2.from, v2.toB) && v2.toB--, i2 = { from: u2 + v2.from, to: u2 + v2.toA, insert: e_.of(f2.text.slice(v2.from, v2.toB).split("\uFFFF")) }), o2 = function(e19, t3) {
if (0 == e19.length)
return null;
var n3 = e19[0].pos, r3 = 2 == e19.length ? e19[1].pos : n3;
return n3 > -1 && r3 > -1 ? T_.single(n3 + t3, r3 + t3) : null;
}(l2, u2);
} else if (e18.hasFocus || !e18.state.facet(_O)) {
var p2 = e18.observer.selectionRange, m2 = e18.docView, g2 = m2.impreciseHead, y2 = m2.impreciseAnchor, b2 = g2 && g2.node == p2.focusNode && g2.offset == p2.focusOffset || !o$(e18.contentDOM, p2.focusNode) ? e18.state.selection.main.head : e18.docView.posFromDOM(p2.focusNode, p2.focusOffset), k2 = y2 && y2.node == p2.anchorNode && y2.offset == p2.anchorOffset || !o$(e18.contentDOM, p2.anchorNode) ? e18.state.selection.main.anchor : e18.docView.posFromDOM(p2.anchorNode, p2.anchorOffset);
b2 == a2.head && k2 == a2.anchor || (o2 = T_.single(k2, b2));
}
if (!i2 && !o2)
return false;
if (!i2 && r2 && !a2.empty && o2 && o2.main.empty ? i2 = { from: a2.from, to: a2.to, insert: e18.state.doc.slice(a2.from, a2.to) } : i2 && i2.from >= a2.from && i2.to <= a2.to && (i2.from != a2.from || i2.to != a2.to) && a2.to - a2.from - (i2.to - i2.from) <= 4 ? i2 = { from: a2.from, to: a2.to, insert: e18.state.doc.slice(a2.from, i2.from).append(i2.insert).append(e18.state.doc.slice(i2.to, a2.to)) } : (q$.mac || q$.android) && i2 && i2.from == i2.to && i2.from == a2.head - 1 && /^\. ?$/.test(i2.insert.toString()) && (o2 && 2 == i2.insert.length && (o2 = T_.single(o2.main.anchor - 1, o2.main.head - 1)), i2 = { from: a2.from, to: a2.to, insert: e_.of([" "]) }), i2) {
var w2 = e18.state;
if (q$.ios && e18.inputState.flushIOSKey(e18))
return true;
if (q$.android && (i2.from == a2.from && i2.to == a2.to && 1 == i2.insert.length && 2 == i2.insert.lines && k$(e18.contentDOM, "Enter", 13) || i2.from == a2.from - 1 && i2.to == a2.to && 0 == i2.insert.length && k$(e18.contentDOM, "Backspace", 8) || i2.from == a2.from && i2.to == a2.to + 1 && 0 == i2.insert.length && k$(e18.contentDOM, "Delete", 46)))
return true;
var j2, x2 = i2.insert.toString();
if (e18.state.facet(kO).some(function(t3) {
return t3(e18, i2.from, i2.to, x2);
}))
return true;
if (e18.inputState.composing >= 0 && e18.inputState.composing++, i2.from >= a2.from && i2.to <= a2.to && i2.to - i2.from >= (a2.to - a2.from) / 3 && (!o2 || o2.main.empty && o2.main.from == i2.from + i2.insert.length) && e18.inputState.composing < 0) {
var S2 = a2.from < i2.from ? w2.sliceDoc(a2.from, i2.from) : "", _2 = a2.to > i2.to ? w2.sliceDoc(i2.to, a2.to) : "";
j2 = w2.replaceSelection(e18.state.toText(S2 + i2.insert.sliceString(0, void 0, e18.state.lineBreak) + _2));
} else {
var C2 = w2.changes(i2), $2 = o2 && !w2.selection.main.eq(o2.main) && o2.main.to <= C2.newLength ? o2.main : void 0;
if (w2.selection.ranges.length > 1 && e18.inputState.composing >= 0 && i2.to <= a2.to && i2.to >= a2.to - 10) {
var O2 = e18.state.sliceDoc(i2.from, i2.to), M2 = lM(e18) || e18.state.doc.lineAt(a2.head), E2 = a2.to - i2.to, P2 = a2.to - a2.from;
j2 = w2.changeByRange(function(t3) {
if (t3.from == a2.from && t3.to == a2.to)
return { changes: C2, range: $2 || t3.map(C2) };
var n3 = t3.to - E2, r3 = n3 - O2.length;
if (t3.to - t3.from != P2 || e18.state.sliceDoc(r3, n3) != O2 || M2 && t3.to >= M2.from && t3.from <= M2.to)
return { range: t3 };
var o3 = w2.changes({ from: r3, to: n3, insert: i2.insert }), s3 = t3.to - a2.to;
return { changes: o3, range: $2 ? T_.range(Math.max(0, $2.anchor + s3), Math.max(0, $2.head + s3)) : t3.map(o3) };
});
} else
j2 = { changes: C2, selection: $2 && w2.selection.replaceRange($2) };
}
var A2 = "input.type";
return e18.composing && (A2 += ".compose", e18.inputState.compositionFirstChange && (A2 += ".start", e18.inputState.compositionFirstChange = false)), e18.dispatch(j2, { scrollIntoView: true, userEvent: A2 }), true;
}
if (o2 && !o2.main.eq(a2)) {
var T2 = false, I2 = "select";
return e18.inputState.lastSelectionTime > Date.now() - 50 && ("select" == e18.inputState.lastSelectionOrigin && (T2 = true), I2 = e18.inputState.lastSelectionOrigin), e18.dispatch({ selection: o2, scrollIntoView: T2, userEvent: I2 }), true;
}
return false;
}
var LE = function() {
function e18() {
var t2 = this, n2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
Ri(this, e18), this.plugins = [], this.pluginMap = /* @__PURE__ */ new Map(), this.editorAttrs = {}, this.contentAttrs = {}, this.bidiCache = [], this.destroyed = false, this.updateState = 2, this.measureScheduled = -1, this.measureRequests = [], this.contentDOM = document.createElement("div"), this.scrollDOM = document.createElement("div"), this.scrollDOM.tabIndex = -1, this.scrollDOM.className = "cm-scroller", this.scrollDOM.appendChild(this.contentDOM), this.announceDOM = document.createElement("div"), this.announceDOM.style.cssText = "position: absolute; top: -10000px", this.announceDOM.setAttribute("aria-live", "polite"), this.dom = document.createElement("div"), this.dom.appendChild(this.announceDOM), this.dom.appendChild(this.scrollDOM), this._dispatch = n2.dispatch || function(e19) {
return t2.update([e19]);
}, this.dispatch = this.dispatch.bind(this), this._root = n2.root || w$(n2.parent) || document, this.viewState = new gE(n2.state || xC.create(n2)), this.plugins = this.state.facet($O).map(function(e19) {
return new MO(e19);
});
var r2, i2 = bi(this.plugins);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
o2.update(this);
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
this.observer = new NE(this, function(e19, n3, r3) {
return DE(t2, e19, n3, r3);
}, function(e19) {
t2.inputState.runScrollHandlers(t2, e19), t2.observer.intersecting && t2.measure();
}), this.inputState = new EM(this), this.inputState.ensureHandlers(this, this.plugins), this.docView = new sM(this), this.mountStyles(), this.updateAttrs(), this.updateState = 0, this.requestMeasure(), n2.parent && n2.parent.appendChild(this.dom);
}
return Li(e18, [{ key: "state", get: function() {
return this.viewState.state;
} }, { key: "viewport", get: function() {
return this.viewState.viewport;
} }, { key: "visibleRanges", get: function() {
return this.viewState.visibleRanges;
} }, { key: "inView", get: function() {
return this.viewState.inView;
} }, { key: "composing", get: function() {
return this.inputState.composing > 0;
} }, { key: "compositionStarted", get: function() {
return this.inputState.composing >= 0;
} }, { key: "root", get: function() {
return this._root;
} }, { key: "win", get: function() {
return this.dom.ownerDocument.defaultView || window;
} }, { key: "dispatch", value: function() {
var e19;
this._dispatch(1 == arguments.length && (arguments.length <= 0 ? void 0 : arguments[0]) instanceof hC ? arguments.length <= 0 ? void 0 : arguments[0] : (e19 = this.state).update.apply(e19, arguments));
} }, { key: "update", value: function(e19) {
if (0 != this.updateState)
throw new Error("Calls to EditorView.update are not allowed while an update is in progress");
var t2, n2, r2 = false, i2 = false, o2 = this.state, a2 = bi(e19);
try {
for (a2.s(); !(n2 = a2.n()).done; ) {
var s2 = n2.value;
if (s2.startState != o2)
throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");
o2 = s2.state;
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
if (this.destroyed)
this.viewState.state = o2;
else {
if (this.observer.clear(), o2.facet(xC.phrases) != this.state.facet(xC.phrases))
return this.setState(o2);
t2 = DO.create(this, o2, e19);
var u2 = this.viewState.scrollTarget;
try {
this.updateState = 2;
var c2, l2 = bi(e19);
try {
for (l2.s(); !(c2 = l2.n()).done; ) {
var f2 = c2.value;
if (u2 && (u2 = u2.map(f2.changes)), f2.scrollIntoView) {
var h2 = f2.state.selection.main;
u2 = new jO(h2.empty ? h2 : T_.cursor(h2.head, h2.head > h2.anchor ? -1 : 1));
}
var d2, v2 = bi(f2.effects);
try {
for (v2.s(); !(d2 = v2.n()).done; ) {
var p2 = d2.value;
p2.is(xO) && (u2 = p2.value);
}
} catch (e20) {
v2.e(e20);
} finally {
v2.f();
}
}
} catch (e20) {
l2.e(e20);
} finally {
l2.f();
}
this.viewState.update(t2, u2), this.bidiCache = qE.update(this.bidiCache, t2.changes), t2.empty || (this.updatePlugins(t2), this.inputState.update(t2)), r2 = this.docView.update(t2), this.state.facet(NO) != this.styleModules && this.mountStyles(), i2 = this.updateAttrs(), this.showAnnouncements(e19), this.docView.updateSelection(r2, e19.some(function(e20) {
return e20.isUserEvent("select.pointer");
}));
} finally {
this.updateState = 0;
}
if (t2.startState.facet(_E) != t2.state.facet(_E) && (this.viewState.mustMeasureContent = true), (r2 || i2 || u2 || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent) && this.requestMeasure(), !t2.empty) {
var m2, g2 = bi(this.state.facet(bO));
try {
for (g2.s(); !(m2 = g2.n()).done; ) {
(0, m2.value)(t2);
}
} catch (e20) {
g2.e(e20);
} finally {
g2.f();
}
}
}
} }, { key: "setState", value: function(e19) {
if (0 != this.updateState)
throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");
if (this.destroyed)
this.viewState.state = e19;
else {
this.updateState = 2;
var t2 = this.hasFocus;
try {
var n2, r2 = bi(this.plugins);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
n2.value.destroy(this);
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
this.viewState = new gE(e19), this.plugins = e19.facet($O).map(function(e20) {
return new MO(e20);
}), this.pluginMap.clear();
var i2, o2 = bi(this.plugins);
try {
for (o2.s(); !(i2 = o2.n()).done; ) {
i2.value.update(this);
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
this.docView = new sM(this), this.inputState.ensureHandlers(this, this.plugins), this.mountStyles(), this.updateAttrs(), this.bidiCache = [];
} finally {
this.updateState = 0;
}
t2 && this.focus(), this.requestMeasure();
}
} }, { key: "updatePlugins", value: function(e19) {
var t2 = e19.startState.facet($O), n2 = e19.state.facet($O);
if (t2 != n2) {
var r2, i2 = [], o2 = bi(n2);
try {
for (o2.s(); !(r2 = o2.n()).done; ) {
var a2 = r2.value, s2 = t2.indexOf(a2);
if (s2 < 0)
i2.push(new MO(a2));
else {
var u2 = this.plugins[s2];
u2.mustUpdate = e19, i2.push(u2);
}
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
var c2, l2 = bi(this.plugins);
try {
for (l2.s(); !(c2 = l2.n()).done; ) {
var f2 = c2.value;
f2.mustUpdate != e19 && f2.destroy(this);
}
} catch (e20) {
l2.e(e20);
} finally {
l2.f();
}
this.plugins = i2, this.pluginMap.clear(), this.inputState.ensureHandlers(this, this.plugins);
} else {
var h2, d2 = bi(this.plugins);
try {
for (d2.s(); !(h2 = d2.n()).done; ) {
h2.value.mustUpdate = e19;
}
} catch (e20) {
d2.e(e20);
} finally {
d2.f();
}
}
for (var v2 = 0; v2 < this.plugins.length; v2++)
this.plugins[v2].update(this);
} }, { key: "measure", value: function() {
var e19 = this, t2 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
if (!this.destroyed) {
this.measureScheduled > -1 && cancelAnimationFrame(this.measureScheduled), this.measureScheduled = 0, t2 && this.observer.forceFlush();
var n2 = null, r2 = this.scrollDOM, i2 = r2.scrollHeight, o2 = r2.scrollTop, a2 = r2.clientHeight, s2 = o2 > i2 - a2 - 4 ? i2 : o2;
try {
for (var u2 = 0; ; u2++) {
this.updateState = 1;
var c2 = this.viewport, l2 = this.viewState.lineBlockAtHeight(s2), f2 = this.viewState.measure(this);
if (!f2 && !this.measureRequests.length && null == this.viewState.scrollTarget)
break;
if (u2 > 5) {
console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize");
break;
}
var h2 = [];
if (!(4 & f2)) {
var d2 = [h2, this.measureRequests];
this.measureRequests = d2[0], h2 = d2[1];
}
var v2 = h2.map(function(t3) {
try {
return t3.read(e19);
} catch (t4) {
return SO(e19.state, t4), BE;
}
}), p2 = DO.create(this, this.state, []), m2 = false, g2 = false;
p2.flags |= f2, n2 ? n2.flags |= f2 : n2 = p2, this.updateState = 2, p2.empty || (this.updatePlugins(p2), this.inputState.update(p2), this.updateAttrs(), m2 = this.docView.update(p2));
for (var y2 = 0; y2 < h2.length; y2++)
if (v2[y2] != BE)
try {
var b2 = h2[y2];
b2.write && b2.write(v2[y2], this);
} catch (e20) {
SO(this.state, e20);
}
if (this.viewState.scrollTarget)
this.docView.scrollIntoView(this.viewState.scrollTarget), this.viewState.scrollTarget = null, g2 = true;
else {
var k2 = this.viewState.lineBlockAt(l2.from).top - l2.top;
(k2 > 1 || k2 < -1) && (this.scrollDOM.scrollTop += k2, g2 = true);
}
if (m2 && this.docView.updateSelection(true), this.viewport.from == c2.from && this.viewport.to == c2.to && !g2 && 0 == this.measureRequests.length)
break;
}
} finally {
this.updateState = 0, this.measureScheduled = -1;
}
if (n2 && !n2.empty) {
var w2, j2 = bi(this.state.facet(bO));
try {
for (j2.s(); !(w2 = j2.n()).done; ) {
var x2 = w2.value;
x2(n2);
}
} catch (e20) {
j2.e(e20);
} finally {
j2.f();
}
}
}
} }, { key: "themeClasses", get: function() {
return $E + " " + (this.state.facet(CE) ? ME : OE) + " " + this.state.facet(_E);
} }, { key: "updateAttrs", value: function() {
var e19 = this, t2 = FE(this, EO, { class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses }), n2 = { spellcheck: "false", autocorrect: "off", autocapitalize: "off", translate: "no", contenteditable: this.state.facet(_O) ? "true" : "false", class: "cm-content", style: "".concat(q$.tabSize, ": ").concat(this.state.tabSize), role: "textbox", "aria-multiline": "true" };
this.state.readOnly && (n2["aria-readonly"] = "true"), FE(this, PO, n2);
var r2 = this.observer.ignore(function() {
var r3 = tO(e19.contentDOM, e19.contentAttrs, n2), i2 = tO(e19.dom, e19.editorAttrs, t2);
return r3 || i2;
});
return this.editorAttrs = t2, this.contentAttrs = n2, r2;
} }, { key: "showAnnouncements", value: function(t2) {
var n2, r2 = true, i2 = bi(t2);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2, a2 = bi(n2.value.effects);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
if (s2.is(e18.announce))
r2 && (this.announceDOM.textContent = ""), r2 = false, this.announceDOM.appendChild(document.createElement("div")).textContent = s2.value;
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
} }, { key: "mountStyles", value: function() {
this.styleModules = this.state.facet(NO), UC.mount(this.root, this.styleModules.concat(AE).reverse());
} }, { key: "readMeasured", value: function() {
if (2 == this.updateState)
throw new Error("Reading the editor layout isn't allowed during an update");
0 == this.updateState && this.measureScheduled > -1 && this.measure(false);
} }, { key: "requestMeasure", value: function(e19) {
var t2 = this;
if (this.measureScheduled < 0 && (this.measureScheduled = this.win.requestAnimationFrame(function() {
return t2.measure();
})), e19) {
if (null != e19.key) {
for (var n2 = 0; n2 < this.measureRequests.length; n2++)
if (this.measureRequests[n2].key === e19.key)
return void (this.measureRequests[n2] = e19);
}
this.measureRequests.push(e19);
}
} }, { key: "plugin", value: function(e19) {
var t2 = this.pluginMap.get(e19);
return (void 0 === t2 || t2 && t2.spec != e19) && this.pluginMap.set(e19, t2 = this.plugins.find(function(t3) {
return t3.spec == e19;
}) || null), t2 && t2.update(this).value;
} }, { key: "documentTop", get: function() {
return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop;
} }, { key: "documentPadding", get: function() {
return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom };
} }, { key: "elementAtHeight", value: function(e19) {
return this.readMeasured(), this.viewState.elementAtHeight(e19);
} }, { key: "lineBlockAtHeight", value: function(e19) {
return this.readMeasured(), this.viewState.lineBlockAtHeight(e19);
} }, { key: "viewportLineBlocks", get: function() {
return this.viewState.viewportLines;
} }, { key: "lineBlockAt", value: function(e19) {
return this.viewState.lineBlockAt(e19);
} }, { key: "contentHeight", get: function() {
return this.viewState.contentHeight;
} }, { key: "moveByChar", value: function(e19, t2, n2) {
return MM(this, e19, OM(this, e19, t2, n2));
} }, { key: "moveByGroup", value: function(e19, t2) {
var n2 = this;
return MM(this, e19, OM(this, e19, t2, function(t3) {
return function(e20, t4, n3) {
var r2 = e20.state.charCategorizer(t4), i2 = r2(n3);
return function(e21) {
var t5 = r2(e21);
return i2 == kC.Space && (i2 = t5), i2 == t5;
};
}(n2, e19.head, t3);
}));
} }, { key: "moveToLineBoundary", value: function(e19, t2) {
var n2 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
return $M(this, e19, t2, n2);
} }, { key: "moveVertically", value: function(e19, t2, n2) {
return MM(this, e19, function(e20, t3, n3, r2) {
var i2 = t3.head, o2 = n3 ? 1 : -1;
if (i2 == (n3 ? e20.state.doc.length : 0))
return T_.cursor(i2, t3.assoc);
var a2, s2 = t3.goalColumn, u2 = e20.contentDOM.getBoundingClientRect(), c2 = e20.coordsAtPos(i2), l2 = e20.documentTop;
if (c2)
null == s2 && (s2 = c2.left - u2.left), a2 = o2 < 0 ? c2.top : c2.bottom;
else {
var f2 = e20.viewState.lineBlockAt(i2);
null == s2 && (s2 = Math.min(u2.right - u2.left, e20.defaultCharacterWidth * (i2 - f2.from))), a2 = (o2 < 0 ? f2.top : f2.bottom) + l2;
}
for (var h2 = u2.left + s2, d2 = null != r2 ? r2 : e20.defaultLineHeight >> 1, v2 = 0; ; v2 += 10) {
var p2 = a2 + (d2 + v2) * o2, m2 = xM(e20, { x: h2, y: p2 }, false, o2);
if (p2 < u2.top || p2 > u2.bottom || (o2 < 0 ? m2 < i2 : m2 > i2))
return T_.cursor(m2, t3.assoc, void 0, s2);
}
}(this, e19, t2, n2));
} }, { key: "domAtPos", value: function(e19) {
return this.docView.domAtPos(e19);
} }, { key: "posAtDOM", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return this.docView.posFromDOM(e19, t2);
} }, { key: "posAtCoords", value: function(e19) {
var t2 = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
return this.readMeasured(), xM(this, e19, t2);
} }, { key: "coordsAtPos", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
this.readMeasured();
var n2 = this.docView.coordsAt(e19, t2);
if (!n2 || n2.left == n2.right)
return n2;
var r2 = this.state.doc.lineAt(e19), i2 = this.bidiSpans(r2), o2 = i2[XO.find(i2, e19 - r2.from, -1, t2)];
return d$(n2, o2.dir == LO.LTR == t2 > 0);
} }, { key: "defaultCharacterWidth", get: function() {
return this.viewState.heightOracle.charWidth;
} }, { key: "defaultLineHeight", get: function() {
return this.viewState.heightOracle.lineHeight;
} }, { key: "textDirection", get: function() {
return this.viewState.defaultTextDirection;
} }, { key: "textDirectionAt", value: function(e19) {
return !this.state.facet(wO) || e19 < this.viewport.from || e19 > this.viewport.to ? this.textDirection : (this.readMeasured(), this.docView.textDirectionAt(e19));
} }, { key: "lineWrapping", get: function() {
return this.viewState.heightOracle.lineWrapping;
} }, { key: "bidiSpans", value: function(e19) {
if (e19.length > zE)
return tM(e19.length);
var t2, n2 = this.textDirectionAt(e19.from), r2 = bi(this.bidiCache);
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
var i2 = t2.value;
if (i2.from == e19.from && i2.dir == n2)
return i2.order;
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
var o2 = function(e20, t3) {
var n3 = e20.length, r3 = t3 == zO ? 1 : 2, i3 = t3 == zO ? 2 : 1;
if (!e20 || 1 == r3 && !ZO.test(e20))
return tM(n3);
for (var o3 = 0, a2 = r3, s2 = r3; o3 < n3; o3++) {
var u2 = YO(e20.charCodeAt(o3));
512 == u2 ? u2 = a2 : 8 == u2 && 4 == s2 && (u2 = 16), eM[o3] = 4 == u2 ? 2 : u2, 7 & u2 && (s2 = u2), a2 = u2;
}
for (var c2 = 0, l2 = r3, f2 = r3; c2 < n3; c2++) {
var h2 = eM[c2];
if (128 == h2)
c2 < n3 - 1 && l2 == eM[c2 + 1] && 24 & l2 ? h2 = eM[c2] = l2 : eM[c2] = 256;
else if (64 == h2) {
for (var d2 = c2 + 1; d2 < n3 && 64 == eM[d2]; )
d2++;
for (var v2 = c2 && 8 == l2 || d2 < n3 && 8 == eM[d2] ? 1 == f2 ? 1 : 8 : 256, p2 = c2; p2 < d2; p2++)
eM[p2] = v2;
c2 = d2 - 1;
} else
8 == h2 && 1 == f2 && (eM[c2] = 1);
l2 = h2, 7 & h2 && (f2 = h2);
}
for (var m2, g2, y2, b2 = 0, k2 = 0, w2 = 0; b2 < n3; b2++)
if (g2 = WO[m2 = e20.charCodeAt(b2)])
if (g2 < 0) {
for (var j2 = k2 - 3; j2 >= 0; j2 -= 3)
if (HO[j2 + 1] == -g2) {
var x2 = HO[j2 + 2], S2 = 2 & x2 ? r3 : 4 & x2 ? 1 & x2 ? i3 : r3 : 0;
S2 && (eM[b2] = eM[HO[j2]] = S2), k2 = j2;
break;
}
} else {
if (189 == HO.length)
break;
HO[k2++] = b2, HO[k2++] = m2, HO[k2++] = w2;
}
else if (2 == (y2 = eM[b2]) || 1 == y2) {
var _2 = y2 == r3;
w2 = _2 ? 0 : 1;
for (var C2 = k2 - 3; C2 >= 0; C2 -= 3) {
var $2 = HO[C2 + 2];
if (2 & $2)
break;
if (_2)
HO[C2 + 2] |= 2;
else {
if (4 & $2)
break;
HO[C2 + 2] |= 4;
}
}
}
for (var O2 = 0; O2 < n3; O2++)
if (256 == eM[O2]) {
for (var M2 = O2 + 1; M2 < n3 && 256 == eM[M2]; )
M2++;
for (var E2 = 1 == (O2 ? eM[O2 - 1] : r3), P2 = E2 == (1 == (M2 < n3 ? eM[M2] : r3)) ? E2 ? 1 : 2 : r3, A2 = O2; A2 < M2; A2++)
eM[A2] = P2;
O2 = M2 - 1;
}
var T2 = [];
if (1 == r3)
for (var I2 = 0; I2 < n3; ) {
for (var N2 = I2, R2 = 1 != eM[I2++]; I2 < n3 && R2 == (1 != eM[I2]); )
I2++;
if (R2)
for (var D2 = I2; D2 > N2; ) {
for (var L2 = D2, z2 = 2 != eM[--D2]; D2 > N2 && z2 == (2 != eM[D2 - 1]); )
D2--;
T2.push(new XO(D2, L2, z2 ? 2 : 1));
}
else
T2.push(new XO(N2, I2, 0));
}
else
for (var B2 = 0; B2 < n3; ) {
for (var q2 = B2, F2 = 2 == eM[B2++]; B2 < n3 && F2 == (2 == eM[B2]); )
B2++;
T2.push(new XO(q2, B2, F2 ? 1 : 2));
}
return T2;
}(e19.text, n2);
return this.bidiCache.push(new qE(e19.from, e19.to, n2, o2)), o2;
} }, { key: "hasFocus", get: function() {
var e19;
return (this.dom.ownerDocument.hasFocus() || q$.safari && (null === (e19 = this.inputState) || void 0 === e19 ? void 0 : e19.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM;
} }, { key: "focus", value: function() {
var e19 = this;
this.observer.ignore(function() {
y$(e19.contentDOM), e19.docView.updateSelection();
});
} }, { key: "setRoot", value: function(e19) {
this._root != e19 && (this._root = e19, this.observer.setWindow((9 == e19.nodeType ? e19 : e19.ownerDocument).defaultView || window), this.mountStyles());
} }, { key: "destroy", value: function() {
var e19, t2 = bi(this.plugins);
try {
for (t2.s(); !(e19 = t2.n()).done; ) {
e19.value.destroy(this);
}
} catch (e20) {
t2.e(e20);
} finally {
t2.f();
}
this.plugins = [], this.inputState.destroy(), this.dom.remove(), this.observer.destroy(), this.measureScheduled > -1 && cancelAnimationFrame(this.measureScheduled), this.destroyed = true;
} }], [{ key: "scrollIntoView", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return xO.of(new jO("number" == typeof e19 ? T_.cursor(e19) : e19, t2.y, t2.x, t2.yMargin, t2.xMargin));
} }, { key: "domEventHandlers", value: function(e19) {
return OO.define(function() {
return {};
}, { eventHandlers: e19 });
} }, { key: "theme", value: function(e19, t2) {
var n2 = UC.newName(), r2 = [_E.of(n2), NO.of(PE(".".concat(n2), e19))];
return t2 && t2.dark && r2.push(CE.of(true)), r2;
} }, { key: "baseTheme", value: function(e19) {
return K_.lowest(NO.of(PE("." + $E, e19, EE)));
} }, { key: "findFromDOM", value: function(e19) {
var t2, n2 = e19.querySelector(".cm-content"), r2 = n2 && _$.get(n2) || _$.get(e19);
return (null === (t2 = null == r2 ? void 0 : r2.rootView) || void 0 === t2 ? void 0 : t2.view) || null;
} }]), e18;
}();
LE.styleModule = NO, LE.inputHandler = kO, LE.perLineTextDirection = wO, LE.exceptionSink = yO, LE.updateListener = bO, LE.editable = _O, LE.mouseSelectionStyle = gO, LE.dragMovesSelection = mO, LE.clickAddsSelectionRange = pO, LE.decorations = AO, LE.atomicRanges = TO, LE.scrollMargins = IO, LE.darkTheme = CE, LE.contentAttributes = PO, LE.editorAttributes = EO, LE.lineWrapping = LE.contentAttributes.of({ class: "cm-lineWrapping" }), LE.announce = fC.define();
var zE = 4096, BE = {}, qE = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.from = t2, this.to = n2, this.dir = r2, this.order = i2;
}
return Li(e18, null, [{ key: "update", value: function(t2, n2) {
if (n2.empty)
return t2;
for (var r2 = [], i2 = t2.length ? t2[t2.length - 1].dir : LO.LTR, o2 = Math.max(0, t2.length - 10); o2 < t2.length; o2++) {
var a2 = t2[o2];
a2.dir != i2 || n2.touchesRange(a2.from, a2.to) || r2.push(new e18(n2.mapPos(a2.from, 1), n2.mapPos(a2.to, -1), a2.dir, a2.order));
}
return r2;
} }]), e18;
}();
function FE(e18, t2, n2) {
for (var r2 = e18.state.facet(t2), i2 = r2.length - 1; i2 >= 0; i2--) {
var o2 = r2[i2], a2 = "function" == typeof o2 ? o2(e18) : o2;
a2 && X$(a2, n2);
}
return n2;
}
var VE = q$.mac ? "mac" : q$.windows ? "win" : q$.linux ? "linux" : "key";
function WE(e18, t2) {
var n2, r2, i2, o2, a2 = e18.split(/-(?!$)/), s2 = a2[a2.length - 1];
"Space" == s2 && (s2 = " ");
for (var u2 = 0; u2 < a2.length - 1; ++u2) {
var c2 = a2[u2];
if (/^(cmd|meta|m)$/i.test(c2))
o2 = true;
else if (/^a(lt)?$/i.test(c2))
n2 = true;
else if (/^(c|ctrl|control)$/i.test(c2))
r2 = true;
else if (/^s(hift)?$/i.test(c2))
i2 = true;
else {
if (!/^mod$/i.test(c2))
throw new Error("Unrecognized modifier name: " + c2);
"mac" == t2 ? o2 = true : r2 = true;
}
}
return n2 && (s2 = "Alt-" + s2), r2 && (s2 = "Ctrl-" + s2), o2 && (s2 = "Meta-" + s2), i2 && (s2 = "Shift-" + s2), s2;
}
function HE(e18, t2, n2) {
return t2.altKey && (e18 = "Alt-" + e18), t2.ctrlKey && (e18 = "Ctrl-" + e18), t2.metaKey && (e18 = "Meta-" + e18), false !== n2 && t2.shiftKey && (e18 = "Shift-" + e18), e18;
}
var JE = K_.default(LE.domEventHandlers({ keydown: function(e18, t2) {
return YE(GE(t2.state), e18, t2, "editor");
} })), UE = R_.define({ enables: JE }), KE = /* @__PURE__ */ new WeakMap();
function GE(e18) {
var t2 = e18.facet(UE), n2 = KE.get(t2);
return n2 || KE.set(t2, n2 = function(e19) {
var t3, n3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : VE, r2 = /* @__PURE__ */ Object.create(null), i2 = /* @__PURE__ */ Object.create(null), o2 = function(e20, t4) {
var n4 = i2[e20];
if (null == n4)
i2[e20] = t4;
else if (n4 != t4)
throw new Error("Key binding " + e20 + " is used both as a regular binding and as a multi-stroke prefix");
}, a2 = function(e20, t4, i3, a3) {
for (var s3, u3, c3 = r2[e20] || (r2[e20] = /* @__PURE__ */ Object.create(null)), l3 = t4.split(/ (?!$)/).map(function(e21) {
return WE(e21, n3);
}), f3 = function(t5) {
var n4 = l3.slice(0, t5).join(" ");
o2(n4, true), c3[n4] || (c3[n4] = { preventDefault: true, run: [function(t6) {
var r3 = QE = { view: t6, prefix: n4, scope: e20 };
return setTimeout(function() {
QE == r3 && (QE = null);
}, 4e3), true;
}] });
}, h3 = 1; h3 < l3.length; h3++)
f3(h3);
var d3 = l3.join(" ");
o2(d3, false);
var v3 = c3[d3] || (c3[d3] = { preventDefault: false, run: (null === (u3 = null === (s3 = c3._any) || void 0 === s3 ? void 0 : s3.run) || void 0 === u3 ? void 0 : u3.slice()) || [] });
i3 && v3.run.push(i3), a3 && (v3.preventDefault = true);
}, s2 = bi(e19);
try {
for (s2.s(); !(t3 = s2.n()).done; ) {
var u2 = t3.value, c2 = u2.scope ? u2.scope.split(" ") : ["editor"];
if (u2.any) {
var l2, f2 = bi(c2);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
var h2 = l2.value, d2 = r2[h2] || (r2[h2] = /* @__PURE__ */ Object.create(null));
for (var v2 in d2._any || (d2._any = { preventDefault: false, run: [] }), d2)
d2[v2].run.push(u2.any);
}
} catch (e20) {
f2.e(e20);
} finally {
f2.f();
}
}
var p2 = u2[n3] || u2.key;
if (p2) {
var m2, g2 = bi(c2);
try {
for (g2.s(); !(m2 = g2.n()).done; ) {
var y2 = m2.value;
a2(y2, p2, u2.run, u2.preventDefault), u2.shift && a2(y2, "Shift-" + p2, u2.shift, u2.preventDefault);
}
} catch (e20) {
g2.e(e20);
} finally {
g2.f();
}
}
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
return r2;
}(t2.reduce(function(e19, t3) {
return e19.concat(t3);
}, []))), n2;
}
var QE = null;
function YE(e18, t2, n2, r2) {
var i2 = function(e19) {
var t3 = !(t$ && (e19.ctrlKey || e19.altKey || e19.metaKey) || e$ && e19.shiftKey && e19.key && 1 == e19.key.length || "Unidentified" == e19.key) && e19.key || (e19.shiftKey ? YC : QC)[e19.keyCode] || e19.key || "Unidentified";
return "Esc" == t3 && (t3 = "Escape"), "Del" == t3 && (t3 = "Delete"), "Left" == t3 && (t3 = "ArrowLeft"), "Up" == t3 && (t3 = "ArrowUp"), "Right" == t3 && (t3 = "ArrowRight"), "Down" == t3 && (t3 = "ArrowDown"), t3;
}(t2), o2 = b_(i2, 0), a2 = w_(o2) == i2.length && " " != i2, s2 = "", u2 = false;
QE && QE.view == n2 && QE.scope == r2 && (s2 = QE.prefix + " ", (u2 = TM.indexOf(t2.keyCode) < 0) && (QE = null));
var c2, l2, f2 = /* @__PURE__ */ new Set(), h2 = function(e19) {
if (e19) {
var r3, i3 = bi(e19.run);
try {
for (i3.s(); !(r3 = i3.n()).done; ) {
var o3 = r3.value;
if (!f2.has(o3) && (f2.add(o3), o3(n2, t2)))
return true;
}
} catch (e20) {
i3.e(e20);
} finally {
i3.f();
}
e19.preventDefault && (u2 = true);
}
return false;
}, d2 = e18[r2];
if (d2) {
if (h2(d2[s2 + HE(i2, t2, !a2)]))
return true;
if (a2 && (t2.shiftKey || t2.altKey || t2.metaKey || o2 > 127) && (c2 = QC[t2.keyCode]) && c2 != i2) {
if (h2(d2[s2 + HE(c2, t2, true)]))
return true;
if (t2.shiftKey && (l2 = YC[t2.keyCode]) != i2 && l2 != c2 && h2(d2[s2 + HE(l2, t2, false)]))
return true;
} else if (a2 && t2.shiftKey && h2(d2[s2 + HE(i2, t2, true)]))
return true;
if (h2(d2._any))
return true;
}
return u2;
}
var ZE = !q$.ios, XE = R_.define({ combine: function(e18) {
return SC(e18, { cursorBlinkRate: 1200, drawRangeCursor: true }, { cursorBlinkRate: function(e19, t2) {
return Math.min(e19, t2);
}, drawRangeCursor: function(e19, t2) {
return e19 || t2;
} });
} });
function eP() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return [XE.of(e18), nP, iP];
}
var tP = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.left = t2, this.top = n2, this.width = r2, this.height = i2, this.className = o2;
}
return Li(e18, [{ key: "draw", value: function() {
var e19 = document.createElement("div");
return e19.className = this.className, this.adjust(e19), e19;
} }, { key: "adjust", value: function(e19) {
e19.style.left = this.left + "px", e19.style.top = this.top + "px", this.width >= 0 && (e19.style.width = this.width + "px"), e19.style.height = this.height + "px";
} }, { key: "eq", value: function(e19) {
return this.left == e19.left && this.top == e19.top && this.width == e19.width && this.height == e19.height && this.className == e19.className;
} }]), e18;
}(), nP = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.rangePieces = [], this.cursors = [], this.measureReq = { read: this.readPos.bind(this), write: this.drawSel.bind(this) }, this.selectionLayer = t2.scrollDOM.appendChild(document.createElement("div")), this.selectionLayer.className = "cm-selectionLayer", this.selectionLayer.setAttribute("aria-hidden", "true"), this.cursorLayer = t2.scrollDOM.appendChild(document.createElement("div")), this.cursorLayer.className = "cm-cursorLayer", this.cursorLayer.setAttribute("aria-hidden", "true"), t2.requestMeasure(this.measureReq), this.setBlinkRate();
}
return Li(e18, [{ key: "setBlinkRate", value: function() {
this.cursorLayer.style.animationDuration = this.view.state.facet(XE).cursorBlinkRate + "ms";
} }, { key: "update", value: function(e19) {
var t2 = e19.startState.facet(XE) != e19.state.facet(XE);
(t2 || e19.selectionSet || e19.geometryChanged || e19.viewportChanged) && this.view.requestMeasure(this.measureReq), e19.transactions.some(function(e20) {
return e20.scrollIntoView;
}) && (this.cursorLayer.style.animationName = "cm-blink" == this.cursorLayer.style.animationName ? "cm-blink2" : "cm-blink"), t2 && this.setBlinkRate();
} }, { key: "readPos", value: function() {
var e19, t2 = this, n2 = this.view.state, r2 = n2.facet(XE), i2 = n2.selection.ranges.map(function(e20) {
return e20.empty ? [] : function(e21, t3) {
if (t3.to <= e21.viewport.from || t3.from >= e21.viewport.to)
return [];
var n3 = Math.max(t3.from, e21.viewport.from), r3 = Math.min(t3.to, e21.viewport.to), i3 = e21.textDirection == LO.LTR, o3 = e21.contentDOM, a3 = o3.getBoundingClientRect(), s3 = oP(e21), u3 = window.getComputedStyle(o3.firstChild), c3 = a3.left + parseInt(u3.paddingLeft) + Math.min(0, parseInt(u3.textIndent)), l2 = a3.right - parseInt(u3.paddingRight), f2 = sP(e21, n3), h2 = sP(e21, r3), d2 = f2.type == rO.Text ? f2 : null, v2 = h2.type == rO.Text ? h2 : null;
e21.lineWrapping && (d2 && (d2 = aP(e21, n3, d2)), v2 && (v2 = aP(e21, r3, v2)));
if (d2 && v2 && d2.from == v2.from)
return b2(k2(t3.from, t3.to, d2));
var p2 = d2 ? k2(t3.from, null, d2) : w2(f2, false), m2 = v2 ? k2(null, t3.to, v2) : w2(h2, true), g2 = [];
return (d2 || f2).to < (v2 || h2).from - 1 ? g2.push(y2(c3, p2.bottom, l2, m2.top)) : p2.bottom < m2.top && e21.elementAtHeight((p2.bottom + m2.top) / 2).type == rO.Text && (p2.bottom = m2.top = (p2.bottom + m2.top) / 2), b2(p2).concat(g2).concat(b2(m2));
function y2(e22, t4, n4, r4) {
return new tP(e22 - s3.left, t4 - s3.top - 0.01, n4 - e22, r4 - t4 + 0.01, "cm-selectionBackground");
}
function b2(e22) {
for (var t4 = e22.top, n4 = e22.bottom, r4 = e22.horizontal, i4 = [], o4 = 0; o4 < r4.length; o4 += 2)
i4.push(y2(r4[o4], t4, r4[o4 + 1], n4));
return i4;
}
function k2(t4, n4, r4) {
var o4 = 1e9, a4 = -1e9, s4 = [];
function u4(t5, n5, u5, f4, h4) {
var d4 = e21.coordsAtPos(t5, t5 == r4.to ? -2 : 2), v4 = e21.coordsAtPos(u5, u5 == r4.from ? 2 : -2);
o4 = Math.min(d4.top, v4.top, o4), a4 = Math.max(d4.bottom, v4.bottom, a4), h4 == LO.LTR ? s4.push(i3 && n5 ? c3 : d4.left, i3 && f4 ? l2 : v4.right) : s4.push(!i3 && f4 ? c3 : v4.left, !i3 && n5 ? l2 : d4.right);
}
var f3, h3 = null != t4 ? t4 : r4.from, d3 = null != n4 ? n4 : r4.to, v3 = bi(e21.visibleRanges);
try {
for (v3.s(); !(f3 = v3.n()).done; ) {
var p3 = f3.value;
if (p3.to > h3 && p3.from < d3)
for (var m3 = Math.max(p3.from, h3), g3 = Math.min(p3.to, d3); ; ) {
var y3, b3 = e21.state.doc.lineAt(m3), k3 = bi(e21.bidiSpans(b3));
try {
for (k3.s(); !(y3 = k3.n()).done; ) {
var w3 = y3.value, j2 = w3.from + b3.from, x2 = w3.to + b3.from;
if (j2 >= g3)
break;
x2 > m3 && u4(Math.max(j2, m3), null == t4 && j2 <= h3, Math.min(x2, g3), null == n4 && x2 >= d3, w3.dir);
}
} catch (e22) {
k3.e(e22);
} finally {
k3.f();
}
if ((m3 = b3.to + 1) >= g3)
break;
}
}
} catch (e22) {
v3.e(e22);
} finally {
v3.f();
}
return 0 == s4.length && u4(h3, null == t4, d3, null == n4, e21.textDirection), { top: o4, bottom: a4, horizontal: s4 };
}
function w2(e22, t4) {
var n4 = a3.top + (t4 ? e22.top : e22.bottom);
return { top: n4, bottom: n4, horizontal: [] };
}
}(t2.view, e20);
}).reduce(function(e20, t3) {
return e20.concat(t3);
}), o2 = [], a2 = bi(n2.selection.ranges);
try {
for (a2.s(); !(e19 = a2.n()).done; ) {
var s2 = e19.value, u2 = s2 == n2.selection.main;
if (s2.empty ? !u2 || ZE : r2.drawRangeCursor) {
var c2 = uP(this.view, s2, u2);
c2 && o2.push(c2);
}
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
return { rangePieces: i2, cursors: o2 };
} }, { key: "drawSel", value: function(e19) {
var t2 = this, n2 = e19.rangePieces, r2 = e19.cursors;
if (n2.length != this.rangePieces.length || n2.some(function(e20, n3) {
return !e20.eq(t2.rangePieces[n3]);
})) {
this.selectionLayer.textContent = "";
var i2, o2 = bi(n2);
try {
for (o2.s(); !(i2 = o2.n()).done; ) {
var a2 = i2.value;
this.selectionLayer.appendChild(a2.draw());
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
this.rangePieces = n2;
}
if (r2.length != this.cursors.length || r2.some(function(e20, n3) {
return !e20.eq(t2.cursors[n3]);
})) {
var s2 = this.cursorLayer.children;
if (s2.length !== r2.length) {
this.cursorLayer.textContent = "";
var u2, c2 = bi(r2);
try {
for (c2.s(); !(u2 = c2.n()).done; ) {
var l2 = u2.value;
this.cursorLayer.appendChild(l2.draw());
}
} catch (e20) {
c2.e(e20);
} finally {
c2.f();
}
} else
r2.forEach(function(e20, t3) {
return e20.adjust(s2[t3]);
});
this.cursors = r2;
}
} }, { key: "destroy", value: function() {
this.selectionLayer.remove(), this.cursorLayer.remove();
} }]), e18;
}()), rP = { ".cm-line": { "& ::selection": { backgroundColor: "transparent !important" }, "&::selection": { backgroundColor: "transparent !important" } } };
ZE && (rP[".cm-line"].caretColor = "transparent !important");
var iP = K_.highest(LE.theme(rP));
function oP(e18) {
var t2 = e18.scrollDOM.getBoundingClientRect();
return { left: (e18.textDirection == LO.LTR ? t2.left : t2.right - e18.scrollDOM.clientWidth) - e18.scrollDOM.scrollLeft, top: t2.top - e18.scrollDOM.scrollTop };
}
function aP(e18, t2, n2) {
var r2 = T_.cursor(t2);
return { from: Math.max(n2.from, e18.moveToLineBoundary(r2, false, true).from), to: Math.min(n2.to, e18.moveToLineBoundary(r2, true, true).from), type: rO.Text };
}
function sP(e18, t2) {
var n2 = e18.lineBlockAt(t2);
if (Array.isArray(n2.type)) {
var r2, i2 = bi(n2.type);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
if (o2.to > t2 || o2.to == t2 && (o2.to == n2.to || o2.type == rO.Text))
return o2;
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
}
return n2;
}
function uP(e18, t2, n2) {
var r2 = e18.coordsAtPos(t2.head, t2.assoc || 1);
if (!r2)
return null;
var i2 = oP(e18);
return new tP(r2.left - i2.left, r2.top - i2.top, -1, r2.bottom - r2.top, n2 ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary");
}
var cP = fC.define({ map: function(e18, t2) {
return null == e18 ? null : t2.mapPos(e18);
} }), lP = F_.define({ create: function() {
return null;
}, update: function(e18, t2) {
return null != e18 && (e18 = t2.changes.mapPos(e18)), t2.effects.reduce(function(e19, t3) {
return t3.is(cP) ? t3.value : e19;
}, e18);
} }), fP = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.cursor = null, this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) };
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2, n2 = e19.state.field(lP);
null == n2 ? null != this.cursor && (null === (t2 = this.cursor) || void 0 === t2 || t2.remove(), this.cursor = null) : (this.cursor || (this.cursor = this.view.scrollDOM.appendChild(document.createElement("div")), this.cursor.className = "cm-dropCursor"), (e19.startState.field(lP) != n2 || e19.docChanged || e19.geometryChanged) && this.view.requestMeasure(this.measureReq));
} }, { key: "readPos", value: function() {
var e19 = this.view.state.field(lP), t2 = null != e19 && this.view.coordsAtPos(e19);
if (!t2)
return null;
var n2 = this.view.scrollDOM.getBoundingClientRect();
return { left: t2.left - n2.left + this.view.scrollDOM.scrollLeft, top: t2.top - n2.top + this.view.scrollDOM.scrollTop, height: t2.bottom - t2.top };
} }, { key: "drawCursor", value: function(e19) {
this.cursor && (e19 ? (this.cursor.style.left = e19.left + "px", this.cursor.style.top = e19.top + "px", this.cursor.style.height = e19.height + "px") : this.cursor.style.left = "-100000px");
} }, { key: "destroy", value: function() {
this.cursor && this.cursor.remove();
} }, { key: "setDropPos", value: function(e19) {
this.view.state.field(lP) != e19 && this.view.dispatch({ effects: cP.of(e19) });
} }]), e18;
}(), { eventHandlers: { dragover: function(e18) {
this.setDropPos(this.view.posAtCoords({ x: e18.clientX, y: e18.clientY }));
}, dragleave: function(e18) {
e18.target != this.view.contentDOM && this.view.contentDOM.contains(e18.relatedTarget) || this.setDropPos(null);
}, dragend: function() {
this.setDropPos(null);
}, drop: function() {
this.setDropPos(null);
} } });
function hP(e18, t2, n2, r2, i2) {
t2.lastIndex = 0;
for (var o2, a2 = e18.iterRange(n2, r2), s2 = n2; !a2.next().done; s2 += a2.value.length)
if (!a2.lineBreak)
for (; o2 = t2.exec(a2.value); )
i2(s2 + o2.index, o2);
}
var dP = function() {
function e18(t2) {
Ri(this, e18);
var n2 = t2.regexp, r2 = t2.decoration, i2 = t2.decorate, o2 = t2.boundary, a2 = t2.maxLength, s2 = void 0 === a2 ? 1e3 : a2;
if (!n2.global)
throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");
if (this.regexp = n2, i2)
this.addMatch = function(e19, t3, n3, r3) {
return i2(r3, n3, n3 + e19[0].length, e19, t3);
};
else if ("function" == typeof r2)
this.addMatch = function(e19, t3, n3, i3) {
var o3 = r2(e19, t3, n3);
o3 && i3(n3, n3 + e19[0].length, o3);
};
else {
if (!r2)
throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");
this.addMatch = function(e19, t3, n3, i3) {
return i3(n3, n3 + e19[0].length, r2);
};
}
this.boundary = o2, this.maxLength = s2;
}
return Li(e18, [{ key: "createDeco", value: function(e19) {
var t2, n2 = this, r2 = new PC(), i2 = r2.add.bind(r2), o2 = bi(function(e20, t3) {
var n3 = e20.visibleRanges;
if (1 == n3.length && n3[0].from == e20.viewport.from && n3[0].to == e20.viewport.to)
return n3;
var r3, i3 = [], o3 = bi(n3);
try {
for (o3.s(); !(r3 = o3.n()).done; ) {
var a3 = r3.value, s3 = a3.from, u3 = a3.to;
s3 = Math.max(e20.state.doc.lineAt(s3).from, s3 - t3), u3 = Math.min(e20.state.doc.lineAt(u3).to, u3 + t3), i3.length && i3[i3.length - 1].to >= s3 ? i3[i3.length - 1].to = u3 : i3.push({ from: s3, to: u3 });
}
} catch (e21) {
o3.e(e21);
} finally {
o3.f();
}
return i3;
}(e19, this.maxLength));
try {
for (o2.s(); !(t2 = o2.n()).done; ) {
var a2 = t2.value, s2 = a2.from, u2 = a2.to;
hP(e19.state.doc, this.regexp, s2, u2, function(t3, r3) {
return n2.addMatch(r3, e19, t3, i2);
});
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
return r2.finish();
} }, { key: "updateDeco", value: function(e19, t2) {
var n2 = 1e9, r2 = -1;
return e19.docChanged && e19.changes.iterChanges(function(t3, i2, o2, a2) {
a2 > e19.view.viewport.from && o2 < e19.view.viewport.to && (n2 = Math.min(o2, n2), r2 = Math.max(a2, r2));
}), e19.viewportChanged || r2 - n2 > 1e3 ? this.createDeco(e19.view) : r2 > -1 ? this.updateRange(e19.view, t2.map(e19.changes), n2, r2) : t2;
} }, { key: "updateRange", value: function(e19, t2, n2, r2) {
var i2, o2 = this, a2 = bi(e19.visibleRanges);
try {
for (a2.s(); !(i2 = a2.n()).done; ) {
var s2 = i2.value, u2 = Math.max(s2.from, n2), c2 = Math.min(s2.to, r2);
c2 > u2 && function() {
var n3 = e19.state.doc.lineAt(u2), r3 = n3.to < c2 ? e19.state.doc.lineAt(c2) : n3, i3 = Math.max(s2.from, n3.from), a3 = Math.min(s2.to, r3.to);
if (o2.boundary) {
for (; u2 > n3.from; u2--)
if (o2.boundary.test(n3.text[u2 - 1 - n3.from])) {
i3 = u2;
break;
}
for (; c2 < r3.to; c2++)
if (o2.boundary.test(r3.text[c2 - r3.from])) {
a3 = c2;
break;
}
}
var l2 = [], f2 = void 0, h2 = function(e20, t3, n4) {
return l2.push(n4.range(e20, t3));
};
if (n3 == r3)
for (o2.regexp.lastIndex = i3 - n3.from; (f2 = o2.regexp.exec(n3.text)) && f2.index < a3 - n3.from; )
o2.addMatch(f2, e19, f2.index + n3.from, h2);
else
hP(e19.state.doc, o2.regexp, i3, a3, function(t3, n4) {
return o2.addMatch(n4, e19, t3, h2);
});
t2 = t2.update({ filterFrom: i3, filterTo: a3, filter: function(e20, t3) {
return e20 < i3 || t3 > a3;
}, add: l2 });
}();
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
return t2;
} }]), e18;
}(), vP = null != /x/.unicode ? "gu" : "g", pP = new RegExp("[\0-\b\n-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]", vP), mP = { 0: "null", 7: "bell", 8: "backspace", 10: "newline", 11: "vertical tab", 13: "carriage return", 27: "escape", 8203: "zero width space", 8204: "zero width non-joiner", 8205: "zero width joiner", 8206: "left-to-right mark", 8207: "right-to-left mark", 8232: "line separator", 8237: "left-to-right override", 8238: "right-to-left override", 8294: "left-to-right isolate", 8295: "right-to-left isolate", 8297: "pop directional isolate", 8233: "paragraph separator", 65279: "zero width no-break space", 65532: "object replacement" }, gP = null;
var yP = R_.define({ combine: function(e18) {
var t2 = SC(e18, { render: null, specialChars: pP, addSpecialChars: null });
return (t2.replaceTabs = !function() {
var e19;
if (null == gP && "undefined" != typeof document && document.body) {
var t3 = document.body.style;
gP = null != (null !== (e19 = t3.tabSize) && void 0 !== e19 ? e19 : t3.MozTabSize);
}
return gP || false;
}()) && (t2.specialChars = new RegExp(" |" + t2.specialChars.source, vP)), t2.addSpecialChars && (t2.specialChars = new RegExp(t2.specialChars.source + "|" + t2.addSpecialChars.source, vP)), t2;
} });
function bP() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return [yP.of(e18), wP()];
}
var kP = null;
function wP() {
return kP || (kP = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.decorations = iO.none, this.decorationCache = /* @__PURE__ */ Object.create(null), this.decorator = this.makeDecorator(t2.state.facet(yP)), this.decorations = this.decorator.createDeco(t2);
}
return Li(e18, [{ key: "makeDecorator", value: function(e19) {
var t2 = this;
return new dP({ regexp: e19.specialChars, decoration: function(n2, r2, i2) {
var o2 = r2.state.doc, a2 = b_(n2[0], 0);
if (9 == a2) {
var s2 = o2.lineAt(i2), u2 = r2.state.tabSize, c2 = FC(s2.text, u2, i2 - s2.from);
return iO.replace({ widget: new xP((u2 - c2 % u2) * t2.view.defaultCharacterWidth) });
}
return t2.decorationCache[a2] || (t2.decorationCache[a2] = iO.replace({ widget: new jP(e19, a2) }));
}, boundary: e19.replaceTabs ? void 0 : /[^]/ });
} }, { key: "update", value: function(e19) {
var t2 = e19.state.facet(yP);
e19.startState.facet(yP) != t2 ? (this.decorator = this.makeDecorator(t2), this.decorations = this.decorator.createDeco(e19.view)) : this.decorations = this.decorator.updateDeco(e19, this.decorations);
} }]), e18;
}(), { decorations: function(e18) {
return e18.decorations;
} }));
}
var jP = function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2(e19, r2) {
var i2;
return Ri(this, n2), (i2 = t2.call(this)).options = e19, i2.code = r2, i2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return e19.code == this.code;
} }, { key: "toDOM", value: function(e19) {
var t3 = function(e20) {
return e20 >= 32 ? "\u2022" : 10 == e20 ? "\u2424" : String.fromCharCode(9216 + e20);
}(this.code), n3 = e19.state.phrase("Control character") + " " + (mP[this.code] || "0x" + this.code.toString(16)), r2 = this.options.render && this.options.render(this.code, n3, t3);
if (r2)
return r2;
var i2 = document.createElement("span");
return i2.textContent = t3, i2.title = n3, i2.setAttribute("aria-label", n3), i2.className = "cm-specialChar", i2;
} }, { key: "ignoreEvent", value: function() {
return false;
} }]), n2;
}(), xP = function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).width = e19, r2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return e19.width == this.width;
} }, { key: "toDOM", value: function() {
var e19 = document.createElement("span");
return e19.textContent = " ", e19.className = "cm-tab", e19.style.width = this.width + "px", e19;
} }, { key: "ignoreEvent", value: function() {
return false;
} }]), n2;
}();
var SP = iO.line({ class: "cm-activeLine" }), _P = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.decorations = this.getDeco(t2);
}
return Li(e18, [{ key: "update", value: function(e19) {
(e19.docChanged || e19.selectionSet) && (this.decorations = this.getDeco(e19.view));
} }, { key: "getDeco", value: function(e19) {
var t2, n2 = -1, r2 = [], i2 = bi(e19.state.selection.ranges);
try {
for (i2.s(); !(t2 = i2.n()).done; ) {
var o2 = t2.value, a2 = e19.lineBlockAt(o2.head);
a2.from > n2 && (r2.push(SP.range(a2.from)), n2 = a2.from);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return iO.set(r2);
} }]), e18;
}(), { decorations: function(e18) {
return e18.decorations;
} });
function CP(e18, t2) {
var n2 = e18.posAtCoords({ x: t2.clientX, y: t2.clientY }, false), r2 = e18.state.doc.lineAt(n2), i2 = n2 - r2.from, o2 = i2 > 2e3 ? -1 : i2 == r2.length ? function(e19, t3) {
var n3 = e19.coordsAtPos(e19.viewport.from);
return n3 ? Math.round(Math.abs((n3.left - t3) / e19.defaultCharacterWidth)) : -1;
}(e18, t2.clientX) : FC(r2.text, e18.state.tabSize, n2 - r2.from);
return { line: r2.number, col: o2, off: i2 };
}
function $P(e18, t2) {
var n2 = CP(e18, t2), r2 = e18.state.selection;
return n2 ? { update: function(e19) {
if (e19.docChanged) {
var t3 = e19.changes.mapPos(e19.startState.doc.line(n2.line).from), i2 = e19.state.doc.lineAt(t3);
n2 = { line: i2.number, col: n2.col, off: Math.min(n2.off, i2.length) }, r2 = r2.map(e19.changes);
}
}, get: function(t3, i2, o2) {
var a2 = CP(e18, t3);
if (!a2)
return r2;
var s2 = function(e19, t4, n3) {
var r3 = Math.min(t4.line, n3.line), i3 = Math.max(t4.line, n3.line), o3 = [];
if (t4.off > 2e3 || n3.off > 2e3 || t4.col < 0 || n3.col < 0)
for (var a3 = Math.min(t4.off, n3.off), s3 = Math.max(t4.off, n3.off), u2 = r3; u2 <= i3; u2++) {
var c2 = e19.doc.line(u2);
c2.length <= s3 && o3.push(T_.range(c2.from + a3, c2.to + s3));
}
else
for (var l2 = Math.min(t4.col, n3.col), f2 = Math.max(t4.col, n3.col), h2 = r3; h2 <= i3; h2++) {
var d2 = e19.doc.line(h2), v2 = VC(d2.text, l2, e19.tabSize, true);
if (v2 > -1) {
var p2 = VC(d2.text, f2, e19.tabSize);
o3.push(T_.range(d2.from + v2, d2.from + p2));
}
}
return o3;
}(e18.state, n2, a2);
return s2.length ? o2 ? T_.create(s2.concat(r2.ranges)) : T_.create(s2) : r2;
} } : null;
}
function OP(e18) {
var t2 = (null == e18 ? void 0 : e18.eventFilter) || function(e19) {
return e19.altKey && 0 == e19.button;
};
return LE.mouseSelectionStyle.of(function(e19, n2) {
return t2(n2) ? $P(e19, n2) : null;
});
}
var MP = { Alt: [18, function(e18) {
return e18.altKey;
}], Control: [17, function(e18) {
return e18.ctrlKey;
}], Shift: [16, function(e18) {
return e18.shiftKey;
}], Meta: [91, function(e18) {
return e18.metaKey;
}] }, EP = { style: "cursor: crosshair" };
function PP() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = ki(MP[e18.key || "Alt"], 2), n2 = t2[0], r2 = t2[1], i2 = OO.fromClass(function() {
function e19(t3) {
Ri(this, e19), this.view = t3, this.isDown = false;
}
return Li(e19, [{ key: "set", value: function(e20) {
this.isDown != e20 && (this.isDown = e20, this.view.update([]));
} }]), e19;
}(), { eventHandlers: { keydown: function(e19) {
this.set(e19.keyCode == n2 || r2(e19));
}, keyup: function(e19) {
e19.keyCode != n2 && r2(e19) || this.set(false);
} } });
return [i2, LE.contentAttributes.of(function(e19) {
var t3;
return (null === (t3 = e19.plugin(i2)) || void 0 === t3 ? void 0 : t3.isDown) ? EP : null;
})];
}
var AP = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.facet = n2, this.createTooltipView = r2, this.input = t2.state.facet(n2), this.tooltips = this.input.filter(function(e19) {
return e19;
}), this.tooltipViews = this.tooltips.map(r2);
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2 = e19.state.facet(this.facet), n2 = t2.filter(function(e20) {
return e20;
});
if (t2 === this.input) {
var r2, i2 = bi(this.tooltipViews);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
o2.update && o2.update(e19);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return false;
}
for (var a2 = [], s2 = 0; s2 < n2.length; s2++) {
var u2 = n2[s2], c2 = -1;
if (u2) {
for (var l2 = 0; l2 < this.tooltips.length; l2++) {
var f2 = this.tooltips[l2];
f2 && f2.create == u2.create && (c2 = l2);
}
if (c2 < 0)
a2[s2] = this.createTooltipView(u2);
else {
var h2 = a2[s2] = this.tooltipViews[c2];
h2.update && h2.update(e19);
}
}
}
var d2, v2 = bi(this.tooltipViews);
try {
for (v2.s(); !(d2 = v2.n()).done; ) {
var p2 = d2.value;
a2.indexOf(p2) < 0 && p2.dom.remove();
}
} catch (e20) {
v2.e(e20);
} finally {
v2.f();
}
return this.input = t2, this.tooltips = n2, this.tooltipViews = a2, true;
} }]), e18;
}();
function TP(e18) {
var t2 = e18.win;
return { top: 0, left: 0, bottom: t2.innerHeight, right: t2.innerWidth };
}
var IP = R_.define({ combine: function(e18) {
var t2, n2, r2;
return { position: q$.ios ? "absolute" : (null === (t2 = e18.find(function(e19) {
return e19.position;
})) || void 0 === t2 ? void 0 : t2.position) || "fixed", parent: (null === (n2 = e18.find(function(e19) {
return e19.parent;
})) || void 0 === n2 ? void 0 : n2.parent) || null, tooltipSpace: (null === (r2 = e18.find(function(e19) {
return e19.tooltipSpace;
})) || void 0 === r2 ? void 0 : r2.tooltipSpace) || TP };
} }), NP = OO.fromClass(function() {
function e18(t2) {
var n2 = this;
Ri(this, e18), this.view = t2, this.inView = true, this.lastTransaction = 0, this.measureTimeout = -1;
var r2 = t2.state.facet(IP);
this.position = r2.position, this.parent = r2.parent, this.classes = t2.themeClasses, this.createContainer(), this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this }, this.manager = new AP(t2, LP, function(e19) {
return n2.createTooltip(e19);
}), this.intersectionObserver = "function" == typeof IntersectionObserver ? new IntersectionObserver(function(e19) {
Date.now() > n2.lastTransaction - 50 && e19.length > 0 && e19[e19.length - 1].intersectionRatio < 1 && n2.measureSoon();
}, { threshold: [1] }) : null, this.observeIntersection(), t2.win.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this)), this.maybeMeasure();
}
return Li(e18, [{ key: "createContainer", value: function() {
this.parent ? (this.container = document.createElement("div"), this.container.style.position = "relative", this.container.className = this.view.themeClasses, this.parent.appendChild(this.container)) : this.container = this.view.dom;
} }, { key: "observeIntersection", value: function() {
if (this.intersectionObserver) {
this.intersectionObserver.disconnect();
var e19, t2 = bi(this.manager.tooltipViews);
try {
for (t2.s(); !(e19 = t2.n()).done; ) {
var n2 = e19.value;
this.intersectionObserver.observe(n2.dom);
}
} catch (e20) {
t2.e(e20);
} finally {
t2.f();
}
}
} }, { key: "measureSoon", value: function() {
var e19 = this;
this.measureTimeout < 0 && (this.measureTimeout = setTimeout(function() {
e19.measureTimeout = -1, e19.maybeMeasure();
}, 50));
} }, { key: "update", value: function(e19) {
e19.transactions.length && (this.lastTransaction = Date.now());
var t2 = this.manager.update(e19);
t2 && this.observeIntersection();
var n2 = t2 || e19.geometryChanged, r2 = e19.state.facet(IP);
if (r2.position != this.position) {
this.position = r2.position;
var i2, o2 = bi(this.manager.tooltipViews);
try {
for (o2.s(); !(i2 = o2.n()).done; ) {
i2.value.dom.style.position = this.position;
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
n2 = true;
}
if (r2.parent != this.parent) {
this.parent && this.container.remove(), this.parent = r2.parent, this.createContainer();
var a2, s2 = bi(this.manager.tooltipViews);
try {
for (s2.s(); !(a2 = s2.n()).done; ) {
var u2 = a2.value;
this.container.appendChild(u2.dom);
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
n2 = true;
} else
this.parent && this.view.themeClasses != this.classes && (this.classes = this.container.className = this.view.themeClasses);
n2 && this.maybeMeasure();
} }, { key: "createTooltip", value: function(e19) {
var t2 = e19.create(this.view);
if (t2.dom.classList.add("cm-tooltip"), e19.arrow && !t2.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) {
var n2 = document.createElement("div");
n2.className = "cm-tooltip-arrow", t2.dom.appendChild(n2);
}
return t2.dom.style.position = this.position, t2.dom.style.top = "-10000px", this.container.appendChild(t2.dom), t2.mount && t2.mount(this.view), t2;
} }, { key: "destroy", value: function() {
var e19;
this.view.win.removeEventListener("resize", this.measureSoon);
var t2, n2 = bi(this.manager.tooltipViews);
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
t2.value.dom.remove();
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
null === (e19 = this.intersectionObserver) || void 0 === e19 || e19.disconnect(), clearTimeout(this.measureTimeout);
} }, { key: "readMeasure", value: function() {
var e19 = this, t2 = this.view.dom.getBoundingClientRect();
return { editor: t2, parent: this.parent ? this.container.getBoundingClientRect() : t2, pos: this.manager.tooltips.map(function(t3, n2) {
var r2 = e19.manager.tooltipViews[n2];
return r2.getCoords ? r2.getCoords(t3.pos) : e19.view.coordsAtPos(t3.pos);
}), size: this.manager.tooltipViews.map(function(e20) {
return e20.dom.getBoundingClientRect();
}), space: this.view.state.facet(IP).tooltipSpace(this.view) };
} }, { key: "writeMeasure", value: function(e19) {
for (var t2 = e19.editor, n2 = e19.space, r2 = [], i2 = 0; i2 < this.manager.tooltips.length; i2++) {
var o2 = this.manager.tooltips[i2], a2 = this.manager.tooltipViews[i2], s2 = a2.dom, u2 = e19.pos[i2], c2 = e19.size[i2];
if (!u2 || u2.bottom <= Math.max(t2.top, n2.top) || u2.top >= Math.min(t2.bottom, n2.bottom) || u2.right < Math.max(t2.left, n2.left) - 0.1 || u2.left > Math.min(t2.right, n2.right) + 0.1)
s2.style.top = "-10000px";
else {
var l2 = o2.arrow ? a2.dom.querySelector(".cm-tooltip-arrow") : null, f2 = l2 ? 7 : 0, h2 = c2.right - c2.left, d2 = c2.bottom - c2.top, v2 = a2.offset || DP, p2 = this.view.textDirection == LO.LTR, m2 = c2.width > n2.right - n2.left ? p2 ? n2.left : n2.right - c2.width : p2 ? Math.min(u2.left - (l2 ? 14 : 0) + v2.x, n2.right - h2) : Math.max(n2.left, u2.left - h2 + (l2 ? 14 : 0) - v2.x), g2 = !!o2.above;
!o2.strictSide && (g2 ? u2.top - (c2.bottom - c2.top) - v2.y < n2.top : u2.bottom + (c2.bottom - c2.top) + v2.y > n2.bottom) && g2 == n2.bottom - u2.bottom > u2.top - n2.top && (g2 = !g2);
var y2 = g2 ? u2.top - d2 - f2 - v2.y : u2.bottom + f2 + v2.y, b2 = m2 + h2;
if (true !== a2.overlap) {
var k2, w2 = bi(r2);
try {
for (w2.s(); !(k2 = w2.n()).done; ) {
var j2 = k2.value;
j2.left < b2 && j2.right > m2 && j2.top < y2 + d2 && j2.bottom > y2 && (y2 = g2 ? j2.top - d2 - 2 - f2 : j2.bottom + f2 + 2);
}
} catch (e20) {
w2.e(e20);
} finally {
w2.f();
}
}
"absolute" == this.position ? (s2.style.top = y2 - e19.parent.top + "px", s2.style.left = m2 - e19.parent.left + "px") : (s2.style.top = y2 + "px", s2.style.left = m2 + "px"), l2 && (l2.style.left = "".concat(u2.left + (p2 ? v2.x : -v2.x) - (m2 + 14 - 7), "px")), true !== a2.overlap && r2.push({ left: m2, top: y2, right: b2, bottom: y2 + d2 }), s2.classList.toggle("cm-tooltip-above", g2), s2.classList.toggle("cm-tooltip-below", !g2), a2.positioned && a2.positioned();
}
}
} }, { key: "maybeMeasure", value: function() {
if (this.manager.tooltips.length && (this.view.inView && this.view.requestMeasure(this.measureReq), this.inView != this.view.inView && (this.inView = this.view.inView, !this.inView))) {
var e19, t2 = bi(this.manager.tooltipViews);
try {
for (t2.s(); !(e19 = t2.n()).done; ) {
e19.value.dom.style.top = "-10000px";
}
} catch (e20) {
t2.e(e20);
} finally {
t2.f();
}
}
} }]), e18;
}(), { eventHandlers: { scroll: function() {
this.maybeMeasure();
} } }), RP = LE.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: "".concat(7, "px"), width: "".concat(14, "px"), position: "absolute", zIndex: -1, overflow: "hidden", "&:before, &:after": { content: "''", position: "absolute", width: 0, height: 0, borderLeft: "".concat(7, "px solid transparent"), borderRight: "".concat(7, "px solid transparent") }, ".cm-tooltip-above &": { bottom: "-".concat(7, "px"), "&:before": { borderTop: "".concat(7, "px solid #bbb") }, "&:after": { borderTop: "".concat(7, "px solid #f5f5f5"), bottom: "1px" } }, ".cm-tooltip-below &": { top: "-".concat(7, "px"), "&:before": { borderBottom: "".concat(7, "px solid #bbb") }, "&:after": { borderBottom: "".concat(7, "px solid #f5f5f5"), top: "1px" } } }, "&dark .cm-tooltip .cm-tooltip-arrow": { "&:before": { borderTopColor: "#333338", borderBottomColor: "#333338" }, "&:after": { borderTopColor: "transparent", borderBottomColor: "transparent" } } }), DP = { x: 0, y: 0 }, LP = R_.define({ enables: [NP, RP] }), zP = R_.define(), BP = function() {
function e18(t2) {
var n2 = this;
Ri(this, e18), this.view = t2, this.mounted = false, this.dom = document.createElement("div"), this.dom.classList.add("cm-tooltip-hover"), this.manager = new AP(t2, zP, function(e19) {
return n2.createHostedView(e19);
});
}
return Li(e18, [{ key: "createHostedView", value: function(e19) {
var t2 = e19.create(this.view);
return t2.dom.classList.add("cm-tooltip-section"), this.dom.appendChild(t2.dom), this.mounted && t2.mount && t2.mount(this.view), t2;
} }, { key: "mount", value: function(e19) {
var t2, n2 = bi(this.manager.tooltipViews);
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
var r2 = t2.value;
r2.mount && r2.mount(e19);
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
this.mounted = true;
} }, { key: "positioned", value: function() {
var e19, t2 = bi(this.manager.tooltipViews);
try {
for (t2.s(); !(e19 = t2.n()).done; ) {
var n2 = e19.value;
n2.positioned && n2.positioned();
}
} catch (e20) {
t2.e(e20);
} finally {
t2.f();
}
} }, { key: "update", value: function(e19) {
this.manager.update(e19);
} }], [{ key: "create", value: function(t2) {
return new e18(t2);
} }]), e18;
}(), qP = LP.compute([zP], function(e18) {
var t2 = e18.facet(zP).filter(function(e19) {
return e19;
});
return 0 === t2.length ? null : { pos: Math.min.apply(Math, Ti(t2.map(function(e19) {
return e19.pos;
}))), end: Math.max.apply(Math, Ti(t2.filter(function(e19) {
return null != e19.end;
}).map(function(e19) {
return e19.end;
}))), create: BP.create, above: t2[0].above, arrow: t2.some(function(e19) {
return e19.arrow;
}) };
}), FP = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.view = t2, this.source = n2, this.field = r2, this.setHover = i2, this.hoverTime = o2, this.hoverTimeout = -1, this.restartTimeout = -1, this.pending = null, this.lastMove = { x: 0, y: 0, target: t2.dom, time: 0 }, this.checkHover = this.checkHover.bind(this), t2.dom.addEventListener("mouseleave", this.mouseleave = this.mouseleave.bind(this)), t2.dom.addEventListener("mousemove", this.mousemove = this.mousemove.bind(this));
}
return Li(e18, [{ key: "update", value: function() {
var e19 = this;
this.pending && (this.pending = null, clearTimeout(this.restartTimeout), this.restartTimeout = setTimeout(function() {
return e19.startHover();
}, 20));
} }, { key: "active", get: function() {
return this.view.state.field(this.field);
} }, { key: "checkHover", value: function() {
if (this.hoverTimeout = -1, !this.active) {
var e19 = Date.now() - this.lastMove.time;
e19 < this.hoverTime ? this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime - e19) : this.startHover();
}
} }, { key: "startHover", value: function() {
var e19 = this;
clearTimeout(this.restartTimeout);
var t2 = this.lastMove, n2 = this.view.contentDOM.contains(t2.target) ? this.view.posAtCoords(t2) : null;
if (null != n2) {
var r2 = this.view.coordsAtPos(n2);
if (!(null == r2 || t2.y < r2.top || t2.y > r2.bottom || t2.x < r2.left - this.view.defaultCharacterWidth || t2.x > r2.right + this.view.defaultCharacterWidth)) {
var i2 = this.view.bidiSpans(this.view.state.doc.lineAt(n2)).find(function(e20) {
return e20.from <= n2 && e20.to >= n2;
}), o2 = i2 && i2.dir == LO.RTL ? -1 : 1, a2 = this.source(this.view, n2, t2.x < r2.left ? -o2 : o2);
if (null == a2 ? void 0 : a2.then) {
var s2 = this.pending = { pos: n2 };
a2.then(function(t3) {
e19.pending == s2 && (e19.pending = null, t3 && e19.view.dispatch({ effects: e19.setHover.of(t3) }));
}, function(t3) {
return SO(e19.view.state, t3, "hover tooltip");
});
} else
a2 && this.view.dispatch({ effects: this.setHover.of(a2) });
}
}
} }, { key: "mousemove", value: function(e19) {
var t2;
this.lastMove = { x: e19.clientX, y: e19.clientY, target: e19.target, time: Date.now() }, this.hoverTimeout < 0 && (this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime));
var n2 = this.active;
if (n2 && !function(e20) {
for (var t3 = e20; t3; t3 = t3.parentNode)
if (1 == t3.nodeType && t3.classList.contains("cm-tooltip"))
return true;
return false;
}(this.lastMove.target) || this.pending) {
var r2 = (n2 || this.pending).pos, i2 = null !== (t2 = null == n2 ? void 0 : n2.end) && void 0 !== t2 ? t2 : r2;
(r2 == i2 ? this.view.posAtCoords(this.lastMove) == r2 : function(e20, t3, n3, r3, i3, o2) {
var a2 = document.createRange(), s2 = e20.domAtPos(t3), u2 = e20.domAtPos(n3);
a2.setEnd(u2.node, u2.offset), a2.setStart(s2.node, s2.offset);
var c2 = a2.getClientRects();
a2.detach();
for (var l2 = 0; l2 < c2.length; l2++) {
var f2 = c2[l2];
if (Math.max(f2.top - i3, i3 - f2.bottom, f2.left - r3, r3 - f2.right) <= o2)
return true;
}
return false;
}(this.view, r2, i2, e19.clientX, e19.clientY, 6)) || (this.view.dispatch({ effects: this.setHover.of(null) }), this.pending = null);
}
} }, { key: "mouseleave", value: function() {
clearTimeout(this.hoverTimeout), this.hoverTimeout = -1, this.active && this.view.dispatch({ effects: this.setHover.of(null) });
} }, { key: "destroy", value: function() {
clearTimeout(this.hoverTimeout), this.view.dom.removeEventListener("mouseleave", this.mouseleave), this.view.dom.removeEventListener("mousemove", this.mousemove);
} }]), e18;
}();
function VP(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n2 = fC.define(), r2 = F_.define({ create: function() {
return null;
}, update: function(e19, r3) {
if (e19 && (t2.hideOnChange && (r3.docChanged || r3.selection) || t2.hideOn && t2.hideOn(r3, e19)))
return null;
if (e19 && r3.docChanged) {
var i2 = r3.changes.mapPos(e19.pos, -1, x_.TrackDel);
if (null == i2)
return null;
var o2 = Object.assign(/* @__PURE__ */ Object.create(null), e19);
o2.pos = i2, null != e19.end && (o2.end = r3.changes.mapPos(e19.end)), e19 = o2;
}
var a2, s2 = bi(r3.effects);
try {
for (s2.s(); !(a2 = s2.n()).done; ) {
var u2 = a2.value;
u2.is(n2) && (e19 = u2.value), u2.is(HP) && (e19 = null);
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
return e19;
}, provide: function(e19) {
return zP.from(e19);
} });
return [r2, OO.define(function(i2) {
return new FP(i2, e18, r2, n2, t2.hoverTime || 300);
}), qP];
}
function WP(e18, t2) {
var n2 = e18.plugin(NP);
if (!n2)
return null;
var r2 = n2.manager.tooltips.indexOf(t2);
return r2 < 0 ? null : n2.manager.tooltipViews[r2];
}
var HP = fC.define(), JP = R_.define({ combine: function(e18) {
var t2, n2, r2, i2 = bi(e18);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
t2 = t2 || o2.topContainer, n2 = n2 || o2.bottomContainer;
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return { topContainer: t2, bottomContainer: n2 };
} });
function UP(e18, t2) {
var n2 = e18.plugin(KP), r2 = n2 ? n2.specs.indexOf(t2) : -1;
return r2 > -1 ? n2.panels[r2] : null;
}
var KP = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.input = t2.state.facet(YP), this.specs = this.input.filter(function(e19) {
return e19;
}), this.panels = this.specs.map(function(e19) {
return e19(t2);
});
var n2 = t2.state.facet(JP);
this.top = new GP(t2, true, n2.topContainer), this.bottom = new GP(t2, false, n2.bottomContainer), this.top.sync(this.panels.filter(function(e19) {
return e19.top;
})), this.bottom.sync(this.panels.filter(function(e19) {
return !e19.top;
}));
var r2, i2 = bi(this.panels);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
o2.dom.classList.add("cm-panel"), o2.mount && o2.mount();
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2 = e19.state.facet(JP);
this.top.container != t2.topContainer && (this.top.sync([]), this.top = new GP(e19.view, true, t2.topContainer)), this.bottom.container != t2.bottomContainer && (this.bottom.sync([]), this.bottom = new GP(e19.view, false, t2.bottomContainer)), this.top.syncClasses(), this.bottom.syncClasses();
var n2 = e19.state.facet(YP);
if (n2 != this.input) {
var r2, i2 = n2.filter(function(e20) {
return e20;
}), o2 = [], a2 = [], s2 = [], u2 = [], c2 = bi(i2);
try {
for (c2.s(); !(r2 = c2.n()).done; ) {
var l2 = r2.value, f2 = this.specs.indexOf(l2), h2 = void 0;
f2 < 0 ? (h2 = l2(e19.view), u2.push(h2)) : (h2 = this.panels[f2]).update && h2.update(e19), o2.push(h2), (h2.top ? a2 : s2).push(h2);
}
} catch (e20) {
c2.e(e20);
} finally {
c2.f();
}
this.specs = i2, this.panels = o2, this.top.sync(a2), this.bottom.sync(s2);
for (var d2 = 0, v2 = u2; d2 < v2.length; d2++) {
var p2 = v2[d2];
p2.dom.classList.add("cm-panel"), p2.mount && p2.mount();
}
} else {
var m2, g2 = bi(this.panels);
try {
for (g2.s(); !(m2 = g2.n()).done; ) {
var y2 = m2.value;
y2.update && y2.update(e19);
}
} catch (e20) {
g2.e(e20);
} finally {
g2.f();
}
}
} }, { key: "destroy", value: function() {
this.top.sync([]), this.bottom.sync([]);
} }]), e18;
}(), { provide: function(e18) {
return LE.scrollMargins.of(function(t2) {
var n2 = t2.plugin(e18);
return n2 && { top: n2.top.scrollMargin(), bottom: n2.bottom.scrollMargin() };
});
} }), GP = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.view = t2, this.top = n2, this.container = r2, this.dom = void 0, this.classes = "", this.panels = [], this.syncClasses();
}
return Li(e18, [{ key: "sync", value: function(e19) {
var t2, n2 = bi(this.panels);
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
var r2 = t2.value;
r2.destroy && e19.indexOf(r2) < 0 && r2.destroy();
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
this.panels = e19, this.syncDOM();
} }, { key: "syncDOM", value: function() {
if (0 != this.panels.length) {
if (!this.dom) {
this.dom = document.createElement("div"), this.dom.className = this.top ? "cm-panels cm-panels-top" : "cm-panels cm-panels-bottom", this.dom.style[this.top ? "top" : "bottom"] = "0";
var e19 = this.container || this.view.dom;
e19.insertBefore(this.dom, this.top ? e19.firstChild : null);
}
var t2, n2 = this.dom.firstChild, r2 = bi(this.panels);
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
var i2 = t2.value;
if (i2.dom.parentNode == this.dom) {
for (; n2 != i2.dom; )
n2 = QP(n2);
n2 = n2.nextSibling;
} else
this.dom.insertBefore(i2.dom, n2);
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
for (; n2; )
n2 = QP(n2);
} else
this.dom && (this.dom.remove(), this.dom = void 0);
} }, { key: "scrollMargin", value: function() {
return !this.dom || this.container ? 0 : Math.max(0, this.top ? this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) : Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top);
} }, { key: "syncClasses", value: function() {
if (this.container && this.classes != this.view.themeClasses) {
var e19, t2 = bi(this.classes.split(" "));
try {
for (t2.s(); !(e19 = t2.n()).done; ) {
var n2 = e19.value;
n2 && this.container.classList.remove(n2);
}
} catch (e20) {
t2.e(e20);
} finally {
t2.f();
}
var r2, i2 = bi((this.classes = this.view.themeClasses).split(" "));
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
o2 && this.container.classList.add(o2);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
}
} }]), e18;
}();
function QP(e18) {
var t2 = e18.nextSibling;
return e18.remove(), t2;
}
var YP = R_.define({ enables: KP }), ZP = function(e18) {
Ci(n2, _C);
var t2 = Oi(n2);
function n2() {
return Ri(this, n2), t2.apply(this, arguments);
}
return Li(n2, [{ key: "compare", value: function(e19) {
return this == e19 || this.constructor == e19.constructor && this.eq(e19);
} }, { key: "eq", value: function(e19) {
return false;
} }, { key: "destroy", value: function(e19) {
} }]), n2;
}();
ZP.prototype.elementClass = "", ZP.prototype.toDOM = void 0, ZP.prototype.mapMode = x_.TrackBefore, ZP.prototype.startSide = ZP.prototype.endSide = -1, ZP.prototype.point = true;
var XP = R_.define(), eA = { class: "", renderEmptyElements: false, elementStyle: "", markers: function() {
return MC.empty;
}, lineMarker: function() {
return null;
}, lineMarkerChange: null, initialSpacer: null, updateSpacer: null, domEventHandlers: {} }, tA = R_.define();
function nA(e18) {
return [iA(), tA.of(Object.assign(Object.assign({}, eA), e18))];
}
var rA = R_.define({ combine: function(e18) {
return e18.some(function(e19) {
return e19;
});
} });
function iA(e18) {
var t2 = [oA];
return e18 && false === e18.fixed && t2.push(rA.of(true)), t2;
}
var oA = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.prevViewport = t2.viewport, this.dom = document.createElement("div"), this.dom.className = "cm-gutters", this.dom.setAttribute("aria-hidden", "true"), this.dom.style.minHeight = this.view.contentHeight + "px", this.gutters = t2.state.facet(tA).map(function(e19) {
return new cA(t2, e19);
});
var n2, r2 = bi(this.gutters);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
this.dom.appendChild(i2.dom);
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
this.fixed = !t2.state.facet(rA), this.fixed && (this.dom.style.position = "sticky"), this.syncGutters(false), t2.scrollDOM.insertBefore(this.dom, t2.contentDOM);
}
return Li(e18, [{ key: "update", value: function(e19) {
if (this.updateGutters(e19)) {
var t2 = this.prevViewport, n2 = e19.view.viewport, r2 = Math.min(t2.to, n2.to) - Math.max(t2.from, n2.from);
this.syncGutters(r2 < 0.8 * (n2.to - n2.from));
}
e19.geometryChanged && (this.dom.style.minHeight = this.view.contentHeight + "px"), this.view.state.facet(rA) != !this.fixed && (this.fixed = !this.fixed, this.dom.style.position = this.fixed ? "sticky" : ""), this.prevViewport = e19.view.viewport;
} }, { key: "syncGutters", value: function(e19) {
var t2 = this, n2 = this.dom.nextSibling;
e19 && this.dom.remove();
var r2, i2 = MC.iter(this.view.state.facet(XP), this.view.viewport.from), o2 = [], a2 = this.gutters.map(function(e20) {
return new uA(e20, t2.view.viewport, -t2.view.documentPadding.top);
}), s2 = bi(this.view.viewportLineBlocks);
try {
for (s2.s(); !(r2 = s2.n()).done; ) {
var u2 = r2.value, c2 = void 0;
if (Array.isArray(u2.type)) {
var l2, f2 = bi(u2.type);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
var h2 = l2.value;
if (h2.type == rO.Text) {
c2 = h2;
break;
}
}
} catch (e20) {
f2.e(e20);
} finally {
f2.f();
}
} else
c2 = u2.type == rO.Text ? u2 : void 0;
if (c2) {
o2.length && (o2 = []), sA(i2, o2, u2.from);
var d2, v2 = bi(a2);
try {
for (v2.s(); !(d2 = v2.n()).done; ) {
d2.value.line(this.view, c2, o2);
}
} catch (e20) {
v2.e(e20);
} finally {
v2.f();
}
}
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
var p2, m2 = bi(a2);
try {
for (m2.s(); !(p2 = m2.n()).done; ) {
p2.value.finish();
}
} catch (e20) {
m2.e(e20);
} finally {
m2.f();
}
e19 && this.view.scrollDOM.insertBefore(this.dom, n2);
} }, { key: "updateGutters", value: function(e19) {
var t2 = e19.startState.facet(tA), n2 = e19.state.facet(tA), r2 = e19.docChanged || e19.heightChanged || e19.viewportChanged || !MC.eq(e19.startState.facet(XP), e19.state.facet(XP), e19.view.viewport.from, e19.view.viewport.to);
if (t2 == n2) {
var i2, o2 = bi(this.gutters);
try {
for (o2.s(); !(i2 = o2.n()).done; ) {
i2.value.update(e19) && (r2 = true);
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
} else {
r2 = true;
var a2, s2 = [], u2 = bi(n2);
try {
for (u2.s(); !(a2 = u2.n()).done; ) {
var c2 = a2.value, l2 = t2.indexOf(c2);
l2 < 0 ? s2.push(new cA(this.view, c2)) : (this.gutters[l2].update(e19), s2.push(this.gutters[l2]));
}
} catch (e20) {
u2.e(e20);
} finally {
u2.f();
}
var f2, h2 = bi(this.gutters);
try {
for (h2.s(); !(f2 = h2.n()).done; ) {
var d2 = f2.value;
d2.dom.remove(), s2.indexOf(d2) < 0 && d2.destroy();
}
} catch (e20) {
h2.e(e20);
} finally {
h2.f();
}
for (var v2 = 0, p2 = s2; v2 < p2.length; v2++) {
var m2 = p2[v2];
this.dom.appendChild(m2.dom);
}
this.gutters = s2;
}
return r2;
} }, { key: "destroy", value: function() {
var e19, t2 = bi(this.gutters);
try {
for (t2.s(); !(e19 = t2.n()).done; ) {
e19.value.destroy();
}
} catch (e20) {
t2.e(e20);
} finally {
t2.f();
}
this.dom.remove();
} }]), e18;
}(), { provide: function(e18) {
return LE.scrollMargins.of(function(t2) {
var n2 = t2.plugin(e18);
return n2 && 0 != n2.gutters.length && n2.fixed ? t2.textDirection == LO.LTR ? { left: n2.dom.offsetWidth } : { right: n2.dom.offsetWidth } : null;
});
} });
function aA(e18) {
return Array.isArray(e18) ? e18 : [e18];
}
function sA(e18, t2, n2) {
for (; e18.value && e18.from <= n2; )
e18.from == n2 && t2.push(e18.value), e18.next();
}
var uA = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.gutter = t2, this.height = r2, this.localMarkers = [], this.i = 0, this.cursor = MC.iter(t2.markers, n2.from);
}
return Li(e18, [{ key: "line", value: function(e19, t2, n2) {
this.localMarkers.length && (this.localMarkers = []), sA(this.cursor, this.localMarkers, t2.from);
var r2 = n2.length ? this.localMarkers.concat(n2) : this.localMarkers, i2 = this.gutter.config.lineMarker(e19, t2, r2);
i2 && r2.unshift(i2);
var o2 = this.gutter;
if (0 != r2.length || o2.config.renderEmptyElements) {
var a2 = t2.top - this.height;
if (this.i == o2.elements.length) {
var s2 = new lA(e19, t2.height, a2, r2);
o2.elements.push(s2), o2.dom.appendChild(s2.dom);
} else
o2.elements[this.i].update(e19, t2.height, a2, r2);
this.height = t2.bottom, this.i++;
}
} }, { key: "finish", value: function() {
for (var e19 = this.gutter; e19.elements.length > this.i; ) {
var t2 = e19.elements.pop();
e19.dom.removeChild(t2.dom), t2.destroy();
}
} }]), e18;
}(), cA = function() {
function e18(t2, n2) {
var r2 = this;
Ri(this, e18), this.view = t2, this.config = n2, this.elements = [], this.spacer = null, this.dom = document.createElement("div"), this.dom.className = "cm-gutter" + (this.config.class ? " " + this.config.class : "");
var i2 = function(e19) {
r2.dom.addEventListener(e19, function(r3) {
var i3 = t2.lineBlockAtHeight(r3.clientY - t2.documentTop);
n2.domEventHandlers[e19](t2, i3, r3) && r3.preventDefault();
});
};
for (var o2 in n2.domEventHandlers)
i2(o2);
this.markers = aA(n2.markers(t2)), n2.initialSpacer && (this.spacer = new lA(t2, 0, 0, [n2.initialSpacer(t2)]), this.dom.appendChild(this.spacer.dom), this.spacer.dom.style.cssText += "visibility: hidden; pointer-events: none");
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2 = this.markers;
if (this.markers = aA(this.config.markers(e19.view)), this.spacer && this.config.updateSpacer) {
var n2 = this.config.updateSpacer(this.spacer.markers[0], e19);
n2 != this.spacer.markers[0] && this.spacer.update(e19.view, 0, 0, [n2]);
}
var r2 = e19.view.viewport;
return !MC.eq(this.markers, t2, r2.from, r2.to) || !!this.config.lineMarkerChange && this.config.lineMarkerChange(e19);
} }, { key: "destroy", value: function() {
var e19, t2 = bi(this.elements);
try {
for (t2.s(); !(e19 = t2.n()).done; ) {
e19.value.destroy();
}
} catch (e20) {
t2.e(e20);
} finally {
t2.f();
}
} }]), e18;
}(), lA = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.height = -1, this.above = 0, this.markers = [], this.dom = document.createElement("div"), this.dom.className = "cm-gutterElement", this.update(t2, n2, r2, i2);
}
return Li(e18, [{ key: "update", value: function(e19, t2, n2, r2) {
this.height != t2 && (this.dom.style.height = (this.height = t2) + "px"), this.above != n2 && (this.dom.style.marginTop = (this.above = n2) ? n2 + "px" : ""), function(e20, t3) {
if (e20.length != t3.length)
return false;
for (var n3 = 0; n3 < e20.length; n3++)
if (!e20[n3].compare(t3[n3]))
return false;
return true;
}(this.markers, r2) || this.setMarkers(e19, r2);
} }, { key: "setMarkers", value: function(e19, t2) {
for (var n2 = "cm-gutterElement", r2 = this.dom.firstChild, i2 = 0, o2 = 0; ; ) {
var a2 = o2, s2 = i2 < t2.length ? t2[i2++] : null, u2 = false;
if (s2) {
var c2 = s2.elementClass;
c2 && (n2 += " " + c2);
for (var l2 = o2; l2 < this.markers.length; l2++)
if (this.markers[l2].compare(s2)) {
a2 = l2, u2 = true;
break;
}
} else
a2 = this.markers.length;
for (; o2 < a2; ) {
var f2 = this.markers[o2++];
if (f2.toDOM) {
f2.destroy(r2);
var h2 = r2.nextSibling;
r2.remove(), r2 = h2;
}
}
if (!s2)
break;
s2.toDOM && (u2 ? r2 = r2.nextSibling : this.dom.insertBefore(s2.toDOM(e19), r2)), u2 && o2++;
}
this.dom.className = n2, this.markers = t2;
} }, { key: "destroy", value: function() {
this.setMarkers(null, []);
} }]), e18;
}();
var fA = R_.define(), hA = R_.define({ combine: function(e18) {
return SC(e18, { formatNumber: String, domEventHandlers: {} }, { domEventHandlers: function(e19, t2) {
var n2 = Object.assign({}, e19), r2 = function(e20) {
var r3 = n2[e20], i3 = t2[e20];
n2[e20] = r3 ? function(e21, t3, n3) {
return r3(e21, t3, n3) || i3(e21, t3, n3);
} : i3;
};
for (var i2 in t2)
r2(i2);
return n2;
} });
} }), dA = function(e18) {
Ci(n2, ZP);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).number = e19, r2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return this.number == e19.number;
} }, { key: "toDOM", value: function() {
return document.createTextNode(this.number);
} }]), n2;
}();
function vA(e18, t2) {
return e18.state.facet(hA).formatNumber(t2, e18.state);
}
var pA = tA.compute([hA], function(e18) {
return { class: "cm-lineNumbers", renderEmptyElements: false, markers: function(e19) {
return e19.state.facet(fA);
}, lineMarker: function(e19, t2, n2) {
return n2.some(function(e20) {
return e20.toDOM;
}) ? null : new dA(vA(e19, e19.state.doc.lineAt(t2.from).number));
}, lineMarkerChange: function(e19) {
return e19.startState.facet(hA) != e19.state.facet(hA);
}, initialSpacer: function(e19) {
return new dA(vA(e19, gA(e19.state.doc.lines)));
}, updateSpacer: function(e19, t2) {
var n2 = vA(t2.view, gA(t2.view.state.doc.lines));
return n2 == e19.number ? e19 : new dA(n2);
}, domEventHandlers: e18.facet(hA).domEventHandlers };
});
function mA() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return [hA.of(e18), iA(), pA];
}
function gA(e18) {
for (var t2 = 9; t2 < e18; )
t2 = 10 * t2 + 9;
return t2;
}
var yA = new (function(e18) {
Ci(n2, ZP);
var t2 = Oi(n2);
function n2() {
var e19;
return Ri(this, n2), (e19 = t2.apply(this, arguments)).elementClass = "cm-activeLineGutter", e19;
}
return Li(n2);
}())(), bA = XP.compute(["selection"], function(e18) {
var t2, n2 = [], r2 = -1, i2 = bi(e18.selection.ranges);
try {
for (i2.s(); !(t2 = i2.n()).done; ) {
var o2 = t2.value, a2 = e18.doc.lineAt(o2.head).from;
a2 > r2 && (r2 = a2, n2.push(yA.range(a2)));
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return MC.of(n2);
});
var kA = 0, wA = Li(function e6(t2, n2) {
Ri(this, e6), this.from = t2, this.to = n2;
}), jA = function() {
function e18() {
var t2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
Ri(this, e18), this.id = kA++, this.perNode = !!t2.perNode, this.deserialize = t2.deserialize || function() {
throw new Error("This node type doesn't define a deserialize function");
};
}
return Li(e18, [{ key: "add", value: function(e19) {
var t2 = this;
if (this.perNode)
throw new RangeError("Can't add per-node props to node types");
return "function" != typeof e19 && (e19 = SA.match(e19)), function(n2) {
var r2 = e19(n2);
return void 0 === r2 ? null : [t2, r2];
};
} }]), e18;
}();
jA.closedBy = new jA({ deserialize: function(e18) {
return e18.split(" ");
} }), jA.openedBy = new jA({ deserialize: function(e18) {
return e18.split(" ");
} }), jA.group = new jA({ deserialize: function(e18) {
return e18.split(" ");
} }), jA.contextHash = new jA({ perNode: true }), jA.lookAhead = new jA({ perNode: true }), jA.mounted = new jA({ perNode: true });
var xA = /* @__PURE__ */ Object.create(null), SA = function() {
function e18(t2, n2, r2) {
var i2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
Ri(this, e18), this.name = t2, this.props = n2, this.id = r2, this.flags = i2;
}
return Li(e18, [{ key: "prop", value: function(e19) {
return this.props[e19.id];
} }, { key: "isTop", get: function() {
return (1 & this.flags) > 0;
} }, { key: "isSkipped", get: function() {
return (2 & this.flags) > 0;
} }, { key: "isError", get: function() {
return (4 & this.flags) > 0;
} }, { key: "isAnonymous", get: function() {
return (8 & this.flags) > 0;
} }, { key: "is", value: function(e19) {
if ("string" == typeof e19) {
if (this.name == e19)
return true;
var t2 = this.prop(jA.group);
return !!t2 && t2.indexOf(e19) > -1;
}
return this.id == e19;
} }], [{ key: "define", value: function(t2) {
var n2 = t2.props && t2.props.length ? /* @__PURE__ */ Object.create(null) : xA, r2 = (t2.top ? 1 : 0) | (t2.skipped ? 2 : 0) | (t2.error ? 4 : 0) | (null == t2.name ? 8 : 0), i2 = new e18(t2.name || "", n2, t2.id, r2);
if (t2.props) {
var o2, a2 = bi(t2.props);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
if (Array.isArray(s2) || (s2 = s2(i2)), s2) {
if (s2[0].perNode)
throw new RangeError("Can't store a per-node prop on a node type");
n2[s2[0].id] = s2[1];
}
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
}
return i2;
} }, { key: "match", value: function(e19) {
var t2 = /* @__PURE__ */ Object.create(null);
for (var n2 in e19) {
var r2, i2 = bi(n2.split(" "));
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
t2[o2] = e19[n2];
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
}
return function(e20) {
for (var n3 = e20.prop(jA.group), r3 = -1; r3 < (n3 ? n3.length : 0); r3++) {
var i3 = t2[r3 < 0 ? e20.name : n3[r3]];
if (i3)
return i3;
}
};
} }]), e18;
}();
SA.none = new SA("", /* @__PURE__ */ Object.create(null), 0, 8);
var _A, CA = function() {
function e18(t2) {
Ri(this, e18), this.types = t2;
for (var n2 = 0; n2 < t2.length; n2++)
if (t2[n2].id != n2)
throw new RangeError("Node type ids should correspond to array positions when creating a node set");
}
return Li(e18, [{ key: "extend", value: function() {
for (var t2 = [], n2 = arguments.length, r2 = new Array(n2), i2 = 0; i2 < n2; i2++)
r2[i2] = arguments[i2];
var o2, a2 = bi(this.types);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2, u2 = o2.value, c2 = null, l2 = bi(r2);
try {
for (l2.s(); !(s2 = l2.n()).done; ) {
var f2 = s2.value, h2 = f2(u2);
h2 && (c2 || (c2 = Object.assign({}, u2.props)), c2[h2[0].id] = h2[1]);
}
} catch (e19) {
l2.e(e19);
} finally {
l2.f();
}
t2.push(c2 ? new SA(u2.name, c2, u2.id, u2.flags) : u2);
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
return new e18(t2);
} }]), e18;
}(), $A = /* @__PURE__ */ new WeakMap(), OA = /* @__PURE__ */ new WeakMap();
!function(e18) {
e18[e18.ExcludeBuffers = 1] = "ExcludeBuffers", e18[e18.IncludeAnonymous = 2] = "IncludeAnonymous", e18[e18.IgnoreMounts = 4] = "IgnoreMounts", e18[e18.IgnoreOverlays = 8] = "IgnoreOverlays";
}(_A || (_A = {}));
var MA = function() {
function e18(t2, n2, r2, i2, o2) {
if (Ri(this, e18), this.type = t2, this.children = n2, this.positions = r2, this.length = i2, this.props = null, o2 && o2.length) {
this.props = /* @__PURE__ */ Object.create(null);
var a2, s2 = bi(o2);
try {
for (s2.s(); !(a2 = s2.n()).done; ) {
var u2 = ki(a2.value, 2), c2 = u2[0], l2 = u2[1];
this.props["number" == typeof c2 ? c2 : c2.id] = l2;
}
} catch (e19) {
s2.e(e19);
} finally {
s2.f();
}
}
}
return Li(e18, [{ key: "toString", value: function() {
var e19 = this.prop(jA.mounted);
if (e19 && !e19.overlay)
return e19.tree.toString();
var t2, n2 = "", r2 = bi(this.children);
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
var i2 = t2.value.toString();
i2 && (n2 && (n2 += ","), n2 += i2);
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (n2.length ? "(" + n2 + ")" : "") : n2;
} }, { key: "cursor", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return new BA(this.topNode, e19);
} }, { key: "cursorAt", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n2 = $A.get(this) || this.topNode, r2 = new BA(n2);
return r2.moveTo(e19, t2), $A.set(this, r2._tree), r2;
} }, { key: "topNode", get: function() {
return new NA(this, 0, 0, null);
} }, { key: "resolve", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n2 = IA($A.get(this) || this.topNode, e19, t2, false);
return $A.set(this, n2), n2;
} }, { key: "resolveInner", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n2 = IA(OA.get(this) || this.topNode, e19, t2, true);
return OA.set(this, n2), n2;
} }, { key: "iterate", value: function(e19) {
for (var t2 = e19.enter, n2 = e19.leave, r2 = e19.from, i2 = void 0 === r2 ? 0 : r2, o2 = e19.to, a2 = void 0 === o2 ? this.length : o2, s2 = this.cursor((e19.mode || 0) | _A.IncludeAnonymous); ; ) {
var u2 = false;
if (s2.from <= a2 && s2.to >= i2 && (s2.type.isAnonymous || false !== t2(s2))) {
if (s2.firstChild())
continue;
u2 = true;
}
for (; u2 && n2 && !s2.type.isAnonymous && n2(s2), !s2.nextSibling(); ) {
if (!s2.parent())
return;
u2 = true;
}
}
} }, { key: "prop", value: function(e19) {
return e19.perNode ? this.props ? this.props[e19.id] : void 0 : this.type.prop(e19);
} }, { key: "propValues", get: function() {
var e19 = [];
if (this.props)
for (var t2 in this.props)
e19.push([+t2, this.props[t2]]);
return e19;
} }, { key: "balance", value: function() {
var t2 = this, n2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return this.children.length <= 8 ? this : HA(SA.none, this.children, this.positions, 0, this.children.length, 0, this.length, function(n3, r2, i2) {
return new e18(t2.type, n3, r2, i2, t2.propValues);
}, n2.makeTree || function(t3, n3, r2) {
return new e18(SA.none, t3, n3, r2);
});
} }], [{ key: "build", value: function(e19) {
return FA(e19);
} }]), e18;
}();
MA.empty = new MA(SA.none, [], [], 0);
var EA = function() {
function e18(t2, n2) {
Ri(this, e18), this.buffer = t2, this.index = n2;
}
return Li(e18, [{ key: "id", get: function() {
return this.buffer[this.index - 4];
} }, { key: "start", get: function() {
return this.buffer[this.index - 3];
} }, { key: "end", get: function() {
return this.buffer[this.index - 2];
} }, { key: "size", get: function() {
return this.buffer[this.index - 1];
} }, { key: "pos", get: function() {
return this.index;
} }, { key: "next", value: function() {
this.index -= 4;
} }, { key: "fork", value: function() {
return new e18(this.buffer, this.index);
} }]), e18;
}(), PA = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.buffer = t2, this.length = n2, this.set = r2;
}
return Li(e18, [{ key: "type", get: function() {
return SA.none;
} }, { key: "toString", value: function() {
for (var e19 = [], t2 = 0; t2 < this.buffer.length; )
e19.push(this.childString(t2)), t2 = this.buffer[t2 + 3];
return e19.join(",");
} }, { key: "childString", value: function(e19) {
var t2 = this.buffer[e19], n2 = this.buffer[e19 + 3], r2 = this.set.types[t2], i2 = r2.name;
if (/\W/.test(i2) && !r2.isError && (i2 = JSON.stringify(i2)), n2 == (e19 += 4))
return i2;
for (var o2 = []; e19 < n2; )
o2.push(this.childString(e19)), e19 = this.buffer[e19 + 3];
return i2 + "(" + o2.join(",") + ")";
} }, { key: "findChild", value: function(e19, t2, n2, r2, i2) {
for (var o2 = this.buffer, a2 = -1, s2 = e19; s2 != t2 && !(AA(i2, r2, o2[s2 + 1], o2[s2 + 2]) && (a2 = s2, n2 > 0)); s2 = o2[s2 + 3])
;
return a2;
} }, { key: "slice", value: function(t2, n2, r2, i2) {
for (var o2 = this.buffer, a2 = new Uint16Array(n2 - t2), s2 = t2, u2 = 0; s2 < n2; )
a2[u2++] = o2[s2++], a2[u2++] = o2[s2++] - r2, a2[u2++] = o2[s2++] - r2, a2[u2++] = o2[s2++] - t2;
return new e18(a2, i2 - r2, this.set);
} }]), e18;
}();
function AA(e18, t2, n2, r2) {
switch (e18) {
case -2:
return n2 < t2;
case -1:
return r2 >= t2 && n2 < t2;
case 0:
return n2 < t2 && r2 > t2;
case 1:
return n2 <= t2 && r2 > t2;
case 2:
return r2 > t2;
case 4:
return true;
}
}
function TA(e18, t2) {
for (var n2 = e18.childBefore(t2); n2; ) {
var r2 = n2.lastChild;
if (!r2 || r2.to != n2.to)
break;
r2.type.isError && r2.from == r2.to ? (e18 = n2, n2 = r2.prevSibling) : n2 = r2;
}
return e18;
}
function IA(e18, t2, n2, r2) {
for (var i2; e18.from == e18.to || (n2 < 1 ? e18.from >= t2 : e18.from > t2) || (n2 > -1 ? e18.to <= t2 : e18.to < t2); ) {
var o2 = !r2 && e18 instanceof NA && e18.index < 0 ? null : e18.parent;
if (!o2)
return e18;
e18 = o2;
}
var a2 = r2 ? 0 : _A.IgnoreOverlays;
if (r2)
for (var s2 = e18, u2 = s2.parent; u2; u2 = (s2 = u2).parent)
s2 instanceof NA && s2.index < 0 && (null === (i2 = u2.enter(t2, n2, a2)) || void 0 === i2 ? void 0 : i2.from) != s2.from && (e18 = u2);
for (; ; ) {
var c2 = e18.enter(t2, n2, a2);
if (!c2)
return e18;
e18 = c2;
}
}
var NA = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this._tree = t2, this.from = n2, this.index = r2, this._parent = i2;
}
return Li(e18, [{ key: "type", get: function() {
return this._tree.type;
} }, { key: "name", get: function() {
return this._tree.type.name;
} }, { key: "to", get: function() {
return this.from + this._tree.length;
} }, { key: "nextChild", value: function(t2, n2, r2, i2) {
for (var o2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, a2 = this; ; ) {
for (var s2 = a2._tree, u2 = s2.children, c2 = s2.positions, l2 = n2 > 0 ? u2.length : -1; t2 != l2; t2 += n2) {
var f2 = u2[t2], h2 = c2[t2] + a2.from;
if (AA(i2, r2, h2, h2 + f2.length)) {
if (f2 instanceof PA) {
if (o2 & _A.ExcludeBuffers)
continue;
var d2 = f2.findChild(0, f2.buffer.length, n2, r2 - h2, i2);
if (d2 > -1)
return new zA(new LA(a2, f2, t2, h2), null, d2);
} else if (o2 & _A.IncludeAnonymous || !f2.type.isAnonymous || qA(f2)) {
var v2 = void 0;
if (!(o2 & _A.IgnoreMounts) && f2.props && (v2 = f2.prop(jA.mounted)) && !v2.overlay)
return new e18(v2.tree, h2, t2, a2);
var p2 = new e18(f2, h2, t2, a2);
return o2 & _A.IncludeAnonymous || !p2.type.isAnonymous ? p2 : p2.nextChild(n2 < 0 ? f2.children.length - 1 : 0, n2, r2, i2);
}
}
}
if (o2 & _A.IncludeAnonymous || !a2.type.isAnonymous)
return null;
if (t2 = a2.index >= 0 ? a2.index + n2 : n2 < 0 ? -1 : a2._parent._tree.children.length, !(a2 = a2._parent))
return null;
}
} }, { key: "firstChild", get: function() {
return this.nextChild(0, 1, 0, 4);
} }, { key: "lastChild", get: function() {
return this.nextChild(this._tree.children.length - 1, -1, 0, 4);
} }, { key: "childAfter", value: function(e19) {
return this.nextChild(0, 1, e19, 2);
} }, { key: "childBefore", value: function(e19) {
return this.nextChild(this._tree.children.length - 1, -1, e19, -2);
} }, { key: "enter", value: function(t2, n2) {
var r2, i2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
if (!(i2 & _A.IgnoreOverlays) && (r2 = this._tree.prop(jA.mounted)) && r2.overlay) {
var o2, a2 = t2 - this.from, s2 = bi(r2.overlay);
try {
for (s2.s(); !(o2 = s2.n()).done; ) {
var u2 = o2.value, c2 = u2.from, l2 = u2.to;
if ((n2 > 0 ? c2 <= a2 : c2 < a2) && (n2 < 0 ? l2 >= a2 : l2 > a2))
return new e18(r2.tree, r2.overlay[0].from + this.from, -1, this);
}
} catch (e19) {
s2.e(e19);
} finally {
s2.f();
}
}
return this.nextChild(0, 1, t2, n2, i2);
} }, { key: "nextSignificantParent", value: function() {
for (var e19 = this; e19.type.isAnonymous && e19._parent; )
e19 = e19._parent;
return e19;
} }, { key: "parent", get: function() {
return this._parent ? this._parent.nextSignificantParent() : null;
} }, { key: "nextSibling", get: function() {
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null;
} }, { key: "prevSibling", get: function() {
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null;
} }, { key: "cursor", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return new BA(this, e19);
} }, { key: "tree", get: function() {
return this._tree;
} }, { key: "toTree", value: function() {
return this._tree;
} }, { key: "resolve", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return IA(this, e19, t2, false);
} }, { key: "resolveInner", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return IA(this, e19, t2, true);
} }, { key: "enterUnfinishedNodesBefore", value: function(e19) {
return TA(this, e19);
} }, { key: "getChild", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, r2 = RA(this, e19, t2, n2);
return r2.length ? r2[0] : null;
} }, { key: "getChildren", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null;
return RA(this, e19, t2, n2);
} }, { key: "toString", value: function() {
return this._tree.toString();
} }, { key: "node", get: function() {
return this;
} }, { key: "matchContext", value: function(e19) {
return DA(this, e19);
} }]), e18;
}();
function RA(e18, t2, n2, r2) {
var i2 = e18.cursor(), o2 = [];
if (!i2.firstChild())
return o2;
if (null != n2) {
for (; !i2.type.is(n2); )
if (!i2.nextSibling())
return o2;
}
for (; ; ) {
if (null != r2 && i2.type.is(r2))
return o2;
if (i2.type.is(t2) && o2.push(i2.node), !i2.nextSibling())
return null == r2 ? o2 : [];
}
}
function DA(e18, t2) {
for (var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t2.length - 1, r2 = e18.parent; n2 >= 0; r2 = r2.parent) {
if (!r2)
return false;
if (!r2.type.isAnonymous) {
if (t2[n2] && t2[n2] != r2.name)
return false;
n2--;
}
}
return true;
}
var LA = Li(function e7(t2, n2, r2, i2) {
Ri(this, e7), this.parent = t2, this.buffer = n2, this.index = r2, this.start = i2;
}), zA = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.context = t2, this._parent = n2, this.index = r2, this.type = t2.buffer.set.types[t2.buffer.buffer[r2]];
}
return Li(e18, [{ key: "name", get: function() {
return this.type.name;
} }, { key: "from", get: function() {
return this.context.start + this.context.buffer.buffer[this.index + 1];
} }, { key: "to", get: function() {
return this.context.start + this.context.buffer.buffer[this.index + 2];
} }, { key: "child", value: function(t2, n2, r2) {
var i2 = this.context.buffer, o2 = i2.findChild(this.index + 4, i2.buffer[this.index + 3], t2, n2 - this.context.start, r2);
return o2 < 0 ? null : new e18(this.context, this, o2);
} }, { key: "firstChild", get: function() {
return this.child(1, 0, 4);
} }, { key: "lastChild", get: function() {
return this.child(-1, 0, 4);
} }, { key: "childAfter", value: function(e19) {
return this.child(1, e19, 2);
} }, { key: "childBefore", value: function(e19) {
return this.child(-1, e19, -2);
} }, { key: "enter", value: function(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
if (r2 & _A.ExcludeBuffers)
return null;
var i2 = this.context.buffer, o2 = i2.findChild(this.index + 4, i2.buffer[this.index + 3], n2 > 0 ? 1 : -1, t2 - this.context.start, n2);
return o2 < 0 ? null : new e18(this.context, this, o2);
} }, { key: "parent", get: function() {
return this._parent || this.context.parent.nextSignificantParent();
} }, { key: "externalSibling", value: function(e19) {
return this._parent ? null : this.context.parent.nextChild(this.context.index + e19, e19, 0, 4);
} }, { key: "nextSibling", get: function() {
var t2 = this.context.buffer, n2 = t2.buffer[this.index + 3];
return n2 < (this._parent ? t2.buffer[this._parent.index + 3] : t2.buffer.length) ? new e18(this.context, this._parent, n2) : this.externalSibling(1);
} }, { key: "prevSibling", get: function() {
var t2 = this.context.buffer, n2 = this._parent ? this._parent.index + 4 : 0;
return this.index == n2 ? this.externalSibling(-1) : new e18(this.context, this._parent, t2.findChild(n2, this.index, -1, 0, 4));
} }, { key: "cursor", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
return new BA(this, e19);
} }, { key: "tree", get: function() {
return null;
} }, { key: "toTree", value: function() {
var e19 = [], t2 = [], n2 = this.context.buffer, r2 = this.index + 4, i2 = n2.buffer[this.index + 3];
if (i2 > r2) {
var o2 = n2.buffer[this.index + 1], a2 = n2.buffer[this.index + 2];
e19.push(n2.slice(r2, i2, o2, a2)), t2.push(0);
}
return new MA(this.type, e19, t2, this.to - this.from);
} }, { key: "resolve", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return IA(this, e19, t2, false);
} }, { key: "resolveInner", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
return IA(this, e19, t2, true);
} }, { key: "enterUnfinishedNodesBefore", value: function(e19) {
return TA(this, e19);
} }, { key: "toString", value: function() {
return this.context.buffer.childString(this.index);
} }, { key: "getChild", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, r2 = RA(this, e19, t2, n2);
return r2.length ? r2[0] : null;
} }, { key: "getChildren", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null;
return RA(this, e19, t2, n2);
} }, { key: "node", get: function() {
return this;
} }, { key: "matchContext", value: function(e19) {
return DA(this, e19);
} }]), e18;
}(), BA = function() {
function e18(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
if (Ri(this, e18), this.mode = n2, this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, t2 instanceof NA)
this.yieldNode(t2);
else {
this._tree = t2.context.parent, this.buffer = t2.context;
for (var r2 = t2._parent; r2; r2 = r2._parent)
this.stack.unshift(r2.index);
this.bufferNode = t2, this.yieldBuf(t2.index);
}
}
return Li(e18, [{ key: "name", get: function() {
return this.type.name;
} }, { key: "yieldNode", value: function(e19) {
return !!e19 && (this._tree = e19, this.type = e19.type, this.from = e19.from, this.to = e19.to, true);
} }, { key: "yieldBuf", value: function(e19, t2) {
this.index = e19;
var n2 = this.buffer, r2 = n2.start, i2 = n2.buffer;
return this.type = t2 || i2.set.types[i2.buffer[e19]], this.from = r2 + i2.buffer[e19 + 1], this.to = r2 + i2.buffer[e19 + 2], true;
} }, { key: "yield", value: function(e19) {
return !!e19 && (e19 instanceof NA ? (this.buffer = null, this.yieldNode(e19)) : (this.buffer = e19.context, this.yieldBuf(e19.index, e19.type)));
} }, { key: "toString", value: function() {
return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
} }, { key: "enterChild", value: function(e19, t2, n2) {
if (!this.buffer)
return this.yield(this._tree.nextChild(e19 < 0 ? this._tree._tree.children.length - 1 : 0, e19, t2, n2, this.mode));
var r2 = this.buffer.buffer, i2 = r2.findChild(this.index + 4, r2.buffer[this.index + 3], e19, t2 - this.buffer.start, n2);
return !(i2 < 0) && (this.stack.push(this.index), this.yieldBuf(i2));
} }, { key: "firstChild", value: function() {
return this.enterChild(1, 0, 4);
} }, { key: "lastChild", value: function() {
return this.enterChild(-1, 0, 4);
} }, { key: "childAfter", value: function(e19) {
return this.enterChild(1, e19, 2);
} }, { key: "childBefore", value: function(e19) {
return this.enterChild(-1, e19, -2);
} }, { key: "enter", value: function(e19, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.mode;
return this.buffer ? !(n2 & _A.ExcludeBuffers) && this.enterChild(1, e19, t2) : this.yield(this._tree.enter(e19, t2, n2));
} }, { key: "parent", value: function() {
if (!this.buffer)
return this.yieldNode(this.mode & _A.IncludeAnonymous ? this._tree._parent : this._tree.parent);
if (this.stack.length)
return this.yieldBuf(this.stack.pop());
var e19 = this.mode & _A.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
return this.buffer = null, this.yieldNode(e19);
} }, { key: "sibling", value: function(e19) {
if (!this.buffer)
return !!this._tree._parent && this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e19, e19, 0, 4, this.mode));
var t2 = this.buffer.buffer, n2 = this.stack.length - 1;
if (e19 < 0) {
var r2 = n2 < 0 ? 0 : this.stack[n2] + 4;
if (this.index != r2)
return this.yieldBuf(t2.findChild(r2, this.index, -1, 0, 4));
} else {
var i2 = t2.buffer[this.index + 3];
if (i2 < (n2 < 0 ? t2.buffer.length : t2.buffer[this.stack[n2] + 3]))
return this.yieldBuf(i2);
}
return n2 < 0 && this.yield(this.buffer.parent.nextChild(this.buffer.index + e19, e19, 0, 4, this.mode));
} }, { key: "nextSibling", value: function() {
return this.sibling(1);
} }, { key: "prevSibling", value: function() {
return this.sibling(-1);
} }, { key: "atLastNode", value: function(e19) {
var t2, n2, r2 = this.buffer;
if (r2) {
if (e19 > 0) {
if (this.index < r2.buffer.buffer.length)
return false;
} else
for (var i2 = 0; i2 < this.index; i2++)
if (r2.buffer.buffer[i2 + 3] < this.index)
return false;
t2 = r2.index, n2 = r2.parent;
} else {
var o2 = this._tree;
t2 = o2.index, n2 = o2._parent;
}
for (; n2; t2 = (a2 = n2).index, n2 = a2._parent, a2) {
var a2;
if (t2 > -1)
for (var s2 = t2 + e19, u2 = e19 < 0 ? -1 : n2._tree.children.length; s2 != u2; s2 += e19) {
var c2 = n2._tree.children[s2];
if (this.mode & _A.IncludeAnonymous || c2 instanceof PA || !c2.type.isAnonymous || qA(c2))
return false;
}
}
return true;
} }, { key: "move", value: function(e19, t2) {
if (t2 && this.enterChild(e19, 0, 4))
return true;
for (; ; ) {
if (this.sibling(e19))
return true;
if (this.atLastNode(e19) || !this.parent())
return false;
}
} }, { key: "next", value: function() {
var e19 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
return this.move(1, e19);
} }, { key: "prev", value: function() {
var e19 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
return this.move(-1, e19);
} }, { key: "moveTo", value: function(e19) {
for (var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; (this.from == this.to || (t2 < 1 ? this.from >= e19 : this.from > e19) || (t2 > -1 ? this.to <= e19 : this.to < e19)) && this.parent(); )
;
for (; this.enterChild(1, e19, t2); )
;
return this;
} }, { key: "node", get: function() {
if (!this.buffer)
return this._tree;
var e19 = this.bufferNode, t2 = null, n2 = 0;
if (e19 && e19.context == this.buffer)
e:
for (var r2 = this.index, i2 = this.stack.length; i2 >= 0; ) {
for (var o2 = e19; o2; o2 = o2._parent)
if (o2.index == r2) {
if (r2 == this.index)
return o2;
t2 = o2, n2 = i2 + 1;
break e;
}
r2 = this.stack[--i2];
}
for (var a2 = n2; a2 < this.stack.length; a2++)
t2 = new zA(this.buffer, t2, this.stack[a2]);
return this.bufferNode = new zA(this.buffer, t2, this.index);
} }, { key: "tree", get: function() {
return this.buffer ? null : this._tree._tree;
} }, { key: "iterate", value: function(e19, t2) {
for (var n2 = 0; ; ) {
var r2 = false;
if (this.type.isAnonymous || false !== e19(this)) {
if (this.firstChild()) {
n2++;
continue;
}
this.type.isAnonymous || (r2 = true);
}
for (; r2 && t2 && t2(this), r2 = this.type.isAnonymous, !this.nextSibling(); ) {
if (!n2)
return;
this.parent(), n2--, r2 = true;
}
}
} }, { key: "matchContext", value: function(e19) {
if (!this.buffer)
return DA(this.node, e19);
for (var t2 = this.buffer.buffer, n2 = t2.set.types, r2 = e19.length - 1, i2 = this.stack.length - 1; r2 >= 0; i2--) {
if (i2 < 0)
return DA(this.node, e19, r2);
var o2 = n2[t2.buffer[this.stack[i2]]];
if (!o2.isAnonymous) {
if (e19[r2] && e19[r2] != o2.name)
return false;
r2--;
}
}
return true;
} }]), e18;
}();
function qA(e18) {
return e18.children.some(function(e19) {
return e19 instanceof PA || !e19.type.isAnonymous || qA(e19);
});
}
function FA(e18) {
var t2, n2 = e18.buffer, r2 = e18.nodeSet, i2 = e18.maxBufferLength, o2 = void 0 === i2 ? 1024 : i2, a2 = e18.reused, s2 = void 0 === a2 ? [] : a2, u2 = e18.minRepeatType, c2 = void 0 === u2 ? r2.types.length : u2, l2 = Array.isArray(n2) ? new EA(n2, n2.length) : n2, f2 = r2.types, h2 = 0, d2 = 0;
function v2(e19, t3, n3, i3, a3) {
for (var u3 = l2.id, y3 = l2.start, b3 = l2.end, k3 = l2.size, w2 = d2; k3 < 0; ) {
if (l2.next(), -1 == k3) {
var j2 = s2[u3];
return n3.push(j2), void i3.push(y3 - e19);
}
if (-3 == k3)
return void (h2 = u3);
if (-4 == k3)
return void (d2 = u3);
throw new RangeError("Unrecognized record size: ".concat(k3));
}
var x2, S2, _2 = f2[u3], C2 = y3 - e19;
if (b3 - y3 <= o2 && (S2 = function(e20, t4) {
var n4 = l2.fork(), r3 = 0, i4 = 0, a4 = 0, s3 = n4.end - o2, u4 = { size: 0, start: 0, skip: 0 };
e:
for (var f3 = n4.pos - e20; n4.pos > f3; ) {
var h3 = n4.size;
if (n4.id == t4 && h3 >= 0)
u4.size = r3, u4.start = i4, u4.skip = a4, a4 += 4, r3 += 4, n4.next();
else {
var d3 = n4.pos - h3;
if (h3 < 0 || d3 < f3 || n4.start < s3)
break;
var v3 = n4.id >= c2 ? 4 : 0, p3 = n4.start;
for (n4.next(); n4.pos > d3; ) {
if (n4.size < 0) {
if (-3 != n4.size)
break e;
v3 += 4;
} else
n4.id >= c2 && (v3 += 4);
n4.next();
}
i4 = p3, r3 += h3, a4 += v3;
}
}
(t4 < 0 || r3 == e20) && (u4.size = r3, u4.start = i4, u4.skip = a4);
return u4.size > 4 ? u4 : void 0;
}(l2.pos - t3, a3))) {
for (var $2 = new Uint16Array(S2.size - S2.skip), O2 = l2.pos - S2.size, M2 = $2.length; l2.pos > O2; )
M2 = g2(S2.start, $2, M2);
x2 = new PA($2, b3 - S2.start, r2), C2 = S2.start - e19;
} else {
var E2 = l2.pos - k3;
l2.next();
for (var P2 = [], A2 = [], T2 = u3 >= c2 ? u3 : -1, I2 = 0, N2 = b3; l2.pos > E2; )
T2 >= 0 && l2.id == T2 && l2.size >= 0 ? (l2.end <= N2 - o2 && (p2(P2, A2, y3, I2, l2.end, N2, T2, w2), I2 = P2.length, N2 = l2.end), l2.next()) : v2(y3, E2, P2, A2, T2);
if (T2 >= 0 && I2 > 0 && I2 < P2.length && p2(P2, A2, y3, I2, y3, N2, T2, w2), P2.reverse(), A2.reverse(), T2 > -1 && I2 > 0) {
var R2 = function(e20) {
return function(t4, n4, r3) {
var i4, o3, a4 = 0, s3 = t4.length - 1;
if (s3 >= 0 && (i4 = t4[s3]) instanceof MA) {
if (!s3 && i4.type == e20 && i4.length == r3)
return i4;
(o3 = i4.prop(jA.lookAhead)) && (a4 = n4[s3] + i4.length + o3);
}
return m2(e20, t4, n4, r3, a4);
};
}(_2);
x2 = HA(_2, P2, A2, 0, P2.length, 0, b3 - y3, R2, R2);
} else
x2 = m2(_2, P2, A2, b3 - y3, w2 - b3);
}
n3.push(x2), i3.push(C2);
}
function p2(e19, t3, n3, i3, o3, a3, s3, u3) {
for (var c3 = [], l3 = []; e19.length > i3; )
c3.push(e19.pop()), l3.push(t3.pop() + n3 - o3);
e19.push(m2(r2.types[s3], c3, l3, a3 - o3, u3 - a3)), t3.push(o3 - n3);
}
function m2(e19, t3, n3, r3) {
var i3 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, o3 = arguments.length > 5 ? arguments[5] : void 0;
if (h2) {
var a3 = [jA.contextHash, h2];
o3 = o3 ? [a3].concat(o3) : [a3];
}
if (i3 > 25) {
var s3 = [jA.lookAhead, i3];
o3 = o3 ? [s3].concat(o3) : [s3];
}
return new MA(e19, t3, n3, r3, o3);
}
function g2(e19, t3, n3) {
var r3 = l2.id, i3 = l2.start, o3 = l2.end, a3 = l2.size;
if (l2.next(), a3 >= 0 && r3 < c2) {
var s3 = n3;
if (a3 > 4)
for (var u3 = l2.pos - (a3 - 4); l2.pos > u3; )
n3 = g2(e19, t3, n3);
t3[--n3] = s3, t3[--n3] = o3 - e19, t3[--n3] = i3 - e19, t3[--n3] = r3;
} else
-3 == a3 ? h2 = r3 : -4 == a3 && (d2 = r3);
return n3;
}
for (var y2 = [], b2 = []; l2.pos > 0; )
v2(e18.start || 0, e18.bufferStart || 0, y2, b2, -1);
var k2 = null !== (t2 = e18.length) && void 0 !== t2 ? t2 : y2.length ? b2[0] + y2[0].length : 0;
return new MA(f2[e18.topID], y2.reverse(), b2.reverse(), k2);
}
var VA = /* @__PURE__ */ new WeakMap();
function WA(e18, t2) {
if (!e18.isAnonymous || t2 instanceof PA || t2.type != e18)
return 1;
var n2 = VA.get(t2);
if (null == n2) {
n2 = 1;
var r2, i2 = bi(t2.children);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
if (o2.type != e18 || !(o2 instanceof MA)) {
n2 = 1;
break;
}
n2 += WA(e18, o2);
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
VA.set(t2, n2);
}
return n2;
}
function HA(e18, t2, n2, r2, i2, o2, a2, s2, u2) {
for (var c2 = 0, l2 = r2; l2 < i2; l2++)
c2 += WA(e18, t2[l2]);
var f2 = Math.ceil(1.5 * c2 / 8), h2 = [], d2 = [];
return function t3(n3, r3, i3, a3, s3) {
for (var c3 = i3; c3 < a3; ) {
var l3 = c3, v2 = r3[c3], p2 = WA(e18, n3[c3]);
for (c3++; c3 < a3; c3++) {
var m2 = WA(e18, n3[c3]);
if (p2 + m2 >= f2)
break;
p2 += m2;
}
if (c3 == l3 + 1) {
if (p2 > f2) {
var g2 = n3[l3];
t3(g2.children, g2.positions, 0, g2.children.length, r3[l3] + s3);
continue;
}
h2.push(n3[l3]);
} else {
var y2 = r3[c3 - 1] + n3[c3 - 1].length - v2;
h2.push(HA(e18, n3, r3, l3, c3, v2, y2, null, u2));
}
d2.push(v2 + s3 - o2);
}
}(t2, n2, r2, i2, 0), (s2 || u2)(h2, d2, a2);
}
var JA = function() {
function e18(t2, n2, r2, i2) {
var o2 = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], a2 = arguments.length > 5 && void 0 !== arguments[5] && arguments[5];
Ri(this, e18), this.from = t2, this.to = n2, this.tree = r2, this.offset = i2, this.open = (o2 ? 1 : 0) | (a2 ? 2 : 0);
}
return Li(e18, [{ key: "openStart", get: function() {
return (1 & this.open) > 0;
} }, { key: "openEnd", get: function() {
return (2 & this.open) > 0;
} }], [{ key: "addTree", value: function(t2) {
var n2, r2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], i2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], o2 = [new e18(0, t2.length, t2, 0, false, i2)], a2 = bi(r2);
try {
for (a2.s(); !(n2 = a2.n()).done; ) {
var s2 = n2.value;
s2.to > t2.length && o2.push(s2);
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
return o2;
} }, { key: "applyChanges", value: function(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 128;
if (!n2.length)
return t2;
for (var i2 = [], o2 = 1, a2 = t2.length ? t2[0] : null, s2 = 0, u2 = 0, c2 = 0; ; s2++) {
var l2 = s2 < n2.length ? n2[s2] : null, f2 = l2 ? l2.fromA : 1e9;
if (f2 - u2 >= r2)
for (; a2 && a2.from < f2; ) {
var h2 = a2;
if (u2 >= h2.from || f2 <= h2.to || c2) {
var d2 = Math.max(h2.from, u2) - c2, v2 = Math.min(h2.to, f2) - c2;
h2 = d2 >= v2 ? null : new e18(d2, v2, h2.tree, h2.offset + c2, s2 > 0, !!l2);
}
if (h2 && i2.push(h2), a2.to > f2)
break;
a2 = o2 < t2.length ? t2[o2++] : null;
}
if (!l2)
break;
u2 = l2.toA, c2 = l2.toA - l2.toB;
}
return i2;
} }]), e18;
}(), UA = function() {
function e18() {
Ri(this, e18);
}
return Li(e18, [{ key: "startParse", value: function(e19, t2, n2) {
return "string" == typeof e19 && (e19 = new KA(e19)), n2 = n2 ? n2.length ? n2.map(function(e20) {
return new wA(e20.from, e20.to);
}) : [new wA(0, 0)] : [new wA(0, e19.length)], this.createParse(e19, t2 || [], n2);
} }, { key: "parse", value: function(e19, t2, n2) {
for (var r2 = this.startParse(e19, t2, n2); ; ) {
var i2 = r2.advance();
if (i2)
return i2;
}
} }]), e18;
}(), KA = function() {
function e18(t2) {
Ri(this, e18), this.string = t2;
}
return Li(e18, [{ key: "length", get: function() {
return this.string.length;
} }, { key: "chunk", value: function(e19) {
return this.string.slice(e19);
} }, { key: "lineChunks", get: function() {
return false;
} }, { key: "read", value: function(e19, t2) {
return this.string.slice(e19, t2);
} }]), e18;
}();
new jA({ perNode: true });
var GA = 0, QA = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.set = t2, this.base = n2, this.modified = r2, this.id = GA++;
}
return Li(e18, null, [{ key: "define", value: function(t2) {
if (null == t2 ? void 0 : t2.base)
throw new Error("Can not derive from a modified tag");
var n2 = new e18([], null, []);
if (n2.set.push(n2), t2) {
var r2, i2 = bi(t2.set);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
n2.set.push(o2);
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
}
return n2;
} }, { key: "defineModifier", value: function() {
var e19 = new ZA();
return function(t2) {
return t2.modified.indexOf(e19) > -1 ? t2 : ZA.get(t2.base || t2, t2.modified.concat(e19).sort(function(e20, t3) {
return e20.id - t3.id;
}));
};
} }]), e18;
}(), YA = 0, ZA = function() {
function e18() {
Ri(this, e18), this.instances = [], this.id = YA++;
}
return Li(e18, null, [{ key: "get", value: function(t2, n2) {
if (!n2.length)
return t2;
var r2 = n2[0].instances.find(function(e19) {
return e19.base == t2 && (r3 = n2, i3 = e19.modified, r3.length == i3.length && r3.every(function(e20, t3) {
return e20 == i3[t3];
}));
var r3, i3;
});
if (r2)
return r2;
var i2, o2 = [], a2 = new QA(o2, t2, n2), s2 = bi(n2);
try {
for (s2.s(); !(i2 = s2.n()).done; ) {
i2.value.instances.push(a2);
}
} catch (e19) {
s2.e(e19);
} finally {
s2.f();
}
var u2, c2 = XA(n2), l2 = bi(t2.set);
try {
for (l2.s(); !(u2 = l2.n()).done; ) {
var f2, h2 = u2.value, d2 = bi(c2);
try {
for (d2.s(); !(f2 = d2.n()).done; ) {
var v2 = f2.value;
o2.push(e18.get(h2, v2));
}
} catch (e19) {
d2.e(e19);
} finally {
d2.f();
}
}
} catch (e19) {
l2.e(e19);
} finally {
l2.f();
}
return a2;
} }]), e18;
}();
function XA(e18) {
for (var t2 = [e18], n2 = 0; n2 < e18.length; n2++) {
var r2, i2 = bi(XA(e18.slice(0, n2).concat(e18.slice(n2 + 1))));
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
t2.push(o2);
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
}
return t2;
}
function eT(e18) {
var t2 = /* @__PURE__ */ Object.create(null);
for (var n2 in e18) {
var r2 = e18[n2];
Array.isArray(r2) || (r2 = [r2]);
var i2, o2 = bi(n2.split(" "));
try {
for (o2.s(); !(i2 = o2.n()).done; ) {
var a2 = i2.value;
if (a2) {
for (var s2 = [], u2 = 2, c2 = a2, l2 = 0; ; ) {
if ("..." == c2 && l2 > 0 && l2 + 3 == a2.length) {
u2 = 1;
break;
}
var f2 = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c2);
if (!f2)
throw new RangeError("Invalid path: " + a2);
if (s2.push("*" == f2[0] ? "" : '"' == f2[0][0] ? JSON.parse(f2[0]) : f2[0]), (l2 += f2[0].length) == a2.length)
break;
var h2 = a2[l2++];
if (l2 == a2.length && "!" == h2) {
u2 = 0;
break;
}
if ("/" != h2)
throw new RangeError("Invalid path: " + a2);
c2 = a2.slice(l2);
}
var d2 = s2.length - 1, v2 = s2[d2];
if (!v2)
throw new RangeError("Invalid path: " + a2);
var p2 = new nT(r2, u2, d2 > 0 ? s2.slice(0, d2) : null);
t2[v2] = p2.sort(t2[v2]);
}
}
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
}
return tT.add(t2);
}
var tT = new jA(), nT = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.tags = t2, this.mode = n2, this.context = r2, this.next = i2;
}
return Li(e18, [{ key: "sort", value: function(e19) {
return !e19 || e19.depth < this.depth ? (this.next = e19, this) : (e19.next = this.sort(e19.next), e19);
} }, { key: "depth", get: function() {
return this.context ? this.context.length : 0;
} }]), e18;
}();
function rT(e18, t2) {
var n2, r2 = /* @__PURE__ */ Object.create(null), i2 = bi(e18);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value;
if (Array.isArray(o2.tag)) {
var a2, s2 = bi(o2.tag);
try {
for (s2.s(); !(a2 = s2.n()).done; ) {
var u2 = a2.value;
r2[u2.id] = o2.class;
}
} catch (e19) {
s2.e(e19);
} finally {
s2.f();
}
} else
r2[o2.tag.id] = o2.class;
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
var c2 = t2 || {}, l2 = c2.scope, f2 = c2.all, h2 = void 0 === f2 ? null : f2;
return { style: function(e19) {
var t3, n3 = h2, i3 = bi(e19);
try {
for (i3.s(); !(t3 = i3.n()).done; ) {
var o3, a3 = bi(t3.value.set);
try {
for (a3.s(); !(o3 = a3.n()).done; ) {
var s3 = o3.value, u3 = r2[s3.id];
if (u3) {
n3 = n3 ? n3 + " " + u3 : u3;
break;
}
}
} catch (e20) {
a3.e(e20);
} finally {
a3.f();
}
}
} catch (e20) {
i3.e(e20);
} finally {
i3.f();
}
return n3;
}, scope: l2 };
}
function iT(e18, t2) {
var n2, r2 = null, i2 = bi(e18);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value.style(t2);
o2 && (r2 = r2 ? r2 + " " + o2 : o2);
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return r2;
}
function oT(e18, t2, n2) {
var r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, i2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : e18.length, o2 = new sT(r2, Array.isArray(t2) ? t2 : [t2], n2);
o2.highlightRange(e18.cursor(), r2, i2, "", o2.highlighters), o2.flush(i2);
}
var aT, sT = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.at = t2, this.highlighters = n2, this.span = r2, this.class = "";
}
return Li(e18, [{ key: "startSpan", value: function(e19, t2) {
t2 != this.class && (this.flush(e19), e19 > this.at && (this.at = e19), this.class = t2);
} }, { key: "flush", value: function(e19) {
e19 > this.at && this.class && this.span(this.at, e19, this.class);
} }, { key: "highlightRange", value: function(e19, t2, n2, r2, i2) {
var o2 = e19.type, a2 = e19.from, s2 = e19.to;
if (!(a2 >= n2 || s2 <= t2)) {
o2.isTop && (i2 = this.highlighters.filter(function(e20) {
return !e20.scope || e20.scope(o2);
}));
for (var u2 = r2, c2 = o2.prop(tT), l2 = false; c2; ) {
if (!c2.context || e19.matchContext(c2.context)) {
var f2 = iT(i2, c2.tags);
f2 && (u2 && (u2 += " "), u2 += f2, 1 == c2.mode ? r2 += (r2 ? " " : "") + f2 : 0 == c2.mode && (l2 = true));
break;
}
c2 = c2.next;
}
if (this.startSpan(e19.from, u2), !l2) {
var h2 = e19.tree && e19.tree.prop(jA.mounted);
if (h2 && h2.overlay) {
for (var d2 = e19.node.enter(h2.overlay[0].from + a2, 1), v2 = this.highlighters.filter(function(e20) {
return !e20.scope || e20.scope(h2.tree.type);
}), p2 = e19.firstChild(), m2 = 0, g2 = a2; ; m2++) {
var y2 = m2 < h2.overlay.length ? h2.overlay[m2] : null, b2 = y2 ? y2.from + a2 : s2, k2 = Math.max(t2, g2), w2 = Math.min(n2, b2);
if (k2 < w2 && p2)
for (; e19.from < w2 && (this.highlightRange(e19, k2, w2, r2, i2), this.startSpan(Math.min(n2, e19.to), u2), !(e19.to >= b2) && e19.nextSibling()); )
;
if (!y2 || b2 > n2)
break;
(g2 = y2.to + a2) > t2 && (this.highlightRange(d2.cursor(), Math.max(t2, y2.from + a2), Math.min(n2, g2), r2, v2), this.startSpan(g2, u2));
}
p2 && e19.parent();
} else if (e19.firstChild()) {
do {
if (!(e19.to <= t2)) {
if (e19.from >= n2)
break;
this.highlightRange(e19, t2, n2, r2, i2), this.startSpan(Math.min(n2, e19.to), u2);
}
} while (e19.nextSibling());
e19.parent();
}
}
}
} }]), e18;
}(), uT = QA.define, cT = uT(), lT = uT(), fT = uT(lT), hT = uT(lT), dT = uT(), vT = uT(dT), pT = uT(dT), mT = uT(), gT = uT(mT), yT = uT(), bT = uT(), kT = uT(), wT = uT(kT), jT = uT(), xT = { comment: cT, lineComment: uT(cT), blockComment: uT(cT), docComment: uT(cT), name: lT, variableName: uT(lT), typeName: fT, tagName: uT(fT), propertyName: hT, attributeName: uT(hT), className: uT(lT), labelName: uT(lT), namespace: uT(lT), macroName: uT(lT), literal: dT, string: vT, docString: uT(vT), character: uT(vT), attributeValue: uT(vT), number: pT, integer: uT(pT), float: uT(pT), bool: uT(dT), regexp: uT(dT), escape: uT(dT), color: uT(dT), url: uT(dT), keyword: yT, self: uT(yT), null: uT(yT), atom: uT(yT), unit: uT(yT), modifier: uT(yT), operatorKeyword: uT(yT), controlKeyword: uT(yT), definitionKeyword: uT(yT), moduleKeyword: uT(yT), operator: bT, derefOperator: uT(bT), arithmeticOperator: uT(bT), logicOperator: uT(bT), bitwiseOperator: uT(bT), compareOperator: uT(bT), updateOperator: uT(bT), definitionOperator: uT(bT), typeOperator: uT(bT), controlOperator: uT(bT), punctuation: kT, separator: uT(kT), bracket: wT, angleBracket: uT(wT), squareBracket: uT(wT), paren: uT(wT), brace: uT(wT), content: mT, heading: gT, heading1: uT(gT), heading2: uT(gT), heading3: uT(gT), heading4: uT(gT), heading5: uT(gT), heading6: uT(gT), contentSeparator: uT(mT), list: uT(mT), quote: uT(mT), emphasis: uT(mT), strong: uT(mT), link: uT(mT), monospace: uT(mT), strikethrough: uT(mT), inserted: uT(), deleted: uT(), changed: uT(), invalid: uT(), meta: jT, documentMeta: uT(jT), annotation: uT(jT), processingInstruction: uT(jT), definition: QA.defineModifier(), constant: QA.defineModifier(), function: QA.defineModifier(), standard: QA.defineModifier(), local: QA.defineModifier(), special: QA.defineModifier() };
rT([{ tag: xT.link, class: "tok-link" }, { tag: xT.heading, class: "tok-heading" }, { tag: xT.emphasis, class: "tok-emphasis" }, { tag: xT.strong, class: "tok-strong" }, { tag: xT.keyword, class: "tok-keyword" }, { tag: xT.atom, class: "tok-atom" }, { tag: xT.bool, class: "tok-bool" }, { tag: xT.url, class: "tok-url" }, { tag: xT.labelName, class: "tok-labelName" }, { tag: xT.inserted, class: "tok-inserted" }, { tag: xT.deleted, class: "tok-deleted" }, { tag: xT.literal, class: "tok-literal" }, { tag: xT.string, class: "tok-string" }, { tag: xT.number, class: "tok-number" }, { tag: [xT.regexp, xT.escape, xT.special(xT.string)], class: "tok-string2" }, { tag: xT.variableName, class: "tok-variableName" }, { tag: xT.local(xT.variableName), class: "tok-variableName tok-local" }, { tag: xT.definition(xT.variableName), class: "tok-variableName tok-definition" }, { tag: xT.special(xT.variableName), class: "tok-variableName2" }, { tag: xT.definition(xT.propertyName), class: "tok-propertyName tok-definition" }, { tag: xT.typeName, class: "tok-typeName" }, { tag: xT.namespace, class: "tok-namespace" }, { tag: xT.className, class: "tok-className" }, { tag: xT.macroName, class: "tok-macroName" }, { tag: xT.propertyName, class: "tok-propertyName" }, { tag: xT.operator, class: "tok-operator" }, { tag: xT.comment, class: "tok-comment" }, { tag: xT.meta, class: "tok-meta" }, { tag: xT.invalid, class: "tok-invalid" }, { tag: xT.punctuation, class: "tok-punctuation" }]);
var ST = new jA();
var _T = function() {
function e18(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
Ri(this, e18), this.data = t2, xC.prototype.hasOwnProperty("tree") || Object.defineProperty(xC.prototype, "tree", { get: function() {
return OT(this);
} }), this.parser = n2, this.extension = [DT.of(this), xC.languageData.of(function(e19, t3, n3) {
return e19.facet(CT(e19, t3, n3));
})].concat(r2);
}
return Li(e18, [{ key: "isActiveAt", value: function(e19, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1;
return CT(e19, t2, n2) == this.data;
} }, { key: "findRegions", value: function(e19) {
var t2 = this, n2 = e19.facet(DT);
if ((null == n2 ? void 0 : n2.data) == this.data)
return [{ from: 0, to: e19.doc.length }];
if (!n2 || !n2.allowsNesting)
return [];
var r2 = [];
return function e20(n3, i2) {
if (n3.prop(ST) != t2.data) {
var o2 = n3.prop(jA.mounted);
if (o2) {
if (o2.tree.prop(ST) == t2.data) {
if (o2.overlay) {
var a2, s2 = bi(o2.overlay);
try {
for (s2.s(); !(a2 = s2.n()).done; ) {
var u2 = a2.value;
r2.push({ from: u2.from + i2, to: u2.to + i2 });
}
} catch (e21) {
s2.e(e21);
} finally {
s2.f();
}
} else
r2.push({ from: i2, to: i2 + n3.length });
return;
}
if (o2.overlay) {
var c2 = r2.length;
if (e20(o2.tree, o2.overlay[0].from + i2), r2.length > c2)
return;
}
}
for (var l2 = 0; l2 < n3.children.length; l2++) {
var f2 = n3.children[l2];
f2 instanceof MA && e20(f2, n3.positions[l2] + i2);
}
} else
r2.push({ from: i2, to: i2 + n3.length });
}(OT(e19), 0), r2;
} }, { key: "allowsNesting", get: function() {
return true;
} }]), e18;
}();
function CT(e18, t2, n2) {
var r2 = e18.facet(DT);
if (!r2)
return null;
var i2 = r2.data;
if (r2.allowsNesting)
for (var o2 = OT(e18).topNode; o2; o2 = o2.enter(t2, n2, _A.ExcludeBuffers))
i2 = o2.type.prop(ST) || i2;
return i2;
}
_T.setState = fC.define();
var $T = function(e18) {
Ci(n2, _T);
var t2 = Oi(n2);
function n2(e19, r2) {
var i2;
return Ri(this, n2), (i2 = t2.call(this, e19, r2)).parser = r2, i2;
}
return Li(n2, [{ key: "configure", value: function(e19) {
return new n2(this.data, this.parser.configure(e19));
} }, { key: "allowsNesting", get: function() {
return this.parser.hasWrappers();
} }], [{ key: "define", value: function(e19) {
var t3, r2 = (t3 = e19.languageData, R_.define({ combine: t3 ? function(e20) {
return e20.concat(t3);
} : void 0 }));
return new n2(r2, e19.parser.configure({ props: [ST.add(function(e20) {
return e20.isTop ? r2 : void 0;
})] }));
} }]), n2;
}();
function OT(e18) {
var t2 = e18.field(_T.state, false);
return t2 ? t2.tree : MA.empty;
}
var MT = function() {
function e18(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t2.length;
Ri(this, e18), this.doc = t2, this.length = n2, this.cursorPos = 0, this.string = "", this.cursor = t2.iter();
}
return Li(e18, [{ key: "syncTo", value: function(e19) {
return this.string = this.cursor.next(e19 - this.cursorPos).value, this.cursorPos = e19 + this.string.length, this.cursorPos - this.string.length;
} }, { key: "chunk", value: function(e19) {
return this.syncTo(e19), this.string;
} }, { key: "lineChunks", get: function() {
return true;
} }, { key: "read", value: function(e19, t2) {
var n2 = this.cursorPos - this.string.length;
return e19 < n2 || t2 >= this.cursorPos ? this.doc.sliceString(e19, t2) : this.string.slice(e19 - n2, t2 - n2);
} }]), e18;
}(), ET = null, PT = function() {
function e18(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [], i2 = arguments.length > 3 ? arguments[3] : void 0, o2 = arguments.length > 4 ? arguments[4] : void 0, a2 = arguments.length > 5 ? arguments[5] : void 0, s2 = arguments.length > 6 ? arguments[6] : void 0, u2 = arguments.length > 7 ? arguments[7] : void 0;
Ri(this, e18), this.parser = t2, this.state = n2, this.fragments = r2, this.tree = i2, this.treeLen = o2, this.viewport = a2, this.skipped = s2, this.scheduleOn = u2, this.parse = null, this.tempSkipped = [];
}
return Li(e18, [{ key: "startParse", value: function() {
return this.parser.startParse(new MT(this.state.doc), this.fragments);
} }, { key: "work", value: function(e19, t2) {
var n2 = this;
return null != t2 && t2 >= this.state.doc.length && (t2 = void 0), this.tree != MA.empty && this.isDone(null != t2 ? t2 : this.state.doc.length) ? (this.takeTree(), true) : this.withContext(function() {
var r2;
if ("number" == typeof e19) {
var i2 = Date.now() + e19;
e19 = function() {
return Date.now() > i2;
};
}
for (n2.parse || (n2.parse = n2.startParse()), null != t2 && (null == n2.parse.stoppedAt || n2.parse.stoppedAt > t2) && t2 < n2.state.doc.length && n2.parse.stopAt(t2); ; ) {
var o2 = n2.parse.advance();
if (o2) {
if (n2.fragments = n2.withoutTempSkipped(JA.addTree(o2, n2.fragments, null != n2.parse.stoppedAt)), n2.treeLen = null !== (r2 = n2.parse.stoppedAt) && void 0 !== r2 ? r2 : n2.state.doc.length, n2.tree = o2, n2.parse = null, !(n2.treeLen < (null != t2 ? t2 : n2.state.doc.length)))
return true;
n2.parse = n2.startParse();
}
if (e19())
return false;
}
});
} }, { key: "takeTree", value: function() {
var e19, t2, n2 = this;
this.parse && (e19 = this.parse.parsedPos) >= this.treeLen && ((null == this.parse.stoppedAt || this.parse.stoppedAt > e19) && this.parse.stopAt(e19), this.withContext(function() {
for (; !(t2 = n2.parse.advance()); )
;
}), this.treeLen = e19, this.tree = t2, this.fragments = this.withoutTempSkipped(JA.addTree(this.tree, this.fragments, true)), this.parse = null);
} }, { key: "withContext", value: function(e19) {
var t2 = ET;
ET = this;
try {
return e19();
} finally {
ET = t2;
}
} }, { key: "withoutTempSkipped", value: function(e19) {
for (var t2; t2 = this.tempSkipped.pop(); )
e19 = AT(e19, t2.from, t2.to);
return e19;
} }, { key: "changes", value: function(t2, n2) {
var r2 = this.fragments, i2 = this.tree, o2 = this.treeLen, a2 = this.viewport, s2 = this.skipped;
if (this.takeTree(), !t2.empty) {
var u2 = [];
if (t2.iterChangedRanges(function(e19, t3, n3, r3) {
return u2.push({ fromA: e19, toA: t3, fromB: n3, toB: r3 });
}), r2 = JA.applyChanges(r2, u2), i2 = MA.empty, o2 = 0, a2 = { from: t2.mapPos(a2.from, -1), to: t2.mapPos(a2.to, 1) }, this.skipped.length) {
s2 = [];
var c2, l2 = bi(this.skipped);
try {
for (l2.s(); !(c2 = l2.n()).done; ) {
var f2 = c2.value, h2 = t2.mapPos(f2.from, 1), d2 = t2.mapPos(f2.to, -1);
h2 < d2 && s2.push({ from: h2, to: d2 });
}
} catch (e19) {
l2.e(e19);
} finally {
l2.f();
}
}
}
return new e18(this.parser, n2, r2, i2, o2, a2, s2, this.scheduleOn);
} }, { key: "updateViewport", value: function(e19) {
if (this.viewport.from == e19.from && this.viewport.to == e19.to)
return false;
this.viewport = e19;
for (var t2 = this.skipped.length, n2 = 0; n2 < this.skipped.length; n2++) {
var r2 = this.skipped[n2], i2 = r2.from, o2 = r2.to;
i2 < e19.to && o2 > e19.from && (this.fragments = AT(this.fragments, i2, o2), this.skipped.splice(n2--, 1));
}
return !(this.skipped.length >= t2) && (this.reset(), true);
} }, { key: "reset", value: function() {
this.parse && (this.takeTree(), this.parse = null);
} }, { key: "skipUntilInView", value: function(e19, t2) {
this.skipped.push({ from: e19, to: t2 });
} }, { key: "isDone", value: function(e19) {
e19 = Math.min(e19, this.state.doc.length);
var t2 = this.fragments;
return this.treeLen >= e19 && t2.length && 0 == t2[0].from && t2[0].to >= e19;
} }], [{ key: "create", value: function(t2, n2, r2) {
return new e18(t2, n2, [], MA.empty, 0, r2, [], null);
} }, { key: "getSkippingParser", value: function(e19) {
return new (function(t2) {
Ci(r2, UA);
var n2 = Oi(r2);
function r2() {
return Ri(this, r2), n2.apply(this, arguments);
}
return Li(r2, [{ key: "createParse", value: function(t3, n3, r3) {
var i2 = r3[0].from, o2 = r3[r3.length - 1].to;
return { parsedPos: i2, advance: function() {
var t4 = ET;
if (t4) {
var n4, a2 = bi(r3);
try {
for (a2.s(); !(n4 = a2.n()).done; ) {
var s2 = n4.value;
t4.tempSkipped.push(s2);
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
e19 && (t4.scheduleOn = t4.scheduleOn ? Promise.all([t4.scheduleOn, e19]) : e19);
}
return this.parsedPos = o2, new MA(SA.none, [], [], o2 - i2);
}, stoppedAt: null, stopAt: function() {
} };
} }]), r2;
}())();
} }, { key: "get", value: function() {
return ET;
} }]), e18;
}();
function AT(e18, t2, n2) {
return JA.applyChanges(e18, [{ fromA: t2, toA: n2, fromB: t2, toB: n2 }]);
}
var TT = function() {
function e18(t2) {
Ri(this, e18), this.context = t2, this.tree = t2.tree;
}
return Li(e18, [{ key: "apply", value: function(t2) {
if (!t2.docChanged && this.tree == this.context.tree)
return this;
var n2 = this.context.changes(t2.changes, t2.state), r2 = this.context.treeLen == t2.startState.doc.length ? void 0 : Math.max(t2.changes.mapPos(this.context.treeLen), n2.viewport.to);
return n2.work(20, r2) || n2.takeTree(), new e18(n2);
} }], [{ key: "init", value: function(t2) {
var n2 = Math.min(3e3, t2.doc.length), r2 = PT.create(t2.facet(DT).parser, t2, { from: 0, to: n2 });
return r2.work(20, n2) || r2.takeTree(), new e18(r2);
} }]), e18;
}();
_T.state = F_.define({ create: TT.init, update: function(e18, t2) {
var n2, r2 = bi(t2.effects);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
if (i2.is(_T.setState))
return i2.value;
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
return t2.startState.facet(DT) != t2.state.facet(DT) ? TT.init(t2.state) : e18.apply(t2);
} });
var IT = function(e18) {
var t2 = setTimeout(function() {
return e18();
}, 500);
return function() {
return clearTimeout(t2);
};
};
"undefined" != typeof requestIdleCallback && (IT = function(e18) {
var t2 = -1, n2 = setTimeout(function() {
t2 = requestIdleCallback(e18, { timeout: 400 });
}, 100);
return function() {
return t2 < 0 ? clearTimeout(n2) : cancelIdleCallback(t2);
};
});
var NT = "undefined" != typeof navigator && (null === (aT = navigator.scheduling) || void 0 === aT ? void 0 : aT.isInputPending) ? function() {
return navigator.scheduling.isInputPending();
} : null, RT = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.working = null, this.workScheduled = 0, this.chunkEnd = -1, this.chunkBudget = -1, this.work = this.work.bind(this), this.scheduleWork();
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2 = this.view.state.field(_T.state).context;
(t2.updateViewport(e19.view.viewport) || this.view.viewport.to > t2.treeLen) && this.scheduleWork(), e19.docChanged && (this.view.hasFocus && (this.chunkBudget += 50), this.scheduleWork()), this.checkAsyncSchedule(t2);
} }, { key: "scheduleWork", value: function() {
if (!this.working) {
var e19 = this.view.state, t2 = e19.field(_T.state);
t2.tree == t2.context.tree && t2.context.isDone(e19.doc.length) || (this.working = IT(this.work));
}
} }, { key: "work", value: function(e19) {
this.working = null;
var t2 = Date.now();
if (this.chunkEnd < t2 && (this.chunkEnd < 0 || this.view.hasFocus) && (this.chunkEnd = t2 + 3e4, this.chunkBudget = 3e3), !(this.chunkBudget <= 0)) {
var n2 = this.view, r2 = n2.state, i2 = n2.viewport.to, o2 = r2.field(_T.state);
if (o2.tree != o2.context.tree || !o2.context.isDone(i2 + 1e5)) {
var a2 = Date.now() + Math.min(this.chunkBudget, 100, e19 && !NT ? Math.max(25, e19.timeRemaining() - 5) : 1e9), s2 = o2.context.treeLen < i2 && r2.doc.length > i2 + 1e3, u2 = o2.context.work(function() {
return NT && NT() || Date.now() > a2;
}, i2 + (s2 ? 0 : 1e5));
this.chunkBudget -= Date.now() - t2, (u2 || this.chunkBudget <= 0) && (o2.context.takeTree(), this.view.dispatch({ effects: _T.setState.of(new TT(o2.context)) })), this.chunkBudget > 0 && (!u2 || s2) && this.scheduleWork(), this.checkAsyncSchedule(o2.context);
}
}
} }, { key: "checkAsyncSchedule", value: function(e19) {
var t2 = this;
e19.scheduleOn && (this.workScheduled++, e19.scheduleOn.then(function() {
return t2.scheduleWork();
}).catch(function(e20) {
return SO(t2.view.state, e20);
}).then(function() {
return t2.workScheduled--;
}), e19.scheduleOn = null);
} }, { key: "destroy", value: function() {
this.working && this.working();
} }, { key: "isWorking", value: function() {
return !!(this.working || this.workScheduled > 0);
} }]), e18;
}(), { eventHandlers: { focus: function() {
this.scheduleWork();
} } }), DT = R_.define({ combine: function(e18) {
return e18.length ? e18[0] : null;
}, enables: [_T.state, RT] }), LT = Li(function e8(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
Ri(this, e8), this.language = t2, this.support = n2, this.extension = [t2, n2];
}), zT = R_.define(), BT = R_.define({ combine: function(e18) {
if (!e18.length)
return " ";
if (!/^(?: +|\t+)$/.test(e18[0]))
throw new Error("Invalid indent unit: " + JSON.stringify(e18[0]));
return e18[0];
} });
function qT(e18) {
var t2 = e18.facet(BT);
return 9 == t2.charCodeAt(0) ? e18.tabSize * t2.length : t2.length;
}
function FT(e18, t2) {
var n2 = "", r2 = e18.tabSize;
if (9 == e18.facet(BT).charCodeAt(0))
for (; t2 >= r2; )
n2 += " ", t2 -= r2;
for (var i2 = 0; i2 < t2; i2++)
n2 += " ";
return n2;
}
function VT(e18, t2) {
e18 instanceof xC && (e18 = new WT(e18));
var n2, r2 = bi(e18.state.facet(zT));
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = (0, n2.value)(e18, t2);
if (null != i2)
return i2;
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
var o2 = OT(e18.state);
return o2 ? function(e19, t3, n3) {
return UT(t3.resolveInner(n3).enterUnfinishedNodesBefore(n3), n3, e19);
}(e18, o2, t2) : null;
}
var WT = function() {
function e18(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
Ri(this, e18), this.state = t2, this.options = n2, this.unit = qT(t2);
}
return Li(e18, [{ key: "lineAt", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n2 = this.state.doc.lineAt(e19), r2 = this.options, i2 = r2.simulateBreak, o2 = r2.simulateDoubleBreak;
return null != i2 && i2 >= n2.from && i2 <= n2.to ? o2 && i2 == e19 ? { text: "", from: e19 } : (t2 < 0 ? i2 < e19 : i2 <= e19) ? { text: n2.text.slice(i2 - n2.from), from: i2 } : { text: n2.text.slice(0, i2 - n2.from), from: n2.from } : n2;
} }, { key: "textAfterPos", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
if (this.options.simulateDoubleBreak && e19 == this.options.simulateBreak)
return "";
var n2 = this.lineAt(e19, t2), r2 = n2.text, i2 = n2.from;
return r2.slice(e19 - i2, Math.min(r2.length, e19 + 100 - i2));
} }, { key: "column", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n2 = this.lineAt(e19, t2), r2 = n2.text, i2 = n2.from, o2 = this.countColumn(r2, e19 - i2), a2 = this.options.overrideIndentation ? this.options.overrideIndentation(i2) : -1;
return a2 > -1 && (o2 += a2 - this.countColumn(r2, r2.search(/\S|$/))), o2;
} }, { key: "countColumn", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e19.length;
return FC(e19, this.state.tabSize, t2);
} }, { key: "lineIndent", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n2 = this.lineAt(e19, t2), r2 = n2.text, i2 = n2.from, o2 = this.options.overrideIndentation;
if (o2) {
var a2 = o2(i2);
if (a2 > -1)
return a2;
}
return this.countColumn(r2, r2.search(/\S|$/));
} }, { key: "simulatedBreak", get: function() {
return this.options.simulateBreak || null;
} }]), e18;
}(), HT = new jA();
function JT(e18) {
var t2 = e18.type.prop(HT);
if (t2)
return t2;
var n2, r2 = e18.firstChild;
if (r2 && (n2 = r2.type.prop(jA.closedBy))) {
var i2 = e18.lastChild, o2 = i2 && n2.indexOf(i2.name) > -1;
return function(e19) {
return function(e20, t3, n3, r3, i3) {
var o3 = e20.textAfter, a2 = o3.match(/^\s*/)[0].length, s2 = r3 && o3.slice(a2, a2 + r3.length) == r3 || i3 == e20.pos + a2, u2 = t3 ? function(e21) {
var t4 = e21.node, n4 = t4.childAfter(t4.from), r4 = t4.lastChild;
if (!n4)
return null;
for (var i4 = e21.options.simulateBreak, o4 = e21.state.doc.lineAt(n4.from), a3 = null == i4 || i4 <= o4.from ? o4.to : Math.min(o4.to, i4), s3 = n4.to; ; ) {
var u3 = t4.childAfter(s3);
if (!u3 || u3 == r4)
return null;
if (!u3.type.isSkipped)
return u3.from < a3 ? n4 : null;
s3 = u3.to;
}
}(e20) : null;
return u2 ? s2 ? e20.column(u2.from) : e20.column(u2.to) : e20.baseIndent + (s2 ? 0 : e20.unit * n3);
}(e19, true, 1, void 0, o2 && !function(e20) {
return e20.pos == e20.options.simulateBreak && e20.options.simulateDoubleBreak;
}(e19) ? i2.from : void 0);
};
}
return null == e18.parent ? KT : null;
}
function UT(e18, t2, n2) {
for (; e18; e18 = e18.parent) {
var r2 = JT(e18);
if (r2)
return r2(GT.create(n2, t2, e18));
}
return null;
}
function KT() {
return 0;
}
var GT = function(e18) {
Ci(n2, WT);
var t2 = Oi(n2);
function n2(e19, r2, i2) {
var o2;
return Ri(this, n2), (o2 = t2.call(this, e19.state, e19.options)).base = e19, o2.pos = r2, o2.node = i2, o2;
}
return Li(n2, [{ key: "textAfter", get: function() {
return this.textAfterPos(this.pos);
} }, { key: "baseIndent", get: function() {
for (var e19 = this.state.doc.lineAt(this.node.from); ; ) {
for (var t3 = this.node.resolve(e19.from); t3.parent && t3.parent.from == t3.from; )
t3 = t3.parent;
if (QT(t3, this.node))
break;
e19 = this.state.doc.lineAt(t3.from);
}
return this.lineIndent(e19.from);
} }, { key: "continue", value: function() {
var e19 = this.node.parent;
return e19 ? UT(e19, this.pos, this.base) : 0;
} }], [{ key: "create", value: function(e19, t3, r2) {
return new n2(e19, t3, r2);
} }]), n2;
}();
function QT(e18, t2) {
for (var n2 = t2; n2; n2 = n2.parent)
if (e18 == n2)
return true;
return false;
}
function YT() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = e18.except, n2 = e18.units, r2 = void 0 === n2 ? 1 : n2;
return function(e19) {
var n3 = t2 && t2.test(e19.textAfter);
return e19.baseIndent + (n3 ? 0 : r2 * e19.unit);
};
}
var ZT = R_.define(), XT = new jA();
function eI(e18, t2, n2) {
var r2, i2 = bi(e18.facet(ZT));
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = (0, r2.value)(e18, t2, n2);
if (o2)
return o2;
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return function(e19, t3, n3) {
var r3 = OT(e19);
if (r3.length < n3)
return null;
for (var i3, o3, a2 = null, s2 = r3.resolveInner(n3); s2; s2 = s2.parent)
if (!(s2.to <= n3 || s2.from > n3)) {
if (a2 && s2.from < t3)
break;
var u2 = s2.type.prop(XT);
if (u2 && (s2.to < r3.length - 50 || r3.length == e19.doc.length || (o3 = void 0, !(o3 = (i3 = s2).lastChild) || o3.to != i3.to || !o3.type.isError))) {
var c2 = u2(s2, e19);
c2 && c2.from <= n3 && c2.from >= t3 && c2.to > n3 && (a2 = c2);
}
}
return a2;
}(e18, t2, n2);
}
function tI(e18, t2) {
var n2 = t2.mapPos(e18.from, 1), r2 = t2.mapPos(e18.to, -1);
return n2 >= r2 ? void 0 : { from: n2, to: r2 };
}
var nI = fC.define({ map: tI }), rI = fC.define({ map: tI });
function iI(e18) {
var t2, n2 = [], r2 = bi(e18.state.selection.ranges);
try {
var i2 = function() {
var r3 = t2.value.head;
if (n2.some(function(e19) {
return e19.from <= r3 && e19.to >= r3;
}))
return "continue";
n2.push(e18.lineBlockAt(r3));
};
for (r2.s(); !(t2 = r2.n()).done; )
i2();
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
return n2;
}
var oI = F_.define({ create: function() {
return iO.none;
}, update: function(e18, t2) {
e18 = e18.map(t2.changes);
var n2, r2 = bi(t2.effects);
try {
var i2 = function() {
var t3 = n2.value;
t3.is(nI) && !function(e19, t4, n3) {
var r3 = false;
return e19.between(t4, t4, function(e20, i3) {
e20 == t4 && i3 == n3 && (r3 = true);
}), r3;
}(e18, t3.value.from, t3.value.to) ? e18 = e18.update({ add: [dI.range(t3.value.from, t3.value.to)] }) : t3.is(rI) && (e18 = e18.update({ filter: function(e19, n3) {
return t3.value.from != e19 || t3.value.to != n3;
}, filterFrom: t3.value.from, filterTo: t3.value.to }));
};
for (r2.s(); !(n2 = r2.n()).done; )
i2();
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
if (t2.selection) {
var o2 = false, a2 = t2.selection.main.head;
e18.between(a2, a2, function(e19, t3) {
e19 < a2 && t3 > a2 && (o2 = true);
}), o2 && (e18 = e18.update({ filterFrom: a2, filterTo: a2, filter: function(e19, t3) {
return t3 <= a2 || e19 >= a2;
} }));
}
return e18;
}, provide: function(e18) {
return LE.decorations.from(e18);
}, toJSON: function(e18, t2) {
var n2 = [];
return e18.between(0, t2.doc.length, function(e19, t3) {
n2.push(e19, t3);
}), n2;
}, fromJSON: function(e18) {
if (!Array.isArray(e18) || e18.length % 2)
throw new RangeError("Invalid JSON for fold state");
for (var t2 = [], n2 = 0; n2 < e18.length; ) {
var r2 = e18[n2++], i2 = e18[n2++];
if ("number" != typeof r2 || "number" != typeof i2)
throw new RangeError("Invalid JSON for fold state");
t2.push(dI.range(r2, i2));
}
return iO.set(t2, true);
} });
function aI(e18, t2, n2) {
var r2, i2 = null;
return null === (r2 = e18.field(oI, false)) || void 0 === r2 || r2.between(t2, n2, function(e19, t3) {
(!i2 || i2.from > e19) && (i2 = { from: e19, to: t3 });
}), i2;
}
function sI(e18, t2) {
return e18.field(oI, false) ? t2 : t2.concat(fC.appendConfig.of(hI()));
}
function uI(e18, t2) {
var n2 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r2 = e18.state.doc.lineAt(t2.from).number, i2 = e18.state.doc.lineAt(t2.to).number;
return LE.announce.of("".concat(e18.state.phrase(n2 ? "Folded lines" : "Unfolded lines"), " ").concat(r2, " ").concat(e18.state.phrase("to"), " ").concat(i2, "."));
}
var cI = [{ key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: function(e18) {
var t2, n2 = bi(iI(e18));
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
var r2 = t2.value, i2 = eI(e18.state, r2.from, r2.to);
if (i2)
return e18.dispatch({ effects: sI(e18.state, [nI.of(i2), uI(e18, i2)]) }), true;
}
} catch (e19) {
n2.e(e19);
} finally {
n2.f();
}
return false;
} }, { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: function(e18) {
if (!e18.state.field(oI, false))
return false;
var t2, n2 = [], r2 = bi(iI(e18));
try {
for (r2.s(); !(t2 = r2.n()).done; ) {
var i2 = t2.value, o2 = aI(e18.state, i2.from, i2.to);
o2 && n2.push(rI.of(o2), uI(e18, o2, false));
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
return n2.length && e18.dispatch({ effects: n2 }), n2.length > 0;
} }, { key: "Ctrl-Alt-[", run: function(e18) {
for (var t2 = e18.state, n2 = [], r2 = 0; r2 < t2.doc.length; ) {
var i2 = e18.lineBlockAt(r2), o2 = eI(t2, i2.from, i2.to);
o2 && n2.push(nI.of(o2)), r2 = (o2 ? e18.lineBlockAt(o2.to) : i2).to + 1;
}
return n2.length && e18.dispatch({ effects: sI(e18.state, n2) }), !!n2.length;
} }, { key: "Ctrl-Alt-]", run: function(e18) {
var t2 = e18.state.field(oI, false);
if (!t2 || !t2.size)
return false;
var n2 = [];
return t2.between(0, e18.state.doc.length, function(e19, t3) {
n2.push(rI.of({ from: e19, to: t3 }));
}), e18.dispatch({ effects: n2 }), true;
} }], lI = { placeholderDOM: null, placeholderText: "\u2026" }, fI = R_.define({ combine: function(e18) {
return SC(e18, lI);
} });
function hI(e18) {
var t2 = [oI, gI];
return e18 && t2.push(fI.of(e18)), t2;
}
var dI = iO.replace({ widget: new (function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2() {
return Ri(this, n2), t2.apply(this, arguments);
}
return Li(n2, [{ key: "toDOM", value: function(e19) {
var t3 = e19.state, n3 = t3.facet(fI), r2 = function(t4) {
var n4 = e19.lineBlockAt(e19.posAtDOM(t4.target)), r3 = aI(e19.state, n4.from, n4.to);
r3 && e19.dispatch({ effects: rI.of(r3) }), t4.preventDefault();
};
if (n3.placeholderDOM)
return n3.placeholderDOM(e19, r2);
var i2 = document.createElement("span");
return i2.textContent = n3.placeholderText, i2.setAttribute("aria-label", t3.phrase("folded code")), i2.title = t3.phrase("unfold"), i2.className = "cm-foldPlaceholder", i2.onclick = r2, i2;
} }]), n2;
}())() }), vI = { openText: "\u2304", closedText: "\u203A", markerDOM: null, domEventHandlers: {}, foldingChanged: function() {
return false;
} }, pI = function(e18) {
Ci(n2, ZP);
var t2 = Oi(n2);
function n2(e19, r2) {
var i2;
return Ri(this, n2), (i2 = t2.call(this)).config = e19, i2.open = r2, i2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return this.config == e19.config && this.open == e19.open;
} }, { key: "toDOM", value: function(e19) {
if (this.config.markerDOM)
return this.config.markerDOM(this.open);
var t3 = document.createElement("span");
return t3.textContent = this.open ? this.config.openText : this.config.closedText, t3.title = e19.state.phrase(this.open ? "Fold line" : "Unfold line"), t3;
} }]), n2;
}();
function mI() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = Object.assign(Object.assign({}, vI), e18), n2 = new pI(t2, true), r2 = new pI(t2, false), i2 = OO.fromClass(function() {
function e19(t3) {
Ri(this, e19), this.from = t3.viewport.from, this.markers = this.buildMarkers(t3);
}
return Li(e19, [{ key: "update", value: function(e20) {
(e20.docChanged || e20.viewportChanged || e20.startState.facet(DT) != e20.state.facet(DT) || e20.startState.field(oI, false) != e20.state.field(oI, false) || OT(e20.startState) != OT(e20.state) || t2.foldingChanged(e20)) && (this.markers = this.buildMarkers(e20.view));
} }, { key: "buildMarkers", value: function(e20) {
var t3, i3 = new PC(), o3 = bi(e20.viewportLineBlocks);
try {
for (o3.s(); !(t3 = o3.n()).done; ) {
var a2 = t3.value, s2 = aI(e20.state, a2.from, a2.to) ? r2 : eI(e20.state, a2.from, a2.to) ? n2 : null;
s2 && i3.add(a2.from, a2.from, s2);
}
} catch (e21) {
o3.e(e21);
} finally {
o3.f();
}
return i3.finish();
} }]), e19;
}()), o2 = t2.domEventHandlers;
return [i2, nA({ class: "cm-foldGutter", markers: function(e19) {
var t3;
return (null === (t3 = e19.plugin(i2)) || void 0 === t3 ? void 0 : t3.markers) || MC.empty;
}, initialSpacer: function() {
return new pI(t2, false);
}, domEventHandlers: Object.assign(Object.assign({}, o2), { click: function(e19, t3, n3) {
if (o2.click && o2.click(e19, t3, n3))
return true;
var r3 = aI(e19.state, t3.from, t3.to);
if (r3)
return e19.dispatch({ effects: rI.of(r3) }), true;
var i3 = eI(e19.state, t3.from, t3.to);
return !!i3 && (e19.dispatch({ effects: nI.of(i3) }), true);
} }) }), hI()];
}
var gI = LE.baseTheme({ ".cm-foldPlaceholder": { backgroundColor: "#eee", border: "1px solid #ddd", color: "#888", borderRadius: ".2em", margin: "0 1px", padding: "0 1px", cursor: "pointer" }, ".cm-foldGutter span": { padding: "0 1px", cursor: "pointer" } }), yI = function() {
function e18(t2, n2) {
var r2;
function i2(e19) {
var t3 = UC.newName();
return (r2 || (r2 = /* @__PURE__ */ Object.create(null)))["." + t3] = e19, t3;
}
Ri(this, e18);
var o2 = "string" == typeof n2.all ? n2.all : n2.all ? i2(n2.all) : void 0, a2 = n2.scope;
this.scope = a2 instanceof _T ? function(e19) {
return e19.prop(ST) == a2.data;
} : a2 ? function(e19) {
return e19 == a2;
} : void 0, this.style = rT(t2.map(function(e19) {
return { tag: e19.tag, class: e19.class || i2(Object.assign({}, e19, { tag: null })) };
}), { all: o2 }).style, this.module = r2 ? new UC(r2) : null, this.themeType = n2.themeType;
}
return Li(e18, null, [{ key: "define", value: function(t2, n2) {
return new e18(t2, n2 || {});
} }]), e18;
}(), bI = R_.define(), kI = R_.define({ combine: function(e18) {
return e18.length ? [e18[0]] : null;
} });
function wI(e18) {
var t2 = e18.facet(bI);
return t2.length ? t2 : e18.facet(kI);
}
function jI(e18, t2) {
var n2, r2 = [SI];
return e18 instanceof yI && (e18.module && r2.push(LE.styleModule.of(e18.module)), n2 = e18.themeType), (null == t2 ? void 0 : t2.fallback) ? r2.push(kI.of(e18)) : n2 ? r2.push(bI.computeN([LE.darkTheme], function(t3) {
return t3.facet(LE.darkTheme) == ("dark" == n2) ? [e18] : [];
})) : r2.push(bI.of(e18)), r2;
}
var xI = function() {
function e18(t2) {
Ri(this, e18), this.markCache = /* @__PURE__ */ Object.create(null), this.tree = OT(t2.state), this.decorations = this.buildDeco(t2, wI(t2.state));
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2 = OT(e19.state), n2 = wI(e19.state), r2 = n2 != wI(e19.startState);
t2.length < e19.view.viewport.to && !r2 && t2.type == this.tree.type ? this.decorations = this.decorations.map(e19.changes) : (t2 != this.tree || e19.viewportChanged || r2) && (this.tree = t2, this.decorations = this.buildDeco(e19.view, n2));
} }, { key: "buildDeco", value: function(e19, t2) {
var n2 = this;
if (!t2 || !this.tree.length)
return iO.none;
var r2, i2 = new PC(), o2 = bi(e19.visibleRanges);
try {
for (o2.s(); !(r2 = o2.n()).done; ) {
var a2 = r2.value, s2 = a2.from, u2 = a2.to;
oT(this.tree, t2, function(e20, t3, r3) {
i2.add(e20, t3, n2.markCache[r3] || (n2.markCache[r3] = iO.mark({ class: r3 })));
}, s2, u2);
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
return i2.finish();
} }]), e18;
}(), SI = K_.high(OO.fromClass(xI, { decorations: function(e18) {
return e18.decorations;
} })), _I = yI.define([{ tag: xT.meta, color: "#7a757a" }, { tag: xT.link, textDecoration: "underline" }, { tag: xT.heading, textDecoration: "underline", fontWeight: "bold" }, { tag: xT.emphasis, fontStyle: "italic" }, { tag: xT.strong, fontWeight: "bold" }, { tag: xT.strikethrough, textDecoration: "line-through" }, { tag: xT.keyword, color: "#708" }, { tag: [xT.atom, xT.bool, xT.url, xT.contentSeparator, xT.labelName], color: "#219" }, { tag: [xT.literal, xT.inserted], color: "#164" }, { tag: [xT.string, xT.deleted], color: "#a11" }, { tag: [xT.regexp, xT.escape, xT.special(xT.string)], color: "#e40" }, { tag: xT.definition(xT.variableName), color: "#00f" }, { tag: xT.local(xT.variableName), color: "#30a" }, { tag: [xT.typeName, xT.namespace], color: "#085" }, { tag: xT.className, color: "#167" }, { tag: [xT.special(xT.variableName), xT.macroName], color: "#256" }, { tag: xT.definition(xT.propertyName), color: "#00c" }, { tag: xT.comment, color: "#940" }, { tag: xT.invalid, color: "#f00" }]), CI = LE.baseTheme({ "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" }, "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" } }), $I = R_.define({ combine: function(e18) {
return SC(e18, { afterCursor: true, brackets: "()[]{}", maxScanDistance: 1e4, renderMatch: EI });
} }), OI = iO.mark({ class: "cm-matchingBracket" }), MI = iO.mark({ class: "cm-nonmatchingBracket" });
function EI(e18) {
var t2 = [], n2 = e18.matched ? OI : MI;
return t2.push(n2.range(e18.start.from, e18.start.to)), e18.end && t2.push(n2.range(e18.end.from, e18.end.to)), t2;
}
var PI = F_.define({ create: function() {
return iO.none;
}, update: function(e18, t2) {
if (!t2.docChanged && !t2.selection)
return e18;
var n2, r2 = [], i2 = t2.state.facet($I), o2 = bi(t2.state.selection.ranges);
try {
for (o2.s(); !(n2 = o2.n()).done; ) {
var a2 = n2.value;
if (a2.empty) {
var s2 = NI(t2.state, a2.head, -1, i2) || a2.head > 0 && NI(t2.state, a2.head - 1, 1, i2) || i2.afterCursor && (NI(t2.state, a2.head, 1, i2) || a2.head < t2.state.doc.length && NI(t2.state, a2.head + 1, -1, i2));
s2 && (r2 = r2.concat(i2.renderMatch(s2, t2.state)));
}
}
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
return iO.set(r2, true);
}, provide: function(e18) {
return LE.decorations.from(e18);
} }), AI = [PI, CI];
function TI() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return [$I.of(e18), AI];
}
function II(e18, t2, n2) {
var r2 = e18.prop(t2 < 0 ? jA.openedBy : jA.closedBy);
if (r2)
return r2;
if (1 == e18.name.length) {
var i2 = n2.indexOf(e18.name);
if (i2 > -1 && i2 % 2 == (t2 < 0 ? 1 : 0))
return [n2[i2 + t2]];
}
return null;
}
function NI(e18, t2, n2) {
for (var r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, i2 = r2.maxScanDistance || 1e4, o2 = r2.brackets || "()[]{}", a2 = OT(e18), s2 = a2.resolveInner(t2, n2), u2 = s2; u2; u2 = u2.parent) {
var c2 = II(u2.type, n2, o2);
if (c2 && u2.from < u2.to)
return RI(e18, t2, n2, u2, c2, o2);
}
return DI(e18, t2, n2, a2, s2.type, i2, o2);
}
function RI(e18, t2, n2, r2, i2, o2) {
var a2 = r2.parent, s2 = { from: r2.from, to: r2.to }, u2 = 0, c2 = null == a2 ? void 0 : a2.cursor();
if (c2 && (n2 < 0 ? c2.childBefore(r2.from) : c2.childAfter(r2.to)))
do {
if (n2 < 0 ? c2.to <= r2.from : c2.from >= r2.to) {
if (0 == u2 && i2.indexOf(c2.type.name) > -1 && c2.from < c2.to)
return { start: s2, end: { from: c2.from, to: c2.to }, matched: true };
if (II(c2.type, n2, o2))
u2++;
else if (II(c2.type, -n2, o2)) {
if (0 == u2)
return { start: s2, end: c2.from == c2.to ? void 0 : { from: c2.from, to: c2.to }, matched: false };
u2--;
}
}
} while (n2 < 0 ? c2.prevSibling() : c2.nextSibling());
return { start: s2, matched: false };
}
function DI(e18, t2, n2, r2, i2, o2, a2) {
var s2 = n2 < 0 ? e18.sliceDoc(t2 - 1, t2) : e18.sliceDoc(t2, t2 + 1), u2 = a2.indexOf(s2);
if (u2 < 0 || u2 % 2 == 0 != n2 > 0)
return null;
for (var c2 = { from: n2 < 0 ? t2 - 1 : t2, to: n2 > 0 ? t2 + 1 : t2 }, l2 = e18.doc.iterRange(t2, n2 > 0 ? e18.doc.length : 0), f2 = 0, h2 = 0; !l2.next().done && h2 <= o2; ) {
var d2 = l2.value;
n2 < 0 && (h2 += d2.length);
for (var v2 = t2 + h2 * n2, p2 = n2 > 0 ? 0 : d2.length - 1, m2 = n2 > 0 ? d2.length : -1; p2 != m2; p2 += n2) {
var g2 = a2.indexOf(d2[p2]);
if (!(g2 < 0 || r2.resolveInner(v2 + p2, 1).type != i2))
if (g2 % 2 == 0 == n2 > 0)
f2++;
else {
if (1 == f2)
return { start: c2, end: { from: v2 + p2, to: v2 + p2 + 1 }, matched: g2 >> 1 == u2 >> 1 };
f2--;
}
}
n2 > 0 && (h2 += d2.length);
}
return l2.done ? { start: c2, matched: false } : null;
}
for (var LI = /* @__PURE__ */ Object.create(null), zI = [SA.none], BI = [], qI = /* @__PURE__ */ Object.create(null), FI = 0, VI = [["variable", "variableName"], ["variable-2", "variableName.special"], ["string-2", "string.special"], ["def", "variableName.definition"], ["tag", "tagName"], ["attribute", "attributeName"], ["type", "typeName"], ["builtin", "variableName.standard"], ["qualifier", "modifier"], ["error", "invalid"], ["header", "heading"], ["property", "propertyName"]]; FI < VI.length; FI++) {
var WI = ki(VI[FI], 2), HI = WI[0], JI = WI[1];
qI[HI] = KI(LI, JI);
}
function UI(e18, t2) {
BI.indexOf(e18) > -1 || (BI.push(e18), console.warn(t2));
}
function KI(e18, t2) {
var n2, r2 = null, i2 = bi(t2.split("."));
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value, a2 = e18[o2] || xT[o2];
a2 ? "function" == typeof a2 ? r2 ? r2 = a2(r2) : UI(o2, "Modifier ".concat(o2, " used at start of tag")) : r2 ? UI(o2, "Tag ".concat(o2, " used as modifier")) : r2 = a2 : UI(o2, "Unknown highlighting tag ".concat(o2));
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
if (!r2)
return 0;
var s2 = t2.replace(/ /g, "_"), u2 = SA.define({ id: zI.length, name: s2, props: [eT(xi({}, s2, r2))] });
return zI.push(u2), u2.id;
}
function GI(e18, t2) {
return function(n2) {
var r2 = n2.state, i2 = n2.dispatch;
if (r2.readOnly)
return false;
var o2 = e18(t2, r2);
return !!o2 && (i2(r2.update(o2)), true);
};
}
var QI = GI(nN, 0), YI = GI(tN, 0), ZI = GI(function(e18, t2) {
return tN(e18, t2, function(e19) {
var t3, n2 = [], r2 = bi(e19.selection.ranges);
try {
for (r2.s(); !(t3 = r2.n()).done; ) {
var i2 = t3.value, o2 = e19.doc.lineAt(i2.from), a2 = i2.to <= o2.to ? o2 : e19.doc.lineAt(i2.to), s2 = n2.length - 1;
s2 >= 0 && n2[s2].to > o2.from ? n2[s2].to = a2.to : n2.push({ from: o2.from, to: a2.to });
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
return n2;
}(t2));
}, 0);
function XI(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : e18.selection.main.head, n2 = e18.languageDataAt("commentTokens", t2);
return n2.length ? n2[0] : {};
}
function eN(e18, t2, n2, r2) {
var i2, o2, a2 = t2.open, s2 = t2.close, u2 = e18.sliceDoc(n2 - 50, n2), c2 = e18.sliceDoc(r2, r2 + 50), l2 = /\s*$/.exec(u2)[0].length, f2 = /^\s*/.exec(c2)[0].length, h2 = u2.length - l2;
if (u2.slice(h2 - a2.length, h2) == a2 && c2.slice(f2, f2 + s2.length) == s2)
return { open: { pos: n2 - l2, margin: l2 && 1 }, close: { pos: r2 + f2, margin: f2 && 1 } };
r2 - n2 <= 100 ? i2 = o2 = e18.sliceDoc(n2, r2) : (i2 = e18.sliceDoc(n2, n2 + 50), o2 = e18.sliceDoc(r2 - 50, r2));
var d2 = /^\s*/.exec(i2)[0].length, v2 = /\s*$/.exec(o2)[0].length, p2 = o2.length - v2 - s2.length;
return i2.slice(d2, d2 + a2.length) == a2 && o2.slice(p2, p2 + s2.length) == s2 ? { open: { pos: n2 + d2 + a2.length, margin: /\s/.test(i2.charAt(d2 + a2.length)) ? 1 : 0 }, close: { pos: r2 - v2 - s2.length, margin: /\s/.test(o2.charAt(p2 - 1)) ? 1 : 0 } } : null;
}
function tN(e18, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t2.selection.ranges, r2 = n2.map(function(e19) {
return XI(t2, e19.from).block;
});
if (!r2.every(function(e19) {
return e19;
}))
return null;
var i2 = n2.map(function(e19, n3) {
return eN(t2, r2[n3], e19.from, e19.to);
});
if (2 != e18 && !i2.every(function(e19) {
return e19;
}))
return { changes: t2.changes(n2.map(function(e19, t3) {
return i2[t3] ? [] : [{ from: e19.from, insert: r2[t3].open + " " }, { from: e19.to, insert: " " + r2[t3].close }];
})) };
if (1 != e18 && i2.some(function(e19) {
return e19;
})) {
for (var o2, a2 = [], s2 = 0; s2 < i2.length; s2++)
if (o2 = i2[s2]) {
var u2 = r2[s2], c2 = o2, l2 = c2.open, f2 = c2.close;
a2.push({ from: l2.pos - u2.open.length, to: l2.pos + l2.margin }, { from: f2.pos - f2.margin, to: f2.pos + u2.close.length });
}
return { changes: a2 };
}
return null;
}
function nN(e18, t2) {
var n2, r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t2.selection.ranges, i2 = [], o2 = -1, a2 = bi(r2);
try {
for (a2.s(); !(n2 = a2.n()).done; ) {
for (var s2 = n2.value, u2 = s2.from, c2 = s2.to, l2 = i2.length, f2 = 1e9, h2 = u2; h2 <= c2; ) {
var d2 = t2.doc.lineAt(h2);
if (d2.from > o2 && (u2 == c2 || c2 > d2.from)) {
o2 = d2.from;
var v2 = XI(t2, h2).line;
if (!v2)
continue;
var p2 = /^\s*/.exec(d2.text)[0].length, m2 = p2 == d2.length, g2 = d2.text.slice(p2, p2 + v2.length) == v2 ? p2 : -1;
p2 < d2.text.length && p2 < f2 && (f2 = p2), i2.push({ line: d2, comment: g2, token: v2, indent: p2, empty: m2, single: false });
}
h2 = d2.to + 1;
}
if (f2 < 1e9)
for (var y2 = l2; y2 < i2.length; y2++)
i2[y2].indent < i2[y2].line.text.length && (i2[y2].indent = f2);
i2.length == l2 + 1 && (i2[l2].single = true);
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
if (2 != e18 && i2.some(function(e19) {
return e19.comment < 0 && (!e19.empty || e19.single);
})) {
var b2, k2 = [], w2 = bi(i2);
try {
for (w2.s(); !(b2 = w2.n()).done; ) {
var j2 = b2.value, x2 = j2.line, S2 = j2.token, _2 = j2.indent, C2 = j2.empty, $2 = j2.single;
!$2 && C2 || k2.push({ from: x2.from + _2, insert: S2 + " " });
}
} catch (e19) {
w2.e(e19);
} finally {
w2.f();
}
var O2 = t2.changes(k2);
return { changes: O2, selection: t2.selection.map(O2, 1) };
}
if (1 != e18 && i2.some(function(e19) {
return e19.comment >= 0;
})) {
var M2, E2 = [], P2 = bi(i2);
try {
for (P2.s(); !(M2 = P2.n()).done; ) {
var A2 = M2.value, T2 = A2.line, I2 = A2.comment, N2 = A2.token;
if (I2 >= 0) {
var R2 = T2.from + I2, D2 = R2 + N2.length;
" " == T2.text[D2 - T2.from] && D2++, E2.push({ from: R2, to: D2 });
}
}
} catch (e19) {
P2.e(e19);
} finally {
P2.f();
}
return { changes: E2 };
}
return null;
}
var rN = uC.define(), iN = uC.define(), oN = R_.define(), aN = R_.define({ combine: function(e18) {
return SC(e18, { minDepth: 100, newGroupDelay: 500 }, { minDepth: Math.max, newGroupDelay: Math.min });
} });
var sN = F_.define({ create: function() {
return CN.empty;
}, update: function(e18, t2) {
var n2, r2, i2 = t2.state.facet(aN), o2 = t2.annotation(rN);
if (o2) {
var a2 = t2.docChanged ? T_.single((n2 = t2.changes, r2 = 0, n2.iterChangedRanges(function(e19, t3) {
return r2 = t3;
}), r2)) : void 0, s2 = gN.fromTransaction(t2, a2), u2 = o2.side, c2 = 0 == u2 ? e18.undone : e18.done;
return c2 = s2 ? yN(c2, c2.length, i2.minDepth, s2) : wN(c2, t2.startState.selection), new CN(0 == u2 ? o2.rest : c2, 0 == u2 ? c2 : o2.rest);
}
var l2 = t2.annotation(iN);
if ("full" != l2 && "before" != l2 || (e18 = e18.isolate()), false === t2.annotation(hC.addToHistory))
return t2.changes.empty ? e18 : e18.addMapping(t2.changes.desc);
var f2 = gN.fromTransaction(t2), h2 = t2.annotation(hC.time), d2 = t2.annotation(hC.userEvent);
return f2 ? e18 = e18.addChanges(f2, h2, d2, i2.newGroupDelay, i2.minDepth) : t2.selection && (e18 = e18.addSelection(t2.startState.selection, h2, d2, i2.newGroupDelay)), "full" != l2 && "after" != l2 || (e18 = e18.isolate()), e18;
}, toJSON: function(e18) {
return { done: e18.done.map(function(e19) {
return e19.toJSON();
}), undone: e18.undone.map(function(e19) {
return e19.toJSON();
}) };
}, fromJSON: function(e18) {
return new CN(e18.done.map(gN.fromJSON), e18.undone.map(gN.fromJSON));
} });
function uN() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return [sN, aN.of(e18), LE.domEventHandlers({ beforeinput: function(e19, t2) {
var n2 = "historyUndo" == e19.inputType ? lN : "historyRedo" == e19.inputType ? fN : null;
return !!n2 && (e19.preventDefault(), n2(t2));
} })];
}
function cN(e18, t2) {
return function(n2) {
var r2 = n2.state, i2 = n2.dispatch;
if (!t2 && r2.readOnly)
return false;
var o2 = r2.field(sN, false);
if (!o2)
return false;
var a2 = o2.pop(e18, r2, t2);
return !!a2 && (i2(a2), true);
};
}
var lN = cN(0, false), fN = cN(1, false), hN = cN(0, true), dN = cN(1, true);
function vN(e18) {
return function(t2) {
var n2 = t2.field(sN, false);
if (!n2)
return 0;
var r2 = 0 == e18 ? n2.done : n2.undone;
return r2.length - (r2.length && !r2[0].changes ? 1 : 0);
};
}
var pN = vN(0), mN = vN(1), gN = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.changes = t2, this.effects = n2, this.mapped = r2, this.startSelection = i2, this.selectionsAfter = o2;
}
return Li(e18, [{ key: "setSelAfter", value: function(t2) {
return new e18(this.changes, this.effects, this.mapped, this.startSelection, t2);
} }, { key: "toJSON", value: function() {
var e19, t2, n2;
return { changes: null === (e19 = this.changes) || void 0 === e19 ? void 0 : e19.toJSON(), mapped: null === (t2 = this.mapped) || void 0 === t2 ? void 0 : t2.toJSON(), startSelection: null === (n2 = this.startSelection) || void 0 === n2 ? void 0 : n2.toJSON(), selectionsAfter: this.selectionsAfter.map(function(e20) {
return e20.toJSON();
}) };
} }], [{ key: "fromJSON", value: function(t2) {
return new e18(t2.changes && __.fromJSON(t2.changes), [], t2.mapped && S_.fromJSON(t2.mapped), t2.startSelection && T_.fromJSON(t2.startSelection), t2.selectionsAfter.map(T_.fromJSON));
} }, { key: "fromTransaction", value: function(t2, n2) {
var r2, i2 = kN, o2 = bi(t2.startState.facet(oN));
try {
for (o2.s(); !(r2 = o2.n()).done; ) {
var a2 = (0, r2.value)(t2);
a2.length && (i2 = i2.concat(a2));
}
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
return !i2.length && t2.changes.empty ? null : new e18(t2.changes.invert(t2.startState.doc), i2, void 0, n2 || t2.startState.selection, kN);
} }, { key: "selection", value: function(t2) {
return new e18(void 0, kN, void 0, void 0, t2);
} }]), e18;
}();
function yN(e18, t2, n2, r2) {
var i2 = t2 + 1 > n2 + 20 ? t2 - n2 - 1 : 0, o2 = e18.slice(i2, t2);
return o2.push(r2), o2;
}
function bN(e18, t2) {
return e18.length ? t2.length ? e18.concat(t2) : e18 : t2;
}
var kN = [];
function wN(e18, t2) {
if (e18.length) {
var n2 = e18[e18.length - 1], r2 = n2.selectionsAfter.slice(Math.max(0, n2.selectionsAfter.length - 200));
return r2.length && r2[r2.length - 1].eq(t2) ? e18 : (r2.push(t2), yN(e18, e18.length - 1, 1e9, n2.setSelAfter(r2)));
}
return [gN.selection([t2])];
}
function jN(e18) {
var t2 = e18[e18.length - 1], n2 = e18.slice();
return n2[e18.length - 1] = t2.setSelAfter(t2.selectionsAfter.slice(0, t2.selectionsAfter.length - 1)), n2;
}
function xN(e18, t2) {
if (!e18.length)
return e18;
for (var n2 = e18.length, r2 = kN; n2; ) {
var i2 = SN(e18[n2 - 1], t2, r2);
if (i2.changes && !i2.changes.empty || i2.effects.length) {
var o2 = e18.slice(0, n2);
return o2[n2 - 1] = i2, o2;
}
t2 = i2.mapped, n2--, r2 = i2.selectionsAfter;
}
return r2.length ? [gN.selection(r2)] : kN;
}
function SN(e18, t2, n2) {
var r2 = bN(e18.selectionsAfter.length ? e18.selectionsAfter.map(function(e19) {
return e19.map(t2);
}) : kN, n2);
if (!e18.changes)
return gN.selection(r2);
var i2 = e18.changes.map(t2), o2 = t2.mapDesc(e18.changes, true), a2 = e18.mapped ? e18.mapped.composeDesc(o2) : o2;
return new gN(i2, fC.mapEffects(e18.effects, t2), a2, e18.startSelection.map(o2), r2);
}
var _N = /^(input\.type|delete)($|\.)/, CN = function() {
function e18(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : void 0;
Ri(this, e18), this.done = t2, this.undone = n2, this.prevTime = r2, this.prevUserEvent = i2;
}
return Li(e18, [{ key: "isolate", value: function() {
return this.prevTime ? new e18(this.done, this.undone) : this;
} }, { key: "addChanges", value: function(t2, n2, r2, i2, o2) {
var a2 = this.done, s2 = a2[a2.length - 1];
return a2 = s2 && s2.changes && !s2.changes.empty && t2.changes && (!r2 || _N.test(r2)) && (!s2.selectionsAfter.length && n2 - this.prevTime < i2 && function(e19, t3) {
var n3 = [], r3 = false;
return e19.iterChangedRanges(function(e20, t4) {
return n3.push(e20, t4);
}), t3.iterChangedRanges(function(e20, t4, i3, o3) {
for (var a3 = 0; a3 < n3.length; ) {
var s3 = n3[a3++], u2 = n3[a3++];
o3 >= s3 && i3 <= u2 && (r3 = true);
}
}), r3;
}(s2.changes, t2.changes) || "input.type.compose" == r2) ? yN(a2, a2.length - 1, o2, new gN(t2.changes.compose(s2.changes), bN(t2.effects, s2.effects), s2.mapped, s2.startSelection, kN)) : yN(a2, a2.length, o2, t2), new e18(a2, kN, n2, r2);
} }, { key: "addSelection", value: function(t2, n2, r2, i2) {
var o2, a2, s2 = this.done.length ? this.done[this.done.length - 1].selectionsAfter : kN;
return s2.length > 0 && n2 - this.prevTime < i2 && r2 == this.prevUserEvent && r2 && /^select($|\.)/.test(r2) && (o2 = s2[s2.length - 1], a2 = t2, o2.ranges.length == a2.ranges.length && 0 === o2.ranges.filter(function(e19, t3) {
return e19.empty != a2.ranges[t3].empty;
}).length) ? this : new e18(wN(this.done, t2), this.undone, n2, r2);
} }, { key: "addMapping", value: function(t2) {
return new e18(xN(this.done, t2), xN(this.undone, t2), this.prevTime, this.prevUserEvent);
} }, { key: "pop", value: function(e19, t2, n2) {
var r2 = 0 == e19 ? this.done : this.undone;
if (0 == r2.length)
return null;
var i2 = r2[r2.length - 1];
if (n2 && i2.selectionsAfter.length)
return t2.update({ selection: i2.selectionsAfter[i2.selectionsAfter.length - 1], annotations: rN.of({ side: e19, rest: jN(r2) }), userEvent: 0 == e19 ? "select.undo" : "select.redo", scrollIntoView: true });
if (i2.changes) {
var o2 = 1 == r2.length ? kN : r2.slice(0, r2.length - 1);
return i2.mapped && (o2 = xN(o2, i2.mapped)), t2.update({ changes: i2.changes, selection: i2.startSelection, effects: i2.effects, annotations: rN.of({ side: e19, rest: o2 }), filter: false, userEvent: 0 == e19 ? "undo" : "redo", scrollIntoView: true });
}
return null;
} }]), e18;
}();
CN.empty = new CN(kN, kN);
var $N = [{ key: "Mod-z", run: lN, preventDefault: true }, { key: "Mod-y", mac: "Mod-Shift-z", run: fN, preventDefault: true }, { linux: "Ctrl-Shift-z", run: fN, preventDefault: true }, { key: "Mod-u", run: hN, preventDefault: true }, { key: "Alt-u", mac: "Mod-Shift-u", run: dN, preventDefault: true }];
function ON(e18, t2) {
return T_.create(e18.ranges.map(t2), e18.mainIndex);
}
function MN(e18, t2) {
return e18.update({ selection: t2, scrollIntoView: true, userEvent: "select" });
}
function EN(e18, t2) {
var n2 = e18.state, r2 = e18.dispatch, i2 = ON(n2.selection, t2);
return !i2.eq(n2.selection) && (r2(MN(n2, i2)), true);
}
function PN(e18, t2) {
return T_.cursor(t2 ? e18.to : e18.from);
}
function AN(e18, t2) {
return EN(e18, function(n2) {
return n2.empty ? e18.moveByChar(n2, t2) : PN(n2, t2);
});
}
function TN(e18) {
return e18.textDirectionAt(e18.state.selection.main.head) == LO.LTR;
}
var IN = function(e18) {
return AN(e18, !TN(e18));
}, NN = function(e18) {
return AN(e18, TN(e18));
};
function RN(e18, t2) {
return EN(e18, function(n2) {
return n2.empty ? e18.moveByGroup(n2, t2) : PN(n2, t2);
});
}
function DN(e18, t2, n2) {
if (t2.type.prop(n2))
return true;
var r2 = t2.to - t2.from;
return r2 && (r2 > 2 || /[^\s,.;:]/.test(e18.sliceDoc(t2.from, t2.to))) || t2.firstChild;
}
function LN(e18, t2, n2) {
for (var r2 = OT(e18).resolveInner(t2.head), i2 = n2 ? jA.closedBy : jA.openedBy, o2 = t2.head; ; ) {
var a2 = n2 ? r2.childAfter(o2) : r2.childBefore(o2);
if (!a2)
break;
DN(e18, a2, i2) ? r2 = a2 : o2 = n2 ? a2.to : a2.from;
}
var s2, u2;
return u2 = r2.type.prop(i2) && (s2 = n2 ? NI(e18, r2.from, 1) : NI(e18, r2.to, -1)) && s2.matched ? n2 ? s2.end.to : s2.end.from : n2 ? r2.to : r2.from, T_.cursor(u2, n2 ? -1 : 1);
}
function zN(e18, t2) {
return EN(e18, function(n2) {
if (!n2.empty)
return PN(n2, t2);
var r2 = e18.moveVertically(n2, t2);
return r2.head != n2.head ? r2 : e18.moveToLineBoundary(n2, t2);
});
}
var BN = function(e18) {
return zN(e18, false);
}, qN = function(e18) {
return zN(e18, true);
};
function FN(e18) {
return Math.max(e18.defaultLineHeight, Math.min(e18.dom.clientHeight, innerHeight) - 5);
}
function VN(e18, t2) {
var n2 = e18.state, r2 = ON(n2.selection, function(n3) {
return n3.empty ? e18.moveVertically(n3, t2, FN(e18)) : PN(n3, t2);
});
if (r2.eq(n2.selection))
return false;
var i2, o2 = e18.coordsAtPos(n2.selection.main.head), a2 = e18.scrollDOM.getBoundingClientRect();
return o2 && o2.top > a2.top && o2.bottom < a2.bottom && o2.top - a2.top <= e18.scrollDOM.scrollHeight - e18.scrollDOM.scrollTop - e18.scrollDOM.clientHeight && (i2 = LE.scrollIntoView(r2.main.head, { y: "start", yMargin: o2.top - a2.top })), e18.dispatch(MN(n2, r2), { effects: i2 }), true;
}
var WN = function(e18) {
return VN(e18, false);
}, HN = function(e18) {
return VN(e18, true);
};
function JN(e18, t2, n2) {
var r2 = e18.lineBlockAt(t2.head), i2 = e18.moveToLineBoundary(t2, n2);
if (i2.head == t2.head && i2.head != (n2 ? r2.to : r2.from) && (i2 = e18.moveToLineBoundary(t2, n2, false)), !n2 && i2.head == r2.from && r2.length) {
var o2 = /^\s*/.exec(e18.state.sliceDoc(r2.from, Math.min(r2.from + 100, r2.to)))[0].length;
o2 && t2.head != r2.from + o2 && (i2 = T_.cursor(r2.from + o2));
}
return i2;
}
function UN(e18, t2) {
var n2 = ON(e18.state.selection, function(e19) {
var n3 = t2(e19);
return T_.range(e19.anchor, n3.head, n3.goalColumn);
});
return !n2.eq(e18.state.selection) && (e18.dispatch(MN(e18.state, n2)), true);
}
function KN(e18, t2) {
return UN(e18, function(n2) {
return e18.moveByChar(n2, t2);
});
}
var GN = function(e18) {
return KN(e18, !TN(e18));
}, QN = function(e18) {
return KN(e18, TN(e18));
};
function YN(e18, t2) {
return UN(e18, function(n2) {
return e18.moveByGroup(n2, t2);
});
}
function ZN(e18, t2) {
return UN(e18, function(n2) {
return e18.moveVertically(n2, t2);
});
}
var XN = function(e18) {
return ZN(e18, false);
}, eR = function(e18) {
return ZN(e18, true);
};
function tR(e18, t2) {
return UN(e18, function(n2) {
return e18.moveVertically(n2, t2, FN(e18));
});
}
var nR = function(e18) {
return tR(e18, false);
}, rR = function(e18) {
return tR(e18, true);
}, iR = function(e18) {
var t2 = e18.state;
return (0, e18.dispatch)(MN(t2, { anchor: 0 })), true;
}, oR = function(e18) {
var t2 = e18.state;
return (0, e18.dispatch)(MN(t2, { anchor: t2.doc.length })), true;
}, aR = function(e18) {
var t2 = e18.state;
return (0, e18.dispatch)(MN(t2, { anchor: t2.selection.main.anchor, head: 0 })), true;
}, sR = function(e18) {
var t2 = e18.state;
return (0, e18.dispatch)(MN(t2, { anchor: t2.selection.main.anchor, head: t2.doc.length })), true;
};
function uR(e18, t2) {
if (e18.state.readOnly)
return false;
var n2 = "delete.selection", r2 = e18.state, i2 = r2.changeByRange(function(r3) {
var i3 = r3.from, o2 = r3.to;
if (i3 == o2) {
var a2 = t2(i3);
a2 < i3 ? (n2 = "delete.backward", a2 = cR(e18, a2, false)) : a2 > i3 && (n2 = "delete.forward", a2 = cR(e18, a2, true)), i3 = Math.min(i3, a2), o2 = Math.max(o2, a2);
} else
i3 = cR(e18, i3, false), o2 = cR(e18, i3, true);
return i3 == o2 ? { range: r3 } : { changes: { from: i3, to: o2 }, range: T_.cursor(i3) };
});
return !i2.changes.empty && (e18.dispatch(r2.update(i2, { scrollIntoView: true, userEvent: n2, effects: "delete.selection" == n2 ? LE.announce.of(r2.phrase("Selection deleted")) : void 0 })), true);
}
function cR(e18, t2, n2) {
if (e18 instanceof LE) {
var r2, i2 = bi(e18.state.facet(LE.atomicRanges).map(function(t3) {
return t3(e18);
}));
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
r2.value.between(t2, t2, function(e19, r3) {
e19 < t2 && r3 > t2 && (t2 = n2 ? r3 : e19);
});
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
}
return t2;
}
var lR = function(e18, t2) {
return uR(e18, function(n2) {
var r2, i2, o2 = e18.state, a2 = o2.doc.lineAt(n2);
if (!t2 && n2 > a2.from && n2 < a2.from + 200 && !/[^ \t]/.test(r2 = a2.text.slice(0, n2 - a2.from))) {
if (" " == r2[r2.length - 1])
return n2 - 1;
for (var s2 = FC(r2, o2.tabSize) % qT(o2) || qT(o2), u2 = 0; u2 < s2 && " " == r2[r2.length - 1 - u2]; u2++)
n2--;
i2 = n2;
} else
(i2 = v_(a2.text, n2 - a2.from, t2, t2) + a2.from) == n2 && a2.number != (t2 ? o2.doc.lines : 1) && (i2 += t2 ? 1 : -1);
return i2;
});
}, fR = function(e18) {
return lR(e18, false);
}, hR = function(e18) {
return lR(e18, true);
}, dR = function(e18, t2) {
return uR(e18, function(n2) {
for (var r2 = n2, i2 = e18.state, o2 = i2.doc.lineAt(r2), a2 = i2.charCategorizer(r2), s2 = null; ; ) {
if (r2 == (t2 ? o2.to : o2.from)) {
r2 == n2 && o2.number != (t2 ? i2.doc.lines : 1) && (r2 += t2 ? 1 : -1);
break;
}
var u2 = v_(o2.text, r2 - o2.from, t2) + o2.from, c2 = o2.text.slice(Math.min(r2, u2) - o2.from, Math.max(r2, u2) - o2.from), l2 = a2(c2);
if (null != s2 && l2 != s2)
break;
" " == c2 && r2 == n2 || (s2 = l2), r2 = u2;
}
return r2;
});
}, vR = function(e18) {
return dR(e18, false);
}, pR = function(e18) {
return uR(e18, function(t2) {
var n2 = e18.lineBlockAt(t2).to;
return t2 < n2 ? n2 : Math.min(e18.state.doc.length, t2 + 1);
});
};
function mR(e18) {
var t2, n2 = [], r2 = -1, i2 = bi(e18.selection.ranges);
try {
for (i2.s(); !(t2 = i2.n()).done; ) {
var o2 = t2.value, a2 = e18.doc.lineAt(o2.from), s2 = e18.doc.lineAt(o2.to);
if (o2.empty || o2.to != s2.from || (s2 = e18.doc.lineAt(o2.to - 1)), r2 >= a2.number) {
var u2 = n2[n2.length - 1];
u2.to = s2.to, u2.ranges.push(o2);
} else
n2.push({ from: a2.from, to: s2.to, ranges: [o2] });
r2 = s2.number + 1;
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return n2;
}
function gR(e18, t2, n2) {
if (e18.readOnly)
return false;
var r2, i2 = [], o2 = [], a2 = bi(mR(e18));
try {
for (a2.s(); !(r2 = a2.n()).done; ) {
var s2 = r2.value;
if (n2 ? s2.to != e18.doc.length : 0 != s2.from) {
var u2 = e18.doc.lineAt(n2 ? s2.to + 1 : s2.from - 1), c2 = u2.length + 1;
if (n2) {
i2.push({ from: s2.to, to: u2.to }, { from: s2.from, insert: u2.text + e18.lineBreak });
var l2, f2 = bi(s2.ranges);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
var h2 = l2.value;
o2.push(T_.range(Math.min(e18.doc.length, h2.anchor + c2), Math.min(e18.doc.length, h2.head + c2)));
}
} catch (e19) {
f2.e(e19);
} finally {
f2.f();
}
} else {
i2.push({ from: u2.from, to: s2.from }, { from: s2.to, insert: e18.lineBreak + u2.text });
var d2, v2 = bi(s2.ranges);
try {
for (v2.s(); !(d2 = v2.n()).done; ) {
var p2 = d2.value;
o2.push(T_.range(p2.anchor - c2, p2.head - c2));
}
} catch (e19) {
v2.e(e19);
} finally {
v2.f();
}
}
}
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
return !!i2.length && (t2(e18.update({ changes: i2, scrollIntoView: true, selection: T_.create(o2, e18.selection.mainIndex), userEvent: "move.line" })), true);
}
function yR(e18, t2, n2) {
if (e18.readOnly)
return false;
var r2, i2 = [], o2 = bi(mR(e18));
try {
for (o2.s(); !(r2 = o2.n()).done; ) {
var a2 = r2.value;
n2 ? i2.push({ from: a2.from, insert: e18.doc.slice(a2.from, a2.to) + e18.lineBreak }) : i2.push({ from: a2.to, insert: e18.lineBreak + e18.doc.slice(a2.from, a2.to) });
}
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
return t2(e18.update({ changes: i2, scrollIntoView: true, userEvent: "input.copyline" })), true;
}
var bR = wR(false), kR = wR(true);
function wR(e18) {
return function(t2) {
var n2 = t2.state, r2 = t2.dispatch;
if (n2.readOnly)
return false;
var i2 = n2.changeByRange(function(t3) {
var r3 = t3.from, i3 = t3.to, o2 = n2.doc.lineAt(r3), a2 = !e18 && r3 == i3 && function(e19, t4) {
if (/\(\)|\[\]|\{\}/.test(e19.sliceDoc(t4 - 1, t4 + 1)))
return { from: t4, to: t4 };
var n3, r4 = OT(e19).resolveInner(t4), i4 = r4.childBefore(t4), o3 = r4.childAfter(t4);
return i4 && o3 && i4.to <= t4 && o3.from >= t4 && (n3 = i4.type.prop(jA.closedBy)) && n3.indexOf(o3.name) > -1 && e19.doc.lineAt(i4.to).from == e19.doc.lineAt(o3.from).from ? { from: i4.to, to: o3.from } : null;
}(n2, r3);
e18 && (r3 = i3 = (i3 <= o2.to ? o2 : n2.doc.lineAt(i3)).to);
var s2 = new WT(n2, { simulateBreak: r3, simulateDoubleBreak: !!a2 }), u2 = VT(s2, r3);
for (null == u2 && (u2 = /^\s*/.exec(n2.doc.lineAt(r3).text)[0].length); i3 < o2.to && /\s/.test(o2.text[i3 - o2.from]); )
i3++;
a2 ? (r3 = a2.from, i3 = a2.to) : r3 > o2.from && r3 < o2.from + 100 && !/\S/.test(o2.text.slice(0, r3)) && (r3 = o2.from);
var c2 = ["", FT(n2, u2)];
return a2 && c2.push(FT(n2, s2.lineIndent(o2.from, -1))), { changes: { from: r3, to: i3, insert: e_.of(c2) }, range: T_.cursor(r3 + 1 + c2[1].length) };
});
return r2(n2.update(i2, { scrollIntoView: true, userEvent: "input" })), true;
};
}
function jR(e18, t2) {
var n2 = -1;
return e18.changeByRange(function(r2) {
for (var i2 = [], o2 = r2.from; o2 <= r2.to; ) {
var a2 = e18.doc.lineAt(o2);
a2.number > n2 && (r2.empty || r2.to > a2.from) && (t2(a2, i2, r2), n2 = a2.number), o2 = a2.to + 1;
}
var s2 = e18.changes(i2);
return { changes: i2, range: T_.range(s2.mapPos(r2.anchor, 1), s2.mapPos(r2.head, 1)) };
});
}
var xR = function(e18) {
var t2 = e18.state, n2 = e18.dispatch;
return !t2.readOnly && (n2(t2.update(jR(t2, function(e19, n3) {
n3.push({ from: e19.from, insert: t2.facet(BT) });
}), { userEvent: "input.indent" })), true);
}, SR = function(e18) {
var t2 = e18.state, n2 = e18.dispatch;
return !t2.readOnly && (n2(t2.update(jR(t2, function(e19, n3) {
var r2 = /^\s*/.exec(e19.text)[0];
if (r2) {
for (var i2 = FC(r2, t2.tabSize), o2 = 0, a2 = FT(t2, Math.max(0, i2 - qT(t2))); o2 < r2.length && o2 < a2.length && r2.charCodeAt(o2) == a2.charCodeAt(o2); )
o2++;
n3.push({ from: e19.from + o2, to: e19.from + r2.length, insert: a2.slice(o2) });
}
}), { userEvent: "delete.dedent" })), true);
}, _R = [{ key: "Ctrl-b", run: IN, shift: GN, preventDefault: true }, { key: "Ctrl-f", run: NN, shift: QN }, { key: "Ctrl-p", run: BN, shift: XN }, { key: "Ctrl-n", run: qN, shift: eR }, { key: "Ctrl-a", run: function(e18) {
return EN(e18, function(t2) {
return T_.cursor(e18.lineBlockAt(t2.head).from, 1);
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return T_.cursor(e18.lineBlockAt(t2.head).from);
});
} }, { key: "Ctrl-e", run: function(e18) {
return EN(e18, function(t2) {
return T_.cursor(e18.lineBlockAt(t2.head).to, -1);
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return T_.cursor(e18.lineBlockAt(t2.head).to);
});
} }, { key: "Ctrl-d", run: hR }, { key: "Ctrl-h", run: fR }, { key: "Ctrl-k", run: pR }, { key: "Ctrl-Alt-h", run: vR }, { key: "Ctrl-o", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch;
if (t2.readOnly)
return false;
var r2 = t2.changeByRange(function(e19) {
return { changes: { from: e19.from, to: e19.to, insert: e_.of(["", ""]) }, range: T_.cursor(e19.from) };
});
return n2(t2.update(r2, { scrollIntoView: true, userEvent: "input" })), true;
} }, { key: "Ctrl-t", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch;
if (t2.readOnly)
return false;
var r2 = t2.changeByRange(function(e19) {
if (!e19.empty || 0 == e19.from || e19.from == t2.doc.length)
return { range: e19 };
var n3 = e19.from, r3 = t2.doc.lineAt(n3), i2 = n3 == r3.from ? n3 - 1 : v_(r3.text, n3 - r3.from, false) + r3.from, o2 = n3 == r3.to ? n3 + 1 : v_(r3.text, n3 - r3.from, true) + r3.from;
return { changes: { from: i2, to: o2, insert: t2.doc.slice(n3, o2).append(t2.doc.slice(i2, n3)) }, range: T_.cursor(o2) };
});
return !r2.changes.empty && (n2(t2.update(r2, { scrollIntoView: true, userEvent: "move.character" })), true);
} }, { key: "Ctrl-v", run: HN }], CR = [{ key: "ArrowLeft", run: IN, shift: GN, preventDefault: true }, { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: function(e18) {
return RN(e18, !TN(e18));
}, shift: function(e18) {
return YN(e18, !TN(e18));
}, preventDefault: true }, { mac: "Cmd-ArrowLeft", run: function(e18) {
return EN(e18, function(t2) {
return JN(e18, t2, !TN(e18));
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return JN(e18, t2, !TN(e18));
});
}, preventDefault: true }, { key: "ArrowRight", run: NN, shift: QN, preventDefault: true }, { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: function(e18) {
return RN(e18, TN(e18));
}, shift: function(e18) {
return YN(e18, TN(e18));
}, preventDefault: true }, { mac: "Cmd-ArrowRight", run: function(e18) {
return EN(e18, function(t2) {
return JN(e18, t2, TN(e18));
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return JN(e18, t2, TN(e18));
});
}, preventDefault: true }, { key: "ArrowUp", run: BN, shift: XN, preventDefault: true }, { mac: "Cmd-ArrowUp", run: iR, shift: aR }, { mac: "Ctrl-ArrowUp", run: WN, shift: nR }, { key: "ArrowDown", run: qN, shift: eR, preventDefault: true }, { mac: "Cmd-ArrowDown", run: oR, shift: sR }, { mac: "Ctrl-ArrowDown", run: HN, shift: rR }, { key: "PageUp", run: WN, shift: nR }, { key: "PageDown", run: HN, shift: rR }, { key: "Home", run: function(e18) {
return EN(e18, function(t2) {
return JN(e18, t2, false);
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return JN(e18, t2, false);
});
}, preventDefault: true }, { key: "Mod-Home", run: iR, shift: aR }, { key: "End", run: function(e18) {
return EN(e18, function(t2) {
return JN(e18, t2, true);
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return JN(e18, t2, true);
});
}, preventDefault: true }, { key: "Mod-End", run: oR, shift: sR }, { key: "Enter", run: bR }, { key: "Mod-a", run: function(e18) {
var t2 = e18.state;
return (0, e18.dispatch)(t2.update({ selection: { anchor: 0, head: t2.doc.length }, userEvent: "select" })), true;
} }, { key: "Backspace", run: fR, shift: fR }, { key: "Delete", run: hR }, { key: "Mod-Backspace", mac: "Alt-Backspace", run: vR }, { key: "Mod-Delete", mac: "Alt-Delete", run: function(e18) {
return dR(e18, true);
} }, { mac: "Mod-Backspace", run: function(e18) {
return uR(e18, function(t2) {
var n2 = e18.lineBlockAt(t2).from;
return t2 > n2 ? n2 : Math.max(0, t2 - 1);
});
} }, { mac: "Mod-Delete", run: pR }].concat(_R.map(function(e18) {
return { mac: e18.key, run: e18.run, shift: e18.shift };
})), $R = [{ key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: function(e18) {
return EN(e18, function(t2) {
return LN(e18.state, t2, !TN(e18));
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return LN(e18.state, t2, !TN(e18));
});
} }, { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: function(e18) {
return EN(e18, function(t2) {
return LN(e18.state, t2, TN(e18));
});
}, shift: function(e18) {
return UN(e18, function(t2) {
return LN(e18.state, t2, TN(e18));
});
} }, { key: "Alt-ArrowUp", run: function(e18) {
return gR(e18.state, e18.dispatch, false);
} }, { key: "Shift-Alt-ArrowUp", run: function(e18) {
return yR(e18.state, e18.dispatch, false);
} }, { key: "Alt-ArrowDown", run: function(e18) {
return gR(e18.state, e18.dispatch, true);
} }, { key: "Shift-Alt-ArrowDown", run: function(e18) {
return yR(e18.state, e18.dispatch, true);
} }, { key: "Escape", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch, r2 = t2.selection, i2 = null;
return r2.ranges.length > 1 ? i2 = T_.create([r2.main]) : r2.main.empty || (i2 = T_.create([T_.cursor(r2.main.head)])), !!i2 && (n2(MN(t2, i2)), true);
} }, { key: "Mod-Enter", run: kR }, { key: "Alt-l", mac: "Ctrl-l", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch, r2 = mR(t2).map(function(e19) {
var n3 = e19.from, r3 = e19.to;
return T_.range(n3, Math.min(r3 + 1, t2.doc.length));
});
return n2(t2.update({ selection: T_.create(r2), userEvent: "select" })), true;
} }, { key: "Mod-i", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch, r2 = ON(t2.selection, function(e19) {
for (var n3, r3 = OT(t2).resolveInner(e19.head, 1); !(r3.from < e19.from && r3.to >= e19.to || r3.to > e19.to && r3.from <= e19.from) && (null === (n3 = r3.parent) || void 0 === n3 ? void 0 : n3.parent); )
r3 = r3.parent;
return T_.range(r3.to, r3.from);
});
return n2(MN(t2, r2)), true;
}, preventDefault: true }, { key: "Mod-[", run: SR }, { key: "Mod-]", run: xR }, { key: "Mod-Alt-\\", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch;
if (t2.readOnly)
return false;
var r2 = /* @__PURE__ */ Object.create(null), i2 = new WT(t2, { overrideIndentation: function(e19) {
var t3 = r2[e19];
return null == t3 ? -1 : t3;
} }), o2 = jR(t2, function(e19, n3, o3) {
var a2 = VT(i2, e19.from);
if (null != a2) {
/\S/.test(e19.text) || (a2 = 0);
var s2 = /^\s*/.exec(e19.text)[0], u2 = FT(t2, a2);
(s2 != u2 || o3.from < e19.from + s2.length) && (r2[e19.from] = a2, n3.push({ from: e19.from, to: e19.from + s2.length, insert: u2 }));
}
});
return o2.changes.empty || n2(t2.update(o2, { userEvent: "indent" })), true;
} }, { key: "Shift-Mod-k", run: function(e18) {
if (e18.state.readOnly)
return false;
var t2 = e18.state, n2 = t2.changes(mR(t2).map(function(e19) {
var n3 = e19.from, r3 = e19.to;
return n3 > 0 ? n3-- : r3 < t2.doc.length && r3++, { from: n3, to: r3 };
})), r2 = ON(t2.selection, function(t3) {
return e18.moveVertically(t3, true);
}).map(n2);
return e18.dispatch({ changes: n2, selection: r2, scrollIntoView: true, userEvent: "delete.line" }), true;
} }, { key: "Shift-Mod-\\", run: function(e18) {
return function(e19, t2, n2) {
var r2 = false, i2 = ON(e19.selection, function(t3) {
var i3 = NI(e19, t3.head, -1) || NI(e19, t3.head, 1) || t3.head > 0 && NI(e19, t3.head - 1, 1) || t3.head < e19.doc.length && NI(e19, t3.head + 1, -1);
if (!i3 || !i3.end)
return t3;
r2 = true;
var o2 = i3.start.from == t3.head ? i3.end.to : i3.end.from;
return n2 ? T_.range(t3.anchor, o2) : T_.cursor(o2);
});
return !!r2 && (t2(MN(e19, i2)), true);
}(e18.state, e18.dispatch, false);
} }, { key: "Mod-/", run: function(e18) {
var t2 = XI(e18.state);
return t2.line ? QI(e18) : !!t2.block && ZI(e18);
} }, { key: "Alt-A", run: YI }].concat(CR), OR = { key: "Tab", run: xR, shift: SR };
function MR() {
var e18 = arguments[0];
"string" == typeof e18 && (e18 = document.createElement(e18));
var t2 = 1, n2 = arguments[1];
if (n2 && "object" == zi(n2) && null == n2.nodeType && !Array.isArray(n2)) {
for (var r2 in n2)
if (Object.prototype.hasOwnProperty.call(n2, r2)) {
var i2 = n2[r2];
"string" == typeof i2 ? e18.setAttribute(r2, i2) : null != i2 && (e18[r2] = i2);
}
t2++;
}
for (; t2 < arguments.length; t2++)
ER(e18, arguments[t2]);
return e18;
}
function ER(e18, t2) {
if ("string" == typeof t2)
e18.appendChild(document.createTextNode(t2));
else if (null == t2)
;
else if (null != t2.nodeType)
e18.appendChild(t2);
else {
if (!Array.isArray(t2))
throw new RangeError("Unsupported child node: " + t2);
for (var n2 = 0; n2 < t2.length; n2++)
ER(e18, t2[n2]);
}
}
var PR = "function" == typeof String.prototype.normalize ? function(e18) {
return e18.normalize("NFKD");
} : function(e18) {
return e18;
}, AR = function() {
function e18(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : t2.length, o2 = arguments.length > 4 ? arguments[4] : void 0, a2 = arguments.length > 5 ? arguments[5] : void 0;
Ri(this, e18), this.test = a2, this.value = { from: 0, to: 0 }, this.done = false, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = t2.iterRange(r2, i2), this.bufferStart = r2, this.normalize = o2 ? function(e19) {
return o2(PR(e19));
} : PR, this.query = this.normalize(n2);
}
return Li(e18, [{ key: "peek", value: function() {
if (this.bufferPos == this.buffer.length) {
if (this.bufferStart += this.buffer.length, this.iter.next(), this.iter.done)
return -1;
this.bufferPos = 0, this.buffer = this.iter.value;
}
return b_(this.buffer, this.bufferPos);
} }, { key: "next", value: function() {
for (; this.matches.length; )
this.matches.pop();
return this.nextOverlapping();
} }, { key: "nextOverlapping", value: function() {
for (; ; ) {
var e19 = this.peek();
if (e19 < 0)
return this.done = true, this;
var t2 = k_(e19), n2 = this.bufferStart + this.bufferPos;
this.bufferPos += w_(e19);
for (var r2 = this.normalize(t2), i2 = 0, o2 = n2; ; i2++) {
var a2 = r2.charCodeAt(i2), s2 = this.match(a2, o2);
if (s2)
return this.value = s2, this;
if (i2 == r2.length - 1)
break;
o2 == n2 && i2 < t2.length && t2.charCodeAt(i2) == a2 && o2++;
}
}
} }, { key: "match", value: function(e19, t2) {
for (var n2 = null, r2 = 0; r2 < this.matches.length; r2 += 2) {
var i2 = this.matches[r2], o2 = false;
this.query.charCodeAt(i2) == e19 && (i2 == this.query.length - 1 ? n2 = { from: this.matches[r2 + 1], to: t2 + 1 } : (this.matches[r2]++, o2 = true)), o2 || (this.matches.splice(r2, 2), r2 -= 2);
}
return this.query.charCodeAt(0) == e19 && (1 == this.query.length ? n2 = { from: t2, to: t2 + 1 } : this.matches.push(1, t2)), n2 && this.test && !this.test(n2.from, n2.to, this.buffer, this.bufferPos) && (n2 = null), n2;
} }]), e18;
}();
"undefined" != typeof Symbol && (AR.prototype[Symbol.iterator] = function() {
return this;
});
var TR = { from: -1, to: -1, match: /.*/.exec("") }, IR = "gm" + (null == /x/.unicode ? "" : "u"), NR = function() {
function e18(t2, n2, r2) {
var i2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, o2 = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : t2.length;
if (Ri(this, e18), this.text = t2, this.to = o2, this.curLine = "", this.done = false, this.value = TR, /\\[sWDnr]|\n|\r|\[\^/.test(n2))
return new LR(t2, n2, r2, i2, o2);
this.re = new RegExp(n2, IR + ((null == r2 ? void 0 : r2.ignoreCase) ? "i" : "")), this.test = null == r2 ? void 0 : r2.test, this.iter = t2.iter();
var a2 = t2.lineAt(i2);
this.curLineStart = a2.from, this.matchPos = zR(t2, i2), this.getLine(this.curLineStart);
}
return Li(e18, [{ key: "getLine", value: function(e19) {
this.iter.next(e19), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
} }, { key: "nextLine", value: function() {
this.curLineStart = this.curLineStart + this.curLine.length + 1, this.curLineStart > this.to ? this.curLine = "" : this.getLine(0);
} }, { key: "next", value: function() {
for (var e19 = this.matchPos - this.curLineStart; ; ) {
this.re.lastIndex = e19;
var t2 = this.matchPos <= this.to && this.re.exec(this.curLine);
if (t2) {
var n2 = this.curLineStart + t2.index, r2 = n2 + t2[0].length;
if (this.matchPos = zR(this.text, r2 + (n2 == r2 ? 1 : 0)), n2 == this.curLine.length && this.nextLine(), (n2 < r2 || n2 > this.value.to) && (!this.test || this.test(n2, r2, t2)))
return this.value = { from: n2, to: r2, match: t2 }, this;
e19 = this.matchPos - this.curLineStart;
} else {
if (!(this.curLineStart + this.curLine.length < this.to))
return this.done = true, this;
this.nextLine(), e19 = 0;
}
}
} }]), e18;
}(), RR = /* @__PURE__ */ new WeakMap(), DR = function() {
function e18(t2, n2) {
Ri(this, e18), this.from = t2, this.text = n2;
}
return Li(e18, [{ key: "to", get: function() {
return this.from + this.text.length;
} }], [{ key: "get", value: function(t2, n2, r2) {
var i2 = RR.get(t2);
if (!i2 || i2.from >= r2 || i2.to <= n2) {
var o2 = new e18(n2, t2.sliceString(n2, r2));
return RR.set(t2, o2), o2;
}
if (i2.from == n2 && i2.to == r2)
return i2;
var a2 = i2.text, s2 = i2.from;
return s2 > n2 && (a2 = t2.sliceString(n2, s2) + a2, s2 = n2), i2.to < r2 && (a2 += t2.sliceString(i2.to, r2)), RR.set(t2, new e18(s2, a2)), new e18(n2, a2.slice(n2 - s2, r2 - s2));
} }]), e18;
}(), LR = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.text = t2, this.to = o2, this.done = false, this.value = TR, this.matchPos = zR(t2, i2), this.re = new RegExp(n2, IR + ((null == r2 ? void 0 : r2.ignoreCase) ? "i" : "")), this.test = null == r2 ? void 0 : r2.test, this.flat = DR.get(t2, i2, this.chunkEnd(i2 + 5e3));
}
return Li(e18, [{ key: "chunkEnd", value: function(e19) {
return e19 >= this.to ? this.to : this.text.lineAt(e19).to;
} }, { key: "next", value: function() {
for (; ; ) {
var e19 = this.re.lastIndex = this.matchPos - this.flat.from, t2 = this.re.exec(this.flat.text);
if (t2 && !t2[0] && t2.index == e19 && (this.re.lastIndex = e19 + 1, t2 = this.re.exec(this.flat.text)), t2) {
var n2 = this.flat.from + t2.index, r2 = n2 + t2[0].length;
if ((this.flat.to >= this.to || t2.index + t2[0].length <= this.flat.text.length - 10) && (!this.test || this.test(n2, r2, t2)))
return this.value = { from: n2, to: r2, match: t2 }, this.matchPos = zR(this.text, r2 + (n2 == r2 ? 1 : 0)), this;
}
if (this.flat.to == this.to)
return this.done = true, this;
this.flat = DR.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + 2 * this.flat.text.length));
}
} }]), e18;
}();
function zR(e18, t2) {
if (t2 >= e18.length)
return t2;
for (var n2, r2 = e18.lineAt(t2); t2 < r2.to && (n2 = r2.text.charCodeAt(t2 - r2.from)) >= 56320 && n2 < 57344; )
t2++;
return t2;
}
function BR(e18) {
var t2 = MR("input", { class: "cm-textfield", name: "line" });
function n2() {
var n3 = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t2.value);
if (n3) {
var r2 = e18.state, i2 = r2.doc.lineAt(r2.selection.main.head), o2 = ki(n3, 5), a2 = o2[1], s2 = o2[2], u2 = o2[3], c2 = o2[4], l2 = u2 ? +u2.slice(1) : 0, f2 = s2 ? +s2 : i2.number;
if (s2 && c2) {
var h2 = f2 / 100;
a2 && (h2 = h2 * ("-" == a2 ? -1 : 1) + i2.number / r2.doc.lines), f2 = Math.round(r2.doc.lines * h2);
} else
s2 && a2 && (f2 = f2 * ("-" == a2 ? -1 : 1) + i2.number);
var d2 = r2.doc.line(Math.max(1, Math.min(r2.doc.lines, f2)));
e18.dispatch({ effects: qR.of(false), selection: T_.cursor(d2.from + Math.max(0, Math.min(l2, d2.length))), scrollIntoView: true }), e18.focus();
}
}
return { dom: MR("form", { class: "cm-gotoLine", onkeydown: function(t3) {
27 == t3.keyCode ? (t3.preventDefault(), e18.dispatch({ effects: qR.of(false) }), e18.focus()) : 13 == t3.keyCode && (t3.preventDefault(), n2());
}, onsubmit: function(e19) {
e19.preventDefault(), n2();
} }, MR("label", e18.state.phrase("Go to line"), ": ", t2), " ", MR("button", { class: "cm-button", type: "submit" }, e18.state.phrase("go"))) };
}
"undefined" != typeof Symbol && (NR.prototype[Symbol.iterator] = LR.prototype[Symbol.iterator] = function() {
return this;
});
var qR = fC.define(), FR = F_.define({ create: function() {
return true;
}, update: function(e18, t2) {
var n2, r2 = bi(t2.effects);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
i2.is(qR) && (e18 = i2.value);
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
return e18;
}, provide: function(e18) {
return YP.from(e18, function(e19) {
return e19 ? BR : null;
});
} }), VR = LE.baseTheme({ ".cm-panel.cm-gotoLine": { padding: "2px 6px 4px", "& label": { fontSize: "80%" } } }), WR = { highlightWordAroundCursor: false, minSelectionLength: 1, maxMatches: 100, wholeWords: false }, HR = R_.define({ combine: function(e18) {
return SC(e18, WR, { highlightWordAroundCursor: function(e19, t2) {
return e19 || t2;
}, minSelectionLength: Math.min, maxMatches: Math.min });
} });
var JR = iO.mark({ class: "cm-selectionMatch" }), UR = iO.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
function KR(e18, t2, n2, r2) {
return !(0 != n2 && e18(t2.sliceDoc(n2 - 1, n2)) == kC.Word || r2 != t2.doc.length && e18(t2.sliceDoc(r2, r2 + 1)) == kC.Word);
}
var GR = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.decorations = this.getDeco(t2);
}
return Li(e18, [{ key: "update", value: function(e19) {
(e19.selectionSet || e19.docChanged || e19.viewportChanged) && (this.decorations = this.getDeco(e19.view));
} }, { key: "getDeco", value: function(e19) {
var t2 = e19.state.facet(HR), n2 = e19.state, r2 = n2.selection;
if (r2.ranges.length > 1)
return iO.none;
var i2, o2 = r2.main, a2 = null;
if (o2.empty) {
if (!t2.highlightWordAroundCursor)
return iO.none;
var s2 = n2.wordAt(o2.head);
if (!s2)
return iO.none;
a2 = n2.charCategorizer(o2.head), i2 = n2.sliceDoc(s2.from, s2.to);
} else {
var u2 = o2.to - o2.from;
if (u2 < t2.minSelectionLength || u2 > 200)
return iO.none;
if (t2.wholeWords) {
if (i2 = n2.sliceDoc(o2.from, o2.to), !KR(a2 = n2.charCategorizer(o2.head), n2, o2.from, o2.to) || !function(e20, t3, n3, r3) {
return e20(t3.sliceDoc(n3, n3 + 1)) == kC.Word && e20(t3.sliceDoc(r3 - 1, r3)) == kC.Word;
}(a2, n2, o2.from, o2.to))
return iO.none;
} else if (!(i2 = n2.sliceDoc(o2.from, o2.to).trim()))
return iO.none;
}
var c2, l2 = [], f2 = bi(e19.visibleRanges);
try {
for (f2.s(); !(c2 = f2.n()).done; )
for (var h2 = c2.value, d2 = new AR(n2.doc, i2, h2.from, h2.to); !d2.next().done; ) {
var v2 = d2.value, p2 = v2.from, m2 = v2.to;
if ((!a2 || KR(a2, n2, p2, m2)) && (o2.empty && p2 <= o2.from && m2 >= o2.to ? l2.push(UR.range(p2, m2)) : (p2 >= o2.to || m2 <= o2.from) && l2.push(JR.range(p2, m2)), l2.length > t2.maxMatches))
return iO.none;
}
} catch (e20) {
f2.e(e20);
} finally {
f2.f();
}
return iO.set(l2);
} }]), e18;
}(), { decorations: function(e18) {
return e18.decorations;
} }), QR = LE.baseTheme({ ".cm-selectionMatch": { backgroundColor: "#99ff7780" }, ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" } });
var YR = R_.define({ combine: function(e18) {
return SC(e18, { top: false, caseSensitive: false, literal: false, wholeWord: false, createPanel: function(e19) {
return new _D(e19);
} });
} });
function ZR(e18) {
return e18 ? [YR.of(e18), ED] : ED;
}
var XR = function() {
function e18(t2) {
Ri(this, e18), this.search = t2.search, this.caseSensitive = !!t2.caseSensitive, this.literal = !!t2.literal, this.regexp = !!t2.regexp, this.replace = t2.replace || "", this.valid = !!this.search && (!this.regexp || function(e19) {
try {
return new RegExp(e19, IR), true;
} catch (e20) {
return false;
}
}(this.search)), this.unquoted = this.literal ? this.search : this.search.replace(/\\([nrt\\])/g, function(e19, t3) {
return "n" == t3 ? "\n" : "r" == t3 ? "\r" : "t" == t3 ? " " : "\\";
}), this.wholeWord = !!t2.wholeWord;
}
return Li(e18, [{ key: "eq", value: function(e19) {
return this.search == e19.search && this.replace == e19.replace && this.caseSensitive == e19.caseSensitive && this.regexp == e19.regexp && this.wholeWord == e19.wholeWord;
} }, { key: "create", value: function() {
return this.regexp ? new aD(this) : new nD(this);
} }, { key: "getCursor", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n2 = arguments.length > 2 ? arguments[2] : void 0, r2 = e19.doc ? e19 : xC.create({ doc: e19 });
return null == n2 && (n2 = r2.doc.length), this.regexp ? rD(this, r2, t2, n2) : tD(this, r2, t2, n2);
} }]), e18;
}(), eD = Li(function e9(t2) {
Ri(this, e9), this.spec = t2;
});
function tD(e18, t2, n2, r2) {
return new AR(t2.doc, e18.unquoted, n2, r2, e18.caseSensitive ? void 0 : function(e19) {
return e19.toLowerCase();
}, e18.wholeWord ? function(e19, t3) {
return function(n3, r3, i2, o2) {
return (o2 > n3 || o2 + i2.length < r3) && (o2 = Math.max(0, n3 - 2), i2 = e19.sliceString(o2, Math.min(e19.length, r3 + 2))), !(t3(iD(i2, n3 - o2)) == kC.Word && t3(oD(i2, n3 - o2)) == kC.Word || t3(oD(i2, r3 - o2)) == kC.Word && t3(iD(i2, r3 - o2)) == kC.Word);
};
}(t2.doc, t2.charCategorizer(t2.selection.main.head)) : void 0);
}
var nD = function(e18) {
Ci(n2, eD);
var t2 = Oi(n2);
function n2(e19) {
return Ri(this, n2), t2.call(this, e19);
}
return Li(n2, [{ key: "nextMatch", value: function(e19, t3, n3) {
var r2 = tD(this.spec, e19, n3, e19.doc.length).nextOverlapping();
return r2.done && (r2 = tD(this.spec, e19, 0, t3).nextOverlapping()), r2.done ? null : r2.value;
} }, { key: "prevMatchInRange", value: function(e19, t3, n3) {
for (var r2 = n3; ; ) {
for (var i2 = Math.max(t3, r2 - 1e4 - this.spec.unquoted.length), o2 = tD(this.spec, e19, i2, r2), a2 = null; !o2.nextOverlapping().done; )
a2 = o2.value;
if (a2)
return a2;
if (i2 == t3)
return null;
r2 -= 1e4;
}
} }, { key: "prevMatch", value: function(e19, t3, n3) {
return this.prevMatchInRange(e19, 0, t3) || this.prevMatchInRange(e19, n3, e19.doc.length);
} }, { key: "getReplacement", value: function(e19) {
return this.spec.replace;
} }, { key: "matchAll", value: function(e19, t3) {
for (var n3 = tD(this.spec, e19, 0, e19.doc.length), r2 = []; !n3.next().done; ) {
if (r2.length >= t3)
return null;
r2.push(n3.value);
}
return r2;
} }, { key: "highlight", value: function(e19, t3, n3, r2) {
for (var i2 = tD(this.spec, e19, Math.max(0, t3 - this.spec.unquoted.length), Math.min(n3 + this.spec.unquoted.length, e19.doc.length)); !i2.next().done; )
r2(i2.value.from, i2.value.to);
} }]), n2;
}();
function rD(e18, t2, n2, r2) {
return new NR(t2.doc, e18.search, { ignoreCase: !e18.caseSensitive, test: e18.wholeWord ? (i2 = t2.charCategorizer(t2.selection.main.head), function(e19, t3, n3) {
return !n3[0].length || (i2(iD(n3.input, n3.index)) != kC.Word || i2(oD(n3.input, n3.index)) != kC.Word) && (i2(oD(n3.input, n3.index + n3[0].length)) != kC.Word || i2(iD(n3.input, n3.index + n3[0].length)) != kC.Word);
}) : void 0 }, n2, r2);
var i2;
}
function iD(e18, t2) {
return e18.slice(v_(e18, t2, false), t2);
}
function oD(e18, t2) {
return e18.slice(t2, v_(e18, t2));
}
var aD = function(e18) {
Ci(n2, eD);
var t2 = Oi(n2);
function n2() {
return Ri(this, n2), t2.apply(this, arguments);
}
return Li(n2, [{ key: "nextMatch", value: function(e19, t3, n3) {
var r2 = rD(this.spec, e19, n3, e19.doc.length).next();
return r2.done && (r2 = rD(this.spec, e19, 0, t3).next()), r2.done ? null : r2.value;
} }, { key: "prevMatchInRange", value: function(e19, t3, n3) {
for (var r2 = 1; ; r2++) {
for (var i2 = Math.max(t3, n3 - 1e4 * r2), o2 = rD(this.spec, e19, i2, n3), a2 = null; !o2.next().done; )
a2 = o2.value;
if (a2 && (i2 == t3 || a2.from > i2 + 10))
return a2;
if (i2 == t3)
return null;
}
} }, { key: "prevMatch", value: function(e19, t3, n3) {
return this.prevMatchInRange(e19, 0, t3) || this.prevMatchInRange(e19, n3, e19.doc.length);
} }, { key: "getReplacement", value: function(e19) {
return this.spec.replace.replace(/\$([$&\d+])/g, function(t3, n3) {
return "$" == n3 ? "$" : "&" == n3 ? e19.match[0] : "0" != n3 && +n3 < e19.match.length ? e19.match[n3] : t3;
});
} }, { key: "matchAll", value: function(e19, t3) {
for (var n3 = rD(this.spec, e19, 0, e19.doc.length), r2 = []; !n3.next().done; ) {
if (r2.length >= t3)
return null;
r2.push(n3.value);
}
return r2;
} }, { key: "highlight", value: function(e19, t3, n3, r2) {
for (var i2 = rD(this.spec, e19, Math.max(0, t3 - 250), Math.min(n3 + 250, e19.doc.length)); !i2.next().done; )
r2(i2.value.from, i2.value.to);
} }]), n2;
}(), sD = fC.define(), uD = fC.define(), cD = F_.define({ create: function(e18) {
return new lD(wD(e18).create(), null);
}, update: function(e18, t2) {
var n2, r2 = bi(t2.effects);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
i2.is(sD) ? e18 = new lD(i2.value.create(), e18.panel) : i2.is(uD) && (e18 = new lD(e18.query, i2.value ? kD : null));
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
return e18;
}, provide: function(e18) {
return YP.from(e18, function(e19) {
return e19.panel;
});
} }), lD = Li(function e10(t2, n2) {
Ri(this, e10), this.query = t2, this.panel = n2;
}), fD = iO.mark({ class: "cm-searchMatch" }), hD = iO.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), dD = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.decorations = this.highlight(t2.state.field(cD));
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2 = e19.state.field(cD);
(t2 != e19.startState.field(cD) || e19.docChanged || e19.selectionSet || e19.viewportChanged) && (this.decorations = this.highlight(t2));
} }, { key: "highlight", value: function(e19) {
var t2 = e19.query;
if (!e19.panel || !t2.spec.valid)
return iO.none;
for (var n2 = this.view, r2 = new PC(), i2 = 0, o2 = n2.visibleRanges, a2 = o2.length; i2 < a2; i2++) {
for (var s2 = o2[i2], u2 = s2.from, c2 = s2.to; i2 < a2 - 1 && c2 > o2[i2 + 1].from - 500; )
c2 = o2[++i2].to;
t2.highlight(n2.state, u2, c2, function(e20, t3) {
var i3 = n2.state.selection.ranges.some(function(n3) {
return n3.from == e20 && n3.to == t3;
});
r2.add(e20, t3, i3 ? hD : fD);
});
}
return r2.finish();
} }]), e18;
}(), { decorations: function(e18) {
return e18.decorations;
} });
function vD(e18) {
return function(t2) {
var n2 = t2.state.field(cD, false);
return n2 && n2.query.spec.valid ? e18(t2, n2) : jD(t2);
};
}
var pD = vD(function(e18, t2) {
var n2 = t2.query, r2 = e18.state.selection.main.to, i2 = n2.nextMatch(e18.state, r2, r2);
return !!i2 && (e18.dispatch({ selection: { anchor: i2.from, head: i2.to }, scrollIntoView: true, effects: OD(e18, i2), userEvent: "select.search" }), true);
}), mD = vD(function(e18, t2) {
var n2 = t2.query, r2 = e18.state, i2 = r2.selection.main.from, o2 = n2.prevMatch(r2, i2, i2);
return !!o2 && (e18.dispatch({ selection: { anchor: o2.from, head: o2.to }, scrollIntoView: true, effects: OD(e18, o2), userEvent: "select.search" }), true);
}), gD = vD(function(e18, t2) {
var n2 = t2.query.matchAll(e18.state, 1e3);
return !(!n2 || !n2.length) && (e18.dispatch({ selection: T_.create(n2.map(function(e19) {
return T_.range(e19.from, e19.to);
})), userEvent: "select.search.matches" }), true);
}), yD = vD(function(e18, t2) {
var n2 = t2.query, r2 = e18.state, i2 = r2.selection.main, o2 = i2.from, a2 = i2.to;
if (r2.readOnly)
return false;
var s2 = n2.nextMatch(r2, o2, o2);
if (!s2)
return false;
var u2, c2, l2 = [], f2 = [];
if (s2.from == o2 && s2.to == a2 && (c2 = r2.toText(n2.getReplacement(s2)), l2.push({ from: s2.from, to: s2.to, insert: c2 }), s2 = n2.nextMatch(r2, s2.from, s2.to), f2.push(LE.announce.of(r2.phrase("replaced match on line $", r2.doc.lineAt(o2).number) + "."))), s2) {
var h2 = 0 == l2.length || l2[0].from >= s2.to ? 0 : s2.to - s2.from - c2.length;
u2 = { anchor: s2.from - h2, head: s2.to - h2 }, f2.push(OD(e18, s2));
}
return e18.dispatch({ changes: l2, selection: u2, scrollIntoView: !!u2, effects: f2, userEvent: "input.replace" }), true;
}), bD = vD(function(e18, t2) {
var n2 = t2.query;
if (e18.state.readOnly)
return false;
var r2 = n2.matchAll(e18.state, 1e9).map(function(e19) {
return { from: e19.from, to: e19.to, insert: n2.getReplacement(e19) };
});
if (!r2.length)
return false;
var i2 = e18.state.phrase("replaced $ matches", r2.length) + ".";
return e18.dispatch({ changes: r2, effects: LE.announce.of(i2), userEvent: "input.replace.all" }), true;
});
function kD(e18) {
return e18.state.facet(YR).createPanel(e18);
}
function wD(e18, t2) {
var n2, r2, i2, o2, a2 = e18.selection.main, s2 = a2.empty || a2.to > a2.from + 100 ? "" : e18.sliceDoc(a2.from, a2.to);
if (t2 && !s2)
return t2;
var u2 = e18.facet(YR);
return new XR({ search: (null !== (n2 = null == t2 ? void 0 : t2.literal) && void 0 !== n2 ? n2 : u2.literal) ? s2 : s2.replace(/\n/g, "\\n"), caseSensitive: null !== (r2 = null == t2 ? void 0 : t2.caseSensitive) && void 0 !== r2 ? r2 : u2.caseSensitive, literal: null !== (i2 = null == t2 ? void 0 : t2.literal) && void 0 !== i2 ? i2 : u2.literal, wholeWord: null !== (o2 = null == t2 ? void 0 : t2.wholeWord) && void 0 !== o2 ? o2 : u2.wholeWord });
}
var jD = function(e18) {
var t2 = e18.state.field(cD, false);
if (t2 && t2.panel) {
var n2 = UP(e18, kD);
if (!n2)
return false;
var r2 = n2.dom.querySelector("[main-field]");
if (r2 && r2 != e18.root.activeElement) {
var i2 = wD(e18.state, t2.query.spec);
i2.valid && e18.dispatch({ effects: sD.of(i2) }), r2.focus(), r2.select();
}
} else
e18.dispatch({ effects: [uD.of(true), t2 ? sD.of(wD(e18.state, t2.query.spec)) : fC.appendConfig.of(ED)] });
return true;
}, xD = function(e18) {
var t2 = e18.state.field(cD, false);
if (!t2 || !t2.panel)
return false;
var n2 = UP(e18, kD);
return n2 && n2.dom.contains(e18.root.activeElement) && e18.focus(), e18.dispatch({ effects: uD.of(false) }), true;
}, SD = [{ key: "Mod-f", run: jD, scope: "editor search-panel" }, { key: "F3", run: pD, shift: mD, scope: "editor search-panel", preventDefault: true }, { key: "Mod-g", run: pD, shift: mD, scope: "editor search-panel", preventDefault: true }, { key: "Escape", run: xD, scope: "editor search-panel" }, { key: "Mod-Shift-l", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch, r2 = t2.selection;
if (r2.ranges.length > 1 || r2.main.empty)
return false;
for (var i2 = r2.main, o2 = i2.from, a2 = i2.to, s2 = [], u2 = 0, c2 = new AR(t2.doc, t2.sliceDoc(o2, a2)); !c2.next().done; ) {
if (s2.length > 1e3)
return false;
c2.value.from == o2 && (u2 = s2.length), s2.push(T_.range(c2.value.from, c2.value.to));
}
return n2(t2.update({ selection: T_.create(s2, u2), userEvent: "select.search.matches" })), true;
} }, { key: "Alt-g", run: function(e18) {
var t2 = UP(e18, BR);
if (!t2) {
var n2 = [qR.of(true)];
null == e18.state.field(FR, false) && n2.push(fC.appendConfig.of([FR, VR])), e18.dispatch({ effects: n2 }), t2 = UP(e18, BR);
}
return t2 && t2.dom.querySelector("input").focus(), true;
} }, { key: "Mod-d", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch, r2 = t2.selection.ranges;
if (r2.some(function(e19) {
return e19.from === e19.to;
}))
return function(e19) {
var t3 = e19.state, n3 = e19.dispatch, r3 = t3.selection, i3 = T_.create(r3.ranges.map(function(e20) {
return t3.wordAt(e20.head) || T_.cursor(e20.head);
}), r3.mainIndex);
return !i3.eq(r3) && (n3(t3.update({ selection: i3 })), true);
}({ state: t2, dispatch: n2 });
var i2 = t2.sliceDoc(r2[0].from, r2[0].to);
if (t2.selection.ranges.some(function(e19) {
return t2.sliceDoc(e19.from, e19.to) != i2;
}))
return false;
var o2 = function(e19, t3) {
for (var n3 = e19.selection, r3 = n3.main, i3 = n3.ranges, o3 = e19.wordAt(r3.head), a2 = o3 && o3.from == r3.from && o3.to == r3.to, s2 = function(n4, r4) {
if (r4.next(), !r4.done) {
if (n4 && i3.some(function(e20) {
return e20.from == r4.value.from;
}))
return c2 = r4, u2 = n4, "continue";
if (a2) {
var o4 = e19.wordAt(r4.value.from);
if (!o4 || o4.from != r4.value.from || o4.to != r4.value.to)
return c2 = r4, u2 = n4, "continue";
}
return u2 = n4, c2 = r4, { v: r4.value };
}
if (n4)
return c2 = r4, u2 = n4, { v: null };
r4 = new AR(e19.doc, t3, 0, Math.max(0, i3[i3.length - 1].from - 1)), u2 = n4 = true, c2 = r4;
}, u2 = false, c2 = new AR(e19.doc, t3, i3[i3.length - 1].to); ; ) {
var l2 = s2(u2, c2);
if ("continue" !== l2 && "object" === zi(l2))
return l2.v;
}
}(t2, i2);
return !!o2 && (n2(t2.update({ selection: t2.selection.addRange(T_.range(o2.from, o2.to), false), effects: LE.scrollIntoView(o2.to) })), true);
}, preventDefault: true }], _D = function() {
function e18(t2) {
var n2 = this;
Ri(this, e18), this.view = t2;
var r2 = this.query = t2.state.field(cD).query.spec;
function i2(e19, t3, n3) {
return MR("button", { class: "cm-button", name: e19, onclick: t3, type: "button" }, n3);
}
this.commit = this.commit.bind(this), this.searchField = MR("input", { value: r2.search, placeholder: CD(t2, "Find"), "aria-label": CD(t2, "Find"), class: "cm-textfield", name: "search", "main-field": "true", onchange: this.commit, onkeyup: this.commit }), this.replaceField = MR("input", { value: r2.replace, placeholder: CD(t2, "Replace"), "aria-label": CD(t2, "Replace"), class: "cm-textfield", name: "replace", onchange: this.commit, onkeyup: this.commit }), this.caseField = MR("input", { type: "checkbox", name: "case", checked: r2.caseSensitive, onchange: this.commit }), this.reField = MR("input", { type: "checkbox", name: "re", checked: r2.regexp, onchange: this.commit }), this.wordField = MR("input", { type: "checkbox", name: "word", checked: r2.wholeWord, onchange: this.commit }), this.dom = MR("div", { onkeydown: function(e19) {
return n2.keydown(e19);
}, class: "cm-search" }, [this.searchField, i2("next", function() {
return pD(t2);
}, [CD(t2, "next")]), i2("prev", function() {
return mD(t2);
}, [CD(t2, "previous")]), i2("select", function() {
return gD(t2);
}, [CD(t2, "all")]), MR("label", null, [this.caseField, CD(t2, "match case")]), MR("label", null, [this.reField, CD(t2, "regexp")]), MR("label", null, [this.wordField, CD(t2, "by word")])].concat(Ti(t2.state.readOnly ? [] : [MR("br"), this.replaceField, i2("replace", function() {
return yD(t2);
}, [CD(t2, "replace")]), i2("replaceAll", function() {
return bD(t2);
}, [CD(t2, "replace all")]), MR("button", { name: "close", onclick: function() {
return xD(t2);
}, "aria-label": CD(t2, "close"), type: "button" }, ["\xD7"])])));
}
return Li(e18, [{ key: "commit", value: function() {
var e19 = new XR({ search: this.searchField.value, caseSensitive: this.caseField.checked, regexp: this.reField.checked, wholeWord: this.wordField.checked, replace: this.replaceField.value });
e19.eq(this.query) || (this.query = e19, this.view.dispatch({ effects: sD.of(e19) }));
} }, { key: "keydown", value: function(e19) {
var t2, n2, r2;
t2 = this.view, n2 = e19, r2 = "search-panel", YE(GE(t2.state), n2, t2, r2) ? e19.preventDefault() : 13 == e19.keyCode && e19.target == this.searchField ? (e19.preventDefault(), (e19.shiftKey ? mD : pD)(this.view)) : 13 == e19.keyCode && e19.target == this.replaceField && (e19.preventDefault(), yD(this.view));
} }, { key: "update", value: function(e19) {
var t2, n2 = bi(e19.transactions);
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
var r2, i2 = bi(t2.value.effects);
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value;
o2.is(sD) && !o2.value.eq(this.query) && this.setQuery(o2.value);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
} }, { key: "setQuery", value: function(e19) {
this.query = e19, this.searchField.value = e19.search, this.replaceField.value = e19.replace, this.caseField.checked = e19.caseSensitive, this.reField.checked = e19.regexp, this.wordField.checked = e19.wholeWord;
} }, { key: "mount", value: function() {
this.searchField.select();
} }, { key: "pos", get: function() {
return 80;
} }, { key: "top", get: function() {
return this.view.state.facet(YR).top;
} }]), e18;
}();
function CD(e18, t2) {
return e18.state.phrase(t2);
}
var $D = /[\s\.,:;?!]/;
function OD(e18, t2) {
var n2 = t2.from, r2 = t2.to, i2 = e18.state.doc.lineAt(n2), o2 = e18.state.doc.lineAt(r2).to, a2 = Math.max(i2.from, n2 - 30), s2 = Math.min(o2, r2 + 30), u2 = e18.state.sliceDoc(a2, s2);
if (a2 != i2.from) {
for (var c2 = 0; c2 < 30; c2++)
if (!$D.test(u2[c2 + 1]) && $D.test(u2[c2])) {
u2 = u2.slice(c2);
break;
}
}
if (s2 != o2) {
for (var l2 = u2.length - 1; l2 > u2.length - 30; l2--)
if (!$D.test(u2[l2 - 1]) && $D.test(u2[l2])) {
u2 = u2.slice(0, l2);
break;
}
}
return LE.announce.of("".concat(e18.state.phrase("current match"), ". ").concat(u2, " ").concat(e18.state.phrase("on line"), " ").concat(i2.number, "."));
}
var MD = LE.baseTheme({ ".cm-panel.cm-search": { padding: "2px 6px 4px", position: "relative", "& [name=close]": { position: "absolute", top: "0", right: "4px", backgroundColor: "inherit", border: "none", font: "inherit", padding: 0, margin: 0 }, "& input, & button, & label": { margin: ".2em .6em .2em 0" }, "& input[type=checkbox]": { marginRight: ".2em" }, "& label": { fontSize: "80%", whiteSpace: "pre" } }, "&light .cm-searchMatch": { backgroundColor: "#ffff0054" }, "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" }, "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" }, "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" } }), ED = [cD, K_.lowest(dD), MD], PD = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.state = t2, this.pos = n2, this.explicit = r2, this.abortListeners = [];
}
return Li(e18, [{ key: "tokenBefore", value: function(e19) {
for (var t2 = OT(this.state).resolveInner(this.pos, -1); t2 && e19.indexOf(t2.name) < 0; )
t2 = t2.parent;
return t2 ? { from: t2.from, to: this.pos, text: this.state.sliceDoc(t2.from, this.pos), type: t2.type } : null;
} }, { key: "matchBefore", value: function(e19) {
var t2 = this.state.doc.lineAt(this.pos), n2 = Math.max(t2.from, this.pos - 250), r2 = t2.text.slice(n2 - t2.from, this.pos - t2.from), i2 = r2.search(RD(e19, false));
return i2 < 0 ? null : { from: n2 + i2, to: this.pos, text: r2.slice(i2) };
} }, { key: "aborted", get: function() {
return null == this.abortListeners;
} }, { key: "addEventListener", value: function(e19, t2) {
"abort" == e19 && this.abortListeners && this.abortListeners.push(t2);
} }]), e18;
}();
function AD(e18) {
var t2 = Object.keys(e18).join(""), n2 = /\w/.test(t2);
return n2 && (t2 = t2.replace(/\w/g, "")), "[".concat(n2 ? "\\w" : "").concat(t2.replace(/[^\w\s]/g, "\\$&"), "]");
}
function TD(e18) {
var t2 = e18.map(function(e19) {
return "string" == typeof e19 ? { label: e19 } : e19;
}), n2 = t2.every(function(e19) {
return /^\w+$/.test(e19.label);
}) ? [/\w*$/, /\w+$/] : function(e19) {
var t3, n3 = /* @__PURE__ */ Object.create(null), r3 = /* @__PURE__ */ Object.create(null), i3 = bi(e19);
try {
for (i3.s(); !(t3 = i3.n()).done; ) {
var o3 = t3.value.label;
n3[o3[0]] = true;
for (var a2 = 1; a2 < o3.length; a2++)
r3[o3[a2]] = true;
}
} catch (e20) {
i3.e(e20);
} finally {
i3.f();
}
var s2 = AD(n3) + AD(r3) + "*$";
return [new RegExp("^" + s2), new RegExp(s2)];
}(t2), r2 = ki(n2, 2), i2 = r2[0], o2 = r2[1];
return function(e19) {
var n3 = e19.matchBefore(o2);
return n3 || e19.explicit ? { from: n3 ? n3.from : e19.pos, options: t2, validFor: i2 } : null;
};
}
var ID = Li(function e11(t2, n2, r2) {
Ri(this, e11), this.completion = t2, this.source = n2, this.match = r2;
});
function ND(e18) {
return e18.selection.main.head;
}
function RD(e18, t2) {
var n2, r2 = e18.source, i2 = t2 && "^" != r2[0], o2 = "$" != r2[r2.length - 1];
return i2 || o2 ? new RegExp("".concat(i2 ? "^" : "", "(?:").concat(r2, ")").concat(o2 ? "$" : ""), null !== (n2 = e18.flags) && void 0 !== n2 ? n2 : e18.ignoreCase ? "i" : "") : e18;
}
function DD(e18, t2) {
var n2 = t2.completion.apply || t2.completion.label, r2 = t2.source;
"string" == typeof n2 ? e18.dispatch(function(e19, t3, n3, r3) {
return Object.assign(Object.assign({}, e19.changeByRange(function(i2) {
if (i2 == e19.selection.main)
return { changes: { from: n3, to: r3, insert: t3 }, range: T_.cursor(n3 + t3.length) };
var o2 = r3 - n3;
return !i2.empty || o2 && e19.sliceDoc(i2.from - o2, i2.from) != e19.sliceDoc(n3, r3) ? { range: i2 } : { changes: { from: i2.from - o2, to: i2.from, insert: t3 }, range: T_.cursor(i2.from - o2 + t3.length) };
})), { userEvent: "input.complete" });
}(e18.state, n2, r2.from, r2.to)) : n2(e18, t2.completion, r2.from, r2.to);
}
var LD = /* @__PURE__ */ new WeakMap();
function zD(e18) {
if (!Array.isArray(e18))
return e18;
var t2 = LD.get(e18);
return t2 || LD.set(e18, t2 = TD(e18)), t2;
}
var BD = function() {
function e18(t2) {
Ri(this, e18), this.pattern = t2, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [];
for (var n2 = 0; n2 < t2.length; ) {
var r2 = b_(t2, n2), i2 = w_(r2);
this.chars.push(r2);
var o2 = t2.slice(n2, n2 + i2), a2 = o2.toUpperCase();
this.folded.push(b_(a2 == o2 ? o2.toLowerCase() : a2, 0)), n2 += i2;
}
this.astral = t2.length != this.chars.length;
}
return Li(e18, [{ key: "match", value: function(e19) {
if (0 == this.pattern.length)
return [0];
if (e19.length < this.pattern.length)
return null;
var t2 = this.chars, n2 = this.folded, r2 = this.any, i2 = this.precise, o2 = this.byWord;
if (1 == t2.length) {
var a2 = b_(e19, 0);
return a2 == t2[0] ? [0, 0, w_(a2)] : a2 == n2[0] ? [-200, 0, w_(a2)] : null;
}
var s2 = e19.indexOf(this.pattern);
if (0 == s2)
return [0, 0, this.pattern.length];
var u2 = t2.length, c2 = 0;
if (s2 < 0) {
for (var l2 = 0, f2 = Math.min(e19.length, 200); l2 < f2 && c2 < u2; ) {
var h2 = b_(e19, l2);
h2 != t2[c2] && h2 != n2[c2] || (r2[c2++] = l2), l2 += w_(h2);
}
if (c2 < u2)
return null;
}
for (var d2 = 0, v2 = 0, p2 = false, m2 = 0, g2 = -1, y2 = -1, b2 = /[a-z]/.test(e19), k2 = true, w2 = 0, j2 = Math.min(e19.length, 200), x2 = 0; w2 < j2 && v2 < u2; ) {
var S2 = b_(e19, w2);
s2 < 0 && (d2 < u2 && S2 == t2[d2] && (i2[d2++] = w2), m2 < u2 && (S2 == t2[m2] || S2 == n2[m2] ? (0 == m2 && (g2 = w2), y2 = w2 + 1, m2++) : m2 = 0));
var _2 = void 0, C2 = S2 < 255 ? S2 >= 48 && S2 <= 57 || S2 >= 97 && S2 <= 122 ? 2 : S2 >= 65 && S2 <= 90 ? 1 : 0 : (_2 = k_(S2)) != _2.toLowerCase() ? 1 : _2 != _2.toUpperCase() ? 2 : 0;
(!w2 || 1 == C2 && b2 || 0 == x2 && 0 != C2) && (t2[v2] == S2 || n2[v2] == S2 && (p2 = true) ? o2[v2++] = w2 : o2.length && (k2 = false)), x2 = C2, w2 += w_(S2);
}
return v2 == u2 && 0 == o2[0] && k2 ? this.result((p2 ? -200 : 0) - 100, o2, e19) : m2 == u2 && 0 == g2 ? [-200 - e19.length, 0, y2] : s2 > -1 ? [-700 - e19.length, s2, s2 + this.pattern.length] : m2 == u2 ? [-900 - e19.length, g2, y2] : v2 == u2 ? this.result((p2 ? -200 : 0) - 100 - 700 + (k2 ? 0 : -1100), o2, e19) : 2 == t2.length ? null : this.result((r2[0] ? -700 : 0) - 200 - 1100, r2, e19);
} }, { key: "result", value: function(e19, t2, n2) {
var r2, i2 = [e19 - n2.length], o2 = 1, a2 = bi(t2);
try {
for (a2.s(); !(r2 = a2.n()).done; ) {
var s2 = r2.value, u2 = s2 + (this.astral ? w_(b_(n2, s2)) : 1);
o2 > 1 && i2[o2 - 1] == s2 ? i2[o2 - 1] = u2 : (i2[o2++] = s2, i2[o2++] = u2);
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
return i2;
} }]), e18;
}(), qD = R_.define({ combine: function(e18) {
return SC(e18, { activateOnTyping: true, selectOnOpen: true, override: null, closeOnBlur: true, maxRenderedOptions: 100, defaultKeymap: true, optionClass: function() {
return "";
}, aboveCursor: false, icons: true, addToOptions: [], compareCompletions: function(e19, t2) {
return e19.label.localeCompare(t2.label);
} }, { defaultKeymap: function(e19, t2) {
return e19 && t2;
}, closeOnBlur: function(e19, t2) {
return e19 && t2;
}, icons: function(e19, t2) {
return e19 && t2;
}, optionClass: function(e19, t2) {
return function(n2) {
return function(e20, t3) {
return e20 ? t3 ? e20 + " " + t3 : e20 : t3;
}(e19(n2), t2(n2));
};
}, addToOptions: function(e19, t2) {
return e19.concat(t2);
} });
} });
function FD(e18, t2, n2) {
if (e18 <= n2)
return { from: 0, to: e18 };
if (t2 < 0 && (t2 = 0), t2 <= e18 >> 1) {
var r2 = Math.floor(t2 / n2);
return { from: r2 * n2, to: (r2 + 1) * n2 };
}
var i2 = Math.floor((e18 - t2) / n2);
return { from: e18 - (i2 + 1) * n2, to: e18 - i2 * n2 };
}
var VD = function() {
function e18(t2, n2) {
var r2 = this;
Ri(this, e18), this.view = t2, this.stateField = n2, this.info = null, this.placeInfo = { read: function() {
return r2.measureInfo();
}, write: function(e19) {
return r2.positionInfo(e19);
}, key: this };
var i2 = t2.state.field(n2), o2 = i2.open, a2 = o2.options, s2 = o2.selected, u2 = t2.state.facet(qD);
this.optionContent = function(e19) {
var t3 = e19.addToOptions.slice();
return e19.icons && t3.push({ render: function(e20) {
var t4, n3 = document.createElement("div");
return n3.classList.add("cm-completionIcon"), e20.type && (t4 = n3.classList).add.apply(t4, Ti(e20.type.split(/\s+/g).map(function(e21) {
return "cm-completionIcon-" + e21;
}))), n3.setAttribute("aria-hidden", "true"), n3;
}, position: 20 }), t3.push({ render: function(e20, t4, n3) {
var r3 = document.createElement("span");
r3.className = "cm-completionLabel";
for (var i3 = e20.label, o3 = 0, a3 = 1; a3 < n3.length; ) {
var s3 = n3[a3++], u3 = n3[a3++];
s3 > o3 && r3.appendChild(document.createTextNode(i3.slice(o3, s3)));
var c2 = r3.appendChild(document.createElement("span"));
c2.appendChild(document.createTextNode(i3.slice(s3, u3))), c2.className = "cm-completionMatchedText", o3 = u3;
}
return o3 < i3.length && r3.appendChild(document.createTextNode(i3.slice(o3))), r3;
}, position: 50 }, { render: function(e20) {
if (!e20.detail)
return null;
var t4 = document.createElement("span");
return t4.className = "cm-completionDetail", t4.textContent = e20.detail, t4;
}, position: 80 }), t3.sort(function(e20, t4) {
return e20.position - t4.position;
}).map(function(e20) {
return e20.render;
});
}(u2), this.optionClass = u2.optionClass, this.range = FD(a2.length, s2, u2.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.dom.addEventListener("mousedown", function(e19) {
for (var n3, i3 = e19.target; i3 && i3 != r2.dom; i3 = i3.parentNode)
if ("LI" == i3.nodeName && (n3 = /-(\d+)$/.exec(i3.id)) && +n3[1] < a2.length)
return DD(t2, a2[+n3[1]]), void e19.preventDefault();
}), this.list = this.dom.appendChild(this.createListBox(a2, i2.id, this.range)), this.list.addEventListener("scroll", function() {
r2.info && r2.view.requestMeasure(r2.placeInfo);
});
}
return Li(e18, [{ key: "mount", value: function() {
this.updateSel();
} }, { key: "update", value: function(e19) {
e19.state.field(this.stateField) != e19.startState.field(this.stateField) && this.updateSel();
} }, { key: "positioned", value: function() {
this.info && this.view.requestMeasure(this.placeInfo);
} }, { key: "updateSel", value: function() {
var e19 = this, t2 = this.view.state.field(this.stateField), n2 = t2.open;
if ((n2.selected < this.range.from || n2.selected >= this.range.to) && (this.range = FD(n2.options.length, n2.selected, this.view.state.facet(qD).maxRenderedOptions), this.list.remove(), this.list = this.dom.appendChild(this.createListBox(n2.options, t2.id, this.range)), this.list.addEventListener("scroll", function() {
e19.info && e19.view.requestMeasure(e19.placeInfo);
})), this.updateSelectedOption(n2.selected)) {
this.info && (this.info.remove(), this.info = null);
var r2 = n2.options[n2.selected].completion, i2 = r2.info;
if (!i2)
return;
var o2 = "string" == typeof i2 ? document.createTextNode(i2) : i2(r2);
if (!o2)
return;
"then" in o2 ? o2.then(function(n3) {
n3 && e19.view.state.field(e19.stateField, false) == t2 && e19.addInfoPane(n3);
}).catch(function(t3) {
return SO(e19.view.state, t3, "completion info");
}) : this.addInfoPane(o2);
}
} }, { key: "addInfoPane", value: function(e19) {
var t2 = this.info = document.createElement("div");
t2.className = "cm-tooltip cm-completionInfo", t2.appendChild(e19), this.dom.appendChild(t2), this.view.requestMeasure(this.placeInfo);
} }, { key: "updateSelectedOption", value: function(e19) {
for (var t2 = null, n2 = this.list.firstChild, r2 = this.range.from; n2; n2 = n2.nextSibling, r2++)
r2 == e19 ? n2.hasAttribute("aria-selected") || (n2.setAttribute("aria-selected", "true"), t2 = n2) : n2.hasAttribute("aria-selected") && n2.removeAttribute("aria-selected");
return t2 && function(e20, t3) {
var n3 = e20.getBoundingClientRect(), r3 = t3.getBoundingClientRect();
r3.top < n3.top ? e20.scrollTop -= n3.top - r3.top : r3.bottom > n3.bottom && (e20.scrollTop += r3.bottom - n3.bottom);
}(this.list, t2), t2;
} }, { key: "measureInfo", value: function() {
var e19 = this.dom.querySelector("[aria-selected]");
if (!e19 || !this.info)
return null;
var t2 = this.dom.getBoundingClientRect(), n2 = this.info.getBoundingClientRect(), r2 = e19.getBoundingClientRect();
if (r2.top > Math.min(innerHeight, t2.bottom) - 10 || r2.bottom < Math.max(0, t2.top) + 10)
return null;
var i2 = Math.max(0, Math.min(r2.top, innerHeight - n2.height)) - t2.top, o2 = this.view.textDirection == LO.RTL, a2 = t2.left, s2 = innerWidth - t2.right;
return o2 && a2 < Math.min(n2.width, s2) ? o2 = false : !o2 && s2 < Math.min(n2.width, a2) && (o2 = true), { top: i2, left: o2 };
} }, { key: "positionInfo", value: function(e19) {
this.info && (this.info.style.top = (e19 ? e19.top : -1e6) + "px", e19 && (this.info.classList.toggle("cm-completionInfo-left", e19.left), this.info.classList.toggle("cm-completionInfo-right", !e19.left)));
} }, { key: "createListBox", value: function(e19, t2, n2) {
var r2 = document.createElement("ul");
r2.id = t2, r2.setAttribute("role", "listbox"), r2.setAttribute("aria-expanded", "true"), r2.setAttribute("aria-label", this.view.state.phrase("Completions"));
for (var i2 = n2.from; i2 < n2.to; i2++) {
var o2 = e19[i2], a2 = o2.completion, s2 = o2.match, u2 = r2.appendChild(document.createElement("li"));
u2.id = t2 + "-" + i2, u2.setAttribute("role", "option");
var c2 = this.optionClass(a2);
c2 && (u2.className = c2);
var l2, f2 = bi(this.optionContent);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
var h2 = (0, l2.value)(a2, this.view.state, s2);
h2 && u2.appendChild(h2);
}
} catch (e20) {
f2.e(e20);
} finally {
f2.f();
}
}
return n2.from && r2.classList.add("cm-completionListIncompleteTop"), n2.to < e19.length && r2.classList.add("cm-completionListIncompleteBottom"), r2;
} }]), e18;
}();
function WD(e18) {
return 100 * (e18.boost || 0) + (e18.apply ? 10 : 0) + (e18.info ? 5 : 0) + (e18.type ? 1 : 0);
}
var HD = function() {
function e18(t2, n2, r2, i2, o2) {
Ri(this, e18), this.options = t2, this.attrs = n2, this.tooltip = r2, this.timestamp = i2, this.selected = o2;
}
return Li(e18, [{ key: "setSelected", value: function(t2, n2) {
return t2 == this.selected || t2 >= this.options.length ? this : new e18(this.options, KD(n2, t2), this.tooltip, this.timestamp, t2);
} }, { key: "map", value: function(t2) {
return new e18(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: t2.mapPos(this.tooltip.pos) }), this.timestamp, this.selected);
} }], [{ key: "build", value: function(t2, n2, r2, i2, o2) {
var a2 = function(e19, t3) {
var n3, r3 = [], i3 = 0, o3 = bi(e19);
try {
for (o3.s(); !(n3 = o3.n()).done; ) {
var a3 = n3.value;
if (a3.hasResult())
if (false === a3.result.filter) {
var s3, u3 = a3.result.getMatch, c3 = bi(a3.result.options);
try {
for (c3.s(); !(s3 = c3.n()).done; ) {
var l3 = s3.value, f2 = [1e9 - i3++];
if (u3) {
var h2, d2 = bi(u3(l3));
try {
for (d2.s(); !(h2 = d2.n()).done; ) {
var v2 = h2.value;
f2.push(v2);
}
} catch (e20) {
d2.e(e20);
} finally {
d2.f();
}
}
r3.push(new ID(l3, a3, f2));
}
} catch (e20) {
c3.e(e20);
} finally {
c3.f();
}
} else {
var p2, m2 = new BD(t3.sliceDoc(a3.from, a3.to)), g2 = void 0, y2 = bi(a3.result.options);
try {
for (y2.s(); !(p2 = y2.n()).done; ) {
var b2 = p2.value;
(g2 = m2.match(b2.label)) && (null != b2.boost && (g2[0] += b2.boost), r3.push(new ID(b2, a3, g2)));
}
} catch (e20) {
y2.e(e20);
} finally {
y2.f();
}
}
}
} catch (e20) {
o3.e(e20);
} finally {
o3.f();
}
var k2, w2 = [], j2 = null, x2 = t3.facet(qD).compareCompletions, S2 = bi(r3.sort(function(e20, t4) {
return t4.match[0] - e20.match[0] || x2(e20.completion, t4.completion);
}));
try {
for (S2.s(); !(k2 = S2.n()).done; ) {
var _2 = k2.value;
!j2 || j2.label != _2.completion.label || j2.detail != _2.completion.detail || null != j2.type && null != _2.completion.type && j2.type != _2.completion.type || j2.apply != _2.completion.apply ? w2.push(_2) : WD(_2.completion) > WD(j2) && (w2[w2.length - 1] = _2), j2 = _2.completion;
}
} catch (e20) {
S2.e(e20);
} finally {
S2.f();
}
return w2;
}(t2, n2);
if (!a2.length)
return null;
var s2, u2 = n2.facet(qD).selectOnOpen ? 0 : -1;
if (i2 && i2.selected != u2 && -1 != i2.selected) {
for (var c2 = i2.options[i2.selected].completion, l2 = 0; l2 < a2.length; l2++)
if (a2[l2].completion == c2) {
u2 = l2;
break;
}
}
return new e18(a2, KD(r2, u2), { pos: t2.reduce(function(e19, t3) {
return t3.hasResult() ? Math.min(e19, t3.from) : e19;
}, 1e8), create: (s2 = rL, function(e19) {
return new VD(e19, s2);
}), above: o2.aboveCursor }, i2 ? i2.timestamp : Date.now(), u2);
} }]), e18;
}(), JD = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.active = t2, this.id = n2, this.open = r2;
}
return Li(e18, [{ key: "update", value: function(t2) {
var n2 = this, r2 = t2.state, i2 = r2.facet(qD), o2 = (i2.override || r2.languageDataAt("autocomplete", ND(r2)).map(zD)).map(function(e19) {
return (n2.active.find(function(t3) {
return t3.source == e19;
}) || new YD(e19, n2.active.some(function(e20) {
return 0 != e20.state;
}) ? 1 : 0)).update(t2, i2);
});
o2.length == this.active.length && o2.every(function(e19, t3) {
return e19 == n2.active[t3];
}) && (o2 = this.active);
var a2 = t2.selection || o2.some(function(e19) {
return e19.hasResult() && t2.changes.touchesRange(e19.from, e19.to);
}) || !function(e19, t3) {
if (e19 == t3)
return true;
for (var n3 = 0, r3 = 0; ; ) {
for (; n3 < e19.length && !e19[n3].hasResult; )
n3++;
for (; r3 < t3.length && !t3[r3].hasResult; )
r3++;
var i3 = n3 == e19.length, o3 = r3 == t3.length;
if (i3 || o3)
return i3 == o3;
if (e19[n3++].result != t3[r3++].result)
return false;
}
}(o2, this.active) ? HD.build(o2, r2, this.id, this.open, i2) : this.open && t2.docChanged ? this.open.map(t2.changes) : this.open;
!a2 && o2.every(function(e19) {
return 1 != e19.state;
}) && o2.some(function(e19) {
return e19.hasResult();
}) && (o2 = o2.map(function(e19) {
return e19.hasResult() ? new YD(e19.source, 0) : e19;
}));
var s2, u2 = bi(t2.effects);
try {
for (u2.s(); !(s2 = u2.n()).done; ) {
var c2 = s2.value;
c2.is(nL) && (a2 = a2 && a2.setSelected(c2.value, this.id));
}
} catch (e19) {
u2.e(e19);
} finally {
u2.f();
}
return o2 == this.active && a2 == this.open ? this : new e18(o2, this.id, a2);
} }, { key: "tooltip", get: function() {
return this.open ? this.open.tooltip : null;
} }, { key: "attrs", get: function() {
return this.open ? this.open.attrs : UD;
} }], [{ key: "start", value: function() {
return new e18(GD, "cm-ac-" + Math.floor(2e6 * Math.random()).toString(36), null);
} }]), e18;
}();
var UD = { "aria-autocomplete": "list" };
function KD(e18, t2) {
var n2 = { "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-controls": e18 };
return t2 > -1 && (n2["aria-activedescendant"] = e18 + "-" + t2), n2;
}
var GD = [];
function QD(e18) {
return e18.isUserEvent("input.type") ? "input" : e18.isUserEvent("delete.backward") ? "delete" : null;
}
var YD = function() {
function e18(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -1;
Ri(this, e18), this.source = t2, this.state = n2, this.explicitPos = r2;
}
return Li(e18, [{ key: "hasResult", value: function() {
return false;
} }, { key: "update", value: function(t2, n2) {
var r2 = QD(t2), i2 = this;
r2 ? i2 = i2.handleUserEvent(t2, r2, n2) : t2.docChanged ? i2 = i2.handleChange(t2) : t2.selection && 0 != i2.state && (i2 = new e18(i2.source, 0));
var o2, a2 = bi(t2.effects);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
if (s2.is(XD))
i2 = new e18(i2.source, 1, s2.value ? ND(t2.state) : -1);
else if (s2.is(eL))
i2 = new e18(i2.source, 0);
else if (s2.is(tL)) {
var u2, c2 = bi(s2.value);
try {
for (c2.s(); !(u2 = c2.n()).done; ) {
var l2 = u2.value;
l2.source == i2.source && (i2 = l2);
}
} catch (e19) {
c2.e(e19);
} finally {
c2.f();
}
}
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
return i2;
} }, { key: "handleUserEvent", value: function(t2, n2, r2) {
return "delete" != n2 && r2.activateOnTyping ? new e18(this.source, 1) : this.map(t2.changes);
} }, { key: "handleChange", value: function(t2) {
return t2.changes.touchesRange(ND(t2.startState)) ? new e18(this.source, 0) : this.map(t2.changes);
} }, { key: "map", value: function(t2) {
return t2.empty || this.explicitPos < 0 ? this : new e18(this.source, this.state, t2.mapPos(this.explicitPos));
} }]), e18;
}(), ZD = function(e18) {
Ci(n2, YD);
var t2 = Oi(n2);
function n2(e19, r2, i2, o2, a2) {
var s2;
return Ri(this, n2), (s2 = t2.call(this, e19, 2, r2)).result = i2, s2.from = o2, s2.to = a2, s2;
}
return Li(n2, [{ key: "hasResult", value: function() {
return true;
} }, { key: "handleUserEvent", value: function(e19, t3, r2) {
var i2, o2 = e19.changes.mapPos(this.from), a2 = e19.changes.mapPos(this.to, 1), s2 = ND(e19.state);
if ((this.explicitPos < 0 ? s2 <= o2 : s2 < this.from) || s2 > a2 || "delete" == t3 && ND(e19.startState) == this.from)
return new YD(this.source, "input" == t3 && r2.activateOnTyping ? 1 : 0);
var u2, c2 = this.explicitPos < 0 ? -1 : e19.changes.mapPos(this.explicitPos);
return function(e20, t4, n3, r3) {
if (!e20)
return false;
var i3 = t4.sliceDoc(n3, r3);
return "function" == typeof e20 ? e20(i3, n3, r3, t4) : RD(e20, true).test(i3);
}(this.result.validFor, e19.state, o2, a2) ? new n2(this.source, c2, this.result, o2, a2) : this.result.update && (u2 = this.result.update(this.result, o2, a2, new PD(e19.state, s2, c2 >= 0))) ? new n2(this.source, c2, u2, u2.from, null !== (i2 = u2.to) && void 0 !== i2 ? i2 : ND(e19.state)) : new YD(this.source, 1, c2);
} }, { key: "handleChange", value: function(e19) {
return e19.changes.touchesRange(this.from, this.to) ? new YD(this.source, 0) : this.map(e19.changes);
} }, { key: "map", value: function(e19) {
return e19.empty ? this : new n2(this.source, this.explicitPos < 0 ? -1 : e19.mapPos(this.explicitPos), this.result, e19.mapPos(this.from), e19.mapPos(this.to, 1));
} }]), n2;
}();
var XD = fC.define(), eL = fC.define(), tL = fC.define({ map: function(e18, t2) {
return e18.map(function(e19) {
return e19.map(t2);
});
} }), nL = fC.define(), rL = F_.define({ create: function() {
return JD.start();
}, update: function(e18, t2) {
return e18.update(t2);
}, provide: function(e18) {
return [LP.from(e18, function(e19) {
return e19.tooltip;
}), LE.contentAttributes.from(e18, function(e19) {
return e19.attrs;
})];
} });
function iL(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "option";
return function(n2) {
var r2 = n2.state.field(rL, false);
if (!r2 || !r2.open || Date.now() - r2.open.timestamp < 75)
return false;
var i2, o2 = 1;
"page" == t2 && (i2 = WP(n2, r2.open.tooltip)) && (o2 = Math.max(2, Math.floor(i2.dom.offsetHeight / i2.dom.querySelector("li").offsetHeight) - 1));
var a2 = r2.open.options.length, s2 = r2.open.selected > -1 ? r2.open.selected + o2 * (e18 ? 1 : -1) : e18 ? 0 : a2 - 1;
return s2 < 0 ? s2 = "page" == t2 ? 0 : a2 - 1 : s2 >= a2 && (s2 = "page" == t2 ? a2 - 1 : 0), n2.dispatch({ effects: nL.of(s2) }), true;
};
}
var oL = Li(function e12(t2, n2) {
Ri(this, e12), this.active = t2, this.context = n2, this.time = Date.now(), this.updates = [], this.done = void 0;
}), aL = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.composing = 0;
var n2, r2 = bi(t2.state.field(rL).active);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
1 == i2.state && this.startQuery(i2);
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
}
return Li(e18, [{ key: "update", value: function(e19) {
var t2 = this, n2 = e19.state.field(rL);
if (e19.selectionSet || e19.docChanged || e19.startState.field(rL) != n2) {
for (var r2 = e19.transactions.some(function(e20) {
return (e20.selection || e20.docChanged) && !QD(e20);
}), i2 = 0; i2 < this.running.length; i2++) {
var o2 = this.running[i2];
if (r2 || o2.updates.length + e19.transactions.length > 50 && Date.now() - o2.time > 1e3) {
var a2, s2 = bi(o2.context.abortListeners);
try {
for (s2.s(); !(a2 = s2.n()).done; ) {
var u2 = a2.value;
try {
u2();
} catch (e20) {
SO(this.view.state, e20);
}
}
} catch (e20) {
s2.e(e20);
} finally {
s2.f();
}
o2.context.abortListeners = null, this.running.splice(i2--, 1);
} else {
var c2;
(c2 = o2.updates).push.apply(c2, Ti(e19.transactions));
}
}
if (this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), this.debounceUpdate = n2.active.some(function(e20) {
return 1 == e20.state && !t2.running.some(function(t3) {
return t3.active.source == e20.source;
});
}) ? setTimeout(function() {
return t2.startUpdate();
}, 50) : -1, 0 != this.composing) {
var l2, f2 = bi(e19.transactions);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
var h2 = l2.value;
"input" == QD(h2) ? this.composing = 2 : 2 == this.composing && h2.selection && (this.composing = 3);
}
} catch (e20) {
f2.e(e20);
} finally {
f2.f();
}
}
}
} }, { key: "startUpdate", value: function() {
var e19 = this;
this.debounceUpdate = -1;
var t2, n2 = bi(this.view.state.field(rL).active);
try {
var r2 = function() {
var n3 = t2.value;
1 != n3.state || e19.running.some(function(e20) {
return e20.active.source == n3.source;
}) || e19.startQuery(n3);
};
for (n2.s(); !(t2 = n2.n()).done; )
r2();
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
} }, { key: "startQuery", value: function(e19) {
var t2 = this, n2 = this.view.state, r2 = ND(n2), i2 = new PD(n2, r2, e19.explicitPos == r2), o2 = new oL(e19, i2);
this.running.push(o2), Promise.resolve(e19.source(i2)).then(function(e20) {
o2.context.aborted || (o2.done = e20 || null, t2.scheduleAccept());
}, function(e20) {
t2.view.dispatch({ effects: eL.of(null) }), SO(t2.view.state, e20);
});
} }, { key: "scheduleAccept", value: function() {
var e19 = this;
this.running.every(function(e20) {
return void 0 !== e20.done;
}) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(function() {
return e19.accept();
}, 50));
} }, { key: "accept", value: function() {
var e19, t2 = this;
this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1;
for (var n2 = [], r2 = this.view.state.facet(qD), i2 = function(i3) {
var a2 = t2.running[i3];
if (void 0 === a2.done)
return o2 = i3, "continue";
if (t2.running.splice(i3--, 1), a2.done) {
var s2, u2 = new ZD(a2.active.source, a2.active.explicitPos, a2.done, a2.done.from, null !== (e19 = a2.done.to) && void 0 !== e19 ? e19 : ND(a2.updates.length ? a2.updates[0].startState : t2.view.state)), c2 = bi(a2.updates);
try {
for (c2.s(); !(s2 = c2.n()).done; ) {
var l2 = s2.value;
u2 = u2.update(l2, r2);
}
} catch (e20) {
c2.e(e20);
} finally {
c2.f();
}
if (u2.hasResult())
return n2.push(u2), o2 = i3, "continue";
}
var f2 = t2.view.state.field(rL).active.find(function(e20) {
return e20.source == a2.active.source;
});
if (f2 && 1 == f2.state)
if (null == a2.done) {
var h2, d2 = new YD(a2.active.source, 0), v2 = bi(a2.updates);
try {
for (v2.s(); !(h2 = v2.n()).done; ) {
var p2 = h2.value;
d2 = d2.update(p2, r2);
}
} catch (e20) {
v2.e(e20);
} finally {
v2.f();
}
1 != d2.state && n2.push(d2);
} else
t2.startQuery(f2);
o2 = i3;
}, o2 = 0; o2 < this.running.length; o2++)
i2(o2);
n2.length && this.view.dispatch({ effects: tL.of(n2) });
} }]), e18;
}(), { eventHandlers: { blur: function() {
var e18 = this.view.state.field(rL, false);
e18 && e18.tooltip && this.view.state.facet(qD).closeOnBlur && this.view.dispatch({ effects: eL.of(null) });
}, compositionstart: function() {
this.composing = 1;
}, compositionend: function() {
var e18 = this;
3 == this.composing && setTimeout(function() {
return e18.view.dispatch({ effects: XD.of(false) });
}, 20), this.composing = 0;
} } }), sL = LE.baseTheme({ ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": { fontFamily: "monospace", whiteSpace: "nowrap", overflow: "hidden auto", maxWidth_fallback: "700px", maxWidth: "min(700px, 95vw)", minWidth: "250px", maxHeight: "10em", listStyle: "none", margin: 0, padding: 0, "& > li": { overflowX: "hidden", textOverflow: "ellipsis", cursor: "pointer", padding: "1px 3px", lineHeight: 1.2 } } }, "&light .cm-tooltip-autocomplete ul li[aria-selected]": { background: "#17c", color: "white" }, "&dark .cm-tooltip-autocomplete ul li[aria-selected]": { background: "#347", color: "white" }, ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": { content: '"\xB7\xB7\xB7"', opacity: 0.5, display: "block", textAlign: "center" }, ".cm-tooltip.cm-completionInfo": { position: "absolute", padding: "3px 9px", width: "max-content", maxWidth: "300px" }, ".cm-completionInfo.cm-completionInfo-left": { right: "100%" }, ".cm-completionInfo.cm-completionInfo-right": { left: "100%" }, "&light .cm-snippetField": { backgroundColor: "#00000022" }, "&dark .cm-snippetField": { backgroundColor: "#ffffff22" }, ".cm-snippetFieldPosition": { verticalAlign: "text-top", width: 0, height: "1.15em", margin: "0 -0.7px -.7em", borderLeft: "1.4px dotted #888" }, ".cm-completionMatchedText": { textDecoration: "underline" }, ".cm-completionDetail": { marginLeft: "0.5em", fontStyle: "italic" }, ".cm-completionIcon": { fontSize: "90%", width: ".8em", display: "inline-block", textAlign: "center", paddingRight: ".6em", opacity: "0.6" }, ".cm-completionIcon-function, .cm-completionIcon-method": { "&:after": { content: "'\u0192'" } }, ".cm-completionIcon-class": { "&:after": { content: "'\u25CB'" } }, ".cm-completionIcon-interface": { "&:after": { content: "'\u25CC'" } }, ".cm-completionIcon-variable": { "&:after": { content: "'\u{1D465}'" } }, ".cm-completionIcon-constant": { "&:after": { content: "'\u{1D436}'" } }, ".cm-completionIcon-type": { "&:after": { content: "'\u{1D461}'" } }, ".cm-completionIcon-enum": { "&:after": { content: "'\u222A'" } }, ".cm-completionIcon-property": { "&:after": { content: "'\u25A1'" } }, ".cm-completionIcon-keyword": { "&:after": { content: "'\u{1F511}\uFE0E'" } }, ".cm-completionIcon-namespace": { "&:after": { content: "'\u25A2'" } }, ".cm-completionIcon-text": { "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" } } }), uL = { brackets: ["(", "[", "{", "'", '"'], before: ")]}:;>" }, cL = fC.define({ map: function(e18, t2) {
var n2 = t2.mapPos(e18, -1, x_.TrackAfter);
return null == n2 ? void 0 : n2;
} }), lL = fC.define({ map: function(e18, t2) {
return t2.mapPos(e18);
} }), fL = new (function(e18) {
Ci(n2, _C);
var t2 = Oi(n2);
function n2() {
return Ri(this, n2), t2.apply(this, arguments);
}
return Li(n2);
}())();
fL.startSide = 1, fL.endSide = -1;
var hL = F_.define({ create: function() {
return MC.empty;
}, update: function(e18, t2) {
if (t2.selection) {
var n2 = t2.state.doc.lineAt(t2.selection.main.head).from, r2 = t2.startState.doc.lineAt(t2.startState.selection.main.head).from;
n2 != t2.changes.mapPos(r2, -1) && (e18 = MC.empty);
}
e18 = e18.map(t2.changes);
var i2, o2 = bi(t2.effects);
try {
var a2 = function() {
var t3 = i2.value;
t3.is(cL) ? e18 = e18.update({ add: [fL.range(t3.value, t3.value + 1)] }) : t3.is(lL) && (e18 = e18.update({ filter: function(e19) {
return e19 != t3.value;
} }));
};
for (o2.s(); !(i2 = o2.n()).done; )
a2();
} catch (e19) {
o2.e(e19);
} finally {
o2.f();
}
return e18;
} });
function dL(e18) {
for (var t2 = 0; t2 < "()[]{}<>".length; t2 += 2)
if ("()[]{}<>".charCodeAt(t2) == e18)
return "()[]{}<>".charAt(t2 + 1);
return k_(e18 < 128 ? e18 : e18 + 1);
}
function vL(e18, t2) {
return e18.languageDataAt("closeBrackets", t2)[0] || uL;
}
var pL = "object" == ("undefined" == typeof navigator ? "undefined" : zi(navigator)) && /Android\b/.test(navigator.userAgent), mL = LE.inputHandler.of(function(e18, t2, n2, r2) {
if ((pL ? e18.composing : e18.compositionStarted) || e18.state.readOnly)
return false;
var i2 = e18.state.selection.main;
if (r2.length > 2 || 2 == r2.length && 1 == w_(b_(r2, 0)) || t2 != i2.from || n2 != i2.to)
return false;
var o2 = function(e19, t3) {
var n3, r3 = vL(e19, e19.selection.main.head), i3 = r3.brackets || uL.brackets, o3 = bi(i3);
try {
for (o3.s(); !(n3 = o3.n()).done; ) {
var a2 = n3.value, s2 = dL(b_(a2, 0));
if (t3 == a2)
return s2 == a2 ? jL(e19, a2, i3.indexOf(a2 + a2 + a2) > -1) : kL(e19, a2, s2, r3.before || uL.before);
if (t3 == s2 && yL(e19, e19.selection.main.from))
return wL(e19, a2, s2);
}
} catch (e20) {
o3.e(e20);
} finally {
o3.f();
}
return null;
}(e18.state, r2);
return !!o2 && (e18.dispatch(o2), true);
}), gL = [{ key: "Backspace", run: function(e18) {
var t2 = e18.state, n2 = e18.dispatch;
if (t2.readOnly)
return false;
var r2 = vL(t2, t2.selection.main.head).brackets || uL.brackets, i2 = null, o2 = t2.changeByRange(function(e19) {
if (e19.empty) {
var n3, o3 = function(e20, t3) {
var n4 = e20.sliceString(t3 - 2, t3);
return w_(b_(n4, 0)) == n4.length ? n4 : n4.slice(1);
}(t2.doc, e19.head), a2 = bi(r2);
try {
for (a2.s(); !(n3 = a2.n()).done; ) {
var s2 = n3.value;
if (s2 == o3 && bL(t2.doc, e19.head) == dL(b_(s2, 0)))
return { changes: { from: e19.head - s2.length, to: e19.head + s2.length }, range: T_.cursor(e19.head - s2.length), userEvent: "delete.backward" };
}
} catch (e20) {
a2.e(e20);
} finally {
a2.f();
}
}
return { range: i2 = e19 };
});
return i2 || n2(t2.update(o2, { scrollIntoView: true })), !i2;
} }];
function yL(e18, t2) {
var n2 = false;
return e18.field(hL).between(0, e18.doc.length, function(e19) {
e19 == t2 && (n2 = true);
}), n2;
}
function bL(e18, t2) {
var n2 = e18.sliceString(t2, t2 + 2);
return n2.slice(0, w_(b_(n2, 0)));
}
function kL(e18, t2, n2, r2) {
var i2 = null, o2 = e18.changeByRange(function(o3) {
if (!o3.empty)
return { changes: [{ insert: t2, from: o3.from }, { insert: n2, from: o3.to }], effects: cL.of(o3.to + t2.length), range: T_.range(o3.anchor + t2.length, o3.head + t2.length) };
var a2 = bL(e18.doc, o3.head);
return !a2 || /\s/.test(a2) || r2.indexOf(a2) > -1 ? { changes: { insert: t2 + n2, from: o3.head }, effects: cL.of(o3.head + t2.length), range: T_.cursor(o3.head + t2.length) } : { range: i2 = o3 };
});
return i2 ? null : e18.update(o2, { scrollIntoView: true, userEvent: "input.type" });
}
function wL(e18, t2, n2) {
var r2 = null, i2 = e18.selection.ranges.map(function(t3) {
return t3.empty && bL(e18.doc, t3.head) == n2 ? T_.cursor(t3.head + n2.length) : r2 = t3;
});
return r2 ? null : e18.update({ selection: T_.create(i2, e18.selection.mainIndex), scrollIntoView: true, effects: e18.selection.ranges.map(function(e19) {
var t3 = e19.from;
return lL.of(t3);
}) });
}
function jL(e18, t2, n2) {
var r2 = null, i2 = e18.changeByRange(function(i3) {
if (!i3.empty)
return { changes: [{ insert: t2, from: i3.from }, { insert: t2, from: i3.to }], effects: cL.of(i3.to + t2.length), range: T_.range(i3.anchor + t2.length, i3.head + t2.length) };
var o2 = i3.head, a2 = bL(e18.doc, o2);
if (a2 == t2) {
if (xL(e18, o2))
return { changes: { insert: t2 + t2, from: o2 }, effects: cL.of(o2 + t2.length), range: T_.cursor(o2 + t2.length) };
if (yL(e18, o2)) {
var s2 = n2 && e18.sliceDoc(o2, o2 + 3 * t2.length) == t2 + t2 + t2;
return { range: T_.cursor(o2 + t2.length * (s2 ? 3 : 1)), effects: lL.of(o2) };
}
} else {
if (n2 && e18.sliceDoc(o2 - 2 * t2.length, o2) == t2 + t2 && xL(e18, o2 - 2 * t2.length))
return { changes: { insert: t2 + t2 + t2 + t2, from: o2 }, effects: cL.of(o2 + t2.length), range: T_.cursor(o2 + t2.length) };
if (e18.charCategorizer(o2)(a2) != kC.Word) {
var u2 = e18.sliceDoc(o2 - 1, o2);
if (u2 != t2 && e18.charCategorizer(o2)(u2) != kC.Word && !function(e19, t3, n3) {
for (var r3 = OT(e19).resolveInner(t3, -1), i4 = 0; i4 < 5; i4++) {
if (e19.sliceDoc(r3.from, r3.from + n3.length) == n3) {
for (var o3 = r3.firstChild; o3 && o3.from == r3.from && o3.to - o3.from > n3.length; ) {
if (e19.sliceDoc(o3.to - n3.length, o3.to) == n3)
return false;
o3 = o3.firstChild;
}
return true;
}
var a3 = r3.to == t3 && r3.parent;
if (!a3)
break;
r3 = a3;
}
return false;
}(e18, o2, t2))
return { changes: { insert: t2 + t2, from: o2 }, effects: cL.of(o2 + t2.length), range: T_.cursor(o2 + t2.length) };
}
}
return { range: r2 = i3 };
});
return r2 ? null : e18.update(i2, { scrollIntoView: true, userEvent: "input.type" });
}
function xL(e18, t2) {
var n2 = OT(e18).resolveInner(t2 + 1);
return n2.parent && n2.from == t2;
}
function SL() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return [rL, qD.of(e18), aL, CL, sL];
}
var _L = [{ key: "Ctrl-Space", run: function(e18) {
return !!e18.state.field(rL, false) && (e18.dispatch({ effects: XD.of(true) }), true);
} }, { key: "Escape", run: function(e18) {
var t2 = e18.state.field(rL, false);
return !(!t2 || !t2.active.some(function(e19) {
return 0 != e19.state;
})) && (e18.dispatch({ effects: eL.of(null) }), true);
} }, { key: "ArrowDown", run: iL(true) }, { key: "ArrowUp", run: iL(false) }, { key: "PageDown", run: iL(true, "page") }, { key: "PageUp", run: iL(false, "page") }, { key: "Enter", run: function(e18) {
var t2 = e18.state.field(rL, false);
return !(e18.state.readOnly || !t2 || !t2.open || Date.now() - t2.open.timestamp < 75 || t2.open.selected < 0) && (DD(e18, t2.open.options[t2.open.selected]), true);
} }], CL = K_.highest(UE.computeN([qD], function(e18) {
return e18.facet(qD).defaultKeymap ? [_L] : [];
})), $L = Li(function e13(t2, n2, r2) {
Ri(this, e13), this.from = t2, this.to = n2, this.diagnostic = r2;
}), OL = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.diagnostics = t2, this.panel = n2, this.selected = r2;
}
return Li(e18, null, [{ key: "init", value: function(t2, n2, r2) {
var i2 = t2, o2 = r2.facet(FL).markerFilter;
o2 && (i2 = o2(i2));
var a2 = iO.set(i2.map(function(e19) {
return e19.from == e19.to || e19.from == e19.to - 1 && r2.doc.lineAt(e19.from).to == e19.from ? iO.widget({ widget: new HL(e19), diagnostic: e19 }).range(e19.from) : iO.mark({ attributes: { class: "cm-lintRange cm-lintRange-" + e19.severity }, diagnostic: e19 }).range(e19.from, e19.to);
}), true);
return new e18(a2, n2, ML(a2));
} }]), e18;
}();
function ML(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, r2 = null;
return e18.between(n2, 1e9, function(e19, n3, i2) {
var o2 = i2.spec;
if (!t2 || o2.diagnostic == t2)
return r2 = new $L(e19, n3, o2.diagnostic), false;
}), r2;
}
function EL(e18, t2) {
return !(!e18.effects.some(function(e19) {
return e19.is(AL);
}) && !e18.changes.touchesRange(t2.pos));
}
function PL(e18, t2) {
return e18.field(NL, false) ? t2 : t2.concat(fC.appendConfig.of([NL, LE.decorations.compute([NL], function(e19) {
var t3 = e19.field(NL), n2 = t3.selected, r2 = t3.panel;
return n2 && r2 && n2.from != n2.to ? iO.set([RL.range(n2.from, n2.to)]) : iO.none;
}), VP(DL, { hideOn: EL }), QL]));
}
var AL = fC.define(), TL = fC.define(), IL = fC.define(), NL = F_.define({ create: function() {
return new OL(iO.none, null, null);
}, update: function(e18, t2) {
if (t2.docChanged) {
var n2 = e18.diagnostics.map(t2.changes), r2 = null;
if (e18.selected) {
var i2 = t2.changes.mapPos(e18.selected.from, 1);
r2 = ML(n2, e18.selected.diagnostic, i2) || ML(n2, null, i2);
}
e18 = new OL(n2, e18.panel, r2);
}
var o2, a2 = bi(t2.effects);
try {
for (a2.s(); !(o2 = a2.n()).done; ) {
var s2 = o2.value;
s2.is(AL) ? e18 = OL.init(s2.value, e18.panel, t2.state) : s2.is(TL) ? e18 = new OL(e18.diagnostics, s2.value ? UL.open : null, e18.selected) : s2.is(IL) && (e18 = new OL(e18.diagnostics, e18.panel, s2.value));
}
} catch (e19) {
a2.e(e19);
} finally {
a2.f();
}
return e18;
}, provide: function(e18) {
return [YP.from(e18, function(e19) {
return e19.panel;
}), LE.decorations.from(e18, function(e19) {
return e19.diagnostics;
})];
} }), RL = iO.mark({ class: "cm-lintRange cm-lintRange-active" });
function DL(e18, t2, n2) {
var r2 = e18.state.field(NL).diagnostics, i2 = [], o2 = 2e8, a2 = 0;
r2.between(t2 - (n2 < 0 ? 1 : 0), t2 + (n2 > 0 ? 1 : 0), function(e19, r3, s3) {
var u2 = s3.spec;
t2 >= e19 && t2 <= r3 && (e19 == r3 || (t2 > e19 || n2 > 0) && (t2 < r3 || n2 < 0)) && (i2.push(u2.diagnostic), o2 = Math.min(e19, o2), a2 = Math.max(r3, a2));
});
var s2 = e18.state.facet(FL).tooltipFilter;
return s2 && (i2 = s2(i2)), i2.length ? { pos: o2, end: a2, above: e18.state.doc.lineAt(o2).to < a2, create: function() {
return { dom: LL(e18, i2) };
} } : null;
}
function LL(e18, t2) {
return MR("ul", { class: "cm-tooltip-lint" }, t2.map(function(t3) {
return WL(e18, t3, false);
}));
}
var zL = function(e18) {
var t2 = e18.state.field(NL, false);
return !(!t2 || !t2.panel) && (e18.dispatch({ effects: TL.of(false) }), true);
}, BL = [{ key: "Mod-Shift-m", run: function(e18) {
var t2 = e18.state.field(NL, false);
t2 && t2.panel || e18.dispatch({ effects: PL(e18.state, [TL.of(true)]) });
var n2 = UP(e18, UL.open);
return n2 && n2.dom.querySelector(".cm-panel-lint ul").focus(), true;
} }, { key: "F8", run: function(e18) {
var t2 = e18.state.field(NL, false);
if (!t2)
return false;
var n2 = e18.state.selection.main, r2 = t2.diagnostics.iter(n2.to + 1);
return !(!r2.value && (!(r2 = t2.diagnostics.iter(0)).value || r2.from == n2.from && r2.to == n2.to)) && (e18.dispatch({ selection: { anchor: r2.from, head: r2.to }, scrollIntoView: true }), true);
} }], qL = OO.fromClass(function() {
function e18(t2) {
Ri(this, e18), this.view = t2, this.timeout = -1, this.set = true;
var n2 = t2.state.facet(FL).delay;
this.lintTime = Date.now() + n2, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, n2);
}
return Li(e18, [{ key: "run", value: function() {
var e19 = this, t2 = Date.now();
if (t2 < this.lintTime - 10)
setTimeout(this.run, this.lintTime - t2);
else {
this.set = false;
var n2 = this.view.state, r2 = n2.facet(FL).sources;
Promise.all(r2.map(function(t3) {
return Promise.resolve(t3(e19.view));
})).then(function(t3) {
var r3 = t3.reduce(function(e20, t4) {
return e20.concat(t4);
});
e19.view.state.doc == n2.doc && e19.view.dispatch(function(e20, t4) {
return { effects: PL(e20, [AL.of(t4)]) };
}(e19.view.state, r3));
}, function(t3) {
SO(e19.view.state, t3);
});
}
} }, { key: "update", value: function(e19) {
var t2 = e19.state.facet(FL);
(e19.docChanged || t2 != e19.startState.facet(FL)) && (this.lintTime = Date.now() + t2.delay, this.set || (this.set = true, this.timeout = setTimeout(this.run, t2.delay)));
} }, { key: "force", value: function() {
this.set && (this.lintTime = Date.now(), this.run());
} }, { key: "destroy", value: function() {
clearTimeout(this.timeout);
} }]), e18;
}()), FL = R_.define({ combine: function(e18) {
return Object.assign({ sources: e18.map(function(e19) {
return e19.source;
}) }, SC(e18.map(function(e19) {
return e19.config;
}), { delay: 750, markerFilter: null, tooltipFilter: null }));
}, enables: qL });
function VL(e18) {
var t2 = [];
if (e18) {
var n2, r2 = bi(e18);
try {
e:
for (r2.s(); !(n2 = r2.n()).done; ) {
for (var i2 = n2.value.name, o2 = function(e19) {
var n3 = i2[e19];
if (/[a-zA-Z]/.test(n3) && !t2.some(function(e20) {
return e20.toLowerCase() == n3.toLowerCase();
}))
return t2.push(n3), "continue|actions";
}, a2 = 0; a2 < i2.length; a2++) {
if ("continue|actions" === o2(a2))
continue e;
}
t2.push("");
}
} catch (e19) {
r2.e(e19);
} finally {
r2.f();
}
}
return t2;
}
function WL(e18, t2, n2) {
var r2, i2 = n2 ? VL(t2.actions) : [];
return MR("li", { class: "cm-diagnostic cm-diagnostic-" + t2.severity }, MR("span", { class: "cm-diagnosticText" }, t2.renderMessage ? t2.renderMessage() : t2.message), null === (r2 = t2.actions) || void 0 === r2 ? void 0 : r2.map(function(n3, r3) {
var o2 = function(r4) {
r4.preventDefault();
var i3 = ML(e18.state.field(NL).diagnostics, t2);
i3 && n3.apply(e18, i3.from, i3.to);
}, a2 = n3.name, s2 = i2[r3] ? a2.indexOf(i2[r3]) : -1, u2 = s2 < 0 ? a2 : [a2.slice(0, s2), MR("u", a2.slice(s2, s2 + 1)), a2.slice(s2 + 1)];
return MR("button", { type: "button", class: "cm-diagnosticAction", onclick: o2, onmousedown: o2, "aria-label": " Action: ".concat(a2).concat(s2 < 0 ? "" : ' (access key "'.concat(i2[r3], ')"'), ".") }, u2);
}), t2.source && MR("div", { class: "cm-diagnosticSource" }, t2.source));
}
var HL = function(e18) {
Ci(n2, nO);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).diagnostic = e19, r2;
}
return Li(n2, [{ key: "eq", value: function(e19) {
return e19.diagnostic == this.diagnostic;
} }, { key: "toDOM", value: function() {
return MR("span", { class: "cm-lintPoint cm-lintPoint-" + this.diagnostic.severity });
} }]), n2;
}(), JL = Li(function e14(t2, n2) {
Ri(this, e14), this.diagnostic = n2, this.id = "item_" + Math.floor(4294967295 * Math.random()).toString(16), this.dom = WL(t2, n2, true), this.dom.id = this.id, this.dom.setAttribute("role", "option");
}), UL = function() {
function e18(t2) {
var n2 = this;
Ri(this, e18), this.view = t2, this.items = [];
this.list = MR("ul", { tabIndex: 0, role: "listbox", "aria-label": this.view.state.phrase("Diagnostics"), onkeydown: function(e19) {
if (27 == e19.keyCode)
zL(n2.view), n2.view.focus();
else if (38 == e19.keyCode || 33 == e19.keyCode)
n2.moveSelection((n2.selectedIndex - 1 + n2.items.length) % n2.items.length);
else if (40 == e19.keyCode || 34 == e19.keyCode)
n2.moveSelection((n2.selectedIndex + 1) % n2.items.length);
else if (36 == e19.keyCode)
n2.moveSelection(0);
else if (35 == e19.keyCode)
n2.moveSelection(n2.items.length - 1);
else if (13 == e19.keyCode)
n2.view.focus();
else {
if (!(e19.keyCode >= 65 && e19.keyCode <= 90 && n2.selectedIndex >= 0))
return;
for (var r2 = n2.items[n2.selectedIndex].diagnostic, i2 = VL(r2.actions), o2 = 0; o2 < i2.length; o2++)
if (i2[o2].toUpperCase().charCodeAt(0) == e19.keyCode) {
var a2 = ML(n2.view.state.field(NL).diagnostics, r2);
a2 && r2.actions[o2].apply(t2, a2.from, a2.to);
}
}
e19.preventDefault();
}, onclick: function(e19) {
for (var t3 = 0; t3 < n2.items.length; t3++)
n2.items[t3].dom.contains(e19.target) && n2.moveSelection(t3);
} }), this.dom = MR("div", { class: "cm-panel-lint" }, this.list, MR("button", { type: "button", name: "close", "aria-label": this.view.state.phrase("close"), onclick: function() {
return zL(n2.view);
} }, "\xD7")), this.update();
}
return Li(e18, [{ key: "selectedIndex", get: function() {
var e19 = this.view.state.field(NL).selected;
if (!e19)
return -1;
for (var t2 = 0; t2 < this.items.length; t2++)
if (this.items[t2].diagnostic == e19.diagnostic)
return t2;
return -1;
} }, { key: "update", value: function() {
var e19 = this, t2 = this.view.state.field(NL), n2 = t2.diagnostics, r2 = t2.selected, i2 = 0, o2 = false, a2 = null;
for (n2.between(0, this.view.state.doc.length, function(t3, n3, s2) {
for (var u2, c2 = s2.spec, l2 = -1, f2 = i2; f2 < e19.items.length; f2++)
if (e19.items[f2].diagnostic == c2.diagnostic) {
l2 = f2;
break;
}
l2 < 0 ? (u2 = new JL(e19.view, c2.diagnostic), e19.items.splice(i2, 0, u2), o2 = true) : (u2 = e19.items[l2], l2 > i2 && (e19.items.splice(i2, l2 - i2), o2 = true)), r2 && u2.diagnostic == r2.diagnostic ? u2.dom.hasAttribute("aria-selected") || (u2.dom.setAttribute("aria-selected", "true"), a2 = u2) : u2.dom.hasAttribute("aria-selected") && u2.dom.removeAttribute("aria-selected"), i2++;
}); i2 < this.items.length && !(1 == this.items.length && this.items[0].diagnostic.from < 0); )
o2 = true, this.items.pop();
0 == this.items.length && (this.items.push(new JL(this.view, { from: -1, to: -1, severity: "info", message: this.view.state.phrase("No diagnostics") })), o2 = true), a2 ? (this.list.setAttribute("aria-activedescendant", a2.id), this.view.requestMeasure({ key: this, read: function() {
return { sel: a2.dom.getBoundingClientRect(), panel: e19.list.getBoundingClientRect() };
}, write: function(t3) {
var n3 = t3.sel, r3 = t3.panel;
n3.top < r3.top ? e19.list.scrollTop -= r3.top - n3.top : n3.bottom > r3.bottom && (e19.list.scrollTop += n3.bottom - r3.bottom);
} })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), o2 && this.sync();
} }, { key: "sync", value: function() {
var e19 = this.list.firstChild;
function t2() {
var t3 = e19;
e19 = t3.nextSibling, t3.remove();
}
var n2, r2 = bi(this.items);
try {
for (r2.s(); !(n2 = r2.n()).done; ) {
var i2 = n2.value;
if (i2.dom.parentNode == this.list) {
for (; e19 != i2.dom; )
t2();
e19 = i2.dom.nextSibling;
} else
this.list.insertBefore(i2.dom, e19);
}
} catch (e20) {
r2.e(e20);
} finally {
r2.f();
}
for (; e19; )
t2();
} }, { key: "moveSelection", value: function(e19) {
if (!(this.selectedIndex < 0)) {
var t2 = ML(this.view.state.field(NL).diagnostics, this.items[e19].diagnostic);
t2 && this.view.dispatch({ selection: { anchor: t2.from, head: t2.to }, scrollIntoView: true, effects: IL.of(t2) });
}
} }], [{ key: "open", value: function(t2) {
return new e18(t2);
} }]), e18;
}();
function KL(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'viewBox="0 0 40 40"';
return `url('data:image/svg+xml,')");
}
function GL(e18) {
return KL(''), 'width="6" height="3"');
}
var QL = LE.baseTheme({ ".cm-diagnostic": { padding: "3px 6px 3px 8px", marginLeft: "-1px", display: "block", whiteSpace: "pre-wrap" }, ".cm-diagnostic-error": { borderLeft: "5px solid #d11" }, ".cm-diagnostic-warning": { borderLeft: "5px solid orange" }, ".cm-diagnostic-info": { borderLeft: "5px solid #999" }, ".cm-diagnosticAction": { font: "inherit", border: "none", padding: "2px 4px", backgroundColor: "#444", color: "white", borderRadius: "3px", marginLeft: "8px" }, ".cm-diagnosticSource": { fontSize: "70%", opacity: 0.7 }, ".cm-lintRange": { backgroundPosition: "left bottom", backgroundRepeat: "repeat-x", paddingBottom: "0.7px" }, ".cm-lintRange-error": { backgroundImage: GL("#d11") }, ".cm-lintRange-warning": { backgroundImage: GL("orange") }, ".cm-lintRange-info": { backgroundImage: GL("#999") }, ".cm-lintRange-active": { backgroundColor: "#ffdd9980" }, ".cm-tooltip-lint": { padding: 0, margin: 0 }, ".cm-lintPoint": { position: "relative", "&:after": { content: '""', position: "absolute", bottom: 0, left: "-2px", borderLeft: "3px solid transparent", borderRight: "3px solid transparent", borderBottom: "4px solid #d11" } }, ".cm-lintPoint-warning": { "&:after": { borderBottomColor: "orange" } }, ".cm-lintPoint-info": { "&:after": { borderBottomColor: "#999" } }, ".cm-panel.cm-panel-lint": { position: "relative", "& ul": { maxHeight: "100px", overflowY: "auto", "& [aria-selected]": { backgroundColor: "#ddd", "& u": { textDecoration: "underline" } }, "&:focus [aria-selected]": { background_fallback: "#bdf", backgroundColor: "Highlight", color_fallback: "white", color: "HighlightText" }, "& u": { textDecoration: "none" }, padding: 0, margin: 0 }, "& [name=close]": { position: "absolute", top: "0", right: "2px", background: "inherit", border: "none", font: "inherit", padding: 0, margin: 0 } } }), YL = function(e18) {
Ci(n2, ZP);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), (r2 = t2.call(this)).diagnostics = e19, r2.severity = e19.reduce(function(e20, t3) {
var n3 = t3.severity;
return "error" == n3 || "warning" == n3 && "info" == e20 ? n3 : e20;
}, "info"), r2;
}
return Li(n2, [{ key: "toDOM", value: function(e19) {
var t3 = document.createElement("div");
t3.className = "cm-lint-marker cm-lint-marker-" + this.severity;
var n3 = this.diagnostics, r2 = e19.state.facet(iz).tooltipFilter;
return r2 && (n3 = r2(n3)), n3.length && (t3.onmouseover = function() {
return function(e20, t4, n4) {
function r3() {
var r4 = e20.elementAtHeight(t4.getBoundingClientRect().top + 5 - e20.documentTop);
e20.coordsAtPos(r4.from) && e20.dispatch({ effects: tz.of({ pos: r4.from, above: false, create: function() {
return { dom: LL(e20, n4), getCoords: function() {
return t4.getBoundingClientRect();
} };
} }) }), t4.onmouseout = t4.onmousemove = null, function(e21, t5) {
var n5 = function n6(r5) {
var i3 = t5.getBoundingClientRect();
if (!(r5.clientX > i3.left - 10 && r5.clientX < i3.right + 10 && r5.clientY > i3.top - 10 && r5.clientY < i3.bottom + 10)) {
for (var o3 = r5.target; o3; o3 = o3.parentNode)
if (1 == o3.nodeType && o3.classList.contains("cm-tooltip-lint"))
return;
window.removeEventListener("mousemove", n6), e21.state.field(nz) && e21.dispatch({ effects: tz.of(null) });
}
};
window.addEventListener("mousemove", n5);
}(e20, t4);
}
var i2 = e20.state.facet(iz).hoverTime, o2 = setTimeout(r3, i2);
t4.onmouseout = function() {
clearTimeout(o2), t4.onmouseout = t4.onmousemove = null;
}, t4.onmousemove = function() {
clearTimeout(o2), o2 = setTimeout(r3, i2);
};
}(e19, t3, n3);
}), t3;
} }]), n2;
}();
function ZL(e18, t2) {
var n2, r2 = /* @__PURE__ */ Object.create(null), i2 = bi(t2);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value, a2 = e18.lineAt(o2.from);
(r2[a2.from] || (r2[a2.from] = [])).push(o2);
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
var s2 = [];
for (var u2 in r2)
s2.push(new YL(r2[u2]).range(+u2));
return MC.of(s2, true);
}
var XL = nA({ class: "cm-gutter-lint", markers: function(e18) {
return e18.state.field(ez);
} }), ez = F_.define({ create: function() {
return MC.empty;
}, update: function(e18, t2) {
e18 = e18.map(t2.changes);
var n2, r2 = t2.state.facet(iz).markerFilter, i2 = bi(t2.effects);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value;
if (o2.is(AL)) {
var a2 = o2.value;
r2 && (a2 = r2(a2 || [])), e18 = ZL(t2.state.doc, a2.slice(0));
}
}
} catch (e19) {
i2.e(e19);
} finally {
i2.f();
}
return e18;
} }), tz = fC.define(), nz = F_.define({ create: function() {
return null;
}, update: function(e18, t2) {
return e18 && t2.docChanged && (e18 = EL(t2, e18) ? null : Object.assign(Object.assign({}, e18), { pos: t2.changes.mapPos(e18.pos) })), t2.effects.reduce(function(e19, t3) {
return t3.is(tz) ? t3.value : e19;
}, e18);
}, provide: function(e18) {
return LP.from(e18);
} }), rz = LE.baseTheme({ ".cm-gutter-lint": { width: "1.4em", "& .cm-gutterElement": { padding: ".2em" } }, ".cm-lint-marker": { width: "1em", height: "1em" }, ".cm-lint-marker-info": { content: KL('') }, ".cm-lint-marker-warning": { content: KL('') }, ".cm-lint-marker-error:before": { content: KL('') } }), iz = R_.define({ combine: function(e18) {
return SC(e18, { hoverTime: 300, markerFilter: null, tooltipFilter: null });
} });
function oz() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
return [iz.of(e18), ez, XL, rz, nz];
}
var az, sz = function() {
return [mA(), bA, bP(), uN(), mI(), eP(), [lP, fP], xC.allowMultipleSelections.of(true), xC.transactionFilter.of(function(e19) {
if (!e19.docChanged || !e19.isUserEvent("input.type") && !e19.isUserEvent("input.complete"))
return e19;
var t3 = e19.startState.languageDataAt("indentOnInput", e19.startState.selection.main.head);
if (!t3.length)
return e19;
var n2 = e19.newDoc, r2 = e19.newSelection.main.head, i2 = n2.lineAt(r2);
if (r2 > i2.from + 200)
return e19;
var o2 = n2.sliceString(i2.from, r2);
if (!t3.some(function(e20) {
return e20.test(o2);
}))
return e19;
var a2, s2 = e19.state, u2 = -1, c2 = [], l2 = bi(s2.selection.ranges);
try {
for (l2.s(); !(a2 = l2.n()).done; ) {
var f2 = a2.value.head, h2 = s2.doc.lineAt(f2);
if (h2.from != u2) {
u2 = h2.from;
var d2 = VT(s2, h2.from);
if (null != d2) {
var v2 = /^\s*/.exec(h2.text)[0], p2 = FT(s2, d2);
v2 != p2 && c2.push({ from: h2.from, to: h2.from + v2.length, insert: p2 });
}
}
}
} catch (e20) {
l2.e(e20);
} finally {
l2.f();
}
return c2.length ? [e19, { changes: c2, sequential: true }] : e19;
}), jI(_I, { fallback: true }), TI(), [mL, hL], SL(), OP(), PP(), _P, (t2 = [QR, GR], e18 && t2.push(HR.of(e18)), t2), UE.of([].concat(gL, Ti($R), SD, $N, cI, _L, BL))];
var e18, t2;
}(), uz = function() {
function e18(t2, n2, r2, i2, o2, a2, s2, u2, c2) {
var l2 = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : 0, f2 = arguments.length > 10 ? arguments[10] : void 0;
Ri(this, e18), this.p = t2, this.stack = n2, this.state = r2, this.reducePos = i2, this.pos = o2, this.score = a2, this.buffer = s2, this.bufferBase = u2, this.curContext = c2, this.lookAhead = l2, this.parent = f2;
}
return Li(e18, [{ key: "toString", value: function() {
return "[".concat(this.stack.filter(function(e19, t2) {
return t2 % 3 == 0;
}).concat(this.state), "]@").concat(this.pos).concat(this.score ? "!" + this.score : "");
} }, { key: "context", get: function() {
return this.curContext ? this.curContext.context : null;
} }, { key: "pushState", value: function(e19, t2) {
this.stack.push(this.state, t2, this.bufferBase + this.buffer.length), this.state = e19;
} }, { key: "reduce", value: function(e19) {
var t2 = e19 >> 19, n2 = 65535 & e19, r2 = this.p.parser, i2 = r2.dynamicPrecedence(n2);
if (i2 && (this.score += i2), 0 == t2)
return this.pushState(r2.getGoto(this.state, n2, true), this.reducePos), n2 < r2.minRepeatTerm && this.storeNode(n2, this.reducePos, this.reducePos, 4, true), void this.reduceContext(n2, this.reducePos);
var o2 = this.stack.length - 3 * (t2 - 1) - (262144 & e19 ? 6 : 0), a2 = this.stack[o2 - 2], s2 = this.stack[o2 - 1], u2 = this.bufferBase + this.buffer.length - s2;
if (n2 < r2.minRepeatTerm || 131072 & e19) {
var c2 = r2.stateFlag(this.state, 1) ? this.pos : this.reducePos;
this.storeNode(n2, a2, c2, u2 + 4, true);
}
if (262144 & e19)
this.state = this.stack[o2];
else {
var l2 = this.stack[o2 - 3];
this.state = r2.getGoto(l2, n2, true);
}
for (; this.stack.length > o2; )
this.stack.pop();
this.reduceContext(n2, a2);
} }, { key: "storeNode", value: function(e19, t2, n2) {
var r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 4, i2 = arguments.length > 4 && void 0 !== arguments[4] && arguments[4];
if (0 == e19 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
var o2 = this, a2 = this.buffer.length;
if (0 == a2 && o2.parent && (a2 = o2.bufferBase - o2.parent.bufferBase, o2 = o2.parent), a2 > 0 && 0 == o2.buffer[a2 - 4] && o2.buffer[a2 - 1] > -1) {
if (t2 == n2)
return;
if (o2.buffer[a2 - 2] >= t2)
return void (o2.buffer[a2 - 2] = n2);
}
}
if (i2 && this.pos != n2) {
var s2 = this.buffer.length;
if (s2 > 0 && 0 != this.buffer[s2 - 4])
for (; s2 > 0 && this.buffer[s2 - 2] > n2; )
this.buffer[s2] = this.buffer[s2 - 4], this.buffer[s2 + 1] = this.buffer[s2 - 3], this.buffer[s2 + 2] = this.buffer[s2 - 2], this.buffer[s2 + 3] = this.buffer[s2 - 1], s2 -= 4, r2 > 4 && (r2 -= 4);
this.buffer[s2] = e19, this.buffer[s2 + 1] = t2, this.buffer[s2 + 2] = n2, this.buffer[s2 + 3] = r2;
} else
this.buffer.push(e19, t2, n2, r2);
} }, { key: "shift", value: function(e19, t2, n2) {
var r2 = this.pos;
if (131072 & e19)
this.pushState(65535 & e19, this.pos);
else if (0 == (262144 & e19)) {
var i2 = e19, o2 = this.p.parser;
(n2 > this.pos || t2 <= o2.maxNode) && (this.pos = n2, o2.stateFlag(i2, 1) || (this.reducePos = n2)), this.pushState(i2, r2), this.shiftContext(t2, r2), t2 <= o2.maxNode && this.buffer.push(t2, r2, n2, 4);
} else
this.pos = n2, this.shiftContext(t2, r2), t2 <= this.p.parser.maxNode && this.buffer.push(t2, r2, n2, 4);
} }, { key: "apply", value: function(e19, t2, n2) {
65536 & e19 ? this.reduce(e19) : this.shift(e19, t2, n2);
} }, { key: "useNode", value: function(e19, t2) {
var n2 = this.p.reused.length - 1;
(n2 < 0 || this.p.reused[n2] != e19) && (this.p.reused.push(e19), n2++);
var r2 = this.pos;
this.reducePos = this.pos = r2 + e19.length, this.pushState(t2, r2), this.buffer.push(n2, r2, this.reducePos, -1), this.curContext && this.updateContext(this.curContext.tracker.reuse(this.curContext.context, e19, this, this.p.stream.reset(this.pos - e19.length)));
} }, { key: "split", value: function() {
for (var t2 = this, n2 = t2.buffer.length; n2 > 0 && t2.buffer[n2 - 2] > t2.reducePos; )
n2 -= 4;
for (var r2 = t2.buffer.slice(n2), i2 = t2.bufferBase + n2; t2 && i2 == t2.bufferBase; )
t2 = t2.parent;
return new e18(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, r2, i2, this.curContext, this.lookAhead, t2);
} }, { key: "recoverByDelete", value: function(e19, t2) {
var n2 = e19 <= this.p.parser.maxNode;
n2 && this.storeNode(e19, this.pos, t2, 4), this.storeNode(0, this.pos, t2, n2 ? 8 : 4), this.pos = this.reducePos = t2, this.score -= 190;
} }, { key: "canShift", value: function(e19) {
for (var t2 = new lz(this); ; ) {
var n2 = this.p.parser.stateSlot(t2.state, 4) || this.p.parser.hasAction(t2.state, e19);
if (0 == (65536 & n2))
return true;
if (0 == n2)
return false;
t2.reduce(n2);
}
} }, { key: "recoverByInsert", value: function(e19) {
if (this.stack.length >= 300)
return [];
var t2 = this.p.parser.nextStates(this.state);
if (t2.length > 8 || this.stack.length >= 120) {
for (var n2, r2 = [], i2 = 0; i2 < t2.length; i2 += 2)
(n2 = t2[i2 + 1]) != this.state && this.p.parser.hasAction(n2, e19) && r2.push(t2[i2], n2);
if (this.stack.length < 120)
for (var o2 = function(e20) {
var n3 = t2[e20 + 1];
r2.some(function(e21, t3) {
return 1 & t3 && e21 == n3;
}) || r2.push(t2[e20], n3);
}, a2 = 0; r2.length < 8 && a2 < t2.length; a2 += 2)
o2(a2);
t2 = r2;
}
for (var s2 = [], u2 = 0; u2 < t2.length && s2.length < 4; u2 += 2) {
var c2 = t2[u2 + 1];
if (c2 != this.state) {
var l2 = this.split();
l2.pushState(c2, this.pos), l2.storeNode(0, l2.pos, l2.pos, 4, true), l2.shiftContext(t2[u2], this.pos), l2.score -= 200, s2.push(l2);
}
}
return s2;
} }, { key: "forceReduce", value: function() {
var e19 = this.p.parser.stateSlot(this.state, 5);
if (0 == (65536 & e19))
return false;
var t2 = this.p.parser;
if (!t2.validAction(this.state, e19)) {
var n2 = e19 >> 19, r2 = 65535 & e19, i2 = this.stack.length - 3 * n2;
if (i2 < 0 || t2.getGoto(this.stack[i2], r2, false) < 0)
return false;
this.storeNode(0, this.reducePos, this.reducePos, 4, true), this.score -= 100;
}
return this.reducePos = this.pos, this.reduce(e19), true;
} }, { key: "forceAll", value: function() {
for (; !this.p.parser.stateFlag(this.state, 2); )
if (!this.forceReduce()) {
this.storeNode(0, this.pos, this.pos, 4, true);
break;
}
return this;
} }, { key: "deadEnd", get: function() {
if (3 != this.stack.length)
return false;
var e19 = this.p.parser;
return 65535 == e19.data[e19.stateSlot(this.state, 1)] && !e19.stateSlot(this.state, 4);
} }, { key: "restart", value: function() {
this.state = this.stack[0], this.stack.length = 0;
} }, { key: "sameState", value: function(e19) {
if (this.state != e19.state || this.stack.length != e19.stack.length)
return false;
for (var t2 = 0; t2 < this.stack.length; t2 += 3)
if (this.stack[t2] != e19.stack[t2])
return false;
return true;
} }, { key: "parser", get: function() {
return this.p.parser;
} }, { key: "dialectEnabled", value: function(e19) {
return this.p.parser.dialect.flags[e19];
} }, { key: "shiftContext", value: function(e19, t2) {
this.curContext && this.updateContext(this.curContext.tracker.shift(this.curContext.context, e19, this, this.p.stream.reset(t2)));
} }, { key: "reduceContext", value: function(e19, t2) {
this.curContext && this.updateContext(this.curContext.tracker.reduce(this.curContext.context, e19, this, this.p.stream.reset(t2)));
} }, { key: "emitContext", value: function() {
var e19 = this.buffer.length - 1;
(e19 < 0 || -3 != this.buffer[e19]) && this.buffer.push(this.curContext.hash, this.reducePos, this.reducePos, -3);
} }, { key: "emitLookAhead", value: function() {
var e19 = this.buffer.length - 1;
(e19 < 0 || -4 != this.buffer[e19]) && this.buffer.push(this.lookAhead, this.reducePos, this.reducePos, -4);
} }, { key: "updateContext", value: function(e19) {
if (e19 != this.curContext.context) {
var t2 = new cz(this.curContext.tracker, e19);
t2.hash != this.curContext.hash && this.emitContext(), this.curContext = t2;
}
} }, { key: "setLookAhead", value: function(e19) {
e19 > this.lookAhead && (this.emitLookAhead(), this.lookAhead = e19);
} }, { key: "close", value: function() {
this.curContext && this.curContext.tracker.strict && this.emitContext(), this.lookAhead > 0 && this.emitLookAhead();
} }], [{ key: "start", value: function(t2, n2) {
var r2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, i2 = t2.parser.context;
return new e18(t2, [], n2, r2, r2, 0, [], 0, i2 ? new cz(i2, i2.start) : null, 0, null);
} }]), e18;
}(), cz = Li(function e15(t2, n2) {
Ri(this, e15), this.tracker = t2, this.context = n2, this.hash = t2.strict ? t2.hash(n2) : 0;
});
!function(e18) {
e18[e18.Insert = 200] = "Insert", e18[e18.Delete = 190] = "Delete", e18[e18.Reduce = 100] = "Reduce", e18[e18.MaxNext = 4] = "MaxNext", e18[e18.MaxInsertStackDepth = 300] = "MaxInsertStackDepth", e18[e18.DampenInsertStackDepth = 120] = "DampenInsertStackDepth";
}(az || (az = {}));
var lz = function() {
function e18(t2) {
Ri(this, e18), this.start = t2, this.state = t2.state, this.stack = t2.stack, this.base = this.stack.length;
}
return Li(e18, [{ key: "reduce", value: function(e19) {
var t2 = 65535 & e19, n2 = e19 >> 19;
0 == n2 ? (this.stack == this.start.stack && (this.stack = this.stack.slice()), this.stack.push(this.state, 0, 0), this.base += 3) : this.base -= 3 * (n2 - 1);
var r2 = this.start.p.parser.getGoto(this.stack[this.base - 3], t2, true);
this.state = r2;
} }]), e18;
}(), fz = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.stack = t2, this.pos = n2, this.index = r2, this.buffer = t2.buffer, 0 == this.index && this.maybeNext();
}
return Li(e18, [{ key: "maybeNext", value: function() {
var e19 = this.stack.parent;
null != e19 && (this.index = this.stack.bufferBase - e19.bufferBase, this.stack = e19, this.buffer = e19.buffer);
} }, { key: "id", get: function() {
return this.buffer[this.index - 4];
} }, { key: "start", get: function() {
return this.buffer[this.index - 3];
} }, { key: "end", get: function() {
return this.buffer[this.index - 2];
} }, { key: "size", get: function() {
return this.buffer[this.index - 1];
} }, { key: "next", value: function() {
this.index -= 4, this.pos -= 4, 0 == this.index && this.maybeNext();
} }, { key: "fork", value: function() {
return new e18(this.stack, this.pos, this.index);
} }], [{ key: "create", value: function(t2) {
var n2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t2.bufferBase + t2.buffer.length;
return new e18(t2, n2, n2 - t2.bufferBase);
} }]), e18;
}(), hz = Li(function e16() {
Ri(this, e16), this.start = -1, this.value = -1, this.end = -1, this.extended = -1, this.lookAhead = 0, this.mask = 0, this.context = 0;
}), dz = new hz(), vz = function() {
function e18(t2, n2) {
Ri(this, e18), this.input = t2, this.ranges = n2, this.chunk = "", this.chunkOff = 0, this.chunk2 = "", this.chunk2Pos = 0, this.next = -1, this.token = dz, this.rangeIndex = 0, this.pos = this.chunkPos = n2[0].from, this.range = n2[0], this.end = n2[n2.length - 1].to, this.readNext();
}
return Li(e18, [{ key: "resolveOffset", value: function(e19, t2) {
for (var n2 = this.range, r2 = this.rangeIndex, i2 = this.pos + e19; i2 < n2.from; ) {
if (!r2)
return null;
var o2 = this.ranges[--r2];
i2 -= n2.from - o2.to, n2 = o2;
}
for (; t2 < 0 ? i2 > n2.to : i2 >= n2.to; ) {
if (r2 == this.ranges.length - 1)
return null;
var a2 = this.ranges[++r2];
i2 += a2.from - n2.to, n2 = a2;
}
return i2;
} }, { key: "clipPos", value: function(e19) {
if (e19 >= this.range.from && e19 < this.range.to)
return e19;
var t2, n2 = bi(this.ranges);
try {
for (n2.s(); !(t2 = n2.n()).done; ) {
var r2 = t2.value;
if (r2.to > e19)
return Math.max(e19, r2.from);
}
} catch (e20) {
n2.e(e20);
} finally {
n2.f();
}
return this.end;
} }, { key: "peek", value: function(e19) {
var t2, n2, r2 = this.chunkOff + e19;
if (r2 >= 0 && r2 < this.chunk.length)
t2 = this.pos + e19, n2 = this.chunk.charCodeAt(r2);
else {
var i2 = this.resolveOffset(e19, 1);
if (null == i2)
return -1;
if ((t2 = i2) >= this.chunk2Pos && t2 < this.chunk2Pos + this.chunk2.length)
n2 = this.chunk2.charCodeAt(t2 - this.chunk2Pos);
else {
for (var o2 = this.rangeIndex, a2 = this.range; a2.to <= t2; )
a2 = this.ranges[++o2];
this.chunk2 = this.input.chunk(this.chunk2Pos = t2), t2 + this.chunk2.length > a2.to && (this.chunk2 = this.chunk2.slice(0, a2.to - t2)), n2 = this.chunk2.charCodeAt(0);
}
}
return t2 >= this.token.lookAhead && (this.token.lookAhead = t2 + 1), n2;
} }, { key: "acceptToken", value: function(e19) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, n2 = t2 ? this.resolveOffset(t2, -1) : this.pos;
if (null == n2 || n2 < this.token.start)
throw new RangeError("Token end out of bounds");
this.token.value = e19, this.token.end = n2;
} }, { key: "getChunk", value: function() {
if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {
var e19 = this.chunk, t2 = this.chunkPos;
this.chunk = this.chunk2, this.chunkPos = this.chunk2Pos, this.chunk2 = e19, this.chunk2Pos = t2, this.chunkOff = this.pos - this.chunkPos;
} else {
this.chunk2 = this.chunk, this.chunk2Pos = this.chunkPos;
var n2 = this.input.chunk(this.pos), r2 = this.pos + n2.length;
this.chunk = r2 > this.range.to ? n2.slice(0, this.range.to - this.pos) : n2, this.chunkPos = this.pos, this.chunkOff = 0;
}
} }, { key: "readNext", value: function() {
return this.chunkOff >= this.chunk.length && (this.getChunk(), this.chunkOff == this.chunk.length) ? this.next = -1 : this.next = this.chunk.charCodeAt(this.chunkOff);
} }, { key: "advance", value: function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1;
for (this.chunkOff += e19; this.pos + e19 >= this.range.to; ) {
if (this.rangeIndex == this.ranges.length - 1)
return this.setDone();
e19 -= this.range.to - this.pos, this.range = this.ranges[++this.rangeIndex], this.pos = this.range.from;
}
return this.pos += e19, this.pos >= this.token.lookAhead && (this.token.lookAhead = this.pos + 1), this.readNext();
} }, { key: "setDone", value: function() {
return this.pos = this.chunkPos = this.end, this.range = this.ranges[this.rangeIndex = this.ranges.length - 1], this.chunk = "", this.next = -1;
} }, { key: "reset", value: function(e19, t2) {
if (t2 ? (this.token = t2, t2.start = e19, t2.lookAhead = e19 + 1, t2.value = t2.extended = -1) : this.token = dz, this.pos != e19) {
if (this.pos = e19, e19 == this.end)
return this.setDone(), this;
for (; e19 < this.range.from; )
this.range = this.ranges[--this.rangeIndex];
for (; e19 >= this.range.to; )
this.range = this.ranges[++this.rangeIndex];
e19 >= this.chunkPos && e19 < this.chunkPos + this.chunk.length ? this.chunkOff = e19 - this.chunkPos : (this.chunk = "", this.chunkOff = 0), this.readNext();
}
return this;
} }, { key: "read", value: function(e19, t2) {
if (e19 >= this.chunkPos && t2 <= this.chunkPos + this.chunk.length)
return this.chunk.slice(e19 - this.chunkPos, t2 - this.chunkPos);
if (e19 >= this.chunk2Pos && t2 <= this.chunk2Pos + this.chunk2.length)
return this.chunk2.slice(e19 - this.chunk2Pos, t2 - this.chunk2Pos);
if (e19 >= this.range.from && t2 <= this.range.to)
return this.input.read(e19, t2);
var n2, r2 = "", i2 = bi(this.ranges);
try {
for (i2.s(); !(n2 = i2.n()).done; ) {
var o2 = n2.value;
if (o2.from >= t2)
break;
o2.to > e19 && (r2 += this.input.read(Math.max(o2.from, e19), Math.min(o2.to, t2)));
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
return r2;
} }]), e18;
}(), pz = function() {
function e18(t2, n2) {
Ri(this, e18), this.data = t2, this.id = n2;
}
return Li(e18, [{ key: "token", value: function(e19, t2) {
!function(e20, t3, n2, r2) {
var i2 = 0, o2 = 1 << r2, a2 = n2.p.parser, s2 = a2.dialect;
e:
for (; 0 != (o2 & e20[i2]); ) {
for (var u2 = e20[i2 + 1], c2 = i2 + 3; c2 < u2; c2 += 2)
if ((e20[c2 + 1] & o2) > 0) {
var l2 = e20[c2];
if (s2.allows(l2) && (-1 == t3.token.value || t3.token.value == l2 || a2.overrides(l2, t3.token.value))) {
t3.acceptToken(l2);
break;
}
}
var f2 = t3.next, h2 = 0, d2 = e20[i2 + 2];
if (!(t3.next < 0 && d2 > h2 && 65535 == e20[u2 + 3 * d2 - 3])) {
for (; h2 < d2; ) {
var v2 = h2 + d2 >> 1, p2 = u2 + v2 + (v2 << 1), m2 = e20[p2], g2 = e20[p2 + 1];
if (f2 < m2)
d2 = v2;
else {
if (!(f2 >= g2)) {
i2 = e20[p2 + 2], t3.advance();
continue e;
}
h2 = v2 + 1;
}
}
break;
}
i2 = e20[u2 + 3 * d2 - 1];
}
}(this.data, e19, t2, this.id);
} }]), e18;
}();
function mz(e18) {
var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Uint16Array;
if ("string" != typeof e18)
return e18;
for (var n2 = null, r2 = 0, i2 = 0; r2 < e18.length; ) {
for (var o2 = 0; ; ) {
var a2 = e18.charCodeAt(r2++), s2 = false;
if (126 == a2) {
o2 = 65535;
break;
}
a2 >= 92 && a2--, a2 >= 34 && a2--;
var u2 = a2 - 32;
if (u2 >= 46 && (u2 -= 46, s2 = true), o2 += u2, s2)
break;
o2 *= 46;
}
n2 ? n2[i2++] = o2 : n2 = new t2(o2);
}
return n2;
}
pz.prototype.contextual = pz.prototype.fallback = pz.prototype.extend = false;
var gz, yz = "undefined" != typeof process && process.env && /\bparse\b/.test({}.LOG), bz = null;
function kz(e18, t2, n2) {
var r2 = e18.cursor(_A.IncludeAnonymous);
for (r2.moveTo(t2); ; )
if (!(n2 < 0 ? r2.childBefore(t2) : r2.childAfter(t2)))
for (; ; ) {
if ((n2 < 0 ? r2.to < t2 : r2.from > t2) && !r2.type.isError)
return n2 < 0 ? Math.max(0, Math.min(r2.to - 1, t2 - 25)) : Math.min(e18.length, Math.max(r2.from + 1, t2 + 25));
if (n2 < 0 ? r2.prevSibling() : r2.nextSibling())
break;
if (!r2.parent())
return n2 < 0 ? 0 : e18.length;
}
}
!function(e18) {
e18[e18.Margin = 25] = "Margin";
}(gz || (gz = {}));
var wz, jz = function() {
function e18(t2, n2) {
Ri(this, e18), this.fragments = t2, this.nodeSet = n2, this.i = 0, this.fragment = null, this.safeFrom = -1, this.safeTo = -1, this.trees = [], this.start = [], this.index = [], this.nextFragment();
}
return Li(e18, [{ key: "nextFragment", value: function() {
var e19 = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];
if (e19) {
for (this.safeFrom = e19.openStart ? kz(e19.tree, e19.from + e19.offset, 1) - e19.offset : e19.from, this.safeTo = e19.openEnd ? kz(e19.tree, e19.to + e19.offset, -1) - e19.offset : e19.to; this.trees.length; )
this.trees.pop(), this.start.pop(), this.index.pop();
this.trees.push(e19.tree), this.start.push(-e19.offset), this.index.push(0), this.nextStart = this.safeFrom;
} else
this.nextStart = 1e9;
} }, { key: "nodeAt", value: function(e19) {
if (e19 < this.nextStart)
return null;
for (; this.fragment && this.safeTo <= e19; )
this.nextFragment();
if (!this.fragment)
return null;
for (; ; ) {
var t2 = this.trees.length - 1;
if (t2 < 0)
return this.nextFragment(), null;
var n2 = this.trees[t2], r2 = this.index[t2];
if (r2 != n2.children.length) {
var i2 = n2.children[r2], o2 = this.start[t2] + n2.positions[r2];
if (o2 > e19)
return this.nextStart = o2, null;
if (i2 instanceof MA) {
if (o2 == e19) {
if (o2 < this.safeFrom)
return null;
var a2 = o2 + i2.length;
if (a2 <= this.safeTo) {
var s2 = i2.prop(jA.lookAhead);
if (!s2 || a2 + s2 < this.fragment.to)
return i2;
}
}
this.index[t2]++, o2 + i2.length >= Math.max(this.safeFrom, e19) && (this.trees.push(i2), this.start.push(o2), this.index.push(0));
} else
this.index[t2]++, this.nextStart = o2 + i2.length;
} else
this.trees.pop(), this.start.pop(), this.index.pop();
}
} }]), e18;
}(), xz = function() {
function e18(t2, n2) {
Ri(this, e18), this.stream = n2, this.tokens = [], this.mainToken = null, this.actions = [], this.tokens = t2.tokenizers.map(function(e19) {
return new hz();
});
}
return Li(e18, [{ key: "getActions", value: function(e19) {
for (var t2 = 0, n2 = null, r2 = e19.p.parser, i2 = r2.tokenizers, o2 = r2.stateSlot(e19.state, 3), a2 = e19.curContext ? e19.curContext.hash : 0, s2 = 0, u2 = 0; u2 < i2.length; u2++)
if (0 != (1 << u2 & o2)) {
var c2 = i2[u2], l2 = this.tokens[u2];
if ((!n2 || c2.fallback) && ((c2.contextual || l2.start != e19.pos || l2.mask != o2 || l2.context != a2) && (this.updateCachedToken(l2, c2, e19), l2.mask = o2, l2.context = a2), l2.lookAhead > l2.end + 25 && (s2 = Math.max(l2.lookAhead, s2)), 0 != l2.value)) {
var f2 = t2;
if (l2.extended > -1 && (t2 = this.addActions(e19, l2.extended, l2.end, t2)), t2 = this.addActions(e19, l2.value, l2.end, t2), !c2.extend && (n2 = l2, t2 > f2))
break;
}
}
for (; this.actions.length > t2; )
this.actions.pop();
return s2 && e19.setLookAhead(s2), n2 || e19.pos != this.stream.end || ((n2 = new hz()).value = e19.p.parser.eofTerm, n2.start = n2.end = e19.pos, t2 = this.addActions(e19, n2.value, n2.end, t2)), this.mainToken = n2, this.actions;
} }, { key: "getMainToken", value: function(e19) {
if (this.mainToken)
return this.mainToken;
var t2 = new hz(), n2 = e19.pos, r2 = e19.p;
return t2.start = n2, t2.end = Math.min(n2 + 1, r2.stream.end), t2.value = n2 == r2.stream.end ? r2.parser.eofTerm : 0, t2;
} }, { key: "updateCachedToken", value: function(e19, t2, n2) {
var r2 = this.stream.clipPos(n2.pos);
if (t2.token(this.stream.reset(r2, e19), n2), e19.value > -1) {
for (var i2 = n2.p.parser, o2 = 0; o2 < i2.specialized.length; o2++)
if (i2.specialized[o2] == e19.value) {
var a2 = i2.specializers[o2](this.stream.read(e19.start, e19.end), n2);
if (a2 >= 0 && n2.p.parser.dialect.allows(a2 >> 1)) {
0 == (1 & a2) ? e19.value = a2 >> 1 : e19.extended = a2 >> 1;
break;
}
}
} else
e19.value = 0, e19.end = this.stream.clipPos(r2 + 1);
} }, { key: "putAction", value: function(e19, t2, n2, r2) {
for (var i2 = 0; i2 < r2; i2 += 3)
if (this.actions[i2] == e19)
return r2;
return this.actions[r2++] = e19, this.actions[r2++] = t2, this.actions[r2++] = n2, r2;
} }, { key: "addActions", value: function(e19, t2, n2, r2) {
for (var i2 = e19.state, o2 = e19.p.parser, a2 = o2.data, s2 = 0; s2 < 2; s2++)
for (var u2 = o2.stateSlot(i2, s2 ? 2 : 1); ; u2 += 3) {
if (65535 == a2[u2]) {
if (1 != a2[u2 + 1]) {
0 == r2 && 2 == a2[u2 + 1] && (r2 = this.putAction(Oz(a2, u2 + 2), t2, n2, r2));
break;
}
u2 = Oz(a2, u2 + 2);
}
a2[u2] == t2 && (r2 = this.putAction(Oz(a2, u2 + 1), t2, n2, r2));
}
return r2;
} }]), e18;
}();
!function(e18) {
e18[e18.Distance = 5] = "Distance", e18[e18.MaxRemainingPerStep = 3] = "MaxRemainingPerStep", e18[e18.MinBufferLengthPrune = 500] = "MinBufferLengthPrune", e18[e18.ForceReduceLimit = 10] = "ForceReduceLimit", e18[e18.CutDepth = 15e3] = "CutDepth", e18[e18.CutTo = 9e3] = "CutTo";
}(wz || (wz = {}));
var Sz = function() {
function e18(t2, n2, r2, i2) {
Ri(this, e18), this.parser = t2, this.input = n2, this.ranges = i2, this.recovering = 0, this.nextStackID = 9812, this.minStackPos = 0, this.reused = [], this.stoppedAt = null, this.stream = new vz(n2, i2), this.tokens = new xz(t2, this.stream), this.topTerm = t2.top[1];
var o2 = i2[0].from;
this.stacks = [uz.start(this, t2.top[0], o2)], this.fragments = r2.length && this.stream.end - o2 > 4 * t2.bufferLength ? new jz(r2, t2.nodeSet) : null;
}
return Li(e18, [{ key: "parsedPos", get: function() {
return this.minStackPos;
} }, { key: "advance", value: function() {
for (var e19, t2, n2 = this.stacks, r2 = this.minStackPos, i2 = this.stacks = [], o2 = 0; o2 < n2.length; o2++)
for (var a2 = n2[o2]; ; ) {
if (this.tokens.mainToken = null, a2.pos > r2)
i2.push(a2);
else {
if (this.advanceStack(a2, i2, n2))
continue;
e19 || (e19 = [], t2 = []), e19.push(a2);
var s2 = this.tokens.getMainToken(a2);
t2.push(s2.value, s2.end);
}
break;
}
if (!i2.length) {
var u2 = e19 && function(e20) {
var t3, n3 = null, r3 = bi(e20);
try {
for (r3.s(); !(t3 = r3.n()).done; ) {
var i3 = t3.value, o3 = i3.p.stoppedAt;
(i3.pos == i3.p.stream.end || null != o3 && i3.pos > o3) && i3.p.parser.stateFlag(i3.state, 2) && (!n3 || n3.score < i3.score) && (n3 = i3);
}
} catch (e21) {
r3.e(e21);
} finally {
r3.f();
}
return n3;
}(e19);
if (u2)
return this.stackToTree(u2);
if (this.parser.strict)
throw yz && e19 && console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none")), new SyntaxError("No parse at " + r2);
this.recovering || (this.recovering = 5);
}
if (this.recovering && e19) {
var c2 = null != this.stoppedAt && e19[0].pos > this.stoppedAt ? e19[0] : this.runRecovery(e19, t2, i2);
if (c2)
return this.stackToTree(c2.forceAll());
}
if (this.recovering) {
var l2 = 1 == this.recovering ? 1 : 3 * this.recovering;
if (i2.length > l2)
for (i2.sort(function(e20, t3) {
return t3.score - e20.score;
}); i2.length > l2; )
i2.pop();
i2.some(function(e20) {
return e20.reducePos > r2;
}) && this.recovering--;
} else if (i2.length > 1)
e:
for (var f2 = 0; f2 < i2.length - 1; f2++)
for (var h2 = i2[f2], d2 = f2 + 1; d2 < i2.length; d2++) {
var v2 = i2[d2];
if (h2.sameState(v2) || h2.buffer.length > 500 && v2.buffer.length > 500) {
if (!((h2.score - v2.score || h2.buffer.length - v2.buffer.length) > 0)) {
i2.splice(f2--, 1);
continue e;
}
i2.splice(d2--, 1);
}
}
this.minStackPos = i2[0].pos;
for (var p2 = 1; p2 < i2.length; p2++)
i2[p2].pos < this.minStackPos && (this.minStackPos = i2[p2].pos);
return null;
} }, { key: "stopAt", value: function(e19) {
if (null != this.stoppedAt && this.stoppedAt < e19)
throw new RangeError("Can't move stoppedAt forward");
this.stoppedAt = e19;
} }, { key: "advanceStack", value: function(e19, t2, n2) {
var r2 = e19.pos, i2 = this.parser, o2 = yz ? this.stackID(e19) + " -> " : "";
if (null != this.stoppedAt && r2 > this.stoppedAt)
return e19.forceReduce() ? e19 : null;
if (this.fragments)
for (var a2 = e19.curContext && e19.curContext.tracker.strict, s2 = a2 ? e19.curContext.hash : 0, u2 = this.fragments.nodeAt(r2); u2; ) {
var c2 = this.parser.nodeSet.types[u2.type.id] == u2.type ? i2.getGoto(e19.state, u2.type.id) : -1;
if (c2 > -1 && u2.length && (!a2 || (u2.prop(jA.contextHash) || 0) == s2))
return e19.useNode(u2, c2), yz && console.log(o2 + this.stackID(e19) + " (via reuse of ".concat(i2.getName(u2.type.id), ")")), true;
if (!(u2 instanceof MA) || 0 == u2.children.length || u2.positions[0] > 0)
break;
var l2 = u2.children[0];
if (!(l2 instanceof MA && 0 == u2.positions[0]))
break;
u2 = l2;
}
var f2 = i2.stateSlot(e19.state, 4);
if (f2 > 0)
return e19.reduce(f2), yz && console.log(o2 + this.stackID(e19) + " (via always-reduce ".concat(i2.getName(65535 & f2), ")")), true;
if (e19.stack.length >= 15e3)
for (; e19.stack.length > 9e3 && e19.forceReduce(); )
;
for (var h2 = this.tokens.getActions(e19), d2 = 0; d2 < h2.length; ) {
var v2 = h2[d2++], p2 = h2[d2++], m2 = h2[d2++], g2 = d2 == h2.length || !n2, y2 = g2 ? e19 : e19.split();
if (y2.apply(v2, p2, m2), yz && console.log(o2 + this.stackID(y2) + " (via ".concat(0 == (65536 & v2) ? "shift" : "reduce of ".concat(i2.getName(65535 & v2)), " for ").concat(i2.getName(p2), " @ ").concat(r2).concat(y2 == e19 ? "" : ", split", ")")), g2)
return true;
y2.pos > r2 ? t2.push(y2) : n2.push(y2);
}
return false;
} }, { key: "advanceFully", value: function(e19, t2) {
for (var n2 = e19.pos; ; ) {
if (!this.advanceStack(e19, null, null))
return false;
if (e19.pos > n2)
return _z(e19, t2), true;
}
} }, { key: "runRecovery", value: function(e19, t2, n2) {
for (var r2 = null, i2 = false, o2 = 0; o2 < e19.length; o2++) {
var a2 = e19[o2], s2 = t2[o2 << 1], u2 = t2[1 + (o2 << 1)], c2 = yz ? this.stackID(a2) + " -> " : "";
if (a2.deadEnd) {
if (i2)
continue;
if (i2 = true, a2.restart(), yz && console.log(c2 + this.stackID(a2) + " (restarted)"), this.advanceFully(a2, n2))
continue;
}
for (var l2 = a2.split(), f2 = c2, h2 = 0; l2.forceReduce() && h2 < 10; h2++) {
if (yz && console.log(f2 + this.stackID(l2) + " (via force-reduce)"), this.advanceFully(l2, n2))
break;
yz && (f2 = this.stackID(l2) + " -> ");
}
var d2, v2 = bi(a2.recoverByInsert(s2));
try {
for (v2.s(); !(d2 = v2.n()).done; ) {
var p2 = d2.value;
yz && console.log(c2 + this.stackID(p2) + " (via recover-insert)"), this.advanceFully(p2, n2);
}
} catch (e20) {
v2.e(e20);
} finally {
v2.f();
}
this.stream.end > a2.pos ? (u2 == a2.pos && (u2++, s2 = 0), a2.recoverByDelete(s2, u2), yz && console.log(c2 + this.stackID(a2) + " (via recover-delete ".concat(this.parser.getName(s2), ")")), _z(a2, n2)) : (!r2 || r2.score < a2.score) && (r2 = a2);
}
return r2;
} }, { key: "stackToTree", value: function(e19) {
return e19.close(), MA.build({ buffer: fz.create(e19), nodeSet: this.parser.nodeSet, topID: this.topTerm, maxBufferLength: this.parser.bufferLength, reused: this.reused, start: this.ranges[0].from, length: e19.pos - this.ranges[0].from, minRepeatType: this.parser.minRepeatTerm });
} }, { key: "stackID", value: function(e19) {
var t2 = (bz || (bz = /* @__PURE__ */ new WeakMap())).get(e19);
return t2 || bz.set(e19, t2 = String.fromCodePoint(this.nextStackID++)), t2 + e19;
} }]), e18;
}();
function _z(e18, t2) {
for (var n2 = 0; n2 < t2.length; n2++) {
var r2 = t2[n2];
if (r2.pos == e18.pos && r2.sameState(e18))
return void (t2[n2].score < e18.score && (t2[n2] = e18));
}
t2.push(e18);
}
var Cz = function() {
function e18(t2, n2, r2) {
Ri(this, e18), this.source = t2, this.flags = n2, this.disabled = r2;
}
return Li(e18, [{ key: "allows", value: function(e19) {
return !this.disabled || 0 == this.disabled[e19];
} }]), e18;
}(), $z = function(e18) {
Ci(n2, UA);
var t2 = Oi(n2);
function n2(e19) {
var r2, i2;
if (Ri(this, n2), (i2 = t2.call(this)).wrappers = [], 14 != e19.version)
throw new RangeError("Parser version (".concat(e19.version, ") doesn't match runtime version (", 14, ")"));
var o2 = e19.nodeNames.split(" ");
i2.minRepeatTerm = o2.length;
for (var a2 = 0; a2 < e19.repeatNodeCount; a2++)
o2.push("");
for (var s2 = Object.keys(e19.topRules).map(function(t3) {
return e19.topRules[t3][1];
}), u2 = [], c2 = 0; c2 < o2.length; c2++)
u2.push([]);
function l2(e20, t3, n3) {
u2[e20].push([t3, t3.deserialize(String(n3))]);
}
if (e19.nodeProps) {
var f2, h2 = bi(e19.nodeProps);
try {
for (h2.s(); !(f2 = h2.n()).done; ) {
var d2 = f2.value, v2 = d2[0];
"string" == typeof v2 && (v2 = jA[v2]);
for (var p2 = 1; p2 < d2.length; ) {
var m2 = d2[p2++];
if (m2 >= 0)
l2(m2, v2, d2[p2++]);
else {
for (var g2 = d2[p2 + -m2], y2 = -m2; y2 > 0; y2--)
l2(d2[p2++], v2, g2);
p2++;
}
}
}
} catch (e20) {
h2.e(e20);
} finally {
h2.f();
}
}
i2.nodeSet = new CA(o2.map(function(t3, n3) {
return SA.define({ name: n3 >= i2.minRepeatTerm ? void 0 : t3, id: n3, props: u2[n3], top: s2.indexOf(n3) > -1, error: 0 == n3, skipped: e19.skippedNodes && e19.skippedNodes.indexOf(n3) > -1 });
})), e19.propSources && (i2.nodeSet = (r2 = i2.nodeSet).extend.apply(r2, Ti(e19.propSources))), i2.strict = false, i2.bufferLength = 1024;
var b2 = mz(e19.tokenData);
i2.context = e19.context, i2.specializerSpecs = e19.specialized || [], i2.specialized = new Uint16Array(i2.specializerSpecs.length);
for (var k2 = 0; k2 < i2.specializerSpecs.length; k2++)
i2.specialized[k2] = i2.specializerSpecs[k2].term;
return i2.specializers = i2.specializerSpecs.map(Ez), i2.states = mz(e19.states, Uint32Array), i2.data = mz(e19.stateData), i2.goto = mz(e19.goto), i2.maxTerm = e19.maxTerm, i2.tokenizers = e19.tokenizers.map(function(e20) {
return "number" == typeof e20 ? new pz(b2, e20) : e20;
}), i2.topRules = e19.topRules, i2.dialects = e19.dialects || {}, i2.dynamicPrecedences = e19.dynamicPrecedences || null, i2.tokenPrecTable = e19.tokenPrec, i2.termNames = e19.termNames || null, i2.maxNode = i2.nodeSet.types.length - 1, i2.dialect = i2.parseDialect(), i2.top = i2.topRules[Object.keys(i2.topRules)[0]], i2;
}
return Li(n2, [{ key: "createParse", value: function(e19, t3, n3) {
var r2, i2 = new Sz(this, e19, t3, n3), o2 = bi(this.wrappers);
try {
for (o2.s(); !(r2 = o2.n()).done; ) {
i2 = (0, r2.value)(i2, e19, t3, n3);
}
} catch (e20) {
o2.e(e20);
} finally {
o2.f();
}
return i2;
} }, { key: "getGoto", value: function(e19, t3) {
var n3 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r2 = this.goto;
if (t3 >= r2[0])
return -1;
for (var i2 = r2[t3 + 1]; ; ) {
var o2 = r2[i2++], a2 = 1 & o2, s2 = r2[i2++];
if (a2 && n3)
return s2;
for (var u2 = i2 + (o2 >> 1); i2 < u2; i2++)
if (r2[i2] == e19)
return s2;
if (a2)
return -1;
}
} }, { key: "hasAction", value: function(e19, t3) {
for (var n3 = this.data, r2 = 0; r2 < 2; r2++)
for (var i2, o2 = this.stateSlot(e19, r2 ? 2 : 1); ; o2 += 3) {
if (65535 == (i2 = n3[o2])) {
if (1 != n3[o2 + 1]) {
if (2 == n3[o2 + 1])
return Oz(n3, o2 + 2);
break;
}
i2 = n3[o2 = Oz(n3, o2 + 2)];
}
if (i2 == t3 || 0 == i2)
return Oz(n3, o2 + 1);
}
return 0;
} }, { key: "stateSlot", value: function(e19, t3) {
return this.states[6 * e19 + t3];
} }, { key: "stateFlag", value: function(e19, t3) {
return (this.stateSlot(e19, 0) & t3) > 0;
} }, { key: "validAction", value: function(e19, t3) {
if (t3 == this.stateSlot(e19, 4))
return true;
for (var n3 = this.stateSlot(e19, 1); ; n3 += 3) {
if (65535 == this.data[n3]) {
if (1 != this.data[n3 + 1])
return false;
n3 = Oz(this.data, n3 + 2);
}
if (t3 == Oz(this.data, n3 + 1))
return true;
}
} }, { key: "nextStates", value: function(e19) {
for (var t3 = this, n3 = [], r2 = this.stateSlot(e19, 1); ; r2 += 3) {
if (65535 == this.data[r2]) {
if (1 != this.data[r2 + 1])
break;
r2 = Oz(this.data, r2 + 2);
}
0 == (1 & this.data[r2 + 2]) && function() {
var e20 = t3.data[r2 + 1];
n3.some(function(t4, n4) {
return 1 & n4 && t4 == e20;
}) || n3.push(t3.data[r2], e20);
}();
}
return n3;
} }, { key: "overrides", value: function(e19, t3) {
var n3 = Mz(this.data, this.tokenPrecTable, t3);
return n3 < 0 || Mz(this.data, this.tokenPrecTable, e19) < n3;
} }, { key: "configure", value: function(e19) {
var t3, r2 = Object.assign(Object.create(n2.prototype), this);
if (e19.props && (r2.nodeSet = (t3 = this.nodeSet).extend.apply(t3, Ti(e19.props))), e19.top) {
var i2 = this.topRules[e19.top];
if (!i2)
throw new RangeError("Invalid top rule name ".concat(e19.top));
r2.top = i2;
}
return e19.tokenizers && (r2.tokenizers = this.tokenizers.map(function(t4) {
var n3 = e19.tokenizers.find(function(e20) {
return e20.from == t4;
});
return n3 ? n3.to : t4;
})), e19.specializers && (r2.specializers = this.specializers.slice(), r2.specializerSpecs = this.specializerSpecs.map(function(t4, n3) {
var i3 = e19.specializers.find(function(e20) {
return e20.from == t4.external;
});
if (!i3)
return t4;
var o2 = Object.assign(Object.assign({}, t4), { external: i3.to });
return r2.specializers[n3] = Ez(o2), o2;
})), e19.contextTracker && (r2.context = e19.contextTracker), e19.dialect && (r2.dialect = this.parseDialect(e19.dialect)), null != e19.strict && (r2.strict = e19.strict), e19.wrap && (r2.wrappers = r2.wrappers.concat(e19.wrap)), null != e19.bufferLength && (r2.bufferLength = e19.bufferLength), r2;
} }, { key: "hasWrappers", value: function() {
return this.wrappers.length > 0;
} }, { key: "getName", value: function(e19) {
return this.termNames ? this.termNames[e19] : String(e19 <= this.maxNode && this.nodeSet.types[e19].name || e19);
} }, { key: "eofTerm", get: function() {
return this.maxNode + 1;
} }, { key: "topNode", get: function() {
return this.nodeSet.types[this.top[1]];
} }, { key: "dynamicPrecedence", value: function(e19) {
var t3 = this.dynamicPrecedences;
return null == t3 ? 0 : t3[e19] || 0;
} }, { key: "parseDialect", value: function(e19) {
var t3 = Object.keys(this.dialects), n3 = t3.map(function() {
return false;
});
if (e19) {
var r2, i2 = bi(e19.split(" "));
try {
for (i2.s(); !(r2 = i2.n()).done; ) {
var o2 = r2.value, a2 = t3.indexOf(o2);
a2 >= 0 && (n3[a2] = true);
}
} catch (e20) {
i2.e(e20);
} finally {
i2.f();
}
}
for (var s2 = null, u2 = 0; u2 < t3.length; u2++)
if (!n3[u2])
for (var c2, l2 = this.dialects[t3[u2]]; 65535 != (c2 = this.data[l2++]); )
(s2 || (s2 = new Uint8Array(this.maxTerm + 1)))[c2] = 1;
return new Cz(e19, n3, s2);
} }], [{ key: "deserialize", value: function(e19) {
return new n2(e19);
} }]), n2;
}();
function Oz(e18, t2) {
return e18[t2] | e18[t2 + 1] << 16;
}
function Mz(e18, t2, n2) {
for (var r2, i2 = t2; 65535 != (r2 = e18[i2]); i2++)
if (r2 == n2)
return i2 - t2;
return -1;
}
function Ez(e18) {
if (e18.external) {
var t2 = e18.extend ? 1 : 0;
return function(n2, r2) {
return e18.external(n2, r2) << 1 | t2;
};
}
return e18.get;
}
var Pz = eT({ String: xT.string, Number: xT.number, "True False": xT.bool, PropertyName: xT.propertyName, Null: xT.null, ",": xT.separator, "[ ]": xT.squareBracket, "{ }": xT.brace }), Az = $z.deserialize({ version: 14, states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j", stateData: "#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O", goto: "!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R", nodeNames: "\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array", maxTerm: 25, nodeProps: [["openedBy", 7, "{", 12, "["], ["closedBy", 8, "}", 13, "]"]], propSources: [Pz], skippedNodes: [0], repeatNodeCount: 2, tokenData: "(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~", tokenizers: [0], topRules: { JsonText: [0, 1] }, tokenPrec: 0 }), Tz = $T.define({ parser: Az.configure({ props: [HT.add({ Object: YT({ except: /^\s*\}/ }), Array: YT({ except: /^\s*\]/ }) }), XT.add({ "Object Array": function(e18) {
var t2 = e18.firstChild, n2 = e18.lastChild;
return t2 && t2.to < n2.from ? { from: t2.to, to: n2.type.isError ? e18.to : n2.from } : null;
} })] }), languageData: { closeBrackets: { brackets: ["[", "{", '"'] }, indentOnInput: /^\s*[\}\]]$/ } });
function Iz(e18) {
co(e18, "svelte-1oo7hnc", ".jse-status-bar.svelte-1oo7hnc.svelte-1oo7hnc{background:var(--jse-panel-background);color:var(--jse-panel-color-readonly);font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);margin:0;border-top:var(--jse-panel-border);border-left:var(--jse-main-border);border-right:var(--jse-main-border);display:flex;gap:var(--jse-padding)}.jse-status-bar.svelte-1oo7hnc.svelte-1oo7hnc:last-child{border-bottom:var(--jse-main-border)}.jse-status-bar.svelte-1oo7hnc .jse-status-bar-info.svelte-1oo7hnc{padding:2px}");
}
function Nz(e18) {
var t2, n2, r2;
return { c: function() {
t2 = go("div"), n2 = bo("Line: "), r2 = bo(e18[0]), So(t2, "class", "jse-status-bar-info svelte-1oo7hnc");
}, m: function(e19, i2) {
vo(e19, t2, i2), uo(t2, n2), uo(t2, r2);
}, p: function(e19, t3) {
1 & t3 && Mo(r2, e19[0]);
}, d: function(e19) {
e19 && po(t2);
} };
}
function Rz(e18) {
var t2, n2, r2;
return { c: function() {
t2 = go("div"), n2 = bo("Column: "), r2 = bo(e18[1]), So(t2, "class", "jse-status-bar-info svelte-1oo7hnc");
}, m: function(e19, i2) {
vo(e19, t2, i2), uo(t2, n2), uo(t2, r2);
}, p: function(e19, t3) {
2 & t3 && Mo(r2, e19[1]);
}, d: function(e19) {
e19 && po(t2);
} };
}
function Dz(e18) {
var t2, n2, r2, i2;
return { c: function() {
t2 = go("div"), n2 = bo("Selection: "), r2 = bo(e18[2]), i2 = bo(" characters"), So(t2, "class", "jse-status-bar-info svelte-1oo7hnc");
}, m: function(e19, o2) {
vo(e19, t2, o2), uo(t2, n2), uo(t2, r2), uo(t2, i2);
}, p: function(e19, t3) {
4 & t3 && Mo(r2, e19[2]);
}, d: function(e19) {
e19 && po(t2);
} };
}
function Lz(e18) {
var t2, n2, r2, i2 = void 0 !== e18[0] && Nz(e18), o2 = void 0 !== e18[1] && Rz(e18), a2 = void 0 !== e18[2] && e18[2] > 0 && Dz(e18);
return { c: function() {
t2 = go("div"), i2 && i2.c(), n2 = ko(), o2 && o2.c(), r2 = ko(), a2 && a2.c(), So(t2, "class", "jse-status-bar svelte-1oo7hnc");
}, m: function(e19, s2) {
vo(e19, t2, s2), i2 && i2.m(t2, null), uo(t2, n2), o2 && o2.m(t2, null), uo(t2, r2), a2 && a2.m(t2, null);
}, p: function(e19, s2) {
var u2 = ki(s2, 1)[0];
void 0 !== e19[0] ? i2 ? i2.p(e19, u2) : ((i2 = Nz(e19)).c(), i2.m(t2, n2)) : i2 && (i2.d(1), i2 = null), void 0 !== e19[1] ? o2 ? o2.p(e19, u2) : ((o2 = Rz(e19)).c(), o2.m(t2, r2)) : o2 && (o2.d(1), o2 = null), void 0 !== e19[2] && e19[2] > 0 ? a2 ? a2.p(e19, u2) : ((a2 = Dz(e19)).c(), a2.m(t2, null)) : a2 && (a2.d(1), a2 = null);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2), i2 && i2.d(), o2 && o2.d(), a2 && a2.d();
} };
}
function zz(e18, t2, n2) {
var r2, i2, o2, a2, s2, u2 = t2.editorState;
return e18.$$set = function(e19) {
"editorState" in e19 && n2(3, u2 = e19.editorState);
}, e18.$$.update = function() {
var t3, c2, l2, f2, h2, d2, v2, p2;
8 & e18.$$.dirty && n2(4, r2 = null === (t3 = u2) || void 0 === t3 || null === (c2 = t3.selection) || void 0 === c2 || null === (l2 = c2.main) || void 0 === l2 ? void 0 : l2.head);
24 & e18.$$.dirty && n2(5, i2 = null === (f2 = u2) || void 0 === f2 || null === (h2 = f2.doc) || void 0 === h2 ? void 0 : h2.lineAt(r2));
(32 & e18.$$.dirty && n2(0, o2 = i2 ? i2.number : void 0), 48 & e18.$$.dirty && n2(1, a2 = i2 ? r2 - i2.from + 1 : void 0), 8 & e18.$$.dirty) && n2(2, s2 = null === (d2 = u2) || void 0 === d2 || null === (v2 = d2.selection) || void 0 === v2 || null === (p2 = v2.ranges) || void 0 === p2 ? void 0 : p2.reduce(function(e19, t4) {
return e19 + t4.to - t4.from;
}, 0));
}, [o2, a2, s2, u2, r2, i2];
}
var Bz = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, zz, Lz, Ui, { editorState: 3 }, Iz), r2;
}
return Li(n2);
}(), qz = yI.define([{ tag: xT.propertyName, color: "var(--jse-key-color)" }, { tag: xT.number, color: "var(--jse-value-color-number)" }, { tag: xT.bool, color: "var(--jse-value-color-boolean)" }, { tag: xT.string, color: "var(--jse-value-color-string)" }, { tag: xT.keyword, color: "var(--jse-value-color-null)" }]), Fz = jI(qz), Vz = qz.style;
function Wz(e18) {
return "object" === zi(e18.parseError) && null !== e18.parseError;
}
qz.style = function(e18) {
return Vz(e18 || []);
};
var Hz = Number.isNaN || function(e18) {
return "number" == typeof e18 && e18 != e18;
};
function Jz(e18, t2) {
if (e18.length !== t2.length)
return false;
for (var n2 = 0; n2 < e18.length; n2++)
if (r2 = e18[n2], i2 = t2[n2], !(r2 === i2 || Hz(r2) && Hz(i2)))
return false;
var r2, i2;
return true;
}
function Uz(e18, t2) {
void 0 === t2 && (t2 = Jz);
var n2 = null;
function r2() {
for (var r3 = [], i2 = 0; i2 < arguments.length; i2++)
r3[i2] = arguments[i2];
if (n2 && n2.lastThis === this && t2(r3, n2.lastArgs))
return n2.lastResult;
var o2 = e18.apply(this, r3);
return n2 = { lastResult: o2, lastArgs: r3, lastThis: this }, o2;
}
return r2.clear = function() {
n2 = null;
}, r2;
}
function Kz(e18, t2) {
var n2 = Date.now(), r2 = e18();
return t2(Date.now() - n2), r2;
}
var Gz = Da("validation");
function Qz(e18, t2, n2, r2) {
return Gz("validateJSON"), t2 ? t2(n2 !== r2 ? r2.parse(n2.stringify(e18)) : e18) : [];
}
function Yz(e18, t2, n2, r2) {
if (Gz("validateText"), e18.length > 104857600)
return { validationErrors: [{ path: [], message: "Validation turned off: the document is too large", severity: vj.info }] };
if (0 === e18.length)
return { validationErrors: [] };
try {
var i2 = Kz(function() {
return n2.parse(e18);
}, function(e19) {
return Gz("validate: parsed json in ".concat(e19, " ms"));
});
if (!t2)
return { validationErrors: [] };
var o2 = n2 === r2 ? i2 : Kz(function() {
return r2.parse(e18);
}, function(e19) {
return Gz("validate: parsed json with the validationParser in ".concat(e19, " ms"));
});
return { validationErrors: Kz(function() {
return t2(o2);
}, function(e19) {
return Gz("validate: validated json in ".concat(e19, " ms"));
}) };
} catch (t3) {
var a2 = Kz(function() {
return function(e19, t4) {
if (e19.length > 1048576)
return false;
try {
return t4.parse(Os(e19)), true;
} catch (e20) {
return false;
}
}(e18, n2);
}, function(e19) {
return Gz("validate: checked whether repairable in ".concat(e19, " ms"));
});
return { parseError: oj(e18, t3.message || t3.toString()), isRepairable: a2 };
}
}
function Zz(e18) {
co(e18, "svelte-o0o8bj", '.jse-text-mode.svelte-o0o8bj.svelte-o0o8bj{flex:1;box-sizing:border-box;display:flex;flex-direction:column;background:var(--jse-background-color)}.jse-text-mode.no-main-menu.svelte-o0o8bj.svelte-o0o8bj{border-top:var(--jse-main-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;min-height:0;border-left:var(--jse-main-border);border-right:var(--jse-main-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj:last-child{border-bottom:var(--jse-main-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.jse-hidden.svelte-o0o8bj{visibility:hidden}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor{flex:1;overflow:hidden}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-scroller{font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);line-height:var(--jse-line-height);color:var(--jse-delimiter-color)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-gutters{background:var(--jse-panel-background);color:var(--jse-panel-color-readonly);border-right:var(--jse-panel-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-activeLine,.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-activeLineGutter{background:var(--jse-hover-background-color)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-selectionBackground{background:var(--jse-selection-background-color)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-searchMatch{background-color:var(--jse-search-match-color);outline:var(--jse-search-match-outline)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-searchMatch.cm-searchMatch-selected{background-color:var(--jse-search-match-active-color);outline:var(--jse-search-match-active-outline)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-foldPlaceholder{background:var(--jse-tag-background);color:var(--jse-tag-color);border:none;padding:0 var(--jse-padding)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-tooltip{font-size:var(--jse-font-size);font-family:var(--jse-font-family);color:var(--jse-tooltip-color);background:var(--jse-tooltip-background);border:var(--jse-tooltip-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-diagnosticAction{background:var(--jse-tooltip-action-button-color);background:var(--jse-tooltip-action-button-background)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-panels{border-bottom:var(--jse-panel-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search{background:var(--jse-panel-background);color:var(--jse-panel-color);font-family:var(--jse-font-family);font-size:var(--jse-font-size)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search input{font-family:var(--jse-font-family);font-size:var(--jse-font-size-text-mode-search);color:var(--jse-input-color);border:var(--jse-input-border);background:var(--jse-input-background);margin-right:2px}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search button{font-family:var(--jse-font-family);font-size:var(--jse-font-size-text-mode-search);color:var(--jse-panel-button-color);background:var(--jse-panel-button-background);border:none;cursor:pointer;text-transform:capitalize;padding:calc(0.5 * var(--jse-padding)) var(--jse-padding);margin:0}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search button:hover{color:var(--jse-panel-button-color-highlight);background:var(--jse-panel-button-background-highlight)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search label{font-family:var(--jse-font-family);font-size:var(--jse-font-size-text-mode-search);padding-left:var(--jse-padding)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search label input{margin-right:2px}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search button[name="close"]{width:32px;height:32px;font-size:24px;line-height:24px;padding:0;right:0;top:-4px}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-cursor-primary{border-color:var(--jse-text-color)}.jse-text-mode.svelte-o0o8bj .jse-contents .jse-loading-space.svelte-o0o8bj{flex:1}.jse-text-mode.svelte-o0o8bj .jse-contents .jse-loading.svelte-o0o8bj{flex:2;text-align:center;color:var(--jse-panel-color-readonly);box-sizing:border-box;font-family:var(--jse-font-family);font-size:var(--jse-font-size)}');
}
function Xz(e18) {
var t2, n2;
return t2 = new XS({ props: { readOnly: e18[0], onFormat: e18[17], onCompact: e18[18], onSort: e18[19], onTransform: e18[20], onToggleSearch: e18[21], onUndo: e18[22], onRedo: e18[23], canFormat: !e18[15], canCompact: !e18[15], canSort: !e18[15], canTransform: !e18[15], canUndo: e18[11], canRedo: e18[12], onRenderMenu: e18[4] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
1 & n3[0] && (r2.readOnly = e19[0]), 32768 & n3[0] && (r2.canFormat = !e19[15]), 32768 & n3[0] && (r2.canCompact = !e19[15]), 32768 & n3[0] && (r2.canSort = !e19[15]), 32768 & n3[0] && (r2.canTransform = !e19[15]), 2048 & n3[0] && (r2.canUndo = e19[11]), 4096 & n3[0] && (r2.canRedo = e19[12]), 16 & n3[0] && (r2.onRenderMenu = e19[4]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function eB(e18) {
var t2;
return { c: function() {
(t2 = go("div")).innerHTML = ' \n loading...
', So(t2, "class", "jse-contents svelte-o0o8bj");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, p: Bi, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function tB(e18) {
var t2, n2, r2, i2, o2, a2, s2 = e18[10] && nB(e18), u2 = e18[2] && rB(e18), c2 = !e18[10] && iB(e18);
return { c: function() {
s2 && s2.c(), t2 = ko(), n2 = go("div"), r2 = ko(), u2 && u2.c(), i2 = ko(), c2 && c2.c(), o2 = wo(), So(n2, "class", "jse-contents svelte-o0o8bj"), Io(n2, "jse-hidden", e18[10]);
}, m: function(l2, f2) {
s2 && s2.m(l2, f2), vo(l2, t2, f2), vo(l2, n2, f2), e18[48](n2), vo(l2, r2, f2), u2 && u2.m(l2, f2), vo(l2, i2, f2), c2 && c2.m(l2, f2), vo(l2, o2, f2), a2 = true;
}, p: function(e19, r3) {
e19[10] ? s2 ? (s2.p(e19, r3), 1024 & r3[0] && ya(s2, 1)) : ((s2 = nB(e19)).c(), ya(s2, 1), s2.m(t2.parentNode, t2)) : s2 && (ma(), ba(s2, 1, 1, function() {
s2 = null;
}), ga()), (!a2 || 1024 & r3[0]) && Io(n2, "jse-hidden", e19[10]), e19[2] ? u2 ? (u2.p(e19, r3), 4 & r3[0] && ya(u2, 1)) : ((u2 = rB(e19)).c(), ya(u2, 1), u2.m(i2.parentNode, i2)) : u2 && (ma(), ba(u2, 1, 1, function() {
u2 = null;
}), ga()), e19[10] ? c2 && (ma(), ba(c2, 1, 1, function() {
c2 = null;
}), ga()) : c2 ? (c2.p(e19, r3), 1024 & r3[0] && ya(c2, 1)) : ((c2 = iB(e19)).c(), ya(c2, 1), c2.m(o2.parentNode, o2));
}, i: function(e19) {
a2 || (ya(s2), ya(u2), ya(c2), a2 = true);
}, o: function(e19) {
ba(s2), ba(u2), ba(c2), a2 = false;
}, d: function(a3) {
s2 && s2.d(a3), a3 && po(t2), a3 && po(n2), e18[48](null), a3 && po(r2), u2 && u2.d(a3), a3 && po(i2), c2 && c2.d(a3), a3 && po(o2);
} };
}
function nB(e18) {
var t2, n2;
return t2 = new mS({ props: { icon: Ix, type: "error", message: "The JSON document is larger than ".concat(Nx(10485760, 1024), ", ") + "and may crash your browser when loading it in text mode. Actual size: ".concat(Nx(e18[5].length, 1024), "."), actions: [{ text: "Open anyway", title: "Open the document in text mode. This may freeze or crash your browser.", onClick: e18[24] }, { text: "Open in tree mode", title: "Open the document in tree mode. Tree mode can handle large documents.", onClick: e18[3] }, { text: "Cancel", title: "Cancel opening this large document.", onClick: e18[25] }] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
32 & n3[0] && (r2.message = "The JSON document is larger than ".concat(Nx(10485760, 1024), ", ") + "and may crash your browser when loading it in text mode. Actual size: ".concat(Nx(e19[5].length, 1024), ".")), 8 & n3[0] && (r2.actions = [{ text: "Open anyway", title: "Open the document in text mode. This may freeze or crash your browser.", onClick: e19[24] }, { text: "Open in tree mode", title: "Open the document in tree mode. Tree mode can handle large documents.", onClick: e19[3] }, { text: "Cancel", title: "Cancel opening this large document.", onClick: e19[25] }]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function rB(e18) {
var t2, n2;
return t2 = new Bz({ props: { editorState: e18[8] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
256 & n3[0] && (r2.editorState = e19[8]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function iB(e18) {
var t2, n2, r2, i2 = e18[13] && oB(e18);
return n2 = new PS({ props: { validationErrors: e18[9], selectError: e18[26] } }), { c: function() {
i2 && i2.c(), t2 = ko(), Ma(n2.$$.fragment);
}, m: function(e19, o2) {
i2 && i2.m(e19, o2), vo(e19, t2, o2), Ea(n2, e19, o2), r2 = true;
}, p: function(e19, r3) {
e19[13] ? i2 ? (i2.p(e19, r3), 8192 & r3[0] && ya(i2, 1)) : ((i2 = oB(e19)).c(), ya(i2, 1), i2.m(t2.parentNode, t2)) : i2 && (ma(), ba(i2, 1, 1, function() {
i2 = null;
}), ga());
var o2 = {};
512 & r3[0] && (o2.validationErrors = e19[9]), n2.$set(o2);
}, i: function(e19) {
r2 || (ya(i2), ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(i2), ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
i2 && i2.d(e19), e19 && po(t2), Pa(n2, e19);
} };
}
function oB(e18) {
var t2, n2;
return t2 = new mS({ props: { type: "error", icon: Ix, message: e18[13].message, actions: e18[14], onClick: e18[49] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
8192 & n3[0] && (r2.message = e19[13].message), 16384 & n3[0] && (r2.actions = e19[14]), 8192 & n3[0] && (r2.onClick = e19[49]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function aB(e18) {
var t2, n2, r2, i2, o2, a2 = e18[1] && Xz(e18), s2 = [tB, eB], u2 = [];
return r2 = function(e19, t3) {
return e19[16] ? 1 : 0;
}(e18), i2 = u2[r2] = s2[r2](e18), { c: function() {
t2 = go("div"), a2 && a2.c(), n2 = ko(), i2.c(), So(t2, "class", "jse-text-mode svelte-o0o8bj"), Io(t2, "no-main-menu", !e18[1]);
}, m: function(i3, s3) {
vo(i3, t2, s3), a2 && a2.m(t2, null), uo(t2, n2), u2[r2].m(t2, null), e18[50](t2), o2 = true;
}, p: function(e19, r3) {
e19[1] ? a2 ? (a2.p(e19, r3), 2 & r3[0] && ya(a2, 1)) : ((a2 = Xz(e19)).c(), ya(a2, 1), a2.m(t2, n2)) : a2 && (ma(), ba(a2, 1, 1, function() {
a2 = null;
}), ga()), i2.p(e19, r3), (!o2 || 2 & r3[0]) && Io(t2, "no-main-menu", !e19[1]);
}, i: function(e19) {
o2 || (ya(a2), ya(i2), o2 = true);
}, o: function(e19) {
ba(a2), ba(i2), o2 = false;
}, d: function(n3) {
n3 && po(t2), a2 && a2.d(), u2[r2].d(), e18[50](null);
} };
}
function sB(e18) {
return { from: e18.from, to: e18.to, message: e18.message, actions: e18.actions, severity: e18.severity, source: void 0 };
}
function uB(e18, t2, n2) {
var r2, i2, o2, a2, s2, u2, c2, l2 = t2.readOnly, f2 = t2.mainMenuBar, h2 = t2.statusBar, d2 = t2.externalContent, v2 = t2.indentation, p2 = t2.tabSize, m2 = t2.escapeUnicodeCharacters, g2 = t2.parser, y2 = t2.validator, b2 = t2.validationParser, k2 = t2.onChange, w2 = t2.onSwitchToTreeMode, j2 = t2.onError, x2 = t2.onFocus, S2 = t2.onBlur, _2 = t2.onRenderMenu, C2 = t2.onSortModal, $2 = t2.onTransformModal, O2 = Da("jsoneditor:TextMode"), M2 = { key: "Mod-i", run: G2, shift: Q2, preventDefault: true }, E2 = "undefined" == typeof window;
O2("isSSR:", E2);
var P2 = false, A2 = [], T2 = new Q_(), I2 = new Q_(), N2 = new Q_(), R2 = new Q_(), D2 = new Q_(), L2 = d2, z2 = uj(L2, v2, g2), B2 = he2(z2, P2), q2 = m2;
Uo(yi(mi().mark(function e19() {
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (!E2) {
e20.next = 2;
break;
}
return e20.abrupt("return");
case 2:
try {
s2 = re2({ target: a2, initialText: B2 ? "" : i2.escapeValue(z2), readOnly: l2, indentation: v2 }), J2();
} catch (e21) {
console.error(e21);
}
case 3:
case "end":
return e20.stop();
}
}, e19);
}))), Ko(function() {
s2 && (O2("Destroy CodeMirror editor"), s2.destroy());
});
var F2 = false, V2 = false, W2 = Xk(), H2 = Xk();
function J2() {
s2 && (O2("focus"), s2.focus());
}
var U2 = false;
function K2(e19) {
O2("patch", e19);
var t3 = g2.parse(z2), n3 = fs.exports.immutableJSONPatch(t3, e19), r3 = fs.exports.revertJSONPatch(t3, e19);
return ae2({ text: g2.stringify(n3, null, v2) }), { json: n3, previousJson: t3, undo: r3, redo: e19 };
}
function G2() {
if (O2("format"), !l2)
try {
var e19 = g2.parse(z2);
ae2({ text: g2.stringify(e19, null, v2) });
} catch (e20) {
j2(e20);
}
}
function Q2() {
if (O2("compact"), !l2)
try {
var e19 = g2.parse(z2);
ae2({ text: g2.stringify(e19) });
} catch (e20) {
j2(e20);
}
}
function Y2() {
if (O2("repair"), !l2)
try {
ae2({ text: Os(z2) }), n2(47, de2 = "valid"), n2(13, ve2 = void 0);
} catch (e19) {
j2(e19);
}
}
function Z2(e19) {
var t3 = e19.id, n3 = e19.selectedPath, r3 = e19.onTransform, i3 = e19.onClose;
try {
var o3 = g2.parse(z2);
U2 = true, $2({ id: t3 || H2, json: o3, selectedPath: n3, onTransform: r3 ? function(e20) {
r3({ operations: e20, json: o3, transformedJson: fs.exports.immutableJSONPatch(o3, e20) });
} : function(e20) {
O2("onTransform", e20), K2(e20);
}, onClose: function() {
U2 = false, J2(), i3 && i3();
} });
} catch (e20) {
j2(e20);
}
}
function X2(e19) {
O2("select parse error", e19);
var t3 = oe2(e19, false);
ee2(t3.from, t3.to), J2();
}
function ee2(e19, t3) {
O2("setSelection", { anchor: e19, head: t3 }), s2 && s2.dispatch(s2.state.update({ selection: { anchor: e19, head: t3 }, scrollIntoView: true }));
}
function te2(e19, t3) {
if (1 === t3.state.selection.ranges.length) {
var n3 = t3.state.selection.ranges[0], r3 = z2.slice(n3.from, n3.to);
if ("{" === r3 || "[" === r3) {
var i3 = hs.parse(z2), o3 = Object.keys(i3.pointers).find(function(e20) {
var t4;
return (null === (t4 = i3.pointers[e20].value) || void 0 === t4 ? void 0 : t4.pos) === n3.from;
}), a3 = i3.pointers[o3];
if (o3 && a3 && a3.value && a3.valueEnd)
O2("pointer found, selecting inner contents of path:", o3, a3), ee2(a3.value.pos + 1, a3.valueEnd.pos - 1);
}
}
}
function ne2() {
return function(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
return FL.of({ source: e19, config: t3 });
}(pe2, { delay: 300 });
}
function re2(e19) {
var t3 = e19.target, r3 = e19.initialText, i3 = e19.readOnly, o3 = e19.indentation;
O2("Create CodeMirror editor", { readOnly: i3, indentation: o3 });
var a3 = xC.create({ doc: r3, extensions: [UE.of([OR, M2]), T2.of(ne2()), oz(), sz, Fz, LE.domEventHandlers({ dblclick: te2 }), LE.updateListener.of(function(e20) {
n2(8, c2 = e20.state), e20.docChanged && le2();
}), new LT(Tz), ZR({ top: true }), N2.of(xC.readOnly.of(i3)), I2.of(LE.editable.of(!i3)), D2.of(xC.tabSize.of(p2)), R2.of(ue2(o3)), LE.lineWrapping] });
return s2 = new LE({ state: a3, parent: t3 });
}
function ie2(e19) {
var t3 = e19.path, n3 = e19.message, r3 = function(e20, t4) {
try {
var n4 = hs.parse(e20), r4 = fs.exports.compileJSONPointer(t4), i3 = n4.pointers[r4];
if (i3)
return { path: t4, line: i3.key ? i3.key.line : i3.value ? i3.value.line : 0, column: i3.key ? i3.key.column : i3.value ? i3.value.column : 0, from: i3.key ? i3.key.pos : i3.value ? i3.value.pos : 0, to: i3.keyEnd ? i3.keyEnd.pos : i3.valueEnd ? i3.valueEnd.pos : 0 };
} catch (e21) {
console.error(e21);
}
return null;
}(z2, t3);
return { path: t3, line: r3.line, column: r3.column, from: r3.from, to: r3.to, message: n3, severity: vj.warning, actions: [] };
}
function oe2(e19, t3) {
var n3 = e19.line, r3 = e19.column, i3 = e19.position, o3 = e19.message;
return { path: null, line: n3, column: r3, from: i3 || 0, to: i3 || 0, severity: vj.error, message: o3, actions: t3 && !l2 ? [{ name: "Auto repair", apply: function() {
return Y2();
} }] : null };
}
function ae2(e19) {
var t3 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r3 = uj(e19, v2, g2);
if (n2(10, B2 = he2(r3, P2)), B2)
O2("externalContent not applying text: editor is disabled");
else {
var o3 = !Em(e19, L2);
if (O2("setCodeMirrorContent", { isChanged: o3, forceUpdate: t3 }), s2 && (o3 || t3)) {
var a3 = L2;
L2 = e19, n2(5, z2 = r3), s2.dispatch({ changes: { from: 0, to: s2.state.doc.length, insert: i2.escapeValue(z2) } }), ce2(), o3 && fe2(L2, a3);
}
}
}
function se2() {
if (s2) {
var e19 = s2 ? i2.unescapeValue(s2.state.doc.toString()) : "", t3 = e19 !== z2;
if (O2("onChangeCodeMirrorValue", { isChanged: t3 }), t3) {
var r3 = L2;
n2(5, z2 = e19), L2 = { text: z2 }, ce2(), fe2(L2, r3);
}
}
}
function ue2(e19) {
return BT.of("number" == typeof e19 ? " ".repeat(e19) : e19);
}
function ce2() {
n2(11, F2 = pN(s2.state) > 0), n2(12, V2 = mN(s2.state) > 0), O2({ canUndo: F2, canRedo: V2 });
}
Dx({ onMount: Uo, onDestroy: Ko, getWindow: function() {
return Dj(u2);
}, hasFocus: function() {
return U2 && document.hasFocus() || Lj(u2);
}, onFocus: x2, onBlur: S2 });
var le2 = uv(se2, 300);
function fe2(e19, t3) {
k2 && k2(e19, t3, { contentErrors: me2(), patchResult: null });
}
function he2(e19, t3) {
return e19 && e19.length > 10485760 && !t3;
}
var de2 = "valid", ve2 = null;
function pe2() {
if (B2)
return [];
var e19 = me2();
return Wz(e19) ? [sB(oe2(e19.parseError, e19.isRepairable))] : function(e20) {
return Array.isArray(e20.validationErrors);
}(e19) ? e19.validationErrors.map(ie2).map(sB) : [];
}
function me2() {
O2("validate:start"), le2.flush();
var e19 = ge2(z2, y2, g2, b2);
return Wz(e19) ? (n2(47, de2 = e19.isRepairable ? "repairable" : "invalid"), n2(13, ve2 = e19.parseError), n2(9, A2 = [])) : (n2(47, de2 = "valid"), n2(13, ve2 = null), n2(9, A2 = e19.validationErrors)), O2("validate:end"), e19;
}
var ge2 = Uz(Yz);
return e18.$$set = function(e19) {
"readOnly" in e19 && n2(0, l2 = e19.readOnly), "mainMenuBar" in e19 && n2(1, f2 = e19.mainMenuBar), "statusBar" in e19 && n2(2, h2 = e19.statusBar), "externalContent" in e19 && n2(28, d2 = e19.externalContent), "indentation" in e19 && n2(29, v2 = e19.indentation), "tabSize" in e19 && n2(30, p2 = e19.tabSize), "escapeUnicodeCharacters" in e19 && n2(31, m2 = e19.escapeUnicodeCharacters), "parser" in e19 && n2(32, g2 = e19.parser), "validator" in e19 && n2(33, y2 = e19.validator), "validationParser" in e19 && n2(34, b2 = e19.validationParser), "onChange" in e19 && n2(35, k2 = e19.onChange), "onSwitchToTreeMode" in e19 && n2(3, w2 = e19.onSwitchToTreeMode), "onError" in e19 && n2(36, j2 = e19.onError), "onFocus" in e19 && n2(37, x2 = e19.onFocus), "onBlur" in e19 && n2(38, S2 = e19.onBlur), "onRenderMenu" in e19 && n2(4, _2 = e19.onRenderMenu), "onSortModal" in e19 && n2(39, C2 = e19.onSortModal), "onTransformModal" in e19 && n2(40, $2 = e19.onTransformModal);
}, e18.$$.update = function() {
32 & e18.$$.dirty[0] && n2(15, r2 = 0 === z2.length), 1 & e18.$$.dirty[1] && (i2 = kj({ escapeControlCharacters: false, escapeUnicodeCharacters: m2 })), 268435456 & e18.$$.dirty[0] && ae2(d2), 4 & e18.$$.dirty[1] && function(e19) {
O2("updateLinter", e19), s2 && s2.dispatch({ effects: T2.reconfigure(ne2()) });
}(y2), 536870912 & e18.$$.dirty[0] && function(e19) {
s2 && (O2("updateIndentation", e19), s2.dispatch({ effects: R2.reconfigure(ue2(e19)) }));
}(v2), 1073741824 & e18.$$.dirty[0] && function(e19) {
s2 && (O2("updateTabSize", e19), s2.dispatch({ effects: D2.reconfigure(xC.tabSize.of(e19)) }));
}(p2), 1 & e18.$$.dirty[0] && function(e19) {
s2 && (O2("updateReadOnly", e19), s2.dispatch({ effects: [N2.reconfigure(xC.readOnly.of(e19)), I2.reconfigure(LE.editable.of(!e19))] }));
}(l2), 32769 & e18.$$.dirty[1] && q2 !== m2 && (n2(46, q2 = m2), O2("forceUpdateText", { escapeUnicodeCharacters: m2 }), s2 && s2.dispatch({ changes: { from: 0, to: s2.state.doc.length, insert: i2.escapeValue(z2) } })), 1 & e18.$$.dirty[0] | 65536 & e18.$$.dirty[1] && n2(14, o2 = "repairable" !== de2 || l2 ? [] : [{ icon: gx, text: "Auto repair", title: "Automatically repair JSON", onClick: Y2 }]);
}, [l2, f2, h2, w2, _2, z2, a2, u2, c2, A2, B2, F2, V2, ve2, o2, r2, E2, G2, Q2, function() {
var e19;
if (!l2)
try {
var t3 = g2.parse(z2);
U2 = true, C2({ id: W2, json: t3, selectedPath: [], onSort: (e19 = yi(mi().mark(function e20(t4) {
return mi().wrap(function(e21) {
for (; ; )
switch (e21.prev = e21.next) {
case 0:
O2("onSort", t4), K2(t4);
case 2:
case "end":
return e21.stop();
}
}, e20);
})), function(t4) {
return e19.apply(this, arguments);
}), onClose: function() {
U2 = false, J2();
} });
} catch (e20) {
j2(e20);
}
}, function() {
l2 || Z2({ selectedPath: [] });
}, function() {
s2 && (a2 && a2.querySelector(".cm-search") ? xD(s2) : jD(s2));
}, function() {
l2 || s2 && (lN(s2), J2());
}, function() {
l2 || s2 && (fN(s2), J2());
}, function() {
P2 = true, ae2(d2, true);
}, function() {
se2();
}, function(e19) {
O2("select validation error", e19);
var t3 = ie2(e19);
ee2(t3.from, t3.to), J2();
}, X2, d2, v2, p2, m2, g2, y2, b2, k2, j2, x2, S2, C2, $2, J2, K2, Z2, function() {
O2("refresh");
var e19 = s2.state.doc.length;
s2.dispatch({ changes: { from: e19, to: e19, insert: " " } }), s2.dispatch({ changes: { from: e19, to: e19 + 1, insert: "" } });
}, me2, q2, de2, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(6, a2 = e19);
});
}, function() {
return X2(ve2);
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(7, u2 = e19);
});
}];
}
var cB = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, uB, aB, Ki, { readOnly: 0, mainMenuBar: 1, statusBar: 2, externalContent: 28, indentation: 29, tabSize: 30, escapeUnicodeCharacters: 31, parser: 32, validator: 33, validationParser: 34, onChange: 35, onSwitchToTreeMode: 3, onError: 36, onFocus: 37, onBlur: 38, onRenderMenu: 4, onSortModal: 39, onTransformModal: 40, focus: 41, patch: 42, openTransformModal: 43, refresh: 44, validate: 45 }, Zz, [-1, -1, -1]), r2;
}
return Li(n2, [{ key: "focus", get: function() {
return this.$$.ctx[41];
} }, { key: "patch", get: function() {
return this.$$.ctx[42];
} }, { key: "openTransformModal", get: function() {
return this.$$.ctx[43];
} }, { key: "refresh", get: function() {
return this.$$.ctx[44];
} }, { key: "validate", get: function() {
return this.$$.ctx[45];
} }]), n2;
}(), lB = Da("jsoneditor:AutoScrollHandler");
var fB = function(e18, t2, n2, r2) {
return (e18 /= r2 / 2) < 1 ? n2 / 2 * e18 * e18 + t2 : -n2 / 2 * (--e18 * (e18 - 2) - 1) + t2;
}, hB = function() {
var e18, t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2;
function d2() {
return e18.scrollY || e18.pageYOffset || e18.scrollTop;
}
function v2(t3) {
return t3.getBoundingClientRect().top - (e18.getBoundingClientRect ? e18.getBoundingClientRect().top : 0) + n2;
}
function p2(t3) {
e18.scrollTo ? e18.scrollTo(0, t3) : e18.scrollTop = t3;
}
function m2(e19) {
c2 || (c2 = e19), p2(o2(l2 = e19 - c2, n2, s2, u2)), h2 = true, l2 < u2 ? requestAnimationFrame(m2) : function() {
p2(n2 + s2), t2 && a2 && (t2.setAttribute("tabindex", "-1"), t2.focus());
"function" == typeof f2 && f2();
c2 = false, h2 = false;
}();
}
return function(l3) {
var p3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
switch (u2 = p3.duration || 1e3, i2 = p3.offset || 0, f2 = p3.callback, o2 = p3.easing || fB, a2 = p3.a11y || false, zi(p3.container)) {
case "object":
e18 = p3.container;
break;
case "string":
e18 = document.querySelector(p3.container);
break;
default:
e18 = window;
}
switch (n2 = d2(), zi(l3)) {
case "number":
t2 = void 0, a2 = false, r2 = n2 + l3;
break;
case "object":
r2 = v2(t2 = l3);
break;
case "string":
t2 = document.querySelector(l3), r2 = v2(t2);
}
switch (s2 = r2 - n2 + i2, zi(p3.duration)) {
case "number":
u2 = p3.duration;
break;
case "function":
u2 = p3.duration(s2);
}
h2 ? c2 = false : requestAnimationFrame(m2);
};
};
function dB(e18) {
for (var t2 = Cb(e18, function(e19) {
return e19.start;
}), n2 = [t2[0]], r2 = 0; r2 < t2.length; r2++) {
var i2 = n2.length - 1, o2 = n2[i2], a2 = t2[r2];
a2.start <= o2.end ? n2[i2] = { start: Math.min(o2.start, a2.start), end: Math.max(o2.end, a2.end) } : n2.push(a2);
}
return n2;
}
function vB(e18, t2) {
return e18.some(function(e19) {
return t2 >= e19.start && t2 < e19.end;
});
}
function pB(e18) {
return mB(e18) + 100;
}
function mB(e18) {
return 100 * Math.floor(e18 / 100);
}
function gB(e18) {
var t2 = { expandedMap: {}, enforceStringMap: {}, visibleSectionsMap: {}, selection: void 0 };
return null != e18 && e18.select && (t2 = ji(ji({}, t2), {}, { selection: e18.select(e18.json, t2) })), null != e18 && e18.expand && (t2 = wB(e18.json, t2, [], e18.expand)), t2;
}
function yB(e18, t2) {
return e18.visibleSectionsMap[t2] || Xa;
}
function bB(e18, t2, n2) {
t2.forEach(function(t3) {
var r2 = t3.start, i2 = t3.end;
Gw(r2, Math.min(e18.length, i2), n2);
});
}
function kB(e18, t2, n2) {
for (var r2 = ji({}, t2.expandedMap), i2 = ji({}, t2.visibleSectionsMap), o2 = 0; o2 <= n2.length; o2++) {
var a2 = n2.slice(0, o2), s2 = fs.exports.compileJSONPointer(a2), u2 = fs.exports.getIn(e18, a2);
if (Ts(u2) && (r2[s2] = true), Array.isArray(u2) && o2 < n2.length) {
var c2 = i2[s2] || Xa, l2 = Ms(n2[o2]);
if (!vB(c2, l2)) {
var f2 = mB(l2), h2 = { start: f2, end: pB(f2) };
i2[s2] = dB(c2.concat(h2));
}
}
}
return ji(ji({}, t2), {}, { expandedMap: r2, visibleSectionsMap: i2 });
}
function wB(e18, t2, n2, r2) {
var i2 = ji({}, t2.expandedMap);
var o2 = n2.slice();
return function e19(n3) {
var a2 = o2.length;
if (Array.isArray(n3)) {
if (r2(o2)) {
var s2 = fs.exports.compileJSONPointer(o2);
if (i2[s2] = true, n3.length > 0) {
var u2 = yB(t2, s2);
bB(n3, u2, function(t3) {
o2[a2] = String(t3), e19(n3[t3]);
}), o2.pop();
}
}
} else if (As(n3) && r2(o2)) {
i2[fs.exports.compileJSONPointer(o2)] = true;
var c2 = Object.keys(n3);
if (c2.length > 0) {
var l2, f2 = bi(c2);
try {
for (f2.s(); !(l2 = f2.n()).done; ) {
var h2 = l2.value;
o2[a2] = h2, e19(n3[h2]);
}
} catch (e20) {
f2.e(e20);
} finally {
f2.f();
}
o2.pop();
}
}
}(fs.exports.getIn(e18, n2)), ji(ji({}, t2), {}, { expandedMap: i2 });
}
function jB(e18, t2) {
return ji(ji({}, e18), {}, { expandedMap: ji(ji({}, e18.expandedMap), {}, xi({}, fs.exports.compileJSONPointer(t2), true)) });
}
function xB(e18, t2) {
var n2 = OB(e18.expandedMap, t2), r2 = OB(e18.enforceStringMap, t2), i2 = OB(e18.visibleSectionsMap, t2);
return ji(ji({}, e18), {}, { expandedMap: n2, enforceStringMap: r2, visibleSectionsMap: i2 });
}
function SB(e18, t2, n2) {
if (n2) {
var r2 = ji({}, e18.enforceStringMap);
return r2[t2] = n2, ji(ji({}, e18), {}, { enforceStringMap: r2 });
}
if ("boolean" == typeof e18.enforceStringMap[t2]) {
var i2 = ji({}, e18.enforceStringMap);
return delete i2[t2], ji(ji({}, e18), {}, { enforceStringMap: i2 });
}
return e18;
}
function _B(e18, t2, n2) {
var r2 = fs.exports.immutableJSONPatch(e18, n2), i2 = n2.reduce(function(e19, t3) {
return fs.exports.isJSONPatchAdd(t3) ? CB(r2, e19, t3) : fs.exports.isJSONPatchRemove(t3) ? $B(r2, e19, t3) : fs.exports.isJSONPatchReplace(t3) ? function(e20, t4, n3) {
var r3 = n3.path, i3 = TB(e20, t4.expandedMap), o2 = TB(e20, t4.enforceStringMap), a2 = TB(e20, t4.visibleSectionsMap);
fs.exports.isJSONObject(n3.value) || fs.exports.isJSONArray(n3.value) || delete i3[r3];
fs.exports.isJSONArray(n3.value) || delete a2[r3];
(fs.exports.isJSONObject(n3.value) || fs.exports.isJSONArray(n3.value)) && delete o2[r3];
return ji(ji({}, t4), {}, { expandedMap: i3, enforceStringMap: o2, visibleSectionsMap: a2 });
}(r2, e19, t3) : fs.exports.isJSONPatchCopy(t3) || fs.exports.isJSONPatchMove(t3) ? function(e20, t4, n3) {
if (fs.exports.isJSONPatchMove(n3) && n3.from === n3.path)
return t4;
var r3 = function(e21) {
return n3.path + e21.substring(n3.from.length);
}, i3 = PB(MB(t4.expandedMap, n3.from), r3), o2 = PB(MB(t4.enforceStringMap, n3.from), r3), a2 = PB(MB(t4.visibleSectionsMap, n3.from), r3), s2 = t4;
fs.exports.isJSONPatchMove(n3) && (s2 = $B(e20, s2, { op: "remove", path: n3.from }));
var u2 = EB((s2 = CB(e20, s2, { op: "add", path: n3.path, value: null })).expandedMap, i3), c2 = EB(s2.enforceStringMap, o2), l2 = EB(s2.visibleSectionsMap, a2);
return ji(ji({}, t4), {}, { expandedMap: u2, enforceStringMap: c2, visibleSectionsMap: l2 });
}(r2, e19, t3) : e19;
}, t2);
return { json: r2, documentState: i2 };
}
function CB(e18, t2, n2) {
var r2 = fs.exports.parsePath(e18, n2.path), i2 = im(r2), o2 = fs.exports.compileJSONPointer(i2), a2 = fs.exports.getIn(e18, i2);
if (fs.exports.isJSONArray(a2)) {
var s2 = Ms($v(r2)), u2 = AB(t2.expandedMap, i2, s2, 1), c2 = AB(t2.enforceStringMap, i2, s2, 1), l2 = AB(t2.visibleSectionsMap, i2, s2, 1);
return l2 = IB(l2, o2, function(e19) {
return NB(e19, s2, 1);
}), ji(ji({}, t2), {}, { expandedMap: u2, enforceStringMap: c2, visibleSectionsMap: l2 });
}
return t2;
}
function $B(e18, t2, n2) {
var r2 = fs.exports.parsePath(e18, n2.path), i2 = im(r2), o2 = fs.exports.compileJSONPointer(i2), a2 = fs.exports.getIn(e18, i2), s2 = t2.expandedMap, u2 = t2.enforceStringMap, c2 = t2.visibleSectionsMap;
if (s2 = OB(s2, r2), u2 = OB(u2, r2), c2 = OB(c2, r2), fs.exports.isJSONArray(a2)) {
var l2 = Ms($v(r2));
s2 = AB(s2, i2, l2, -1), u2 = AB(u2, i2, l2, -1), c2 = IB(c2 = AB(c2, i2, l2, -1), o2, function(e19) {
return NB(e19, l2, -1);
});
}
return ji(ji({}, t2), {}, { expandedMap: s2, enforceStringMap: u2, visibleSectionsMap: c2 });
}
function OB(e18, t2) {
var n2 = {}, r2 = fs.exports.compileJSONPointer(t2);
return Object.keys(e18).forEach(function(t3) {
fs.exports.startsWithJSONPointer(t3, r2) || (n2[t3] = e18[t3]);
}), n2;
}
function MB(e18, t2) {
var n2 = {};
return Object.keys(e18).forEach(function(r2) {
fs.exports.startsWithJSONPointer(r2, t2) && (n2[r2] = e18[r2]);
}), n2;
}
function EB(e18, t2) {
return ji(ji({}, e18), t2);
}
function PB(e18, t2) {
var n2 = {};
return Object.keys(e18).forEach(function(r2) {
var i2 = t2(r2);
n2[i2] = e18[r2];
}), n2;
}
function AB(e18, t2, n2, r2) {
for (var i2 = t2.length, o2 = fs.exports.compileJSONPointer(t2), a2 = [], s2 = 0, u2 = Object.keys(e18); s2 < u2.length; s2++) {
var c2 = u2[s2];
if (fs.exports.startsWithJSONPointer(c2, o2)) {
var l2 = fs.exports.parseJSONPointer(c2), f2 = Ms(l2[i2]);
f2 >= n2 && (l2[i2] = String(f2 + r2), a2.push({ oldPointer: c2, newPointer: fs.exports.compileJSONPointer(l2), value: e18[c2] }));
}
}
if (0 === a2.length)
return e18;
var h2 = ji({}, e18);
return a2.forEach(function(e19) {
delete h2[e19.oldPointer];
}), a2.forEach(function(e19) {
h2[e19.newPointer] = e19.value;
}), h2;
}
function TB(e18, t2) {
var n2 = {};
return Object.keys(t2).filter(function(t3) {
return fs.exports.existsIn(e18, fs.exports.parsePath(e18, t3));
}).forEach(function(e19) {
n2[e19] = t2[e19];
}), n2;
}
function IB(e18, t2, n2) {
var r2 = e18[t2];
if (t2 in e18) {
var i2 = n2(r2);
if (!Em(r2, i2)) {
var o2 = ji({}, e18);
return void 0 === i2 ? delete o2[t2] : o2[t2] = i2, o2;
}
}
return e18;
}
function NB(e18, t2, n2) {
return e18.map(function(e19) {
return { start: e19.start > t2 ? e19.start + n2 : e19.start, end: e19.end >= t2 ? e19.end + n2 : e19.end };
});
}
function RB(e18, t2, n2, r2) {
var i2 = t2 ? t2[n2] : void 0;
return "boolean" == typeof i2 ? i2 : function(e19, t3) {
return "string" == typeof e19 && "string" != typeof zs(e19, t3);
}(e18, r2);
}
function DB(e18, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r2 = e18.indexOf(t2);
return -1 !== r2 ? n2 ? e18.slice(r2) : e18.slice(r2 + 1) : [];
}
function LB(e18, t2) {
var n2 = [];
return function e19(r2, i2) {
n2.push(i2);
var o2 = fs.exports.compileJSONPointer(i2);
if (r2 && true === t2.expandedMap[o2]) {
if (fs.exports.isJSONArray(r2)) {
var a2 = yB(t2, o2);
bB(r2, a2, function(t3) {
e19(r2[t3], i2.concat(String(t3)));
});
}
fs.exports.isJSONObject(r2) && Object.keys(r2).forEach(function(t3) {
e19(r2[t3], i2.concat(t3));
});
}
}(e18, []), n2;
}
function zB(e18, t2) {
var n2 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], r2 = [];
function i2(e19, o2) {
r2.push({ path: o2, type: dj.value });
var a2 = fs.exports.compileJSONPointer(o2);
if (e19 && true === t2.expandedMap[a2]) {
if (n2 && r2.push({ path: o2, type: dj.inside }), fs.exports.isJSONArray(e19)) {
var s2 = yB(t2, a2);
bB(e19, s2, function(t3) {
var a3 = o2.concat(String(t3));
i2(e19[t3], a3), n2 && r2.push({ path: a3, type: dj.after });
});
}
if (fs.exports.isJSONObject(e19))
Object.keys(e19).forEach(function(t3) {
var a3 = o2.concat(t3);
r2.push({ path: a3, type: dj.key }), i2(e19[t3], a3), n2 && r2.push({ path: a3, type: dj.after });
});
}
}
return i2(e18, []), r2;
}
function BB(e18, t2, n2) {
var r2 = LB(e18, t2), i2 = r2.map(fs.exports.compileJSONPointer), o2 = fs.exports.compileJSONPointer(n2), a2 = i2.indexOf(o2);
return -1 !== a2 && a2 > 0 ? r2[a2 - 1] : null;
}
function qB(e18, t2, n2) {
var r2 = LB(e18, t2), i2 = r2.map(fs.exports.compileJSONPointer).indexOf(fs.exports.compileJSONPointer(n2));
return -1 !== i2 && i2 < r2.length - 1 ? r2[i2 + 1] : null;
}
var FB = Da("jsoneditor:History");
function VB() {
var e18 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t2 = e18.maxItems || 1e3, n2 = [], r2 = 0;
function i2() {
return r2 < n2.length;
}
function o2() {
return r2 > 0;
}
function a2() {
return { canUndo: i2(), canRedo: o2(), length: n2.length };
}
function s2() {
e18.onChange && e18.onChange(a2());
}
function u2(e19) {
FB("add", e19), n2 = [e19].concat(n2.slice(r2)).slice(0, t2), r2 = 0, s2();
}
function c2() {
FB("clear"), n2 = [], r2 = 0, s2();
}
function l2() {
if (i2()) {
var e19 = n2[r2];
return r2 += 1, FB("undo", e19), s2(), e19;
}
}
function f2() {
if (o2())
return FB("redo", n2[r2 -= 1]), s2(), n2[r2];
}
return { add: u2, clear: c2, getState: a2, undo: l2, redo: f2 };
}
function WB(e18, t2) {
for (var n2 = new Set(t2), r2 = e18.replace(/ \(copy( \d+)?\)$/, ""), i2 = e18, o2 = 1; n2.has(i2); ) {
var a2 = "copy" + (o2 > 1 ? " " + o2 : "");
i2 = "".concat(r2, " (").concat(a2, ")"), o2++;
}
return i2;
}
function HB(e18, t2) {
var n2 = t2 - "...".length;
return e18.length > t2 ? e18.substring(0, n2) + "..." : e18;
}
function JB(e18) {
if ("" === e18)
return "";
var t2 = e18.toLowerCase();
if ("null" === t2)
return null;
if ("true" === t2)
return true;
if ("false" === t2)
return false;
if ("undefined" !== t2) {
var n2 = Number(e18), r2 = parseFloat(e18);
return isNaN(n2) || isNaN(r2) ? e18 : n2;
}
}
function UB(e18) {
return e18 && e18.type === hj.after;
}
function KB(e18) {
return e18 && e18.type === hj.inside;
}
function GB(e18) {
return e18 && e18.type === hj.key;
}
function QB(e18) {
return e18 && e18.type === hj.value;
}
function YB(e18) {
return e18 && e18.type === hj.multi;
}
function ZB(e18) {
return KB(e18) ? e18.focusPath : im(e18.focusPath);
}
function XB(e18) {
return YB(e18) ? yp(e18.paths) : e18.focusPath;
}
function eq(e18) {
return YB(e18) ? $v(e18.paths) : e18.focusPath;
}
function tq(e18, t2) {
return lq(e18.focusPath, t2) && (e18.focusPath.length > t2.length || KB(e18));
}
function nq(e18, t2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r2 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i2 = t2.selection, o2 = !r2 && YB(i2) ? yp(i2.paths) : i2.focusPath, a2 = BB(e18, t2, o2);
if (null === a2)
return null;
var s2 = a2, u2 = a2;
if (n2)
return UB(i2) || KB(i2) ? mq(e18, i2.anchorPath, i2.anchorPath) : mq(e18, i2.anchorPath, u2);
if (GB(i2)) {
var c2 = im(a2), l2 = fs.exports.getIn(e18, c2);
return Array.isArray(l2) || Mm(a2) ? dq(a2, false) : hq(a2, false);
}
return QB(i2) ? dq(a2, false) : UB(i2) || KB(i2) ? mq(e18, o2, o2) : mq(e18, s2, u2);
}
function rq(e18, t2, n2) {
var r2 = t2.selection, i2 = zB(e18, t2, n2), o2 = i2.findIndex(function(e19) {
return Em(e19.path, r2.focusPath) && String(e19.type) === String(r2.type);
});
return { caret: -1 !== o2 ? i2[o2] : null, previous: -1 !== o2 && o2 > 0 ? i2[o2 - 1] : null, next: -1 !== o2 && o2 < i2.length - 1 ? i2[o2 + 1] : null };
}
function iq(e18, t2) {
for (var n2 = LB(e18, t2), r2 = 0; r2 < n2.length - 1 && n2[r2 + 1].length > n2[r2].length; )
r2++;
var i2 = n2[r2];
return 0 === i2.length || Array.isArray(fs.exports.getIn(e18, im(i2))) ? dq(i2, false) : hq(i2, false);
}
function oq(e18, t2) {
if (1 === t2.length) {
var n2 = yp(t2);
if ("replace" === n2.op || "move" === n2.op)
return dq(fs.exports.parsePath(e18, n2.path), false);
}
if (!Mm(t2) && t2.every(function(e19) {
return "move" === e19.op;
})) {
var r2 = yp(t2), i2 = t2.slice(1);
if ((fs.exports.isJSONPatchCopy(r2) || fs.exports.isJSONPatchMove(r2)) && r2.from !== r2.path && i2.every(function(e19) {
return (fs.exports.isJSONPatchCopy(e19) || fs.exports.isJSONPatchMove(e19)) && e19.from === e19.path;
}))
return hq(fs.exports.parsePath(e18, r2.path), false);
}
var o2 = t2.filter(function(e19) {
return "test" !== e19.op && "remove" !== e19.op && ("move" !== e19.op || e19.from !== e19.path) && "string" == typeof e19.path;
}).map(function(t3) {
return fs.exports.parsePath(e18, t3.path);
});
return Mm(o2) ? null : { type: hj.multi, paths: o2, anchorPath: yp(o2), focusPath: $v(o2), pointersMap: aq(o2) };
}
function aq(e18) {
var t2 = {};
return e18.forEach(function(e19) {
t2[fs.exports.compileJSONPointer(e19)] = true;
}), t2;
}
function sq(e18) {
return xi({}, fs.exports.compileJSONPointer(e18), true);
}
function uq(e18) {
return e18 && (GB(e18) || QB(e18) || YB(e18) && 1 === e18.paths.length);
}
function cq(e18, t2) {
return uq(t2) && Ts(fs.exports.getIn(e18, t2.focusPath)) ? t2.focusPath : im(t2.focusPath);
}
function lq(e18, t2) {
if (e18.length < t2.length)
return false;
for (var n2 = 0; n2 < t2.length; n2++)
if (e18[n2] !== t2[n2])
return false;
return true;
}
function fq(e18) {
var t2 = e18.selection;
return (GB(t2) || QB(t2)) && t2.edit ? ji(ji({}, e18), {}, { selection: ji(ji({}, t2), {}, { edit: false }) }) : e18;
}
function hq(e18, t2) {
return { type: hj.key, anchorPath: e18, focusPath: e18, pointersMap: sq(e18), edit: t2 };
}
function dq(e18, t2) {
return { type: hj.value, anchorPath: e18, focusPath: e18, pointersMap: sq(e18), edit: t2 };
}
function vq(e18) {
return { type: hj.inside, anchorPath: e18, focusPath: e18, pointersMap: sq(e18) };
}
function pq(e18) {
return { type: hj.after, anchorPath: e18, focusPath: e18, pointersMap: sq(e18) };
}
function mq(e18, t2, n2) {
var r2 = function(e19, t3, n3) {
if (Em(t3, n3))
return [t3];
var r3 = function(e20, t4) {
for (var n4 = 0; n4 < e20.length && n4 < t4.length && e20[n4] === t4[n4]; )
n4++;
return e20.slice(0, n4);
}(t3, n3);
if (t3.length === r3.length || n3.length === r3.length)
return [r3];
var i3 = t3[r3.length], o2 = n3[r3.length], a2 = fs.exports.getIn(e19, r3);
if (fs.exports.isJSONObject(a2)) {
var s2 = Object.keys(a2), u2 = s2.indexOf(i3), c2 = s2.indexOf(o2);
if (-1 !== u2 && -1 !== c2) {
for (var l2 = Math.min(u2, c2), f2 = Math.max(u2, c2), h2 = [], d2 = l2; d2 <= f2; d2++)
h2.push(r3.concat(s2[d2]));
return h2;
}
}
if (fs.exports.isJSONArray(a2)) {
for (var v2 = Math.min(Ms(i3), Ms(o2)), p2 = Math.max(Ms(i3), Ms(o2)), m2 = [], g2 = v2; g2 <= p2; g2++)
m2.push(r3.concat(String(g2)));
return m2;
}
throw new Error("Failed to create selection");
}(e18, t2, n2), i2 = lq(n2, $v(r2)) || lq(t2, yp(r2));
return { type: hj.multi, anchorPath: i2 ? yp(r2) : $v(r2), focusPath: i2 ? $v(r2) : yp(r2), paths: r2, pointersMap: aq(r2) };
}
function gq(e18, t2, n2, r2) {
if (GB(t2))
return String($v(t2.focusPath));
if (QB(t2)) {
var i2 = fs.exports.getIn(e18, t2.focusPath);
return "string" == typeof i2 ? i2 : r2.stringify(i2, null, n2);
}
if (YB(t2)) {
if (Mm(t2.focusPath))
return r2.stringify(e18, null, n2);
var o2 = ZB(t2), a2 = fs.exports.getIn(e18, o2);
if (Array.isArray(a2)) {
if (1 === t2.paths.length) {
var s2 = fs.exports.getIn(e18, yp(t2.paths));
return r2.stringify(s2, null, n2);
}
return t2.paths.map(function(t3) {
var i3 = fs.exports.getIn(e18, t3);
return "".concat(r2.stringify(i3, null, n2), ",");
}).join("\n");
}
return t2.paths.map(function(t3) {
var i3 = $v(t3), o3 = fs.exports.getIn(e18, t3);
return "".concat(r2.stringify(i3), ": ").concat(r2.stringify(o3, null, n2), ",");
}).join("\n");
}
return null;
}
function yq(e18) {
return YB(e18) ? e18.paths : [e18.focusPath];
}
function bq(e18) {
return (GB(e18) || QB(e18)) && e18.edit;
}
function kq(e18) {
return !!e18 && (!(!GB(e18) && !QB(e18)) || (!(!YB(e18) || 1 !== e18.paths.length) || void 0));
}
function wq(e18) {
switch (e18.type) {
case dj.key:
return hq(e18.path, false);
case dj.value:
return dq(e18.path, false);
case dj.after:
return pq(e18.path);
case dj.inside:
return vq(e18.path);
}
}
function jq(e18, t2, n2) {
switch (t2) {
case hj.key:
return hq(n2, false);
case hj.value:
return dq(n2, false);
case hj.after:
return pq(n2);
case hj.inside:
return vq(n2);
case hj.multi:
return mq(e18, n2, n2);
}
}
function xq(e18, t2) {
if (e18)
return Object.keys(e18.pointersMap).some(function(e19) {
return fs.exports.startsWithJSONPointer(e19, t2) || fs.exports.startsWithJSONPointer(t2, e19);
}) ? e18 : void 0;
}
function Sq(e18, t2, n2) {
var r2 = im(t2), i2 = fs.exports.getIn(e18, r2);
if (fs.exports.isJSONArray(i2)) {
var o2 = Ms($v(t2));
return n2.map(function(e19, t3) {
return { op: "add", path: fs.exports.compileJSONPointer(r2.concat(String(o2 + t3))), value: e19.value };
});
}
if (fs.exports.isJSONObject(i2)) {
var a2 = $v(t2), s2 = Object.keys(i2), u2 = DB(s2, a2, true);
return [].concat(Ti(n2.map(function(e19) {
var t3 = WB(e19.key, s2);
return { op: "add", path: fs.exports.compileJSONPointer(r2.concat(t3)), value: e19.value };
})), Ti(u2.map(function(e19) {
return Mq(r2, e19);
})));
}
throw new Error("Cannot create insert operations: parent must be an Object or Array");
}
function _q(e18, t2, n2) {
var r2 = fs.exports.getIn(e18, t2);
if (Array.isArray(r2)) {
var i2 = r2.length;
return n2.map(function(e19, n3) {
return { op: "add", path: fs.exports.compileJSONPointer(t2.concat(String(i2 + n3))), value: e19.value };
});
}
return n2.map(function(e19) {
var n3 = WB(e19.key, Object.keys(r2));
return { op: "add", path: fs.exports.compileJSONPointer(t2.concat(n3)), value: e19.value };
});
}
function Cq(e18, t2, n2, r2) {
var i2 = WB(r2, t2.filter(function(e19) {
return e19 !== n2;
})), o2 = DB(t2, n2, false);
return [{ op: "move", from: fs.exports.compileJSONPointer(e18.concat(n2)), path: fs.exports.compileJSONPointer(e18.concat(i2)) }].concat(Ti(o2.map(function(t3) {
return Mq(e18, t3);
})));
}
function $q(e18, t2, n2, r2) {
if (GB(t2)) {
var i2 = tj(n2, r2), o2 = im(t2.focusPath), a2 = fs.exports.getIn(e18, o2);
return Cq(o2, Object.keys(a2), $v(t2.focusPath), "string" == typeof i2 ? i2 : n2);
}
if (QB(t2) || YB(t2) && Mm(t2.focusPath))
try {
return [{ op: "replace", path: fs.exports.compileJSONPointer(t2.focusPath), value: nj(n2, function(e19) {
return ej(e19, r2);
}) }];
} catch (e19) {
return [{ op: "replace", path: fs.exports.compileJSONPointer(t2.focusPath), value: n2 }];
}
if (YB(t2)) {
var s2 = Eq(n2, r2);
return function(e19, t3, n3) {
var r3 = im(yp(t3)), i3 = fs.exports.getIn(e19, r3);
if (fs.exports.isJSONArray(i3)) {
var o3 = yp(t3), a3 = o3 ? Ms($v(o3)) : 0;
return [].concat(Ti(Oq(t3)), Ti(n3.map(function(e20, t4) {
return { op: "add", path: fs.exports.compileJSONPointer(r3.concat(String(t4 + a3))), value: e20.value };
})));
}
if (fs.exports.isJSONObject(i3)) {
var s3 = $v(t3), u3 = im(s3), c3 = $v(s3), l3 = Object.keys(i3), f3 = DB(l3, c3, false), h3 = new Set(t3.map(function(e20) {
return $v(e20);
})), d3 = l3.filter(function(e20) {
return !h3.has(e20);
});
return [].concat(Ti(Oq(t3)), Ti(n3.map(function(e20) {
var t4 = WB(e20.key, d3);
return { op: "add", path: fs.exports.compileJSONPointer(u3.concat(t4)), value: e20.value };
})), Ti(f3.map(function(e20) {
return Mq(u3, e20);
})));
}
throw new Error("Cannot create replace operations: parent must be an Object or Array");
}(e18, t2.paths, s2);
}
if (UB(t2)) {
var u2 = Eq(n2, r2), c2 = t2.focusPath, l2 = im(c2), f2 = fs.exports.getIn(e18, l2);
if (fs.exports.isJSONArray(f2)) {
var h2 = Ms($v(c2));
return Sq(e18, l2.concat(String(h2 + 1)), u2);
}
if (fs.exports.isJSONObject(f2)) {
var d2 = String($v(c2)), v2 = Object.keys(f2);
if (Mm(v2) || $v(v2) === d2)
return _q(e18, l2, u2);
var p2 = v2.indexOf(d2), m2 = v2[p2 + 1];
return Sq(e18, l2.concat(m2), u2);
}
throw new Error("Cannot create insert operations: parent must be an Object or Array");
}
if (KB(t2)) {
var g2 = Eq(n2, r2), y2 = t2.focusPath, b2 = fs.exports.getIn(e18, y2);
if (fs.exports.isJSONArray(b2))
return Sq(e18, y2.concat("0"), g2);
if (fs.exports.isJSONObject(b2)) {
var k2 = Object.keys(b2);
if (Mm(k2))
return _q(e18, y2, g2);
var w2 = yp(k2);
return Sq(e18, y2.concat(w2), g2);
}
throw new Error("Cannot create insert operations: parent must be an Object or Array");
}
throw new Error("Cannot insert: unsupported type of selection " + JSON.stringify(t2));
}
function Oq(e18) {
return e18.map(function(e19) {
return { op: "remove", path: fs.exports.compileJSONPointer(e19) };
}).reverse();
}
function Mq(e18, t2) {
return { op: "move", from: fs.exports.compileJSONPointer(e18.concat(t2)), path: fs.exports.compileJSONPointer(e18.concat(t2)) };
}
function Eq(e18, t2) {
var n2 = /^\s*{/.test(e18), r2 = /^\s*\[/.test(e18), i2 = tj(e18, t2), o2 = void 0 !== i2 ? i2 : nj(e18, function(e19) {
return ej(e19, t2);
});
return n2 && As(o2) || r2 && Array.isArray(o2) ? [{ key: "New item", value: o2 }] : Array.isArray(o2) ? o2.map(function(e19, t3) {
return { key: "New item " + t3, value: e19 };
}) : As(o2) ? Object.keys(o2).map(function(e19) {
return { key: e19, value: o2[e19] };
}) : [{ key: "New item", value: o2 }];
}
function Pq(e18, t2) {
if (GB(t2)) {
var n2 = im(t2.focusPath), r2 = fs.exports.getIn(e18, n2), i2 = Cq(n2, Object.keys(r2), $v(t2.focusPath), "");
return { operations: i2, newSelection: oq(e18, i2) };
}
if (QB(t2))
return { operations: [{ op: "replace", path: fs.exports.compileJSONPointer(t2.focusPath), value: "" }], newSelection: t2 };
if (YB(t2)) {
var o2 = Oq(t2.paths), a2 = $v(t2.paths);
if (Mm(a2)) {
return { operations: [{ op: "replace", path: "", value: "" }], newSelection: dq([], false) };
}
var s2 = im(a2), u2 = fs.exports.getIn(e18, s2);
if (fs.exports.isJSONArray(u2)) {
var c2 = Ms($v(yp(t2.paths)));
return { operations: o2, newSelection: 0 === c2 ? vq(s2) : pq(s2.concat(String(c2 - 1))) };
}
if (fs.exports.isJSONObject(u2)) {
var l2 = Object.keys(u2), f2 = $v(yp(t2.paths)), h2 = l2.indexOf(f2), d2 = l2[h2 - 1];
return { operations: o2, newSelection: 0 === h2 ? vq(s2) : pq(s2.concat(d2)) };
}
throw new Error("Cannot create remove operations: parent must be an Object or Array");
}
throw new Error("Cannot remove: unsupported type of selection " + JSON.stringify(t2));
}
function Aq(e18, t2) {
var n2 = im(t2), r2 = $v(t2), i2 = fs.exports.getIn(e18, n2);
return fs.exports.isJSONObject(i2) ? DB(Object.keys(i2), r2, false).map(function(e19) {
return Mq(n2, e19);
}) : [];
}
function Tq(e18) {
var t2 = e18.activeIndex < e18.items.length - 1 ? e18.activeIndex + 1 : e18.items.length > 0 ? 0 : -1, n2 = e18.items[t2], r2 = e18.items.map(function(e19, n3) {
return ji(ji({}, e19), {}, { active: n3 === t2 });
});
return ji(ji({}, e18), {}, { items: r2, itemsMap: Bp(r2, function(e19) {
return fs.exports.compileJSONPointer(e19.path);
}), activeItem: n2, activeIndex: t2 });
}
function Iq(e18) {
var t2 = e18.activeIndex > 0 ? e18.activeIndex - 1 : e18.items.length - 1, n2 = e18.items[t2], r2 = e18.items.map(function(e19, n3) {
return ji(ji({}, e19), {}, { active: n3 === t2 });
});
return ji(ji({}, e18), {}, { items: r2, itemsMap: Bp(r2, function(e19) {
return fs.exports.compileJSONPointer(e19.path);
}), activeItem: n2, activeIndex: t2 });
}
function Nq(e18, t2, n2) {
var r2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 / 0, i2 = [], o2 = [];
function a2(e19) {
i2.length < r2 && i2.push(e19);
}
function s2(e19, t3) {
if (fs.exports.isJSONArray(t3)) {
var n3 = o2.length;
o2.push("0");
for (var u3 = 0; u3 < t3.length; u3++)
if (o2[n3] = String(u3), s2(e19, t3[u3]), i2.length >= r2)
return;
o2.pop();
} else if (fs.exports.isJSONObject(t3)) {
var c2 = Object.keys(t3), l2 = o2.length;
o2.push("");
for (var f2 = 0, h2 = c2; f2 < h2.length; f2++) {
var d2 = h2[f2];
if (o2[l2] = d2, Rq(d2, e19, o2, pj.key, a2), s2(e19, t3[d2]), i2.length >= r2)
return;
}
o2.pop();
} else
Rq(String(t3), e19, o2, pj.value, a2);
}
if ("string" == typeof e18 && "" !== e18) {
var u2 = e18.toLowerCase();
s2(u2, t2);
}
return i2;
}
function Rq(e18, t2, n2, r2, i2) {
var o2 = e18.toLowerCase(), a2 = 0, s2 = -1, u2 = -1;
do {
-1 !== (u2 = o2.indexOf(t2, s2)) && (s2 = u2 + t2.length, i2({ path: n2.slice(0), field: r2, fieldIndex: a2, start: u2, end: s2 }), a2++);
} while (-1 !== u2);
}
function Dq(e18, t2, n2, r2) {
return e18.substring(0, n2) + t2 + e18.substring(r2);
}
function Lq(e18, t2, n2) {
var r2 = e18;
return Fv(n2, function(e19) {
r2 = Dq(r2, t2, e19.start, e19.end);
}), r2;
}
function zq(e18, t2, n2, r2, i2) {
var o2 = r2.field, a2 = r2.path, s2 = r2.start, u2 = r2.end;
if (o2 === pj.key) {
var c2 = im(a2), l2 = fs.exports.getIn(e18, c2), f2 = $v(a2), h2 = Cq(c2, Object.keys(l2), f2, Dq(f2, n2, s2, u2));
return { newSelection: oq(e18, h2), operations: h2 };
}
if (o2 === pj.value) {
var d2 = fs.exports.getIn(e18, a2);
if (void 0 === d2)
throw new Error("Cannot replace: path not found ".concat(fs.exports.compileJSONPointer(a2)));
var v2 = "string" == typeof d2 ? d2 : String(d2), p2 = fs.exports.compileJSONPointer(a2), m2 = RB(d2, t2.enforceStringMap, p2, i2), g2 = Dq(v2, n2, s2, u2), y2 = [{ op: "replace", path: fs.exports.compileJSONPointer(a2), value: m2 ? g2 : zs(g2, i2) }];
return { newSelection: oq(e18, y2), operations: y2 };
}
throw new Error("Cannot replace: unknown type of search result field ".concat(o2));
}
function Bq(e18, t2, n2, r2, i2) {
for (var o2 = Nq(n2, e18, t2, 1 / 0), a2 = [], s2 = 0; s2 < o2.length; s2++) {
var u2 = o2[s2 - 1], c2 = o2[s2];
0 !== s2 && c2.field === u2.field && Em(c2.path, u2.path) ? $v(a2).items.push(c2) : a2.push({ path: c2.path, field: c2.field, items: [c2] });
}
a2.sort(function(e19, t3) {
return e19.field !== t3.field ? e19.field === pj.key ? 1 : -1 : t3.path.length - e19.path.length;
});
var l2 = [], f2 = void 0;
return a2.forEach(function(n3) {
var o3 = n3.field, a3 = n3.path, s3 = n3.items;
if (o3 === pj.key) {
var u3 = im(a3), c3 = fs.exports.getIn(e18, u3), h2 = $v(a3), d2 = Cq(u3, Object.keys(c3), h2, Lq(h2, r2, s3));
l2 = l2.concat(d2), f2 = oq(e18, d2);
} else {
if (o3 !== pj.value)
throw new Error("Cannot replace: unknown type of search result field ".concat(o3));
var v2 = fs.exports.getIn(e18, a3);
if (void 0 === v2)
throw new Error("Cannot replace: path not found ".concat(fs.exports.compileJSONPointer(a3)));
var p2 = "string" == typeof v2 ? v2 : String(v2), m2 = fs.exports.compileJSONPointer(a3), g2 = RB(v2, t2.enforceStringMap, m2, i2), y2 = Lq(p2, r2, s3), b2 = [{ op: "replace", path: fs.exports.compileJSONPointer(a3), value: g2 ? y2 : zs(y2, i2) }];
l2 = l2.concat(b2), f2 = oq(e18, b2);
}
}), { operations: l2, newSelection: f2 };
}
function qq(e18) {
return e18.path.concat(e18.field, String(e18.fieldIndex));
}
function Fq(e18, t2) {
var n2, r2 = null == e18 || null === (n2 = e18[t2]) || void 0 === n2 ? void 0 : n2.filter(function(e19) {
return e19.field === pj.key;
});
if (r2 && 0 !== r2.length)
return r2;
}
function Vq(e18, t2) {
var n2, r2 = null == e18 || null === (n2 = e18[t2]) || void 0 === n2 ? void 0 : n2.filter(function(e19) {
return e19.field === pj.value;
});
if (r2 && 0 !== r2.length)
return r2;
}
function Wq(e18) {
var t2, n2;
if (navigator.clipboard)
return navigator.clipboard.writeText(e18);
if (null !== (t2 = (n2 = document).queryCommandSupported) && void 0 !== t2 && t2.call(n2, "copy")) {
var r2 = document.createElement("textarea");
r2.value = e18, r2.style.position = "fixed", r2.style.opacity = "0", document.body.appendChild(r2), r2.select();
try {
document.execCommand("copy");
} catch (e19) {
console.error(e19);
} finally {
document.body.removeChild(r2);
}
} else
console.error("Copy failed.");
}
function Hq(e18) {
co(e18, "svelte-d01h2s", ".jse-header.svelte-d01h2s.svelte-d01h2s{display:flex;background:var(--jse-theme-color);color:var(--jse-menu-color)}.jse-header.svelte-d01h2s .jse-title.svelte-d01h2s{flex:1;padding:5px;vertical-align:middle}.jse-header.svelte-d01h2s button.svelte-d01h2s{border:none;background:transparent;min-width:32px;color:inherit;cursor:pointer}.jse-header.svelte-d01h2s button.svelte-d01h2s:hover{background:rgba(255, 255, 255, 0.1)}");
}
function Jq(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2;
return a2 = new uS({ props: { data: Px } }), { c: function() {
t2 = go("div"), n2 = go("div"), r2 = bo(e18[0]), i2 = ko(), o2 = go("button"), Ma(a2.$$.fragment), So(n2, "class", "jse-title svelte-d01h2s"), So(o2, "type", "button"), So(o2, "class", "jse-close svelte-d01h2s"), So(t2, "class", "jse-header svelte-d01h2s");
}, m: function(l2, f2) {
vo(l2, t2, f2), uo(t2, n2), uo(n2, r2), uo(t2, i2), uo(t2, o2), Ea(a2, o2, null), s2 = true, u2 || (c2 = jo(o2, "click", e18[1]), u2 = true);
}, p: function(e19, t3) {
var n3 = ki(t3, 1)[0];
(!s2 || 1 & n3) && Mo(r2, e19[0]);
}, i: function(e19) {
s2 || (ya(a2.$$.fragment, e19), s2 = true);
}, o: function(e19) {
ba(a2.$$.fragment, e19), s2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(a2), u2 = false, c2();
} };
}
function Uq(e18, t2, n2) {
var r2 = t2.title, i2 = void 0 === r2 ? "Modal" : r2, o2 = Yo("simple-modal").close;
return e18.$$set = function(e19) {
"title" in e19 && n2(0, i2 = e19.title);
}, [i2, o2];
}
var Kq = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, Uq, Jq, Ki, { title: 0 }, Hq), r2;
}
return Li(n2);
}();
function Gq(e18) {
co(e18, "svelte-t45ah0", ".jse-modal.svelte-t45ah0.svelte-t45ah0{--height:36px;--multiItemHeight:28px;--multiItemMargin:2px;--multiItemPadding:2px 8px;--multiClearTop:5px;--multiItemBorderRadius:6px;--clearSelectTop:2px;--clearSelectBottom:2px;--indicatorTop:8px;flex:1;display:flex;flex-direction:column;font-family:var(--jse-font-family);font-size:var(--jse-font-size);line-height:normal;background:var(--jse-modal-background);color:var(--jse-text-color)}.jse-modal.svelte-t45ah0 .jse-contents.svelte-t45ah0{padding:20px;overflow:auto}.jse-modal.svelte-t45ah0 .jse-contents .jse-actions.svelte-t45ah0{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding)}.jse-modal.svelte-t45ah0 .jse-contents .jse-actions button.svelte-t45ah0{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;background:var(--jse-button-primary-background);color:var(--jse-button-primary-color);padding:var(--jse-padding) calc(2 * var(--jse-padding));border-radius:3px}.jse-modal.svelte-t45ah0 .jse-contents .jse-actions button.svelte-t45ah0:hover{background:var(--jse-button-primary-background-highlight)}.jse-modal.svelte-t45ah0 .jse-contents .jse-actions button.svelte-t45ah0:disabled{background:var(--jse-button-primary-background-disabled)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-modal-overlay-background)}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-content{flex:1;display:flex;max-height:calc(100vh - 6rem);padding:0}.jse-modal.jse-copy-paste.svelte-t45ah0 .jse-shortcuts.svelte-t45ah0{display:flex;flex-wrap:wrap;justify-content:space-around;margin:calc(2 * var(--jse-padding)) 0}.jse-modal.jse-copy-paste.svelte-t45ah0 .jse-shortcuts .jse-shortcut .jse-key.svelte-t45ah0{font-size:200%;color:var(--jse-theme-color)}");
}
function Qq(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2, g2, y2, b2, k2, w2, j2, x2, S2;
return n2 = new Kq({ props: { title: "Copying and pasting" } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), r2 = ko(), i2 = go("div"), (o2 = go("div")).textContent = "These actions are unavailable via the menu. Please use:", a2 = ko(), s2 = go("div"), u2 = go("div"), (c2 = go("div")).textContent = "".concat(e18[1], "+C"), l2 = bo("\n for copy"), f2 = ko(), h2 = go("div"), (d2 = go("div")).textContent = "".concat(e18[1], "+X"), v2 = bo("\n for cut"), p2 = ko(), m2 = go("div"), (g2 = go("div")).textContent = "".concat(e18[1], "+V"), y2 = bo("\n for paste"), b2 = ko(), k2 = go("div"), (w2 = go("button")).textContent = "Close", So(c2, "class", "jse-key svelte-t45ah0"), So(u2, "class", "jse-shortcut"), So(d2, "class", "jse-key svelte-t45ah0"), So(h2, "class", "jse-shortcut"), So(g2, "class", "jse-key svelte-t45ah0"), So(m2, "class", "jse-shortcut"), So(s2, "class", "jse-shortcuts svelte-t45ah0"), So(w2, "type", "button"), So(w2, "class", "jse-primary svelte-t45ah0"), So(k2, "class", "jse-actions svelte-t45ah0"), So(i2, "class", "jse-contents svelte-t45ah0"), So(t2, "class", "jse-modal jse-copy-paste svelte-t45ah0");
}, m: function(_2, C2) {
vo(_2, t2, C2), Ea(n2, t2, null), uo(t2, r2), uo(t2, i2), uo(i2, o2), uo(i2, a2), uo(i2, s2), uo(s2, u2), uo(u2, c2), uo(u2, l2), uo(s2, f2), uo(s2, h2), uo(h2, d2), uo(h2, v2), uo(s2, p2), uo(s2, m2), uo(m2, g2), uo(m2, y2), uo(i2, b2), uo(i2, k2), uo(k2, w2), j2 = true, x2 || (S2 = jo(w2, "click", e18[0]), x2 = true);
}, p: Bi, i: function(e19) {
j2 || (ya(n2.$$.fragment, e19), j2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), j2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), x2 = false, S2();
} };
}
function Yq(e18) {
return [Yo("simple-modal").close, Wj ? "\u2318" : "Ctrl"];
}
var Zq = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, Yq, Qq, Ki, {}, Gq), r2;
}
return Li(n2);
}();
function Xq(e18) {
co(e18, "svelte-gz09vf", ".jse-json-repair-component.svelte-gz09vf.svelte-gz09vf{flex:1;display:flex;flex-direction:column;background:var(--jse-background-color);color:var(--jse-text-color)}.jse-json-repair-component.svelte-gz09vf .jse-menu .jse-info.svelte-gz09vf{padding:0 var(--jse-padding)}.jse-json-repair-component.svelte-gz09vf .jse-json-text.svelte-gz09vf{flex:1;border:none;padding:2px;font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);background:var(--jse-background-color);color:var(--jse-text-color);resize:none;outline:none}");
}
function eF(e18) {
var t2;
return { c: function() {
(t2 = go("div")).textContent = "Repair invalid JSON, then click apply", So(t2, "slot", "left"), So(t2, "class", "jse-info svelte-gz09vf");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, p: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function tF(e18) {
var t2, n2;
return t2 = new mS({ props: { type: "success", message: "JSON is valid now and can be parsed.", actions: e18[5] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
32 & n3 && (r2.actions = e19[5]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function nF(e18) {
var t2, n2;
return t2 = new mS({ props: { type: "error", icon: Ix, message: "Cannot parse JSON: ".concat(e18[2].message), actions: e18[6] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
4 & n3 && (r2.message = "Cannot parse JSON: ".concat(e19[2].message)), 64 & n3 && (r2.actions = e19[6]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function rF(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2;
n2 = new QS({ props: { items: e18[7], $$slots: { left: [eF] }, $$scope: { ctx: e18 } } });
var f2 = [nF, tF], h2 = [];
function d2(e19, t3) {
return e19[2] ? 0 : 1;
}
return i2 = d2(e18), o2 = h2[i2] = f2[i2](e18), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), r2 = ko(), o2.c(), a2 = ko(), (s2 = go("textarea")).value = e18[0], s2.readOnly = e18[1], So(s2, "class", "jse-json-text svelte-gz09vf"), So(s2, "autocomplete", "off"), So(s2, "autocapitalize", "off"), So(s2, "spellcheck", "false"), So(t2, "class", "jse-json-repair-component svelte-gz09vf");
}, m: function(o3, f3) {
vo(o3, t2, f3), Ea(n2, t2, null), uo(t2, r2), h2[i2].m(t2, null), uo(t2, a2), uo(t2, s2), e18[19](s2), e18[20](t2), u2 = true, c2 || (l2 = jo(s2, "input", e18[8]), c2 = true);
}, p: function(e19, r3) {
var c3 = ki(r3, 1)[0], l3 = {};
128 & c3 && (l3.items = e19[7]), 134217728 & c3 && (l3.$$scope = { dirty: c3, ctx: e19 }), n2.$set(l3);
var v2 = i2;
(i2 = d2(e19)) === v2 ? h2[i2].p(e19, c3) : (ma(), ba(h2[v2], 1, 1, function() {
h2[v2] = null;
}), ga(), (o2 = h2[i2]) ? o2.p(e19, c3) : (o2 = h2[i2] = f2[i2](e19)).c(), ya(o2, 1), o2.m(t2, a2)), (!u2 || 1 & c3) && (s2.value = e19[0]), (!u2 || 2 & c3) && (s2.readOnly = e19[1]);
}, i: function(e19) {
u2 || (ya(n2.$$.fragment, e19), ya(o2), u2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), ba(o2), u2 = false;
}, d: function(r3) {
r3 && po(t2), Pa(n2), h2[i2].d(), e18[19](null), e18[20](null), c2 = false, l2();
} };
}
function iF(e18, t2, n2) {
var r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2 = t2.text, v2 = void 0 === d2 ? "" : d2, p2 = t2.readOnly, m2 = void 0 !== p2 && p2, g2 = t2.onParse, y2 = t2.onRepair, b2 = t2.onChange, k2 = void 0 === b2 ? null : b2, w2 = t2.onApply, j2 = t2.onCancel, x2 = t2.onRenderMenu, S2 = void 0 === x2 ? Yu : x2, _2 = Da("jsoneditor:JSONRepair");
function C2() {
w2(v2);
}
return e18.$$set = function(e19) {
"text" in e19 && n2(0, v2 = e19.text), "readOnly" in e19 && n2(1, m2 = e19.readOnly), "onParse" in e19 && n2(9, g2 = e19.onParse), "onRepair" in e19 && n2(10, y2 = e19.onRepair), "onChange" in e19 && n2(11, k2 = e19.onChange), "onApply" in e19 && n2(12, w2 = e19.onApply), "onCancel" in e19 && n2(13, j2 = e19.onCancel), "onRenderMenu" in e19 && n2(14, S2 = e19.onRenderMenu);
}, e18.$$.update = function() {
1 & e18.$$.dirty && n2(2, r2 = function(e19) {
try {
return g2(e19), null;
} catch (t3) {
return oj(e19, t3.message);
}
}(v2)), 1 & e18.$$.dirty && n2(17, i2 = function(e19) {
try {
return y2(e19), true;
} catch (e20) {
return false;
}
}(v2)), 4 & e18.$$.dirty && _2("error", r2), 8192 & e18.$$.dirty && n2(18, o2 = [{ space: true }, { icon: Px, title: "Cancel repair", className: "jse-cancel", onClick: j2 }]), 278528 & e18.$$.dirty && n2(7, a2 = S2("repair", o2) || o2), 229376 & e18.$$.dirty && n2(6, c2 = i2 ? [s2, u2] : [s2]), 2 & e18.$$.dirty && n2(5, l2 = [{ icon: Tx, text: "Apply", title: "Apply fixed JSON", disabled: m2, onClick: C2 }]);
}, n2(15, s2 = { icon: $x, text: "Show me", title: "Scroll to the error location", onClick: function() {
h2 && r2 && null != r2.position && (h2.setSelectionRange(r2.position, r2.position), setTimeout(function() {
h2.focus();
}));
} }), n2(16, u2 = { icon: gx, text: "Auto repair", title: "Automatically repair JSON", onClick: function() {
try {
n2(0, v2 = y2(v2)), k2 && k2(v2);
} catch (e19) {
}
} }), [v2, m2, r2, f2, h2, l2, c2, a2, function(e19) {
_2("handleChange");
var t3 = e19.target.value;
v2 !== t3 && (n2(0, v2 = t3), k2 && k2(v2));
}, g2, y2, k2, w2, j2, S2, s2, u2, i2, o2, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(4, h2 = e19);
});
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(3, f2 = e19);
});
}];
}
var oF = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, iF, rF, Ki, { text: 0, readOnly: 1, onParse: 9, onRepair: 10, onChange: 11, onApply: 12, onCancel: 13, onRenderMenu: 14 }, Xq), r2;
}
return Li(n2);
}();
function aF(e18) {
co(e18, "svelte-1ffm3pm", ".jse-modal.jse-repair.svelte-1ffm3pm{flex:1;display:flex;flex-direction:column;font-family:var(--jse-font-family);font-size:var(--jse-font-size);line-height:normal;background:var(--jse-background-color);color:var(--jse-text-color)}");
}
function sF(e18) {
var t2, n2, r2, i2;
function o2(t3) {
e18[7](t3);
}
var a2 = { onParse: e18[1], onRepair: e18[2], onApply: e18[4], onCancel: e18[5], onRenderMenu: e18[3] };
return void 0 !== e18[0] && (a2.text = e18[0]), n2 = new oF({ props: a2 }), Xo.push(function() {
return Oa(n2, "text", o2);
}), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-modal jse-repair svelte-1ffm3pm");
}, m: function(e19, r3) {
vo(e19, t2, r3), Ea(n2, t2, null), i2 = true;
}, p: function(e19, t3) {
var i3 = ki(t3, 1)[0], o3 = {};
2 & i3 && (o3.onParse = e19[1]), 4 & i3 && (o3.onRepair = e19[2]), 8 & i3 && (o3.onRenderMenu = e19[3]), !r2 && 1 & i3 && (r2 = true, o3.text = e19[0], sa(function() {
return r2 = false;
})), n2.$set(o3);
}, i: function(e19) {
i2 || (ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function uF(e18, t2, n2) {
var r2 = t2.text, i2 = t2.onParse, o2 = t2.onRepair, a2 = t2.onApply, s2 = t2.onRenderMenu, u2 = Yo("simple-modal").close;
return e18.$$set = function(e19) {
"text" in e19 && n2(0, r2 = e19.text), "onParse" in e19 && n2(1, i2 = e19.onParse), "onRepair" in e19 && n2(2, o2 = e19.onRepair), "onApply" in e19 && n2(6, a2 = e19.onApply), "onRenderMenu" in e19 && n2(3, s2 = e19.onRenderMenu);
}, [r2, i2, o2, s2, function(e19) {
u2(), a2(e19);
}, function() {
u2();
}, a2, function(e19) {
n2(0, r2 = e19);
}];
}
var cF = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, uF, sF, Ki, { text: 0, onParse: 1, onRepair: 2, onApply: 6, onRenderMenu: 3 }, aF), r2;
}
return Li(n2);
}();
function lF(e18) {
co(e18, "svelte-mojfmz", ".jse-dropdown-button.svelte-mojfmz.svelte-mojfmz{flex:1;line-height:normal;border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;position:relative;padding:0;display:flex}.jse-dropdown-button.svelte-mojfmz ul.svelte-mojfmz{margin:0;padding:0}.jse-dropdown-button.svelte-mojfmz ul li.svelte-mojfmz{margin:0;padding:0;list-style-type:none}.jse-dropdown-button.svelte-mojfmz button.jse-open-dropdown.svelte-mojfmz{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;width:2em;background:var(--jse-context-menu-background);color:var(--jse-context-menu-color);border-radius:0}.jse-dropdown-button.svelte-mojfmz button.jse-open-dropdown.jse-visible.svelte-mojfmz{background:var(--jse-context-menu-background)}.jse-dropdown-button.svelte-mojfmz button.jse-open-dropdown.svelte-mojfmz:hover{background:var(--jse-context-menu-background-highlight)}.jse-dropdown-button.svelte-mojfmz button.jse-open-dropdown.svelte-mojfmz:disabled{color:var(--jse-context-menu-color-disabled);background:unset}.jse-dropdown-button.svelte-mojfmz .jse-dropdown-items.svelte-mojfmz{display:none;position:absolute;top:100%;left:0;z-index:1;background:var(--jse-context-menu-background);color:var(--jse-context-menu-color);box-shadow:var(--jse-controls-box-shadow)}.jse-dropdown-button.svelte-mojfmz .jse-dropdown-items.jse-visible.svelte-mojfmz{display:block}.jse-dropdown-button.svelte-mojfmz .jse-dropdown-items button.svelte-mojfmz{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;width:100%;text-align:left;padding:var(--jse-padding);margin:0}.jse-dropdown-button.svelte-mojfmz .jse-dropdown-items button.svelte-mojfmz:hover{background:var(--jse-context-menu-background-highlight)}.jse-dropdown-button.svelte-mojfmz .jse-dropdown-items button.svelte-mojfmz:disabled{color:var(--jse-context-menu-color-disabled);background:unset}");
}
function fF(e18, t2, n2) {
var r2 = e18.slice();
return r2[11] = t2[n2], r2;
}
var hF = function(e18) {
return {};
}, dF = function(e18) {
return {};
};
function vF(e18) {
var t2, n2;
return t2 = new uS({ props: { data: e18[11].icon } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
1 & n3 && (r2.data = e19[11].icon), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function pF(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2 = e18[11].text + "", h2 = e18[11].icon && vF(e18);
function d2() {
return e18[9](e18[11]);
}
return { c: function() {
t2 = go("li"), n2 = go("button"), h2 && h2.c(), r2 = ko(), i2 = bo(f2), s2 = ko(), So(n2, "type", "button"), So(n2, "title", o2 = e18[11].title), n2.disabled = a2 = e18[11].disabled, So(n2, "class", "svelte-mojfmz"), So(t2, "class", "svelte-mojfmz");
}, m: function(e19, o3) {
vo(e19, t2, o3), uo(t2, n2), h2 && h2.m(n2, null), uo(n2, r2), uo(n2, i2), uo(t2, s2), u2 = true, c2 || (l2 = jo(n2, "click", d2), c2 = true);
}, p: function(t3, s3) {
(e18 = t3)[11].icon ? h2 ? (h2.p(e18, s3), 1 & s3 && ya(h2, 1)) : ((h2 = vF(e18)).c(), ya(h2, 1), h2.m(n2, r2)) : h2 && (ma(), ba(h2, 1, 1, function() {
h2 = null;
}), ga()), (!u2 || 1 & s3) && f2 !== (f2 = e18[11].text + "") && Mo(i2, f2), (!u2 || 1 & s3 && o2 !== (o2 = e18[11].title)) && So(n2, "title", o2), (!u2 || 1 & s3 && a2 !== (a2 = e18[11].disabled)) && (n2.disabled = a2);
}, i: function(e19) {
u2 || (ya(h2), u2 = true);
}, o: function(e19) {
ba(h2), u2 = false;
}, d: function(e19) {
e19 && po(t2), h2 && h2.d(), c2 = false, l2();
} };
}
function mF(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2 = e18[8].defaultItem, h2 = Gi(f2, e18, e18[7], dF);
i2 = new uS({ props: { data: xx } });
for (var d2 = e18[0], v2 = [], p2 = 0; p2 < d2.length; p2 += 1)
v2[p2] = pF(fF(e18, d2, p2));
var m2 = function(e19) {
return ba(v2[e19], 1, 1, function() {
v2[e19] = null;
});
};
return { c: function() {
t2 = go("div"), h2 && h2.c(), n2 = ko(), r2 = go("button"), Ma(i2.$$.fragment), o2 = ko(), a2 = go("div"), s2 = go("ul");
for (var u3 = 0; u3 < v2.length; u3 += 1)
v2[u3].c();
So(r2, "type", "button"), So(r2, "class", "jse-open-dropdown svelte-mojfmz"), So(r2, "data-type", "jse-open-dropdown"), r2.disabled = e18[4], Io(r2, "jse-visible", e18[3]), So(s2, "class", "svelte-mojfmz"), So(a2, "class", "jse-dropdown-items svelte-mojfmz"), Po(a2, "width", e18[2]), Io(a2, "jse-visible", e18[3]), So(t2, "class", "jse-dropdown-button svelte-mojfmz"), So(t2, "title", e18[1]);
}, m: function(f3, d3) {
vo(f3, t2, d3), h2 && h2.m(t2, null), uo(t2, n2), uo(t2, r2), Ea(i2, r2, null), uo(t2, o2), uo(t2, a2), uo(a2, s2);
for (var p3 = 0; p3 < v2.length; p3 += 1)
v2[p3].m(s2, null);
u2 = true, c2 || (l2 = [jo(r2, "click", e18[5]), jo(t2, "click", e18[6])], c2 = true);
}, p: function(e19, n3) {
var i3 = ki(n3, 1)[0];
if (h2 && h2.p && (!u2 || 128 & i3) && Zi(h2, f2, e19, e19[7], u2 ? Yi(f2, e19[7], i3, hF) : Xi(e19[7]), dF), (!u2 || 16 & i3) && (r2.disabled = e19[4]), (!u2 || 8 & i3) && Io(r2, "jse-visible", e19[3]), 1 & i3) {
var o3;
for (d2 = e19[0], o3 = 0; o3 < d2.length; o3 += 1) {
var c3 = fF(e19, d2, o3);
v2[o3] ? (v2[o3].p(c3, i3), ya(v2[o3], 1)) : (v2[o3] = pF(c3), v2[o3].c(), ya(v2[o3], 1), v2[o3].m(s2, null));
}
for (ma(), o3 = d2.length; o3 < v2.length; o3 += 1)
m2(o3);
ga();
}
(!u2 || 4 & i3) && Po(a2, "width", e19[2]), (!u2 || 8 & i3) && Io(a2, "jse-visible", e19[3]), (!u2 || 2 & i3) && So(t2, "title", e19[1]);
}, i: function(e19) {
if (!u2) {
ya(h2, e19), ya(i2.$$.fragment, e19);
for (var t3 = 0; t3 < d2.length; t3 += 1)
ya(v2[t3]);
u2 = true;
}
}, o: function(e19) {
ba(h2, e19), ba(i2.$$.fragment, e19), v2 = v2.filter(Boolean);
for (var t3 = 0; t3 < v2.length; t3 += 1)
ba(v2[t3]);
u2 = false;
}, d: function(e19) {
e19 && po(t2), h2 && h2.d(e19), Pa(i2), mo(v2, e19), c2 = false, Hi(l2);
} };
}
function gF(e18, t2, n2) {
var r2, i2 = t2.$$slots, o2 = void 0 === i2 ? {} : i2, a2 = t2.$$scope, s2 = t2.items, u2 = void 0 === s2 ? [] : s2, c2 = t2.title, l2 = void 0 === c2 ? void 0 : c2, f2 = t2.width, h2 = void 0 === f2 ? "120px" : f2, d2 = false;
function v2() {
n2(3, d2 = false);
}
function p2(e19) {
"Escape" === Hj(e19) && (e19.preventDefault(), n2(3, d2 = false));
}
Uo(function() {
document.addEventListener("click", v2), document.addEventListener("keydown", p2);
}), Ko(function() {
document.removeEventListener("click", v2), document.removeEventListener("keydown", p2);
});
return e18.$$set = function(e19) {
"items" in e19 && n2(0, u2 = e19.items), "title" in e19 && n2(1, l2 = e19.title), "width" in e19 && n2(2, h2 = e19.width), "$$scope" in e19 && n2(7, a2 = e19.$$scope);
}, e18.$$.update = function() {
1 & e18.$$.dirty && n2(4, r2 = u2.every(function(e19) {
return true === e19.disabled;
}));
}, [u2, l2, h2, d2, r2, function() {
var e19 = d2;
setTimeout(function() {
return n2(3, d2 = !e19);
});
}, v2, a2, o2, function(e19) {
return e19.onClick();
}];
}
var yF = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, gF, mF, Ki, { items: 0, title: 1, width: 2 }, lF), r2;
}
return Li(n2);
}(), bF = { prefix: "far", iconName: "lightbulb", icon: [384, 512, [128161], "f0eb", "M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM192 0C90.02 .3203 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.8 289.2 .0039 192 0zM288.4 260.1c-15.66 17.85-35.04 46.3-49.05 75.89h-94.61c-14.01-29.59-33.39-58.04-49.04-75.88C75.24 236.8 64 206.1 64 175.1C64 113.3 112.1 48.25 191.1 48C262.6 48 320 105.4 320 175.1C320 206.1 308.8 236.8 288.4 260.1zM176 80C131.9 80 96 115.9 96 160c0 8.844 7.156 16 16 16S128 168.8 128 160c0-26.47 21.53-48 48-48c8.844 0 16-7.148 16-15.99S184.8 80 176 80z"] }, kF = { prefix: "far", iconName: "square-check", icon: [448, 512, [9745, 9989, 61510, "check-square"], "f14a", "M211.8 339.8C200.9 350.7 183.1 350.7 172.2 339.8L108.2 275.8C97.27 264.9 97.27 247.1 108.2 236.2C119.1 225.3 136.9 225.3 147.8 236.2L192 280.4L300.2 172.2C311.1 161.3 328.9 161.3 339.8 172.2C350.7 183.1 350.7 200.9 339.8 211.8L211.8 339.8zM0 96C0 60.65 28.65 32 64 32H384C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96zM48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80H64C55.16 80 48 87.16 48 96z"] }, wF = { prefix: "far", iconName: "square", icon: [448, 512, [9632, 9723, 9724, 61590], "f0c8", "M384 32C419.3 32 448 60.65 448 96V416C448 451.3 419.3 480 384 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H384zM384 80H64C55.16 80 48 87.16 48 96V416C48 424.8 55.16 432 64 432H384C392.8 432 400 424.8 400 416V96C400 87.16 392.8 80 384 80z"] }, jF = { prefix: "far", iconName: "clock", icon: [512, 512, [128339, "clock-four"], "f017", "M232 120C232 106.7 242.7 96 256 96C269.3 96 280 106.7 280 120V243.2L365.3 300C376.3 307.4 379.3 322.3 371.1 333.3C364.6 344.3 349.7 347.3 338.7 339.1L242.7 275.1C236 271.5 232 264 232 255.1L232 120zM256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0zM48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48C141.1 48 48 141.1 48 256z"] };
function xF(e18) {
co(e18, "svelte-1yai37q", ".jse-contextmenu.svelte-1yai37q.svelte-1yai37q{box-shadow:var(--jse-controls-box-shadow);font-family:var(--jse-font-family);font-size:var(--jse-font-size);background:var(--jse-context-menu-background);color:var(--jse-context-menu-color)}.jse-contextmenu.svelte-1yai37q button.svelte-1yai37q{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0}.jse-contextmenu.svelte-1yai37q button.svelte-1yai37q:focus{background:var(--jse-context-menu-background-highlight)}.jse-contextmenu.svelte-1yai37q .jse-row.svelte-1yai37q{display:flex;flex-direction:row;align-items:flex-start;justify-content:stretch}.jse-contextmenu.svelte-1yai37q .jse-row div.jse-label.svelte-1yai37q{flex:1;white-space:nowrap;padding:var(--jse-padding);color:var(--jse-context-menu-color-disabled);line-height:normal}.jse-contextmenu.svelte-1yai37q .jse-row div.jse-tip.svelte-1yai37q{flex:1;background:var(--jse-context-menu-tip-background);color:var(--jse-context-menu-tip-color);margin:calc(0.5 * var(--jse-padding));padding:calc(0.5 * var(--jse-padding)) var(--jse-padding);font-size:80%;line-height:1.3em;display:flex;flex-direction:row;align-items:center;gap:var(--jse-padding);border-radius:3px}.jse-contextmenu.svelte-1yai37q .jse-row div.jse-tip div.svelte-1yai37q{vertical-align:middle}.jse-contextmenu.svelte-1yai37q .jse-row button.svelte-1yai37q{flex:1;white-space:nowrap;padding:var(--jse-padding);color:inherit}.jse-contextmenu.svelte-1yai37q .jse-row button.svelte-1yai37q:hover{background:var(--jse-context-menu-background-highlight)}.jse-contextmenu.svelte-1yai37q .jse-row button.svelte-1yai37q:disabled{color:var(--jse-context-menu-color-disabled);background:unset}.jse-contextmenu.svelte-1yai37q .jse-row button .jse-insert.svelte-1yai37q{display:inline-block;position:relative;width:18px;height:18px;font-family:var(--jse-font-family-mono);font-weight:bold;font-size:16px}.jse-contextmenu.svelte-1yai37q .jse-row button .jse-insert .jse-quote.svelte-1yai37q,.jse-contextmenu.svelte-1yai37q .jse-row button .jse-insert .jse-plus.svelte-1yai37q{position:absolute;top:-4px;left:2px;font-size:24px}.jse-contextmenu.svelte-1yai37q .jse-column.svelte-1yai37q{flex:1;display:flex;flex-direction:column;align-items:stretch}.jse-contextmenu.svelte-1yai37q .jse-column.svelte-1yai37q:not(:last-child){border-right:1px solid var(--jse-context-menu-separator-color)}.jse-contextmenu.svelte-1yai37q .jse-column button.svelte-1yai37q{text-align:left;min-width:130px}.jse-contextmenu.svelte-1yai37q .jse-separator.svelte-1yai37q{width:100%;height:1px;background:var(--jse-context-menu-separator-color)}");
}
function SF(e18) {
var t2, n2, r2, i2, o2, a2, s2;
return n2 = new uS({ props: { data: yx } }), { c: function() {
t2 = go("button"), Ma(n2.$$.fragment), r2 = bo(" Edit value"), So(t2, "type", "button"), So(t2, "slot", "defaultItem"), So(t2, "title", "Edit the value (Double-click on the value)"), t2.disabled = i2 = !e18[2], So(t2, "class", "svelte-1yai37q");
}, m: function(i3, u2) {
vo(i3, t2, u2), Ea(n2, t2, null), uo(t2, r2), o2 = true, a2 || (s2 = jo(t2, "click", e18[18]), a2 = true);
}, p: function(e19, n3) {
(!o2 || 4 & n3[0] && i2 !== (i2 = !e19[2])) && (t2.disabled = i2);
}, i: function(e19) {
o2 || (ya(n2.$$.fragment, e19), o2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), o2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), a2 = false, s2();
} };
}
function _F(e18) {
var t2, n2, r2, i2, o2, a2, s2;
return n2 = new uS({ props: { data: lx } }), { c: function() {
t2 = go("button"), Ma(n2.$$.fragment), r2 = bo(" Cut"), So(t2, "type", "button"), So(t2, "slot", "defaultItem"), So(t2, "title", "Cut selected contents, formatted with indentation (Ctrl+X)"), t2.disabled = i2 = !e18[1], So(t2, "class", "svelte-1yai37q");
}, m: function(i3, u2) {
vo(i3, t2, u2), Ea(n2, t2, null), uo(t2, r2), o2 = true, a2 || (s2 = jo(t2, "click", e18[19]), a2 = true);
}, p: function(e19, n3) {
(!o2 || 2 & n3[0] && i2 !== (i2 = !e19[1])) && (t2.disabled = i2);
}, i: function(e19) {
o2 || (ya(n2.$$.fragment, e19), o2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), o2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), a2 = false, s2();
} };
}
function CF(e18) {
var t2, n2, r2, i2, o2, a2, s2;
return n2 = new uS({ props: { data: Ex } }), { c: function() {
t2 = go("button"), Ma(n2.$$.fragment), r2 = bo(" Copy"), So(t2, "type", "button"), So(t2, "slot", "defaultItem"), So(t2, "title", "Copy selected contents, formatted with indentation (Ctrl+C)"), t2.disabled = i2 = !e18[1], So(t2, "class", "svelte-1yai37q");
}, m: function(i3, u2) {
vo(i3, t2, u2), Ea(n2, t2, null), uo(t2, r2), o2 = true, a2 || (s2 = jo(t2, "click", e18[20]), a2 = true);
}, p: function(e19, n3) {
(!o2 || 2 & n3[0] && i2 !== (i2 = !e19[1])) && (t2.disabled = i2);
}, i: function(e19) {
o2 || (ya(n2.$$.fragment, e19), o2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), o2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), a2 = false, s2();
} };
}
function $F(e18) {
var t2, n2, r2, i2, o2, a2, s2;
return i2 = new uS({ props: { data: bF } }), { c: function() {
t2 = go("div"), n2 = go("div"), r2 = go("div"), Ma(i2.$$.fragment), o2 = ko(), (a2 = go("div")).textContent = "Tip: you can open this context menu via right-click or with Ctrl+Q", So(r2, "class", "svelte-1yai37q"), So(a2, "class", "svelte-1yai37q"), So(n2, "class", "jse-tip svelte-1yai37q"), So(t2, "class", "jse-row svelte-1yai37q");
}, m: function(e19, u2) {
vo(e19, t2, u2), uo(t2, n2), uo(n2, r2), Ea(i2, r2, null), uo(n2, o2), uo(n2, a2), s2 = true;
}, p: Bi, i: function(e19) {
s2 || (ya(i2.$$.fragment, e19), s2 = true);
}, o: function(e19) {
ba(i2.$$.fragment, e19), s2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(i2);
} };
}
function OF(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2, g2, y2, b2, k2, w2, j2, x2, S2, _2, C2, $2, O2, M2, E2, P2, A2, T2, I2, N2, R2, D2, L2, z2, B2, q2, F2, V2, W2, H2, J2, U2, K2, G2, Q2, Y2, Z2, X2, ee2, te2, ne2, re2, ie2, oe2, ae2, se2, ue2, ce2, le2, fe2, he2, de2, ve2, pe2, me2, ge2, ye2, be2, ke2, we2, je2, xe2, Se2, _e2, Ce2, $e2, Oe2, Me2, Ee2, Pe2, Ae2, Te2, Ie2, Ne2, Re2, De2, Le2, ze2, Be2, qe2, Fe2;
i2 = new uS({ props: { data: yx } }), u2 = new yF({ props: { width: "11em", items: e18[8], $$slots: { defaultItem: [SF] }, $$scope: { ctx: e18 } } }), d2 = new yF({ props: { width: "10em", items: e18[7], $$slots: { defaultItem: [_F] }, $$scope: { ctx: e18 } } }), p2 = new yF({ props: { width: "12em", items: e18[6], $$slots: { defaultItem: [CF] }, $$scope: { ctx: e18 } } }), y2 = new uS({ props: { data: ux } }), $2 = new uS({ props: { data: Px } }), A2 = new uS({ props: { data: Ax } }), D2 = new uS({ props: { data: wx } }), F2 = new uS({ props: { data: _x } }), U2 = new uS({ props: { data: px } }), Pe2 = new uS({ props: { data: vx } }), Re2 = new uS({ props: { data: fx } });
var Ve2 = e18[0] && $F();
return { c: function() {
t2 = go("div"), n2 = go("div"), r2 = go("button"), Ma(i2.$$.fragment), o2 = bo(" Edit key"), s2 = ko(), Ma(u2.$$.fragment), c2 = ko(), l2 = go("div"), f2 = ko(), h2 = go("div"), Ma(d2.$$.fragment), v2 = ko(), Ma(p2.$$.fragment), m2 = ko(), g2 = go("button"), Ma(y2.$$.fragment), b2 = bo(" Paste"), w2 = ko(), j2 = go("div"), x2 = ko(), S2 = go("div"), _2 = go("div"), C2 = go("button"), Ma($2.$$.fragment), O2 = bo(" Remove"), E2 = ko(), P2 = go("button"), Ma(A2.$$.fragment), T2 = bo(" Duplicate"), N2 = ko(), R2 = go("button"), Ma(D2.$$.fragment), L2 = bo(" Extract"), B2 = ko(), q2 = go("button"), Ma(F2.$$.fragment), V2 = bo(" Sort"), H2 = ko(), J2 = go("button"), Ma(U2.$$.fragment), K2 = bo(" Transform"), Q2 = ko(), Y2 = go("div"), Z2 = go("div"), X2 = bo(e18[13]), ee2 = bo(":"), te2 = ko(), ne2 = go("button"), re2 = go("span"), (ie2 = go("span")).textContent = "+", oe2 = bo(" Structure"), ue2 = ko(), ce2 = go("button"), (le2 = go("span")).textContent = "{}", fe2 = bo(" Object"), ve2 = ko(), pe2 = go("button"), (me2 = go("span")).textContent = "[]", ge2 = bo(" Array"), ke2 = ko(), we2 = go("button"), (je2 = go("span")).innerHTML = '"', xe2 = bo(" Value"), Ce2 = ko(), $e2 = go("div"), Oe2 = ko(), Me2 = go("div"), Ee2 = go("button"), Ma(Pe2.$$.fragment), Ae2 = bo(" Insert before"), Ie2 = ko(), Ne2 = go("button"), Ma(Re2.$$.fragment), De2 = bo(" Insert after"), ze2 = ko(), Ve2 && Ve2.c(), So(r2, "type", "button"), So(r2, "title", "Edit the key (Double-click on the key)"), r2.disabled = a2 = !e18[14], So(r2, "class", "svelte-1yai37q"), So(n2, "class", "jse-row svelte-1yai37q"), So(l2, "class", "jse-separator svelte-1yai37q"), So(g2, "type", "button"), So(g2, "title", "Paste clipboard contents (Ctrl+V)"), g2.disabled = k2 = !e18[3], So(g2, "class", "svelte-1yai37q"), So(h2, "class", "jse-row svelte-1yai37q"), So(j2, "class", "jse-separator svelte-1yai37q"), So(C2, "type", "button"), So(C2, "title", "Remove selected contents (Delete)"), C2.disabled = M2 = !e18[1], So(C2, "class", "svelte-1yai37q"), So(P2, "type", "button"), So(P2, "title", "Duplicate selected contents (Ctrl+D)"), P2.disabled = I2 = !e18[16], So(P2, "class", "svelte-1yai37q"), So(R2, "type", "button"), So(R2, "title", "Extract selected contents"), R2.disabled = z2 = !e18[15], So(R2, "class", "svelte-1yai37q"), So(q2, "type", "button"), So(q2, "title", "Sort array or object contents"), q2.disabled = W2 = !e18[1], So(q2, "class", "svelte-1yai37q"), So(J2, "type", "button"), So(J2, "title", "Transform array or object contents (filter, sort, project)"), J2.disabled = G2 = !e18[1], So(J2, "class", "svelte-1yai37q"), So(_2, "class", "jse-column svelte-1yai37q"), So(Z2, "class", "jse-label svelte-1yai37q"), So(ie2, "class", "jse-plus svelte-1yai37q"), So(re2, "class", "jse-insert svelte-1yai37q"), So(ne2, "type", "button"), So(ne2, "title", ae2 = e18[13] + " structure"), ne2.disabled = se2 = !e18[12], So(ne2, "class", "svelte-1yai37q"), So(le2, "class", "jse-insert svelte-1yai37q"), So(ce2, "type", "button"), So(ce2, "title", he2 = e18[13] + " object"), ce2.disabled = de2 = !e18[11], So(ce2, "class", "svelte-1yai37q"), So(me2, "class", "jse-insert svelte-1yai37q"), So(pe2, "type", "button"), So(pe2, "title", ye2 = e18[13] + " array"), pe2.disabled = be2 = !e18[10], So(pe2, "class", "svelte-1yai37q"), So(je2, "class", "jse-insert svelte-1yai37q"), So(we2, "type", "button"), So(we2, "title", Se2 = e18[13] + " value"), we2.disabled = _e2 = !e18[9], So(we2, "class", "svelte-1yai37q"), So(Y2, "class", "jse-column svelte-1yai37q"), So(S2, "class", "jse-row svelte-1yai37q"), So($e2, "class", "jse-separator svelte-1yai37q"), So(Ee2, "type", "button"), So(Ee2, "title", "Select area before current entry to insert or paste contents"), Ee2.disabled = Te2 = !e18[1] || e18[4], So(Ee2, "class", "svelte-1yai37q"), So(Ne2, "type", "button"), So(Ne2, "title", "Select area after current entry to insert or paste contents"), Ne2.disabled = Le2 = !e18[1] || e18[4], So(Ne2, "class", "svelte-1yai37q"), So(Me2, "class", "jse-row svelte-1yai37q"), So(t2, "class", "jse-contextmenu svelte-1yai37q");
}, m: function(a3, k3) {
vo(a3, t2, k3), uo(t2, n2), uo(n2, r2), Ea(i2, r2, null), uo(r2, o2), uo(n2, s2), Ea(u2, n2, null), uo(t2, c2), uo(t2, l2), uo(t2, f2), uo(t2, h2), Ea(d2, h2, null), uo(h2, v2), Ea(p2, h2, null), uo(h2, m2), uo(h2, g2), Ea(y2, g2, null), uo(g2, b2), uo(t2, w2), uo(t2, j2), uo(t2, x2), uo(t2, S2), uo(S2, _2), uo(_2, C2), Ea($2, C2, null), uo(C2, O2), uo(_2, E2), uo(_2, P2), Ea(A2, P2, null), uo(P2, T2), uo(_2, N2), uo(_2, R2), Ea(D2, R2, null), uo(R2, L2), uo(_2, B2), uo(_2, q2), Ea(F2, q2, null), uo(q2, V2), uo(_2, H2), uo(_2, J2), Ea(U2, J2, null), uo(J2, K2), uo(S2, Q2), uo(S2, Y2), uo(Y2, Z2), uo(Z2, X2), uo(Z2, ee2), uo(Y2, te2), uo(Y2, ne2), uo(ne2, re2), uo(re2, ie2), uo(ne2, oe2), uo(Y2, ue2), uo(Y2, ce2), uo(ce2, le2), uo(ce2, fe2), uo(Y2, ve2), uo(Y2, pe2), uo(pe2, me2), uo(pe2, ge2), uo(Y2, ke2), uo(Y2, we2), uo(we2, je2), uo(we2, xe2), uo(t2, Ce2), uo(t2, $e2), uo(t2, Oe2), uo(t2, Me2), uo(Me2, Ee2), Ea(Pe2, Ee2, null), uo(Ee2, Ae2), uo(Me2, Ie2), uo(Me2, Ne2), Ea(Re2, Ne2, null), uo(Ne2, De2), uo(t2, ze2), Ve2 && Ve2.m(t2, null), e18[59](t2), Be2 = true, qe2 || (Fe2 = [jo(r2, "click", e18[17]), jo(g2, "click", e18[21]), jo(C2, "click", e18[22]), jo(P2, "click", e18[23]), jo(R2, "click", e18[24]), jo(q2, "click", e18[26]), jo(J2, "click", e18[27]), jo(ne2, "click", e18[55]), jo(ce2, "click", e18[56]), jo(pe2, "click", e18[57]), jo(we2, "click", e18[58]), jo(Ee2, "click", e18[28]), jo(Ne2, "click", e18[29]), jo(t2, "keydown", e18[30])], qe2 = true);
}, p: function(e19, n3) {
(!Be2 || 16384 & n3[0] && a2 !== (a2 = !e19[14])) && (r2.disabled = a2);
var i3 = {};
256 & n3[0] && (i3.items = e19[8]), 4 & n3[0] | 2 & n3[2] && (i3.$$scope = { dirty: n3, ctx: e19 }), u2.$set(i3);
var o3 = {};
128 & n3[0] && (o3.items = e19[7]), 2 & n3[0] | 2 & n3[2] && (o3.$$scope = { dirty: n3, ctx: e19 }), d2.$set(o3);
var s3 = {};
64 & n3[0] && (s3.items = e19[6]), 2 & n3[0] | 2 & n3[2] && (s3.$$scope = { dirty: n3, ctx: e19 }), p2.$set(s3), (!Be2 || 8 & n3[0] && k2 !== (k2 = !e19[3])) && (g2.disabled = k2), (!Be2 || 2 & n3[0] && M2 !== (M2 = !e19[1])) && (C2.disabled = M2), (!Be2 || 65536 & n3[0] && I2 !== (I2 = !e19[16])) && (P2.disabled = I2), (!Be2 || 32768 & n3[0] && z2 !== (z2 = !e19[15])) && (R2.disabled = z2), (!Be2 || 2 & n3[0] && W2 !== (W2 = !e19[1])) && (q2.disabled = W2), (!Be2 || 2 & n3[0] && G2 !== (G2 = !e19[1])) && (J2.disabled = G2), (!Be2 || 8192 & n3[0]) && Mo(X2, e19[13]), (!Be2 || 8192 & n3[0] && ae2 !== (ae2 = e19[13] + " structure")) && So(ne2, "title", ae2), (!Be2 || 4096 & n3[0] && se2 !== (se2 = !e19[12])) && (ne2.disabled = se2), (!Be2 || 8192 & n3[0] && he2 !== (he2 = e19[13] + " object")) && So(ce2, "title", he2), (!Be2 || 2048 & n3[0] && de2 !== (de2 = !e19[11])) && (ce2.disabled = de2), (!Be2 || 8192 & n3[0] && ye2 !== (ye2 = e19[13] + " array")) && So(pe2, "title", ye2), (!Be2 || 1024 & n3[0] && be2 !== (be2 = !e19[10])) && (pe2.disabled = be2), (!Be2 || 8192 & n3[0] && Se2 !== (Se2 = e19[13] + " value")) && So(we2, "title", Se2), (!Be2 || 512 & n3[0] && _e2 !== (_e2 = !e19[9])) && (we2.disabled = _e2), (!Be2 || 18 & n3[0] && Te2 !== (Te2 = !e19[1] || e19[4])) && (Ee2.disabled = Te2), (!Be2 || 18 & n3[0] && Le2 !== (Le2 = !e19[1] || e19[4])) && (Ne2.disabled = Le2), e19[0] ? Ve2 ? (Ve2.p(e19, n3), 1 & n3[0] && ya(Ve2, 1)) : ((Ve2 = $F()).c(), ya(Ve2, 1), Ve2.m(t2, null)) : Ve2 && (ma(), ba(Ve2, 1, 1, function() {
Ve2 = null;
}), ga());
}, i: function(e19) {
Be2 || (ya(i2.$$.fragment, e19), ya(u2.$$.fragment, e19), ya(d2.$$.fragment, e19), ya(p2.$$.fragment, e19), ya(y2.$$.fragment, e19), ya($2.$$.fragment, e19), ya(A2.$$.fragment, e19), ya(D2.$$.fragment, e19), ya(F2.$$.fragment, e19), ya(U2.$$.fragment, e19), ya(Pe2.$$.fragment, e19), ya(Re2.$$.fragment, e19), ya(Ve2), Be2 = true);
}, o: function(e19) {
ba(i2.$$.fragment, e19), ba(u2.$$.fragment, e19), ba(d2.$$.fragment, e19), ba(p2.$$.fragment, e19), ba(y2.$$.fragment, e19), ba($2.$$.fragment, e19), ba(A2.$$.fragment, e19), ba(D2.$$.fragment, e19), ba(F2.$$.fragment, e19), ba(U2.$$.fragment, e19), ba(Pe2.$$.fragment, e19), ba(Re2.$$.fragment, e19), ba(Ve2), Be2 = false;
}, d: function(n3) {
n3 && po(t2), Pa(i2), Pa(u2), Pa(d2), Pa(p2), Pa(y2), Pa($2), Pa(A2), Pa(D2), Pa(F2), Pa(U2), Pa(Pe2), Pa(Re2), Ve2 && Ve2.d(), e18[59](null), qe2 = false, Hi(Fe2);
} };
}
function MF(e18, t2, n2) {
var r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2, g2, y2, b2, k2, w2, j2, x2, S2 = t2.json, _2 = t2.documentState, C2 = t2.parser, $2 = t2.showTip, O2 = t2.onCloseContextMenu, M2 = t2.onEditKey, E2 = t2.onEditValue, P2 = t2.onToggleEnforceString, A2 = t2.onCut, T2 = t2.onCopy, I2 = t2.onPaste, N2 = t2.onRemove, R2 = t2.onDuplicate, D2 = t2.onExtract, L2 = t2.onInsertBefore, z2 = t2.onInsert, B2 = t2.onConvert, q2 = t2.onInsertAfter, F2 = t2.onSort, V2 = t2.onTransform;
function W2() {
O2(), E2();
}
function H2() {
O2(), P2();
}
function J2() {
O2(), A2(true);
}
function U2() {
O2(), A2(false);
}
function K2() {
O2(), T2(true);
}
function G2() {
O2(), T2(false);
}
function Q2(e19) {
O2(), u2 ? B2(e19) : z2(e19);
}
Uo(function() {
setTimeout(function() {
var e19 = Ti(x2.querySelectorAll("button")).find(function(e20) {
return !e20.disabled;
});
e19 && e19.focus();
});
});
return e18.$$set = function(e19) {
"json" in e19 && n2(31, S2 = e19.json), "documentState" in e19 && n2(32, _2 = e19.documentState), "parser" in e19 && n2(33, C2 = e19.parser), "showTip" in e19 && n2(0, $2 = e19.showTip), "onCloseContextMenu" in e19 && n2(34, O2 = e19.onCloseContextMenu), "onEditKey" in e19 && n2(35, M2 = e19.onEditKey), "onEditValue" in e19 && n2(36, E2 = e19.onEditValue), "onToggleEnforceString" in e19 && n2(37, P2 = e19.onToggleEnforceString), "onCut" in e19 && n2(38, A2 = e19.onCut), "onCopy" in e19 && n2(39, T2 = e19.onCopy), "onPaste" in e19 && n2(40, I2 = e19.onPaste), "onRemove" in e19 && n2(41, N2 = e19.onRemove), "onDuplicate" in e19 && n2(42, R2 = e19.onDuplicate), "onExtract" in e19 && n2(43, D2 = e19.onExtract), "onInsertBefore" in e19 && n2(44, L2 = e19.onInsertBefore), "onInsert" in e19 && n2(45, z2 = e19.onInsert), "onConvert" in e19 && n2(46, B2 = e19.onConvert), "onInsertAfter" in e19 && n2(47, q2 = e19.onInsertAfter), "onSort" in e19 && n2(48, F2 = e19.onSort), "onTransform" in e19 && n2(49, V2 = e19.onTransform);
}, e18.$$.update = function() {
2 & e18.$$.dirty[1] && n2(51, r2 = _2.selection), 1 & e18.$$.dirty[1] && n2(54, i2 = void 0 !== S2), 1048576 & e18.$$.dirty[1] && n2(3, o2 = null != r2), 8 & e18.$$.dirty[0] | 1048576 & e18.$$.dirty[1] && n2(4, a2 = o2 && Mm(r2.focusPath)), 8 & e18.$$.dirty[0] | 1048577 & e18.$$.dirty[1] && n2(52, s2 = o2 ? fs.exports.getIn(S2, r2.focusPath) : void 0), 9437184 & e18.$$.dirty[1] && n2(1, u2 = i2 && (YB(r2) || GB(r2) || QB(r2))), 18 & e18.$$.dirty[0] | 8388608 & e18.$$.dirty[1] && n2(16, c2 = i2 && u2 && !a2), 16 & e18.$$.dirty[0] | 9437184 & e18.$$.dirty[1] && n2(15, l2 = i2 && null != r2 && (YB(r2) || QB(r2)) && !a2), 16 & e18.$$.dirty[0] | 9437185 & e18.$$.dirty[1] && n2(14, f2 = i2 && null != r2 && uq(r2) && !a2 && !Array.isArray(fs.exports.getIn(S2, im(r2.focusPath)))), 11534336 & e18.$$.dirty[1] && n2(2, h2 = i2 && null != r2 && uq(r2) && !Ts(s2)), 2 & e18.$$.dirty[0] && n2(53, d2 = u2), 4194304 & e18.$$.dirty[1] && n2(13, v2 = d2 ? "Convert to" : "Insert"), 8 & e18.$$.dirty[0] | 4194304 & e18.$$.dirty[1] && n2(12, p2 = !d2 && o2), 8 & e18.$$.dirty[0] | 7340032 & e18.$$.dirty[1] && n2(11, m2 = d2 ? kq(r2) && !As(s2) : o2), 8 & e18.$$.dirty[0] | 7340032 & e18.$$.dirty[1] && n2(10, g2 = d2 ? kq(r2) && !Array.isArray(s2) : o2), 8 & e18.$$.dirty[0] | 7340032 & e18.$$.dirty[1] && n2(9, y2 = d2 ? kq(r2) && Ts(s2) : o2), 3145734 & e18.$$.dirty[1] && n2(50, b2 = null != r2 && RB(s2, _2.enforceStringMap, fs.exports.compileJSONPointer(r2.focusPath), C2)), 4 & e18.$$.dirty[0] | 524288 & e18.$$.dirty[1] && n2(8, k2 = [{ icon: yx, text: "Edit value", title: "Edit the value (Double-click on the value)", onClick: W2, disabled: !h2 }, { icon: b2 ? kF : wF, text: "Enforce string", title: "Enforce keeping the value as string when it contains a numeric value", onClick: H2, disabled: !h2 }]), 2 & e18.$$.dirty[0] && n2(7, w2 = [{ icon: lx, text: "Cut formatted", title: "Cut selected contents, formatted with indentation (Ctrl+X)", onClick: J2, disabled: !u2 }, { icon: lx, text: "Cut compacted", title: "Cut selected contents, without indentation (Ctrl+Shift+X)", onClick: U2, disabled: !u2 }]), 2 & e18.$$.dirty[0] && n2(6, j2 = [{ icon: Ex, text: "Copy formatted", title: "Copy selected contents, formatted with indentation (Ctrl+C)", onClick: K2, disabled: !u2 }, { icon: Ex, text: "Copy compacted", title: "Copy selected contents, without indentation (Ctrl+Shift+C)", onClick: G2, disabled: !u2 }]);
}, [$2, u2, h2, o2, a2, x2, j2, w2, k2, y2, g2, m2, p2, v2, f2, l2, c2, function() {
O2(), M2();
}, W2, J2, K2, function() {
O2(), I2();
}, function() {
O2(), N2();
}, function() {
O2(), R2();
}, function() {
O2(), D2();
}, Q2, function() {
O2(), F2();
}, function() {
O2(), V2();
}, function() {
O2(), L2();
}, function() {
O2(), q2();
}, function(e19) {
var t3 = Hj(e19).replace(/^Command\+/, "Ctrl+");
if ("Up" === t3 || "Down" === t3 || "Left" === t3 || "Right" === t3) {
e19.preventDefault();
var n3 = Vj({ allElements: Array.from(x2.querySelectorAll("button:not([disabled])")), currentElement: e19.target, direction: t3, hasPrio: function(e20) {
return "jse-open-dropdown" !== e20.getAttribute("data-type");
} });
n3 && n3.focus();
}
}, S2, _2, C2, O2, M2, E2, P2, A2, T2, I2, N2, R2, D2, L2, z2, B2, q2, F2, V2, b2, r2, s2, d2, i2, function() {
return Q2("structure");
}, function() {
return Q2("object");
}, function() {
return Q2("array");
}, function() {
return Q2("value");
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(5, x2 = e19);
});
}];
}
var EF = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, MF, OF, Ki, { json: 31, documentState: 32, parser: 33, showTip: 0, onCloseContextMenu: 34, onEditKey: 35, onEditValue: 36, onToggleEnforceString: 37, onCut: 38, onCopy: 39, onPaste: 40, onRemove: 41, onDuplicate: 42, onExtract: 43, onInsertBefore: 44, onInsert: 45, onConvert: 46, onInsertAfter: 47, onSort: 48, onTransform: 49 }, xF, [-1, -1, -1]), r2;
}
return Li(n2);
}(), PF = { exports: {} };
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(e18) {
!function() {
var t2 = {}.hasOwnProperty;
function n2() {
for (var e19 = [], r2 = 0; r2 < arguments.length; r2++) {
var i2 = arguments[r2];
if (i2) {
var o2 = zi(i2);
if ("string" === o2 || "number" === o2)
e19.push(i2);
else if (Array.isArray(i2)) {
if (i2.length) {
var a2 = n2.apply(null, i2);
a2 && e19.push(a2);
}
} else if ("object" === o2) {
if (i2.toString !== Object.prototype.toString && !i2.toString.toString().includes("[native code]")) {
e19.push(i2.toString());
continue;
}
for (var s2 in i2)
t2.call(i2, s2) && i2[s2] && e19.push(s2);
}
}
}
return e19.join(" ");
}
e18.exports ? (n2.default = n2, e18.exports = n2) : window.classNames = n2;
}();
}(PF);
var AF = PF.exports;
function TF(e18) {
co(e18, "svelte-1knbf5w", "div.jse-collapsed-items.svelte-1knbf5w.svelte-1knbf5w{font-family:var(--jse-font-family);font-size:var(--jse-font-size);color:var(--jse-collapsed-items-link-color);padding:calc(0.5 * var(--jse-padding));border:8px solid transparent;border-width:8px 0;background-color:transparent;background-image:linear-gradient(var(--jse-collapsed-items-background-color), var(--jse-collapsed-items-background-color)), linear-gradient(to bottom right, transparent 50.5%, var(--jse-collapsed-items-background-color) 50.5%), linear-gradient(to bottom left, transparent 50.5%, var(--jse-collapsed-items-background-color) 50.5%), linear-gradient(to top right, transparent 50.5%, var(--jse-collapsed-items-background-color) 50.5%), linear-gradient(to top left, transparent 50.5%, var(--jse-collapsed-items-background-color) 50.5%);background-repeat:repeat, repeat-x, repeat-x, repeat-x, repeat-x;background-position:0 0, 8px 0, 8px 0, 8px 100%, 8px 100%;background-size:auto auto, 16px 16px, 16px 16px, 16px 16px, 16px 16px;background-clip:padding-box, border-box, border-box, border-box, border-box;background-origin:padding-box, border-box, border-box, border-box, border-box;display:flex}div.jse-collapsed-items.svelte-1knbf5w div.jse-text.svelte-1knbf5w,div.jse-collapsed-items.svelte-1knbf5w button.jse-expand-items.svelte-1knbf5w{margin:0 calc(0.5 * var(--jse-padding))}div.jse-collapsed-items.svelte-1knbf5w div.jse-text.svelte-1knbf5w{display:inline}div.jse-collapsed-items.svelte-1knbf5w button.jse-expand-items.svelte-1knbf5w{font-family:inherit;font-size:inherit;color:var(--jse-collapsed-items-link-color);background:none;border:none;padding:0;text-decoration:underline;cursor:pointer}div.jse-collapsed-items.svelte-1knbf5w button.jse-expand-items.svelte-1knbf5w:hover,div.jse-collapsed-items.svelte-1knbf5w button.jse-expand-items.svelte-1knbf5w:focus{color:var(--jse-collapsed-items-link-color-highlight)}");
}
function IF(e18, t2, n2) {
var r2 = e18.slice();
return r2[13] = t2[n2], r2;
}
function NF(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2 = e18[13].start + "", l2 = e18[13].end + "";
function f2() {
return e18[12](e18[13]);
}
return { c: function() {
t2 = go("button"), n2 = bo("show "), r2 = bo(c2), i2 = bo("-"), o2 = bo(l2), a2 = ko(), So(t2, "type", "button"), So(t2, "class", "jse-expand-items svelte-1knbf5w");
}, m: function(e19, c3) {
vo(e19, t2, c3), uo(t2, n2), uo(t2, r2), uo(t2, i2), uo(t2, o2), uo(t2, a2), s2 || (u2 = jo(t2, "click", f2), s2 = true);
}, p: function(t3, n3) {
e18 = t3, 16 & n3 && c2 !== (c2 = e18[13].start + "") && Mo(r2, c2), 16 & n3 && l2 !== (l2 = e18[13].end + "") && Mo(o2, l2);
}, d: function(e19) {
e19 && po(t2), s2 = false, u2();
} };
}
function RF(e18) {
for (var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2 = e18[4], d2 = [], v2 = 0; v2 < h2.length; v2 += 1)
d2[v2] = NF(IF(e18, h2, v2));
return { c: function() {
t2 = go("div"), n2 = go("div"), r2 = go("div"), i2 = bo("Items "), o2 = bo(e18[3]), a2 = bo("-"), s2 = bo(e18[2]), u2 = ko();
for (var l3 = 0; l3 < d2.length; l3 += 1)
d2[l3].c();
So(r2, "class", "jse-text svelte-1knbf5w"), So(t2, "class", "jse-collapsed-items svelte-1knbf5w"), So(t2, "style", c2 = DF(e18[0].length + 2)), Io(t2, "jse-selected", e18[5]);
}, m: function(e19, c3) {
vo(e19, t2, c3), uo(t2, n2), uo(n2, r2), uo(r2, i2), uo(r2, o2), uo(r2, a2), uo(r2, s2), uo(n2, u2);
for (var h3 = 0; h3 < d2.length; h3 += 1)
d2[h3].m(n2, null);
l2 || (f2 = jo(t2, "mousemove", LF), l2 = true);
}, p: function(e19, r3) {
var i3 = ki(r3, 1)[0];
if (8 & i3 && Mo(o2, e19[3]), 4 & i3 && Mo(s2, e19[2]), 19 & i3) {
var a3;
for (h2 = e19[4], a3 = 0; a3 < h2.length; a3 += 1) {
var u3 = IF(e19, h2, a3);
d2[a3] ? d2[a3].p(u3, i3) : (d2[a3] = NF(u3), d2[a3].c(), d2[a3].m(n2, null));
}
for (; a3 < d2.length; a3 += 1)
d2[a3].d(1);
d2.length = h2.length;
}
1 & i3 && c2 !== (c2 = DF(e19[0].length + 2)) && So(t2, "style", c2), 32 & i3 && Io(t2, "jse-selected", e19[5]);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2), mo(d2, e19), l2 = false, f2();
} };
}
function DF(e18) {
return "margin-left: calc(".concat(e18, " * var(--jse-indent-size))");
}
function LF(e18) {
e18.stopPropagation();
}
function zF(e18, t2, n2) {
var r2, i2, o2, a2, s2, u2 = t2.visibleSections, c2 = t2.sectionIndex, l2 = t2.total, f2 = t2.path, h2 = t2.pointer, d2 = t2.selection, v2 = t2.onExpandSection;
return e18.$$set = function(e19) {
"visibleSections" in e19 && n2(6, u2 = e19.visibleSections), "sectionIndex" in e19 && n2(7, c2 = e19.sectionIndex), "total" in e19 && n2(8, l2 = e19.total), "path" in e19 && n2(0, f2 = e19.path), "pointer" in e19 && n2(9, h2 = e19.pointer), "selection" in e19 && n2(10, d2 = e19.selection), "onExpandSection" in e19 && n2(1, v2 = e19.onExpandSection);
}, e18.$$.update = function() {
192 & e18.$$.dirty && n2(11, r2 = u2[c2]), 2048 & e18.$$.dirty && n2(3, i2 = r2.end), 448 & e18.$$.dirty && n2(2, o2 = u2[c2 + 1] ? u2[c2 + 1].start : l2), 1544 & e18.$$.dirty && n2(5, a2 = !!YB(d2) && true === d2.pointersMap[fs.exports.appendToJSONPointer(h2, i2)]), 12 & e18.$$.dirty && n2(4, s2 = function(e19, t3) {
var n3 = { start: e19, end: Math.min(pB(e19), t3) }, r3 = Math.max(mB((e19 + t3) / 2), e19), i3 = { start: r3, end: Math.min(pB(r3), t3) }, o3 = mB(t3), a3 = o3 === t3 ? o3 - 100 : o3, s3 = { start: Math.max(a3, e19), end: t3 }, u3 = [n3], c3 = i3.start >= n3.end && i3.end <= s3.start;
return c3 && u3.push(i3), s3.start >= (c3 ? i3.end : n3.end) && u3.push(s3), u3;
}(i2, o2));
}, [f2, v2, o2, i2, s2, a2, u2, c2, l2, h2, d2, r2, function(e19) {
return v2(f2, e19);
}];
}
var BF = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, zF, RF, Ki, { visibleSections: 6, sectionIndex: 7, total: 8, path: 0, pointer: 9, selection: 10, onExpandSection: 1 }, TF), r2;
}
return Li(n2);
}();
function qF(e18) {
co(e18, "svelte-dol684", ".jse-context-menu-button.svelte-dol684{position:absolute;top:calc(-0.5 * var(--jse-context-menu-button-size));right:calc(-0.5 * var(--jse-context-menu-button-size));width:var(--jse-context-menu-button-size);height:var(--jse-context-menu-button-size);padding:0;margin:0;z-index:2;cursor:pointer;background:transparent;border-radius:2px;background:var(--jse-context-menu-button-background);color:var(--jse-context-menu-button-color);border:none;box-shadow:var(--jse-controls-box-shadow)}.jse-context-menu-button.svelte-dol684:hover{background:var(--jse-context-menu-button-background-highlight)}");
}
function FF(e18) {
var t2, n2, r2, i2, o2;
return n2 = new uS({ props: { data: xx } }), { c: function() {
t2 = go("button"), Ma(n2.$$.fragment), So(t2, "type", "button"), So(t2, "class", "jse-context-menu-button svelte-dol684"), So(t2, "title", is), Io(t2, "jse-selected", e18[0]);
}, m: function(a2, s2) {
vo(a2, t2, s2), Ea(n2, t2, null), r2 = true, i2 || (o2 = jo(t2, "click", e18[1]), i2 = true);
}, p: function(e19, n3) {
var i3 = ki(n3, 1)[0];
(!r2 || 1 & i3) && Io(t2, "jse-selected", e19[0]);
}, i: function(e19) {
r2 || (ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), i2 = false, o2();
} };
}
function VF(e18, t2, n2) {
var r2 = t2.selected, i2 = t2.onContextMenu;
return e18.$$set = function(e19) {
"selected" in e19 && n2(0, r2 = e19.selected), "onContextMenu" in e19 && n2(2, i2 = e19.onContextMenu);
}, [r2, function(e19) {
for (var t3 = e19.target; t3 && "BUTTON" !== t3.nodeName; )
t3 = t3.parentNode;
t3 && i2({ anchor: t3, left: 0, top: 0, width: 260, height: 336, offsetTop: 2, offsetLeft: 0, showTip: true });
}, i2];
}
var WF = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, VF, FF, Ki, { selected: 0, onContextMenu: 2 }, qF), r2;
}
return Li(n2);
}();
function HF(e18) {
co(e18, "svelte-s6kbew", ".jse-highlight.svelte-s6kbew{background-color:var(--jse-search-match-color);outline:var(--jse-search-match-outline)}.jse-highlight.jse-active.svelte-s6kbew{background-color:var(--jse-search-match-active-color);outline:var(--jse-search-match-active-outline)}");
}
function JF(e18, t2, n2) {
var r2 = e18.slice();
return r2[3] = t2[n2], r2;
}
function UF(e18) {
var t2, n2, r2 = Pj(e18[3].text) + "";
return { c: function() {
t2 = go("span"), n2 = bo(r2), So(t2, "class", "jse-highlight svelte-s6kbew"), Io(t2, "jse-active", e18[3].active);
}, m: function(e19, r3) {
vo(e19, t2, r3), uo(t2, n2);
}, p: function(e19, i2) {
1 & i2 && r2 !== (r2 = Pj(e19[3].text) + "") && Mo(n2, r2), 1 & i2 && Io(t2, "jse-active", e19[3].active);
}, d: function(e19) {
e19 && po(t2);
} };
}
function KF(e18) {
var t2, n2 = e18[3].text + "";
return { c: function() {
t2 = bo(n2);
}, m: function(e19, n3) {
vo(e19, t2, n3);
}, p: function(e19, r2) {
1 & r2 && n2 !== (n2 = e19[3].text + "") && Mo(t2, n2);
}, d: function(e19) {
e19 && po(t2);
} };
}
function GF(e18) {
var t2;
function n2(e19, t3) {
return "normal" === e19[3].type ? KF : UF;
}
var r2 = n2(e18), i2 = r2(e18);
return { c: function() {
i2.c(), t2 = wo();
}, m: function(e19, n3) {
i2.m(e19, n3), vo(e19, t2, n3);
}, p: function(e19, o2) {
r2 === (r2 = n2(e19)) && i2 ? i2.p(e19, o2) : (i2.d(1), (i2 = r2(e19)) && (i2.c(), i2.m(t2.parentNode, t2)));
}, d: function(e19) {
i2.d(e19), e19 && po(t2);
} };
}
function QF(e18) {
for (var t2, n2 = e18[0], r2 = [], i2 = 0; i2 < n2.length; i2 += 1)
r2[i2] = GF(JF(e18, n2, i2));
return { c: function() {
for (var e19 = 0; e19 < r2.length; e19 += 1)
r2[e19].c();
t2 = wo();
}, m: function(e19, n3) {
for (var i3 = 0; i3 < r2.length; i3 += 1)
r2[i3].m(e19, n3);
vo(e19, t2, n3);
}, p: function(e19, i3) {
var o2 = ki(i3, 1)[0];
if (1 & o2) {
var a2;
for (n2 = e19[0], a2 = 0; a2 < n2.length; a2 += 1) {
var s2 = JF(e19, n2, a2);
r2[a2] ? r2[a2].p(s2, o2) : (r2[a2] = GF(s2), r2[a2].c(), r2[a2].m(t2.parentNode, t2));
}
for (; a2 < r2.length; a2 += 1)
r2[a2].d(1);
r2.length = n2.length;
}
}, i: Bi, o: Bi, d: function(e19) {
mo(r2, e19), e19 && po(t2);
} };
}
function YF(e18, t2, n2) {
var r2, i2 = t2.text, o2 = t2.searchResultItems;
return e18.$$set = function(e19) {
"text" in e19 && n2(1, i2 = e19.text), "searchResultItems" in e19 && n2(2, o2 = e19.searchResultItems);
}, e18.$$.update = function() {
6 & e18.$$.dirty && n2(0, r2 = function(e19, t3) {
var n3, r3 = [], i3 = 0, o3 = bi(t3);
try {
for (o3.s(); !(n3 = o3.n()).done; ) {
var a2 = n3.value, s2 = e19.slice(i3, a2.start);
"" !== s2 && r3.push({ type: "normal", text: s2, active: false });
var u2 = e19.slice(a2.start, a2.end);
r3.push({ type: "highlight", text: u2, active: a2.active }), i3 = a2.end;
}
} catch (e20) {
o3.e(e20);
} finally {
o3.f();
}
var c2 = $v(t3);
return c2.end < e19.length && r3.push({ type: "normal", text: e19.slice(c2.end), active: false }), r3;
}(String(i2), o2));
}, [r2, i2, o2];
}
var ZF = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, YF, QF, Ui, { text: 1, searchResultItems: 2 }, HF), r2;
}
return Li(n2);
}();
function XF(e18) {
co(e18, "svelte-rw77oa", ".jse-value.jse-string.svelte-rw77oa{color:var(--jse-value-color-string)}.jse-value.jse-object.svelte-rw77oa,.jse-value.jse-array.svelte-rw77oa{min-width:16px;color:var(--jse-delimiter-color)}.jse-value.jse-number.svelte-rw77oa{color:var(--jse-value-color-number)}.jse-value.jse-boolean.svelte-rw77oa{color:var(--jse-value-color-boolean)}.jse-value.jse-null.svelte-rw77oa{color:var(--jse-value-color-null)}.jse-value.jse-invalid.svelte-rw77oa{color:var(--jse-text-color)}.jse-value.jse-url.svelte-rw77oa{color:var(--jse-value-color-url);text-decoration:underline}div.jse-editable-div.svelte-rw77oa{min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;word-break:normal;white-space:pre-wrap;overflow-wrap:anywhere}div.jse-editable-div.jse-short-text.svelte-rw77oa{overflow-wrap:normal}div.jse-editable-div[contenteditable=true].svelte-rw77oa{outline:var(--jse-edit-outline);background:inherit !important;position:relative;border-radius:0;z-index:3}div.jse-editable-div.jse-empty.svelte-rw77oa:not(:focus){outline:1px dotted var(--jse-tag-background);-moz-outline-radius:2px}div.jse-editable-div.jse-empty.svelte-rw77oa::after{pointer-events:none;color:var(--jse-tag-background)}");
}
function eV(e18) {
var t2, n2, r2, i2;
return { c: function() {
So(t2 = go("div"), "class", n2 = eo(AF("jse-editable-div", e18[2], { "jse-short-text": e18[0] })) + " svelte-rw77oa"), So(t2, "contenteditable", "true"), So(t2, "spellcheck", "false");
}, m: function(n3, o2) {
vo(n3, t2, o2), e18[13](t2), r2 || (i2 = [jo(t2, "input", e18[3]), jo(t2, "keydown", e18[4]), jo(t2, "paste", e18[5]), jo(t2, "blur", e18[6])], r2 = true);
}, p: function(e19, r3) {
5 & ki(r3, 1)[0] && n2 !== (n2 = eo(AF("jse-editable-div", e19[2], { "jse-short-text": e19[0] })) + " svelte-rw77oa") && So(t2, "class", n2);
}, i: Bi, o: Bi, d: function(n3) {
n3 && po(t2), e18[13](null), r2 = false, Hi(i2);
} };
}
function tV(e18, t2, n2) {
var r2, i2 = Da("jsoneditor:EditableDiv"), o2 = t2.value, a2 = t2.shortText, s2 = void 0 !== a2 && a2, u2 = t2.onChange, c2 = t2.onCancel, l2 = t2.onFind, f2 = t2.onPaste, h2 = void 0 === f2 ? Yu : f2, d2 = t2.onValueClass, v2 = void 0 === d2 ? function() {
return "";
} : d2, p2 = v2(o2), m2 = false;
function g2() {
return function(e19) {
return e19.replace(/\n$/, "");
}(r2.innerText);
}
function y2(e19) {
n2(1, r2.innerText = Pj(e19), r2);
}
return Uo(function() {
i2("onMount", { value: o2 }), y2(o2), setTimeout(function() {
return Rj(r2);
});
}), Ko(function() {
var e19 = g2();
i2("onDestroy", { closed: m2, value: o2, newValue: e19 }), m2 || e19 === o2 || u2(e19, os);
}), e18.$$set = function(e19) {
"value" in e19 && n2(7, o2 = e19.value), "shortText" in e19 && n2(0, s2 = e19.shortText), "onChange" in e19 && n2(8, u2 = e19.onChange), "onCancel" in e19 && n2(9, c2 = e19.onCancel), "onFind" in e19 && n2(10, l2 = e19.onFind), "onPaste" in e19 && n2(11, h2 = e19.onPaste), "onValueClass" in e19 && n2(12, v2 = e19.onValueClass);
}, [s2, r2, p2, function() {
var e19 = g2();
"" === e19 && y2(""), n2(2, p2 = v2(e19));
}, function(e19) {
e19.stopPropagation();
var t3 = Hj(e19).replace(/^Command\+/, "Ctrl+");
if ("Escape" === t3 && (m2 = true, c2()), "Enter" === t3 || "Tab" === t3) {
m2 = true;
var n3 = g2();
u2(n3, ss);
}
"Ctrl+F" === t3 && (e19.preventDefault(), l2(false)), "Ctrl+H" === t3 && (e19.preventDefault(), l2(true));
}, function(e19) {
if (h2) {
var t3 = e19.clipboardData.getData("text/plain");
h2(t3);
}
}, function() {
var e19 = document.hasFocus(), t3 = g2();
i2("handleBlur", { hasFocus: e19, closed: m2, value: o2, newValue: t3 }), document.hasFocus() && !m2 && (m2 = true, t3 !== o2 ? u2(t3, as) : c2());
}, o2, u2, c2, l2, h2, v2, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(1, r2 = e19);
});
}];
}
var nV = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, tV, eV, Ki, { value: 7, shortText: 0, onChange: 8, onCancel: 9, onFind: 10, onPaste: 11, onValueClass: 12 }, XF), r2;
}
return Li(n2);
}();
function rV(e18) {
co(e18, "svelte-566egb", '.jse-key.svelte-566egb{display:inline-block;min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;color:var(--jse-key-color);word-break:normal;overflow-wrap:normal;white-space:pre-wrap}.jse-key.svelte-566egb:hover{background:var(--jse-hover-background-color)}.jse-key.svelte-566egb:hover{background:var(--jse-hover-background-color)}.jse-key.jse-empty.svelte-566egb{min-width:3em;outline:1px dotted var(--jse-tag-background);-moz-outline-radius:2px}.jse-key.jse-empty.svelte-566egb::after{pointer-events:none;color:var(--jse-tag-background);content:"key"}');
}
function iV(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2 = [sV, aV], c2 = [];
function l2(e19, t3) {
return e19[1] ? 0 : 1;
}
return n2 = l2(e18), r2 = c2[n2] = u2[n2](e18), { c: function() {
t2 = go("div"), r2.c(), So(t2, "data-type", "selectable-key"), So(t2, "class", i2 = eo(e18[6](e18[0])) + " svelte-566egb");
}, m: function(r3, i3) {
vo(r3, t2, i3), c2[n2].m(t2, null), o2 = true, a2 || (s2 = jo(t2, "dblclick", e18[5]), a2 = true);
}, p: function(e19, a3) {
var s3 = n2;
(n2 = l2(e19)) === s3 ? c2[n2].p(e19, a3) : (ma(), ba(c2[s3], 1, 1, function() {
c2[s3] = null;
}), ga(), (r2 = c2[n2]) ? r2.p(e19, a3) : (r2 = c2[n2] = u2[n2](e19)).c(), ya(r2, 1), r2.m(t2, null)), (!o2 || 1 & a3 && i2 !== (i2 = eo(e19[6](e19[0])) + " svelte-566egb")) && So(t2, "class", i2);
}, i: function(e19) {
o2 || (ya(r2), o2 = true);
}, o: function(e19) {
ba(r2), o2 = false;
}, d: function(e19) {
e19 && po(t2), c2[n2].d(), a2 = false, s2();
} };
}
function oV(e18) {
var t2, n2;
return t2 = new nV({ props: { value: e18[2].normalization.escapeValue(e18[0]), shortText: true, onChange: e18[7], onCancel: e18[8], onFind: e18[2].onFind } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
5 & n3 && (r2.value = e19[2].normalization.escapeValue(e19[0])), 4 & n3 && (r2.onFind = e19[2].onFind), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function aV(e18) {
var t2, n2 = Pj(e18[2].normalization.escapeValue(e18[0])) + "";
return { c: function() {
t2 = bo(n2);
}, m: function(e19, n3) {
vo(e19, t2, n3);
}, p: function(e19, r2) {
5 & r2 && n2 !== (n2 = Pj(e19[2].normalization.escapeValue(e19[0])) + "") && Mo(t2, n2);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function sV(e18) {
var t2, n2;
return t2 = new ZF({ props: { text: e18[2].normalization.escapeValue(e18[0]), searchResultItems: e18[1] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
5 & n3 && (r2.text = e19[2].normalization.escapeValue(e19[0])), 2 & n3 && (r2.searchResultItems = e19[1]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function uV(e18) {
var t2, n2;
return t2 = new WF({ props: { selected: true, onContextMenu: e18[2].onContextMenu } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
4 & n3 && (r2.onContextMenu = e19[2].onContextMenu), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function cV(e18) {
var t2, n2, r2, i2, o2, a2 = [oV, iV], s2 = [];
function u2(e19, t3) {
return e19[4] ? 0 : 1;
}
t2 = u2(e18), n2 = s2[t2] = a2[t2](e18);
var c2 = !e18[2].readOnly && e18[3] && !e18[4] && uV(e18);
return { c: function() {
n2.c(), r2 = ko(), c2 && c2.c(), i2 = wo();
}, m: function(e19, n3) {
s2[t2].m(e19, n3), vo(e19, r2, n3), c2 && c2.m(e19, n3), vo(e19, i2, n3), o2 = true;
}, p: function(e19, o3) {
var l2 = ki(o3, 1)[0], f2 = t2;
(t2 = u2(e19)) === f2 ? s2[t2].p(e19, l2) : (ma(), ba(s2[f2], 1, 1, function() {
s2[f2] = null;
}), ga(), (n2 = s2[t2]) ? n2.p(e19, l2) : (n2 = s2[t2] = a2[t2](e19)).c(), ya(n2, 1), n2.m(r2.parentNode, r2)), e19[2].readOnly || !e19[3] || e19[4] ? c2 && (ma(), ba(c2, 1, 1, function() {
c2 = null;
}), ga()) : c2 ? (c2.p(e19, l2), 28 & l2 && ya(c2, 1)) : ((c2 = uV(e19)).c(), ya(c2, 1), c2.m(i2.parentNode, i2));
}, i: function(e19) {
o2 || (ya(n2), ya(c2), o2 = true);
}, o: function(e19) {
ba(n2), ba(c2), o2 = false;
}, d: function(e19) {
s2[t2].d(e19), e19 && po(r2), c2 && c2.d(e19), e19 && po(i2);
} };
}
function lV(e18, t2, n2) {
var r2, i2, o2 = t2.path, a2 = t2.pointer, s2 = t2.key, u2 = t2.selection, c2 = t2.searchResultItems, l2 = t2.onUpdateKey, f2 = t2.context;
return e18.$$set = function(e19) {
"path" in e19 && n2(9, o2 = e19.path), "pointer" in e19 && n2(10, a2 = e19.pointer), "key" in e19 && n2(0, s2 = e19.key), "selection" in e19 && n2(11, u2 = e19.selection), "searchResultItems" in e19 && n2(1, c2 = e19.searchResultItems), "onUpdateKey" in e19 && n2(12, l2 = e19.onUpdateKey), "context" in e19 && n2(2, f2 = e19.context);
}, e18.$$.update = function() {
3072 & e18.$$.dirty && n2(3, r2 = u2 ? true === u2.pointersMap[a2] && GB(u2) : void 0), 2056 & e18.$$.dirty && n2(4, i2 = r2 && bq(u2));
}, [s2, c2, f2, r2, i2, function(e19) {
i2 || f2.readOnly || (e19.preventDefault(), f2.onSelect(hq(o2, true)));
}, function(e19) {
return AF("jse-key", { "jse-empty": "" === e19 });
}, function(e19, t3) {
var n3 = l2(s2, f2.normalization.unescapeValue(e19)), r3 = im(o2).concat(n3);
f2.onSelect(t3 === ss ? dq(r3, false) : hq(r3, false)), t3 !== as && f2.focus();
}, function() {
f2.onSelect(hq(o2, false)), f2.focus();
}, o2, a2, u2, l2];
}
var fV = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, lV, cV, Ki, { path: 9, pointer: 10, key: 0, selection: 11, searchResultItems: 1, onUpdateKey: 12, context: 2 }, rV), r2;
}
return Li(n2);
}();
function hV(e18, t2, n2) {
var r2 = e18.slice();
return r2[9] = t2[n2], r2;
}
function dV(e18) {
var t2, n2, r2, i2 = [e18[9].props], o2 = e18[9].component;
function a2(e19) {
for (var t3 = {}, n3 = 0; n3 < i2.length; n3 += 1)
t3 = Fi(t3, i2[n3]);
return { props: t3 };
}
return o2 && (t2 = new o2(a2())), { c: function() {
t2 && Ma(t2.$$.fragment), n2 = wo();
}, m: function(e19, i3) {
t2 && Ea(t2, e19, i3), vo(e19, n2, i3), r2 = true;
}, p: function(e19, r3) {
var s2 = 1 & r3 ? Ca(i2, [$a(e19[9].props)]) : {};
if (o2 !== (o2 = e19[9].component)) {
if (t2) {
ma();
var u2 = t2;
ba(u2.$$.fragment, 1, 0, function() {
Pa(u2, 1);
}), ga();
}
o2 ? (Ma((t2 = new o2(a2())).$$.fragment), ya(t2.$$.fragment, 1), Ea(t2, n2.parentNode, n2)) : t2 = null;
} else
o2 && t2.$set(s2);
}, i: function(e19) {
r2 || (t2 && ya(t2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
t2 && ba(t2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(n2), t2 && Pa(t2, e19);
} };
}
function vV(e18) {
for (var t2, n2, r2 = e18[0], i2 = [], o2 = 0; o2 < r2.length; o2 += 1)
i2[o2] = dV(hV(e18, r2, o2));
var a2 = function(e19) {
return ba(i2[e19], 1, 1, function() {
i2[e19] = null;
});
};
return { c: function() {
for (var e19 = 0; e19 < i2.length; e19 += 1)
i2[e19].c();
t2 = wo();
}, m: function(e19, r3) {
for (var o3 = 0; o3 < i2.length; o3 += 1)
i2[o3].m(e19, r3);
vo(e19, t2, r3), n2 = true;
}, p: function(e19, n3) {
var o3 = ki(n3, 1)[0];
if (1 & o3) {
var s2;
for (r2 = e19[0], s2 = 0; s2 < r2.length; s2 += 1) {
var u2 = hV(e19, r2, s2);
i2[s2] ? (i2[s2].p(u2, o3), ya(i2[s2], 1)) : (i2[s2] = dV(u2), i2[s2].c(), ya(i2[s2], 1), i2[s2].m(t2.parentNode, t2));
}
for (ma(), s2 = r2.length; s2 < i2.length; s2 += 1)
a2(s2);
ga();
}
}, i: function(e19) {
if (!n2) {
for (var t3 = 0; t3 < r2.length; t3 += 1)
ya(i2[t3]);
n2 = true;
}
}, o: function(e19) {
i2 = i2.filter(Boolean);
for (var t3 = 0; t3 < i2.length; t3 += 1)
ba(i2[t3]);
n2 = false;
}, d: function(e19) {
mo(i2, e19), e19 && po(t2);
} };
}
function pV(e18, t2, n2) {
var r2, i2, o2 = t2.path, a2 = t2.value, s2 = t2.context, u2 = t2.isSelected, c2 = t2.enforceString, l2 = t2.selection, f2 = t2.searchResultItems;
return e18.$$set = function(e19) {
"path" in e19 && n2(1, o2 = e19.path), "value" in e19 && n2(2, a2 = e19.value), "context" in e19 && n2(3, s2 = e19.context), "isSelected" in e19 && n2(4, u2 = e19.isSelected), "enforceString" in e19 && n2(5, c2 = e19.enforceString), "selection" in e19 && n2(6, l2 = e19.selection), "searchResultItems" in e19 && n2(7, f2 = e19.searchResultItems);
}, e18.$$.update = function() {
72 & e18.$$.dirty && n2(8, r2 = !s2.readOnly && QB(l2) && bq(l2)), 510 & e18.$$.dirty && n2(0, i2 = s2.onRenderValue({ path: o2, value: a2, readOnly: s2.readOnly, enforceString: c2, isSelected: u2, isEditing: r2, parser: s2.parser, normalization: s2.normalization, selection: l2, searchResultItems: f2, onPatch: s2.onPatch, onPasteJson: s2.onPasteJson, onSelect: s2.onSelect, onFind: s2.onFind, focus: s2.focus }));
}, [i2, o2, a2, s2, u2, c2, l2, f2, r2];
}
var mV = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, pV, vV, Ki, { path: 1, value: 2, context: 3, isSelected: 4, enforceString: 5, selection: 6, searchResultItems: 7 }), r2;
}
return Li(n2);
}(), gV = { selecting: false, selectionAnchor: null, selectionAnchorType: null, selectionFocus: null, dragging: false };
function yV(e18) {
var t2 = e18.json, n2 = e18.documentState, r2 = e18.deltaY, i2 = e18.items, o2 = n2.selection, a2 = r2 < 0 ? function(e19) {
var t3 = e19.items, n3 = e19.selection, r3 = e19.deltaY, i3 = XB(n3), o3 = t3.findIndex(function(e20) {
return Em(e20.path, i3);
}), a3 = function() {
var e20;
return null === (e20 = t3[s3 - 1]) || void 0 === e20 ? void 0 : e20.height;
}, s3 = o3, u3 = 0;
for (; void 0 !== a3() && Math.abs(r3) > u3 + a3() / 2; )
u3 += a3(), s3 -= 1;
var c3 = t3[s3].path, l3 = s3 - o3;
return s3 !== o3 && void 0 !== t3[s3] ? { beforePath: c3, offset: l3 } : void 0;
}({ json: t2, selection: o2, deltaY: r2, items: i2 }) : function(e19) {
var t3, n3 = e19.json, r3 = e19.items, i3 = e19.selection, o3 = e19.deltaY, a3 = eq(i3), s3 = r3.findIndex(function(e20) {
return Em(e20.path, a3);
}), u3 = 0, c3 = s3, l3 = function() {
var e20;
return null === (e20 = r3[c3 + 1]) || void 0 === e20 ? void 0 : e20.height;
};
for (; void 0 !== l3() && Math.abs(o3) > u3 + l3() / 2; )
u3 += l3(), c3 += 1;
var f2 = im(a3), h2 = fs.exports.getIn(n3, f2), d2 = Array.isArray(h2), v2 = null === (t3 = r3[d2 ? c3 : c3 + 1]) || void 0 === t3 ? void 0 : t3.path, p2 = c3 - s3;
return v2 ? { beforePath: v2, offset: p2 } : { append: true, offset: p2 };
}({ json: t2, selection: o2, deltaY: r2, items: i2 });
if (!a2 || 0 === a2.offset)
return { operations: void 0, updatedSelection: void 0, offset: 0 };
var s2 = function(e19, t3, n3) {
var r3 = n3.beforePath, i3 = n3.append, o3 = im(t3.focusPath), a3 = fs.exports.getIn(e19, o3);
if (!(i3 || r3 && lq(r3, o3) && r3.length > o3.length))
return [];
var s3 = XB(t3), u3 = eq(t3), c3 = $v(s3), l3 = $v(u3), f2 = r3 ? r3[o3.length] : void 0;
if (!fs.exports.isJSONObject(a3)) {
if (fs.exports.isJSONArray(a3)) {
var h2 = Ms(c3), d2 = Ms(l3), v2 = void 0 !== f2 ? Ms(f2) : a3.length;
return jk(d2 - h2 + 1, v2 < h2 ? function(e20) {
return { op: "move", from: fs.exports.compileJSONPointer(o3.concat(String(h2 + e20))), path: fs.exports.compileJSONPointer(o3.concat(String(v2 + e20))) };
} : function() {
return { op: "move", from: fs.exports.compileJSONPointer(o3.concat(String(h2))), path: fs.exports.compileJSONPointer(o3.concat(String(v2))) };
});
}
throw new Error("Cannot create move operations: parent must be an Object or Array");
}
var p2 = Object.keys(a3), m2 = p2.indexOf(c3), g2 = p2.indexOf(l3), y2 = i3 ? p2.length : p2.indexOf(f2);
return -1 !== m2 && -1 !== g2 && -1 !== y2 ? y2 > m2 ? [].concat(Ti(p2.slice(m2, g2 + 1)), Ti(p2.slice(y2, p2.length))).map(function(e20) {
return Mq(o3, e20);
}) : [].concat(Ti(p2.slice(y2, m2)), Ti(p2.slice(g2 + 1, p2.length))).map(function(e20) {
return Mq(o3, e20);
}) : void 0;
}(t2, n2.selection, a2), u2 = im(XB(o2)), c2 = fs.exports.getIn(t2, u2);
if (Array.isArray(c2)) {
var l2 = function(e19) {
var t3, n3, r3 = e19.items, i3 = e19.json, o3 = e19.selection, a3 = e19.offset, s3 = XB(o3), u3 = eq(o3), c3 = r3.findIndex(function(e20) {
return Em(e20.path, s3);
}), l3 = r3.findIndex(function(e20) {
return Em(e20.path, u3);
}), f2 = null === (t3 = r3[c3 + a3]) || void 0 === t3 ? void 0 : t3.path, h2 = null === (n3 = r3[l3 + a3]) || void 0 === n3 ? void 0 : n3.path;
return mq(i3, f2, h2);
}({ items: i2, json: t2, selection: o2, offset: a2.offset });
return { operations: s2, updatedSelection: l2, offset: a2.offset };
}
return { operations: s2, updatedSelection: void 0, offset: a2.offset };
}
function bV(e18, t2) {
return function(e19, t3) {
if (e19) {
for (var n2 = {}, r2 = 0, i2 = Object.keys(e19); r2 < i2.length; r2++) {
var o2 = i2[r2];
t3(o2, e19[o2]) && (n2[o2] = e19[o2]);
}
return Object.keys(n2).length > 0 ? n2 : void 0;
}
}(e18, function(e19) {
return fs.exports.startsWithJSONPointer(e19, t2);
});
}
function kV(e18) {
co(e18, "svelte-r4omvg", ".jse-tooltip.svelte-r4omvg{font-family:var(--jse-font-family);font-size:var(--jse-font-size);line-height:normal;padding:calc(0.5 * var(--jse-padding)) var(--jse-padding);border-radius:3px;background:var(--jse-context-menu-background);color:var(--jse-context-menu-color);white-space:nowrap;box-shadow:var(--jse-controls-box-shadow)}");
}
function wV(e18) {
var t2, n2;
return { c: function() {
t2 = go("div"), n2 = bo(e18[0]), So(t2, "class", "jse-tooltip svelte-r4omvg");
}, m: function(e19, r2) {
vo(e19, t2, r2), uo(t2, n2);
}, p: function(e19, t3) {
1 & ki(t3, 1)[0] && Mo(n2, e19[0]);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function jV(e18, t2, n2) {
var r2 = t2.text;
return e18.$$set = function(e19) {
"text" in e19 && n2(0, r2 = e19.text);
}, [r2];
}
var xV = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, jV, wV, Ui, { text: 0 }, kV), r2;
}
return Li(n2);
}();
function SV(e18, t2) {
var n2, r2 = t2.text, i2 = t2.openAbsolutePopup, o2 = t2.closeAbsolutePopup;
function a2() {
n2 = i2(xV, { text: r2 }, { position: "top", width: 10 * r2.length, offsetTop: 3, anchor: e18, closeOnOuterClick: true });
}
function s2() {
o2(n2);
}
return e18.addEventListener("mouseenter", a2), e18.addEventListener("mouseleave", s2), { destroy: function() {
e18.removeEventListener("mouseenter", a2), e18.removeEventListener("mouseleave", s2);
} };
}
function _V(e18) {
co(e18, "svelte-1q62mys", "button.jse-validation-error.svelte-1q62mys{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;color:var(--jse-warning-color);padding:0 5px;margin:0;font-size:var(--jse-font-size-mono);height:var(--jse-line-height);overflow:hidden}");
}
function CV(e18) {
var t2, n2, r2, i2, o2, a2;
return n2 = new uS({ props: { data: Ix } }), { c: function() {
t2 = go("button"), Ma(n2.$$.fragment), So(t2, "type", "button"), So(t2, "class", "jse-validation-error svelte-1q62mys");
}, m: function(s2, u2) {
vo(s2, t2, u2), Ea(n2, t2, null), i2 = true, o2 || (a2 = [jo(t2, "click", function() {
Ji(e18[0]) && e18[0].apply(this, arguments);
}), to(r2 = SV.call(null, t2, ji({ text: e18[1] }, e18[2])))], o2 = true);
}, p: function(t3, n3) {
var i3 = ki(n3, 1)[0];
e18 = t3, r2 && Ji(r2.update) && 2 & i3 && r2.update.call(null, ji({ text: e18[1] }, e18[2]));
}, i: function(e19) {
i2 || (ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), o2 = false, Hi(a2);
} };
}
function $V(e18, t2, n2) {
var r2, i2 = Yo("absolute-popup"), o2 = t2.validationError, a2 = t2.onExpand;
return e18.$$set = function(e19) {
"validationError" in e19 && n2(3, o2 = e19.validationError), "onExpand" in e19 && n2(0, a2 = e19.onExpand);
}, e18.$$.update = function() {
8 & e18.$$.dirty && n2(1, r2 = o2.isChildError ? "Contains invalid data" : o2.message);
}, [a2, r2, i2, o2];
}
var OV = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, $V, CV, Ui, { validationError: 3, onExpand: 0 }, _V), r2;
}
return Li(n2);
}();
function MV(e18) {
co(e18, "svelte-uj4yd7", ".jse-json-node.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative;color:var(--jse-text-color)}.jse-json-node.jse-root.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{min-height:100%;padding-bottom:2px;box-sizing:border-box}.jse-json-node.jse-root.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7 .jse-context-menu-button,.jse-json-node.jse-root.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7 .jse-context-menu-button{top:0;right:calc(-2px - var(--jse-context-menu-button-size))}.jse-json-node.jse-root.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7.svelte-uj4yd7{padding-left:0}.jse-json-node.jse-hovered.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{background:var(--jse-hover-background-color)}.jse-json-node.svelte-uj4yd7 .jse-props.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.svelte-uj4yd7 .jse-items.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative}.jse-json-node.svelte-uj4yd7 .jse-header-outer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.svelte-uj4yd7 .jse-footer-outer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex}.jse-json-node.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative}.jse-json-node.svelte-uj4yd7 .jse-header .jse-meta.svelte-uj4yd7>.jse-meta-inner.svelte-uj4yd7.svelte-uj4yd7{display:flex;justify-content:center}.jse-json-node.svelte-uj4yd7 .jse-contents-outer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex}.jse-json-node.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex;flex-direction:row}.jse-json-node.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding-left:var(--jse-indent-size)}.jse-json-node.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:inline-flex;padding-left:calc(var(--jse-indent-size) + 5px)}.jse-json-node.svelte-uj4yd7 .jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{visibility:hidden;padding:0 calc(0.5 * var(--jse-padding));flex:1}.jse-json-node.svelte-uj4yd7 .jse-insert-selection-area.jse-inside.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:inline-flex;align-items:center}.jse-json-node.svelte-uj4yd7 .jse-insert-selection-area.jse-after.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex;align-items:flex-end}.jse-json-node.svelte-uj4yd7:hover>.jse-contents-outer .jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:not(.jse-selected),.jse-json-node.svelte-uj4yd7 .jse-header-outer.svelte-uj4yd7:hover>.jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7:not(.jse-selected),.jse-json-node.svelte-uj4yd7 .jse-footer-outer:hover .jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:not(.jse-selected){visibility:visible;z-index:1}.jse-json-node.svelte-uj4yd7 .jse-context-menu-button-anchor.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative}.jse-json-node.svelte-uj4yd7 .jse-insert-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex;position:relative;max-width:250px;min-width:100px;height:0;margin-right:calc(0.5 * var(--jse-padding));outline:1px solid}.jse-json-node.svelte-uj4yd7 .jse-insert-area.svelte-uj4yd7 .jse-context-menu-button{right:-1px;background:var(--jse-selection-background-color)}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-hovered.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{outline-color:var(--jse-selection-background-color)}.jse-json-node.jse-selected.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-color) !important;cursor:grab}.jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{cursor:pointer}.jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-identifier>.jse-key,.jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-identifier>.jse-key{background:var(--jse-selection-background-color);cursor:grab}.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-value{background:var(--jse-selection-background-color);cursor:grab}.jse-json-node.svelte-uj4yd7 .jse-collapsed-items.jse-selected,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-collapsed-items,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-collapsed-items{background-color:var(--jse-selection-background-color);cursor:grab;background-image:linear-gradient(var(--jse-collapsed-items-selected-background-color), var(--jse-collapsed-items-selected-background-color)), linear-gradient(to bottom right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to bottom left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%)}.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{background:var(--jse-selection-background-color) !important}.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-color);cursor:grab}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{z-index:2;outline-color:var(--jse-context-menu-button-background)}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button{background:var(--jse-context-menu-button-background)}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button:hover{background:var(--jse-context-menu-button-background-highlight)}.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-light-color) !important;cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{cursor:pointer}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-identifier>.jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-identifier>.jse-key{background:var(--jse-selection-background-light-color);cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-value{background:var(--jse-selection-background-light-color);cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-collapsed-items.jse-selected,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-collapsed-items,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-collapsed-items{background-color:var(--jse-selection-background-light-color);cursor:grab;background-image:linear-gradient(var(--jse-collapsed-items-selected-background-color), var(--jse-collapsed-items-selected-background-color)), linear-gradient(to bottom right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to bottom left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%)}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{background:var(--jse-selection-background-light-color) !important}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-light-color);cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{z-index:2;outline-color:var(--jse-selection-background-color)}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button{background:var(--jse-selection-background-color)}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button:hover{background:var(--jse-selection-background-color)}.jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{width:var(--jse-indent-size);padding:0;margin:0;border:none;cursor:pointer;background:transparent;color:var(--jse-delimiter-color);font-size:var(--jse-font-size-mono);height:var(--jse-line-height)}.jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:hover{opacity:0.8}.jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-separator.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-index.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-bracket.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{vertical-align:top;color:var(--jse-delimiter-color)}.jse-index.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding:0 calc(0.5 * var(--jse-padding))}.jse-bracket.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding:0 2px}.jse-bracket.jse-expanded.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding-right:var(--jse-padding)}.jse-tag.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{border:none;font-size:80%;font-family:var(--jse-font-family);color:var(--jse-tag-color);background:var(--jse-tag-background);border-radius:2px;cursor:pointer;position:relative;display:inline-block;padding:0 4px;line-height:normal;margin:1px 0}.jse-tag.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:hover{opacity:0.8}.jse-tag.jse-expanded.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{opacity:0.7;cursor:inherit}.jse-identifier.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{vertical-align:top;position:relative}");
}
var EV = function(e18) {
return {};
}, PV = function(e18) {
return {};
};
function AV(e18, t2, n2) {
var r2 = e18.slice();
return r2[53] = t2[n2], r2;
}
var TV = function(e18) {
return {};
}, IV = function(e18) {
return {};
};
function NV(e18, t2, n2) {
var r2 = e18.slice();
return r2[47] = t2[n2], r2[49] = n2, r2;
}
function RV(e18, t2, n2) {
var r2 = e18.slice();
return r2[50] = t2[n2], r2;
}
var DV = function(e18) {
return {};
}, LV = function(e18) {
return {};
};
function zV(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2 = !e18[8].readOnly && e18[16] && e18[7] && (QB(e18[7]) || YB(e18[7])) && !e18[7].edit && Em(e18[7].focusPath, e18[1]), f2 = e18[34].identifier, h2 = Gi(f2, e18, e18[35], PV), d2 = !e18[17] && FV();
o2 = new mV({ props: { path: e18[1], value: e18[0], enforceString: e18[13], isSelected: e18[16], selection: e18[16] ? e18[7] : void 0, searchResultItems: Vq(e18[6], e18[9]), context: e18[8] } });
var v2 = l2 && VV(e18), p2 = e18[15] && WV(e18), m2 = !e18[17] && HV(e18);
return { c: function() {
t2 = go("div"), n2 = go("div"), h2 && h2.c(), r2 = ko(), d2 && d2.c(), i2 = ko(), Ma(o2.$$.fragment), a2 = ko(), v2 && v2.c(), s2 = ko(), p2 && p2.c(), u2 = ko(), m2 && m2.c(), So(n2, "class", "jse-contents svelte-uj4yd7"), So(t2, "class", "jse-contents-outer svelte-uj4yd7"), So(t2, "style", e18[18]);
}, m: function(e19, l3) {
vo(e19, t2, l3), uo(t2, n2), h2 && h2.m(n2, null), uo(n2, r2), d2 && d2.m(n2, null), uo(n2, i2), Ea(o2, n2, null), uo(n2, a2), v2 && v2.m(n2, null), uo(t2, s2), p2 && p2.m(t2, null), uo(t2, u2), m2 && m2.m(t2, null), c2 = true;
}, p: function(e19, r3) {
h2 && h2.p && (!c2 || 16 & r3[1]) && Zi(h2, f2, e19, e19[35], c2 ? Yi(f2, e19[35], r3, EV) : Xi(e19[35]), PV), e19[17] ? d2 && (d2.d(1), d2 = null) : d2 || ((d2 = FV()).c(), d2.m(n2, i2));
var a3 = {};
2 & r3[0] && (a3.path = e19[1]), 1 & r3[0] && (a3.value = e19[0]), 8192 & r3[0] && (a3.enforceString = e19[13]), 65536 & r3[0] && (a3.isSelected = e19[16]), 65664 & r3[0] && (a3.selection = e19[16] ? e19[7] : void 0), 576 & r3[0] && (a3.searchResultItems = Vq(e19[6], e19[9])), 256 & r3[0] && (a3.context = e19[8]), o2.$set(a3), 65922 & r3[0] && (l2 = !e19[8].readOnly && e19[16] && e19[7] && (QB(e19[7]) || YB(e19[7])) && !e19[7].edit && Em(e19[7].focusPath, e19[1])), l2 ? v2 ? (v2.p(e19, r3), 65922 & r3[0] && ya(v2, 1)) : ((v2 = VV(e19)).c(), ya(v2, 1), v2.m(n2, null)) : v2 && (ma(), ba(v2, 1, 1, function() {
v2 = null;
}), ga()), e19[15] ? p2 ? (p2.p(e19, r3), 32768 & r3[0] && ya(p2, 1)) : ((p2 = WV(e19)).c(), ya(p2, 1), p2.m(t2, u2)) : p2 && (ma(), ba(p2, 1, 1, function() {
p2 = null;
}), ga()), e19[17] ? m2 && (m2.d(1), m2 = null) : m2 ? m2.p(e19, r3) : ((m2 = HV(e19)).c(), m2.m(t2, null)), (!c2 || 262144 & r3[0]) && So(t2, "style", e19[18]);
}, i: function(e19) {
c2 || (ya(h2, e19), ya(o2.$$.fragment, e19), ya(v2), ya(p2), c2 = true);
}, o: function(e19) {
ba(h2, e19), ba(o2.$$.fragment, e19), ba(v2), ba(p2), c2 = false;
}, d: function(e19) {
e19 && po(t2), h2 && h2.d(e19), d2 && d2.d(), Pa(o2), v2 && v2.d(), p2 && p2.d(), m2 && m2.d();
} };
}
function BV(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2, g2, y2, b2 = !e18[8].readOnly && e18[16] && e18[7] && (QB(e18[7]) || YB(e18[7])) && !e18[7].edit && Em(e18[7].focusPath, e18[1]), k2 = [UV, JV], w2 = [];
function j2(e19, t3) {
return e19[12] ? 0 : 1;
}
i2 = j2(e18), o2 = w2[i2] = k2[i2](e18);
var x2 = e18[34].identifier, S2 = Gi(x2, e18, e18[35], IV), _2 = !e18[17] && KV();
function C2(e19, t3) {
return e19[12] ? QV : GV;
}
var $2 = C2(e18), O2 = $2(e18), M2 = b2 && YV(e18), E2 = e18[15] && (!e18[12] || !e18[15].isChildError) && ZV(e18);
function P2(e19, t3) {
return e19[12] ? eW : e19[17] ? void 0 : XV;
}
var A2 = P2(e18), T2 = A2 && A2(e18), I2 = e18[12] && tW(e18);
return { c: function() {
t2 = go("div"), n2 = go("div"), r2 = go("button"), o2.c(), a2 = ko(), S2 && S2.c(), s2 = ko(), _2 && _2.c(), u2 = ko(), c2 = go("div"), l2 = go("div"), O2.c(), f2 = ko(), M2 && M2.c(), h2 = ko(), E2 && E2.c(), d2 = ko(), T2 && T2.c(), v2 = ko(), I2 && I2.c(), p2 = wo(), So(r2, "type", "button"), So(r2, "class", "jse-expand svelte-uj4yd7"), So(r2, "title", "Expand or collapse this object (Ctrl+Click to expand/collapse recursively)"), So(l2, "class", "jse-meta-inner svelte-uj4yd7"), So(c2, "class", "jse-meta svelte-uj4yd7"), So(c2, "data-type", "selectable-value"), So(n2, "class", "jse-header svelte-uj4yd7"), So(t2, "class", "jse-header-outer svelte-uj4yd7"), So(t2, "style", e18[18]);
}, m: function(o3, b3) {
vo(o3, t2, b3), uo(t2, n2), uo(n2, r2), w2[i2].m(r2, null), uo(n2, a2), S2 && S2.m(n2, null), uo(n2, s2), _2 && _2.m(n2, null), uo(n2, u2), uo(n2, c2), uo(c2, l2), O2.m(l2, null), uo(n2, f2), M2 && M2.m(n2, null), uo(t2, h2), E2 && E2.m(t2, null), uo(t2, d2), T2 && T2.m(t2, null), vo(o3, v2, b3), I2 && I2.m(o3, b3), vo(o3, p2, b3), m2 = true, g2 || (y2 = jo(r2, "click", e18[21]), g2 = true);
}, p: function(e19, a3) {
var s3 = i2;
(i2 = j2(e19)) === s3 ? w2[i2].p(e19, a3) : (ma(), ba(w2[s3], 1, 1, function() {
w2[s3] = null;
}), ga(), (o2 = w2[i2]) ? o2.p(e19, a3) : (o2 = w2[i2] = k2[i2](e19)).c(), ya(o2, 1), o2.m(r2, null)), S2 && S2.p && (!m2 || 16 & a3[1]) && Zi(S2, x2, e19, e19[35], m2 ? Yi(x2, e19[35], a3, TV) : Xi(e19[35]), IV), e19[17] ? _2 && (_2.d(1), _2 = null) : _2 || ((_2 = KV()).c(), _2.m(n2, u2)), $2 === ($2 = C2(e19)) && O2 ? O2.p(e19, a3) : (O2.d(1), (O2 = $2(e19)) && (O2.c(), O2.m(l2, null))), 65922 & a3[0] && (b2 = !e19[8].readOnly && e19[16] && e19[7] && (QB(e19[7]) || YB(e19[7])) && !e19[7].edit && Em(e19[7].focusPath, e19[1])), b2 ? M2 ? (M2.p(e19, a3), 65922 & a3[0] && ya(M2, 1)) : ((M2 = YV(e19)).c(), ya(M2, 1), M2.m(n2, null)) : M2 && (ma(), ba(M2, 1, 1, function() {
M2 = null;
}), ga()), !e19[15] || e19[12] && e19[15].isChildError ? E2 && (ma(), ba(E2, 1, 1, function() {
E2 = null;
}), ga()) : E2 ? (E2.p(e19, a3), 36864 & a3[0] && ya(E2, 1)) : ((E2 = ZV(e19)).c(), ya(E2, 1), E2.m(t2, d2)), A2 === (A2 = P2(e19)) && T2 ? T2.p(e19, a3) : (T2 && T2.d(1), (T2 = A2 && A2(e19)) && (T2.c(), T2.m(t2, null))), (!m2 || 262144 & a3[0]) && So(t2, "style", e19[18]), e19[12] ? I2 ? (I2.p(e19, a3), 4096 & a3[0] && ya(I2, 1)) : ((I2 = tW(e19)).c(), ya(I2, 1), I2.m(p2.parentNode, p2)) : I2 && (ma(), ba(I2, 1, 1, function() {
I2 = null;
}), ga());
}, i: function(e19) {
m2 || (ya(o2), ya(S2, e19), ya(M2), ya(E2), ya(I2), m2 = true);
}, o: function(e19) {
ba(o2), ba(S2, e19), ba(M2), ba(E2), ba(I2), m2 = false;
}, d: function(e19) {
e19 && po(t2), w2[i2].d(), S2 && S2.d(e19), _2 && _2.d(), O2.d(), M2 && M2.d(), E2 && E2.d(), T2 && T2.d(), e19 && po(v2), I2 && I2.d(e19), e19 && po(p2), g2 = false, y2();
} };
}
function qV(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2, g2, y2, b2 = !e18[8].readOnly && e18[16] && e18[7] && (QB(e18[7]) || YB(e18[7])) && !e18[7].edit && Em(e18[7].focusPath, e18[1]), k2 = [sW, aW], w2 = [];
function j2(e19, t3) {
return e19[12] ? 0 : 1;
}
i2 = j2(e18), o2 = w2[i2] = k2[i2](e18);
var x2 = e18[34].identifier, S2 = Gi(x2, e18, e18[35], LV), _2 = !e18[17] && uW();
function C2(e19, t3) {
return e19[12] ? lW : cW;
}
var $2 = C2(e18), O2 = $2(e18), M2 = b2 && fW(e18), E2 = e18[15] && (!e18[12] || !e18[15].isChildError) && hW(e18);
function P2(e19, t3) {
return e19[12] ? vW : dW;
}
var A2 = P2(e18), T2 = A2(e18), I2 = e18[12] && pW(e18);
return { c: function() {
t2 = go("div"), n2 = go("div"), r2 = go("button"), o2.c(), a2 = ko(), S2 && S2.c(), s2 = ko(), _2 && _2.c(), u2 = ko(), c2 = go("div"), l2 = go("div"), O2.c(), f2 = ko(), M2 && M2.c(), h2 = ko(), E2 && E2.c(), d2 = ko(), T2.c(), v2 = ko(), I2 && I2.c(), p2 = wo(), So(r2, "type", "button"), So(r2, "class", "jse-expand svelte-uj4yd7"), So(r2, "title", "Expand or collapse this array (Ctrl+Click to expand/collapse recursively)"), So(l2, "class", "jse-meta-inner svelte-uj4yd7"), So(l2, "data-type", "selectable-value"), So(c2, "class", "jse-meta svelte-uj4yd7"), So(n2, "class", "jse-header svelte-uj4yd7"), So(t2, "class", "jse-header-outer svelte-uj4yd7"), So(t2, "style", e18[18]);
}, m: function(o3, b3) {
vo(o3, t2, b3), uo(t2, n2), uo(n2, r2), w2[i2].m(r2, null), uo(n2, a2), S2 && S2.m(n2, null), uo(n2, s2), _2 && _2.m(n2, null), uo(n2, u2), uo(n2, c2), uo(c2, l2), O2.m(l2, null), uo(n2, f2), M2 && M2.m(n2, null), uo(t2, h2), E2 && E2.m(t2, null), uo(t2, d2), T2.m(t2, null), vo(o3, v2, b3), I2 && I2.m(o3, b3), vo(o3, p2, b3), m2 = true, g2 || (y2 = jo(r2, "click", e18[21]), g2 = true);
}, p: function(e19, a3) {
var s3 = i2;
(i2 = j2(e19)) === s3 ? w2[i2].p(e19, a3) : (ma(), ba(w2[s3], 1, 1, function() {
w2[s3] = null;
}), ga(), (o2 = w2[i2]) ? o2.p(e19, a3) : (o2 = w2[i2] = k2[i2](e19)).c(), ya(o2, 1), o2.m(r2, null)), S2 && S2.p && (!m2 || 16 & a3[1]) && Zi(S2, x2, e19, e19[35], m2 ? Yi(x2, e19[35], a3, DV) : Xi(e19[35]), LV), e19[17] ? _2 && (_2.d(1), _2 = null) : _2 || ((_2 = uW()).c(), _2.m(n2, u2)), $2 === ($2 = C2(e19)) && O2 ? O2.p(e19, a3) : (O2.d(1), (O2 = $2(e19)) && (O2.c(), O2.m(l2, null))), 65922 & a3[0] && (b2 = !e19[8].readOnly && e19[16] && e19[7] && (QB(e19[7]) || YB(e19[7])) && !e19[7].edit && Em(e19[7].focusPath, e19[1])), b2 ? M2 ? (M2.p(e19, a3), 65922 & a3[0] && ya(M2, 1)) : ((M2 = fW(e19)).c(), ya(M2, 1), M2.m(n2, null)) : M2 && (ma(), ba(M2, 1, 1, function() {
M2 = null;
}), ga()), !e19[15] || e19[12] && e19[15].isChildError ? E2 && (ma(), ba(E2, 1, 1, function() {
E2 = null;
}), ga()) : E2 ? (E2.p(e19, a3), 36864 & a3[0] && ya(E2, 1)) : ((E2 = hW(e19)).c(), ya(E2, 1), E2.m(t2, d2)), A2 === (A2 = P2(e19)) && T2 ? T2.p(e19, a3) : (T2.d(1), (T2 = A2(e19)) && (T2.c(), T2.m(t2, null))), (!m2 || 262144 & a3[0]) && So(t2, "style", e19[18]), e19[12] ? I2 ? (I2.p(e19, a3), 4096 & a3[0] && ya(I2, 1)) : ((I2 = pW(e19)).c(), ya(I2, 1), I2.m(p2.parentNode, p2)) : I2 && (ma(), ba(I2, 1, 1, function() {
I2 = null;
}), ga());
}, i: function(e19) {
m2 || (ya(o2), ya(S2, e19), ya(M2), ya(E2), ya(I2), m2 = true);
}, o: function(e19) {
ba(o2), ba(S2, e19), ba(M2), ba(E2), ba(I2), m2 = false;
}, d: function(e19) {
e19 && po(t2), w2[i2].d(), S2 && S2.d(e19), _2 && _2.d(), O2.d(), M2 && M2.d(), E2 && E2.d(), T2.d(), e19 && po(v2), I2 && I2.d(e19), e19 && po(p2), g2 = false, y2();
} };
}
function FV(e18) {
var t2;
return { c: function() {
(t2 = go("div")).textContent = ":", So(t2, "class", "jse-separator svelte-uj4yd7");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, d: function(e19) {
e19 && po(t2);
} };
}
function VV(e18) {
var t2, n2, r2;
return n2 = new WF({ props: { selected: true, onContextMenu: e18[8].onContextMenu } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-context-menu-button-anchor svelte-uj4yd7");
}, m: function(e19, i2) {
vo(e19, t2, i2), Ea(n2, t2, null), r2 = true;
}, p: function(e19, t3) {
var r3 = {};
256 & t3[0] && (r3.onContextMenu = e19[8].onContextMenu), n2.$set(r3);
}, i: function(e19) {
r2 || (ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function WV(e18) {
var t2, n2;
return t2 = new OV({ props: { validationError: e18[15], onExpand: e18[22] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
32768 & n3[0] && (r2.validationError = e19[15]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function HV(e18) {
var t2, n2, r2;
return { c: function() {
So(t2 = go("div"), "class", "jse-insert-selection-area jse-after svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-after");
}, m: function(i2, o2) {
vo(i2, t2, o2), n2 || (r2 = jo(t2, "click", e18[30]), n2 = true);
}, p: Bi, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function JV(e18) {
var t2, n2;
return t2 = new uS({ props: { data: sx } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: Bi, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function UV(e18) {
var t2, n2;
return t2 = new uS({ props: { data: xx } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: Bi, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function KV(e18) {
var t2;
return { c: function() {
(t2 = go("div")).textContent = ":", So(t2, "class", "jse-separator svelte-uj4yd7");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, d: function(e19) {
e19 && po(t2);
} };
}
function GV(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2 = Object.keys(e18[0]).length + "", h2 = 1 === Object.keys(e18[0]).length ? "prop" : "props";
return { c: function() {
(t2 = go("div")).textContent = "{", n2 = ko(), r2 = go("button"), i2 = bo(f2), o2 = ko(), a2 = bo(h2), s2 = ko(), (u2 = go("div")).textContent = "}", So(t2, "class", "jse-bracket svelte-uj4yd7"), So(r2, "type", "button"), So(r2, "class", "jse-tag svelte-uj4yd7"), So(u2, "class", "jse-bracket svelte-uj4yd7");
}, m: function(f3, h3) {
vo(f3, t2, h3), vo(f3, n2, h3), vo(f3, r2, h3), uo(r2, i2), uo(r2, o2), uo(r2, a2), vo(f3, s2, h3), vo(f3, u2, h3), c2 || (l2 = jo(r2, "click", e18[22]), c2 = true);
}, p: function(e19, t3) {
1 & t3[0] && f2 !== (f2 = Object.keys(e19[0]).length + "") && Mo(i2, f2), 1 & t3[0] && h2 !== (h2 = 1 === Object.keys(e19[0]).length ? "prop" : "props") && Mo(a2, h2);
}, d: function(e19) {
e19 && po(t2), e19 && po(n2), e19 && po(r2), e19 && po(s2), e19 && po(u2), c2 = false, l2();
} };
}
function QV(e18) {
var t2;
return { c: function() {
(t2 = go("div")).textContent = "{", So(t2, "class", "jse-bracket jse-expanded svelte-uj4yd7");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, p: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function YV(e18) {
var t2, n2, r2;
return n2 = new WF({ props: { selected: true, onContextMenu: e18[8].onContextMenu } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-context-menu-button-anchor svelte-uj4yd7");
}, m: function(e19, i2) {
vo(e19, t2, i2), Ea(n2, t2, null), r2 = true;
}, p: function(e19, t3) {
var r3 = {};
256 & t3[0] && (r3.onContextMenu = e19[8].onContextMenu), n2.$set(r3);
}, i: function(e19) {
r2 || (ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function ZV(e18) {
var t2, n2;
return t2 = new OV({ props: { validationError: e18[15], onExpand: e18[22] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
32768 & n3[0] && (r2.validationError = e19[15]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function XV(e18) {
var t2, n2, r2;
return { c: function() {
So(t2 = go("div"), "class", "jse-insert-selection-area jse-after svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-after");
}, m: function(i2, o2) {
vo(i2, t2, o2), n2 || (r2 = jo(t2, "click", e18[30]), n2 = true);
}, p: Bi, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function eW(e18) {
var t2, n2, r2;
return { c: function() {
So(t2 = go("div"), "class", "jse-insert-selection-area jse-inside svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-inside");
}, m: function(i2, o2) {
vo(i2, t2, o2), n2 || (r2 = jo(t2, "click", e18[29]), n2 = true);
}, p: Bi, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function tW(e18) {
for (var t2, n2, r2, i2, o2, a2, s2, u2 = !e18[8].readOnly && ("hover-insert-inside" === e18[10] || e18[16] && KB(e18[7])), c2 = u2 && nW(e18), l2 = e18[19](e18[1], e18[0], e18[2], e18[3], e18[4], e18[5], e18[6], e18[7], e18[11]), f2 = [], h2 = 0; h2 < l2.length; h2 += 1)
f2[h2] = iW(AV(e18, l2, h2));
var d2 = function(e19) {
return ba(f2[e19], 1, 1, function() {
f2[e19] = null;
});
}, v2 = !e18[17] && oW(e18);
return { c: function() {
t2 = go("div"), c2 && c2.c(), n2 = ko();
for (var s3 = 0; s3 < f2.length; s3 += 1)
f2[s3].c();
r2 = ko(), i2 = go("div"), (o2 = go("div")).innerHTML = '}
', a2 = ko(), v2 && v2.c(), So(t2, "class", "jse-props svelte-uj4yd7"), So(o2, "data-type", "selectable-value"), So(o2, "class", "jse-footer svelte-uj4yd7"), So(i2, "class", "jse-footer-outer svelte-uj4yd7"), So(i2, "style", e18[18]);
}, m: function(e19, u3) {
vo(e19, t2, u3), c2 && c2.m(t2, null), uo(t2, n2);
for (var l3 = 0; l3 < f2.length; l3 += 1)
f2[l3].m(t2, null);
vo(e19, r2, u3), vo(e19, i2, u3), uo(i2, o2), uo(i2, a2), v2 && v2.m(i2, null), s2 = true;
}, p: function(e19, r3) {
if (66944 & r3[0] && (u2 = !e19[8].readOnly && ("hover-insert-inside" === e19[10] || e19[16] && KB(e19[7]))), u2 ? c2 ? (c2.p(e19, r3), 66944 & r3[0] && ya(c2, 1)) : ((c2 = nW(e19)).c(), ya(c2, 1), c2.m(t2, n2)) : c2 && (ma(), ba(c2, 1, 1, function() {
c2 = null;
}), ga()), 76024319 & r3[0]) {
var o3;
for (l2 = e19[19](e19[1], e19[0], e19[2], e19[3], e19[4], e19[5], e19[6], e19[7], e19[11]), o3 = 0; o3 < l2.length; o3 += 1) {
var a3 = AV(e19, l2, o3);
f2[o3] ? (f2[o3].p(a3, r3), ya(f2[o3], 1)) : (f2[o3] = iW(a3), f2[o3].c(), ya(f2[o3], 1), f2[o3].m(t2, null));
}
for (ma(), o3 = l2.length; o3 < f2.length; o3 += 1)
d2(o3);
ga();
}
e19[17] ? v2 && (v2.d(1), v2 = null) : v2 ? v2.p(e19, r3) : ((v2 = oW(e19)).c(), v2.m(i2, null)), (!s2 || 262144 & r3[0]) && So(i2, "style", e19[18]);
}, i: function(e19) {
if (!s2) {
ya(c2);
for (var t3 = 0; t3 < l2.length; t3 += 1)
ya(f2[t3]);
s2 = true;
}
}, o: function(e19) {
ba(c2), f2 = f2.filter(Boolean);
for (var t3 = 0; t3 < f2.length; t3 += 1)
ba(f2[t3]);
s2 = false;
}, d: function(e19) {
e19 && po(t2), c2 && c2.d(), mo(f2, e19), e19 && po(r2), e19 && po(i2), v2 && v2.d();
} };
}
function nW(e18) {
var t2, n2, r2, i2;
return n2 = new WF({ props: { selected: e18[16] && KB(e18[7]), onContextMenu: e18[31] } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-insert-area jse-inside svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-inside"), So(t2, "style", r2 = SW(e18[1].length + 1)), So(t2, "title", rs), Io(t2, "jse-hovered", "hover-insert-inside" === e18[10]), Io(t2, "jse-selected", e18[16] && KB(e18[7]));
}, m: function(e19, r3) {
vo(e19, t2, r3), Ea(n2, t2, null), i2 = true;
}, p: function(e19, o2) {
var a2 = {};
65664 & o2[0] && (a2.selected = e19[16] && KB(e19[7])), n2.$set(a2), (!i2 || 2 & o2[0] && r2 !== (r2 = SW(e19[1].length + 1))) && So(t2, "style", r2), (!i2 || 1024 & o2[0]) && Io(t2, "jse-hovered", "hover-insert-inside" === e19[10]), (!i2 || 65664 & o2[0]) && Io(t2, "jse-selected", e19[16] && KB(e19[7]));
}, i: function(e19) {
i2 || (ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function rW(e18) {
var t2, n2, r2, i2;
return n2 = new fV({ props: { path: e18[53].path, pointer: e18[53].pointer, key: e18[53].key, selection: e18[53].selection, searchResultItems: e18[53].keySearchResultItemsMap, context: e18[8], onUpdateKey: e18[23] } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), r2 = ko(), So(t2, "slot", "identifier"), So(t2, "class", "jse-identifier svelte-uj4yd7");
}, m: function(e19, o2) {
vo(e19, t2, o2), Ea(n2, t2, null), uo(t2, r2), i2 = true;
}, p: function(e19, t3) {
var r3 = {};
2303 & t3[0] && (r3.path = e19[53].path), 2303 & t3[0] && (r3.pointer = e19[53].pointer), 2303 & t3[0] && (r3.key = e19[53].key), 2303 & t3[0] && (r3.selection = e19[53].selection), 2303 & t3[0] && (r3.searchResultItems = e19[53].keySearchResultItemsMap), 256 & t3[0] && (r3.context = e19[8]), n2.$set(r3);
}, i: function(e19) {
i2 || (ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function iW(e18) {
var t2, n2;
return t2 = new CW({ props: { value: e18[53].value, path: e18[53].path, expandedMap: e18[53].expandedMap, enforceStringMap: e18[53].enforceStringMap, visibleSectionsMap: e18[53].visibleSectionsMap, validationErrorsMap: e18[53].validationErrorsMap, searchResultItemsMap: e18[53].valueSearchResultItemsMap, selection: e18[53].selection, context: e18[8], onDragSelectionStart: e18[26], $$slots: { identifier: [rW] }, $$scope: { ctx: e18 } } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
2303 & n3[0] && (r2.value = e19[53].value), 2303 & n3[0] && (r2.path = e19[53].path), 2303 & n3[0] && (r2.expandedMap = e19[53].expandedMap), 2303 & n3[0] && (r2.enforceStringMap = e19[53].enforceStringMap), 2303 & n3[0] && (r2.visibleSectionsMap = e19[53].visibleSectionsMap), 2303 & n3[0] && (r2.validationErrorsMap = e19[53].validationErrorsMap), 2303 & n3[0] && (r2.searchResultItemsMap = e19[53].valueSearchResultItemsMap), 2303 & n3[0] && (r2.selection = e19[53].selection), 256 & n3[0] && (r2.context = e19[8]), 2559 & n3[0] | 16 & n3[1] && (r2.$$scope = { dirty: n3, ctx: e19 }), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function oW(e18) {
var t2, n2, r2;
return { c: function() {
So(t2 = go("div"), "class", "jse-insert-selection-area jse-after svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-after");
}, m: function(i2, o2) {
vo(i2, t2, o2), n2 || (r2 = jo(t2, "click", e18[30]), n2 = true);
}, p: Bi, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function aW(e18) {
var t2, n2;
return t2 = new uS({ props: { data: sx } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: Bi, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function sW(e18) {
var t2, n2;
return t2 = new uS({ props: { data: xx } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: Bi, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function uW(e18) {
var t2;
return { c: function() {
(t2 = go("div")).textContent = ":", So(t2, "class", "jse-separator svelte-uj4yd7");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, d: function(e19) {
e19 && po(t2);
} };
}
function cW(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2 = e18[0].length + "", h2 = 1 === e18[0].length ? "item" : "items";
return { c: function() {
(t2 = go("div")).textContent = "[", n2 = ko(), r2 = go("button"), i2 = bo(f2), o2 = ko(), a2 = bo(h2), s2 = ko(), (u2 = go("div")).textContent = "]", So(t2, "class", "jse-bracket svelte-uj4yd7"), So(r2, "type", "button"), So(r2, "class", "jse-tag svelte-uj4yd7"), So(u2, "class", "jse-bracket svelte-uj4yd7");
}, m: function(f3, h3) {
vo(f3, t2, h3), vo(f3, n2, h3), vo(f3, r2, h3), uo(r2, i2), uo(r2, o2), uo(r2, a2), vo(f3, s2, h3), vo(f3, u2, h3), c2 || (l2 = jo(r2, "click", e18[22]), c2 = true);
}, p: function(e19, t3) {
1 & t3[0] && f2 !== (f2 = e19[0].length + "") && Mo(i2, f2), 1 & t3[0] && h2 !== (h2 = 1 === e19[0].length ? "item" : "items") && Mo(a2, h2);
}, d: function(e19) {
e19 && po(t2), e19 && po(n2), e19 && po(r2), e19 && po(s2), e19 && po(u2), c2 = false, l2();
} };
}
function lW(e18) {
var t2, n2, r2, i2, o2, a2, s2 = e18[0].length + "", u2 = 1 === e18[0].length ? "item" : "items";
return { c: function() {
(t2 = go("div")).textContent = "[", n2 = ko(), r2 = go("span"), i2 = bo(s2), o2 = ko(), a2 = bo(u2), So(t2, "class", "jse-bracket svelte-uj4yd7"), So(r2, "class", "jse-tag jse-expanded svelte-uj4yd7");
}, m: function(e19, s3) {
vo(e19, t2, s3), vo(e19, n2, s3), vo(e19, r2, s3), uo(r2, i2), uo(r2, o2), uo(r2, a2);
}, p: function(e19, t3) {
1 & t3[0] && s2 !== (s2 = e19[0].length + "") && Mo(i2, s2), 1 & t3[0] && u2 !== (u2 = 1 === e19[0].length ? "item" : "items") && Mo(a2, u2);
}, d: function(e19) {
e19 && po(t2), e19 && po(n2), e19 && po(r2);
} };
}
function fW(e18) {
var t2, n2, r2;
return n2 = new WF({ props: { selected: true, onContextMenu: e18[8].onContextMenu } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-context-menu-button-anchor svelte-uj4yd7");
}, m: function(e19, i2) {
vo(e19, t2, i2), Ea(n2, t2, null), r2 = true;
}, p: function(e19, t3) {
var r3 = {};
256 & t3[0] && (r3.onContextMenu = e19[8].onContextMenu), n2.$set(r3);
}, i: function(e19) {
r2 || (ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function hW(e18) {
var t2, n2;
return t2 = new OV({ props: { validationError: e18[15], onExpand: e18[22] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
32768 & n3[0] && (r2.validationError = e19[15]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function dW(e18) {
var t2, n2, r2;
return { c: function() {
So(t2 = go("div"), "class", "jse-insert-selection-area jse-after svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-after");
}, m: function(i2, o2) {
vo(i2, t2, o2), n2 || (r2 = jo(t2, "click", e18[30]), n2 = true);
}, p: Bi, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function vW(e18) {
var t2, n2, r2;
return { c: function() {
So(t2 = go("div"), "class", "jse-insert-selection-area jse-inside svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-inside");
}, m: function(i2, o2) {
vo(i2, t2, o2), n2 || (r2 = jo(t2, "click", e18[29]), n2 = true);
}, p: Bi, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function pW(e18) {
for (var t2, n2, r2, i2, o2, a2, s2, u2 = !e18[8].readOnly && ("hover-insert-inside" === e18[10] || e18[16] && KB(e18[7])), c2 = [], l2 = /* @__PURE__ */ new Map(), f2 = u2 && mW(e18), h2 = e18[14] || Xa, d2 = function(e19) {
return e19[49];
}, v2 = 0; v2 < h2.length; v2 += 1) {
var p2 = NV(e18, h2, v2), m2 = d2(p2);
l2.set(m2, c2[v2] = kW(m2, p2));
}
var g2 = !e18[17] && wW(e18);
return { c: function() {
t2 = go("div"), f2 && f2.c(), n2 = ko();
for (var s3 = 0; s3 < c2.length; s3 += 1)
c2[s3].c();
r2 = ko(), i2 = go("div"), (o2 = go("div")).innerHTML = ']', a2 = ko(), g2 && g2.c(), So(t2, "class", "jse-items svelte-uj4yd7"), So(o2, "data-type", "selectable-value"), So(o2, "class", "jse-footer svelte-uj4yd7"), So(i2, "class", "jse-footer-outer svelte-uj4yd7"), So(i2, "style", e18[18]);
}, m: function(e19, u3) {
vo(e19, t2, u3), f2 && f2.m(t2, null), uo(t2, n2);
for (var l3 = 0; l3 < c2.length; l3 += 1)
c2[l3].m(t2, null);
vo(e19, r2, u3), vo(e19, i2, u3), uo(i2, o2), uo(i2, a2), g2 && g2.m(i2, null), s2 = true;
}, p: function(e19, r3) {
66944 & r3[0] && (u2 = !e19[8].readOnly && ("hover-insert-inside" === e19[10] || e19[16] && KB(e19[7]))), u2 ? f2 ? (f2.p(e19, r3), 66944 & r3[0] && ya(f2, 1)) : ((f2 = mW(e19)).c(), ya(f2, 1), f2.m(t2, n2)) : f2 && (ma(), ba(f2, 1, 1, function() {
f2 = null;
}), ga()), 68176895 & r3[0] && (h2 = e19[14] || Xa, ma(), c2 = _a(c2, r3, d2, 1, e19, h2, l2, t2, Sa, kW, null, NV), ga()), e19[17] ? g2 && (g2.d(1), g2 = null) : g2 ? g2.p(e19, r3) : ((g2 = wW(e19)).c(), g2.m(i2, null)), (!s2 || 262144 & r3[0]) && So(i2, "style", e19[18]);
}, i: function(e19) {
if (!s2) {
ya(f2);
for (var t3 = 0; t3 < h2.length; t3 += 1)
ya(c2[t3]);
s2 = true;
}
}, o: function(e19) {
ba(f2);
for (var t3 = 0; t3 < c2.length; t3 += 1)
ba(c2[t3]);
s2 = false;
}, d: function(e19) {
e19 && po(t2), f2 && f2.d();
for (var n3 = 0; n3 < c2.length; n3 += 1)
c2[n3].d();
e19 && po(r2), e19 && po(i2), g2 && g2.d();
} };
}
function mW(e18) {
var t2, n2, r2, i2;
return n2 = new WF({ props: { selected: e18[16] && KB(e18[7]), onContextMenu: e18[31] } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-insert-area jse-inside svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-inside"), So(t2, "style", r2 = SW(e18[1].length + 1)), So(t2, "title", rs), Io(t2, "jse-hovered", "hover-insert-inside" === e18[10]), Io(t2, "jse-selected", e18[16] && KB(e18[7]));
}, m: function(e19, r3) {
vo(e19, t2, r3), Ea(n2, t2, null), i2 = true;
}, p: function(e19, o2) {
var a2 = {};
65664 & o2[0] && (a2.selected = e19[16] && KB(e19[7])), n2.$set(a2), (!i2 || 2 & o2[0] && r2 !== (r2 = SW(e19[1].length + 1))) && So(t2, "style", r2), (!i2 || 1024 & o2[0]) && Io(t2, "jse-hovered", "hover-insert-inside" === e19[10]), (!i2 || 65664 & o2[0]) && Io(t2, "jse-selected", e19[16] && KB(e19[7]));
}, i: function(e19) {
i2 || (ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function gW(e18) {
var t2, n2, r2, i2 = e18[50].index + "";
return { c: function() {
t2 = go("div"), n2 = go("div"), r2 = bo(i2), So(n2, "class", "jse-index svelte-uj4yd7"), So(t2, "slot", "identifier"), So(t2, "class", "jse-identifier svelte-uj4yd7");
}, m: function(e19, i3) {
vo(e19, t2, i3), uo(t2, n2), uo(n2, r2);
}, p: function(e19, t3) {
18687 & t3[0] && i2 !== (i2 = e19[50].index + "") && Mo(r2, i2);
}, d: function(e19) {
e19 && po(t2);
} };
}
function yW(e18, t2) {
var n2, r2, i2;
return r2 = new CW({ props: { value: t2[50].value, path: t2[50].path, expandedMap: t2[50].expandedMap, enforceStringMap: t2[50].enforceStringMap, visibleSectionsMap: t2[50].visibleSectionsMap, validationErrorsMap: t2[50].validationErrorsMap, searchResultItemsMap: t2[50].searchResultItemsMap, selection: t2[50].selection, context: t2[8], onDragSelectionStart: t2[26], $$slots: { identifier: [gW] }, $$scope: { ctx: t2 } } }), { key: e18, first: null, c: function() {
n2 = wo(), Ma(r2.$$.fragment), this.first = n2;
}, m: function(e19, t3) {
vo(e19, n2, t3), Ea(r2, e19, t3), i2 = true;
}, p: function(e19, n3) {
t2 = e19;
var i3 = {};
18687 & n3[0] && (i3.value = t2[50].value), 18687 & n3[0] && (i3.path = t2[50].path), 18687 & n3[0] && (i3.expandedMap = t2[50].expandedMap), 18687 & n3[0] && (i3.enforceStringMap = t2[50].enforceStringMap), 18687 & n3[0] && (i3.visibleSectionsMap = t2[50].visibleSectionsMap), 18687 & n3[0] && (i3.validationErrorsMap = t2[50].validationErrorsMap), 18687 & n3[0] && (i3.searchResultItemsMap = t2[50].searchResultItemsMap), 18687 & n3[0] && (i3.selection = t2[50].selection), 256 & n3[0] && (i3.context = t2[8]), 18687 & n3[0] | 16 & n3[1] && (i3.$$scope = { dirty: n3, ctx: t2 }), r2.$set(i3);
}, i: function(e19) {
i2 || (ya(r2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(r2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(n2), Pa(r2, e19);
} };
}
function bW(e18) {
var t2, n2;
return t2 = new BF({ props: { visibleSections: e18[14] || Xa, sectionIndex: e18[49], total: e18[0].length, path: e18[1], pointer: e18[9], onExpandSection: e18[8].onExpandSection, selection: e18[7] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
16384 & n3[0] && (r2.visibleSections = e19[14] || Xa), 16384 & n3[0] && (r2.sectionIndex = e19[49]), 1 & n3[0] && (r2.total = e19[0].length), 2 & n3[0] && (r2.path = e19[1]), 512 & n3[0] && (r2.pointer = e19[9]), 256 & n3[0] && (r2.onExpandSection = e19[8].onExpandSection), 128 & n3[0] && (r2.selection = e19[7]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function kW(e18, t2) {
for (var n2, r2, i2, o2, a2 = [], s2 = /* @__PURE__ */ new Map(), u2 = t2[20](t2[1], t2[0], t2[47], t2[2], t2[3], t2[4], t2[5], t2[6], t2[7], t2[11]), c2 = function(e19) {
return e19[50].index;
}, l2 = 0; l2 < u2.length; l2 += 1) {
var f2 = RV(t2, u2, l2), h2 = c2(f2);
s2.set(h2, a2[l2] = yW(h2, f2));
}
var d2 = t2[47].end < t2[0].length && bW(t2);
return { key: e18, first: null, c: function() {
n2 = wo();
for (var e19 = 0; e19 < a2.length; e19 += 1)
a2[e19].c();
r2 = ko(), d2 && d2.c(), i2 = wo(), this.first = n2;
}, m: function(e19, t3) {
vo(e19, n2, t3);
for (var s3 = 0; s3 < a2.length; s3 += 1)
a2[s3].m(e19, t3);
vo(e19, r2, t3), d2 && d2.m(e19, t3), vo(e19, i2, t3), o2 = true;
}, p: function(e19, n3) {
t2 = e19, 68176383 & n3[0] && (u2 = t2[20](t2[1], t2[0], t2[47], t2[2], t2[3], t2[4], t2[5], t2[6], t2[7], t2[11]), ma(), a2 = _a(a2, n3, c2, 1, t2, u2, s2, r2.parentNode, Sa, yW, r2, RV), ga()), t2[47].end < t2[0].length ? d2 ? (d2.p(t2, n3), 16385 & n3[0] && ya(d2, 1)) : ((d2 = bW(t2)).c(), ya(d2, 1), d2.m(i2.parentNode, i2)) : d2 && (ma(), ba(d2, 1, 1, function() {
d2 = null;
}), ga());
}, i: function(e19) {
if (!o2) {
for (var t3 = 0; t3 < u2.length; t3 += 1)
ya(a2[t3]);
ya(d2), o2 = true;
}
}, o: function(e19) {
for (var t3 = 0; t3 < a2.length; t3 += 1)
ba(a2[t3]);
ba(d2), o2 = false;
}, d: function(e19) {
e19 && po(n2);
for (var t3 = 0; t3 < a2.length; t3 += 1)
a2[t3].d(e19);
e19 && po(r2), d2 && d2.d(e19), e19 && po(i2);
} };
}
function wW(e18) {
var t2, n2, r2;
return { c: function() {
So(t2 = go("div"), "class", "jse-insert-selection-area jse-after svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-after");
}, m: function(i2, o2) {
vo(i2, t2, o2), n2 || (r2 = jo(t2, "click", e18[30]), n2 = true);
}, p: Bi, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function jW(e18) {
var t2, n2, r2;
return n2 = new WF({ props: { selected: e18[16] && UB(e18[7]), onContextMenu: e18[32] } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-insert-area jse-after svelte-uj4yd7"), So(t2, "data-type", "insert-selection-area-after"), So(t2, "style", e18[18]), So(t2, "title", rs), Io(t2, "jse-hovered", "hover-insert-after" === e18[10]), Io(t2, "jse-selected", e18[16] && UB(e18[7]));
}, m: function(e19, i2) {
vo(e19, t2, i2), Ea(n2, t2, null), r2 = true;
}, p: function(e19, i2) {
var o2 = {};
65664 & i2[0] && (o2.selected = e19[16] && UB(e19[7])), n2.$set(o2), (!r2 || 262144 & i2[0]) && So(t2, "style", e19[18]), (!r2 || 1024 & i2[0]) && Io(t2, "jse-hovered", "hover-insert-after" === e19[10]), (!r2 || 65664 & i2[0]) && Io(t2, "jse-selected", e19[16] && UB(e19[7]));
}, i: function(e19) {
r2 || (ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2);
} };
}
function xW(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2 = !e18[8].readOnly && ("hover-insert-after" === e18[10] || e18[16] && UB(e18[7])), d2 = [qV, BV, zV], v2 = [];
function p2(e19, t3) {
return 1 & t3[0] && (n2 = null), 1 & t3[0] && (r2 = null), null == n2 && (n2 = !!Array.isArray(e19[0])), n2 ? 0 : (null == r2 && (r2 = !!As(e19[0])), r2 ? 1 : 2);
}
i2 = p2(e18, [-1, -1]), o2 = v2[i2] = d2[i2](e18);
var m2 = h2 && jW(e18);
return { c: function() {
t2 = go("div"), o2.c(), a2 = ko(), m2 && m2.c(), So(t2, "class", s2 = eo(AF("jse-json-node", { "jse-expanded": e18[12] }, e18[8].onClassName(e18[1], e18[0]))) + " svelte-uj4yd7"), So(t2, "data-path", u2 = qj(e18[1])), Io(t2, "jse-root", e18[17]), Io(t2, "jse-selected", e18[16] && YB(e18[7])), Io(t2, "jse-selected-key", e18[16] && GB(e18[7])), Io(t2, "jse-selected-value", e18[16] && QB(e18[7])), Io(t2, "jse-hovered", "hover-collection" === e18[10]);
}, m: function(n3, r3) {
vo(n3, t2, r3), v2[i2].m(t2, null), uo(t2, a2), m2 && m2.m(t2, null), c2 = true, l2 || (f2 = [jo(t2, "mousedown", e18[24]), jo(t2, "mousemove", e18[25]), jo(t2, "mouseover", e18[27]), jo(t2, "mouseout", e18[28]), jo(t2, "focus", void 0), jo(t2, "blur", void 0)], l2 = true);
}, p: function(e19, n3) {
var r3 = i2;
(i2 = p2(e19, n3)) === r3 ? v2[i2].p(e19, n3) : (ma(), ba(v2[r3], 1, 1, function() {
v2[r3] = null;
}), ga(), (o2 = v2[i2]) ? o2.p(e19, n3) : (o2 = v2[i2] = d2[i2](e19)).c(), ya(o2, 1), o2.m(t2, a2)), 66944 & n3[0] && (h2 = !e19[8].readOnly && ("hover-insert-after" === e19[10] || e19[16] && UB(e19[7]))), h2 ? m2 ? (m2.p(e19, n3), 66944 & n3[0] && ya(m2, 1)) : ((m2 = jW(e19)).c(), ya(m2, 1), m2.m(t2, null)) : m2 && (ma(), ba(m2, 1, 1, function() {
m2 = null;
}), ga()), (!c2 || 4355 & n3[0] && s2 !== (s2 = eo(AF("jse-json-node", { "jse-expanded": e19[12] }, e19[8].onClassName(e19[1], e19[0]))) + " svelte-uj4yd7")) && So(t2, "class", s2), (!c2 || 2 & n3[0] && u2 !== (u2 = qj(e19[1]))) && So(t2, "data-path", u2), (!c2 || 135427 & n3[0]) && Io(t2, "jse-root", e19[17]), (!c2 || 70019 & n3[0]) && Io(t2, "jse-selected", e19[16] && YB(e19[7])), (!c2 || 70019 & n3[0]) && Io(t2, "jse-selected-key", e19[16] && GB(e19[7])), (!c2 || 70019 & n3[0]) && Io(t2, "jse-selected-value", e19[16] && QB(e19[7])), (!c2 || 5379 & n3[0]) && Io(t2, "jse-hovered", "hover-collection" === e19[10]);
}, i: function(e19) {
c2 || (ya(o2), ya(m2), c2 = true);
}, o: function(e19) {
ba(o2), ba(m2), c2 = false;
}, d: function(e19) {
e19 && po(t2), v2[i2].d(), m2 && m2.d(), l2 = false, Hi(f2);
} };
}
function SW(e18) {
return "margin-left: calc(".concat(e18, " * var(--jse-indent-size))");
}
function _W(e18, t2, n2) {
var r2, i2, o2, a2, s2, u2, c2, l2, f2 = t2.$$slots, h2 = void 0 === f2 ? {} : f2, d2 = t2.$$scope, v2 = t2.value, p2 = t2.path, m2 = t2.expandedMap, g2 = t2.enforceStringMap, y2 = t2.visibleSectionsMap, b2 = t2.validationErrorsMap, k2 = t2.searchResultItemsMap, w2 = t2.selection, j2 = t2.context, x2 = t2.onDragSelectionStart, S2 = Da("jsoneditor:JSONNode"), _2 = void 0, C2 = void 0, $2 = void 0, O2 = Wl(function(e19) {
return e19;
}, gS);
function M2(e19) {
j2.onDrag(e19);
}
function E2(e19) {
gV.selecting && (gV.selecting = false, e19.stopPropagation()), j2.onDragEnd(), document.removeEventListener("mousemove", M2, true), document.removeEventListener("mouseup", E2);
}
function P2() {
var e19, t3;
return (null === (e19 = j2.findElement([])) || void 0 === e19 || null === (t3 = e19.getBoundingClientRect()) || void 0 === t3 ? void 0 : t3.top) || 0;
}
function A2(e19, t3) {
var n3 = P2() - e19.initialContentTop;
return t3.clientY - e19.initialClientY - n3;
}
function T2(e19) {
if ($2) {
var t3 = j2.getJson(), r3 = j2.getDocumentState(), i3 = A2($2, e19), o3 = yV({ json: t3, documentState: r3, deltaY: i3, items: $2.items }).offset;
o3 !== $2.offset && (S2("drag selection", o3, i3), n2(11, $2 = ji(ji({}, $2), {}, { offset: o3, didMoveItems: true })));
}
}
function I2(e19) {
if ($2) {
var t3 = j2.getJson(), r3 = yV({ json: t3, documentState: j2.getDocumentState(), deltaY: A2($2, e19), items: $2.items }), i3 = r3.operations, o3 = r3.updatedSelection;
if (i3)
j2.onPatch(i3, function(e20, t4) {
return { state: ji(ji({}, t4), {}, { selection: o3 || w2 }) };
});
else if (e19.target === $2.initialTarget && !$2.didMoveItems) {
var a3 = Bj(e19.target), s3 = Fj(e19.target);
s3 && j2.onSelect(jq(t3, a3, s3));
}
n2(11, $2 = void 0), gV.dragging = false, document.removeEventListener("mousemove", T2, true), document.removeEventListener("mouseup", I2);
}
}
return e18.$$set = function(e19) {
"value" in e19 && n2(0, v2 = e19.value), "path" in e19 && n2(1, p2 = e19.path), "expandedMap" in e19 && n2(2, m2 = e19.expandedMap), "enforceStringMap" in e19 && n2(3, g2 = e19.enforceStringMap), "visibleSectionsMap" in e19 && n2(4, y2 = e19.visibleSectionsMap), "validationErrorsMap" in e19 && n2(5, b2 = e19.validationErrorsMap), "searchResultItemsMap" in e19 && n2(6, k2 = e19.searchResultItemsMap), "selection" in e19 && n2(7, w2 = e19.selection), "context" in e19 && n2(8, j2 = e19.context), "onDragSelectionStart" in e19 && n2(33, x2 = e19.onDragSelectionStart), "$$scope" in e19 && n2(35, d2 = e19.$$scope);
}, e18.$$.update = function() {
2 & e18.$$.dirty[0] && n2(9, o2 = fs.exports.compileJSONPointer(p2)), 516 & e18.$$.dirty[0] && n2(12, a2 = !!m2 && true === m2[o2]), 777 & e18.$$.dirty[0] && n2(13, s2 = RB(v2, g2, o2, j2.parser)), 528 & e18.$$.dirty[0] && n2(14, u2 = y2 ? y2[o2] : void 0), 544 & e18.$$.dirty[0] && n2(15, c2 = b2 ? b2[o2] : void 0), 640 & e18.$$.dirty[0] && n2(16, l2 = !!w2 && true === w2.pointersMap[o2]), 2 & e18.$$.dirty[0] && n2(17, r2 = 0 === p2.length), 2 & e18.$$.dirty[0] && n2(18, i2 = SW(p2.length));
}, [v2, p2, m2, g2, y2, b2, k2, w2, j2, o2, _2, $2, a2, s2, u2, c2, l2, r2, i2, function(e19, t3, n3, r3, i3, a3, s3, u3, c3) {
var l3 = Object.keys(t3).map(function(c4) {
var l4 = fs.exports.appendToJSONPointer(o2, c4);
return { key: c4, value: t3[c4], path: O2(e19.concat(c4)), pointer: l4, expandedMap: bV(n3, l4), enforceStringMap: bV(r3, l4), visibleSectionsMap: bV(i3, l4), validationErrorsMap: bV(a3, l4), keySearchResultItemsMap: Fq(s3, l4), valueSearchResultItemsMap: bV(s3, l4), selection: xq(u3, l4) };
});
return c3 && 0 !== c3.offset && (l3 = Xw(l3, c3.selectionStartIndex, c3.selectionItemsCount, c3.offset)), l3;
}, function(e19, t3, n3, r3, i3, a3, s3, u3, c3, l3) {
for (var f3 = n3.start, h3 = Math.min(n3.end, t3.length), d3 = [], v3 = f3; v3 < h3; v3++) {
var p3 = fs.exports.appendToJSONPointer(o2, v3);
d3.push({ index: v3, value: t3[v3], path: O2(e19.concat(String(v3))), pointer: p3, expandedMap: bV(r3, p3), enforceStringMap: bV(i3, p3), visibleSectionsMap: bV(a3, p3), validationErrorsMap: bV(s3, p3), searchResultItemsMap: bV(u3, p3), selection: xq(c3, p3) });
}
if (l3 && 0 !== l3.offset) {
var m3 = d3.map(function(e20) {
return e20.index;
});
d3 = Xw(d3, l3.selectionStartIndex, l3.selectionItemsCount, l3.offset);
for (var g3 = 0; g3 < d3.length; g3++)
d3[g3].index = m3[g3];
}
return d3;
}, function(e19) {
e19.stopPropagation();
var t3 = e19.ctrlKey;
j2.onExpand(p2, !a2, t3);
}, function(e19) {
e19.stopPropagation(), j2.onExpand(p2, true);
}, function(e19, t3) {
var n3 = Cq(p2, Object.keys(v2), e19, t3);
return j2.onPatch(n3), $v(fs.exports.parseJSONPointer(n3[0].path));
}, function(e19) {
if (!(function(e20) {
return "DIV" === e20.nodeName && "true" === e20.contentEditable;
}(e19.target) || 1 === e19.which && Aj(e19.target, "BUTTON"))) {
e19.stopPropagation(), e19.preventDefault(), document.addEventListener("mousemove", M2, true), document.addEventListener("mouseup", E2);
var t3 = Bj(e19.target), n3 = j2.getJson(), i3 = j2.getDocumentState();
if (function(e20, t4, n4) {
if (!e20)
return false;
var r3 = t4.slice(0);
if (YB(e20))
for (; r3.length > 0; ) {
if (true === e20.pointersMap[fs.exports.compileJSONPointer(r3)])
return true;
r3.pop();
}
if (GB(e20))
return n4 === hj.key && Em(e20.focusPath, t4);
if (QB(e20)) {
if (n4 === hj.value && Em(e20.focusPath, t4))
return true;
if (lq(t4, e20.focusPath) && t4.length > e20.focusPath.length && (n4 === hj.key || n4 === hj.value || n4 === hj.multi))
return true;
}
return false;
}(w2, p2, t3))
0 === e19.button && x2(e19);
else {
if (gV.selecting = true, gV.selectionAnchor = p2, gV.selectionAnchorType = t3, gV.selectionFocus = p2, e19.shiftKey)
w2 && j2.onSelect(mq(n3, w2.anchorPath, p2));
else if (t3 === hj.multi)
if (r2 && e19.target.hasAttribute("data-path")) {
var o3 = $v(zB(v2, i3));
j2.onSelect(wq(o3));
} else
j2.onSelect(mq(n3, p2, p2));
else
j2.onSelect(jq(n3, t3, p2));
j2.focus();
}
}
}, function(e19) {
if (gV.selecting) {
e19.preventDefault(), e19.stopPropagation(), null == gV.selectionFocus && window.getSelection && window.getSelection().empty();
var t3 = Bj(e19.target);
if (!Em(p2, gV.selectionFocus) || t3 !== gV.selectionAnchorType) {
gV.selectionFocus = p2, gV.selectionAnchorType = t3;
var n3 = j2.getJson();
j2.onSelect(mq(n3, gV.selectionAnchor, gV.selectionFocus));
}
}
}, function(e19) {
if (!j2.readOnly) {
var t3 = im(w2.focusPath);
if (Em(p2, t3)) {
var r3 = function(e20, t4) {
var n3 = [];
function r4(e21) {
var t5 = p2.concat(e21), r5 = j2.findElement(t5);
null != r5 && n3.push({ path: t5, height: r5.clientHeight });
}
if (Array.isArray(v2)) {
var i4 = XB(e20), o4 = eq(e20), a4 = $v(i4), s3 = $v(o4), u3 = t4.find(function(e21) {
return a4 >= e21.start && s3 <= e21.end;
});
if (!u3)
return null;
var c3 = u3.start, l3 = u3.end;
Gw(c3, Math.min(v2.length, l3), function(e21) {
return r4(String(e21));
});
} else
Object.keys(v2).forEach(r4);
return n3;
}(w2, u2 || Xa);
if (S2("dragSelectionStart", { selection: w2, items: r3 }), r3) {
var i3 = XB(w2), o3 = r3.findIndex(function(e20) {
return Em(e20.path, i3);
}), a3 = yV({ json: j2.getJson(), documentState: j2.getDocumentState(), deltaY: 0, items: r3 }).offset;
n2(11, $2 = { initialTarget: e19.target, initialClientY: e19.clientY, initialContentTop: P2(), selectionStartIndex: o3, selectionItemsCount: yq(w2).length, items: r3, offset: a3, didMoveItems: false }), gV.dragging = true, document.addEventListener("mousemove", T2, true), document.addEventListener("mouseup", I2);
} else
S2("Cannot drag the current selection (probably spread over multiple sections)");
} else
x2(e19);
}
}, function(e19) {
gV.selecting || gV.dragging || (e19.stopPropagation(), Tj(e19.target, "data-type", "selectable-value") ? n2(10, _2 = "hover-collection") : Tj(e19.target, "data-type", "insert-selection-area-inside") ? n2(10, _2 = "hover-insert-inside") : Tj(e19.target, "data-type", "insert-selection-area-after") && n2(10, _2 = "hover-insert-after"), clearTimeout(C2));
}, function(e19) {
e19.stopPropagation(), C2 = setTimeout(function() {
return n2(10, _2 = void 0);
});
}, function(e19) {
e19.shiftKey || (e19.stopPropagation(), e19.preventDefault(), j2.onSelect(vq(p2)));
}, function(e19) {
e19.shiftKey || (e19.stopPropagation(), e19.preventDefault(), j2.onSelect(pq(p2)));
}, function(e19) {
j2.onSelect(vq(p2)), j2.onContextMenu(e19);
}, function(e19) {
j2.onSelect(pq(p2)), j2.onContextMenu(e19);
}, x2, h2, d2];
}
var CW = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, _W, xW, Ki, { value: 0, path: 1, expandedMap: 2, enforceStringMap: 3, visibleSectionsMap: 4, validationErrorsMap: 5, searchResultItemsMap: 6, selection: 7, context: 8, onDragSelectionStart: 33 }, MV, [-1, -1]), r2;
}
return Li(n2);
}(), $W = CW;
function OW(e18) {
var t2, n2;
return t2 = new QS({ props: { items: e18[0] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
1 & ki(n3, 1)[0] && (r2.items = e19[0]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function MW(e18, t2, n2) {
var r2, i2, o2, a2, s2, u2, c2, l2 = t2.json, f2 = t2.selection, h2 = t2.readOnly, d2 = t2.showSearch, v2 = void 0 !== d2 && d2, p2 = t2.historyState, m2 = t2.onExpandAll, g2 = t2.onCollapseAll, y2 = t2.onUndo, b2 = t2.onRedo, k2 = t2.onSort, w2 = t2.onTransform, j2 = t2.onContextMenu, x2 = t2.onCopy, S2 = t2.onRenderMenu, _2 = void 0 === S2 ? Yu : S2;
function C2() {
n2(1, v2 = !v2);
}
return e18.$$set = function(e19) {
"json" in e19 && n2(2, l2 = e19.json), "selection" in e19 && n2(3, f2 = e19.selection), "readOnly" in e19 && n2(4, h2 = e19.readOnly), "showSearch" in e19 && n2(1, v2 = e19.showSearch), "historyState" in e19 && n2(5, p2 = e19.historyState), "onExpandAll" in e19 && n2(6, m2 = e19.onExpandAll), "onCollapseAll" in e19 && n2(7, g2 = e19.onCollapseAll), "onUndo" in e19 && n2(8, y2 = e19.onUndo), "onRedo" in e19 && n2(9, b2 = e19.onRedo), "onSort" in e19 && n2(10, k2 = e19.onSort), "onTransform" in e19 && n2(11, w2 = e19.onTransform), "onContextMenu" in e19 && n2(12, j2 = e19.onContextMenu), "onCopy" in e19 && n2(13, x2 = e19.onCopy), "onRenderMenu" in e19 && n2(14, _2 = e19.onRenderMenu);
}, e18.$$.update = function() {
4 & e18.$$.dirty && n2(20, r2 = void 0 !== l2), e18.$$.dirty, 1048584 & e18.$$.dirty && n2(17, i2 = r2 && (YB(f2) || GB(f2) || QB(f2))), 68 & e18.$$.dirty && n2(19, o2 = { icon: AS, title: "Expand all", className: "jse-expand-all", onClick: m2, disabled: !Ts(l2) }), 132 & e18.$$.dirty && n2(18, a2 = { icon: TS, title: "Collapse all", className: "jse-collapse-all", onClick: g2, disabled: !Ts(l2) }), 4 & e18.$$.dirty && n2(16, s2 = { icon: Ox, title: "Search (Ctrl+F)", className: "jse-search", onClick: C2, disabled: void 0 === l2 }), 999220 & e18.$$.dirty && n2(15, u2 = h2 ? [o2, a2, { separator: true }, { icon: Ex, title: "Copy (Ctrl+C)", className: "jse-copy", onClick: x2, disabled: !i2 }, { separator: true }, s2, { space: true }] : [o2, a2, { separator: true }, { icon: _x, title: "Sort", className: "jse-sort", onClick: k2, disabled: h2 || void 0 === l2 }, { icon: px, title: "Transform contents (filter, sort, project)", className: "jse-transform", onClick: w2, disabled: h2 || void 0 === l2 }, s2, { icon: Sx, title: is, className: "jse-contextmenu", onClick: j2 }, { separator: true }, { icon: kx, title: "Undo (Ctrl+Z)", className: "jse-undo", onClick: y2, disabled: !p2.canUndo }, { icon: bx, title: "Redo (Ctrl+Shift+Z)", className: "jse-redo", onClick: b2, disabled: !p2.canRedo }, { space: true }]), 49152 & e18.$$.dirty && n2(0, c2 = _2("tree", u2) || u2);
}, [c2, v2, l2, f2, h2, p2, m2, g2, y2, b2, k2, w2, j2, x2, _2, u2, s2, i2, a2, o2, r2];
}
var EW = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, MW, OW, Ki, { json: 2, selection: 3, readOnly: 4, showSearch: 1, historyState: 5, onExpandAll: 6, onCollapseAll: 7, onUndo: 8, onRedo: 9, onSort: 10, onTransform: 11, onContextMenu: 12, onCopy: 13, onRenderMenu: 14 }), r2;
}
return Li(n2);
}();
function PW(e18) {
co(e18, "svelte-1q2qkk2", '@charset "UTF-8";.jse-welcome.svelte-1q2qkk2.svelte-1q2qkk2{flex:1;overflow:auto;font-family:var(--jse-font-family);font-size:var(--jse-font-size);display:flex;flex-direction:column;align-items:center;border-left:var(--jse-main-border);border-right:var(--jse-main-border)}.jse-welcome.svelte-1q2qkk2.svelte-1q2qkk2:last-child{border-bottom:var(--jse-main-border)}.jse-welcome.svelte-1q2qkk2 .jse-space.jse-before.svelte-1q2qkk2{flex:1}.jse-welcome.svelte-1q2qkk2 .jse-space.jse-after.svelte-1q2qkk2{flex:2}.jse-welcome.svelte-1q2qkk2 .jse-contents.svelte-1q2qkk2{margin:2em var(--jse-padding) 0;color:var(--jse-panel-color-readonly)}.jse-welcome.svelte-1q2qkk2 .jse-contents ul.svelte-1q2qkk2{list-style:"\u25CF";list-style-position:outside;padding-left:20px}.jse-welcome.svelte-1q2qkk2 .jse-contents ul li.svelte-1q2qkk2{padding-left:10px}.jse-welcome.svelte-1q2qkk2 .jse-contents ul li span.jse-bold.svelte-1q2qkk2{font-family:var(--jse-font-family-mono);font-weight:bold}');
}
function AW(e18) {
var t2;
return { c: function() {
(t2 = go("ul")).innerHTML = 'Click inside the editor \n Paste clipboard data using Ctrl+V \n Create a new object by typing { \n Create a new array by typing [', So(t2, "class", "svelte-1q2qkk2");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, d: function(e19) {
e19 && po(t2);
} };
}
function TW(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2 = !e18[0] && AW();
return { c: function() {
t2 = go("div"), n2 = go("div"), r2 = ko(), i2 = go("div"), o2 = bo("Empty document\n "), u2 && u2.c(), a2 = ko(), s2 = go("div"), So(n2, "class", "jse-space jse-before svelte-1q2qkk2"), So(i2, "class", "jse-contents svelte-1q2qkk2"), So(s2, "class", "jse-space jse-after svelte-1q2qkk2"), So(t2, "class", "jse-welcome svelte-1q2qkk2");
}, m: function(e19, c2) {
vo(e19, t2, c2), uo(t2, n2), uo(t2, r2), uo(t2, i2), uo(i2, o2), u2 && u2.m(i2, null), uo(t2, a2), uo(t2, s2);
}, p: function(e19, t3) {
ki(t3, 1)[0];
e19[0] ? u2 && (u2.d(1), u2 = null) : u2 || ((u2 = AW()).c(), u2.m(i2, null));
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2), u2 && u2.d();
} };
}
function IW(e18, t2, n2) {
var r2 = t2.readOnly;
return e18.$$set = function(e19) {
"readOnly" in e19 && n2(0, r2 = e19.readOnly);
}, [r2];
}
var NW = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, IW, TW, Ki, { readOnly: 0 }, PW), r2;
}
return Li(n2);
}();
function RW(e18) {
co(e18, "svelte-6hb2gf", ".jse-navigation-bar-dropdown.svelte-6hb2gf.svelte-6hb2gf{position:absolute;top:100%;left:0;z-index:3;background:var(--jse-navigation-bar-background);color:var(--jse-navigation-bar-dropdown-color);box-shadow:var(--jse-controls-box-shadow);display:flex;flex-direction:column;max-height:300px;overflow:auto;min-width:80px}.jse-navigation-bar-dropdown.svelte-6hb2gf button.jse-navigation-bar-dropdown-item.svelte-6hb2gf{font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);border:none;background:transparent;color:inherit;cursor:pointer;outline:none;text-align:left;white-space:nowrap;box-sizing:border-box;padding:calc(0.5 * var(--jse-padding)) 36px}.jse-navigation-bar-dropdown.svelte-6hb2gf button.jse-navigation-bar-dropdown-item.svelte-6hb2gf:focus,.jse-navigation-bar-dropdown.svelte-6hb2gf button.jse-navigation-bar-dropdown-item.svelte-6hb2gf:hover{background:var(--jse-navigation-bar-background-highlight)}.jse-navigation-bar-dropdown.svelte-6hb2gf button.jse-navigation-bar-dropdown-item.jse-selected.svelte-6hb2gf{background:var(--jse-navigation-bar-dropdown-color);color:var(--jse-navigation-bar-background)}");
}
function DW(e18, t2, n2) {
var r2 = e18.slice();
return r2[4] = t2[n2], r2;
}
function LW(e18, t2) {
var n2, r2, i2, o2, a2, s2 = HB(t2[4], FW) + "";
function u2() {
return t2[3](t2[4]);
}
return { key: e18, first: null, c: function() {
n2 = go("button"), r2 = bo(s2), So(n2, "type", "button"), So(n2, "class", "jse-navigation-bar-dropdown-item svelte-6hb2gf"), So(n2, "title", i2 = t2[4]), Io(n2, "jse-selected", t2[4] === t2[1]), this.first = n2;
}, m: function(e19, t3) {
vo(e19, n2, t3), uo(n2, r2), o2 || (a2 = jo(n2, "click", xo(u2)), o2 = true);
}, p: function(e19, o3) {
t2 = e19, 1 & o3 && s2 !== (s2 = HB(t2[4], FW) + "") && Mo(r2, s2), 1 & o3 && i2 !== (i2 = t2[4]) && So(n2, "title", i2), 3 & o3 && Io(n2, "jse-selected", t2[4] === t2[1]);
}, d: function(e19) {
e19 && po(n2), o2 = false, a2();
} };
}
function zW(e18) {
var t2, n2;
return { c: function() {
t2 = go("button"), n2 = bo("..."), So(t2, "type", "button"), So(t2, "class", "jse-navigation-bar-dropdown-item svelte-6hb2gf"), So(t2, "title", "Limited to " + qW + " items");
}, m: function(e19, r2) {
vo(e19, t2, r2), uo(t2, n2);
}, p: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function BW(e18) {
for (var t2, n2, r2 = [], i2 = /* @__PURE__ */ new Map(), o2 = Qw(e18[0], qW), a2 = function(e19) {
return e19[4];
}, s2 = 0; s2 < o2.length; s2 += 1) {
var u2 = DW(e18, o2, s2), c2 = a2(u2);
i2.set(c2, r2[s2] = LW(c2, u2));
}
var l2 = e18[0].length > qW && zW();
return { c: function() {
t2 = go("div");
for (var e19 = 0; e19 < r2.length; e19 += 1)
r2[e19].c();
n2 = ko(), l2 && l2.c(), So(t2, "class", "jse-navigation-bar-dropdown svelte-6hb2gf");
}, m: function(e19, i3) {
vo(e19, t2, i3);
for (var o3 = 0; o3 < r2.length; o3 += 1)
r2[o3].m(t2, null);
uo(t2, n2), l2 && l2.m(t2, null);
}, p: function(e19, s3) {
var u3 = ki(s3, 1)[0];
7 & u3 && (o2 = Qw(e19[0], qW), r2 = _a(r2, u3, a2, 1, e19, o2, i2, t2, xa, LW, n2, DW)), e19[0].length > qW ? l2 ? l2.p(e19, u3) : ((l2 = zW()).c(), l2.m(t2, null)) : l2 && (l2.d(1), l2 = null);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
for (var n3 = 0; n3 < r2.length; n3 += 1)
r2[n3].d();
l2 && l2.d();
} };
}
var qW = 100, FW = 30;
function VW(e18, t2, n2) {
var r2 = t2.items, i2 = t2.selectedItem, o2 = t2.onSelect;
return e18.$$set = function(e19) {
"items" in e19 && n2(0, r2 = e19.items), "selectedItem" in e19 && n2(1, i2 = e19.selectedItem), "onSelect" in e19 && n2(2, o2 = e19.onSelect);
}, [r2, i2, o2, function(e19) {
return o2(e19);
}];
}
var WW = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, VW, BW, Ki, { items: 0, selectedItem: 1, onSelect: 2 }, RW), r2;
}
return Li(n2);
}();
function HW(e18) {
co(e18, "svelte-1r1k9th", ".jse-navigation-bar-item.svelte-1r1k9th.svelte-1r1k9th{position:relative;display:flex}.jse-navigation-bar-item.svelte-1r1k9th button.jse-navigation-bar-button.svelte-1r1k9th{font-family:inherit;font-size:inherit;padding:calc(0.5 * var(--jse-padding)) 2px;border:none;background:transparent;color:inherit;cursor:pointer;outline:none;min-width:2em;white-space:nowrap}.jse-navigation-bar-item.svelte-1r1k9th button.jse-navigation-bar-button.svelte-1r1k9th:focus,.jse-navigation-bar-item.svelte-1r1k9th button.jse-navigation-bar-button.svelte-1r1k9th:hover{background:var(--jse-panel-button-background-highlight);color:var(--jse-panel-button-color-highlight)}.jse-navigation-bar-item.svelte-1r1k9th button.jse-navigation-bar-button.jse-navigation-bar-arrow.svelte-1r1k9th{padding:2px var(--jse-padding) 0}.jse-navigation-bar-item.svelte-1r1k9th button.jse-navigation-bar-button.jse-navigation-bar-arrow.jse-open.svelte-1r1k9th{background:var(--jse-navigation-bar-background);color:var(--jse-navigation-bar-dropdown-color)}.jse-navigation-bar-item.svelte-1r1k9th.svelte-1r1k9th:last-child{padding-right:var(--jse-padding)}");
}
function JW(e18) {
var t2, n2, r2, i2;
return { c: function() {
t2 = go("button"), n2 = bo(e18[2]), So(t2, "type", "button"), So(t2, "class", "jse-navigation-bar-button svelte-1r1k9th");
}, m: function(o2, a2) {
vo(o2, t2, a2), uo(t2, n2), r2 || (i2 = jo(t2, "click", e18[9]), r2 = true);
}, p: function(e19, t3) {
4 & t3 && Mo(n2, e19[2]);
}, d: function(e19) {
e19 && po(t2), r2 = false, i2();
} };
}
function UW(e18) {
var t2, n2, r2, i2, o2, a2, s2;
r2 = new uS({ props: { data: dx } });
var u2 = void 0 !== e18[2] && JW(e18);
return { c: function() {
t2 = go("div"), n2 = go("button"), Ma(r2.$$.fragment), i2 = ko(), u2 && u2.c(), So(n2, "type", "button"), So(n2, "class", "jse-navigation-bar-button jse-navigation-bar-arrow svelte-1r1k9th"), Io(n2, "jse-open", e18[1]), So(t2, "class", "jse-navigation-bar-item svelte-1r1k9th");
}, m: function(c2, l2) {
vo(c2, t2, l2), uo(t2, n2), Ea(r2, n2, null), uo(t2, i2), u2 && u2.m(t2, null), e18[10](t2), o2 = true, a2 || (s2 = jo(n2, "click", e18[4]), a2 = true);
}, p: function(e19, r3) {
var i3 = ki(r3, 1)[0];
(!o2 || 2 & i3) && Io(n2, "jse-open", e19[1]), void 0 !== e19[2] ? u2 ? u2.p(e19, i3) : ((u2 = JW(e19)).c(), u2.m(t2, null)) : u2 && (u2.d(1), u2 = null);
}, i: function(e19) {
o2 || (ya(r2.$$.fragment, e19), o2 = true);
}, o: function(e19) {
ba(r2.$$.fragment, e19), o2 = false;
}, d: function(n3) {
n3 && po(t2), Pa(r2), u2 && u2.d(), e18[10](null), a2 = false, s2();
} };
}
function KW(e18, t2, n2) {
var r2, i2, o2, a2, s2 = Yo("absolute-popup"), u2 = s2.openAbsolutePopup, c2 = s2.closeAbsolutePopup, l2 = t2.path, f2 = t2.index, h2 = t2.onSelect, d2 = t2.getItems, v2 = false;
function p2(e19) {
c2(a2), h2(r2.concat(e19));
}
return e18.$$set = function(e19) {
"path" in e19 && n2(5, l2 = e19.path), "index" in e19 && n2(6, f2 = e19.index), "onSelect" in e19 && n2(7, h2 = e19.onSelect), "getItems" in e19 && n2(8, d2 = e19.getItems);
}, e18.$$.update = function() {
96 & e18.$$.dirty && (r2 = l2.slice(0, f2)), 96 & e18.$$.dirty && n2(2, i2 = l2[f2]);
}, [o2, v2, i2, p2, function() {
if (o2) {
n2(1, v2 = true);
var e19 = { items: d2(r2), selectedItem: i2, onSelect: p2 };
a2 = u2(WW, e19, { anchor: o2, closeOnOuterClick: true, onClose: function() {
n2(1, v2 = false);
} });
}
}, l2, f2, h2, d2, function() {
return p2(i2);
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(0, o2 = e19);
});
}];
}
var GW = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, KW, UW, Ki, { path: 5, index: 6, onSelect: 7, getItems: 8 }, HW), r2;
}
return Li(n2);
}(), QW = { exports: {} }, YW = function(e18, t2) {
var n2, r2, i2 = 1, o2 = 0, a2 = 0, s2 = String.alphabet;
function u2(e19, t3, r3) {
if (r3) {
for (n2 = t3; (r3 = u2(e19, n2)) < 76 && r3 > 65; )
++n2;
return +e19.slice(t3 - 1, n2);
}
return (r3 = s2 && s2.indexOf(e19.charAt(t3))) > -1 ? r3 + 76 : (r3 = e19.charCodeAt(t3) || 0) < 45 || r3 > 127 ? r3 : r3 < 46 ? 65 : r3 < 48 ? r3 - 1 : r3 < 58 ? r3 + 18 : r3 < 65 ? r3 - 11 : r3 < 91 ? r3 + 11 : r3 < 97 ? r3 - 37 : r3 < 123 ? r3 + 5 : r3 - 63;
}
if ((e18 += "") != (t2 += "")) {
for (; i2; )
if (r2 = u2(e18, o2++), i2 = u2(t2, a2++), r2 < 76 && i2 < 76 && r2 > 66 && i2 > 66 && (r2 = u2(e18, o2, o2), i2 = u2(t2, a2, o2 = n2), a2 = n2), r2 != i2)
return r2 < i2 ? -1 : 1;
}
return 0;
};
try {
QW.exports = YW;
} catch (e18) {
String.naturalCompare = YW;
}
function ZW(e18, t2) {
var n2 = "string" == typeof e18 ? e18.toLowerCase() : e18, r2 = "string" == typeof t2 ? t2.toLowerCase() : t2;
return QW.exports(n2, r2);
}
function XW(e18, t2) {
return function(n2, r2) {
var i2 = fs.exports.getIn(n2, e18), o2 = fs.exports.getIn(r2, e18);
return void 0 === i2 ? t2 : void 0 === o2 ? -t2 : "string" != typeof i2 && "string" != typeof o2 ? i2 > o2 ? t2 : i2 < o2 ? -t2 : 0 : t2 * ZW(i2, o2);
};
}
function eH(e18) {
co(e18, "svelte-5lwyke", ".jse-navigation-bar.svelte-5lwyke.svelte-5lwyke{font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);background:var(--jse-panel-background);color:var(--jse-panel-button-color);padding:0;margin:0;display:flex;overflow:auto;border-left:var(--jse-main-border);border-right:var(--jse-main-border)}.jse-navigation-bar.svelte-5lwyke .jse-navigation-bar-space.svelte-5lwyke{padding:calc(0.5 * var(--jse-padding)) var(--jse-padding);color:var(--jse-navigation-bar-color)}");
}
function tH(e18, t2, n2) {
var r2 = e18.slice();
return r2[11] = t2[n2], r2[13] = n2, r2;
}
function nH(e18, t2) {
var n2, r2, i2;
return r2 = new GW({ props: { getItems: t2[4], path: t2[1], index: t2[13], onSelect: t2[5] } }), { key: e18, first: null, c: function() {
n2 = wo(), Ma(r2.$$.fragment), this.first = n2;
}, m: function(e19, t3) {
vo(e19, n2, t3), Ea(r2, e19, t3), i2 = true;
}, p: function(e19, n3) {
t2 = e19;
var i3 = {};
2 & n3 && (i3.path = t2[1]), 2 & n3 && (i3.index = t2[13]), r2.$set(i3);
}, i: function(e19) {
i2 || (ya(r2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(r2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(n2), Pa(r2, e19);
} };
}
function rH(e18) {
var t2, n2;
return t2 = new GW({ props: { getItems: e18[4], path: e18[1], index: void 0, onSelect: e18[5] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
2 & n3 && (r2.path = e19[1]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function iH(e18) {
for (var t2, n2, r2, i2, o2, a2, s2 = [], u2 = /* @__PURE__ */ new Map(), c2 = Ts(e18[0]) ? "\xA0" : "Navigation bar", l2 = e18[1], f2 = function(e19) {
return e19[13];
}, h2 = 0; h2 < l2.length; h2 += 1) {
var d2 = tH(e18, l2, h2), v2 = f2(d2);
u2.set(v2, s2[h2] = nH(v2, d2));
}
var p2 = e18[3] && rH(e18);
return { c: function() {
t2 = go("div");
for (var e19 = 0; e19 < s2.length; e19 += 1)
s2[e19].c();
n2 = ko(), p2 && p2.c(), r2 = ko(), i2 = go("div"), o2 = bo(c2), So(i2, "class", "jse-navigation-bar-space svelte-5lwyke"), So(t2, "class", "jse-navigation-bar svelte-5lwyke");
}, m: function(u3, c3) {
vo(u3, t2, c3);
for (var l3 = 0; l3 < s2.length; l3 += 1)
s2[l3].m(t2, null);
uo(t2, n2), p2 && p2.m(t2, null), uo(t2, r2), uo(t2, i2), uo(i2, o2), e18[8](t2), a2 = true;
}, p: function(e19, i3) {
var h3 = ki(i3, 1)[0];
50 & h3 && (l2 = e19[1], ma(), s2 = _a(s2, h3, f2, 1, e19, l2, u2, t2, Sa, nH, n2, tH), ga()), e19[3] ? p2 ? (p2.p(e19, h3), 8 & h3 && ya(p2, 1)) : ((p2 = rH(e19)).c(), ya(p2, 1), p2.m(t2, r2)) : p2 && (ma(), ba(p2, 1, 1, function() {
p2 = null;
}), ga()), (!a2 || 1 & h3) && c2 !== (c2 = Ts(e19[0]) ? "\xA0" : "Navigation bar") && Mo(o2, c2);
}, i: function(e19) {
if (!a2) {
for (var t3 = 0; t3 < l2.length; t3 += 1)
ya(s2[t3]);
ya(p2), a2 = true;
}
}, o: function(e19) {
for (var t3 = 0; t3 < s2.length; t3 += 1)
ba(s2[t3]);
ba(p2), a2 = false;
}, d: function(n3) {
n3 && po(t2);
for (var r3 = 0; r3 < s2.length; r3 += 1)
s2[r3].d();
p2 && p2.d(), e18[8](null);
} };
}
function oH(e18, t2, n2) {
var r2, i2, o2, a2 = Da("jsoneditor:NavigationBar"), s2 = t2.json, u2 = t2.documentState, c2 = t2.onSelect;
return e18.$$set = function(e19) {
"json" in e19 && n2(0, s2 = e19.json), "documentState" in e19 && n2(6, u2 = e19.documentState), "onSelect" in e19 && n2(7, c2 = e19.onSelect);
}, e18.$$.update = function() {
64 & e18.$$.dirty && n2(1, r2 = u2.selection ? u2.selection.focusPath : []), 3 & e18.$$.dirty && n2(3, i2 = Ts(fs.exports.getIn(s2, r2))), 2 & e18.$$.dirty && setTimeout(function() {
if (o2 && o2.scrollTo) {
var e19 = o2.scrollWidth - o2.clientWidth;
e19 > 0 && (a2("scrollTo ", e19), o2.scrollTo({ left: e19, behavior: "smooth" }));
}
});
}, [s2, r2, o2, i2, function(e19) {
a2("get items for path", e19);
var t3 = fs.exports.getIn(s2, e19);
if (Array.isArray(t3))
return Uy(0, t3.length).map(String);
if (As(t3)) {
var n3 = Object.keys(t3).slice(0);
return n3.sort(ZW), n3;
}
return [];
}, function(e19) {
a2("select path", JSON.stringify(e19)), c2(mq(s2, e19, e19));
}, u2, c2, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(2, o2 = e19);
});
}];
}
var aH = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, oH, iH, Ki, { json: 0, documentState: 6, onSelect: 7 }, eH), r2;
}
return Li(n2);
}();
function sH(e18) {
co(e18, "svelte-18vllqh", ".jse-search-box.svelte-18vllqh.svelte-18vllqh{border:var(--jse-panel-border);border-radius:3px;font-family:var(--jse-font-family);font-size:var(--jse-font-size);background:var(--jse-panel-background);color:var(--jse-panel-color-readonly);box-shadow:var(--jse-controls-box-shadow);display:inline-block;width:400px;max-width:100%;overflow:auto}.jse-search-box.svelte-18vllqh .jse-search-form.svelte-18vllqh{display:flex;align-items:stretch}.jse-search-box.svelte-18vllqh .jse-search-form button.svelte-18vllqh,.jse-search-box.svelte-18vllqh .jse-search-form input.svelte-18vllqh{font-family:inherit;font-size:inherit}.jse-search-box.svelte-18vllqh .jse-search-form button.svelte-18vllqh{display:block;text-align:center;border:none;padding:0 5px;margin:0;cursor:pointer;color:var(--jse-panel-button-color);background:var(--jse-panel-button-background)}.jse-search-box.svelte-18vllqh .jse-search-form button.svelte-18vllqh:hover{color:var(--jse-panel-button-color-highlight);background:var(--jse-panel-button-background-highlight)}.jse-search-box.svelte-18vllqh .jse-search-form input.svelte-18vllqh{color:var(--jse-panel-color);border:var(--jse-input-border);border-radius:3px;background:var(--jse-input-background);height:28px;padding:0 5px;margin:0;flex:1;outline:none}.jse-search-box.svelte-18vllqh .jse-search-form .jse-replace-toggle.svelte-18vllqh{padding:var(--jse-padding) calc(0.5 * var(--jse-padding));min-width:20px;background:var(--jse-panel-button-background-highlight)}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents.svelte-18vllqh{flex:1;display:flex;flex-direction:column;padding:calc(0.5 * var(--jse-padding));gap:calc(0.5 * var(--jse-padding))}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section.svelte-18vllqh{flex:1;display:flex;align-items:center;position:relative;padding-left:32px}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section .jse-search-icon.svelte-18vllqh{color:inherit;cursor:inherit;background:inherit;position:absolute;top:calc(0.5 * var(--jse-padding));left:calc(0.5 * var(--jse-padding))}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section label.jse-search-input-label.svelte-18vllqh{flex:1;display:flex}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.svelte-18vllqh{color:inherit;font-size:80%;visibility:hidden;padding:0 5px;min-width:36px;text-align:center}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.jse-visible.svelte-18vllqh{visibility:visible}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-replace-section.svelte-18vllqh{padding-left:32px;flex:1;display:flex}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-replace-section button.svelte-18vllqh{width:auto}");
}
function uH(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2, p2, m2, g2, y2, b2, k2, w2, j2, x2, S2, _2, C2, $2, O2, M2 = (-1 !== e18[3] ? "".concat(e18[3] + 1, "/") : "") + "", E2 = !e18[4] && cH(e18), P2 = [fH, lH], A2 = [];
function T2(e19, t3) {
return e19[2] ? 0 : 1;
}
s2 = T2(e18), u2 = A2[s2] = P2[s2](e18), y2 = new uS({ props: { data: Mx } }), w2 = new uS({ props: { data: hx } }), S2 = new uS({ props: { data: Px } });
var I2 = e18[0] && !e18[4] && hH(e18);
return { c: function() {
t2 = go("div"), n2 = go("form"), E2 && E2.c(), r2 = ko(), i2 = go("div"), o2 = go("div"), a2 = go("div"), u2.c(), c2 = ko(), l2 = go("label"), f2 = go("input"), h2 = ko(), d2 = go("div"), v2 = bo(M2), p2 = bo(e18[10]), m2 = ko(), g2 = go("button"), Ma(y2.$$.fragment), b2 = ko(), k2 = go("button"), Ma(w2.$$.fragment), j2 = ko(), x2 = go("button"), Ma(S2.$$.fragment), _2 = ko(), I2 && I2.c(), So(a2, "class", "jse-search-icon svelte-18vllqh"), So(f2, "class", "jse-search-input svelte-18vllqh"), So(f2, "title", "Enter text to search"), So(f2, "type", "text"), So(f2, "placeholder", "Find"), So(l2, "class", "jse-search-input-label svelte-18vllqh"), So(l2, "about", "jse-search input"), So(d2, "class", "jse-search-count svelte-18vllqh"), Io(d2, "jse-visible", "" !== e18[8]), So(g2, "type", "button"), So(g2, "class", "jse-search-next svelte-18vllqh"), So(g2, "title", "Go to next search result (Enter)"), So(k2, "type", "button"), So(k2, "class", "jse-search-previous svelte-18vllqh"), So(k2, "title", "Go to previous search result (Shift+Enter)"), So(x2, "type", "button"), So(x2, "class", "jse-search-clear svelte-18vllqh"), So(x2, "title", "Close search box (Esc)"), So(o2, "class", "jse-search-section svelte-18vllqh"), So(i2, "class", "jse-search-contents svelte-18vllqh"), So(n2, "class", "jse-search-form svelte-18vllqh"), So(t2, "class", "jse-search-box svelte-18vllqh");
}, m: function(u3, M3) {
vo(u3, t2, M3), uo(t2, n2), E2 && E2.m(n2, null), uo(n2, r2), uo(n2, i2), uo(i2, o2), uo(o2, a2), A2[s2].m(a2, null), uo(o2, c2), uo(o2, l2), uo(l2, f2), Eo(f2, e18[8]), uo(o2, h2), uo(o2, d2), uo(d2, v2), uo(d2, p2), uo(o2, m2), uo(o2, g2), Ea(y2, g2, null), uo(o2, b2), uo(o2, k2), Ea(w2, k2, null), uo(o2, j2), uo(o2, x2), Ea(S2, x2, null), uo(i2, _2), I2 && I2.m(i2, null), C2 = true, $2 || (O2 = [jo(f2, "input", e18[21]), to(vH.call(null, f2)), jo(g2, "click", e18[22]), jo(k2, "click", e18[23]), jo(x2, "click", e18[24]), jo(n2, "submit", e18[12]), jo(n2, "keydown", e18[13])], $2 = true);
}, p: function(e19, t3) {
e19[4] ? E2 && (ma(), ba(E2, 1, 1, function() {
E2 = null;
}), ga()) : E2 ? (E2.p(e19, t3), 16 & t3 && ya(E2, 1)) : ((E2 = cH(e19)).c(), ya(E2, 1), E2.m(n2, r2));
var o3 = s2;
(s2 = T2(e19)) === o3 ? A2[s2].p(e19, t3) : (ma(), ba(A2[o3], 1, 1, function() {
A2[o3] = null;
}), ga(), (u2 = A2[s2]) ? u2.p(e19, t3) : (u2 = A2[s2] = P2[s2](e19)).c(), ya(u2, 1), u2.m(a2, null)), 256 & t3 && f2.value !== e19[8] && Eo(f2, e19[8]), (!C2 || 8 & t3) && M2 !== (M2 = (-1 !== e19[3] ? "".concat(e19[3] + 1, "/") : "") + "") && Mo(v2, M2), (!C2 || 1024 & t3) && Mo(p2, e19[10]), (!C2 || 256 & t3) && Io(d2, "jse-visible", "" !== e19[8]), e19[0] && !e19[4] ? I2 ? I2.p(e19, t3) : ((I2 = hH(e19)).c(), I2.m(i2, null)) : I2 && (I2.d(1), I2 = null);
}, i: function(e19) {
C2 || (ya(E2), ya(u2), ya(y2.$$.fragment, e19), ya(w2.$$.fragment, e19), ya(S2.$$.fragment, e19), C2 = true);
}, o: function(e19) {
ba(E2), ba(u2), ba(y2.$$.fragment, e19), ba(w2.$$.fragment, e19), ba(S2.$$.fragment, e19), C2 = false;
}, d: function(e19) {
e19 && po(t2), E2 && E2.d(), A2[s2].d(), Pa(y2), Pa(w2), Pa(S2), I2 && I2.d(), $2 = false, Hi(O2);
} };
}
function cH(e18) {
var t2, n2, r2, i2, o2;
return n2 = new uS({ props: { data: e18[0] ? xx : sx } }), { c: function() {
t2 = go("button"), Ma(n2.$$.fragment), So(t2, "type", "button"), So(t2, "class", "jse-replace-toggle svelte-18vllqh"), So(t2, "title", "Toggle visibility of replace options (Ctrl+H)");
}, m: function(a2, s2) {
vo(a2, t2, s2), Ea(n2, t2, null), r2 = true, i2 || (o2 = jo(t2, "click", e18[11]), i2 = true);
}, p: function(e19, t3) {
var r3 = {};
1 & t3 && (r3.data = e19[0] ? xx : sx), n2.$set(r3);
}, i: function(e19) {
r2 || (ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), i2 = false, o2();
} };
}
function lH(e18) {
var t2, n2;
return t2 = new uS({ props: { data: Ox } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: Bi, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function fH(e18) {
var t2, n2;
return t2 = new uS({ props: { data: cx, spin: true } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: Bi, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function hH(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2;
return { c: function() {
t2 = go("div"), n2 = go("input"), r2 = ko(), (i2 = go("button")).textContent = "Replace", o2 = ko(), (a2 = go("button")).textContent = "All", So(n2, "class", "jse-replace-input svelte-18vllqh"), So(n2, "title", "Enter replacement text"), So(n2, "type", "text"), So(n2, "placeholder", "Replace"), So(i2, "type", "button"), So(i2, "title", "Replace current occurrence (Ctrl+Enter)"), So(i2, "class", "svelte-18vllqh"), So(a2, "type", "button"), So(a2, "title", "Replace all occurrences"), So(a2, "class", "svelte-18vllqh"), So(t2, "class", "jse-replace-section svelte-18vllqh");
}, m: function(c2, l2) {
vo(c2, t2, l2), uo(t2, n2), Eo(n2, e18[9]), uo(t2, r2), uo(t2, i2), uo(t2, o2), uo(t2, a2), s2 || (u2 = [jo(n2, "input", e18[25]), jo(i2, "click", e18[14]), jo(a2, "click", e18[15])], s2 = true);
}, p: function(e19, t3) {
512 & t3 && n2.value !== e19[9] && Eo(n2, e19[9]);
}, d: function(e19) {
e19 && po(t2), s2 = false, Hi(u2);
} };
}
function dH(e18) {
var t2, n2, r2 = e18[1] && uH(e18);
return { c: function() {
r2 && r2.c(), t2 = wo();
}, m: function(e19, i2) {
r2 && r2.m(e19, i2), vo(e19, t2, i2), n2 = true;
}, p: function(e19, n3) {
var i2 = ki(n3, 1)[0];
e19[1] ? r2 ? (r2.p(e19, i2), 2 & i2 && ya(r2, 1)) : ((r2 = uH(e19)).c(), ya(r2, 1), r2.m(t2.parentNode, t2)) : r2 && (ma(), ba(r2, 1, 1, function() {
r2 = null;
}), ga());
}, i: function(e19) {
n2 || (ya(r2), n2 = true);
}, o: function(e19) {
ba(r2), n2 = false;
}, d: function(e19) {
r2 && r2.d(e19), e19 && po(t2);
} };
}
function vH(e18) {
e18.select();
}
function pH(e18, t2, n2) {
var r2, i2, o2 = t2.show, a2 = void 0 !== o2 && o2, s2 = t2.searching, u2 = t2.resultCount, c2 = void 0 === u2 ? 0 : u2, l2 = t2.activeIndex, f2 = void 0 === l2 ? 0 : l2, h2 = t2.showReplace, d2 = void 0 !== h2 && h2, v2 = t2.readOnly, p2 = void 0 !== v2 && v2, m2 = t2.onChange, g2 = void 0 === m2 ? Yu : m2, y2 = t2.onPrevious, b2 = void 0 === y2 ? Yu : y2, k2 = t2.onNext, w2 = void 0 === k2 ? Yu : k2, j2 = t2.onReplace, x2 = void 0 === j2 ? Yu : j2, S2 = t2.onReplaceAll, _2 = void 0 === S2 ? Yu : S2, C2 = t2.onClose, $2 = void 0 === C2 ? Yu : C2, O2 = "", M2 = "", E2 = "";
function P2() {
n2(0, d2 = !d2 && !p2);
}
function A2() {
p2 || x2(O2, E2);
}
return e18.$$set = function(e19) {
"show" in e19 && n2(1, a2 = e19.show), "searching" in e19 && n2(2, s2 = e19.searching), "resultCount" in e19 && n2(16, c2 = e19.resultCount), "activeIndex" in e19 && n2(3, f2 = e19.activeIndex), "showReplace" in e19 && n2(0, d2 = e19.showReplace), "readOnly" in e19 && n2(4, p2 = e19.readOnly), "onChange" in e19 && n2(17, g2 = e19.onChange), "onPrevious" in e19 && n2(5, b2 = e19.onPrevious), "onNext" in e19 && n2(6, w2 = e19.onNext), "onReplace" in e19 && n2(18, x2 = e19.onReplace), "onReplaceAll" in e19 && n2(19, _2 = e19.onReplaceAll), "onClose" in e19 && n2(7, $2 = e19.onClose);
}, e18.$$.update = function() {
65536 & e18.$$.dirty && n2(10, r2 = c2 >= 1e3 ? "".concat(999, "+") : String(c2)), 131072 & e18.$$.dirty && n2(20, i2 = uv(g2, 300)), 1048832 & e18.$$.dirty && i2(O2), 2 & e18.$$.dirty && a2 && "" !== O2 && g2(O2);
}, [d2, a2, s2, f2, p2, b2, w2, $2, O2, E2, r2, P2, function(e19) {
e19.preventDefault(), O2 !== M2 ? (M2 = O2, i2.cancel(), g2(O2)) : w2();
}, function(e19) {
e19.stopPropagation();
var t3 = Hj(e19);
"Enter" === t3 && (e19.preventDefault(), w2()), "Shift+Enter" === t3 && (e19.preventDefault(), b2()), "Ctrl+Enter" !== t3 && "Command+Enter" !== t3 || (e19.preventDefault(), d2 ? A2() : w2()), "Ctrl+H" === t3 && (e19.preventDefault(), P2()), "Escape" === t3 && (e19.preventDefault(), $2());
}, A2, function() {
p2 || _2(O2, E2);
}, c2, g2, x2, _2, i2, function() {
O2 = this.value, n2(8, O2);
}, function() {
return w2();
}, function() {
return b2();
}, function() {
return $2();
}, function() {
E2 = this.value, n2(9, E2);
}];
}
var mH = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, pH, dH, Ki, { show: 1, searching: 2, resultCount: 16, activeIndex: 3, showReplace: 0, readOnly: 4, onChange: 17, onPrevious: 5, onNext: 6, onReplace: 18, onReplaceAll: 19, onClose: 7 }, sH), r2;
}
return Li(n2);
}(), gH = ja.window;
function yH(e18) {
co(e18, "svelte-1chflnh", ".jse-tree-mode.svelte-1chflnh.svelte-1chflnh{flex:1;display:flex;flex-direction:column;position:relative;background:var(--jse-background-color);min-width:0;min-height:0;font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);color:var(--jse-text-color);line-height:var(--jse-line-height)}.jse-tree-mode.svelte-1chflnh .jse-hidden-input-label.svelte-1chflnh{position:fixed;right:0;top:0;width:0;height:0}.jse-tree-mode.svelte-1chflnh .jse-hidden-input-label .jse-hidden-input.svelte-1chflnh{width:0;height:0;padding:0;border:0;outline:none}.jse-tree-mode.svelte-1chflnh .jse-search-box-container.svelte-1chflnh{position:relative;height:0;top:var(--jse-padding);margin-right:calc(var(--jse-padding) + 20px);margin-left:var(--jse-padding);text-align:right;z-index:3}.jse-tree-mode.no-main-menu.svelte-1chflnh.svelte-1chflnh{border-top:var(--jse-main-border)}.jse-tree-mode.svelte-1chflnh .jse-contents.svelte-1chflnh{border-left:var(--jse-main-border);border-right:var(--jse-main-border);flex:1;overflow:auto;position:relative;padding:2px;display:flex;flex-direction:column}.jse-tree-mode.svelte-1chflnh .jse-contents.svelte-1chflnh:last-child{border-bottom:var(--jse-main-border)}.jse-tree-mode.svelte-1chflnh .jse-contents .jse-loading-space.svelte-1chflnh{flex:1}.jse-tree-mode.svelte-1chflnh .jse-contents .jse-loading.svelte-1chflnh{flex:2;text-align:center;color:var(--jse-panel-color-readonly);box-sizing:border-box;font-family:var(--jse-font-family);font-size:var(--jse-font-size)}.jse-tree-mode.svelte-1chflnh .jse-preview.svelte-1chflnh{flex:1;color:var(--jse-panel-color-readonly);overflow:auto;white-space:pre-wrap;padding:2px}");
}
function bH(e18) {
var t2, n2, r2;
function i2(t3) {
e18[72](t3);
}
var o2 = { json: e18[7], selection: e18[13].selection, readOnly: e18[0], historyState: e18[19], onExpandAll: e18[37], onCollapseAll: e18[38], onUndo: e18[33], onRedo: e18[34], onSort: e18[35], onTransform: e18[36], onContextMenu: e18[42], onCopy: e18[31], onRenderMenu: e18[4] };
return void 0 !== e18[16] && (o2.showSearch = e18[16]), t2 = new EW({ props: o2 }), Xo.push(function() {
return Oa(t2, "showSearch", i2);
}), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, n3) {
Ea(t2, e19, n3), r2 = true;
}, p: function(e19, r3) {
var i3 = {};
128 & r3[0] && (i3.json = e19[7]), 8192 & r3[0] && (i3.selection = e19[13].selection), 1 & r3[0] && (i3.readOnly = e19[0]), 524288 & r3[0] && (i3.historyState = e19[19]), 16 & r3[0] && (i3.onRenderMenu = e19[4]), !n2 && 65536 & r3[0] && (n2 = true, i3.showSearch = e19[16], sa(function() {
return n2 = false;
})), t2.$set(i3);
}, i: function(e19) {
r2 || (ya(t2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function kH(e18) {
var t2, n2;
return t2 = new aH({ props: { json: e18[7], documentState: e18[13], onSelect: e18[45] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
128 & n3[0] && (r2.json = e19[7]), 8192 & n3[0] && (r2.documentState = e19[13]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function wH(e18) {
var t2;
return { c: function() {
(t2 = go("div")).innerHTML = ' \n loading...
', So(t2, "class", "jse-contents svelte-1chflnh");
}, m: function(e19, n2) {
vo(e19, t2, n2);
}, p: Bi, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function jH(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2 = [SH, xH], f2 = [];
function h2(e19, t3) {
return void 0 === e19[7] ? 0 : 1;
}
return i2 = h2(e18), o2 = f2[i2] = l2[i2](e18), { c: function() {
t2 = go("label"), n2 = go("input"), r2 = ko(), o2.c(), a2 = wo(), So(n2, "type", "text"), n2.readOnly = "readonly", So(n2, "tabindex", "-1"), So(n2, "class", "jse-hidden-input svelte-1chflnh"), So(t2, "class", "jse-hidden-input-label svelte-1chflnh");
}, m: function(o3, l3) {
vo(o3, t2, l3), uo(t2, n2), e18[73](n2), vo(o3, r2, l3), f2[i2].m(o3, l3), vo(o3, a2, l3), s2 = true, u2 || (c2 = jo(n2, "paste", e18[32]), u2 = true);
}, p: function(e19, t3) {
var n3 = i2;
(i2 = h2(e19)) === n3 ? f2[i2].p(e19, t3) : (ma(), ba(f2[n3], 1, 1, function() {
f2[n3] = null;
}), ga(), (o2 = f2[i2]) ? o2.p(e19, t3) : (o2 = f2[i2] = l2[i2](e19)).c(), ya(o2, 1), o2.m(a2.parentNode, a2));
}, i: function(e19) {
s2 || (ya(o2), s2 = true);
}, o: function(e19) {
ba(o2), s2 = false;
}, d: function(n3) {
n3 && po(t2), e18[73](null), n3 && po(r2), f2[i2].d(n3), n3 && po(a2), u2 = false, c2();
} };
}
function xH(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2, l2, f2, h2, d2, v2;
a2 = new mH({ props: { show: e18[16], resultCount: (null === (t2 = e18[14]) || void 0 === t2 || null === (n2 = t2.items) || void 0 === n2 ? void 0 : n2.length) || 0, activeIndex: (null === (r2 = e18[14]) || void 0 === r2 ? void 0 : r2.activeIndex) || 0, showReplace: e18[17], searching: e18[18], readOnly: e18[0], onChange: e18[24], onNext: e18[25], onPrevious: e18[26], onReplace: e18[27], onReplaceAll: e18[28], onClose: e18[29] } }), c2 = new $W({ props: { value: e18[7], path: e18[23], expandedMap: e18[13].expandedMap, enforceStringMap: e18[13].enforceStringMap, visibleSectionsMap: e18[13].visibleSectionsMap, validationErrorsMap: e18[21], searchResultItemsMap: null === (i2 = e18[14]) || void 0 === i2 ? void 0 : i2.itemsMap, selection: e18[13].selection, context: e18[10], onDragSelectionStart: Yu } });
var p2 = e18[15] && _H(e18), m2 = e18[20] && CH(e18);
return d2 = new PS({ props: { validationErrors: e18[9], selectError: e18[30] } }), { c: function() {
o2 = go("div"), Ma(a2.$$.fragment), s2 = ko(), u2 = go("div"), Ma(c2.$$.fragment), l2 = ko(), p2 && p2.c(), f2 = ko(), m2 && m2.c(), h2 = ko(), Ma(d2.$$.fragment), So(o2, "class", "jse-search-box-container svelte-1chflnh"), So(u2, "class", "jse-contents svelte-1chflnh"), So(u2, "data-jsoneditor-scrollable-contents", true);
}, m: function(t3, n3) {
vo(t3, o2, n3), Ea(a2, o2, null), vo(t3, s2, n3), vo(t3, u2, n3), Ea(c2, u2, null), e18[74](u2), vo(t3, l2, n3), p2 && p2.m(t3, n3), vo(t3, f2, n3), m2 && m2.m(t3, n3), vo(t3, h2, n3), Ea(d2, t3, n3), v2 = true;
}, p: function(e19, t3) {
var n3, r3, i3, o3, s3 = {};
65536 & t3[0] && (s3.show = e19[16]), 16384 & t3[0] && (s3.resultCount = (null === (n3 = e19[14]) || void 0 === n3 || null === (r3 = n3.items) || void 0 === r3 ? void 0 : r3.length) || 0), 16384 & t3[0] && (s3.activeIndex = (null === (i3 = e19[14]) || void 0 === i3 ? void 0 : i3.activeIndex) || 0), 131072 & t3[0] && (s3.showReplace = e19[17]), 262144 & t3[0] && (s3.searching = e19[18]), 1 & t3[0] && (s3.readOnly = e19[0]), a2.$set(s3);
var u3 = {};
128 & t3[0] && (u3.value = e19[7]), 8192 & t3[0] && (u3.expandedMap = e19[13].expandedMap), 8192 & t3[0] && (u3.enforceStringMap = e19[13].enforceStringMap), 8192 & t3[0] && (u3.visibleSectionsMap = e19[13].visibleSectionsMap), 2097152 & t3[0] && (u3.validationErrorsMap = e19[21]), 16384 & t3[0] && (u3.searchResultItemsMap = null === (o3 = e19[14]) || void 0 === o3 ? void 0 : o3.itemsMap), 8192 & t3[0] && (u3.selection = e19[13].selection), 1024 & t3[0] && (u3.context = e19[10]), c2.$set(u3), e19[15] ? p2 ? (p2.p(e19, t3), 32768 & t3[0] && ya(p2, 1)) : ((p2 = _H(e19)).c(), ya(p2, 1), p2.m(f2.parentNode, f2)) : p2 && (ma(), ba(p2, 1, 1, function() {
p2 = null;
}), ga()), e19[20] ? m2 ? (m2.p(e19, t3), 1048576 & t3[0] && ya(m2, 1)) : ((m2 = CH(e19)).c(), ya(m2, 1), m2.m(h2.parentNode, h2)) : m2 && (ma(), ba(m2, 1, 1, function() {
m2 = null;
}), ga());
var l3 = {};
512 & t3[0] && (l3.validationErrors = e19[9]), d2.$set(l3);
}, i: function(e19) {
v2 || (ya(a2.$$.fragment, e19), ya(c2.$$.fragment, e19), ya(p2), ya(m2), ya(d2.$$.fragment, e19), v2 = true);
}, o: function(e19) {
ba(a2.$$.fragment, e19), ba(c2.$$.fragment, e19), ba(p2), ba(m2), ba(d2.$$.fragment, e19), v2 = false;
}, d: function(t3) {
t3 && po(o2), Pa(a2), t3 && po(s2), t3 && po(u2), Pa(c2), e18[74](null), t3 && po(l2), p2 && p2.d(t3), t3 && po(f2), m2 && m2.d(t3), t3 && po(h2), Pa(d2, t3);
} };
}
function SH(e18) {
var t2, n2, r2, i2, o2 = [OH, $H], a2 = [];
function s2(e19, t3) {
return "" === e19[8] || void 0 === e19[8] ? 0 : 1;
}
return t2 = s2(e18), n2 = a2[t2] = o2[t2](e18), { c: function() {
n2.c(), r2 = wo();
}, m: function(e19, n3) {
a2[t2].m(e19, n3), vo(e19, r2, n3), i2 = true;
}, p: function(e19, i3) {
var u2 = t2;
(t2 = s2(e19)) === u2 ? a2[t2].p(e19, i3) : (ma(), ba(a2[u2], 1, 1, function() {
a2[u2] = null;
}), ga(), (n2 = a2[t2]) ? n2.p(e19, i3) : (n2 = a2[t2] = o2[t2](e19)).c(), ya(n2, 1), n2.m(r2.parentNode, r2));
}, i: function(e19) {
i2 || (ya(n2), i2 = true);
}, o: function(e19) {
ba(n2), i2 = false;
}, d: function(e19) {
a2[t2].d(e19), e19 && po(r2);
} };
}
function _H(e18) {
var t2, n2;
return t2 = new mS({ props: { type: "info", message: "You pasted a JSON ".concat(Array.isArray(e18[15].contents) ? "array" : "object", " as text"), actions: [{ icon: gx, text: "Paste as JSON instead", onMouseDown: e18[43] }, { text: "Leave as is", onClick: e18[44] }] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
32768 & n3[0] && (r2.message = "You pasted a JSON ".concat(Array.isArray(e19[15].contents) ? "array" : "object", " as text")), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function CH(e18) {
var t2, n2;
return t2 = new mS({ props: { type: "success", message: "The loaded JSON document was invalid but is successfully repaired.", actions: e18[0] ? [] : [{ icon: Tx, text: "Ok", onClick: e18[5] }, { icon: mx, text: "Repair manually instead", onClick: e18[3] }] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
9 & n3[0] && (r2.actions = e19[0] ? [] : [{ icon: Tx, text: "Ok", onClick: e19[5] }, { icon: mx, text: "Repair manually instead", onClick: e19[3] }]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function $H(e18) {
var t2, n2, r2, i2, o2, a2 = HB(e18[8], 2e4) + "";
return t2 = new mS({ props: { type: "error", message: "The loaded JSON document is invalid and could not be repaired automatically.", actions: e18[0] ? [] : [{ icon: mx, text: "Repair manually", onClick: e18[3] }] } }), { c: function() {
Ma(t2.$$.fragment), n2 = ko(), r2 = go("div"), i2 = bo(a2), So(r2, "class", "jse-preview svelte-1chflnh");
}, m: function(e19, a3) {
Ea(t2, e19, a3), vo(e19, n2, a3), vo(e19, r2, a3), uo(r2, i2), o2 = true;
}, p: function(e19, n3) {
var r3 = {};
9 & n3[0] && (r3.actions = e19[0] ? [] : [{ icon: mx, text: "Repair manually", onClick: e19[3] }]), t2.$set(r3), (!o2 || 256 & n3[0]) && a2 !== (a2 = HB(e19[8], 2e4) + "") && Mo(i2, a2);
}, i: function(e19) {
o2 || (ya(t2.$$.fragment, e19), o2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), o2 = false;
}, d: function(e19) {
Pa(t2, e19), e19 && po(n2), e19 && po(r2);
} };
}
function OH(e18) {
var t2, n2;
return t2 = new NW({ props: { readOnly: e18[0] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
1 & n3[0] && (r2.readOnly = e19[0]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function MH(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2 = e18[1] && bH(e18), l2 = e18[2] && kH(e18), f2 = [jH, wH], h2 = [];
return i2 = function(e19, t3) {
return e19[22] ? 1 : 0;
}(e18), o2 = h2[i2] = f2[i2](e18), { c: function() {
t2 = go("div"), c2 && c2.c(), n2 = ko(), l2 && l2.c(), r2 = ko(), o2.c(), So(t2, "class", "jse-tree-mode svelte-1chflnh"), Io(t2, "no-main-menu", !e18[1]);
}, m: function(o3, f3) {
vo(o3, t2, f3), c2 && c2.m(t2, null), uo(t2, n2), l2 && l2.m(t2, null), uo(t2, r2), h2[i2].m(t2, null), e18[75](t2), a2 = true, s2 || (u2 = [jo(gH, "mousedown", e18[46]), jo(t2, "keydown", e18[39]), jo(t2, "mousedown", e18[40]), jo(t2, "contextmenu", e18[41])], s2 = true);
}, p: function(e19, i3) {
e19[1] ? c2 ? (c2.p(e19, i3), 2 & i3[0] && ya(c2, 1)) : ((c2 = bH(e19)).c(), ya(c2, 1), c2.m(t2, n2)) : c2 && (ma(), ba(c2, 1, 1, function() {
c2 = null;
}), ga()), e19[2] ? l2 ? (l2.p(e19, i3), 4 & i3[0] && ya(l2, 1)) : ((l2 = kH(e19)).c(), ya(l2, 1), l2.m(t2, r2)) : l2 && (ma(), ba(l2, 1, 1, function() {
l2 = null;
}), ga()), o2.p(e19, i3), (!a2 || 2 & i3[0]) && Io(t2, "no-main-menu", !e19[1]);
}, i: function(e19) {
a2 || (ya(c2), ya(l2), ya(o2), a2 = true);
}, o: function(e19) {
ba(c2), ba(l2), ba(o2), a2 = false;
}, d: function(n3) {
n3 && po(t2), c2 && c2.d(), l2 && l2.d(), h2[i2].d(), e18[75](null), s2 = false, Hi(u2);
} };
}
function EH(e18) {
return 0 === e18.length || 1 === e18.length && "0" === e18[0];
}
function PH() {
return true;
}
function AH(e18, t2, n2) {
var r2, i2 = Da("jsoneditor:TreeMode"), o2 = "undefined" == typeof window;
i2("isSSR:", o2);
var a2, s2, u2, c2, l2, f2 = Yo("simple-modal").open, h2 = Xk(), d2 = Xk(), v2 = Yo("absolute-popup"), p2 = v2.openAbsolutePopup, m2 = v2.closeAbsolutePopup, g2 = false, y2 = hB(), b2 = t2.readOnly, k2 = t2.externalContent, w2 = t2.mainMenuBar, j2 = t2.navigationBar, x2 = t2.escapeControlCharacters, S2 = t2.escapeUnicodeCharacters, _2 = t2.parser, C2 = t2.validator, $2 = t2.validationParser, O2 = t2.indentation, M2 = t2.onError, E2 = t2.onChange, P2 = t2.onRenderValue, A2 = t2.onRequestRepair, T2 = t2.onRenderMenu, I2 = t2.onClassName, N2 = t2.onFocus, R2 = t2.onBlur, D2 = t2.onSortModal, L2 = t2.onTransformModal, z2 = false;
Dx({ onMount: Uo, onDestroy: Ko, getWindow: function() {
return Dj(u2);
}, hasFocus: function() {
return z2 && document.hasFocus() || Lj(u2);
}, onFocus: function() {
g2 = true, N2 && N2();
}, onBlur: function() {
g2 = false, R2 && R2();
} });
var B2 = [], q2 = void 0;
function F2(e19) {
i2("updateSelection", e19);
var t3 = "function" == typeof e19 ? e19(U2.selection) : e19;
Em(t3, U2.selection) || n2(13, U2 = ji(ji({}, U2), {}, { selection: t3 }));
}
var V2, W2, H2, J2 = false, U2 = gB();
var K2 = false, G2 = false, Q2 = false, Y2 = "";
function Z2(e19) {
return X2.apply(this, arguments);
}
function X2() {
return X2 = yi(mi().mark(function e19(t3) {
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
return i2("search text updated", t3), n2(71, Y2 = t3), e20.next = 4, oa();
case 4:
return e20.next = 6, ie2();
case 6:
case "end":
return e20.stop();
}
}, e19);
})), X2.apply(this, arguments);
}
function ee2() {
return (ee2 = yi(mi().mark(function e19() {
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
return n2(14, V2 = V2 ? Tq(V2) : void 0), e20.next = 3, ie2();
case 3:
case "end":
return e20.stop();
}
}, e19);
}))).apply(this, arguments);
}
function te2() {
return (te2 = yi(mi().mark(function e19() {
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
return n2(14, V2 = V2 ? Iq(V2) : void 0), e20.next = 3, ie2();
case 3:
case "end":
return e20.stop();
}
}, e19);
}))).apply(this, arguments);
}
function ne2() {
return (ne2 = yi(mi().mark(function e19(t3, n3) {
var r3, o3, a3, s3, u3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (o3 = null === (r3 = V2) || void 0 === r3 ? void 0 : r3.activeItem, i2("handleReplace", { replacementText: n3, activeItem: o3 }), o3) {
e20.next = 4;
break;
}
return e20.abrupt("return");
case 4:
return a3 = zq(c2, U2, n3, o3, _2), s3 = a3.operations, u3 = a3.newSelection, it2(s3, function(e21, t4) {
return { state: ji(ji({}, t4), {}, { selection: u3 }) };
}), e20.next = 8, oa();
case 8:
return e20.next = 10, ie2();
case 10:
case "end":
return e20.stop();
}
}, e19);
}))).apply(this, arguments);
}
function re2() {
return re2 = yi(mi().mark(function e19(t3, n3) {
var r3, o3, a3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
return i2("handleReplaceAll", { text: t3, replacementText: n3 }), r3 = Bq(c2, U2, t3, n3, _2), o3 = r3.operations, a3 = r3.newSelection, it2(o3, function(e21, t4) {
return { state: ji(ji({}, t4), {}, { selection: a3 }) };
}), e20.next = 5, oa();
case 5:
return e20.next = 7, ie2();
case 7:
case "end":
return e20.stop();
}
}, e19);
})), re2.apply(this, arguments);
}
function ie2() {
return oe2.apply(this, arguments);
}
function oe2() {
return (oe2 = yi(mi().mark(function e19() {
var t3, r3, o3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (r3 = null === (t3 = V2) || void 0 === t3 ? void 0 : t3.activeItem, i2("focusActiveSearchResult", V2), !r3) {
e20.next = 9;
break;
}
return o3 = r3.path, n2(13, U2 = ji(ji({}, kB(c2, U2, o3)), {}, { selection: void 0 })), e20.next = 7, oa();
case 7:
return e20.next = 9, Xe2(o3);
case 9:
case "end":
return e20.stop();
}
}, e19);
}))).apply(this, arguments);
}
var ae2 = VB({ onChange: function(e19) {
n2(19, se2 = e19);
} }), se2 = ae2.getState();
var ue2, ce2, le2 = bk(function() {
if ("" === Y2)
return i2("clearing search result"), void (void 0 !== V2 && n2(14, V2 = void 0));
n2(18, Q2 = true), setTimeout(function() {
i2("searching...", Y2);
var e19 = Nq(Y2, c2, U2, 1e3);
n2(14, V2 = function(e20, t3, n3) {
var r3 = null != n3 && n3.activeItem ? qq(n3.activeItem) : void 0, i3 = t3.findIndex(function(e21) {
return Em(r3, qq(e21));
}), o3 = -1 !== i3 ? i3 : (null == n3 ? void 0 : n3.activeIndex) < t3.length ? null == n3 ? void 0 : n3.activeIndex : t3.length > 0 ? 0 : -1, a3 = t3.map(function(e21, t4) {
return ji(ji({}, e21), {}, { active: t4 === o3 });
}), s3 = a3[o3];
return { items: a3, itemsMap: Bp(a3, function(e21) {
return fs.exports.compileJSONPointer(e21.path);
}), activeItem: s3, activeIndex: o3 };
}(0, e19, V2)), n2(18, Q2 = false);
});
}, 300), fe2 = false, he2 = [], de2 = Uz(Qz);
function ve2(e19, t3, r3, o3) {
Kz(function() {
var a3;
try {
a3 = de2(e19, t3, r3, o3);
} catch (e20) {
a3 = [{ path: [], message: "Failed to validate: " + e20.message, severity: vj.warning }];
}
Em(a3, he2) || (i2("validationErrors changed:", a3), n2(9, he2 = a3));
}, function(e20) {
return i2("validationErrors updated in ".concat(e20, " ms"));
});
}
function pe2() {
return i2("validate"), q2 ? { parseError: q2, isRepairable: false } : (ve2(c2, C2, _2, $2), { validationErrors: he2 });
}
function me2() {
return c2;
}
function ge2() {
return U2;
}
function ye2(e19) {
void 0 !== e19.json && function(e20) {
if (void 0 === e20)
return;
var t3 = !Em(c2, e20);
if (i2("update external json", { isChanged: t3, currentlyText: void 0 === c2 }), !t3)
return;
var r3 = { json: c2, text: l2 }, o3 = U2, a3 = c2, s3 = l2, u3 = fe2;
n2(7, c2 = e20), be2(c2), n2(8, l2 = void 0), n2(20, fe2 = false), ke2(c2), we2({ previousJson: a3, previousState: o3, previousText: s3, previousTextIsRepaired: u3 }), rt2(r3, null);
}(e19.json), void 0 !== e19.text && function(e20) {
if (void 0 === e20 || void 0 !== k2.json)
return;
var t3 = e20 === l2;
if (i2("update external text", { isChanged: t3 }), t3)
return;
var r3 = { json: c2, text: l2 }, o3 = c2, a3 = U2, s3 = l2, u3 = fe2;
try {
n2(7, c2 = _2.parse(e20)), be2(c2), n2(8, l2 = e20), n2(20, fe2 = false), q2 = void 0, ke2(c2);
} catch (t4) {
try {
n2(7, c2 = _2.parse(Os(e20))), be2(c2), n2(8, l2 = e20), n2(20, fe2 = true), q2 = void 0, ke2(c2);
} catch (e21) {
n2(7, c2 = void 0), n2(8, l2 = k2.text), n2(20, fe2 = false), q2 = oj(l2, t4.message || t4.toString()), ke2(c2);
}
}
we2({ previousJson: o3, previousState: a3, previousText: s3, previousTextIsRepaired: u3 }), rt2(r3, null);
}(e19.text);
}
function be2(e19) {
J2 || (J2 = true, n2(13, U2 = wB(e19, U2, B2, function(e20) {
return cj({ json: e20 }, 10240) ? EH : PH;
}(e19))));
}
function ke2(e19) {
void 0 !== U2.selection && (U2.selection && fs.exports.existsIn(e19, U2.selection.anchorPath) && fs.exports.existsIn(e19, U2.selection.focusPath) || (i2("clearing selection: path does not exist anymore", U2.selection), n2(13, U2 = ji(ji({}, U2), {}, { selection: void 0 }))));
}
function we2(e19) {
var t3 = e19.previousJson, n3 = e19.previousState, r3 = e19.previousText, i3 = e19.previousTextIsRepaired;
void 0 === t3 && void 0 === r3 || (void 0 !== c2 ? void 0 !== t3 ? ae2.add({ undo: { patch: [{ op: "replace", path: "", value: t3 }], state: fq(n3), json: void 0, text: r3, textIsRepaired: i3 }, redo: { patch: [{ op: "replace", path: "", value: c2 }], state: fq(U2), json: void 0, text: l2, textIsRepaired: fe2 } }) : ae2.add({ undo: { patch: void 0, json: void 0, text: r3, state: fq(n3), textIsRepaired: i3 }, redo: { patch: void 0, json: c2, state: fq(U2), text: l2, textIsRepaired: fe2 } }) : void 0 !== t3 && ae2.add({ undo: { patch: void 0, json: t3, state: fq(n3), text: r3, textIsRepaired: i3 }, redo: { patch: void 0, json: void 0, text: l2, textIsRepaired: fe2, state: fq(U2) } }));
}
function je2() {
i2("createDefaultSelection"), n2(13, U2 = ji(ji({}, U2), {}, { selection: mq(c2 || {}, [], []) }));
}
function xe2(e19, t3) {
if (i2("patch", e19, t3), void 0 === c2)
throw new Error("Cannot apply patch: no JSON");
var r3 = { json: c2, text: l2 }, o3 = c2, a3 = U2, s3 = l2, u3 = fe2, f3 = function(e20, t4) {
return fs.exports.revertJSONPatch(e20, t4, { before: function(e21, t5, n3) {
if (fs.exports.isJSONPatchRemove(t5)) {
var r4 = fs.exports.parseJSONPointer(t5.path);
return { revertOperations: [].concat(Ti(n3), Ti(Aq(e21, r4))) };
}
if (fs.exports.isJSONPatchMove(t5)) {
var i3 = fs.exports.parseJSONPointer(t5.from);
return { revertOperations: [].concat(Ti(n3), Ti(Aq(e21, i3))) };
}
return { revertOperations: n3 };
} });
}(c2, e19), h3 = _B(c2, U2, e19), d3 = oq(c2, e19), v3 = function(e20, t4) {
var n3 = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
return void 0 !== t4 || n3 ? ji(ji({}, e20), {}, { selection: t4 }) : e20;
}(h3.documentState, d3, false);
i2("patch updatedSelection", d3);
var p3 = "function" == typeof t3 ? t3(h3.json, v3) : void 0;
n2(7, c2 = p3 && void 0 !== p3.json ? p3.json : h3.json);
var m3 = p3 && void 0 !== p3.state ? p3.state : v3;
n2(13, U2 = m3), n2(8, l2 = void 0), n2(20, fe2 = false), ke2(c2), ae2.add({ undo: { patch: f3, json: void 0, text: s3, state: fq(a3), textIsRepaired: u3 }, redo: { patch: e19, json: void 0, state: fq(m3), text: l2, textIsRepaired: fe2 } });
var g3 = { json: c2, previousJson: o3, undo: f3, redo: e19 };
return rt2(r3, g3), g3;
}
function Se2(e19) {
return YB(e19) || GB(e19) || QB(e19);
}
function _e2() {
!b2 && U2.selection && F2(hq(U2.selection.focusPath, true));
}
function Ce2() {
!b2 && U2.selection && F2(dq(U2.selection.focusPath, true));
}
function $e2() {
if (!b2 && QB(U2.selection)) {
var e19 = U2.selection.focusPath, t3 = fs.exports.compileJSONPointer(e19), n3 = fs.exports.getIn(c2, e19), r3 = !RB(n3, U2.enforceStringMap, t3, _2), o3 = r3 ? String(n3) : zs(String(n3), _2);
i2("handleToggleEnforceString", { enforceString: r3, value: n3, updatedValue: o3 }), it2([{ op: "replace", path: fs.exports.compileJSONPointer(e19), value: o3 }], function(e20, n4) {
return { state: SB(n4, t3, r3) };
});
}
}
function Oe2() {
return Me2.apply(this, arguments);
}
function Me2() {
return Me2 = yi(mi().mark(function e19() {
var t3, n3, r3, o3, a3, s3, u3 = arguments;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (t3 = !(u3.length > 0 && void 0 !== u3[0]) || u3[0], !b2 && Se2(U2.selection)) {
e20.next = 3;
break;
}
return e20.abrupt("return");
case 3:
if (n3 = t3 ? O2 : null, null != (r3 = gq(c2, U2.selection, n3, _2))) {
e20.next = 7;
break;
}
return e20.abrupt("return");
case 7:
return i2("cut", { selection: U2.selection, clipboard: r3, indent: t3 }), e20.next = 10, Wq(r3);
case 10:
o3 = Pq(c2, U2.selection), a3 = o3.operations, s3 = o3.newSelection, it2(a3, function(e21, t4) {
return { state: ji(ji({}, t4), {}, { selection: s3 }) };
});
case 12:
case "end":
return e20.stop();
}
}, e19);
})), Me2.apply(this, arguments);
}
function Ee2() {
return Pe2.apply(this, arguments);
}
function Pe2() {
return Pe2 = yi(mi().mark(function e19() {
var t3, n3, r3, o3 = arguments;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (t3 = !(o3.length > 0 && void 0 !== o3[0]) || o3[0], n3 = t3 ? O2 : null, null != (r3 = gq(c2, U2.selection, n3, _2))) {
e20.next = 5;
break;
}
return e20.abrupt("return");
case 5:
return i2("copy", { clipboard: r3, indent: t3 }), e20.next = 8, Wq(r3);
case 8:
case "end":
return e20.stop();
}
}, e19);
})), Pe2.apply(this, arguments);
}
function Ae2() {
f2(Zq, {}, ji(ji({}, es), {}, { styleWindow: { width: "450px" } }), { onClose: function() {
return vt2();
} });
}
function Te2(e19) {
if (void 0 !== c2) {
U2.selection || je2();
var t3 = $q(c2, U2.selection, e19, _2);
i2("paste", { clipboardText: e19, operations: t3, selection: U2.selection }), it2(t3, function(e20, n3) {
var r3 = n3;
return t3.filter(function(e21) {
return (fs.exports.isJSONPatchAdd(e21) || fs.exports.isJSONPatchReplace(e21)) && Ts(e21.value);
}).forEach(function(t4) {
var n4 = fs.exports.parsePath(c2, t4.path);
r3 = at2(e20, r3, n4);
}), { state: r3 };
});
} else
i2("paste text", { clipboardText: e19 }), function(e20, t4) {
i2("handleChangeText");
var r3 = U2, o3 = c2, a3 = l2, s3 = { json: c2, text: l2 }, u3 = fe2;
try {
n2(7, c2 = _2.parse(e20)), n2(13, U2 = wB(c2, U2, B2, EH)), n2(8, l2 = void 0), n2(20, fe2 = false);
} catch (t5) {
try {
n2(7, c2 = _2.parse(Os(e20))), n2(13, U2 = wB(c2, U2, B2, EH)), n2(8, l2 = e20), n2(20, fe2 = true);
} catch (t6) {
n2(7, c2 = void 0), n2(13, U2 = gB({ json: c2, expand: EH })), n2(8, l2 = e20), n2(20, fe2 = false);
}
}
if ("function" == typeof t4) {
var f3 = t4(c2, U2);
n2(7, c2 = f3 && f3.json ? f3.json : c2), n2(13, U2 = f3 && f3.state ? f3.state : U2);
}
ke2(c2), we2({ previousJson: o3, previousState: r3, previousText: a3, previousTextIsRepaired: u3 }), rt2(s3, null);
}(e19, function(e20, t4) {
if (e20) {
return { state: at2(e20, t4, []) };
}
});
}
function Ie2() {
if (!b2 && U2.selection) {
var e19 = GB(U2.selection) || QB(U2.selection) ? mq(c2, U2.selection.anchorPath, U2.selection.focusPath) : U2.selection;
if (Mm(U2.selection.focusPath))
i2("remove root", { selection: U2.selection }), E2({ text: "", json: void 0 }, { text: l2, json: c2 }, { contentErrors: pe2(), patchResult: null });
else {
var t3 = Pq(c2, e19), n3 = t3.operations, r3 = t3.newSelection;
i2("remove", { operations: n3, selection: U2.selection, newSelection: r3 }), it2(n3, function(e20, t4) {
return { state: ji(ji({}, t4), {}, { selection: r3 }) };
});
}
}
}
function Ne2() {
if (!b2 && Se2(U2.selection) && !Mm(U2.selection.focusPath)) {
i2("duplicate", { selection: U2.selection });
var e19 = function(e20, t3) {
var n3 = $v(t3);
if (Mm(n3))
throw new Error("Cannot duplicate root object");
var r3 = im(n3), i3 = $v(n3), o3 = fs.exports.getIn(e20, r3);
if (fs.exports.isJSONArray(o3)) {
var a3 = $v(t3), s3 = a3 ? Ms($v(a3)) + 1 : 0;
return Ti(t3.map(function(e21, t4) {
return { op: "copy", from: fs.exports.compileJSONPointer(e21), path: fs.exports.compileJSONPointer(r3.concat(String(t4 + s3))) };
}));
}
if (fs.exports.isJSONObject(o3)) {
var u3 = Object.keys(o3), c3 = DB(u3, i3, false);
return [].concat(Ti(t3.map(function(e21) {
var t4 = WB($v(e21), u3);
return { op: "copy", from: fs.exports.compileJSONPointer(e21), path: fs.exports.compileJSONPointer(r3.concat(t4)) };
})), Ti(c3.map(function(e21) {
return Mq(r3, e21);
})));
}
throw new Error("Cannot create duplicate operations: parent must be an Object or Array");
}(c2, yq(U2.selection));
it2(e19);
}
}
function Re2() {
if (!b2 && U2.selection && (YB(U2.selection) || QB(U2.selection)) && !Mm(U2.selection.focusPath)) {
i2("extract", { selection: U2.selection });
var e19 = function(e20, t3) {
if (QB(t3))
return [{ op: "move", from: fs.exports.compileJSONPointer(t3.focusPath), path: "" }];
if (!YB(t3))
throw new Error("Cannot create extract operations: parent must be an Object or Array");
var n3 = im(t3.focusPath), r3 = fs.exports.getIn(e20, n3);
if (fs.exports.isJSONArray(r3))
return [{ op: "replace", path: "", value: t3.paths.map(function(e21) {
var t4 = Ms($v(e21));
return r3[t4];
}) }];
if (fs.exports.isJSONObject(r3)) {
var i3 = {};
return t3.paths.forEach(function(e21) {
var t4 = String($v(e21));
i3[t4] = r3[t4];
}), [{ op: "replace", path: "", value: i3 }];
}
throw new Error("Cannot extract: unsupported type of selection " + JSON.stringify(t3));
}(c2, U2.selection);
it2(e19, function(e20, t3) {
if (Ts(e20)) {
return { state: at2(e20, t3, []) };
}
});
}
}
function De2(e19) {
if (!b2 && U2.selection) {
var t3 = function(e20, t4, n4) {
if ("object" === n4)
return {};
if ("array" === n4)
return [];
if ("structure" === n4) {
var r4 = ZB(t4), i3 = fs.exports.getIn(e20, r4);
if (Array.isArray(i3) && !Mm(i3)) {
var o4 = yp(i3);
return Ts(o4) ? hd(o4, function(e21) {
return Array.isArray(e21) ? [] : As(e21) ? void 0 : "";
}) : "";
}
}
return "";
}(c2, U2.selection, e19);
if (void 0 !== c2) {
var n3 = _2.stringify(t3), r3 = $q(c2, U2.selection, n3, _2);
i2("handleInsert", { type: e19, operations: r3, newValue: t3, data: n3 });
var o3 = $v(r3.filter(function(e20) {
return "add" === e20.op || "replace" === e20.op;
}));
it2(r3, function(e20, n4) {
if (o3) {
var r4 = fs.exports.parsePath(e20, o3.path);
if (Ts(t3))
return { state: ji(ji({}, wB(e20, n4, r4, PH)), {}, { selection: vq(r4) }) };
if ("" === t3) {
var a4 = Mm(r4) ? null : fs.exports.getIn(e20, im(r4));
return i2("test A", r4, vq(r4)), { state: kB(e20, ji(ji({}, U2), {}, { selection: As(a4) ? hq(r4, true) : dq(r4, true) }), r4) };
}
}
}), i2("after patch"), o3 && "" === t3 && oa().then(function() {
setTimeout(function() {
return Fe2("", true);
});
});
} else {
i2("handleInsert", { type: e19, newValue: t3 });
var a3 = [];
ot2(t3, function(e20, t4) {
return { state: ji(ji({}, at2(e20, t4, a3)), {}, { selection: vq(a3) }) };
});
}
}
}
function Le2(e19) {
GB(U2.selection) && F2(dq(U2.selection.focusPath, false)), De2(e19);
}
function ze2(e19) {
if (!b2 && U2.selection)
if (kq(U2.selection))
try {
var t3 = U2.selection.anchorPath, n3 = fs.exports.getIn(c2, t3), r3 = function(e20, t4, n4) {
if ("array" === t4) {
if (Array.isArray(e20))
return e20;
if (As(e20))
return Zw(e20);
if ("string" == typeof e20) {
var r4 = n4.parse(e20);
if (Array.isArray(r4))
return r4;
if (As(r4))
return Zw(r4);
}
}
if ("object" === t4) {
if (Array.isArray(e20))
return Yw(e20);
if (As(e20))
return e20;
if ("string" == typeof e20) {
var i3 = n4.parse(e20);
if (As(i3))
return i3;
if (Array.isArray(i3))
return Yw(i3);
}
}
if ("value" === t4)
return Ts(e20) ? n4.stringify(e20) : e20;
throw new Error("Cannot convert ".concat(Rs(e20, n4), " to ").concat(t4));
}(n3, e19, _2);
if (r3 === n3)
return;
var o3 = [{ op: "replace", path: fs.exports.compileJSONPointer(t3), value: r3 }];
i2("handleConvert", { selection: U2.selection, path: t3, type: e19, operations: o3 }), it2(o3, function(e20, t4) {
return { state: at2(e20, t4, U2.selection.focusPath) };
});
} catch (e20) {
M2(e20);
}
else
M2(new Error("Cannot convert current selection to ".concat(e19)));
}
function Be2() {
var e19 = nq(c2, U2, false), t3 = im(U2.selection.focusPath);
!Mm(e19.focusPath) && Em(t3, im(e19.focusPath)) ? F2(pq(e19.focusPath)) : F2(vq(t3)), i2("insert before", { selection: U2.selection, selectionBefore: e19, parentPath: t3 }), oa().then(ht2);
}
function qe2() {
var e19 = YB(U2.selection) ? $v(U2.selection.paths) : U2.selection.focusPath;
i2("insert after", e19), F2(pq(e19)), oa().then(ht2);
}
function Fe2(e19, t3) {
var n3 = Dj(u2).document.activeElement;
n3.isContentEditable && (n3.textContent = t3 ? e19 : n3.textContent + e19, Rj(n3));
}
function Ve2(e19) {
return We2.apply(this, arguments);
}
function We2() {
return (We2 = yi(mi().mark(function e19(t3) {
var n3, r3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (!b2 && U2.selection) {
e20.next = 2;
break;
}
return e20.abrupt("return");
case 2:
if (!GB(U2.selection)) {
e20.next = 9;
break;
}
return n3 = !U2.selection.edit, F2(ji(ji({}, U2.selection), {}, { edit: true })), e20.next = 7, oa();
case 7:
return setTimeout(function() {
return Fe2(t3, n3);
}), e20.abrupt("return");
case 9:
if ("{" !== t3) {
e20.next = 13;
break;
}
De2("object"), e20.next = 28;
break;
case 13:
if ("[" !== t3) {
e20.next = 17;
break;
}
De2("array"), e20.next = 28;
break;
case 17:
if (!QB(U2.selection)) {
e20.next = 26;
break;
}
if (Ts(fs.exports.getIn(c2, U2.selection.focusPath))) {
e20.next = 24;
break;
}
return r3 = !U2.selection.edit, F2(ji(ji({}, U2.selection), {}, { edit: true })), e20.next = 23, oa();
case 23:
setTimeout(function() {
return Fe2(t3, r3);
});
case 24:
e20.next = 28;
break;
case 26:
return e20.next = 28, He2(t3);
case 28:
case "end":
return e20.stop();
}
}, e19);
}))).apply(this, arguments);
}
function He2(e19) {
return Je2.apply(this, arguments);
}
function Je2() {
return Je2 = yi(mi().mark(function e19(t3) {
var n3, r3, i3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (!b2 && U2.selection) {
e20.next = 2;
break;
}
return e20.abrupt("return");
case 2:
return De2("value"), n3 = !bq(U2.selection), r3 = U2.selection.focusPath, i3 = fs.exports.getIn(c2, im(r3)), Array.isArray(i3) || !i3 || QB(U2.selection) ? F2(dq(r3, true)) : F2(hq(r3, true)), e20.next = 9, oa();
case 9:
setTimeout(function() {
return Fe2(t3, n3);
});
case 10:
case "end":
return e20.stop();
}
}, e19);
})), Je2.apply(this, arguments);
}
function Ue2() {
if (!b2 && ae2.getState().canUndo) {
var e19 = ae2.undo();
if (e19) {
var t3 = { json: c2, text: l2 };
n2(7, c2 = e19.undo.patch ? fs.exports.immutableJSONPatch(c2, e19.undo.patch) : e19.undo.json), n2(13, U2 = e19.undo.state), n2(8, l2 = e19.undo.text), n2(20, fe2 = e19.undo.textIsRepaired), i2("undo", { item: e19, json: c2, documentState: U2 }), rt2(t3, { json: c2, previousJson: t3.json, redo: e19.undo.patch, undo: e19.redo.patch }), vt2(), U2.selection && Xe2(U2.selection.focusPath, false);
}
}
}
function Ke2() {
if (!b2 && ae2.getState().canRedo) {
var e19 = ae2.redo();
if (e19) {
var t3 = { json: c2, text: l2 };
n2(7, c2 = e19.redo.patch ? fs.exports.immutableJSONPatch(c2, e19.redo.patch) : e19.redo.json), n2(13, U2 = e19.redo.state), n2(8, l2 = e19.redo.text), n2(20, fe2 = e19.redo.textIsRepaired), i2("redo", { item: e19, json: c2, documentState: U2 }), rt2(t3, { json: c2, previousJson: t3.json, redo: e19.redo.patch, undo: e19.undo.patch }), vt2(), U2.selection && Xe2(U2.selection.focusPath, false);
}
}
}
function Ge2(e19) {
var t3;
b2 || (z2 = true, D2({ id: h2, json: c2, selectedPath: e19, onSort: (t3 = yi(mi().mark(function t4(n3) {
return mi().wrap(function(t5) {
for (; ; )
switch (t5.prev = t5.next) {
case 0:
i2("onSort", e19, n3), it2(n3, function(t6, n4) {
return { state: ji(ji({}, at2(t6, n4, e19)), {}, { selection: dq(e19, false) }) };
});
case 2:
case "end":
return t5.stop();
}
}, t4);
})), function(e20) {
return t3.apply(this, arguments);
}), onClose: function() {
z2 = false, vt2();
} }));
}
function Qe2() {
U2.selection && Ge2(cq(c2, U2.selection));
}
function Ye2(e19) {
var t3 = e19.id, n3 = e19.selectedPath, r3 = e19.onTransform, o3 = e19.onClose;
z2 = true, L2({ id: t3 || d2, json: c2, selectedPath: n3, onTransform: r3 ? function(e20) {
r3({ operations: e20, json: c2, transformedJson: fs.exports.immutableJSONPatch(c2, e20) });
} : function(e20) {
i2("onTransform", n3, e20), it2(e20, function(e21, t4) {
return { state: ji(ji({}, at2(e21, t4, n3)), {}, { selection: dq(n3, false) }) };
});
}, onClose: function() {
z2 = false, vt2(), o3 && o3();
} });
}
function Ze2() {
U2.selection && Ye2({ selectedPath: cq(c2, U2.selection) });
}
function Xe2(e19) {
return et2.apply(this, arguments);
}
function et2() {
return et2 = yi(mi().mark(function e19(t3) {
var r3, o3, s3, u3, l3, f3 = arguments;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
return r3 = !(f3.length > 1 && void 0 !== f3[1]) || f3[1], n2(13, U2 = kB(c2, U2, im(t3))), e20.next = 4, oa();
case 4:
if (!(o3 = tt2(t3))) {
e20.next = 14;
break;
}
if (i2("scrollTo", { path: t3, elem: o3, refContents: a2 }), s3 = a2.getBoundingClientRect(), u3 = o3.getBoundingClientRect(), r3) {
e20.next = 12;
break;
}
if (!(u3.bottom > s3.top && u3.top < s3.bottom)) {
e20.next = 12;
break;
}
return e20.abrupt("return");
case 12:
l3 = -s3.height / 4, y2(o3, { container: a2, offset: l3, duration: 300 });
case 14:
case "end":
return e20.stop();
}
}, e19);
})), et2.apply(this, arguments);
}
function tt2(e19) {
return a2 ? a2.querySelector('div[data-path="'.concat(qj(e19), '"]')) : null;
}
function nt2(e19) {
var t3 = tt2(e19);
if (t3 && a2) {
var n3 = a2.getBoundingClientRect(), r3 = t3.getBoundingClientRect(), i3 = Ts(fs.exports.getIn(c2, e19)) ? 20 : r3.height;
r3.top < n3.top + 20 ? y2(t3, { container: a2, offset: -20, duration: 0 }) : r3.top + i3 > n3.bottom - 20 && y2(t3, { container: a2, offset: -(n3.height - i3 - 20), duration: 0 });
}
}
function rt2(e19, t3) {
void 0 === e19.json && void 0 === (null == e19 ? void 0 : e19.text) || (void 0 !== l2 ? E2({ text: l2, json: void 0 }, e19, { contentErrors: pe2(), patchResult: t3 }) : void 0 !== c2 && E2({ text: void 0, json: c2 }, e19, { contentErrors: pe2(), patchResult: t3 }));
}
function it2(e19, t3) {
if (!b2) {
i2("handlePatch", e19, t3);
var r3 = xe2(e19, t3);
return n2(15, H2 = void 0), r3;
}
}
function ot2(e19, t3) {
var r3 = U2, i3 = c2, o3 = l2, a3 = { json: c2, text: l2 }, s3 = fe2, u3 = wB(c2, U2, B2, EH), f3 = "function" == typeof t3 ? t3(e19, u3) : void 0;
n2(7, c2 = f3 && void 0 !== f3.json ? f3.json : e19), n2(13, U2 = f3 && void 0 !== f3.state ? f3.state : u3), n2(8, l2 = void 0), n2(20, fe2 = false), ke2(c2), we2({ previousJson: i3, previousState: r3, previousText: o3, previousTextIsRepaired: s3 });
rt2(a3, null);
}
function at2(e19, t3, n3) {
return wB(e19, t3, n3, !cj({ json: fs.exports.getIn(e19, n3) }, 10240) ? PH : EH);
}
function st2(e19, t3) {
var r3 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
i2("expand", { path: e19, expanded: t3, recursive: r3 }), n2(13, U2 = t3 ? r3 ? wB(c2, U2, e19, PH) : jB(U2, e19) : xB(U2, e19)), U2.selection && !t3 && tq(U2.selection, e19) && F2(void 0), setTimeout(function() {
Lj(u2) || vt2();
});
}
function ut2(e19) {
i2("openFind", { findAndReplace: e19 }), n2(16, K2 = false), n2(17, G2 = false), oa().then(function() {
n2(16, K2 = true), n2(17, G2 = e19);
});
}
function ct2(e19, t3) {
i2("handleExpandSection", e19, t3);
var r3 = fs.exports.compileJSONPointer(e19);
n2(13, U2 = function(e20, t4, n3, r4) {
return ji(ji({}, t4), {}, { visibleSectionsMap: ji(ji({}, t4.visibleSectionsMap), {}, xi({}, n3, dB(yB(t4, n3).concat(r4)))) });
}(0, U2, r3, t3));
}
function lt2(e19) {
i2("pasted json as text", e19), n2(15, H2 = e19);
}
function ft2(e19) {
var t3 = e19.anchor, n3 = e19.left, r3 = e19.top, i3 = e19.width, o3 = e19.height, a3 = e19.offsetTop, s3 = e19.offsetLeft, u3 = e19.showTip;
z2 = true;
var l3 = p2(EF, { json: c2, documentState: U2, parser: _2, showTip: u3, onEditKey: _e2, onEditValue: Ce2, onToggleEnforceString: $e2, onCut: Oe2, onCopy: Ee2, onPaste: Ae2, onRemove: Ie2, onDuplicate: Ne2, onExtract: Re2, onInsertBefore: Be2, onInsert: Le2, onConvert: ze2, onInsertAfter: qe2, onSort: Qe2, onTransform: Ze2, onCloseContextMenu: function() {
m2(l3), vt2();
} }, { left: n3, top: r3, offsetTop: a3, offsetLeft: s3, width: i3, height: o3, anchor: t3, closeOnOuterClick: true, onClose: function() {
z2 = false, vt2();
} });
}
function ht2(e19) {
if (!b2 && !bq(U2.selection)) {
if (e19 && (e19.stopPropagation(), e19.preventDefault()), e19 && "contextmenu" === e19.type && e19.target !== s2)
ft2({ left: e19.clientX, top: e19.clientY, width: 260, height: 336, showTip: false });
else {
var t3, n3 = null === (t3 = a2) || void 0 === t3 ? void 0 : t3.querySelector(".jse-context-menu-button.jse-selected");
if (n3)
ft2({ anchor: n3, offsetTop: 2, width: 260, height: 336, showTip: false });
else {
var r3, i3 = null === (r3 = a2) || void 0 === r3 ? void 0 : r3.getBoundingClientRect();
i3 && ft2({ top: i3.top + 2, left: i3.left + 2, width: 260, height: 336, showTip: false });
}
}
return false;
}
}
function dt2() {
return (dt2 = yi(mi().mark(function e19() {
var t3, n3, r3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
return i2("apply pasted json", H2), n3 = (t3 = H2).path, r3 = t3.contents, F2(dq(n3, false)), e20.next = 5, oa();
case 5:
it2([{ op: "replace", path: fs.exports.compileJSONPointer(n3), value: r3 }], function(e21, t4) {
return { state: at2(e21, t4, n3) };
});
case 7:
case "end":
return e20.stop();
}
}, e19);
}))).apply(this, arguments);
}
function vt2() {
i2("focus"), s2 && (s2.focus(), s2.select());
}
function pt2(e19) {
r2 && r2.onDrag(e19);
}
function mt2() {
r2 && r2.onDragEnd();
}
return e18.$$set = function(e19) {
"readOnly" in e19 && n2(0, b2 = e19.readOnly), "externalContent" in e19 && n2(47, k2 = e19.externalContent), "mainMenuBar" in e19 && n2(1, w2 = e19.mainMenuBar), "navigationBar" in e19 && n2(2, j2 = e19.navigationBar), "escapeControlCharacters" in e19 && n2(48, x2 = e19.escapeControlCharacters), "escapeUnicodeCharacters" in e19 && n2(49, S2 = e19.escapeUnicodeCharacters), "parser" in e19 && n2(50, _2 = e19.parser), "validator" in e19 && n2(51, C2 = e19.validator), "validationParser" in e19 && n2(52, $2 = e19.validationParser), "indentation" in e19 && n2(53, O2 = e19.indentation), "onError" in e19 && n2(54, M2 = e19.onError), "onChange" in e19 && n2(55, E2 = e19.onChange), "onRenderValue" in e19 && n2(56, P2 = e19.onRenderValue), "onRequestRepair" in e19 && n2(3, A2 = e19.onRequestRepair), "onRenderMenu" in e19 && n2(4, T2 = e19.onRenderMenu), "onClassName" in e19 && n2(57, I2 = e19.onClassName), "onFocus" in e19 && n2(58, N2 = e19.onFocus), "onBlur" in e19 && n2(59, R2 = e19.onBlur), "onSortModal" in e19 && n2(60, D2 = e19.onSortModal), "onTransformModal" in e19 && n2(61, L2 = e19.onTransformModal);
}, e18.$$.update = function() {
393216 & e18.$$.dirty[1] && n2(70, W2 = kj({ escapeControlCharacters: x2, escapeUnicodeCharacters: S2 })), 65536 & e18.$$.dirty[1] && ye2(k2), 128 & e18.$$.dirty[0] | 512 & e18.$$.dirty[2] && le2(Y2, c2), e18.$$.dirty[0], 128 & e18.$$.dirty[0] | 3670016 & e18.$$.dirty[1] && ve2(c2, C2, _2, $2), 512 & e18.$$.dirty[0] && n2(21, ue2 = function(e19) {
var t3 = {};
return e19.forEach(function(e20) {
t3[fs.exports.compileJSONPointer(e20.path)] = e20;
}), e19.forEach(function(e20) {
for (var n3 = e20.path; n3.length > 0; ) {
n3 = im(n3);
var r3 = fs.exports.compileJSONPointer(n3);
r3 in t3 || (t3[r3] = { isChildError: true, path: n3, message: "Contains invalid data" });
}
}), t3;
}(he2)), 64 & e18.$$.dirty[0] && (r2 = a2 ? function(e19) {
var t3, n3;
function r3(e20) {
return e20 < 20 ? 200 : e20 < 50 ? 400 : 1200;
}
function i3() {
if (e19) {
var n4 = 0.05 * t3;
e19.scrollTop += n4;
}
}
function o3(e20) {
n3 && e20 === t3 || (a3(), lB("startAutoScroll", e20), t3 = e20, n3 = setInterval(i3, 50));
}
function a3() {
n3 && (lB("stopAutoScroll"), clearInterval(n3), n3 = void 0, t3 = void 0);
}
return lB("createAutoScrollHandler", e19), { onDrag: function(t4) {
if (e19) {
var n4 = t4.clientY, i4 = e19.getBoundingClientRect(), s3 = i4.top, u3 = i4.bottom;
n4 < s3 ? o3(-r3(s3 - n4)) : n4 > u3 ? o3(r3(n4 - u3)) : a3();
}
}, onDragEnd: function() {
a3();
} };
}(a2) : void 0), 1 & e18.$$.dirty[0] | 101187584 & e18.$$.dirty[1] | 256 & e18.$$.dirty[2] && n2(10, ce2 = { readOnly: b2, parser: _2, normalization: W2, getJson: me2, getDocumentState: ge2, findElement: tt2, focus: vt2, onPatch: it2, onInsert: De2, onExpand: st2, onSelect: F2, onFind: ut2, onExpandSection: ct2, onPasteJson: lt2, onRenderValue: P2, onContextMenu: ft2, onClassName: I2 || function() {
}, onDrag: pt2, onDragEnd: mt2 }), 1024 & e18.$$.dirty[0] && i2("context changed", ce2);
}, [b2, w2, j2, A2, T2, function() {
return fe2 && void 0 !== c2 && ot2(c2), { json: c2, text: l2 };
}, a2, c2, l2, he2, ce2, s2, u2, U2, V2, H2, K2, G2, Q2, se2, fe2, ue2, o2, B2, Z2, function() {
return ee2.apply(this, arguments);
}, function() {
return te2.apply(this, arguments);
}, function(e19, t3) {
return ne2.apply(this, arguments);
}, function(e19, t3) {
return re2.apply(this, arguments);
}, function() {
n2(16, K2 = false), n2(17, G2 = false), Z2(""), vt2();
}, function(e19) {
i2("select validation error", e19), F2(dq(e19.path, false)), Xe2(e19.path);
}, Ee2, function(e19) {
if (e19.preventDefault(), !b2) {
var t3 = e19.clipboardData.getData("text/plain");
try {
Te2(t3);
} catch (e20) {
!function(e21, t4) {
f2(cF, { text: e21, onParse: nj, onRepair: rj, onApply: t4, onRenderMenu: T2 }, ji(ji({}, es), {}, { styleWindow: { width: "600px", height: "500px" }, styleContent: { padding: 0, height: "100%" } }), { onClose: function() {
return vt2();
} });
}(t3, function(e21) {
i2("repaired pasted text: ", e21), Te2(e21);
});
}
}
}, Ue2, Ke2, function() {
Ge2([]);
}, function() {
Ye2({ selectedPath: [] });
}, function() {
st2([], true, true);
}, function() {
st2([], false, true);
}, function(e19) {
var t3 = Hj(e19).replace(/^Command\+/, "Ctrl+"), n3 = e19.shiftKey;
if (i2("keydown", { combo: t3, key: e19.key }), "Ctrl+X" === t3 && (e19.preventDefault(), Oe2(true)), "Ctrl+Shift+X" === t3 && (e19.preventDefault(), Oe2(false)), "Ctrl+C" === t3 && (e19.preventDefault(), Ee2(true)), "Ctrl+Shift+C" === t3 && (e19.preventDefault(), Ee2(false)), "Ctrl+D" === t3 && (e19.preventDefault(), Ne2()), "Delete" !== t3 && "Backspace" !== t3 || (e19.preventDefault(), Ie2()), "Insert" === t3 && (e19.preventDefault(), De2("structure")), "Ctrl+A" === t3 && (e19.preventDefault(), F2(dq([], false))), "Ctrl+Q" === t3 && ht2(e19), "Up" === t3 || "Shift+Up" === t3) {
e19.preventDefault();
var r3 = U2.selection ? nq(c2, U2, n3, true) || U2.selection : iq(c2, U2);
F2(r3), nt2(r3.focusPath);
}
if ("Down" === t3 || "Shift+Down" === t3) {
e19.preventDefault();
var o3 = U2.selection ? function(e20, t4) {
var n4 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r4 = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], i3 = t4.selection, o4 = !r4 && YB(i3) ? $v(i3.paths) : i3.focusPath, a4 = qB(e20, t4, o4), s4 = a4, u4 = a4;
if (null === a4)
return null;
if (n4) {
var c3 = qB(e20, Ts(fs.exports.getIn(e20, o4)) ? xB(t4, o4) : t4, o4);
return null === c3 ? null : UB(i3) ? mq(e20, c3, c3) : KB(i3) ? mq(e20, s4, u4) : mq(e20, i3.anchorPath, c3);
}
if (GB(i3)) {
var l4 = im(a4), f4 = fs.exports.getIn(e20, l4);
return Array.isArray(f4) ? dq(u4, false) : hq(u4, false);
}
return QB(i3) ? dq(u4, false) : KB(i3) ? mq(e20, s4, u4) : mq(e20, a4, a4);
}(c2, U2, n3, true) || U2.selection : iq(c2, U2);
F2(o3), nt2(o3.focusPath);
}
if ("Left" === t3 || "Shift+Left" === t3) {
e19.preventDefault();
var a3 = U2.selection ? function(e20, t4) {
var n4 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r4 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], i3 = t4.selection, o4 = rq(e20, t4, r4), a4 = o4.caret, s4 = o4.previous;
if (n4)
return YB(i3) ? null : mq(e20, i3.anchorPath, i3.focusPath);
if (a4 && s4)
return wq(s4);
var u4 = im(i3.focusPath), c3 = fs.exports.getIn(e20, u4);
return QB(i3) && Array.isArray(c3) ? mq(e20, i3.focusPath, i3.focusPath) : YB(i3) && !Array.isArray(c3) ? hq(i3.focusPath, false) : null;
}(c2, U2, n3, !b2) || U2.selection : iq(c2, U2);
F2(a3), nt2(a3.focusPath);
}
if ("Right" === t3 || "Shift+Right" === t3) {
e19.preventDefault();
var s3 = U2.selection ? function(e20, t4) {
var n4 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], r4 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], i3 = t4.selection, o4 = rq(e20, t4, r4), a4 = o4.caret, s4 = o4.next;
return n4 ? YB(i3) ? null : mq(e20, i3.anchorPath, i3.focusPath) : a4 && s4 ? wq(s4) : YB(i3) ? dq(i3.focusPath, false) : null;
}(c2, U2, n3, !b2) || U2.selection : iq(c2, U2);
F2(s3), nt2(s3.focusPath);
}
if ("Enter" === t3 && U2.selection) {
if (!b2 && YB(U2.selection) && 1 === U2.selection.paths.length) {
var u3 = U2.selection.focusPath, l3 = fs.exports.getIn(c2, im(u3));
Array.isArray(l3) && F2(dq(u3, false));
}
if (!b2 && GB(U2.selection) && (e19.preventDefault(), F2(ji(ji({}, U2.selection), {}, { edit: true }))), QB(U2.selection))
e19.preventDefault(), Ts(fs.exports.getIn(c2, U2.selection.focusPath)) ? st2(U2.selection.focusPath, true) : b2 || F2(ji(ji({}, U2.selection), {}, { edit: true }));
}
if (1 === t3.replace(/^Shift\+/, "").replace(/^Numpad_/, "").length && U2.selection)
return e19.preventDefault(), void Ve2(e19.key);
if ("Enter" === t3 && (UB(U2.selection) || KB(U2.selection)))
return e19.preventDefault(), void Ve2("");
if ("Ctrl+Enter" === t3 && QB(U2.selection)) {
var f3 = fs.exports.getIn(c2, U2.selection.focusPath);
Ls(f3) && window.open(String(f3), "_blank");
}
if ("Escape" === t3 && U2.selection && (e19.preventDefault(), F2(void 0)), "Ctrl+F" === t3 && (e19.preventDefault(), ut2(false)), "Ctrl+H" === t3 && (e19.preventDefault(), ut2(true)), "Ctrl+Z" === t3) {
e19.preventDefault();
var h3 = document.activeElement;
h3 && h3.blur && h3.focus ? (h3.blur(), setTimeout(function() {
Ue2(), setTimeout(function() {
return h3.select();
});
})) : Ue2();
}
if ("Ctrl+Shift+Z" === t3) {
e19.preventDefault();
var d3 = document.activeElement;
d3 && d3.blur && d3.focus ? (d3.blur(), setTimeout(function() {
Ke2(), setTimeout(function() {
return d3.select();
});
})) : Ke2();
}
}, function(e19) {
i2("handleMouseDown", e19), setTimeout(function() {
setTimeout(function() {
g2 || Aj(e19.target, "BUTTON") || (vt2(), U2.selection || void 0 !== c2 || "" !== l2 && void 0 !== l2 || je2());
});
});
}, ht2, function(e19) {
b2 || ft2({ anchor: zj(e19.target, "BUTTON"), offsetTop: 0, width: 260, height: 336, showTip: true });
}, function() {
return dt2.apply(this, arguments);
}, function() {
i2("clear pasted json"), n2(15, H2 = void 0);
}, function(e19) {
F2(e19), vt2(), Xe2(e19.focusPath);
}, function(e19) {
var t3 = !Ij(e19.target, function(e20) {
return e20 === u2;
});
t3 && bq(U2.selection) && (i2("click outside the editor, stop edit mode"), F2(function(e20) {
return GB(e20) || QB(e20) ? ji(ji({}, e20), {}, { edit: false }) : e20;
}), g2 && s2 && (s2.focus(), s2.blur()), oa().then(function() {
setTimeout(function() {
s2 && s2.blur();
});
}));
}, k2, x2, S2, _2, C2, $2, O2, M2, E2, P2, I2, N2, R2, D2, L2, function() {
var e19 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : function() {
return true;
};
i2("expand");
var t3 = ji(ji({}, U2), {}, { expandedMap: {}, visibleSectionsMap: {} });
n2(13, U2 = wB(c2, t3, B2, e19));
}, pe2, me2, xe2, Ye2, Xe2, tt2, vt2, W2, Y2, function(e19) {
n2(16, K2 = e19);
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(11, s2 = e19);
});
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(6, a2 = e19);
});
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(12, u2 = e19);
});
}];
}
var TH = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, AH, MH, Ki, { readOnly: 0, externalContent: 47, mainMenuBar: 1, navigationBar: 2, escapeControlCharacters: 48, escapeUnicodeCharacters: 49, parser: 50, validator: 51, validationParser: 52, indentation: 53, onError: 54, onChange: 55, onRenderValue: 56, onRequestRepair: 3, onRenderMenu: 4, onClassName: 57, onFocus: 58, onBlur: 59, onSortModal: 60, onTransformModal: 61, expand: 62, validate: 63, getJson: 64, patch: 65, acceptAutoRepair: 5, openTransformModal: 66, scrollTo: 67, findElement: 68, focus: 69 }, yH, [-1, -1, -1, -1, -1]), r2;
}
return Li(n2, [{ key: "expand", get: function() {
return this.$$.ctx[62];
} }, { key: "validate", get: function() {
return this.$$.ctx[63];
} }, { key: "getJson", get: function() {
return this.$$.ctx[64];
} }, { key: "patch", get: function() {
return this.$$.ctx[65];
} }, { key: "acceptAutoRepair", get: function() {
return this.$$.ctx[5];
} }, { key: "openTransformModal", get: function() {
return this.$$.ctx[66];
} }, { key: "scrollTo", get: function() {
return this.$$.ctx[67];
} }, { key: "findElement", get: function() {
return this.$$.ctx[68];
} }, { key: "focus", get: function() {
return this.$$.ctx[69];
} }]), n2;
}(), IH = { id: "javascript", name: "JavaScript", description: "\n\n Enter a JavaScript function to filter, sort, or transform the data.\n
\n", createQuery: function(e18, t2) {
var n2 = t2.filter, r2 = t2.sort, i2 = t2.projection, o2 = [];
if (n2 && n2.path && n2.relation && n2.value) {
var a2 = "item => item".concat(bS(n2.path)), s2 = JB(n2.value), u2 = "string" == typeof s2 ? "'".concat(n2.value, "'") : Bs(n2.value) && !Number.isSafeInteger(s2) ? "".concat(n2.value, "n") : n2.value;
o2.push(" data = data.filter(".concat(a2, " ").concat(n2.relation, " ").concat(u2, ")\n"));
}
r2 && r2.path && r2.direction && ("desc" === r2.direction ? o2.push(" data = data.slice().sort((a, b) => {\n // sort descending\n" + " const valueA = a".concat(bS(r2.path), "\n") + " const valueB = b".concat(bS(r2.path), "\n") + " return valueA > valueB ? -1 : valueA < valueB ? 1 : 0\n })\n") : o2.push(" data = data.slice().sort((a, b) => {\n // sort ascending\n" + " const valueA = a".concat(bS(r2.path), "\n") + " const valueB = b".concat(bS(r2.path), "\n") + " return valueA > valueB ? 1 : valueA < valueB ? -1 : 0\n })\n"));
if (i2 && i2.paths)
if (i2.paths.length > 1) {
var c2 = i2.paths.map(function(e19) {
var t3 = e19[e19.length - 1] || "item", n3 = "item".concat(bS(e19));
return " ".concat(JSON.stringify(t3), ": ").concat(n3);
});
o2.push(" data = data.map(item => ({\n".concat(c2.join(",\n"), "})\n )\n"));
} else {
var l2 = "item".concat(bS(i2.paths[0]));
o2.push(" data = data.map(item => ".concat(l2, ")\n"));
}
return o2.push(" return data\n"), "function query (data) {\n".concat(o2.join(""), "}");
}, executeQuery: function(e18, t2) {
var n2 = new Function('"use strict";\n\n' + t2 + `
if (typeof query !== "function") {
throw new Error("Cannot execute query: expecting a function named 'query' but is undefined")
}
return query;
`)()(e18);
return void 0 !== n2 ? n2 : null;
} };
function NH(e18) {
co(e18, "svelte-zs5o25", ".jse-boolean-toggle.svelte-zs5o25{color:var(--jse-value-color-boolean);position:relative;padding-left:calc(0.5 * var(--jse-padding));padding-top:1px;height:var(--jse-line-height)}");
}
function RH(e18) {
var t2, n2, r2, i2, o2, a2;
return n2 = new uS({ props: { data: true === e18[0] ? kF : wF } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-boolean-toggle svelte-zs5o25"), So(t2, "title", r2 = e18[1] ? "Boolean value ".concat(e18[0]) : "Click to toggle this boolean value");
}, m: function(r3, s2) {
vo(r3, t2, s2), Ea(n2, t2, null), i2 = true, o2 || (a2 = jo(t2, "mousedown", e18[2]), o2 = true);
}, p: function(e19, o3) {
var a3 = ki(o3, 1)[0], s2 = {};
1 & a3 && (s2.data = true === e19[0] ? kF : wF), n2.$set(s2), (!i2 || 3 & a3 && r2 !== (r2 = e19[1] ? "Boolean value ".concat(e19[0]) : "Click to toggle this boolean value")) && So(t2, "title", r2);
}, i: function(e19) {
i2 || (ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), o2 = false, a2();
} };
}
function DH(e18, t2, n2) {
var r2 = t2.path, i2 = t2.value, o2 = t2.readOnly, a2 = t2.onPatch, s2 = t2.focus;
return e18.$$set = function(e19) {
"path" in e19 && n2(3, r2 = e19.path), "value" in e19 && n2(0, i2 = e19.value), "readOnly" in e19 && n2(1, o2 = e19.readOnly), "onPatch" in e19 && n2(4, a2 = e19.onPatch), "focus" in e19 && n2(5, s2 = e19.focus);
}, [i2, o2, function(e19) {
e19.stopPropagation(), o2 || (a2([{ op: "replace", path: fs.exports.compileJSONPointer(r2), value: !i2 }]), setTimeout(s2));
}, r2, a2, s2];
}
var LH = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, DH, RH, Ki, { path: 3, value: 0, readOnly: 1, onPatch: 4, focus: 5 }, NH), r2;
}
return Li(n2);
}();
function zH(e18) {
co(e18, "svelte-1gn8yt9", ".jse-color-picker-popup.svelte-1gn8yt9 .picker_wrapper.popup,.jse-color-picker-popup.svelte-1gn8yt9 .picker_wrapper.popup .picker_arrow::before,.jse-color-picker-popup.svelte-1gn8yt9 .picker_wrapper.popup .picker_arrow::after{background:var(--jse-color-picker-background);line-height:normal}.jse-color-picker-popup.svelte-1gn8yt9 .picker_slider,.jse-color-picker-popup.svelte-1gn8yt9 .picker_sl,.jse-color-picker-popup.svelte-1gn8yt9 .picker_editor input,.jse-color-picker-popup.svelte-1gn8yt9 .picker_sample,.jse-color-picker-popup.svelte-1gn8yt9 .picker_done button{box-shadow:var(--jse-color-picker-border-box-shadow)}.jse-color-picker-popup.svelte-1gn8yt9 .picker_editor input{background:var(--jse-background-color);color:var(--jse-text-color)}.jse-color-picker-popup.svelte-1gn8yt9 .picker_done button{background:var(--jse-button-background);color:var(--jse-button-color)}.jse-color-picker-popup.svelte-1gn8yt9 .picker_done button:hover{background:var(--jse-button-background-highlight)}");
}
function BH(e18) {
var t2;
return { c: function() {
So(t2 = go("div"), "class", "jse-color-picker-popup svelte-1gn8yt9");
}, m: function(n2, r2) {
vo(n2, t2, r2), e18[4](t2);
}, p: Bi, i: Bi, o: Bi, d: function(n2) {
n2 && po(t2), e18[4](null);
} };
}
function qH(e18, t2, n2) {
var r2, i2, o2 = t2.color, a2 = t2.onChange, s2 = t2.showOnTop;
return Uo(yi(mi().mark(function e19() {
var t3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
return e20.next = 2, Promise.resolve().then(function() {
return JK;
});
case 2:
t3 = e20.sent.default, i2 = new t3({ parent: r2, color: o2, popup: s2 ? "top" : "bottom", onDone: function(e21) {
var t4 = 1 === e21.rgba[3] ? e21.hex.substring(0, 7) : e21.hex;
a2(t4);
} }), i2.show();
case 5:
case "end":
return e20.stop();
}
}, e19);
}))), Ko(function() {
i2 && i2.destroy();
}), e18.$$set = function(e19) {
"color" in e19 && n2(1, o2 = e19.color), "onChange" in e19 && n2(2, a2 = e19.onChange), "showOnTop" in e19 && n2(3, s2 = e19.showOnTop);
}, [r2, o2, a2, s2, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(0, r2 = e19);
});
}];
}
var FH = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, qH, BH, Ui, { color: 1, onChange: 2, showOnTop: 3 }, zH), r2;
}
return Li(n2);
}();
function VH(e18) {
co(e18, "svelte-fk1u9y", ".jse-color-picker-button.svelte-fk1u9y{font-size:var(--jse-font-size-mono);width:var(--jse-color-picker-button-size);height:var(--jse-color-picker-button-size);box-sizing:border-box;padding:0;margin:2px;border:1px solid var(--jse-text-color);border-radius:2px;background:inherit;outline:none;cursor:pointer}");
}
function WH(e18) {
var t2, n2, r2, i2;
return { c: function() {
So(t2 = go("button"), "class", "jse-color-picker-button svelte-fk1u9y"), Po(t2, "background", e18[2]), So(t2, "title", n2 = e18[1] ? "Color ".concat(e18[0]) : "Click to open a color picker");
}, m: function(n3, o2) {
vo(n3, t2, o2), r2 || (i2 = jo(t2, "click", e18[3]), r2 = true);
}, p: function(e19, r3) {
var i3 = ki(r3, 1)[0];
4 & i3 && Po(t2, "background", e19[2]), 3 & i3 && n2 !== (n2 = e19[1] ? "Color ".concat(e19[0]) : "Click to open a color picker") && So(t2, "title", n2);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2), r2 = false, i2();
} };
}
function HH(e18, t2, n2) {
var r2, i2 = Yo("absolute-popup").openAbsolutePopup, o2 = t2.path, a2 = t2.value, s2 = t2.readOnly, u2 = t2.onPatch, c2 = t2.focus;
function l2(e19) {
u2([{ op: "replace", path: fs.exports.compileJSONPointer(o2), value: e19 }]), f2();
}
function f2() {
c2();
}
return e18.$$set = function(e19) {
"path" in e19 && n2(4, o2 = e19.path), "value" in e19 && n2(0, a2 = e19.value), "readOnly" in e19 && n2(1, s2 = e19.readOnly), "onPatch" in e19 && n2(5, u2 = e19.onPatch), "focus" in e19 && n2(6, c2 = e19.focus);
}, e18.$$.update = function() {
1 & e18.$$.dirty && n2(2, r2 = Ns(a2));
}, [a2, s2, r2, function(e19) {
if (!s2) {
var t3 = e19.target.getBoundingClientRect().top, n3 = Dj(e19.target).innerHeight;
i2(FH, { color: a2, onChange: l2, showOnTop: n3 - t3 < 300 && t3 > 300 }, { anchor: e19.target, closeOnOuterClick: true, onClose: f2, offsetTop: 18, offsetLeft: -8, height: 300 });
}
}, o2, u2, c2];
}
var JH = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, HH, WH, Ki, { path: 4, value: 0, readOnly: 1, onPatch: 5, focus: 6 }, VH), r2;
}
return Li(n2);
}();
function UH(e18, t2) {
var n2 = Rs(e18, t2);
return AF("jse-value", "jse-" + n2, { "jse-url": Ls(e18), "jse-empty": "string" == typeof e18 && 0 === e18.length });
}
function KH(e18) {
var t2, n2;
return t2 = new nV({ props: { value: e18[1].escapeValue(e18[0]), onChange: e18[3], onCancel: e18[4], onPaste: e18[5], onFind: e18[2], onValueClass: e18[6] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = ki(n3, 1)[0], i2 = {};
3 & r2 && (i2.value = e19[1].escapeValue(e19[0])), 4 & r2 && (i2.onFind = e19[2]), t2.$set(i2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function GH(e18, t2, n2) {
var r2 = t2.path, i2 = t2.value, o2 = t2.parser, a2 = t2.normalization, s2 = t2.enforceString, u2 = t2.onPatch, c2 = t2.onPasteJson, l2 = t2.onSelect, f2 = t2.onFind, h2 = t2.focus;
function d2(e19) {
return s2 ? e19 : zs(e19, o2);
}
return e18.$$set = function(e19) {
"path" in e19 && n2(7, r2 = e19.path), "value" in e19 && n2(0, i2 = e19.value), "parser" in e19 && n2(8, o2 = e19.parser), "normalization" in e19 && n2(1, a2 = e19.normalization), "enforceString" in e19 && n2(9, s2 = e19.enforceString), "onPatch" in e19 && n2(10, u2 = e19.onPatch), "onPasteJson" in e19 && n2(11, c2 = e19.onPasteJson), "onSelect" in e19 && n2(12, l2 = e19.onSelect), "onFind" in e19 && n2(2, f2 = e19.onFind), "focus" in e19 && n2(13, h2 = e19.focus);
}, [i2, a2, f2, function(e19, t3) {
u2([{ op: "replace", path: fs.exports.compileJSONPointer(r2), value: d2(a2.unescapeValue(e19)) }], function(e20, n3) {
var i3 = t3 === ss ? function(e21, t4, n4) {
var r3 = im(n4), i4 = [$v(n4)], o3 = qB(fs.exports.getIn(e21, r3), t4, i4);
return o3 ? dq(r3.concat(o3), false) : pq(n4);
}(e20, n3, r2) || n3.selection : dq(r2, false);
return { state: ji(ji({}, n3), {}, { selection: i3 }) };
}), t3 !== as && h2();
}, function() {
l2(dq(r2, false)), h2();
}, function(e19) {
try {
var t3 = o2.parse(e19);
Ts(t3) && c2({ path: r2, contents: t3 });
} catch (e20) {
}
}, function(e19) {
return UH(d2(a2.unescapeValue(e19)), o2);
}, r2, o2, s2, u2, c2, l2, h2];
}
var QH = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, GH, KH, Ki, { path: 7, value: 0, parser: 8, normalization: 1, enforceString: 9, onPatch: 10, onPasteJson: 11, onSelect: 12, onFind: 2, focus: 13 }), r2;
}
return Li(n2);
}();
function YH(e18) {
co(e18, "svelte-6ci2p7", '.jse-value.jse-string.svelte-6ci2p7{color:var(--jse-value-color-string)}.jse-value.jse-object.svelte-6ci2p7,.jse-value.jse-array.svelte-6ci2p7{min-width:16px;color:var(--jse-delimiter-color)}.jse-value.jse-number.svelte-6ci2p7{color:var(--jse-value-color-number)}.jse-value.jse-boolean.svelte-6ci2p7{color:var(--jse-value-color-boolean)}.jse-value.jse-null.svelte-6ci2p7{color:var(--jse-value-color-null)}.jse-value.jse-invalid.svelte-6ci2p7{color:var(--jse-text-color)}.jse-value.jse-url.svelte-6ci2p7{color:var(--jse-value-color-url);text-decoration:underline}.jse-value.svelte-6ci2p7{min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;word-break:normal;overflow-wrap:anywhere;white-space:pre-wrap}.jse-value.svelte-6ci2p7:hover{background:var(--jse-hover-background-color)}.jse-value.jse-empty.svelte-6ci2p7{min-width:4em;outline:1px dotted var(--jse-tag-background);-moz-outline-radius:2px}.jse-value.jse-empty.svelte-6ci2p7::after{pointer-events:none;color:var(--jse-tag-background);content:"value"}');
}
function ZH(e18) {
var t2, n2 = Pj(e18[1].escapeValue(e18[0])) + "";
return { c: function() {
t2 = bo(n2);
}, m: function(e19, n3) {
vo(e19, t2, n3);
}, p: function(e19, r2) {
3 & r2 && n2 !== (n2 = Pj(e19[1].escapeValue(e19[0])) + "") && Mo(t2, n2);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function XH(e18) {
var t2, n2;
return t2 = new ZF({ props: { text: e18[1].escapeValue(e18[0]), searchResultItems: e18[3] } }), { c: function() {
Ma(t2.$$.fragment);
}, m: function(e19, r2) {
Ea(t2, e19, r2), n2 = true;
}, p: function(e19, n3) {
var r2 = {};
3 & n3 && (r2.text = e19[1].escapeValue(e19[0])), 8 & n3 && (r2.searchResultItems = e19[3]), t2.$set(r2);
}, i: function(e19) {
n2 || (ya(t2.$$.fragment, e19), n2 = true);
}, o: function(e19) {
ba(t2.$$.fragment, e19), n2 = false;
}, d: function(e19) {
Pa(t2, e19);
} };
}
function eJ(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2, c2 = [XH, ZH], l2 = [];
function f2(e19, t3) {
return e19[3] ? 0 : 1;
}
return n2 = f2(e18), r2 = l2[n2] = c2[n2](e18), { c: function() {
t2 = go("div"), r2.c(), So(t2, "data-type", "selectable-value"), So(t2, "class", i2 = eo(UH(e18[0], e18[2])) + " svelte-6ci2p7"), So(t2, "title", o2 = e18[4] ? "Ctrl+Click or Ctrl+Enter to open url in new window" : null);
}, m: function(r3, i3) {
vo(r3, t2, i3), l2[n2].m(t2, null), a2 = true, s2 || (u2 = [jo(t2, "click", e18[5]), jo(t2, "dblclick", e18[6])], s2 = true);
}, p: function(e19, s3) {
var u3 = ki(s3, 1)[0], h2 = n2;
(n2 = f2(e19)) === h2 ? l2[n2].p(e19, u3) : (ma(), ba(l2[h2], 1, 1, function() {
l2[h2] = null;
}), ga(), (r2 = l2[n2]) ? r2.p(e19, u3) : (r2 = l2[n2] = c2[n2](e19)).c(), ya(r2, 1), r2.m(t2, null)), (!a2 || 5 & u3 && i2 !== (i2 = eo(UH(e19[0], e19[2])) + " svelte-6ci2p7")) && So(t2, "class", i2), (!a2 || 16 & u3 && o2 !== (o2 = e19[4] ? "Ctrl+Click or Ctrl+Enter to open url in new window" : null)) && So(t2, "title", o2);
}, i: function(e19) {
a2 || (ya(r2), a2 = true);
}, o: function(e19) {
ba(r2), a2 = false;
}, d: function(e19) {
e19 && po(t2), l2[n2].d(), s2 = false, Hi(u2);
} };
}
function tJ(e18, t2, n2) {
var r2, i2 = t2.path, o2 = t2.value, a2 = t2.readOnly, s2 = t2.normalization, u2 = t2.parser, c2 = t2.onSelect, l2 = t2.searchResultItems;
return e18.$$set = function(e19) {
"path" in e19 && n2(7, i2 = e19.path), "value" in e19 && n2(0, o2 = e19.value), "readOnly" in e19 && n2(8, a2 = e19.readOnly), "normalization" in e19 && n2(1, s2 = e19.normalization), "parser" in e19 && n2(2, u2 = e19.parser), "onSelect" in e19 && n2(9, c2 = e19.onSelect), "searchResultItems" in e19 && n2(3, l2 = e19.searchResultItems);
}, e18.$$.update = function() {
1 & e18.$$.dirty && n2(4, r2 = Ls(o2));
}, [o2, s2, u2, l2, r2, function(e19) {
"string" == typeof o2 && r2 && e19.ctrlKey && (e19.preventDefault(), e19.stopPropagation(), window.open(o2, "_blank"));
}, function(e19) {
a2 || (e19.preventDefault(), c2(dq(i2, true)));
}, i2, a2, c2];
}
var nJ = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, tJ, eJ, Ki, { path: 7, value: 0, readOnly: 8, normalization: 1, parser: 2, onSelect: 9, searchResultItems: 3 }, YH), r2;
}
return Li(n2);
}();
function rJ(e18) {
co(e18, "svelte-1u00zub", ".jse-timestamp.svelte-1u00zub{padding:0;margin:0;height:var(--jse-line-height);color:var(--jse-value-color-number);border-radius:3px}");
}
function iJ(e18) {
var t2, n2, r2, i2, o2, a2;
return n2 = new uS({ props: { data: jF } }), { c: function() {
t2 = go("div"), Ma(n2.$$.fragment), So(t2, "class", "jse-timestamp svelte-1u00zub");
}, m: function(s2, u2) {
vo(s2, t2, u2), Ea(n2, t2, null), i2 = true, o2 || (a2 = to(r2 = SV.call(null, t2, ji({ text: e18[0] }, e18[1]))), o2 = true);
}, p: function(e19, t3) {
var n3 = ki(t3, 1)[0];
r2 && Ji(r2.update) && 1 & n3 && r2.update.call(null, ji({ text: e19[0] }, e19[1]));
}, i: function(e19) {
i2 || (ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), Pa(n2), o2 = false, a2();
} };
}
function oJ(e18, t2, n2) {
var r2, i2 = Yo("absolute-popup"), o2 = t2.value;
return e18.$$set = function(e19) {
"value" in e19 && n2(2, o2 = e19.value);
}, e18.$$.update = function() {
4 & e18.$$.dirty && n2(0, r2 = "Time: ".concat(new Date(o2).toString()));
}, [r2, i2, o2];
}
var aJ = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, oJ, iJ, Ki, { value: 2 }, rJ), r2;
}
return Li(n2);
}();
function sJ(e18) {
var t2 = e18.path, n2 = e18.value, r2 = e18.readOnly, i2 = e18.enforceString, o2 = e18.searchResultItems, a2 = e18.isEditing, s2 = e18.parser, u2 = e18.normalization, c2 = e18.onPatch, l2 = e18.onPasteJson, f2 = e18.onSelect, h2 = e18.onFind, d2 = e18.focus, v2 = [];
return !a2 && function(e19) {
return true === e19 || false === e19;
}(n2) && v2.push({ component: LH, props: { path: t2, value: n2, readOnly: r2, onPatch: c2, focus: d2 } }), !a2 && function(e19) {
return "string" == typeof e19 && !!Ns(e19);
}(n2) && v2.push({ component: JH, props: { path: t2, value: n2, readOnly: r2, onPatch: c2, focus: d2 } }), a2 && v2.push({ component: QH, props: { path: t2, value: n2, enforceString: i2, parser: s2, normalization: u2, onPatch: c2, onPasteJson: l2, onSelect: f2, onFind: h2, focus: d2 } }), a2 || v2.push({ component: nJ, props: { path: t2, value: n2, readOnly: r2, parser: s2, normalization: u2, searchResultItems: o2, onSelect: f2 } }), !a2 && Is(n2) && v2.push({ component: aJ, props: { value: n2 } }), v2;
}
var uJ = {};
function cJ(e18) {
co(e18, "svelte-3e0qet", ".item.svelte-3e0qet{cursor:default;height:var(--height, 42px);line-height:var(--height, 42px);padding:var(--itemPadding, 0 20px);color:var(--itemColor, inherit);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.groupHeader.svelte-3e0qet{text-transform:var(--groupTitleTextTransform, uppercase)}.groupItem.svelte-3e0qet{padding-left:var(--groupItemPaddingLeft, 40px)}.item.svelte-3e0qet:active{background:var(--itemActiveBackground, #b9daff)}.item.active.svelte-3e0qet{background:var(--itemIsActiveBG, #007aff);color:var(--itemIsActiveColor, #fff)}.item.notSelectable.svelte-3e0qet{color:var(--itemIsNotSelectableColor, #999)}.item.first.svelte-3e0qet{border-radius:var(--itemFirstBorderRadius, 4px 4px 0 0)}.item.hover.svelte-3e0qet:not(.active){background:var(--itemHoverBG, #e7f2ff);color:var(--itemHoverColor, inherit)}");
}
function lJ(e18) {
var t2, n2, r2 = e18[0](e18[1], e18[2]) + "";
return { c: function() {
So(t2 = go("div"), "class", n2 = "item " + e18[3] + " svelte-3e0qet");
}, m: function(e19, n3) {
vo(e19, t2, n3), t2.innerHTML = r2;
}, p: function(e19, i2) {
var o2 = ki(i2, 1)[0];
7 & o2 && r2 !== (r2 = e19[0](e19[1], e19[2]) + "") && (t2.innerHTML = r2), 8 & o2 && n2 !== (n2 = "item " + e19[3] + " svelte-3e0qet") && So(t2, "class", n2);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function fJ(e18, t2, n2) {
var r2 = t2.isActive, i2 = void 0 !== r2 && r2, o2 = t2.isFirst, a2 = void 0 !== o2 && o2, s2 = t2.isHover, u2 = void 0 !== s2 && s2, c2 = t2.isSelectable, l2 = void 0 !== c2 && c2, f2 = t2.getOptionLabel, h2 = void 0 === f2 ? void 0 : f2, d2 = t2.item, v2 = void 0 === d2 ? void 0 : d2, p2 = t2.filterText, m2 = void 0 === p2 ? "" : p2, g2 = "";
return e18.$$set = function(e19) {
"isActive" in e19 && n2(4, i2 = e19.isActive), "isFirst" in e19 && n2(5, a2 = e19.isFirst), "isHover" in e19 && n2(6, u2 = e19.isHover), "isSelectable" in e19 && n2(7, l2 = e19.isSelectable), "getOptionLabel" in e19 && n2(0, h2 = e19.getOptionLabel), "item" in e19 && n2(1, v2 = e19.item), "filterText" in e19 && n2(2, m2 = e19.filterText);
}, e18.$$.update = function() {
if (242 & e18.$$.dirty) {
var t3 = [];
i2 && t3.push("active"), a2 && t3.push("first"), u2 && t3.push("hover"), v2.isGroupHeader && t3.push("groupHeader"), v2.isGroupItem && t3.push("groupItem"), l2 || t3.push("notSelectable"), n2(3, g2 = t3.join(" "));
}
}, [h2, v2, m2, g2, i2, a2, u2, l2];
}
var hJ = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, fJ, lJ, Ui, { isActive: 4, isFirst: 5, isHover: 6, isSelectable: 7, getOptionLabel: 0, item: 1, filterText: 2 }, cJ), r2;
}
return Li(n2);
}();
function dJ(e18) {
co(e18, "svelte-1uyqfml", ".listContainer.svelte-1uyqfml{box-shadow:var(--listShadow, 0 2px 3px 0 rgba(44, 62, 80, 0.24));border-radius:var(--listBorderRadius, 4px);max-height:var(--listMaxHeight, 250px);overflow-y:auto;background:var(--listBackground, #fff);border:var(--listBorder, none);position:var(--listPosition, absolute);z-index:var(--listZIndex, 2);width:100%;left:var(--listLeft, 0);right:var(--listRight, 0)}.virtualList.svelte-1uyqfml{height:var(--virtualListHeight, 200px)}.listGroupTitle.svelte-1uyqfml{color:var(--groupTitleColor, #8f8f8f);cursor:default;font-size:var(--groupTitleFontSize, 12px);font-weight:var(--groupTitleFontWeight, 600);height:var(--height, 42px);line-height:var(--height, 42px);padding:var(--groupTitlePadding, 0 20px);text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;text-transform:var(--groupTitleTextTransform, uppercase)}.empty.svelte-1uyqfml{text-align:var(--listEmptyTextAlign, center);padding:var(--listEmptyPadding, 20px 0);color:var(--listEmptyColor, #78848f)}");
}
function vJ(e18, t2, n2) {
var r2 = e18.slice();
return r2[41] = t2[n2], r2[42] = n2, r2;
}
function pJ(e18) {
for (var t2, n2, r2 = e18[1], i2 = [], o2 = 0; o2 < r2.length; o2 += 1)
i2[o2] = wJ(vJ(e18, r2, o2));
var a2 = function(e19) {
return ba(i2[e19], 1, 1, function() {
i2[e19] = null;
});
}, s2 = null;
return r2.length || (s2 = gJ(e18)), { c: function() {
for (var e19 = 0; e19 < i2.length; e19 += 1)
i2[e19].c();
t2 = wo(), s2 && s2.c();
}, m: function(e19, r3) {
for (var o3 = 0; o3 < i2.length; o3 += 1)
i2[o3].m(e19, r3);
vo(e19, t2, r3), s2 && s2.m(e19, r3), n2 = true;
}, p: function(e19, n3) {
if (114390 & n3[0]) {
var o3;
for (r2 = e19[1], o3 = 0; o3 < r2.length; o3 += 1) {
var u2 = vJ(e19, r2, o3);
i2[o3] ? (i2[o3].p(u2, n3), ya(i2[o3], 1)) : (i2[o3] = wJ(u2), i2[o3].c(), ya(i2[o3], 1), i2[o3].m(t2.parentNode, t2));
}
for (ma(), o3 = r2.length; o3 < i2.length; o3 += 1)
a2(o3);
ga(), !r2.length && s2 ? s2.p(e19, n3) : r2.length ? s2 && (s2.d(1), s2 = null) : ((s2 = gJ(e19)).c(), s2.m(t2.parentNode, t2));
}
}, i: function(e19) {
if (!n2) {
for (var t3 = 0; t3 < r2.length; t3 += 1)
ya(i2[t3]);
n2 = true;
}
}, o: function(e19) {
i2 = i2.filter(Boolean);
for (var t3 = 0; t3 < i2.length; t3 += 1)
ba(i2[t3]);
n2 = false;
}, d: function(e19) {
mo(i2, e19), e19 && po(t2), s2 && s2.d(e19);
} };
}
function mJ(e18) {
var t2, n2, r2, i2 = e18[3];
function o2(e19) {
return { props: { items: e19[1], itemHeight: e19[8], $$slots: { default: [jJ, function(e20) {
return { 41: e20.item, 42: e20.i };
}, function(e20) {
return [0, (e20.item ? 1024 : 0) | (e20.i ? 2048 : 0)];
}] }, $$scope: { ctx: e19 } } };
}
return i2 && (t2 = new i2(o2(e18))), { c: function() {
t2 && Ma(t2.$$.fragment), n2 = wo();
}, m: function(e19, i3) {
t2 && Ea(t2, e19, i3), vo(e19, n2, i3), r2 = true;
}, p: function(e19, r3) {
var a2 = {};
if (2 & r3[0] && (a2.items = e19[1]), 256 & r3[0] && (a2.itemHeight = e19[8]), 9814 & r3[0] | 11264 & r3[1] && (a2.$$scope = { dirty: r3, ctx: e19 }), i2 !== (i2 = e19[3])) {
if (t2) {
ma();
var s2 = t2;
ba(s2.$$.fragment, 1, 0, function() {
Pa(s2, 1);
}), ga();
}
i2 ? (Ma((t2 = new i2(o2(e19))).$$.fragment), ya(t2.$$.fragment, 1), Ea(t2, n2.parentNode, n2)) : t2 = null;
} else
i2 && t2.$set(a2);
}, i: function(e19) {
r2 || (t2 && ya(t2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
t2 && ba(t2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(n2), t2 && Pa(t2, e19);
} };
}
function gJ(e18) {
var t2, n2 = !e18[11] && yJ(e18);
return { c: function() {
n2 && n2.c(), t2 = wo();
}, m: function(e19, r2) {
n2 && n2.m(e19, r2), vo(e19, t2, r2);
}, p: function(e19, r2) {
e19[11] ? n2 && (n2.d(1), n2 = null) : n2 ? n2.p(e19, r2) : ((n2 = yJ(e19)).c(), n2.m(t2.parentNode, t2));
}, d: function(e19) {
n2 && n2.d(e19), e19 && po(t2);
} };
}
function yJ(e18) {
var t2, n2;
return { c: function() {
t2 = go("div"), n2 = bo(e18[12]), So(t2, "class", "empty svelte-1uyqfml");
}, m: function(e19, r2) {
vo(e19, t2, r2), uo(t2, n2);
}, p: function(e19, t3) {
4096 & t3[0] && Mo(n2, e19[12]);
}, d: function(e19) {
e19 && po(t2);
} };
}
function bJ(e18) {
var t2, n2, r2, i2, o2, a2, s2 = e18[4];
function u2(e19) {
return { props: { item: e19[41], filterText: e19[13], getOptionLabel: e19[6], isFirst: _J(e19[42]), isActive: SJ(e19[41], e19[9], e19[10]), isHover: CJ(e19[2], e19[41], e19[42], e19[1]), isSelectable: $J(e19[41]) } };
}
function c2() {
return e18[29](e18[42]);
}
function l2() {
return e18[30](e18[42]);
}
function f2() {
for (var t3, n3 = arguments.length, r3 = new Array(n3), i3 = 0; i3 < n3; i3++)
r3[i3] = arguments[i3];
return (t3 = e18)[31].apply(t3, [e18[41], e18[42]].concat(r3));
}
return s2 && (n2 = new s2(u2(e18))), { c: function() {
t2 = go("div"), n2 && Ma(n2.$$.fragment), r2 = ko(), So(t2, "class", "listItem"), So(t2, "tabindex", "-1");
}, m: function(e19, s3) {
vo(e19, t2, s3), n2 && Ea(n2, t2, null), uo(t2, r2), i2 = true, o2 || (a2 = [jo(t2, "mouseover", c2), jo(t2, "focus", l2), jo(t2, "click", f2)], o2 = true);
}, p: function(i3, o3) {
e18 = i3;
var a3 = {};
if (2 & o3[0] && (a3.item = e18[41]), 8192 & o3[0] && (a3.filterText = e18[13]), 64 & o3[0] && (a3.getOptionLabel = e18[6]), 1538 & o3[0] && (a3.isActive = SJ(e18[41], e18[9], e18[10])), 6 & o3[0] && (a3.isHover = CJ(e18[2], e18[41], e18[42], e18[1])), 2 & o3[0] && (a3.isSelectable = $J(e18[41])), s2 !== (s2 = e18[4])) {
if (n2) {
ma();
var c3 = n2;
ba(c3.$$.fragment, 1, 0, function() {
Pa(c3, 1);
}), ga();
}
s2 ? (Ma((n2 = new s2(u2(e18))).$$.fragment), ya(n2.$$.fragment, 1), Ea(n2, t2, r2)) : n2 = null;
} else
s2 && n2.$set(a3);
}, i: function(e19) {
i2 || (n2 && ya(n2.$$.fragment, e19), i2 = true);
}, o: function(e19) {
n2 && ba(n2.$$.fragment, e19), i2 = false;
}, d: function(e19) {
e19 && po(t2), n2 && Pa(n2), o2 = false, Hi(a2);
} };
}
function kJ(e18) {
var t2, n2, r2 = e18[7](e18[41]) + "";
return { c: function() {
t2 = go("div"), n2 = bo(r2), So(t2, "class", "listGroupTitle svelte-1uyqfml");
}, m: function(e19, r3) {
vo(e19, t2, r3), uo(t2, n2);
}, p: function(e19, t3) {
130 & t3[0] && r2 !== (r2 = e19[7](e19[41]) + "") && Mo(n2, r2);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function wJ(e18) {
var t2, n2, r2, i2, o2 = [kJ, bJ], a2 = [];
function s2(e19, t3) {
return e19[41].isGroupHeader && !e19[41].isSelectable ? 0 : 1;
}
return t2 = s2(e18), n2 = a2[t2] = o2[t2](e18), { c: function() {
n2.c(), r2 = wo();
}, m: function(e19, n3) {
a2[t2].m(e19, n3), vo(e19, r2, n3), i2 = true;
}, p: function(e19, i3) {
var u2 = t2;
(t2 = s2(e19)) === u2 ? a2[t2].p(e19, i3) : (ma(), ba(a2[u2], 1, 1, function() {
a2[u2] = null;
}), ga(), (n2 = a2[t2]) ? n2.p(e19, i3) : (n2 = a2[t2] = o2[t2](e19)).c(), ya(n2, 1), n2.m(r2.parentNode, r2));
}, i: function(e19) {
i2 || (ya(n2), i2 = true);
}, o: function(e19) {
ba(n2), i2 = false;
}, d: function(e19) {
a2[t2].d(e19), e19 && po(r2);
} };
}
function jJ(e18) {
var t2, n2, r2, i2, o2, a2 = e18[4];
function s2(e19) {
return { props: { item: e19[41], filterText: e19[13], getOptionLabel: e19[6], isFirst: _J(e19[42]), isActive: SJ(e19[41], e19[9], e19[10]), isHover: CJ(e19[2], e19[41], e19[42], e19[1]), isSelectable: $J(e19[41]) } };
}
function u2() {
return e18[26](e18[42]);
}
function c2() {
return e18[27](e18[42]);
}
function l2() {
for (var t3, n3 = arguments.length, r3 = new Array(n3), i3 = 0; i3 < n3; i3++)
r3[i3] = arguments[i3];
return (t3 = e18)[28].apply(t3, [e18[41], e18[42]].concat(r3));
}
return a2 && (n2 = new a2(s2(e18))), { c: function() {
t2 = go("div"), n2 && Ma(n2.$$.fragment), So(t2, "class", "listItem");
}, m: function(e19, a3) {
vo(e19, t2, a3), n2 && Ea(n2, t2, null), r2 = true, i2 || (o2 = [jo(t2, "mouseover", u2), jo(t2, "focus", c2), jo(t2, "click", l2)], i2 = true);
}, p: function(r3, i3) {
e18 = r3;
var o3 = {};
if (1024 & i3[1] && (o3.item = e18[41]), 8192 & i3[0] && (o3.filterText = e18[13]), 64 & i3[0] && (o3.getOptionLabel = e18[6]), 2048 & i3[1] && (o3.isFirst = _J(e18[42])), 1536 & i3[0] | 1024 & i3[1] && (o3.isActive = SJ(e18[41], e18[9], e18[10])), 6 & i3[0] | 3072 & i3[1] && (o3.isHover = CJ(e18[2], e18[41], e18[42], e18[1])), 1024 & i3[1] && (o3.isSelectable = $J(e18[41])), a2 !== (a2 = e18[4])) {
if (n2) {
ma();
var u3 = n2;
ba(u3.$$.fragment, 1, 0, function() {
Pa(u3, 1);
}), ga();
}
a2 ? (Ma((n2 = new a2(s2(e18))).$$.fragment), ya(n2.$$.fragment, 1), Ea(n2, t2, null)) : n2 = null;
} else
a2 && n2.$set(o3);
}, i: function(e19) {
r2 || (n2 && ya(n2.$$.fragment, e19), r2 = true);
}, o: function(e19) {
n2 && ba(n2.$$.fragment, e19), r2 = false;
}, d: function(e19) {
e19 && po(t2), n2 && Pa(n2), i2 = false, Hi(o2);
} };
}
function xJ(e18) {
var t2, n2, r2, i2, o2, a2, s2 = [mJ, pJ], u2 = [];
function c2(e19, t3) {
return e19[5] ? 0 : 1;
}
return n2 = c2(e18), r2 = u2[n2] = s2[n2](e18), { c: function() {
t2 = go("div"), r2.c(), So(t2, "class", "listContainer svelte-1uyqfml"), So(t2, "style", e18[14]), Io(t2, "virtualList", e18[5]);
}, m: function(r3, s3) {
vo(r3, t2, s3), u2[n2].m(t2, null), e18[32](t2), i2 = true, o2 || (a2 = [jo(window, "keydown", e18[17]), jo(window, "resize", e18[18])], o2 = true);
}, p: function(e19, o3) {
var a3 = n2;
(n2 = c2(e19)) === a3 ? u2[n2].p(e19, o3) : (ma(), ba(u2[a3], 1, 1, function() {
u2[a3] = null;
}), ga(), (r2 = u2[n2]) ? r2.p(e19, o3) : (r2 = u2[n2] = s2[n2](e19)).c(), ya(r2, 1), r2.m(t2, null)), (!i2 || 16384 & o3[0]) && So(t2, "style", e19[14]), (!i2 || 32 & o3[0]) && Io(t2, "virtualList", e19[5]);
}, i: function(e19) {
i2 || (ya(r2), i2 = true);
}, o: function(e19) {
ba(r2), i2 = false;
}, d: function(r3) {
r3 && po(t2), u2[n2].d(), e18[32](null), o2 = false, Hi(a2);
} };
}
function SJ(e18, t2, n2) {
return t2 && t2[n2] === e18[n2];
}
function _J(e18) {
return 0 === e18;
}
function CJ(e18, t2, n2, r2) {
return $J(t2) && (e18 === n2 || 1 === r2.length);
}
function $J(e18) {
return e18.isGroupHeader && e18.isSelectable || e18.selectable || !e18.hasOwnProperty("selectable");
}
function OJ(e18, t2, n2) {
var r2, i2, o2 = Go(), a2 = t2.container, s2 = void 0 === a2 ? void 0 : a2, u2 = t2.VirtualList, c2 = void 0 === u2 ? null : u2, l2 = t2.Item, f2 = void 0 === l2 ? hJ : l2, h2 = t2.isVirtualList, d2 = void 0 !== h2 && h2, v2 = t2.items, p2 = void 0 === v2 ? [] : v2, m2 = t2.labelIdentifier, g2 = void 0 === m2 ? "label" : m2, y2 = t2.getOptionLabel, b2 = void 0 === y2 ? function(e19, t3) {
if (e19)
return e19.isCreator ? 'Create "'.concat(t3, '"') : e19[g2];
} : y2, k2 = t2.getGroupHeaderLabel, w2 = void 0 === k2 ? null : k2, j2 = t2.itemHeight, x2 = void 0 === j2 ? 40 : j2, S2 = t2.hoverItemIndex, _2 = void 0 === S2 ? 0 : S2, C2 = t2.value, $2 = void 0 === C2 ? void 0 : C2, O2 = t2.optionIdentifier, M2 = void 0 === O2 ? "value" : O2, E2 = t2.hideEmptyState, P2 = void 0 !== E2 && E2, A2 = t2.noOptionsMessage, T2 = void 0 === A2 ? "No options" : A2, I2 = t2.isMulti, N2 = void 0 !== I2 && I2, R2 = t2.activeItemIndex, D2 = void 0 === R2 ? 0 : R2, L2 = t2.filterText, z2 = void 0 === L2 ? "" : L2, B2 = t2.parent, q2 = void 0 === B2 ? null : B2, F2 = t2.listPlacement, V2 = void 0 === F2 ? null : F2, W2 = t2.listAutoWidth, H2 = void 0 === W2 ? null : W2, J2 = t2.listOffset, U2 = void 0 === J2 ? 5 : J2, K2 = 0, G2 = false;
function Q2(e19) {
e19.isCreator || o2("itemSelected", e19);
}
function Y2(e19) {
G2 || n2(2, _2 = e19);
}
function Z2(e19) {
var t3 = e19.item, r3 = e19.i;
if (e19.event.stopPropagation(), $2 && !N2 && $2[M2] === t3[M2])
return X2();
t3.isCreator ? o2("itemCreated", z2) : $J(t3) && (n2(19, D2 = r3), n2(2, _2 = r3), Q2(t3));
}
function X2() {
o2("closeList");
}
function ee2(e19) {
return te2.apply(this, arguments);
}
function te2() {
return (te2 = yi(mi().mark(function e19(t3) {
var r3;
return mi().wrap(function(e20) {
for (; ; )
switch (e20.prev = e20.next) {
case 0:
if (!d2) {
e20.next = 2;
break;
}
return e20.abrupt("return");
case 2:
for (r3 = true; r3; )
t3 > 0 && _2 === p2.length - 1 ? n2(2, _2 = 0) : n2(2, t3 < 0 && 0 === _2 ? _2 = p2.length - 1 : _2 += t3), r3 = !$J(p2[_2]);
return e20.next = 6, oa();
case 6:
ne2("hover");
case 7:
case "end":
return e20.stop();
}
}, e19);
}))).apply(this, arguments);
}
function ne2(e19) {
if (!d2 && s2) {
var t3, r3 = s2.querySelector(".listItem .".concat(e19));
r3 && (t3 = s2.getBoundingClientRect().bottom - r3.getBoundingClientRect().bottom), n2(0, s2.scrollTop -= t3, s2);
}
}
function re2() {
var e19 = q2.getBoundingClientRect(), t3 = e19.height, r3 = e19.width;
n2(14, i2 = ""), n2(14, i2 += "min-width:".concat(r3, "px;width:").concat(H2 ? "auto" : "100%", ";")), "top" === V2 || "auto" === V2 && function(e20, t4) {
var n3 = e20.getBoundingClientRect(), r4 = t4.getBoundingClientRect(), i3 = {};
return i3.top = n3.top < 0, i3.left = n3.left < 0, i3.bottom = n3.bottom + r4.height > (window.innerHeight || document.documentElement.clientHeight), i3.right = n3.right > (window.innerWidth || document.documentElement.clientWidth), i3.any = i3.top || i3.left || i3.bottom || i3.right, i3;
}(q2, s2).bottom ? n2(14, i2 += "bottom:".concat(t3 + U2, "px;")) : n2(14, i2 += "top:".concat(t3 + U2, "px;"));
}
Uo(function() {
if (p2.length > 0 && !N2 && $2) {
var e19 = p2.findIndex(function(e20) {
return e20[M2] === $2[M2];
});
e19 && n2(2, _2 = e19);
}
ne2("active"), s2.addEventListener("scroll", function() {
clearTimeout(K2), K2 = setTimeout(function() {
G2 = false;
}, 100);
}, false);
}), Jo(function() {
p2 || n2(1, p2 = []), p2 !== r2 && p2.length > 0 && n2(2, _2 = 0), r2 = p2;
});
return e18.$$set = function(e19) {
"container" in e19 && n2(0, s2 = e19.container), "VirtualList" in e19 && n2(3, c2 = e19.VirtualList), "Item" in e19 && n2(4, f2 = e19.Item), "isVirtualList" in e19 && n2(5, d2 = e19.isVirtualList), "items" in e19 && n2(1, p2 = e19.items), "labelIdentifier" in e19 && n2(20, g2 = e19.labelIdentifier), "getOptionLabel" in e19 && n2(6, b2 = e19.getOptionLabel), "getGroupHeaderLabel" in e19 && n2(7, w2 = e19.getGroupHeaderLabel), "itemHeight" in e19 && n2(8, x2 = e19.itemHeight), "hoverItemIndex" in e19 && n2(2, _2 = e19.hoverItemIndex), "value" in e19 && n2(9, $2 = e19.value), "optionIdentifier" in e19 && n2(10, M2 = e19.optionIdentifier), "hideEmptyState" in e19 && n2(11, P2 = e19.hideEmptyState), "noOptionsMessage" in e19 && n2(12, T2 = e19.noOptionsMessage), "isMulti" in e19 && n2(21, N2 = e19.isMulti), "activeItemIndex" in e19 && n2(19, D2 = e19.activeItemIndex), "filterText" in e19 && n2(13, z2 = e19.filterText), "parent" in e19 && n2(22, q2 = e19.parent), "listPlacement" in e19 && n2(23, V2 = e19.listPlacement), "listAutoWidth" in e19 && n2(24, H2 = e19.listAutoWidth), "listOffset" in e19 && n2(25, U2 = e19.listOffset);
}, e18.$$.update = function() {
4194305 & e18.$$.dirty[0] && q2 && s2 && re2();
}, [s2, p2, _2, c2, f2, d2, b2, w2, x2, $2, M2, P2, T2, z2, i2, Y2, Z2, function(e19) {
switch (e19.key) {
case "Escape":
e19.preventDefault(), X2();
break;
case "ArrowDown":
e19.preventDefault(), p2.length && ee2(1);
break;
case "ArrowUp":
e19.preventDefault(), p2.length && ee2(-1);
break;
case "Enter":
if (e19.preventDefault(), 0 === p2.length)
break;
var t3 = p2[_2];
if ($2 && !N2 && $2[M2] === t3[M2]) {
X2();
break;
}
t3.isCreator ? o2("itemCreated", z2) : (n2(19, D2 = _2), Q2(p2[_2]));
break;
case "Tab":
if (e19.preventDefault(), 0 === p2.length)
return X2();
if ($2 && $2[M2] === p2[_2][M2])
return X2();
n2(19, D2 = _2), Q2(p2[_2]);
}
}, re2, D2, g2, N2, q2, V2, H2, U2, function(e19) {
return Y2(e19);
}, function(e19) {
return Y2(e19);
}, function(e19, t3, n3) {
return Z2({ item: e19, i: t3, event: n3 });
}, function(e19) {
return Y2(e19);
}, function(e19) {
return Y2(e19);
}, function(e19, t3, n3) {
return Z2({ item: e19, i: t3, event: n3 });
}, function(e19) {
Xo[e19 ? "unshift" : "push"](function() {
n2(0, s2 = e19);
});
}];
}
var MJ = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, OJ, xJ, Ui, { container: 0, VirtualList: 3, Item: 4, isVirtualList: 5, items: 1, labelIdentifier: 20, getOptionLabel: 6, getGroupHeaderLabel: 7, itemHeight: 8, hoverItemIndex: 2, value: 9, optionIdentifier: 10, hideEmptyState: 11, noOptionsMessage: 12, isMulti: 21, activeItemIndex: 19, filterText: 13, parent: 22, listPlacement: 23, listAutoWidth: 24, listOffset: 25 }, dJ, [-1, -1]), r2;
}
return Li(n2);
}();
function EJ(e18) {
co(e18, "svelte-pu1q1n", ".selection.svelte-pu1q1n{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}");
}
function PJ(e18) {
var t2, n2 = e18[0](e18[1]) + "";
return { c: function() {
So(t2 = go("div"), "class", "selection svelte-pu1q1n");
}, m: function(e19, r2) {
vo(e19, t2, r2), t2.innerHTML = n2;
}, p: function(e19, r2) {
3 & ki(r2, 1)[0] && n2 !== (n2 = e19[0](e19[1]) + "") && (t2.innerHTML = n2);
}, i: Bi, o: Bi, d: function(e19) {
e19 && po(t2);
} };
}
function AJ(e18, t2, n2) {
var r2 = t2.getSelectionLabel, i2 = void 0 === r2 ? void 0 : r2, o2 = t2.item, a2 = void 0 === o2 ? void 0 : o2;
return e18.$$set = function(e19) {
"getSelectionLabel" in e19 && n2(0, i2 = e19.getSelectionLabel), "item" in e19 && n2(1, a2 = e19.item);
}, [i2, a2];
}
var TJ = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, AJ, PJ, Ui, { getSelectionLabel: 0, item: 1 }, EJ), r2;
}
return Li(n2);
}();
function IJ(e18) {
co(e18, "svelte-liu9pa", ".multiSelectItem.svelte-liu9pa.svelte-liu9pa{background:var(--multiItemBG, #ebedef);margin:var(--multiItemMargin, 5px 5px 0 0);border-radius:var(--multiItemBorderRadius, 16px);height:var(--multiItemHeight, 32px);line-height:var(--multiItemHeight, 32px);display:flex;cursor:default;padding:var(--multiItemPadding, 0 10px 0 15px);max-width:100%}.multiSelectItem_label.svelte-liu9pa.svelte-liu9pa{margin:var(--multiLabelMargin, 0 5px 0 0);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multiSelectItem.svelte-liu9pa.svelte-liu9pa:hover,.multiSelectItem.active.svelte-liu9pa.svelte-liu9pa{background-color:var(--multiItemActiveBG, #006fff);color:var(--multiItemActiveColor, #fff)}.multiSelectItem.disabled.svelte-liu9pa.svelte-liu9pa:hover{background:var(--multiItemDisabledHoverBg, #ebedef);color:var(--multiItemDisabledHoverColor, #c1c6cc)}.multiSelectItem_clear.svelte-liu9pa.svelte-liu9pa{border-radius:var(--multiClearRadius, 50%);background:var(--multiClearBG, #52616f);min-width:var(--multiClearWidth, 16px);max-width:var(--multiClearWidth, 16px);height:var(--multiClearHeight, 16px);position:relative;top:var(--multiClearTop, 8px);text-align:var(--multiClearTextAlign, center);padding:var(--multiClearPadding, 1px)}.multiSelectItem_clear.svelte-liu9pa.svelte-liu9pa:hover,.active.svelte-liu9pa .multiSelectItem_clear.svelte-liu9pa{background:var(--multiClearHoverBG, #fff)}.multiSelectItem_clear.svelte-liu9pa:hover svg.svelte-liu9pa,.active.svelte-liu9pa .multiSelectItem_clear svg.svelte-liu9pa{fill:var(--multiClearHoverFill, #006fff)}.multiSelectItem_clear.svelte-liu9pa svg.svelte-liu9pa{fill:var(--multiClearFill, #ebedef);vertical-align:top}");
}
function NJ(e18, t2, n2) {
var r2 = e18.slice();
return r2[9] = t2[n2], r2[11] = n2, r2;
}
function RJ(e18) {
var t2, n2, r2;
function i2() {
for (var t3, n3 = arguments.length, r3 = new Array(n3), i3 = 0; i3 < n3; i3++)
r3[i3] = arguments[i3];
return (t3 = e18)[6].apply(t3, [e18[11]].concat(r3));
}
return { c: function() {
(t2 = go("div")).innerHTML = '', So(t2, "class", "multiSelectItem_clear svelte-liu9pa");
}, m: function(e19, o2) {
vo(e19, t2, o2), n2 || (r2 = jo(t2, "click", i2), n2 = true);
}, p: function(t3, n3) {
e18 = t3;
}, d: function(e19) {
e19 && po(t2), n2 = false, r2();
} };
}
function DJ(e18) {
var t2, n2, r2, i2, o2, a2, s2, u2 = e18[4](e18[9]) + "", c2 = !e18[2] && !e18[3] && RJ(e18);
function l2() {
for (var t3, n3 = arguments.length, r3 = new Array(n3), i3 = 0; i3 < n3; i3++)
r3[i3] = arguments[i3];
return (t3 = e18)[7].apply(t3, [e18[11]].concat(r3));
}
return { c: function() {
t2 = go("div"), n2 = go("div"), r2 = ko(), c2 && c2.c(), i2 = ko(), So(n2, "class", "multiSelectItem_label svelte-liu9pa"), So(t2, "class", o2 = "multiSelectItem " + (e18[1] === e18[11] ? "active" : "") + " " + (e18[2] ? "disabled" : "") + " svelte-liu9pa");
}, m: function(e19, o3) {
vo(e19, t2, o3), uo(t2, n2), n2.innerHTML = u2, uo(t2, r2), c2 && c2.m(t2, null), uo(t2, i2), a2 || (s2 = jo(t2, "click", l2), a2 = true);
}, p: function(r3, a3) {
e18 = r3, 17 & a3 && u2 !== (u2 = e18[4](e18[9]) + "") && (n2.innerHTML = u2), e18[2] || e18[3] ? c2 && (c2.d(1), c2 = null) : c2 ? c2.p(e18, a3) : ((c2 = RJ(e18)).c(), c2.m(t2, i2)), 6 & a3 && o2 !== (o2 = "multiSelectItem " + (e18[1] === e18[11] ? "active" : "") + " " + (e18[2] ? "disabled" : "") + " svelte-liu9pa") && So(t2, "class", o2);
}, d: function(e19) {
e19 && po(t2), c2 && c2.d(), a2 = false, s2();
} };
}
function LJ(e18) {
for (var t2, n2 = e18[0], r2 = [], i2 = 0; i2 < n2.length; i2 += 1)
r2[i2] = DJ(NJ(e18, n2, i2));
return { c: function() {
for (var e19 = 0; e19 < r2.length; e19 += 1)
r2[e19].c();
t2 = wo();
}, m: function(e19, n3) {
for (var i3 = 0; i3 < r2.length; i3 += 1)
r2[i3].m(e19, n3);
vo(e19, t2, n3);
}, p: function(e19, i3) {
var o2 = ki(i3, 1)[0];
if (63 & o2) {
var a2;
for (n2 = e19[0], a2 = 0; a2 < n2.length; a2 += 1) {
var s2 = NJ(e19, n2, a2);
r2[a2] ? r2[a2].p(s2, o2) : (r2[a2] = DJ(s2), r2[a2].c(), r2[a2].m(t2.parentNode, t2));
}
for (; a2 < r2.length; a2 += 1)
r2[a2].d(1);
r2.length = n2.length;
}
}, i: Bi, o: Bi, d: function(e19) {
mo(r2, e19), e19 && po(t2);
} };
}
function zJ(e18, t2, n2) {
var r2 = Go(), i2 = t2.value, o2 = void 0 === i2 ? [] : i2, a2 = t2.activeValue, s2 = void 0 === a2 ? void 0 : a2, u2 = t2.isDisabled, c2 = void 0 !== u2 && u2, l2 = t2.multiFullItemClearable, f2 = void 0 !== l2 && l2, h2 = t2.getSelectionLabel, d2 = void 0 === h2 ? void 0 : h2;
function v2(e19, t3) {
t3.stopPropagation(), r2("multiItemClear", { i: e19 });
}
return e18.$$set = function(e19) {
"value" in e19 && n2(0, o2 = e19.value), "activeValue" in e19 && n2(1, s2 = e19.activeValue), "isDisabled" in e19 && n2(2, c2 = e19.isDisabled), "multiFullItemClearable" in e19 && n2(3, f2 = e19.multiFullItemClearable), "getSelectionLabel" in e19 && n2(4, d2 = e19.getSelectionLabel);
}, [o2, s2, c2, f2, d2, v2, function(e19, t3) {
return v2(e19, t3);
}, function(e19, t3) {
return f2 ? v2(e19, t3) : {};
}];
}
var BJ = function(e18) {
Ci(n2, Ia);
var t2 = Oi(n2);
function n2(e19) {
var r2;
return Ri(this, n2), Ta(Ei(r2 = t2.call(this)), e19, zJ, LJ, Ui, { value: 0, activeValue: 1, isDisabled: 2, multiFullItemClearable: 3, getSelectionLabel: 4 }, IJ), r2;
}
return Li(n2);
}();
function qJ(e18) {
co(e18, "svelte-g2cagw", "svelte-virtual-list-viewport.svelte-g2cagw{position:relative;overflow-y:auto;-webkit-overflow-scrolling:touch;display:block}svelte-virtual-list-contents.svelte-g2cagw,svelte-virtual-list-row.svelte-g2cagw{display:block}svelte-virtual-list-row.svelte-g2cagw{overflow:hidden}");
}
function FJ(e18, t2, n2) {
var r2 = e18.slice();
return r2[23] = t2[n2], r2;
}
var VJ = function(e18) {
return { item: 32 & e18, i: 32 & e18, hoverItemIndex: 2 & e18 };
}, WJ = function(e18) {
return { item: e18[23].data, i: e18[23].index, hoverItemIndex: e18[1] };
};
function HJ(e18, t2) {
var n2, r2, i2, o2 = t2[15].default, a2 = Gi(o2, t2, t2[14], WJ), s2 = a2 || function(e19) {
var t3;
return { c: function() {
t3 = bo("Missing template");
}, m: function(e20, n3) {
vo(e20, t3, n3);
}, d: function(e20) {
e20 && po(t3);
} };
}();
return { key: e18, first: null, c: function() {
n2 = go("svelte-virtual-list-row"), s2 && s2.c(), r2 = ko(), $o(n2, "class", "svelte-g2cagw"), this.first = n2;
}, m: function(e19, t3) {
vo(e19, n2, t3), s2 && s2.m(n2, null), uo(n2, r2), i2 = true;
}, p: function(e19, n3) {
t2 = e19, a2 && a2.p && (!i2 || 16418 & n3) && Zi(a2, o2, t2, t2[14], i2 ? Yi(o2, t2[14], n3, VJ) : Xi(t2[14]), WJ);
}, i: function(e19) {
i2 || (ya(s2, e19), i2 = true);
}, o: function(e19) {
ba(s2, e19), i2 = false;
}, d: function(e19) {
e19 && po(n2), s2 && s2.d(e19);
} };
}
function JJ(e18) {
for (var t2, n2, r2, i2, o2, a2, s2 = [], u2 = /* @__PURE__ */ new Map(), c2 = e18[5], l2 = function(e19) {
return e19[23].index;
}, f2 = 0; f2 < c2.length; f2 += 1) {
var h2 = FJ(e18, c2, f2), d2 = l2(h2);
u2.set(d2, s2[f2] = HJ(d2, h2));
}
return { c: function() {
t2 = go("svelte-virtual-list-viewport"), n2 = go("svelte-virtual-list-contents");
for (var r3 = 0; r3 < s2.length; r3 += 1)
s2[r3].c();
Po(n2, "padding-top", e18[6] + "px"), Po(n2, "padding-bottom", e18[7] + "px"), $o(n2, "class", "svelte-g2cagw"), Po(t2, "height", e18[0]), $o(t2, "class", "svelte-g2cagw"), aa(function() {
return e18[18].call(t2);
});
}, m: function(u3, c3) {
vo(u3, t2, c3), uo(t2, n2);
for (var l3 = 0; l3 < s2.length; l3 += 1)
s2[l3].m(n2, null);
e18[16](n2), e18[17](t2), r2 = function(e19, t3) {
"static" === getComputedStyle(e19).position && (e19.style.position = "relative");
var n3 = go("iframe");
n3.setAttribute("style", "display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"), n3.setAttribute("aria-hidden", "true"), n3.tabIndex = -1;
var r3, i3 = To();
return i3 ? (n3.src = "data:text/html,