@jbrowse/cli 4.1.13 → 4.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +15 -15
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/bundle/index.js
CHANGED
|
@@ -50,7 +50,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
50
50
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
51
51
|
|
|
52
52
|
"use strict";
|
|
53
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexGff3: () => (/* binding */ indexGff3)\n/* harmony export */ });\n/* harmony import */ var _util_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util.ts */ \"../../packages/text-indexing-core/src/util.ts\");\n/* harmony import */ var _common_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common.ts */ \"../../packages/text-indexing-core/src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var r, t; function resume(r, t) { try { var n = e[r](t), o = n.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (t) { if (u) { var i = \"return\" === r ? \"return\" : \"next\"; if (!o.k || t.done) return resume(i, t); t = e[i](t).value; } settle(n.done ? \"return\" : \"normal\", t); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(\"throw\", e); } } function settle(e, n) { switch (e) { case \"return\": r.resolve({ value: n, done: !0 }); break; case \"throw\": r.reject(n); break; default: r.resolve({ value: n, done: !1 }); } (r = r.next) ? resume(r.key, r.arg) : t = null; } this._invoke = function (e, n) { return new Promise(function (o, u) { var i = { key: e, arg: n, resolve: o, reject: u, next: null }; t ? t = t.next = i : (r = t = i, resume(e, n)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\nfunction indexGff3(_x) {\n return _indexGff.apply(this, arguments);\n}\nfunction _indexGff() {\n _indexGff = _wrapAsyncGenerator(function (_ref) {\n var config = _ref.config,\n attributesToIndex = _ref.attributesToIndex,\n inLocation = _ref.inLocation,\n outDir = _ref.outDir,\n featureTypesToExclude = _ref.featureTypesToExclude,\n onStart = _ref.onStart,\n onUpdate = _ref.onUpdate;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var trackId, stream, rl, excludeSet, encodedTrackId, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _ret, _iterator, _step, _t;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n trackId = config.trackId;\n _context2.n = 1;\n return _awaitAsyncGenerator((0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.getLocalOrRemoteStream)({\n file: inLocation,\n out: outDir,\n onStart: onStart,\n onUpdate: onUpdate\n }));\n case 1:\n stream = _context2.v;\n rl = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.createReadlineInterface)(stream, inLocation);\n excludeSet = new Set(featureTypesToExclude);\n encodedTrackId = encodeURIComponent(trackId);\n _iteratorAbruptCompletion = false;\n _didIteratorError = false;\n _context2.p = 2;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var line, _line$split, _line$split2, seq_id, type, start, end, col9, col9attrs, attrs, locStr, encodedAttrs, record, uniqueAttrs;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n line = _step.value;\n if (line.trim()) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 0);\n case 1:\n if (!line.startsWith('#')) {\n _context.n = 2;\n break;\n }\n return _context.a(2, 0);\n case 2:\n if (!line.startsWith('>')) {\n _context.n = 3;\n break;\n }\n return _context.a(2, 1);\n case 3:\n _line$split = line.split('\\t'), _line$split2 = _slicedToArray(_line$split, 9), seq_id = _line$split2[0], type = _line$split2[2], start = _line$split2[3], end = _line$split2[4], col9 = _line$split2[8];\n if (excludeSet.has(type)) {\n _context.n = 4;\n break;\n }\n col9attrs = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.parseAttributes)(col9, _util_ts__WEBPACK_IMPORTED_MODULE_0__.decodeURIComponentNoThrow);\n attrs = attributesToIndex.map(function (attr) {\n return col9attrs[attr];\n }).filter(function (f) {\n return !!f;\n });\n if (!(attrs.length > 0)) {\n _context.n = 4;\n break;\n }\n locStr = \"\".concat(seq_id, \":\").concat(start, \"..\").concat(end);\n encodedAttrs = attrs.map(function (a) {\n return \"\\\"\".concat(encodeURIComponent(a), \"\\\"\");\n });\n record = \"[\\\"\".concat(encodeURIComponent(locStr), \"\\\"|\\\"\").concat(encodedTrackId, \"\\\"|\").concat(encodedAttrs.join('|'), \"]\");\n uniqueAttrs = _toConsumableArray(new Set(attrs));\n _context.n = 4;\n return \"\".concat(record, \" \").concat(uniqueAttrs.join(' '), \"\\n\");\n case 4:\n return _context.a(2);\n }\n }, _loop);\n });\n _iterator = _asyncIterator(rl);\n case 3:\n _context2.n = 4;\n return _awaitAsyncGenerator(_iterator.next());\n case 4:\n if (!(_iteratorAbruptCompletion = !(_step = _context2.v).done)) {\n _context2.n = 8;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 5);\n case 5:\n _ret = _context2.v;\n if (!(_ret === 0)) {\n _context2.n = 6;\n break;\n }\n return _context2.a(3, 7);\n case 6:\n if (!(_ret === 1)) {\n _context2.n = 7;\n break;\n }\n return _context2.a(3, 8);\n case 7:\n _iteratorAbruptCompletion = false;\n _context2.n = 3;\n break;\n case 8:\n _context2.n = 10;\n break;\n case 9:\n _context2.p = 9;\n _t = _context2.v;\n _didIteratorError = true;\n _iteratorError = _t;\n case 10:\n _context2.p = 10;\n _context2.p = 11;\n if (!(_iteratorAbruptCompletion && _iterator[\"return\"] != null)) {\n _context2.n = 12;\n break;\n }\n _context2.n = 12;\n return _awaitAsyncGenerator(_iterator[\"return\"]());\n case 12:\n _context2.p = 12;\n if (!_didIteratorError) {\n _context2.n = 13;\n break;\n }\n throw _iteratorError;\n case 13:\n return _context2.f(12);\n case 14:\n return _context2.f(10);\n case 15:\n return _context2.a(2);\n }\n }, _callee, null, [[11,, 12, 14], [2, 9, 10, 15]]);\n })();\n });\n return _indexGff.apply(this, arguments);\n}\n\n//# sourceURL=webpack://@jbrowse/cli/../../packages/text-indexing-core/src/types/gff3Adapter.ts?\n}");
|
|
53
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexGff3: () => (/* binding */ indexGff3)\n/* harmony export */ });\n/* harmony import */ var _util_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util.ts */ \"../../packages/text-indexing-core/src/util.ts\");\n/* harmony import */ var _common_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common.ts */ \"../../packages/text-indexing-core/src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var t, n; function resume(t, n) { try { var r = e[t](n), o = r.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (n) { if (u) { var i = \"return\" === t && o.k ? t : \"next\"; if (!o.k || n.done) return resume(i, n); n = e[i](n).value; } settle(!!r.done, n); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(2, e); } } function settle(e, r) { 2 === e ? t.reject(r) : t.resolve({ value: r, done: e }), (t = t.next) ? resume(t.key, t.arg) : n = null; } this._invoke = function (e, r) { return new Promise(function (o, u) { var i = { key: e, arg: r, resolve: o, reject: u, next: null }; n ? n = n.next = i : (t = n = i, resume(e, r)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\nfunction indexGff3(_x) {\n return _indexGff.apply(this, arguments);\n}\nfunction _indexGff() {\n _indexGff = _wrapAsyncGenerator(function (_ref) {\n var config = _ref.config,\n attributesToIndex = _ref.attributesToIndex,\n inLocation = _ref.inLocation,\n outDir = _ref.outDir,\n featureTypesToExclude = _ref.featureTypesToExclude,\n onStart = _ref.onStart,\n onUpdate = _ref.onUpdate;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var trackId, stream, rl, excludeSet, encodedTrackId, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _ret, _iterator, _step, _t;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n trackId = config.trackId;\n _context2.n = 1;\n return _awaitAsyncGenerator((0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.getLocalOrRemoteStream)({\n file: inLocation,\n out: outDir,\n onStart: onStart,\n onUpdate: onUpdate\n }));\n case 1:\n stream = _context2.v;\n rl = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.createReadlineInterface)(stream, inLocation);\n excludeSet = new Set(featureTypesToExclude);\n encodedTrackId = encodeURIComponent(trackId);\n _iteratorAbruptCompletion = false;\n _didIteratorError = false;\n _context2.p = 2;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var line, _line$split, _line$split2, seq_id, type, start, end, col9, col9attrs, attrs, locStr, encodedAttrs, record, uniqueAttrs;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n line = _step.value;\n if (line.trim()) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 0);\n case 1:\n if (!line.startsWith('#')) {\n _context.n = 2;\n break;\n }\n return _context.a(2, 0);\n case 2:\n if (!line.startsWith('>')) {\n _context.n = 3;\n break;\n }\n return _context.a(2, 1);\n case 3:\n _line$split = line.split('\\t'), _line$split2 = _slicedToArray(_line$split, 9), seq_id = _line$split2[0], type = _line$split2[2], start = _line$split2[3], end = _line$split2[4], col9 = _line$split2[8];\n if (excludeSet.has(type)) {\n _context.n = 4;\n break;\n }\n col9attrs = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.parseAttributes)(col9, _util_ts__WEBPACK_IMPORTED_MODULE_0__.decodeURIComponentNoThrow);\n attrs = attributesToIndex.map(function (attr) {\n return col9attrs[attr];\n }).filter(function (f) {\n return !!f;\n });\n if (!(attrs.length > 0)) {\n _context.n = 4;\n break;\n }\n locStr = \"\".concat(seq_id, \":\").concat(start, \"..\").concat(end);\n encodedAttrs = attrs.map(function (a) {\n return \"\\\"\".concat(encodeURIComponent(a), \"\\\"\");\n });\n record = \"[\\\"\".concat(encodeURIComponent(locStr), \"\\\"|\\\"\").concat(encodedTrackId, \"\\\"|\").concat(encodedAttrs.join('|'), \"]\");\n uniqueAttrs = _toConsumableArray(new Set(attrs));\n _context.n = 4;\n return \"\".concat(record, \" \").concat(uniqueAttrs.join(' '), \"\\n\");\n case 4:\n return _context.a(2);\n }\n }, _loop);\n });\n _iterator = _asyncIterator(rl);\n case 3:\n _context2.n = 4;\n return _awaitAsyncGenerator(_iterator.next());\n case 4:\n if (!(_iteratorAbruptCompletion = !(_step = _context2.v).done)) {\n _context2.n = 8;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 5);\n case 5:\n _ret = _context2.v;\n if (!(_ret === 0)) {\n _context2.n = 6;\n break;\n }\n return _context2.a(3, 7);\n case 6:\n if (!(_ret === 1)) {\n _context2.n = 7;\n break;\n }\n return _context2.a(3, 8);\n case 7:\n _iteratorAbruptCompletion = false;\n _context2.n = 3;\n break;\n case 8:\n _context2.n = 10;\n break;\n case 9:\n _context2.p = 9;\n _t = _context2.v;\n _didIteratorError = true;\n _iteratorError = _t;\n case 10:\n _context2.p = 10;\n _context2.p = 11;\n if (!(_iteratorAbruptCompletion && _iterator[\"return\"] != null)) {\n _context2.n = 12;\n break;\n }\n _context2.n = 12;\n return _awaitAsyncGenerator(_iterator[\"return\"]());\n case 12:\n _context2.p = 12;\n if (!_didIteratorError) {\n _context2.n = 13;\n break;\n }\n throw _iteratorError;\n case 13:\n return _context2.f(12);\n case 14:\n return _context2.f(10);\n case 15:\n return _context2.a(2);\n }\n }, _callee, null, [[11,, 12, 14], [2, 9, 10, 15]]);\n })();\n });\n return _indexGff.apply(this, arguments);\n}\n\n//# sourceURL=webpack://@jbrowse/cli/../../packages/text-indexing-core/src/types/gff3Adapter.ts?\n}");
|
|
54
54
|
|
|
55
55
|
/***/ },
|
|
56
56
|
|
|
@@ -61,7 +61,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
61
61
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
62
62
|
|
|
63
63
|
"use strict";
|
|
64
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexVcf: () => (/* binding */ indexVcf)\n/* harmony export */ });\n/* harmony import */ var _util_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util.ts */ \"../../packages/text-indexing-core/src/util.ts\");\n/* harmony import */ var _common_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common.ts */ \"../../packages/text-indexing-core/src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var r, t; function resume(r, t) { try { var n = e[r](t), o = n.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (t) { if (u) { var i = \"return\" === r ? \"return\" : \"next\"; if (!o.k || t.done) return resume(i, t); t = e[i](t).value; } settle(n.done ? \"return\" : \"normal\", t); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(\"throw\", e); } } function settle(e, n) { switch (e) { case \"return\": r.resolve({ value: n, done: !0 }); break; case \"throw\": r.reject(n); break; default: r.resolve({ value: n, done: !1 }); } (r = r.next) ? resume(r.key, r.arg) : t = null; } this._invoke = function (e, n) { return new Promise(function (o, u) { var i = { key: e, arg: n, resolve: o, reject: u, next: null }; t ? t = t.next = i : (r = t = i, resume(e, n)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\nfunction indexVcf(_x) {\n return _indexVcf.apply(this, arguments);\n}\nfunction _indexVcf() {\n _indexVcf = _wrapAsyncGenerator(function (_ref2) {\n var config = _ref2.config,\n attributesToIndex = _ref2.attributesToIndex,\n inLocation = _ref2.inLocation,\n outDir = _ref2.outDir,\n onStart = _ref2.onStart,\n onUpdate = _ref2.onUpdate;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var trackId, stream, rl, encodedTrackId, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _ret, _iterator, _step, _t2;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n trackId = config.trackId;\n _context2.n = 1;\n return _awaitAsyncGenerator((0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.getLocalOrRemoteStream)({\n file: inLocation,\n out: outDir,\n onStart: onStart,\n onUpdate: onUpdate\n }));\n case 1:\n stream = _context2.v;\n rl = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.createReadlineInterface)(stream, inLocation);\n encodedTrackId = encodeURIComponent(trackId);\n _iteratorAbruptCompletion = false;\n _didIteratorError = false;\n _context2.p = 2;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var line, _line$split, _line$split2, ref, pos, id, _ref, _alt, _qual, _filter, info, fields, end, locStr, encodedLocStr, infoAttrs, encodedInfoAttrs, _iterator2, _step2, variantId, encodedId, record, _t;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.p = _context.n) {\n case 0:\n line = _step.value;\n if (!line.startsWith('#')) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 0);\n case 1:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _line$split = line.split('\\t'), _line$split2 = _slicedToArray(_line$split, 8), ref = _line$split2[0], pos = _line$split2[1], id = _line$split2[2], _ref = _line$split2[3], _alt = _line$split2[4], _qual = _line$split2[5], _filter = _line$split2[6], info = _line$split2[7];\n if (!(id === '.')) {\n _context.n = 2;\n break;\n }\n return _context.a(2, 0);\n case 2:\n fields = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.parseAttributes)(info, _util_ts__WEBPACK_IMPORTED_MODULE_0__.decodeURIComponentNoThrow);\n end = fields.END;\n locStr = \"\".concat(ref, \":\").concat(pos, \"..\").concat(end || +pos + 1);\n encodedLocStr = encodeURIComponent(locStr);\n infoAttrs = attributesToIndex.map(function (attr) {\n return fields[attr];\n }).filter(function (f) {\n return !!f;\n });\n encodedInfoAttrs = infoAttrs.map(function (a) {\n return \"\\\"\".concat(encodeURIComponent(a), \"\\\"\");\n });\n _iterator2 = _createForOfIteratorHelper(id.split(','));\n _context.p = 3;\n _iterator2.s();\n case 4:\n if ((_step2 = _iterator2.n()).done) {\n _context.n = 6;\n break;\n }\n variantId = _step2.value;\n encodedId = encodeURIComponent(variantId);\n record = \"[\\\"\".concat(encodedLocStr, \"\\\"|\\\"\").concat(encodedTrackId, \"\\\"|\\\"\").concat(encodedId, \"\\\"\").concat(encodedInfoAttrs.length > 0 ? \"|\".concat(encodedInfoAttrs.join('|')) : '', \"]\");\n _context.n = 5;\n return \"\".concat(record, \" \").concat(variantId, \"\\n\");\n case 5:\n _context.n = 4;\n break;\n case 6:\n _context.n = 8;\n break;\n case 7:\n _context.p = 7;\n _t = _context.v;\n _iterator2.e(_t);\n case 8:\n _context.p = 8;\n _iterator2.f();\n return _context.f(8);\n case 9:\n return _context.a(2);\n }\n }, _loop, null, [[3, 7, 8, 9]]);\n });\n _iterator = _asyncIterator(rl);\n case 3:\n _context2.n = 4;\n return _awaitAsyncGenerator(_iterator.next());\n case 4:\n if (!(_iteratorAbruptCompletion = !(_step = _context2.v).done)) {\n _context2.n = 7;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 5);\n case 5:\n _ret = _context2.v;\n if (!(_ret === 0)) {\n _context2.n = 6;\n break;\n }\n return _context2.a(3, 6);\n case 6:\n _iteratorAbruptCompletion = false;\n _context2.n = 3;\n break;\n case 7:\n _context2.n = 9;\n break;\n case 8:\n _context2.p = 8;\n _t2 = _context2.v;\n _didIteratorError = true;\n _iteratorError = _t2;\n case 9:\n _context2.p = 9;\n _context2.p = 10;\n if (!(_iteratorAbruptCompletion && _iterator[\"return\"] != null)) {\n _context2.n = 11;\n break;\n }\n _context2.n = 11;\n return _awaitAsyncGenerator(_iterator[\"return\"]());\n case 11:\n _context2.p = 11;\n if (!_didIteratorError) {\n _context2.n = 12;\n break;\n }\n throw _iteratorError;\n case 12:\n return _context2.f(11);\n case 13:\n return _context2.f(9);\n case 14:\n return _context2.a(2);\n }\n }, _callee, null, [[10,, 11, 13], [2, 8, 9, 14]]);\n })();\n });\n return _indexVcf.apply(this, arguments);\n}\n\n//# sourceURL=webpack://@jbrowse/cli/../../packages/text-indexing-core/src/types/vcfAdapter.ts?\n}");
|
|
64
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexVcf: () => (/* binding */ indexVcf)\n/* harmony export */ });\n/* harmony import */ var _util_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util.ts */ \"../../packages/text-indexing-core/src/util.ts\");\n/* harmony import */ var _common_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common.ts */ \"../../packages/text-indexing-core/src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var t, n; function resume(t, n) { try { var r = e[t](n), o = r.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (n) { if (u) { var i = \"return\" === t && o.k ? t : \"next\"; if (!o.k || n.done) return resume(i, n); n = e[i](n).value; } settle(!!r.done, n); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(2, e); } } function settle(e, r) { 2 === e ? t.reject(r) : t.resolve({ value: r, done: e }), (t = t.next) ? resume(t.key, t.arg) : n = null; } this._invoke = function (e, r) { return new Promise(function (o, u) { var i = { key: e, arg: r, resolve: o, reject: u, next: null }; n ? n = n.next = i : (t = n = i, resume(e, r)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\nfunction indexVcf(_x) {\n return _indexVcf.apply(this, arguments);\n}\nfunction _indexVcf() {\n _indexVcf = _wrapAsyncGenerator(function (_ref2) {\n var config = _ref2.config,\n attributesToIndex = _ref2.attributesToIndex,\n inLocation = _ref2.inLocation,\n outDir = _ref2.outDir,\n onStart = _ref2.onStart,\n onUpdate = _ref2.onUpdate;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var trackId, stream, rl, encodedTrackId, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _ret, _iterator, _step, _t2;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n trackId = config.trackId;\n _context2.n = 1;\n return _awaitAsyncGenerator((0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.getLocalOrRemoteStream)({\n file: inLocation,\n out: outDir,\n onStart: onStart,\n onUpdate: onUpdate\n }));\n case 1:\n stream = _context2.v;\n rl = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.createReadlineInterface)(stream, inLocation);\n encodedTrackId = encodeURIComponent(trackId);\n _iteratorAbruptCompletion = false;\n _didIteratorError = false;\n _context2.p = 2;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var line, _line$split, _line$split2, ref, pos, id, _ref, _alt, _qual, _filter, info, fields, end, locStr, encodedLocStr, infoAttrs, encodedInfoAttrs, _iterator2, _step2, variantId, encodedId, record, _t;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.p = _context.n) {\n case 0:\n line = _step.value;\n if (!line.startsWith('#')) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 0);\n case 1:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _line$split = line.split('\\t'), _line$split2 = _slicedToArray(_line$split, 8), ref = _line$split2[0], pos = _line$split2[1], id = _line$split2[2], _ref = _line$split2[3], _alt = _line$split2[4], _qual = _line$split2[5], _filter = _line$split2[6], info = _line$split2[7];\n if (!(id === '.')) {\n _context.n = 2;\n break;\n }\n return _context.a(2, 0);\n case 2:\n fields = (0,_common_ts__WEBPACK_IMPORTED_MODULE_1__.parseAttributes)(info, _util_ts__WEBPACK_IMPORTED_MODULE_0__.decodeURIComponentNoThrow);\n end = fields.END;\n locStr = \"\".concat(ref, \":\").concat(pos, \"..\").concat(end || +pos + 1);\n encodedLocStr = encodeURIComponent(locStr);\n infoAttrs = attributesToIndex.map(function (attr) {\n return fields[attr];\n }).filter(function (f) {\n return !!f;\n });\n encodedInfoAttrs = infoAttrs.map(function (a) {\n return \"\\\"\".concat(encodeURIComponent(a), \"\\\"\");\n });\n _iterator2 = _createForOfIteratorHelper(id.split(','));\n _context.p = 3;\n _iterator2.s();\n case 4:\n if ((_step2 = _iterator2.n()).done) {\n _context.n = 6;\n break;\n }\n variantId = _step2.value;\n encodedId = encodeURIComponent(variantId);\n record = \"[\\\"\".concat(encodedLocStr, \"\\\"|\\\"\").concat(encodedTrackId, \"\\\"|\\\"\").concat(encodedId, \"\\\"\").concat(encodedInfoAttrs.length > 0 ? \"|\".concat(encodedInfoAttrs.join('|')) : '', \"]\");\n _context.n = 5;\n return \"\".concat(record, \" \").concat(variantId, \"\\n\");\n case 5:\n _context.n = 4;\n break;\n case 6:\n _context.n = 8;\n break;\n case 7:\n _context.p = 7;\n _t = _context.v;\n _iterator2.e(_t);\n case 8:\n _context.p = 8;\n _iterator2.f();\n return _context.f(8);\n case 9:\n return _context.a(2);\n }\n }, _loop, null, [[3, 7, 8, 9]]);\n });\n _iterator = _asyncIterator(rl);\n case 3:\n _context2.n = 4;\n return _awaitAsyncGenerator(_iterator.next());\n case 4:\n if (!(_iteratorAbruptCompletion = !(_step = _context2.v).done)) {\n _context2.n = 7;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 5);\n case 5:\n _ret = _context2.v;\n if (!(_ret === 0)) {\n _context2.n = 6;\n break;\n }\n return _context2.a(3, 6);\n case 6:\n _iteratorAbruptCompletion = false;\n _context2.n = 3;\n break;\n case 7:\n _context2.n = 9;\n break;\n case 8:\n _context2.p = 8;\n _t2 = _context2.v;\n _didIteratorError = true;\n _iteratorError = _t2;\n case 9:\n _context2.p = 9;\n _context2.p = 10;\n if (!(_iteratorAbruptCompletion && _iterator[\"return\"] != null)) {\n _context2.n = 11;\n break;\n }\n _context2.n = 11;\n return _awaitAsyncGenerator(_iterator[\"return\"]());\n case 11:\n _context2.p = 11;\n if (!_didIteratorError) {\n _context2.n = 12;\n break;\n }\n throw _iteratorError;\n case 12:\n return _context2.f(11);\n case 13:\n return _context2.f(9);\n case 14:\n return _context2.a(2);\n }\n }, _callee, null, [[10,, 11, 13], [2, 8, 9, 14]]);\n })();\n });\n return _indexVcf.apply(this, arguments);\n}\n\n//# sourceURL=webpack://@jbrowse/cli/../../packages/text-indexing-core/src/types/vcfAdapter.ts?\n}");
|
|
65
65
|
|
|
66
66
|
/***/ },
|
|
67
67
|
|
|
@@ -435,7 +435,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
435
435
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
436
436
|
|
|
437
437
|
"use strict";
|
|
438
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexDriver: () => (/* binding */ indexDriver),\n/* harmony export */ indexFiles: () => (/* binding */ indexFiles),\n/* harmony export */ prepareFileTrackConfigs: () => (/* binding */ prepareFileTrackConfigs),\n/* harmony export */ runIxIxx: () => (/* binding */ runIxIxx)\n/* harmony export */ });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stream */ \"stream\");\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/common.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/gff3Adapter.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/vcfAdapter.ts\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! cli-progress */ \"../../node_modules/.pnpm/cli-progress@3.12.0/node_modules/cli-progress/cli-progress.js\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(cli_progress__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var ixixx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ixixx */ \"../../node_modules/.pnpm/ixixx@3.0.3/node_modules/ixixx/esm/index.js\");\n/* harmony import */ var _adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./adapter-utils.ts */ \"./src/commands/text-index/adapter-utils.ts\");\n/* harmony import */ var _types_common_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../types/common.ts */ \"./src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var r, t; function resume(r, t) { try { var n = e[r](t), o = n.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (t) { if (u) { var i = \"return\" === r ? \"return\" : \"next\"; if (!o.k || t.done) return resume(i, t); t = e[i](t).value; } settle(n.done ? \"return\" : \"normal\", t); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(\"throw\", e); } } function settle(e, n) { switch (e) { case \"return\": r.resolve({ value: n, done: !0 }); break; case \"throw\": r.reject(n); break; default: r.resolve({ value: n, done: !1 }); } (r = r.next) ? resume(r.key, r.arg) : t = null; } this._invoke = function (e, n) { return new Promise(function (o, u) { var i = { key: e, arg: n, resolve: o, reject: u, next: null }; t ? t = t.next = i : (r = t = i, resume(e, n)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _asyncGeneratorDelegate(t) { var e = {}, n = !1; function pump(e, r) { return n = !0, r = new Promise(function (n) { n(t[e](r)); }), { done: !1, value: new _OverloadYield(r, 1) }; } return e[\"undefined\" != typeof Symbol && Symbol.iterator || \"@@iterator\"] = function () { return this; }, e.next = function (t) { return n ? (n = !1, t) : pump(\"next\", t); }, \"function\" == typeof t[\"throw\"] && (e[\"throw\"] = function (t) { if (n) throw n = !1, t; return pump(\"throw\", t); }), \"function\" == typeof t[\"return\"] && (e[\"return\"] = function (t) { return n ? (n = !1, t) : pump(\"return\", t); }), e; }\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\n\n\n\n\n\nfunction runIxIxx(_x2) {\n return _runIxIxx.apply(this, arguments);\n}\nfunction _runIxIxx() {\n _runIxIxx = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {\n var readStream, outLocation, name, prefixSize, quiet, progressBar, ixPath, ixxPath;\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n readStream = _ref.readStream, outLocation = _ref.outLocation, name = _ref.name, prefixSize = _ref.prefixSize, quiet = _ref.quiet;\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: '{bar} Sorting and writing index...',\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!quiet) {\n progressBar.start(1, 0);\n }\n ixPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ix\"));\n ixxPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ixx\"));\n _context3.n = 1;\n return (0,ixixx__WEBPACK_IMPORTED_MODULE_6__.ixIxxStream)(readStream, ixPath, ixxPath, prefixSize);\n case 1:\n if (!quiet) {\n progressBar.update(1);\n progressBar.stop();\n }\n case 2:\n return _context3.a(2);\n }\n }, _callee2);\n }));\n return _runIxIxx.apply(this, arguments);\n}\nfunction indexFiles(_x) {\n return _indexFiles.apply(this, arguments);\n}\nfunction _indexFiles() {\n _indexFiles = _wrapAsyncGenerator(function (_ref2) {\n var trackConfigs = _ref2.trackConfigs,\n attributes = _ref2.attributes,\n outLocation = _ref2.outLocation,\n quiet = _ref2.quiet,\n typesToExclude = _ref2.typesToExclude;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var _iterator, _step, _loop, _t;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n _iterator = _createForOfIteratorHelper(trackConfigs);\n _context2.p = 1;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var config, adapter, textSearching, trackId, _ref3, type, _ref4, _ref4$indexingFeature, indexingFeatureTypesToExclude, _ref4$indexingAttribu, indexingAttributes, loc, progressBar;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n config = _step.value;\n adapter = config.adapter, textSearching = config.textSearching, trackId = config.trackId;\n _ref3 = adapter || {}, type = _ref3.type;\n _ref4 = textSearching || {}, _ref4$indexingFeature = _ref4.indexingFeatureTypesToExclude, indexingFeatureTypesToExclude = _ref4$indexingFeature === void 0 ? typesToExclude : _ref4$indexingFeature, _ref4$indexingAttribu = _ref4.indexingAttributes, indexingAttributes = _ref4$indexingAttribu === void 0 ? attributes : _ref4$indexingAttribu;\n loc = (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getAdapterLocation)(adapter);\n if (loc) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 1);\n case 1:\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: \"{bar} \".concat(trackId, \" {percentage}% | ETA: {eta}s\"),\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!(type === 'Gff3TabixAdapter' || type === 'Gff3Adapter')) {\n _context.n = 3;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__.indexGff3)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n featureTypesToExclude: indexingFeatureTypesToExclude,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 2);\n case 2:\n _context.n = 4;\n break;\n case 3:\n if (!(type === 'VcfTabixAdapter' || type === 'VcfAdapter')) {\n _context.n = 4;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__.indexVcf)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 4);\n case 4:\n if (!quiet) {\n progressBar.stop();\n }\n case 5:\n return _context.a(2);\n }\n }, _loop);\n });\n _iterator.s();\n case 2:\n if ((_step = _iterator.n()).done) {\n _context2.n = 5;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 3);\n case 3:\n if (!_context2.v) {\n _context2.n = 4;\n break;\n }\n return _context2.a(3, 4);\n case 4:\n _context2.n = 2;\n break;\n case 5:\n _context2.n = 7;\n break;\n case 6:\n _context2.p = 6;\n _t = _context2.v;\n _iterator.e(_t);\n case 7:\n _context2.p = 7;\n _iterator.f();\n return _context2.f(7);\n case 8:\n return _context2.a(2);\n }\n }, _callee, null, [[1, 6, 7, 8]]);\n })();\n });\n return _indexFiles.apply(this, arguments);\n}\nfunction indexDriver(_x3) {\n return _indexDriver.apply(this, arguments);\n}\nfunction _indexDriver() {\n _indexDriver = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {\n var trackConfigs, attributes, outLocation, name, quiet, typesToExclude, assemblyNames, prefixSize, readStream;\n return _regenerator().w(function (_context4) {\n while (1) switch (_context4.n) {\n case 0:\n trackConfigs = _ref5.trackConfigs, attributes = _ref5.attributes, outLocation = _ref5.outLocation, name = _ref5.name, quiet = _ref5.quiet, typesToExclude = _ref5.typesToExclude, assemblyNames = _ref5.assemblyNames, prefixSize = _ref5.prefixSize;\n readStream = stream__WEBPACK_IMPORTED_MODULE_1__.Readable.from(indexFiles({\n trackConfigs: trackConfigs,\n attributes: attributes,\n outLocation: outLocation,\n quiet: quiet,\n typesToExclude: typesToExclude\n }));\n _context4.n = 1;\n return runIxIxx({\n readStream: readStream,\n outLocation: outLocation,\n name: name,\n prefixSize: prefixSize,\n quiet: quiet\n });\n case 1:\n _context4.n = 2;\n return (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.generateMeta)({\n configs: trackConfigs,\n attributesToIndex: attributes,\n outDir: outLocation,\n name: name,\n featureTypesToExclude: typesToExclude,\n assemblyNames: assemblyNames\n });\n case 2:\n return _context4.a(2);\n }\n }, _callee3);\n }));\n return _indexDriver.apply(this, arguments);\n}\nfunction prepareFileTrackConfigs(files, fileIds) {\n return files.map(function (file, i) {\n var config = (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.guessAdapterFromFileName)(file);\n if (fileIds !== null && fileIds !== void 0 && fileIds[i]) {\n config.trackId = fileIds[i];\n }\n return config;\n }).filter(function (fileConfig) {\n var _fileConfig$adapter;\n return (0,_types_common_ts__WEBPACK_IMPORTED_MODULE_8__.supported)((_fileConfig$adapter = fileConfig.adapter) === null || _fileConfig$adapter === void 0 ? void 0 : _fileConfig$adapter.type);\n });\n}\n\n//# sourceURL=webpack://@jbrowse/cli/./src/commands/text-index/indexing-utils.ts?\n}");
|
|
438
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ indexDriver: () => (/* binding */ indexDriver),\n/* harmony export */ indexFiles: () => (/* binding */ indexFiles),\n/* harmony export */ prepareFileTrackConfigs: () => (/* binding */ prepareFileTrackConfigs),\n/* harmony export */ runIxIxx: () => (/* binding */ runIxIxx)\n/* harmony export */ });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stream */ \"stream\");\n/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/common.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/gff3Adapter.ts\");\n/* harmony import */ var _jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jbrowse/text-indexing-core */ \"../../packages/text-indexing-core/src/types/vcfAdapter.ts\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! cli-progress */ \"../../node_modules/.pnpm/cli-progress@3.12.0/node_modules/cli-progress/cli-progress.js\");\n/* harmony import */ var cli_progress__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(cli_progress__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var ixixx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ixixx */ \"../../node_modules/.pnpm/ixixx@3.0.3/node_modules/ixixx/esm/index.js\");\n/* harmony import */ var _adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./adapter-utils.ts */ \"./src/commands/text-index/adapter-utils.ts\");\n/* harmony import */ var _types_common_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../types/common.ts */ \"./src/types/common.ts\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorValues(e) { if (null != e) { var t = e[\"function\" == typeof Symbol && Symbol.iterator || \"@@iterator\"], r = 0; if (t) return t.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + \" is not iterable\"); }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var t, n; function resume(t, n) { try { var r = e[t](n), o = r.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (n) { if (u) { var i = \"return\" === t && o.k ? t : \"next\"; if (!o.k || n.done) return resume(i, n); n = e[i](n).value; } settle(!!r.done, n); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(2, e); } } function settle(e, r) { 2 === e ? t.reject(r) : t.resolve({ value: r, done: e }), (t = t.next) ? resume(t.key, t.arg) : n = null; } this._invoke = function (e, r) { return new Promise(function (o, u) { var i = { key: e, arg: r, resolve: o, reject: u, next: null }; n ? n = n.next = i : (t = n = i, resume(e, r)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _asyncGeneratorDelegate(t) { var e = {}, n = !1; function pump(e, r) { return n = !0, r = new Promise(function (n) { n(t[e](r)); }), { done: !1, value: new _OverloadYield(r, 1) }; } return e[\"undefined\" != typeof Symbol && Symbol.iterator || \"@@iterator\"] = function () { return this; }, e.next = function (t) { return n ? (n = !1, t) : pump(\"next\", t); }, \"function\" == typeof t[\"throw\"] && (e[\"throw\"] = function (t) { if (n) throw n = !1, t; return pump(\"throw\", t); }), \"function\" == typeof t[\"return\"] && (e[\"return\"] = function (t) { return n ? (n = !1, t) : pump(\"return\", t); }), e; }\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\n\n\n\n\n\nfunction runIxIxx(_x2) {\n return _runIxIxx.apply(this, arguments);\n}\nfunction _runIxIxx() {\n _runIxIxx = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {\n var readStream, outLocation, name, prefixSize, quiet, progressBar, ixPath, ixxPath;\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n readStream = _ref.readStream, outLocation = _ref.outLocation, name = _ref.name, prefixSize = _ref.prefixSize, quiet = _ref.quiet;\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: '{bar} Sorting and writing index...',\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!quiet) {\n progressBar.start(1, 0);\n }\n ixPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ix\"));\n ixxPath = path__WEBPACK_IMPORTED_MODULE_0___default().join(outLocation, 'trix', \"\".concat(name, \".ixx\"));\n _context3.n = 1;\n return (0,ixixx__WEBPACK_IMPORTED_MODULE_6__.ixIxxStream)(readStream, ixPath, ixxPath, prefixSize);\n case 1:\n if (!quiet) {\n progressBar.update(1);\n progressBar.stop();\n }\n case 2:\n return _context3.a(2);\n }\n }, _callee2);\n }));\n return _runIxIxx.apply(this, arguments);\n}\nfunction indexFiles(_x) {\n return _indexFiles.apply(this, arguments);\n}\nfunction _indexFiles() {\n _indexFiles = _wrapAsyncGenerator(function (_ref2) {\n var trackConfigs = _ref2.trackConfigs,\n attributes = _ref2.attributes,\n outLocation = _ref2.outLocation,\n quiet = _ref2.quiet,\n typesToExclude = _ref2.typesToExclude;\n return /*#__PURE__*/_regenerator().m(function _callee() {\n var _iterator, _step, _loop, _t;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n _iterator = _createForOfIteratorHelper(trackConfigs);\n _context2.p = 1;\n _loop = /*#__PURE__*/_regenerator().m(function _loop() {\n var config, adapter, textSearching, trackId, _ref3, type, _ref4, _ref4$indexingFeature, indexingFeatureTypesToExclude, _ref4$indexingAttribu, indexingAttributes, loc, progressBar;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n config = _step.value;\n adapter = config.adapter, textSearching = config.textSearching, trackId = config.trackId;\n _ref3 = adapter || {}, type = _ref3.type;\n _ref4 = textSearching || {}, _ref4$indexingFeature = _ref4.indexingFeatureTypesToExclude, indexingFeatureTypesToExclude = _ref4$indexingFeature === void 0 ? typesToExclude : _ref4$indexingFeature, _ref4$indexingAttribu = _ref4.indexingAttributes, indexingAttributes = _ref4$indexingAttribu === void 0 ? attributes : _ref4$indexingAttribu;\n loc = (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getAdapterLocation)(adapter);\n if (loc) {\n _context.n = 1;\n break;\n }\n return _context.a(2, 1);\n case 1:\n progressBar = new cli_progress__WEBPACK_IMPORTED_MODULE_5__.SingleBar({\n format: \"{bar} \".concat(trackId, \" {percentage}% | ETA: {eta}s\"),\n etaBuffer: 2000\n }, cli_progress__WEBPACK_IMPORTED_MODULE_5__.Presets.shades_classic);\n if (!(type === 'Gff3TabixAdapter' || type === 'Gff3Adapter')) {\n _context.n = 3;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_3__.indexGff3)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n featureTypesToExclude: indexingFeatureTypesToExclude,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 2);\n case 2:\n _context.n = 4;\n break;\n case 3:\n if (!(type === 'VcfTabixAdapter' || type === 'VcfAdapter')) {\n _context.n = 4;\n break;\n }\n return _context.d(_regeneratorValues(_asyncGeneratorDelegate(_asyncIterator((0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_4__.indexVcf)({\n config: config,\n attributesToIndex: indexingAttributes,\n inLocation: (0,_adapter_utils_ts__WEBPACK_IMPORTED_MODULE_7__.getLoc)(loc),\n outDir: outLocation,\n onStart: function onStart(totalBytes) {\n if (!quiet) {\n progressBar.start(totalBytes, 0);\n }\n },\n onUpdate: function onUpdate(receivedBytes) {\n if (!quiet) {\n progressBar.update(receivedBytes);\n }\n }\n })), _awaitAsyncGenerator)), 4);\n case 4:\n if (!quiet) {\n progressBar.stop();\n }\n case 5:\n return _context.a(2);\n }\n }, _loop);\n });\n _iterator.s();\n case 2:\n if ((_step = _iterator.n()).done) {\n _context2.n = 5;\n break;\n }\n return _context2.d(_regeneratorValues(_loop()), 3);\n case 3:\n if (!_context2.v) {\n _context2.n = 4;\n break;\n }\n return _context2.a(3, 4);\n case 4:\n _context2.n = 2;\n break;\n case 5:\n _context2.n = 7;\n break;\n case 6:\n _context2.p = 6;\n _t = _context2.v;\n _iterator.e(_t);\n case 7:\n _context2.p = 7;\n _iterator.f();\n return _context2.f(7);\n case 8:\n return _context2.a(2);\n }\n }, _callee, null, [[1, 6, 7, 8]]);\n })();\n });\n return _indexFiles.apply(this, arguments);\n}\nfunction indexDriver(_x3) {\n return _indexDriver.apply(this, arguments);\n}\nfunction _indexDriver() {\n _indexDriver = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref5) {\n var trackConfigs, attributes, outLocation, name, quiet, typesToExclude, assemblyNames, prefixSize, readStream;\n return _regenerator().w(function (_context4) {\n while (1) switch (_context4.n) {\n case 0:\n trackConfigs = _ref5.trackConfigs, attributes = _ref5.attributes, outLocation = _ref5.outLocation, name = _ref5.name, quiet = _ref5.quiet, typesToExclude = _ref5.typesToExclude, assemblyNames = _ref5.assemblyNames, prefixSize = _ref5.prefixSize;\n readStream = stream__WEBPACK_IMPORTED_MODULE_1__.Readable.from(indexFiles({\n trackConfigs: trackConfigs,\n attributes: attributes,\n outLocation: outLocation,\n quiet: quiet,\n typesToExclude: typesToExclude\n }));\n _context4.n = 1;\n return runIxIxx({\n readStream: readStream,\n outLocation: outLocation,\n name: name,\n prefixSize: prefixSize,\n quiet: quiet\n });\n case 1:\n _context4.n = 2;\n return (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.generateMeta)({\n configs: trackConfigs,\n attributesToIndex: attributes,\n outDir: outLocation,\n name: name,\n featureTypesToExclude: typesToExclude,\n assemblyNames: assemblyNames\n });\n case 2:\n return _context4.a(2);\n }\n }, _callee3);\n }));\n return _indexDriver.apply(this, arguments);\n}\nfunction prepareFileTrackConfigs(files, fileIds) {\n return files.map(function (file, i) {\n var config = (0,_jbrowse_text_indexing_core__WEBPACK_IMPORTED_MODULE_2__.guessAdapterFromFileName)(file);\n if (fileIds !== null && fileIds !== void 0 && fileIds[i]) {\n config.trackId = fileIds[i];\n }\n return config;\n }).filter(function (fileConfig) {\n var _fileConfig$adapter;\n return (0,_types_common_ts__WEBPACK_IMPORTED_MODULE_8__.supported)((_fileConfig$adapter = fileConfig.adapter) === null || _fileConfig$adapter === void 0 ? void 0 : _fileConfig$adapter.type);\n });\n}\n\n//# sourceURL=webpack://@jbrowse/cli/./src/commands/text-index/indexing-utils.ts?\n}");
|
|
439
439
|
|
|
440
440
|
/***/ },
|
|
441
441
|
|
|
@@ -512,7 +512,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
512
512
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
513
513
|
|
|
514
514
|
"use strict";
|
|
515
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ debug: () => (/* binding */ debug),\n/* harmony export */ fetchGithubVersions: () => (/* binding */ fetchGithubVersions),\n/* harmony export */ fetchVersions: () => (/* binding */ fetchVersions),\n/* harmony export */ getBranch: () => (/* binding */ getBranch),\n/* harmony export */ getLatest: () => (/* binding */ getLatest),\n/* harmony export */ getTag: () => (/* binding */ getTag),\n/* harmony export */ printHelp: () => (/* binding */ printHelp),\n/* harmony export */ readFile: () => (/* binding */ readFile),\n/* harmony export */ readInlineOrFileJson: () => (/* binding */ readInlineOrFileJson),\n/* harmony export */ readJsonFile: () => (/* binding */ readJsonFile),\n/* harmony export */ resolveConfigPath: () => (/* binding */ resolveConfigPath),\n/* harmony export */ resolveFileLocation: () => (/* binding */ resolveFileLocation),\n/* harmony export */ writeJsonFile: () => (/* binding */ writeJsonFile)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! json-parse-better-errors */ \"../../node_modules/.pnpm/json-parse-better-errors@1.0.2/node_modules/json-parse-better-errors/index.js\");\n/* harmony import */ var json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cliFetch.ts */ \"./src/cliFetch.ts\");\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var r, t; function resume(r, t) { try { var n = e[r](t), o = n.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (t) { if (u) { var i = \"return\" === r ? \"return\" : \"next\"; if (!o.k || t.done) return resume(i, t); t = e[i](t).value; } settle(n.done ? \"return\" : \"normal\", t); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(\"throw\", e); } } function settle(e, n) { switch (e) { case \"return\": r.resolve({ value: n, done: !0 }); break; case \"throw\": r.reject(n); break; default: r.resolve({ value: n, done: !1 }); } (r = r.next) ? resume(r.key, r.arg) : t = null; } this._invoke = function (e, n) { return new Promise(function (o, u) { var i = { key: e, arg: n, resolve: o, reject: u, next: null }; t ? t = t.next = i : (r = t = i, resume(e, n)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\n\n\nfunction debug(message) {\n if (process.env.DEBUG) {\n console.log(\"DEBUG: \".concat(message));\n }\n}\nfunction resolveConfigPath(_x, _x2) {\n return _resolveConfigPath.apply(this, arguments);\n}\nfunction _resolveConfigPath() {\n _resolveConfigPath = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(target, out) {\n var output, stat;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.n) {\n case 0:\n output = target || out || '.';\n _context2.n = 1;\n return fs__WEBPACK_IMPORTED_MODULE_0__.promises.lstat(output);\n case 1:\n stat = _context2.v;\n return _context2.a(2, stat.isDirectory() ? \"\".concat(output, \"/config.json\") : output);\n }\n }, _callee2);\n }));\n return _resolveConfigPath.apply(this, arguments);\n}\nfunction readFile(_x3) {\n return _readFile.apply(this, arguments);\n}\nfunction _readFile() {\n _readFile = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(location) {\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n return _context3.a(2, fs__WEBPACK_IMPORTED_MODULE_0__.promises.readFile(location, {\n encoding: 'utf8'\n }));\n }\n }, _callee3);\n }));\n return _readFile.apply(this, arguments);\n}\nfunction readJsonFile(_x4) {\n return _readJsonFile.apply(this, arguments);\n}\nfunction _readJsonFile() {\n _readJsonFile = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(location) {\n var contents;\n return _regenerator().w(function (_context4) {\n while (1) switch (_context4.n) {\n case 0:\n _context4.n = 1;\n return fs__WEBPACK_IMPORTED_MODULE_0__.promises.readFile(location, {\n encoding: 'utf8'\n });\n case 1:\n contents = _context4.v;\n return _context4.a(2, json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2___default()(contents));\n }\n }, _callee4);\n }));\n return _readJsonFile.apply(this, arguments);\n}\nfunction writeJsonFile(_x5, _x6) {\n return _writeJsonFile.apply(this, arguments);\n}\nfunction _writeJsonFile() {\n _writeJsonFile = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(location, contents) {\n return _regenerator().w(function (_context5) {\n while (1) switch (_context5.n) {\n case 0:\n debug(\"Writing JSON file to \".concat(process.cwd(), \" \").concat(location));\n return _context5.a(2, fs__WEBPACK_IMPORTED_MODULE_0__.promises.writeFile(location, JSON.stringify(contents, null, 2)));\n }\n }, _callee5);\n }));\n return _writeJsonFile.apply(this, arguments);\n}\nfunction resolveFileLocation(_x7) {\n return _resolveFileLocation.apply(this, arguments);\n}\nfunction _resolveFileLocation() {\n _resolveFileLocation = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(location) {\n var check,\n inPlace,\n locationUrl,\n response,\n locationPath,\n filePath,\n _args6 = arguments,\n _t,\n _t2;\n return _regenerator().w(function (_context6) {\n while (1) switch (_context6.p = _context6.n) {\n case 0:\n check = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : true;\n inPlace = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : false;\n try {\n locationUrl = new URL(location);\n } catch (error) {\n // ignore\n }\n if (!locationUrl) {\n _context6.n = 3;\n break;\n }\n if (!check) {\n _context6.n = 2;\n break;\n }\n _context6.n = 1;\n return (0,_cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(locationUrl, {\n method: 'HEAD'\n });\n case 1:\n response = _context6.v;\n if (response.ok) {\n _context6.n = 2;\n break;\n }\n throw new Error(\"\".concat(locationUrl, \" result \").concat(response.statusText));\n case 2:\n return _context6.a(2, locationUrl.href);\n case 3:\n _context6.p = 3;\n if (!check) {\n _context6.n = 5;\n break;\n }\n _context6.n = 4;\n return fs__WEBPACK_IMPORTED_MODULE_0__.promises.realpath(location);\n case 4:\n _t = _context6.v;\n _context6.n = 6;\n break;\n case 5:\n _t = location;\n case 6:\n locationPath = _t;\n _context6.n = 8;\n break;\n case 7:\n _context6.p = 7;\n _t2 = _context6.v;\n case 8:\n if (!locationPath) {\n _context6.n = 9;\n break;\n }\n filePath = path__WEBPACK_IMPORTED_MODULE_1___default().relative(process.cwd(), locationPath);\n if (inPlace && filePath.startsWith('..')) {\n console.warn(\"Location \".concat(filePath, \" is not in the JBrowse directory. Make sure it is still in your server directory.\"));\n }\n return _context6.a(2, inPlace ? location : filePath);\n case 9:\n throw new Error(\"Could not resolve to a file or a URL: \\\"\".concat(location, \"\\\"\"));\n case 10:\n return _context6.a(2);\n }\n }, _callee6, null, [[3, 7]]);\n }));\n return _resolveFileLocation.apply(this, arguments);\n}\nfunction readInlineOrFileJson(_x8) {\n return _readInlineOrFileJson.apply(this, arguments);\n}\nfunction _readInlineOrFileJson() {\n _readInlineOrFileJson = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(inlineOrFileName) {\n var result, _t3;\n return _regenerator().w(function (_context7) {\n while (1) switch (_context7.p = _context7.n) {\n case 0:\n _context7.p = 0;\n result = json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2___default()(inlineOrFileName);\n _context7.n = 3;\n break;\n case 1:\n _context7.p = 1;\n _t3 = _context7.v;\n debug(\"Not valid inline JSON, attempting to parse as filename: '\".concat(inlineOrFileName, \"'\"));\n // not inline JSON, must be location of a JSON file\n _context7.n = 2;\n return readJsonFile(inlineOrFileName);\n case 2:\n result = _context7.v;\n case 3:\n return _context7.a(2, result);\n }\n }, _callee7, null, [[0, 1]]);\n }));\n return _readInlineOrFileJson.apply(this, arguments);\n}\nfunction fetchGithubVersions() {\n return _fetchGithubVersions.apply(this, arguments);\n}\nfunction _fetchGithubVersions() {\n _fetchGithubVersions = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {\n var versions, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, iter, _t4;\n return _regenerator().w(function (_context8) {\n while (1) switch (_context8.p = _context8.n) {\n case 0:\n versions = [];\n _iteratorAbruptCompletion = false;\n _didIteratorError = false;\n _context8.p = 1;\n _iterator = _asyncIterator(fetchVersions());\n case 2:\n _context8.n = 3;\n return _iterator.next();\n case 3:\n if (!(_iteratorAbruptCompletion = !(_step = _context8.v).done)) {\n _context8.n = 5;\n break;\n }\n iter = _step.value;\n versions = [].concat(_toConsumableArray(versions), _toConsumableArray(iter));\n case 4:\n _iteratorAbruptCompletion = false;\n _context8.n = 2;\n break;\n case 5:\n _context8.n = 7;\n break;\n case 6:\n _context8.p = 6;\n _t4 = _context8.v;\n _didIteratorError = true;\n _iteratorError = _t4;\n case 7:\n _context8.p = 7;\n _context8.p = 8;\n if (!(_iteratorAbruptCompletion && _iterator[\"return\"] != null)) {\n _context8.n = 9;\n break;\n }\n _context8.n = 9;\n return _iterator[\"return\"]();\n case 9:\n _context8.p = 9;\n if (!_didIteratorError) {\n _context8.n = 10;\n break;\n }\n throw _iteratorError;\n case 10:\n return _context8.f(9);\n case 11:\n return _context8.f(7);\n case 12:\n return _context8.a(2, versions);\n }\n }, _callee8, null, [[8,, 9, 11], [1, 6, 7, 12]]);\n }));\n return _fetchGithubVersions.apply(this, arguments);\n}\nfunction getLatest() {\n return _getLatest.apply(this, arguments);\n}\nfunction _getLatest() {\n _getLatest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {\n var _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, versions, nonprerelease, first, _first$assets$find, file, _t5;\n return _regenerator().w(function (_context9) {\n while (1) switch (_context9.p = _context9.n) {\n case 0:\n _iteratorAbruptCompletion2 = false;\n _didIteratorError2 = false;\n _context9.p = 1;\n _iterator2 = _asyncIterator(fetchVersions());\n case 2:\n _context9.n = 3;\n return _iterator2.next();\n case 3:\n if (!(_iteratorAbruptCompletion2 = !(_step2 = _context9.v).done)) {\n _context9.n = 6;\n break;\n }\n versions = _step2.value;\n // if a release was just uploaded, or an erroneous build was made then it\n // might have no build asset\n nonprerelease = versions.filter(function (release) {\n return !release.prerelease;\n }).find(function (release) {\n var _release$assets;\n return (_release$assets = release.assets) === null || _release$assets === void 0 ? void 0 : _release$assets.length;\n });\n first = nonprerelease;\n if (!(first !== null && first !== void 0 && first.assets)) {\n _context9.n = 5;\n break;\n }\n file = (_first$assets$find = first.assets.find(function (f) {\n return f.name.includes('jbrowse-web');\n })) === null || _first$assets$find === void 0 ? void 0 : _first$assets$find.browser_download_url;\n if (file) {\n _context9.n = 4;\n break;\n }\n throw new Error('no jbrowse-web download found');\n case 4:\n return _context9.a(2, file);\n case 5:\n _iteratorAbruptCompletion2 = false;\n _context9.n = 2;\n break;\n case 6:\n _context9.n = 8;\n break;\n case 7:\n _context9.p = 7;\n _t5 = _context9.v;\n _didIteratorError2 = true;\n _iteratorError2 = _t5;\n case 8:\n _context9.p = 8;\n _context9.p = 9;\n if (!(_iteratorAbruptCompletion2 && _iterator2[\"return\"] != null)) {\n _context9.n = 10;\n break;\n }\n _context9.n = 10;\n return _iterator2[\"return\"]();\n case 10:\n _context9.p = 10;\n if (!_didIteratorError2) {\n _context9.n = 11;\n break;\n }\n throw _iteratorError2;\n case 11:\n return _context9.f(10);\n case 12:\n return _context9.f(8);\n case 13:\n throw new Error('no version tags found');\n case 14:\n return _context9.a(2);\n }\n }, _callee9, null, [[9,, 10, 12], [1, 7, 8, 13]]);\n }));\n return _getLatest.apply(this, arguments);\n}\nfunction fetchVersions() {\n return _fetchVersions.apply(this, arguments);\n}\nfunction _fetchVersions() {\n _fetchVersions = _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n var page, result, url, response;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n page = 1;\n case 1:\n url = \"https://api.github.com/repos/GMOD/jbrowse-components/releases?page=\".concat(page);\n _context.n = 2;\n return _awaitAsyncGenerator((0,_cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(url));\n case 2:\n response = _context.v;\n if (!response.ok) {\n _context.n = 5;\n break;\n }\n _context.n = 3;\n return _awaitAsyncGenerator(response.json());\n case 3:\n result = _context.v;\n _context.n = 4;\n return result.filter(function (release) {\n return release.tag_name.startsWith('v');\n });\n case 4:\n page++;\n _context.n = 6;\n break;\n case 5:\n throw new Error(\"HTTP \".concat(response.status, \" fetching \").concat(url));\n case 6:\n if (result.length) {\n _context.n = 1;\n break;\n }\n case 7:\n return _context.a(2);\n }\n }, _callee);\n }));\n return _fetchVersions.apply(this, arguments);\n}\nfunction getTag(_x9) {\n return _getTag.apply(this, arguments);\n}\nfunction _getTag() {\n _getTag = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(tag) {\n var response, _result$assets, result, file;\n return _regenerator().w(function (_context0) {\n while (1) switch (_context0.n) {\n case 0:\n _context0.n = 1;\n return (0,_cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(\"https://api.github.com/repos/GMOD/jbrowse-components/releases/tags/\".concat(tag));\n case 1:\n response = _context0.v;\n if (!response.ok) {\n _context0.n = 4;\n break;\n }\n _context0.n = 2;\n return response.json();\n case 2:\n result = _context0.v;\n file = (_result$assets = result.assets) === null || _result$assets === void 0 || (_result$assets = _result$assets.find(function (f) {\n return f.name.includes('jbrowse-web');\n })) === null || _result$assets === void 0 ? void 0 : _result$assets.browser_download_url;\n if (file) {\n _context0.n = 3;\n break;\n }\n throw new Error('Could not find version specified. Use --listVersions to see all available versions');\n case 3:\n return _context0.a(2, file);\n case 4:\n throw new Error(\"Could not find version: \".concat(response.statusText));\n case 5:\n return _context0.a(2);\n }\n }, _callee0);\n }));\n return _getTag.apply(this, arguments);\n}\nfunction getBranch(_x0) {\n return _getBranch.apply(this, arguments);\n}\nfunction _getBranch() {\n _getBranch = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(branch) {\n return _regenerator().w(function (_context1) {\n while (1) switch (_context1.n) {\n case 0:\n return _context1.a(2, \"https://s3.amazonaws.com/jbrowse.org/code/jb2/\".concat(branch, \"/jbrowse-web-\").concat(branch, \".zip\"));\n }\n }, _callee1);\n }));\n return _getBranch.apply(this, arguments);\n}\nfunction wrapText(text, width, indent) {\n // Normalize: join single \\n into spaces, preserve \\n\\n as paragraph breaks\n var normalized = text.replace(/\\n\\n/g, '\\0').replace(/\\n/g, ' ').replace(/\\0/g, '\\n\\n');\n var lines = [];\n var _iterator3 = _createForOfIteratorHelper(normalized.split('\\n')),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var line = _step3.value;\n if (line.length <= width) {\n lines.push(line);\n } else {\n var words = line.split(' ');\n var current = '';\n var _iterator4 = _createForOfIteratorHelper(words),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var word = _step4.value;\n if (current.length + word.length + 1 <= width) {\n current += (current ? ' ' : '') + word;\n } else {\n if (current) {\n lines.push(current);\n }\n current = word;\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n if (current) {\n lines.push(current);\n }\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n return lines.join(\"\\n\".concat(indent));\n}\nfunction printHelp(_ref) {\n var description = _ref.description,\n options = _ref.options,\n examples = _ref.examples,\n usage = _ref.usage;\n var termWidth = process.stdout.columns || 80;\n console.log(description);\n console.log(\"\\nUsage: \".concat(usage || 'jbrowse <command> [options]'));\n console.log('\\nOptions:');\n for (var _i = 0, _Object$entries = Object.entries(options); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n name = _Object$entries$_i[0],\n option = _Object$entries$_i[1];\n var opt = option;\n var shortFlag = opt[\"short\"];\n var prefix = shortFlag ? \" -\".concat(shortFlag, \", \") : ' ';\n var namePadded = \"--\".concat(name).padEnd(22, ' ');\n var indent = ' '.repeat(prefix.length + namePadded.length + 1);\n var descWidth = termWidth - indent.length;\n var desc = opt.description || '';\n if (opt.choices) {\n desc += \" [choices: \".concat(opt.choices.join(', '), \"]\");\n }\n if (opt[\"default\"] !== undefined) {\n desc += \" [default: \".concat(opt[\"default\"], \"]\");\n }\n var wrapped = desc ? wrapText(desc, descWidth, indent) : '';\n console.log(\"\".concat(prefix).concat(namePadded, \" \").concat(wrapped, \"\\n\"));\n }\n console.log(examples.join('\\n'));\n}\n\n//# sourceURL=webpack://@jbrowse/cli/./src/utils.ts?\n}");
|
|
515
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ debug: () => (/* binding */ debug),\n/* harmony export */ fetchGithubVersions: () => (/* binding */ fetchGithubVersions),\n/* harmony export */ fetchVersions: () => (/* binding */ fetchVersions),\n/* harmony export */ getBranch: () => (/* binding */ getBranch),\n/* harmony export */ getLatest: () => (/* binding */ getLatest),\n/* harmony export */ getTag: () => (/* binding */ getTag),\n/* harmony export */ printHelp: () => (/* binding */ printHelp),\n/* harmony export */ readFile: () => (/* binding */ readFile),\n/* harmony export */ readInlineOrFileJson: () => (/* binding */ readInlineOrFileJson),\n/* harmony export */ readJsonFile: () => (/* binding */ readJsonFile),\n/* harmony export */ resolveConfigPath: () => (/* binding */ resolveConfigPath),\n/* harmony export */ resolveFileLocation: () => (/* binding */ resolveFileLocation),\n/* harmony export */ writeJsonFile: () => (/* binding */ writeJsonFile)\n/* harmony export */ });\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! json-parse-better-errors */ \"../../node_modules/.pnpm/json-parse-better-errors@1.0.2/node_modules/json-parse-better-errors/index.js\");\n/* harmony import */ var json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cliFetch.ts */ \"./src/cliFetch.ts\");\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = \"function\" == typeof Symbol ? Symbol : {}, n = r.iterator || \"@@iterator\", o = r.toStringTag || \"@@toStringTag\"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, \"_invoke\", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError(\"Generator is already running\"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = \"next\"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError(\"iterator result is not an object\"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i[\"return\"]) && t.call(i), c < 2 && (u = TypeError(\"The iterator does not provide a '\" + o + \"' method\"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, \"GeneratorFunction\")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, \"constructor\", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = \"GeneratorFunction\", _regeneratorDefine2(GeneratorFunctionPrototype, o, \"GeneratorFunction\"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, \"Generator\"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, \"toString\", function () { return \"[object Generator]\"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, \"\", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o(\"next\", 0), o(\"throw\", 1), o(\"return\", 2)); }, _regeneratorDefine2(e, r, n, t); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _awaitAsyncGenerator(e) { return new _OverloadYield(e, 0); }\nfunction _wrapAsyncGenerator(e) { return function () { return new AsyncGenerator(e.apply(this, arguments)); }; }\nfunction AsyncGenerator(e) { var t, n; function resume(t, n) { try { var r = e[t](n), o = r.value, u = o instanceof _OverloadYield; Promise.resolve(u ? o.v : o).then(function (n) { if (u) { var i = \"return\" === t && o.k ? t : \"next\"; if (!o.k || n.done) return resume(i, n); n = e[i](n).value; } settle(!!r.done, n); }, function (e) { resume(\"throw\", e); }); } catch (e) { settle(2, e); } } function settle(e, r) { 2 === e ? t.reject(r) : t.resolve({ value: r, done: e }), (t = t.next) ? resume(t.key, t.arg) : n = null; } this._invoke = function (e, r) { return new Promise(function (o, u) { var i = { key: e, arg: r, resolve: o, reject: u, next: null }; n ? n = n.next = i : (t = n = i, resume(e, r)); }); }, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0); }\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function () { return this; }, AsyncGenerator.prototype.next = function (e) { return this._invoke(\"next\", e); }, AsyncGenerator.prototype[\"throw\"] = function (e) { return this._invoke(\"throw\", e); }, AsyncGenerator.prototype[\"return\"] = function (e) { return this._invoke(\"return\", e); };\nfunction _OverloadYield(e, d) { this.v = e, this.k = d; }\nfunction _asyncIterator(r) { var n, t, o, e = 2; for (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = \"@@asyncIterator\", o = \"@@iterator\"; } throw new TypeError(\"Object is not async iterable\"); }\nfunction AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, \"return\": function _return(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, \"throw\": function _throw(r) { var n = this.s[\"return\"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }\n\n\n\n\nfunction debug(message) {\n if (process.env.DEBUG) {\n console.log(\"DEBUG: \".concat(message));\n }\n}\nfunction resolveConfigPath(_x, _x2) {\n return _resolveConfigPath.apply(this, arguments);\n}\nfunction _resolveConfigPath() {\n _resolveConfigPath = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(target, out) {\n var output, stat;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.n) {\n case 0:\n output = target || out || '.';\n _context2.n = 1;\n return fs__WEBPACK_IMPORTED_MODULE_0__.promises.lstat(output);\n case 1:\n stat = _context2.v;\n return _context2.a(2, stat.isDirectory() ? \"\".concat(output, \"/config.json\") : output);\n }\n }, _callee2);\n }));\n return _resolveConfigPath.apply(this, arguments);\n}\nfunction readFile(_x3) {\n return _readFile.apply(this, arguments);\n}\nfunction _readFile() {\n _readFile = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(location) {\n return _regenerator().w(function (_context3) {\n while (1) switch (_context3.n) {\n case 0:\n return _context3.a(2, fs__WEBPACK_IMPORTED_MODULE_0__.promises.readFile(location, {\n encoding: 'utf8'\n }));\n }\n }, _callee3);\n }));\n return _readFile.apply(this, arguments);\n}\nfunction readJsonFile(_x4) {\n return _readJsonFile.apply(this, arguments);\n}\nfunction _readJsonFile() {\n _readJsonFile = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(location) {\n var contents;\n return _regenerator().w(function (_context4) {\n while (1) switch (_context4.n) {\n case 0:\n _context4.n = 1;\n return fs__WEBPACK_IMPORTED_MODULE_0__.promises.readFile(location, {\n encoding: 'utf8'\n });\n case 1:\n contents = _context4.v;\n return _context4.a(2, json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2___default()(contents));\n }\n }, _callee4);\n }));\n return _readJsonFile.apply(this, arguments);\n}\nfunction writeJsonFile(_x5, _x6) {\n return _writeJsonFile.apply(this, arguments);\n}\nfunction _writeJsonFile() {\n _writeJsonFile = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(location, contents) {\n return _regenerator().w(function (_context5) {\n while (1) switch (_context5.n) {\n case 0:\n debug(\"Writing JSON file to \".concat(process.cwd(), \" \").concat(location));\n return _context5.a(2, fs__WEBPACK_IMPORTED_MODULE_0__.promises.writeFile(location, JSON.stringify(contents, null, 2)));\n }\n }, _callee5);\n }));\n return _writeJsonFile.apply(this, arguments);\n}\nfunction resolveFileLocation(_x7) {\n return _resolveFileLocation.apply(this, arguments);\n}\nfunction _resolveFileLocation() {\n _resolveFileLocation = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(location) {\n var check,\n inPlace,\n locationUrl,\n response,\n locationPath,\n filePath,\n _args6 = arguments,\n _t,\n _t2;\n return _regenerator().w(function (_context6) {\n while (1) switch (_context6.p = _context6.n) {\n case 0:\n check = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : true;\n inPlace = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : false;\n try {\n locationUrl = new URL(location);\n } catch (error) {\n // ignore\n }\n if (!locationUrl) {\n _context6.n = 3;\n break;\n }\n if (!check) {\n _context6.n = 2;\n break;\n }\n _context6.n = 1;\n return (0,_cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(locationUrl, {\n method: 'HEAD'\n });\n case 1:\n response = _context6.v;\n if (response.ok) {\n _context6.n = 2;\n break;\n }\n throw new Error(\"\".concat(locationUrl, \" result \").concat(response.statusText));\n case 2:\n return _context6.a(2, locationUrl.href);\n case 3:\n _context6.p = 3;\n if (!check) {\n _context6.n = 5;\n break;\n }\n _context6.n = 4;\n return fs__WEBPACK_IMPORTED_MODULE_0__.promises.realpath(location);\n case 4:\n _t = _context6.v;\n _context6.n = 6;\n break;\n case 5:\n _t = location;\n case 6:\n locationPath = _t;\n _context6.n = 8;\n break;\n case 7:\n _context6.p = 7;\n _t2 = _context6.v;\n case 8:\n if (!locationPath) {\n _context6.n = 9;\n break;\n }\n filePath = path__WEBPACK_IMPORTED_MODULE_1___default().relative(process.cwd(), locationPath);\n if (inPlace && filePath.startsWith('..')) {\n console.warn(\"Location \".concat(filePath, \" is not in the JBrowse directory. Make sure it is still in your server directory.\"));\n }\n return _context6.a(2, inPlace ? location : filePath);\n case 9:\n throw new Error(\"Could not resolve to a file or a URL: \\\"\".concat(location, \"\\\"\"));\n case 10:\n return _context6.a(2);\n }\n }, _callee6, null, [[3, 7]]);\n }));\n return _resolveFileLocation.apply(this, arguments);\n}\nfunction readInlineOrFileJson(_x8) {\n return _readInlineOrFileJson.apply(this, arguments);\n}\nfunction _readInlineOrFileJson() {\n _readInlineOrFileJson = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(inlineOrFileName) {\n var result, _t3;\n return _regenerator().w(function (_context7) {\n while (1) switch (_context7.p = _context7.n) {\n case 0:\n _context7.p = 0;\n result = json_parse_better_errors__WEBPACK_IMPORTED_MODULE_2___default()(inlineOrFileName);\n _context7.n = 3;\n break;\n case 1:\n _context7.p = 1;\n _t3 = _context7.v;\n debug(\"Not valid inline JSON, attempting to parse as filename: '\".concat(inlineOrFileName, \"'\"));\n // not inline JSON, must be location of a JSON file\n _context7.n = 2;\n return readJsonFile(inlineOrFileName);\n case 2:\n result = _context7.v;\n case 3:\n return _context7.a(2, result);\n }\n }, _callee7, null, [[0, 1]]);\n }));\n return _readInlineOrFileJson.apply(this, arguments);\n}\nfunction fetchGithubVersions() {\n return _fetchGithubVersions.apply(this, arguments);\n}\nfunction _fetchGithubVersions() {\n _fetchGithubVersions = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {\n var versions, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, iter, _t4;\n return _regenerator().w(function (_context8) {\n while (1) switch (_context8.p = _context8.n) {\n case 0:\n versions = [];\n _iteratorAbruptCompletion = false;\n _didIteratorError = false;\n _context8.p = 1;\n _iterator = _asyncIterator(fetchVersions());\n case 2:\n _context8.n = 3;\n return _iterator.next();\n case 3:\n if (!(_iteratorAbruptCompletion = !(_step = _context8.v).done)) {\n _context8.n = 5;\n break;\n }\n iter = _step.value;\n versions = [].concat(_toConsumableArray(versions), _toConsumableArray(iter));\n case 4:\n _iteratorAbruptCompletion = false;\n _context8.n = 2;\n break;\n case 5:\n _context8.n = 7;\n break;\n case 6:\n _context8.p = 6;\n _t4 = _context8.v;\n _didIteratorError = true;\n _iteratorError = _t4;\n case 7:\n _context8.p = 7;\n _context8.p = 8;\n if (!(_iteratorAbruptCompletion && _iterator[\"return\"] != null)) {\n _context8.n = 9;\n break;\n }\n _context8.n = 9;\n return _iterator[\"return\"]();\n case 9:\n _context8.p = 9;\n if (!_didIteratorError) {\n _context8.n = 10;\n break;\n }\n throw _iteratorError;\n case 10:\n return _context8.f(9);\n case 11:\n return _context8.f(7);\n case 12:\n return _context8.a(2, versions);\n }\n }, _callee8, null, [[8,, 9, 11], [1, 6, 7, 12]]);\n }));\n return _fetchGithubVersions.apply(this, arguments);\n}\nfunction getLatest() {\n return _getLatest.apply(this, arguments);\n}\nfunction _getLatest() {\n _getLatest = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {\n var _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, versions, nonprerelease, first, _first$assets$find, file, _t5;\n return _regenerator().w(function (_context9) {\n while (1) switch (_context9.p = _context9.n) {\n case 0:\n _iteratorAbruptCompletion2 = false;\n _didIteratorError2 = false;\n _context9.p = 1;\n _iterator2 = _asyncIterator(fetchVersions());\n case 2:\n _context9.n = 3;\n return _iterator2.next();\n case 3:\n if (!(_iteratorAbruptCompletion2 = !(_step2 = _context9.v).done)) {\n _context9.n = 6;\n break;\n }\n versions = _step2.value;\n // if a release was just uploaded, or an erroneous build was made then it\n // might have no build asset\n nonprerelease = versions.filter(function (release) {\n return !release.prerelease;\n }).find(function (release) {\n var _release$assets;\n return (_release$assets = release.assets) === null || _release$assets === void 0 ? void 0 : _release$assets.length;\n });\n first = nonprerelease;\n if (!(first !== null && first !== void 0 && first.assets)) {\n _context9.n = 5;\n break;\n }\n file = (_first$assets$find = first.assets.find(function (f) {\n return f.name.includes('jbrowse-web');\n })) === null || _first$assets$find === void 0 ? void 0 : _first$assets$find.browser_download_url;\n if (file) {\n _context9.n = 4;\n break;\n }\n throw new Error('no jbrowse-web download found');\n case 4:\n return _context9.a(2, file);\n case 5:\n _iteratorAbruptCompletion2 = false;\n _context9.n = 2;\n break;\n case 6:\n _context9.n = 8;\n break;\n case 7:\n _context9.p = 7;\n _t5 = _context9.v;\n _didIteratorError2 = true;\n _iteratorError2 = _t5;\n case 8:\n _context9.p = 8;\n _context9.p = 9;\n if (!(_iteratorAbruptCompletion2 && _iterator2[\"return\"] != null)) {\n _context9.n = 10;\n break;\n }\n _context9.n = 10;\n return _iterator2[\"return\"]();\n case 10:\n _context9.p = 10;\n if (!_didIteratorError2) {\n _context9.n = 11;\n break;\n }\n throw _iteratorError2;\n case 11:\n return _context9.f(10);\n case 12:\n return _context9.f(8);\n case 13:\n throw new Error('no version tags found');\n case 14:\n return _context9.a(2);\n }\n }, _callee9, null, [[9,, 10, 12], [1, 7, 8, 13]]);\n }));\n return _getLatest.apply(this, arguments);\n}\nfunction fetchVersions() {\n return _fetchVersions.apply(this, arguments);\n}\nfunction _fetchVersions() {\n _fetchVersions = _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee() {\n var page, result, url, response;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.n) {\n case 0:\n page = 1;\n case 1:\n url = \"https://api.github.com/repos/GMOD/jbrowse-components/releases?page=\".concat(page);\n _context.n = 2;\n return _awaitAsyncGenerator((0,_cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(url));\n case 2:\n response = _context.v;\n if (!response.ok) {\n _context.n = 5;\n break;\n }\n _context.n = 3;\n return _awaitAsyncGenerator(response.json());\n case 3:\n result = _context.v;\n _context.n = 4;\n return result.filter(function (release) {\n return release.tag_name.startsWith('v');\n });\n case 4:\n page++;\n _context.n = 6;\n break;\n case 5:\n throw new Error(\"HTTP \".concat(response.status, \" fetching \").concat(url));\n case 6:\n if (result.length) {\n _context.n = 1;\n break;\n }\n case 7:\n return _context.a(2);\n }\n }, _callee);\n }));\n return _fetchVersions.apply(this, arguments);\n}\nfunction getTag(_x9) {\n return _getTag.apply(this, arguments);\n}\nfunction _getTag() {\n _getTag = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(tag) {\n var response, _result$assets, result, file;\n return _regenerator().w(function (_context0) {\n while (1) switch (_context0.n) {\n case 0:\n _context0.n = 1;\n return (0,_cliFetch_ts__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(\"https://api.github.com/repos/GMOD/jbrowse-components/releases/tags/\".concat(tag));\n case 1:\n response = _context0.v;\n if (!response.ok) {\n _context0.n = 4;\n break;\n }\n _context0.n = 2;\n return response.json();\n case 2:\n result = _context0.v;\n file = (_result$assets = result.assets) === null || _result$assets === void 0 || (_result$assets = _result$assets.find(function (f) {\n return f.name.includes('jbrowse-web');\n })) === null || _result$assets === void 0 ? void 0 : _result$assets.browser_download_url;\n if (file) {\n _context0.n = 3;\n break;\n }\n throw new Error('Could not find version specified. Use --listVersions to see all available versions');\n case 3:\n return _context0.a(2, file);\n case 4:\n throw new Error(\"Could not find version: \".concat(response.statusText));\n case 5:\n return _context0.a(2);\n }\n }, _callee0);\n }));\n return _getTag.apply(this, arguments);\n}\nfunction getBranch(_x0) {\n return _getBranch.apply(this, arguments);\n}\nfunction _getBranch() {\n _getBranch = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(branch) {\n return _regenerator().w(function (_context1) {\n while (1) switch (_context1.n) {\n case 0:\n return _context1.a(2, \"https://s3.amazonaws.com/jbrowse.org/code/jb2/\".concat(branch, \"/jbrowse-web-\").concat(branch, \".zip\"));\n }\n }, _callee1);\n }));\n return _getBranch.apply(this, arguments);\n}\nfunction wrapText(text, width, indent) {\n // Normalize: join single \\n into spaces, preserve \\n\\n as paragraph breaks\n var normalized = text.replace(/\\n\\n/g, '\\0').replace(/\\n/g, ' ').replace(/\\0/g, '\\n\\n');\n var lines = [];\n var _iterator3 = _createForOfIteratorHelper(normalized.split('\\n')),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var line = _step3.value;\n if (line.length <= width) {\n lines.push(line);\n } else {\n var words = line.split(' ');\n var current = '';\n var _iterator4 = _createForOfIteratorHelper(words),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var word = _step4.value;\n if (current.length + word.length + 1 <= width) {\n current += (current ? ' ' : '') + word;\n } else {\n if (current) {\n lines.push(current);\n }\n current = word;\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n if (current) {\n lines.push(current);\n }\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n return lines.join(\"\\n\".concat(indent));\n}\nfunction printHelp(_ref) {\n var description = _ref.description,\n options = _ref.options,\n examples = _ref.examples,\n usage = _ref.usage;\n var termWidth = process.stdout.columns || 80;\n console.log(description);\n console.log(\"\\nUsage: \".concat(usage || 'jbrowse <command> [options]'));\n console.log('\\nOptions:');\n for (var _i = 0, _Object$entries = Object.entries(options); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n name = _Object$entries$_i[0],\n option = _Object$entries$_i[1];\n var opt = option;\n var shortFlag = opt[\"short\"];\n var prefix = shortFlag ? \" -\".concat(shortFlag, \", \") : ' ';\n var namePadded = \"--\".concat(name).padEnd(22, ' ');\n var indent = ' '.repeat(prefix.length + namePadded.length + 1);\n var descWidth = termWidth - indent.length;\n var desc = opt.description || '';\n if (opt.choices) {\n desc += \" [choices: \".concat(opt.choices.join(', '), \"]\");\n }\n if (opt[\"default\"] !== undefined) {\n desc += \" [default: \".concat(opt[\"default\"], \"]\");\n }\n var wrapped = desc ? wrapText(desc, descWidth, indent) : '';\n console.log(\"\".concat(prefix).concat(namePadded, \" \").concat(wrapped, \"\\n\"));\n }\n console.log(examples.join('\\n'));\n}\n\n//# sourceURL=webpack://@jbrowse/cli/./src/utils.ts?\n}");
|
|
516
516
|
|
|
517
517
|
/***/ },
|
|
518
518
|
|
|
@@ -523,7 +523,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
523
523
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
524
524
|
|
|
525
525
|
"use strict";
|
|
526
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nvar version = '4.1.
|
|
526
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ version: () => (/* binding */ version)\n/* harmony export */ });\nvar version = '4.1.15';\n\n//# sourceURL=webpack://@jbrowse/cli/./src/version.ts?\n}");
|
|
527
527
|
|
|
528
528
|
/***/ },
|
|
529
529
|
|
|
@@ -2259,14 +2259,14 @@ eval("{/*!\n * parseurl\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2014
|
|
|
2259
2259
|
|
|
2260
2260
|
/***/ },
|
|
2261
2261
|
|
|
2262
|
-
/***/ "../../node_modules/.pnpm/path-to-regexp@8.
|
|
2262
|
+
/***/ "../../node_modules/.pnpm/path-to-regexp@8.4.1/node_modules/path-to-regexp/dist/index.js"
|
|
2263
2263
|
/*!***********************************************************************************************!*\
|
|
2264
|
-
!*** ../../node_modules/.pnpm/path-to-regexp@8.
|
|
2264
|
+
!*** ../../node_modules/.pnpm/path-to-regexp@8.4.1/node_modules/path-to-regexp/dist/index.js ***!
|
|
2265
2265
|
\***********************************************************************************************/
|
|
2266
2266
|
(__unused_webpack_module, exports) {
|
|
2267
2267
|
|
|
2268
2268
|
"use strict";
|
|
2269
|
-
eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PathError = exports.TokenData = void 0;\nexports.parse = parse;\nexports.compile = compile;\nexports.match = match;\nexports.pathToRegexp = pathToRegexp;\nexports.stringify = stringify;\nconst DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\nconst SIMPLE_TOKENS = {\n // Groups.\n \"{\": \"{\",\n \"}\": \"}\",\n // Reserved.\n \"(\": \"(\",\n \")\": \")\",\n \"[\": \"[\",\n \"]\": \"]\",\n \"+\": \"+\",\n \"?\": \"?\",\n \"!\": \"!\",\n};\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n/**\n * Escape a regular expression string.\n */\nfunction escape(str) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n/**\n * Tokenized path instance.\n */\nclass TokenData {\n constructor(tokens, originalPath) {\n this.tokens = tokens;\n this.originalPath = originalPath;\n }\n}\nexports.TokenData = TokenData;\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nclass PathError extends TypeError {\n constructor(message, originalPath) {\n let text = message;\n if (originalPath)\n text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n this.originalPath = originalPath;\n }\n}\nexports.PathError = PathError;\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options = {}) {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n const tokens = [];\n let index = 0;\n let pos = 0;\n function name() {\n let value = \"\";\n if (ID_START.test(chars[index])) {\n do {\n value += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n }\n else if (chars[index] === '\"') {\n let quoteStart = index;\n while (index++ < chars.length) {\n if (chars[index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n // Increment over escape characters.\n if (chars[index] === \"\\\\\")\n index++;\n value += chars[index];\n }\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n if (!value) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n return value;\n }\n while (index < chars.length) {\n const value = chars[index];\n const type = SIMPLE_TOKENS[value];\n if (type) {\n tokens.push({ type, index: index++, value });\n }\n else if (value === \"\\\\\") {\n tokens.push({ type: \"escape\", index: index++, value: chars[index++] });\n }\n else if (value === \":\") {\n tokens.push({ type: \"param\", index: index++, value: name() });\n }\n else if (value === \"*\") {\n tokens.push({ type: \"wildcard\", index: index++, value: name() });\n }\n else {\n tokens.push({ type: \"char\", index: index++, value });\n }\n }\n tokens.push({ type: \"end\", index, value: \"\" });\n function consumeUntil(endType) {\n const output = [];\n while (true) {\n const token = tokens[pos++];\n if (token.type === endType)\n break;\n if (token.type === \"char\" || token.type === \"escape\") {\n let path = token.value;\n let cur = tokens[pos];\n while (cur.type === \"char\" || cur.type === \"escape\") {\n path += cur.value;\n cur = tokens[++pos];\n }\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n continue;\n }\n if (token.type === \"param\" || token.type === \"wildcard\") {\n output.push({\n type: token.type,\n name: token.value,\n });\n continue;\n }\n if (token.type === \"{\") {\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);\n }\n return output;\n }\n return new TokenData(consumeUntil(\"end\"), str);\n}\n/**\n * Compile a string to a template function for the path.\n */\nfunction compile(path, options = {}) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n return function path(params = {}) {\n const [path, ...missing] = fn(params);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\nfunction tokensToFunction(tokens, delimiter, encode) {\n const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));\n return (data) => {\n const result = [\"\"];\n for (const encoder of encoders) {\n const [value, ...extras] = encoder(data);\n result[0] += value;\n result.push(...extras);\n }\n return result;\n };\n}\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(token, delimiter, encode) {\n if (token.type === \"text\")\n return () => [token.value];\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n return (data) => {\n const [value, ...missing] = fn(data);\n if (!missing.length)\n return [value];\n return [\"\"];\n };\n }\n const encodeValue = encode || NOOP_VALUE;\n if (token.type === \"wildcard\" && encode !== false) {\n return (data) => {\n const value = data[token.name];\n if (value == null)\n return [\"\", token.name];\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n return [\n value\n .map((value, index) => {\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}/${index}\" to be a string`);\n }\n return encodeValue(value);\n })\n .join(delimiter),\n ];\n };\n }\n return (data) => {\n const value = data[token.name];\n if (value == null)\n return [\"\", token.name];\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n return [encodeValue(value)];\n };\n}\n/**\n * Transform a path into a match function.\n */\nfunction match(path, options = {}) {\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const { regexp, keys } = pathToRegexp(path, options);\n const decoders = keys.map((key) => {\n if (decode === false)\n return NOOP_VALUE;\n if (key.type === \"param\")\n return decode;\n return (value) => value.split(delimiter).map(decode);\n });\n return function match(input) {\n const m = regexp.exec(input);\n if (!m)\n return false;\n const path = m[0];\n const params = Object.create(null);\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined)\n continue;\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n return { path, params };\n };\n}\nfunction pathToRegexp(path, options = {}) {\n const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;\n const keys = [];\n const flags = sensitive ? \"\" : \"i\";\n const sources = [];\n for (const input of pathsToArray(path, [])) {\n const data = typeof input === \"object\" ? input : parse(input, options);\n for (const tokens of flatten(data.tokens, 0, [])) {\n sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n }\n }\n let pattern = `^(?:${sources.join(\"|\")})`;\n if (trailing)\n pattern += `(?:${escape(delimiter)}$)?`;\n pattern += end ? \"$\" : `(?=${escape(delimiter)}|$)`;\n const regexp = new RegExp(pattern, flags);\n return { regexp, keys };\n}\n/**\n * Convert a path or array of paths into a flat array.\n */\nfunction pathsToArray(paths, init) {\n if (Array.isArray(paths)) {\n for (const p of paths)\n pathsToArray(p, init);\n }\n else {\n init.push(paths);\n }\n return init;\n}\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction* flatten(tokens, index, init) {\n if (index === tokens.length) {\n return yield init;\n }\n const token = tokens[index];\n if (token.type === \"group\") {\n for (const seq of flatten(token.tokens, 0, init.slice())) {\n yield* flatten(tokens, index + 1, seq);\n }\n }\n else {\n init.push(token);\n }\n yield* flatten(tokens, index + 1, init);\n}\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(tokens, delimiter, keys, originalPath) {\n let result = \"\";\n let backtrack = \"\";\n let isSafeSegmentParam = true;\n for (const token of tokens) {\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter));\n continue;\n }\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (!isSafeSegmentParam && !backtrack) {\n throw new PathError(`Missing text before \"${token.name}\" ${token.type}`, originalPath);\n }\n if (token.type === \"param\") {\n result += `(${negate(delimiter, isSafeSegmentParam ? \"\" : backtrack)}+)`;\n }\n else {\n result += `([\\\\s\\\\S]+)`;\n }\n keys.push(token);\n backtrack = \"\";\n isSafeSegmentParam = false;\n continue;\n }\n }\n return result;\n}\n/**\n * Block backtracking on previous text and ignore delimiter string.\n */\nfunction negate(delimiter, backtrack) {\n if (backtrack.length < 2) {\n if (delimiter.length < 2)\n return `[^${escape(delimiter + backtrack)}]`;\n return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;\n }\n if (delimiter.length < 2) {\n return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;\n }\n return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\\\s\\\\S])`;\n}\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens) {\n let value = \"\";\n let i = 0;\n function name(value) {\n const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]);\n return isSafe ? value : JSON.stringify(value);\n }\n while (i < tokens.length) {\n const token = tokens[i++];\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n if (token.type === \"group\") {\n value += `{${stringifyTokens(token.tokens)}}`;\n continue;\n }\n if (token.type === \"param\") {\n value += `:${name(token.name)}`;\n continue;\n }\n if (token.type === \"wildcard\") {\n value += `*${name(token.name)}`;\n continue;\n }\n throw new TypeError(`Unknown token type: ${token.type}`);\n }\n return value;\n}\n/**\n * Stringify token data into a path string.\n */\nfunction stringify(data) {\n return stringifyTokens(data.tokens);\n}\n/**\n * Validate the parameter name contains valid ID characters.\n */\nfunction isNameSafe(name) {\n const [first, ...rest] = name;\n return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));\n}\n/**\n * Validate the next token does not interfere with the current param name.\n */\nfunction isNextNameSafe(token) {\n if (token && token.type === \"text\")\n return !ID_CONTINUE.test(token.value[0]);\n return true;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/path-to-regexp@8.3.0/node_modules/path-to-regexp/dist/index.js?\n}");
|
|
2269
|
+
eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PathError = exports.TokenData = void 0;\nexports.parse = parse;\nexports.compile = compile;\nexports.match = match;\nexports.pathToRegexp = pathToRegexp;\nexports.stringify = stringify;\nconst DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\nconst ID = /^[$_\\p{ID_Start}][$\\u200c\\u200d\\p{ID_Continue}]*$/u;\nconst SIMPLE_TOKENS = \"{}()[]+?!\";\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n/**\n * Escape a regular expression string.\n */\nfunction escape(str) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n/**\n * Tokenized path instance.\n */\nclass TokenData {\n constructor(tokens, originalPath) {\n this.tokens = tokens;\n this.originalPath = originalPath;\n }\n}\nexports.TokenData = TokenData;\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nclass PathError extends TypeError {\n constructor(message, originalPath) {\n let text = message;\n if (originalPath)\n text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n this.originalPath = originalPath;\n }\n}\nexports.PathError = PathError;\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options = {}) {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n const tokens = [];\n let index = 0;\n let pos = 0;\n function name() {\n let value = \"\";\n if (ID_START.test(chars[index])) {\n do {\n value += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n }\n else if (chars[index] === '\"') {\n let quoteStart = index;\n while (index < chars.length) {\n if (chars[++index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n // Increment over escape characters.\n if (chars[index] === \"\\\\\")\n index++;\n value += chars[index];\n }\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n if (!value) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n return value;\n }\n while (index < chars.length) {\n const value = chars[index++];\n if (SIMPLE_TOKENS.includes(value)) {\n tokens.push({ type: value, index, value });\n }\n else if (value === \"\\\\\") {\n tokens.push({ type: \"escape\", index, value: chars[index++] });\n }\n else if (value === \":\") {\n tokens.push({ type: \"param\", index, value: name() });\n }\n else if (value === \"*\") {\n tokens.push({ type: \"wildcard\", index, value: name() });\n }\n else {\n tokens.push({ type: \"char\", index, value });\n }\n }\n tokens.push({ type: \"end\", index, value: \"\" });\n function consumeUntil(endType) {\n const output = [];\n while (true) {\n const token = tokens[pos++];\n if (token.type === endType)\n break;\n if (token.type === \"char\" || token.type === \"escape\") {\n let path = token.value;\n let cur = tokens[pos];\n while (cur.type === \"char\" || cur.type === \"escape\") {\n path += cur.value;\n cur = tokens[++pos];\n }\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n continue;\n }\n if (token.type === \"param\" || token.type === \"wildcard\") {\n output.push({\n type: token.type,\n name: token.value,\n });\n continue;\n }\n if (token.type === \"{\") {\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);\n }\n return output;\n }\n return new TokenData(consumeUntil(\"end\"), str);\n}\n/**\n * Compile a string to a template function for the path.\n */\nfunction compile(path, options = {}) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n return function path(params = {}) {\n const [path, ...missing] = fn(params);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\nfunction tokensToFunction(tokens, delimiter, encode) {\n const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));\n return (data) => {\n const result = [\"\"];\n for (const encoder of encoders) {\n const [value, ...extras] = encoder(data);\n result[0] += value;\n result.push(...extras);\n }\n return result;\n };\n}\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(token, delimiter, encode) {\n if (token.type === \"text\")\n return () => [token.value];\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n return (data) => {\n const [value, ...missing] = fn(data);\n if (!missing.length)\n return [value];\n return [\"\"];\n };\n }\n const encodeValue = encode || NOOP_VALUE;\n if (token.type === \"wildcard\" && encode !== false) {\n return (data) => {\n const value = data[token.name];\n if (value == null)\n return [\"\", token.name];\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n return [\n value\n .map((value, index) => {\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}/${index}\" to be a string`);\n }\n return encodeValue(value);\n })\n .join(delimiter),\n ];\n };\n }\n return (data) => {\n const value = data[token.name];\n if (value == null)\n return [\"\", token.name];\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n return [encodeValue(value)];\n };\n}\n/**\n * Transform a path into a match function.\n */\nfunction match(path, options = {}) {\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n const { regexp, keys } = pathToRegexp(path, options);\n const decoders = keys.map((key) => {\n if (decode === false)\n return NOOP_VALUE;\n if (key.type === \"param\")\n return decode;\n return (value) => value.split(delimiter).map(decode);\n });\n return function match(input) {\n const m = regexp.exec(input);\n if (!m)\n return false;\n const path = m[0];\n const params = Object.create(null);\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined)\n continue;\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n return { path, params };\n };\n}\n/**\n * Transform a path into a regular expression and capture keys.\n */\nfunction pathToRegexp(path, options = {}) {\n const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;\n const keys = [];\n const sources = [];\n const paths = [path];\n let combinations = 0;\n while (paths.length) {\n const path = paths.shift();\n if (Array.isArray(path)) {\n paths.push(...path);\n continue;\n }\n const data = typeof path === \"object\" ? path : parse(path, options);\n flatten(data.tokens, 0, [], (tokens) => {\n if (combinations++ >= 256) {\n throw new PathError(\"Too many path combinations\", data.originalPath);\n }\n sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n });\n }\n let pattern = `^(?:${sources.join(\"|\")})`;\n if (trailing)\n pattern += \"(?:\" + escape(delimiter) + \"$)?\";\n pattern += end ? \"$\" : \"(?=\" + escape(delimiter) + \"|$)\";\n return { regexp: new RegExp(pattern, sensitive ? \"\" : \"i\"), keys };\n}\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction flatten(tokens, index, result, callback) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"group\") {\n flatten(token.tokens, 0, result.slice(), (seq) => flatten(tokens, index, seq, callback));\n continue;\n }\n result.push(token);\n }\n callback(result);\n}\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(tokens, delimiter, keys, originalPath) {\n let result = \"\";\n let backtrack = \"\";\n let wildcardBacktrack = \"\";\n let prevCaptureType = 0;\n let hasSegmentCapture = 0;\n let index = 0;\n function hasInSegment(index, type) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === type)\n return true;\n if (token.type === \"text\") {\n if (token.value.includes(delimiter))\n break;\n }\n }\n return false;\n }\n function peekText(index) {\n let result = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type !== \"text\")\n break;\n result += token.value;\n }\n return result;\n }\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n if (prevCaptureType === 2)\n wildcardBacktrack += token.value;\n if (token.value.includes(delimiter))\n hasSegmentCapture = 0;\n continue;\n }\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (prevCaptureType && !backtrack) {\n throw new PathError(`Missing text before \"${token.name}\" ${token.type}`, originalPath);\n }\n if (token.type === \"param\") {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(delimiter, backtrack)}+)`\n : hasInSegment(index, \"wildcard\") // See wildcard later in segment.\n ? `(${negate(delimiter, peekText(index))}+)`\n : hasSegmentCapture & 1 // Seen parameter in segment.\n ? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})`\n : `(${negate(delimiter, \"\")}+)`;\n hasSegmentCapture |= prevCaptureType = 1;\n }\n else {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(backtrack, \"\")}+)`\n : wildcardBacktrack // No capture in segment, seen wildcard in path.\n ? `(${negate(wildcardBacktrack, \"\")}+|${negate(delimiter, \"\")}+)`\n : `([^]+)`;\n wildcardBacktrack = \"\";\n hasSegmentCapture |= prevCaptureType = 2;\n }\n keys.push(token);\n backtrack = \"\";\n continue;\n }\n throw new TypeError(`Unknown token type: ${token.type}`);\n }\n return result;\n}\n/**\n * Block backtracking on previous text/delimiter.\n */\nfunction negate(a, b) {\n if (b.length > a.length)\n return negate(b, a); // Longest string first.\n if (a === b)\n b = \"\"; // Cleaner regex strings, no duplication.\n if (b.length > 1)\n return `(?:(?!${escape(a)}|${escape(b)})[^])`;\n if (a.length > 1)\n return `(?:(?!${escape(a)})[^${escape(b)}])`;\n return `[^${escape(a + b)}]`;\n}\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens, index) {\n let value = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n if (token.type === \"group\") {\n value += \"{\" + stringifyTokens(token.tokens, 0) + \"}\";\n continue;\n }\n if (token.type === \"param\") {\n value += \":\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n if (token.type === \"wildcard\") {\n value += \"*\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n throw new TypeError(`Unknown token type: ${token.type}`);\n }\n return value;\n}\n/**\n * Stringify token data into a path string.\n */\nfunction stringify(data) {\n return stringifyTokens(data.tokens, 0);\n}\n/**\n * Stringify a parameter name, escaping when it cannot be emitted directly.\n */\nfunction stringifyName(name, next) {\n if (!ID.test(name))\n return JSON.stringify(name);\n if ((next === null || next === void 0 ? void 0 : next.type) === \"text\" && ID_CONTINUE.test(next.value[0])) {\n return JSON.stringify(name);\n }\n return name;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/path-to-regexp@8.4.1/node_modules/path-to-regexp/dist/index.js?\n}");
|
|
2270
2270
|
|
|
2271
2271
|
/***/ },
|
|
2272
2272
|
|
|
@@ -2559,7 +2559,7 @@ eval("{/*!\n * router\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014
|
|
|
2559
2559
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
2560
2560
|
|
|
2561
2561
|
"use strict";
|
|
2562
|
-
eval("{/*!\n * router\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nconst isPromise = __webpack_require__(/*! is-promise */ \"../../node_modules/.pnpm/is-promise@4.0.0/node_modules/is-promise/index.js\")\nconst pathRegexp = __webpack_require__(/*! path-to-regexp */ \"../../node_modules/.pnpm/path-to-regexp@8.
|
|
2562
|
+
eval("{/*!\n * router\n * Copyright(c) 2013 Roman Shtylman\n * Copyright(c) 2014-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n\n\n/**\n * Module dependencies.\n * @private\n */\n\nconst isPromise = __webpack_require__(/*! is-promise */ \"../../node_modules/.pnpm/is-promise@4.0.0/node_modules/is-promise/index.js\")\nconst pathRegexp = __webpack_require__(/*! path-to-regexp */ \"../../node_modules/.pnpm/path-to-regexp@8.4.1/node_modules/path-to-regexp/dist/index.js\")\nconst debug = __webpack_require__(/*! debug */ \"../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js\")('router:layer')\nconst deprecate = __webpack_require__(/*! depd */ \"../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js\")('router')\n\n/**\n * Module variables.\n * @private\n */\n\nconst TRAILING_SLASH_REGEXP = /\\/+$/\nconst MATCHING_GROUP_REGEXP = /\\((?:\\?<(.*?)>)?(?!\\?)/g\n\n/**\n * Expose `Layer`.\n */\n\nmodule.exports = Layer\n\nfunction Layer (path, options, fn) {\n if (!(this instanceof Layer)) {\n return new Layer(path, options, fn)\n }\n\n debug('new %o', path)\n const opts = options || {}\n\n this.handle = fn\n this.keys = []\n this.name = fn.name || '<anonymous>'\n this.params = undefined\n this.path = undefined\n this.slash = path === '/' && opts.end === false\n\n function matcher (_path) {\n if (_path instanceof RegExp) {\n const keys = []\n let name = 0\n let m\n // eslint-disable-next-line no-cond-assign\n while (m = MATCHING_GROUP_REGEXP.exec(_path.source)) {\n keys.push({\n name: m[1] || name++,\n offset: m.index\n })\n }\n\n return function regexpMatcher (p) {\n const match = _path.exec(p)\n if (!match) {\n return false\n }\n\n const params = {}\n for (let i = 1; i < match.length; i++) {\n const key = keys[i - 1]\n const prop = key.name\n const val = decodeParam(match[i])\n\n if (val !== undefined) {\n params[prop] = val\n }\n }\n\n return {\n params,\n path: match[0]\n }\n }\n }\n\n return pathRegexp.match((opts.strict ? _path : loosen(_path)), {\n sensitive: opts.sensitive,\n end: opts.end,\n trailing: !opts.strict,\n decode: decodeParam\n })\n }\n this.matchers = Array.isArray(path) ? path.map(matcher) : [matcher(path)]\n}\n\n/**\n * Handle the error for the layer.\n *\n * @param {Error} error\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handleError = function handleError (error, req, res, next) {\n const fn = this.handle\n\n if (fn.length !== 4) {\n // not a standard error handler\n return next(error)\n }\n\n try {\n // invoke function\n const ret = fn(error, req, res, next)\n\n // wait for returned promise\n if (isPromise(ret)) {\n if (!(ret instanceof Promise)) {\n deprecate('handlers that are Promise-like are deprecated, use a native Promise instead')\n }\n\n ret.then(null, function (error) {\n next(error || new Error('Rejected promise'))\n })\n }\n } catch (err) {\n next(err)\n }\n}\n\n/**\n * Handle the request for the layer.\n *\n * @param {Request} req\n * @param {Response} res\n * @param {function} next\n * @api private\n */\n\nLayer.prototype.handleRequest = function handleRequest (req, res, next) {\n const fn = this.handle\n\n if (fn.length > 3) {\n // not a standard request handler\n return next()\n }\n\n try {\n // invoke function\n const ret = fn(req, res, next)\n\n // wait for returned promise\n if (isPromise(ret)) {\n if (!(ret instanceof Promise)) {\n deprecate('handlers that are Promise-like are deprecated, use a native Promise instead')\n }\n\n ret.then(null, function (error) {\n next(error || new Error('Rejected promise'))\n })\n }\n } catch (err) {\n next(err)\n }\n}\n\n/**\n * Check if this route matches `path`, if so\n * populate `.params`.\n *\n * @param {String} path\n * @return {Boolean}\n * @api private\n */\n\nLayer.prototype.match = function match (path) {\n let match\n\n if (path != null) {\n // fast path non-ending match for / (any path matches)\n if (this.slash) {\n this.params = {}\n this.path = ''\n return true\n }\n\n let i = 0\n while (!match && i < this.matchers.length) {\n // match the path\n match = this.matchers[i](path)\n i++\n }\n }\n\n if (!match) {\n this.params = undefined\n this.path = undefined\n return false\n }\n\n // store values\n this.params = match.params\n this.path = match.path\n this.keys = Object.keys(match.params)\n\n return true\n}\n\n/**\n * Decode param value.\n *\n * @param {string} val\n * @return {string}\n * @private\n */\n\nfunction decodeParam (val) {\n if (typeof val !== 'string' || val.length === 0) {\n return val\n }\n\n try {\n return decodeURIComponent(val)\n } catch (err) {\n if (err instanceof URIError) {\n err.message = 'Failed to decode param \\'' + val + '\\''\n err.status = 400\n }\n\n throw err\n }\n}\n\n/**\n * Loosens the given path for path-to-regexp matching.\n */\nfunction loosen (path) {\n if (path instanceof RegExp || path === '/') {\n return path\n }\n\n return Array.isArray(path)\n ? path.map(function (p) { return loosen(p) })\n : String(path).replace(TRAILING_SLASH_REGEXP, '')\n}\n\n\n//# sourceURL=webpack://@jbrowse/cli/../../node_modules/.pnpm/router@2.2.0/node_modules/router/lib/layer.js?\n}");
|
|
2563
2563
|
|
|
2564
2564
|
/***/ },
|
|
2565
2565
|
|
|
@@ -3546,12 +3546,6 @@ eval("{module.exports = /*#__PURE__*/JSON.parse('{\"100\":\"Continue\",\"101\":\
|
|
|
3546
3546
|
/******/ if (cachedModule !== undefined) {
|
|
3547
3547
|
/******/ return cachedModule.exports;
|
|
3548
3548
|
/******/ }
|
|
3549
|
-
/******/ // Check if module exists (development only)
|
|
3550
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
3551
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
3552
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
3553
|
-
/******/ throw e;
|
|
3554
|
-
/******/ }
|
|
3555
3549
|
/******/ // Create a new module (and put it into the cache)
|
|
3556
3550
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
3557
3551
|
/******/ id: moduleId,
|
|
@@ -3560,6 +3554,12 @@ eval("{module.exports = /*#__PURE__*/JSON.parse('{\"100\":\"Continue\",\"101\":\
|
|
|
3560
3554
|
/******/ };
|
|
3561
3555
|
/******/
|
|
3562
3556
|
/******/ // Execute the module function
|
|
3557
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
3558
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
3559
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
3560
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
3561
|
+
/******/ throw e;
|
|
3562
|
+
/******/ }
|
|
3563
3563
|
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
3564
3564
|
/******/
|
|
3565
3565
|
/******/ // Flag the module as loaded
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.1.
|
|
1
|
+
export const version = '4.1.15';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/cli",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A command line tool for working with JBrowse 2",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"ixixx": "^3.0.3",
|
|
38
38
|
"json-parse-better-errors": "^1.0.2",
|
|
39
39
|
"tmp": "^0.2.5",
|
|
40
|
-
"@jbrowse/text-indexing-core": "^4.1.
|
|
40
|
+
"@jbrowse/text-indexing-core": "^4.1.15"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|