@difizen/libro-terminal 0.0.0-snapshot-20241017072317

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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/es/command.d.ts +18 -0
  4. package/es/command.d.ts.map +1 -0
  5. package/es/command.js +150 -0
  6. package/es/configuration.d.ts +35 -0
  7. package/es/configuration.d.ts.map +1 -0
  8. package/es/configuration.js +242 -0
  9. package/es/connection.d.ts +109 -0
  10. package/es/connection.d.ts.map +1 -0
  11. package/es/connection.js +390 -0
  12. package/es/index.d.ts +12 -0
  13. package/es/index.d.ts.map +1 -0
  14. package/es/index.js +11 -0
  15. package/es/index.less +9 -0
  16. package/es/manager.d.ts +108 -0
  17. package/es/manager.d.ts.map +1 -0
  18. package/es/manager.js +515 -0
  19. package/es/module.d.ts +4 -0
  20. package/es/module.d.ts.map +1 -0
  21. package/es/module.js +29 -0
  22. package/es/protocol.d.ts +87 -0
  23. package/es/protocol.d.ts.map +1 -0
  24. package/es/protocol.js +16 -0
  25. package/es/restapi.d.ts +11 -0
  26. package/es/restapi.d.ts.map +1 -0
  27. package/es/restapi.js +181 -0
  28. package/es/stateful-view.d.ts +9 -0
  29. package/es/stateful-view.d.ts.map +1 -0
  30. package/es/stateful-view.js +35 -0
  31. package/es/theme-service.d.ts +24 -0
  32. package/es/theme-service.d.ts.map +1 -0
  33. package/es/theme-service.js +218 -0
  34. package/es/view.d.ts +137 -0
  35. package/es/view.d.ts.map +1 -0
  36. package/es/view.js +639 -0
  37. package/package.json +69 -0
  38. package/src/command.ts +78 -0
  39. package/src/configuration.ts +295 -0
  40. package/src/connection.ts +355 -0
  41. package/src/index.less +9 -0
  42. package/src/index.spec.ts +8 -0
  43. package/src/index.ts +12 -0
  44. package/src/manager.ts +313 -0
  45. package/src/module.ts +49 -0
  46. package/src/protocol.ts +103 -0
  47. package/src/restapi.ts +76 -0
  48. package/src/stateful-view.ts +20 -0
  49. package/src/theme-service.ts +214 -0
  50. package/src/view.tsx +634 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Difizen Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # libro-widget
@@ -0,0 +1,18 @@
1
+ import type { Command, CommandRegistry, KeybindingRegistry } from '@difizen/mana-app';
2
+ import { ConfigurationService, KeybindingContribution } from '@difizen/mana-app';
3
+ import { SlotViewManager } from '@difizen/mana-app';
4
+ import { ViewManager } from '@difizen/mana-app';
5
+ import { CommandContribution } from '@difizen/mana-app';
6
+ import { TerminalManager } from './manager.js';
7
+ export declare const TerminalCommands: Record<string, Command & {
8
+ keybind?: string;
9
+ }>;
10
+ export declare class TerminalCommandContribution implements CommandContribution, KeybindingContribution {
11
+ viewManager: ViewManager;
12
+ protected slotManager: SlotViewManager;
13
+ protected config: ConfigurationService;
14
+ manager: TerminalManager;
15
+ registerKeybindings(keybindings: KeybindingRegistry): void;
16
+ registerCommands(commands: CommandRegistry): void;
17
+ }
18
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAU,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAU3E,CAAC;AAEF,qBACa,2BACX,YAAW,mBAAmB,EAAE,sBAAsB;IAEjC,WAAW,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,WAAW,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAC5C,OAAO,EAAE,eAAe,CAAC;IAClD,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI;IAS1D,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;CAqClD"}
package/es/command.js ADDED
@@ -0,0 +1,150 @@
1
+ function _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); }
2
+ var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
3
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
13
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
14
+ import { ConfigurationService, KeybindingContribution } from '@difizen/mana-app';
15
+ import { SlotViewManager } from '@difizen/mana-app';
16
+ import { inject, ViewManager } from '@difizen/mana-app';
17
+ import { singleton } from '@difizen/mana-app';
18
+ import { CommandContribution } from '@difizen/mana-app';
19
+ import { terminalDefaultSlot } from "./configuration.js";
20
+ import { TerminalManager } from "./manager.js";
21
+ import { LibroTerminalView } from "./view.js";
22
+ export var TerminalCommands = {
23
+ OpenTerminal: {
24
+ id: 'libro-terminal-open',
25
+ label: '新建终端',
26
+ keybind: 'ctrl+`'
27
+ },
28
+ CloseTerminal: {
29
+ id: 'libro-terminal-close',
30
+ label: '关闭终端'
31
+ }
32
+ };
33
+ export var TerminalCommandContribution = (_dec = singleton({
34
+ contrib: [CommandContribution, KeybindingContribution]
35
+ }), _dec2 = inject(ViewManager), _dec3 = inject(SlotViewManager), _dec4 = inject(ConfigurationService), _dec5 = inject(TerminalManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
36
+ function TerminalCommandContribution() {
37
+ _classCallCheck(this, TerminalCommandContribution);
38
+ _initializerDefineProperty(this, "viewManager", _descriptor, this);
39
+ _initializerDefineProperty(this, "slotManager", _descriptor2, this);
40
+ _initializerDefineProperty(this, "config", _descriptor3, this);
41
+ _initializerDefineProperty(this, "manager", _descriptor4, this);
42
+ }
43
+ _createClass(TerminalCommandContribution, [{
44
+ key: "registerKeybindings",
45
+ value: function registerKeybindings(keybindings) {
46
+ if (TerminalCommands['OpenTerminal'].keybind) {
47
+ keybindings.registerKeybinding({
48
+ keybinding: TerminalCommands['OpenTerminal'].keybind,
49
+ command: TerminalCommands['OpenTerminal'].id
50
+ });
51
+ }
52
+ }
53
+ }, {
54
+ key: "registerCommands",
55
+ value: function registerCommands(commands) {
56
+ var _this = this;
57
+ commands.registerCommand(TerminalCommands['OpenTerminal'], {
58
+ execute: function () {
59
+ var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(name) {
60
+ var terminalView, slot;
61
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
62
+ while (1) switch (_context.prev = _context.next) {
63
+ case 0:
64
+ _context.prev = 0;
65
+ _context.next = 3;
66
+ return _this.viewManager.getOrCreateView(LibroTerminalView, _this.manager.getTerminalArgs(name));
67
+ case 3:
68
+ terminalView = _context.sent;
69
+ _context.next = 6;
70
+ return _this.config.get(terminalDefaultSlot);
71
+ case 6:
72
+ slot = _context.sent;
73
+ if (slot) {
74
+ _this.slotManager.addView(terminalView, slot, {
75
+ reveal: true
76
+ });
77
+ }
78
+ _context.next = 13;
79
+ break;
80
+ case 10:
81
+ _context.prev = 10;
82
+ _context.t0 = _context["catch"](0);
83
+ console.error(_context.t0);
84
+ case 13:
85
+ case "end":
86
+ return _context.stop();
87
+ }
88
+ }, _callee, null, [[0, 10]]);
89
+ }));
90
+ function execute(_x) {
91
+ return _execute.apply(this, arguments);
92
+ }
93
+ return execute;
94
+ }()
95
+ });
96
+ commands.registerCommand(TerminalCommands['CloseTerminal'], {
97
+ execute: function () {
98
+ var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(name) {
99
+ var terminalView;
100
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
101
+ while (1) switch (_context2.prev = _context2.next) {
102
+ case 0:
103
+ _context2.prev = 0;
104
+ _context2.next = 3;
105
+ return _this.viewManager.getOrCreateView(LibroTerminalView, _this.manager.getTerminalArgs(name));
106
+ case 3:
107
+ terminalView = _context2.sent;
108
+ terminalView.dispose();
109
+ _context2.next = 10;
110
+ break;
111
+ case 7:
112
+ _context2.prev = 7;
113
+ _context2.t0 = _context2["catch"](0);
114
+ console.error(_context2.t0);
115
+ case 10:
116
+ case "end":
117
+ return _context2.stop();
118
+ }
119
+ }, _callee2, null, [[0, 7]]);
120
+ }));
121
+ function execute(_x2) {
122
+ return _execute2.apply(this, arguments);
123
+ }
124
+ return execute;
125
+ }()
126
+ });
127
+ }
128
+ }]);
129
+ return TerminalCommandContribution;
130
+ }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "viewManager", [_dec2], {
131
+ configurable: true,
132
+ enumerable: true,
133
+ writable: true,
134
+ initializer: null
135
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "slotManager", [_dec3], {
136
+ configurable: true,
137
+ enumerable: true,
138
+ writable: true,
139
+ initializer: null
140
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "config", [_dec4], {
141
+ configurable: true,
142
+ enumerable: true,
143
+ writable: true,
144
+ initializer: null
145
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "manager", [_dec5], {
146
+ configurable: true,
147
+ enumerable: true,
148
+ writable: true,
149
+ initializer: null
150
+ })), _class2)) || _class);
@@ -0,0 +1,35 @@
1
+ import type { ConfigurationNode } from '@difizen/mana-app';
2
+ import { ConfigurationContribution } from '@difizen/mana-app';
3
+ export type TerminalRendererType = 'canvas' | 'dom';
4
+ export declare const DEFAULT_TERMINAL_RENDERER_TYPE = "canvas";
5
+ export declare function isTerminalRendererType(arg: any): arg is TerminalRendererType;
6
+ export type CursorStyle = 'block' | 'underline' | 'bar';
7
+ export declare const terminalDefaultSlot: ConfigurationNode<string | undefined>;
8
+ export declare const terminalEnableCopy: ConfigurationNode<boolean>;
9
+ export declare const terminalEnablePaste: ConfigurationNode<boolean>;
10
+ export declare const terminalIntegratedFontFamily: ConfigurationNode<string>;
11
+ export declare const terminalIntegratedFontSize: ConfigurationNode<number>;
12
+ export declare const terminalIntegratedFontWeight: ConfigurationNode<string>;
13
+ export declare const terminalIntegratedFontWeightBold: ConfigurationNode<string>;
14
+ export declare const terminalIntegratedDrawBoldTextInBrightColors: ConfigurationNode<boolean>;
15
+ export declare const terminalIntegratedLetterSpacing: ConfigurationNode<number>;
16
+ export declare const terminalIntegratedLineHeight: ConfigurationNode<number>;
17
+ export declare const terminalIntegratedScrollback: ConfigurationNode<number>;
18
+ export declare const terminalIntegratedFastScrollSensitivity: ConfigurationNode<number>;
19
+ export declare const terminalIntegratedRendererType: ConfigurationNode<string>;
20
+ export declare const terminalIntegratedCopyOnSelection: ConfigurationNode<boolean>;
21
+ export declare const terminalIntegratedCursorBlinking: ConfigurationNode<boolean>;
22
+ export declare const terminalIntegratedCursorStyle: ConfigurationNode<string>;
23
+ export declare const terminalIntegratedCursorWidth: ConfigurationNode<number>;
24
+ export declare const terminalIntegratedShellWindows: ConfigurationNode<string | undefined>;
25
+ export declare const terminalIntegratedShellOsx: ConfigurationNode<string | undefined>;
26
+ export declare const terminalIntegratedShellLinux: ConfigurationNode<string | undefined>;
27
+ export declare const terminalIntegratedShellArgsWindows: ConfigurationNode<string[]>;
28
+ export declare const terminalIntegratedShellArgsOsx: ConfigurationNode<string[]>;
29
+ export declare const terminalIntegratedShellArgsLinux: ConfigurationNode<string[]>;
30
+ export declare const terminalIntegratedConfirmOnExit: ConfigurationNode<string>;
31
+ export declare class TerminalConfiguration implements ConfigurationContribution {
32
+ configs: (ConfigurationNode<string | undefined> | ConfigurationNode<boolean> | ConfigurationNode<number> | ConfigurationNode<string[]>)[];
33
+ registerConfigurations(): (ConfigurationNode<string | undefined> | ConfigurationNode<boolean> | ConfigurationNode<number> | ConfigurationNode<string[]>)[];
34
+ }
35
+ //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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AAiB,CAAC,OAAO,CASxE,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,iBAAiB,CAAC,OAAO,CAQvE,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,CAAC,MAAM,CAQnE,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,CAAC,MAAM,CASnE,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,iBAAiB,CAAC,MAAM,GAAG,SAAS,CAShF,CAAC;AACF,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,CAAC,MAAM,GAAG,SAAS,CAQ5E,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,iBAAiB,CAAC,MAAM,GAAG,SAAS,CAQ9E,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAS1E,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAStE,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CASxE,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,iBAAiB,CAAC,MAAM,CAcrE,CAAC;AAEF,qBACa,qBAAsB,YAAW,yBAAyB;IACrE,OAAO,mIAyBL;IAEF,sBAAsB;CAGvB"}
@@ -0,0 +1,242 @@
1
+ function _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); }
2
+ var _dec, _class;
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ import { isOSX, isWindows, singleton, ConfigurationContribution } from '@difizen/mana-app';
9
+ export var DEFAULT_TERMINAL_RENDERER_TYPE = 'canvas';
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ export function isTerminalRendererType(arg) {
12
+ return typeof arg === 'string' && (arg === 'canvas' || arg === 'dom');
13
+ }
14
+ export var terminalDefaultSlot = {
15
+ id: 'terminal.default.slot',
16
+ schema: {
17
+ type: 'string'
18
+ },
19
+ description: 'The location where the terminal is opened by default.',
20
+ defaultValue: undefined
21
+ };
22
+ export var terminalEnableCopy = {
23
+ id: 'terminal.enableCopy',
24
+ schema: {
25
+ type: 'boolean'
26
+ },
27
+ description: 'Enable ctrl-c (cmd-c on macOS) to copy selected text',
28
+ defaultValue: true
29
+ };
30
+ export var terminalEnablePaste = {
31
+ id: 'terminal.enablePaste',
32
+ schema: {
33
+ type: 'boolean'
34
+ },
35
+ description: 'Enable ctrl-v (cmd-v on macOS) to paste from clipboard',
36
+ defaultValue: true
37
+ };
38
+ export var terminalIntegratedFontFamily = {
39
+ id: 'terminal.integrated.fontFamily',
40
+ schema: {
41
+ type: 'string'
42
+ },
43
+ description: "Controls the font family of the terminal, this defaults to `#editor.fontFamily#`'s value.",
44
+ defaultValue: isOSX ? "Menlo, Monaco, 'Courier New', monospace" : isWindows ? "Consolas, 'Courier New', monospace" : "'Droid Sans Mono', 'monospace', monospace"
45
+ };
46
+ export var terminalIntegratedFontSize = {
47
+ id: 'terminal.integrated.fontSize',
48
+ schema: {
49
+ type: 'number',
50
+ minimum: 6
51
+ },
52
+ description: 'Controls the font size in pixels of the terminal.',
53
+ defaultValue: 12
54
+ };
55
+ export var terminalIntegratedFontWeight = {
56
+ id: 'terminal.integrated.fontWeight',
57
+ schema: {
58
+ type: 'string'
59
+ },
60
+ // enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
61
+ description: 'The font weight to use within the terminal for non-bold text. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.',
62
+ defaultValue: 'normal'
63
+ };
64
+ export var terminalIntegratedFontWeightBold = {
65
+ id: 'terminal.integrated.fontWeightBold',
66
+ schema: {
67
+ type: 'string'
68
+ },
69
+ // enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
70
+ description: 'The font weight to use within the terminal for bold text. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.',
71
+ defaultValue: 'bold'
72
+ };
73
+ export var terminalIntegratedDrawBoldTextInBrightColors = {
74
+ id: 'terminal.integrated.drawBoldTextInBrightColors',
75
+ description: 'Controls whether bold text in the terminal will always use the "bright" ANSI color variant.',
76
+ schema: {
77
+ type: 'boolean'
78
+ },
79
+ defaultValue: true
80
+ };
81
+ export var terminalIntegratedLetterSpacing = {
82
+ id: 'terminal.integrated.letterSpacing',
83
+ description: 'Controls the letter spacing of the terminal, this is an integer value which represents the amount of additional pixels to add between characters.',
84
+ schema: {
85
+ type: 'number'
86
+ },
87
+ defaultValue: 1
88
+ };
89
+ export var terminalIntegratedLineHeight = {
90
+ id: 'terminal.integrated.lineHeight',
91
+ description: 'Controls the line height of the terminal, this number is multiplied by the terminal font size to get the actual line-height in pixels.',
92
+ schema: {
93
+ type: 'number',
94
+ minimum: 1
95
+ },
96
+ defaultValue: 1
97
+ };
98
+ export var terminalIntegratedScrollback = {
99
+ id: 'terminal.integrated.scrollback',
100
+ description: 'Controls the maximum amount of lines the terminal keeps in its buffer.',
101
+ schema: {
102
+ type: 'number'
103
+ },
104
+ defaultValue: 1000
105
+ };
106
+ export var terminalIntegratedFastScrollSensitivity = {
107
+ id: 'terminal.integrated.fastScrollSensitivity',
108
+ description: 'Scrolling speed multiplier when pressing `Alt`.',
109
+ schema: {
110
+ type: 'number'
111
+ },
112
+ defaultValue: 5
113
+ };
114
+ export var terminalIntegratedRendererType = {
115
+ id: 'terminal.integrated.rendererType',
116
+ description: 'Controls how the terminal is rendered.',
117
+ schema: {
118
+ type: 'string'
119
+ },
120
+ // enum: ['canvas', 'dom'],
121
+ defaultValue: 'canvas'
122
+ };
123
+ export var terminalIntegratedCopyOnSelection = {
124
+ id: 'terminal.integrated.copyOnSelection',
125
+ description: 'Controls whether text selected in the terminal will be copied to the clipboard.',
126
+ schema: {
127
+ type: 'boolean'
128
+ },
129
+ defaultValue: false
130
+ };
131
+ export var terminalIntegratedCursorBlinking = {
132
+ id: 'terminal.integrated.cursorBlinking',
133
+ description: 'Controls whether the terminal cursor blinks.',
134
+ schema: {
135
+ type: 'boolean'
136
+ },
137
+ defaultValue: false
138
+ };
139
+ export var terminalIntegratedCursorStyle = {
140
+ id: 'terminal.integrated.cursorStyle',
141
+ description: 'Controls the style of terminal cursor.',
142
+ // enum: ['block', 'underline', 'line'],
143
+ defaultValue: 'block',
144
+ schema: {
145
+ type: 'string'
146
+ }
147
+ };
148
+ export var terminalIntegratedCursorWidth = {
149
+ id: 'terminal.integrated.cursorWidth',
150
+ description: 'Controls the width of the cursor when `#terminal.integrated.cursorStyle#` is set to `line`.',
151
+ schema: {
152
+ type: 'number'
153
+ },
154
+ defaultValue: 1
155
+ };
156
+ export var terminalIntegratedShellWindows = {
157
+ id: 'terminal.integrated.shell.windows',
158
+ schema: {
159
+ type: 'string'
160
+ },
161
+ // typeDetails: { isFilepath: true },
162
+ description: "The path of the shell that the terminal uses on Windows. (defaultValue: '{0}').",
163
+ defaultValue: undefined
164
+ };
165
+ export var terminalIntegratedShellOsx = {
166
+ id: 'terminal.integrated.shell.osx',
167
+ schema: {
168
+ type: 'string'
169
+ },
170
+ description: "The path of the shell that the terminal uses on macOS (defaultValue: '{0}'}).",
171
+ defaultValue: undefined
172
+ };
173
+ export var terminalIntegratedShellLinux = {
174
+ id: 'terminal.integrated.shell.linux',
175
+ schema: {
176
+ type: 'string'
177
+ },
178
+ description: "The path of the shell that the terminal uses on Linux (defaultValue: '{0}'}).",
179
+ defaultValue: undefined
180
+ };
181
+ export var terminalIntegratedShellArgsWindows = {
182
+ id: 'terminal.integrated.shellArgs.windows',
183
+ schema: {
184
+ type: 'array',
185
+ items: {
186
+ type: 'string'
187
+ }
188
+ },
189
+ description: 'The command line arguments to use when on the Windows terminal.',
190
+ defaultValue: []
191
+ };
192
+ export var terminalIntegratedShellArgsOsx = {
193
+ id: 'terminal.integrated.shellArgs.osx',
194
+ schema: {
195
+ type: 'array',
196
+ items: {
197
+ type: 'string'
198
+ }
199
+ },
200
+ description: 'The command line arguments to use when on the macOS terminal.',
201
+ defaultValue: ['-l']
202
+ };
203
+ export var terminalIntegratedShellArgsLinux = {
204
+ id: 'terminal.integrated.shellArgs.linux',
205
+ schema: {
206
+ type: 'array',
207
+ items: {
208
+ type: 'string'
209
+ }
210
+ },
211
+ description: 'The command line arguments to use when on the Linux terminal.',
212
+ defaultValue: []
213
+ };
214
+ export var terminalIntegratedConfirmOnExit = {
215
+ id: 'terminal.integrated.confirmOnExit',
216
+ schema: {
217
+ type: 'string'
218
+ },
219
+ description: 'Controls whether to confirm when the window closes if there are active terminal sessions.',
220
+ // enum: ['never', 'always', 'hasChildProcesses'],
221
+ // enumDescriptions: [
222
+ // nls.localize('theia/terminal/confirmCloseNever', 'Never confirm.'),
223
+ // nls.localize('theia/terminal/confirmCloseAlways', 'Always confirm if there are terminals.'),
224
+ // nls.localize('theia/terminal/confirmCloseChildren', 'Confirm if there are any terminals that have child processes.'),
225
+ // ],
226
+ defaultValue: 'never'
227
+ };
228
+ export var TerminalConfiguration = (_dec = singleton({
229
+ contrib: ConfigurationContribution
230
+ }), _dec(_class = /*#__PURE__*/function () {
231
+ function TerminalConfiguration() {
232
+ _classCallCheck(this, TerminalConfiguration);
233
+ this.configs = [terminalEnableCopy, terminalEnablePaste, terminalIntegratedFontFamily, terminalIntegratedFontSize, terminalIntegratedFontWeight, terminalIntegratedFontWeightBold, terminalIntegratedDrawBoldTextInBrightColors, terminalIntegratedLetterSpacing, terminalIntegratedLineHeight, terminalIntegratedScrollback, terminalIntegratedFastScrollSensitivity, terminalIntegratedRendererType, terminalIntegratedCopyOnSelection, terminalIntegratedCursorBlinking, terminalIntegratedCursorStyle, terminalIntegratedCursorWidth, terminalIntegratedShellWindows, terminalIntegratedShellOsx, terminalIntegratedShellLinux, terminalIntegratedShellArgsWindows, terminalIntegratedShellArgsOsx, terminalIntegratedShellArgsLinux, terminalIntegratedConfirmOnExit, terminalDefaultSlot];
234
+ }
235
+ _createClass(TerminalConfiguration, [{
236
+ key: "registerConfigurations",
237
+ value: function registerConfigurations() {
238
+ return this.configs;
239
+ }
240
+ }]);
241
+ return TerminalConfiguration;
242
+ }()) || _class);
@@ -0,0 +1,109 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { ServerConnection } from '@difizen/libro-kernel';
3
+ import type { Disposable, Disposed, Event } from '@difizen/mana-app';
4
+ import { Emitter } from '@difizen/mana-app';
5
+ import { TerminalOption } from './protocol.js';
6
+ import type { TerminalMessage, TerminalModel, TerminalConnectionStatus } from './protocol.js';
7
+ import { TerminalRestAPI } from './restapi.js';
8
+ export declare class TerminalConnection implements Disposable, Disposed {
9
+ protected _onDisposed: Emitter<void>;
10
+ protected _messageReceived: Emitter<TerminalMessage>;
11
+ protected _connectionStatus: TerminalConnectionStatus;
12
+ protected _connectionStatusChanged: Emitter<TerminalConnectionStatus>;
13
+ protected _name: string;
14
+ protected _reconnectTimeout?: NodeJS.Timeout;
15
+ protected _ws?: WebSocket;
16
+ protected _noOp: () => void;
17
+ protected _reconnectLimit: number;
18
+ protected _reconnectAttempt: number;
19
+ protected _pendingMessages: TerminalMessage[];
20
+ terminalRestAPI: TerminalRestAPI;
21
+ serverConnection: ServerConnection;
22
+ disposed: boolean;
23
+ /**
24
+ * Construct a new terminal session.
25
+ */
26
+ constructor(options: TerminalOption & {
27
+ name: string;
28
+ }, serverConnection: ServerConnection);
29
+ /**
30
+ * A signal emitted when a message is received from the server.
31
+ */
32
+ get messageReceived(): Event<TerminalMessage>;
33
+ get onDisposed(): Event<void>;
34
+ /**
35
+ * Get the name of the terminal session.
36
+ */
37
+ get name(): string;
38
+ /**
39
+ * Get the model for the terminal session.
40
+ */
41
+ get model(): TerminalModel;
42
+ /**
43
+ * The server settings for the session.
44
+ */
45
+ get serverSettings(): import("@difizen/libro-kernel").ISettings;
46
+ /**
47
+ * Dispose of the resources held by the session.
48
+ */
49
+ dispose(): void;
50
+ /**
51
+ * Send a message to the terminal session.
52
+ *
53
+ * #### Notes
54
+ * If the connection is down, the message will be queued for sending when
55
+ * the connection comes back up.
56
+ */
57
+ send(message: TerminalMessage): void;
58
+ /**
59
+ * Send a message on the websocket, or possibly queue for later sending.
60
+ *
61
+ * @param queue - whether to queue the message if it cannot be sent
62
+ */
63
+ _sendMessage(message: TerminalMessage, queue?: boolean): void;
64
+ /**
65
+ * Send pending messages to the kernel.
66
+ */
67
+ protected _sendPending(): void;
68
+ toDisposeOnReconnect: Disposable | undefined;
69
+ /**
70
+ * Reconnect to a terminal.
71
+ */
72
+ reconnect: () => Promise<void>;
73
+ /**
74
+ * Attempt a connection if we have not exhausted connection attempts.
75
+ */
76
+ _reconnect(): void;
77
+ /**
78
+ * Forcefully clear the socket state.
79
+ *
80
+ * #### Notes
81
+ * This will clear all socket state without calling any handlers and will
82
+ * not update the connection status. If you call this method, you are
83
+ * responsible for updating the connection status as needed and recreating
84
+ * the socket if you plan to reconnect.
85
+ */
86
+ protected _clearSocket(): void;
87
+ /**
88
+ * Shut down the terminal session.
89
+ */
90
+ shutdown(): Promise<void>;
91
+ /**
92
+ * Create the terminal websocket connection and add socket status handlers.
93
+ *
94
+ * #### Notes
95
+ * You are responsible for updating the connection status as appropriate.
96
+ */
97
+ protected _createSocket: () => void;
98
+ protected _onWSMessage: (event: MessageEvent) => void;
99
+ protected _onWSClose: (event: CloseEvent) => void;
100
+ /**
101
+ * Handle connection status changes.
102
+ */
103
+ protected _updateConnectionStatus(connectionStatus: TerminalConnectionStatus): void;
104
+ protected _errorIfDisposed(): void;
105
+ get connectionStatusChanged(): Event<TerminalConnectionStatus>;
106
+ get connectionStatus(): TerminalConnectionStatus;
107
+ }
108
+ export declare function getRandomIntInclusive(min: number, max: number): number;
109
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,wBAAwB,EAEzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,qBACa,kBAAmB,YAAW,UAAU,EAAE,QAAQ;IAC7D,SAAS,CAAC,WAAW,gBAAuB;IAC5C,SAAS,CAAC,gBAAgB,2BAAkC;IAC5D,SAAS,CAAC,iBAAiB,EAAE,wBAAwB,CAAgB;IACrE,SAAS,CAAC,wBAAwB,oCAA2C;IAC7E,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,OAA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