react-terminal-viewer-cicd 3.0.0-beta.21 → 3.0.0-beta.22
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function LogWorker() {
|
|
2
2
|
var workerPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/worker';
|
|
3
3
|
var worker = null;
|
|
4
|
-
var version = "3.0.0-beta.
|
|
4
|
+
var version = "3.0.0-beta.22" || '0.0.0';
|
|
5
5
|
var path = workerPath.includes('http') ? "".concat(workerPath, "/log.worker.js") : "".concat(window.location.origin).concat(workerPath, "/log.worker.js");
|
|
6
6
|
var blob = new Blob(["importScripts(\"".concat(path, "?v=").concat(version, "\")")], {
|
|
7
7
|
type: 'application/javascript'
|
|
@@ -79,8 +79,10 @@ var Logs = /*#__PURE__*/function () {
|
|
|
79
79
|
// 创建新的解析器实例
|
|
80
80
|
var newParser = new LogParser();
|
|
81
81
|
|
|
82
|
+
// 兼容真实换行(\r\n/\n/\r)与转义换行(\\r\\n/\\n/\\r)
|
|
83
|
+
var normalizedString = this.string.includes('\n') ? this.string : this.string.replace(/\\r\\n|\\n|\\r/g, '\n');
|
|
82
84
|
// 分割原始字符串为行数组(不进行 HTML 转换)
|
|
83
|
-
var rawLines =
|
|
85
|
+
var rawLines = normalizedString.split(/\r\n|\n|\r/);
|
|
84
86
|
|
|
85
87
|
// 解析日志结构
|
|
86
88
|
newParser.parse(rawLines);
|
|
@@ -88,6 +88,7 @@ var ReactVirtuoso = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
88
88
|
var highlightOptionsRef = useRef(highlightOptions);
|
|
89
89
|
var extraOptionsRef = useRef(extraOptions);
|
|
90
90
|
var logEmptyRef = useRef(true);
|
|
91
|
+
var initialCollapseRef = useRef(defaultGroupCollapsed);
|
|
91
92
|
useEffect(function () {
|
|
92
93
|
highlightOptionsRef.current = highlightOptions;
|
|
93
94
|
extraOptionsRef.current = extraOptions;
|
|
@@ -110,7 +111,7 @@ var ReactVirtuoso = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
110
111
|
});
|
|
111
112
|
}, 0);
|
|
112
113
|
}
|
|
113
|
-
},
|
|
114
|
+
}, initialCollapseRef.current),
|
|
114
115
|
logs = _useStreamStepWorkerL.logs,
|
|
115
116
|
searcherRef = _useStreamStepWorkerL.searcherRef,
|
|
116
117
|
working = _useStreamStepWorkerL.working,
|
|
@@ -208,18 +209,7 @@ var ReactVirtuoso = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
208
209
|
var itemTop = _ref3.itemTop,
|
|
209
210
|
itemBottom = _ref3.itemBottom,
|
|
210
211
|
viewportTop = _ref3.viewportTop,
|
|
211
|
-
viewportBottom = _ref3.viewportBottom
|
|
212
|
-
locationParams = _ref3.locationParams;
|
|
213
|
-
// 调试输出,帮助理解坐标系
|
|
214
|
-
// eslint-disable-next-line no-console
|
|
215
|
-
console.log('calculateViewLocation:', {
|
|
216
|
-
itemTop: itemTop,
|
|
217
|
-
itemBottom: itemBottom,
|
|
218
|
-
viewportTop: viewportTop,
|
|
219
|
-
viewportBottom: viewportBottom,
|
|
220
|
-
locationParams: locationParams
|
|
221
|
-
});
|
|
222
|
-
|
|
212
|
+
viewportBottom = _ref3.viewportBottom;
|
|
223
213
|
// 按照官方默认实现:如果项目顶部在视口上方,滚动到顶部对齐
|
|
224
214
|
if (itemTop < viewportTop) {
|
|
225
215
|
return {
|
|
@@ -386,22 +376,31 @@ var ReactVirtuoso = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
386
376
|
var _virtuosoRef$current6;
|
|
387
377
|
(_virtuosoRef$current6 = virtuosoRef.current) === null || _virtuosoRef$current6 === void 0 || _virtuosoRef$current6.scrollIntoView({
|
|
388
378
|
groupIndex: 0,
|
|
389
|
-
align: 'start'
|
|
390
|
-
behavior: 'auto'
|
|
379
|
+
align: 'start'
|
|
391
380
|
});
|
|
392
381
|
isScrollTopRef.current = true;
|
|
393
382
|
},
|
|
394
383
|
scrollToBottom: function scrollToBottom() {
|
|
395
384
|
if (logs.length > 0) {
|
|
396
|
-
var
|
|
397
|
-
var
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
385
|
+
var _stageStatsRef$curren;
|
|
386
|
+
var lastGroupIndex = groupCounts.length - 1;
|
|
387
|
+
var isLastGroupCollapsed = (_stageStatsRef$curren = stageStatsRef.current[lastGroupIndex]) === null || _stageStatsRef$curren === void 0 ? void 0 : _stageStatsRef$curren.collapse;
|
|
388
|
+
if (isLastGroupCollapsed) {
|
|
389
|
+
var _virtuosoRef$current7;
|
|
390
|
+
(_virtuosoRef$current7 = virtuosoRef.current) === null || _virtuosoRef$current7 === void 0 || _virtuosoRef$current7.scrollIntoView({
|
|
391
|
+
groupIndex: lastGroupIndex,
|
|
392
|
+
align: 'end'
|
|
393
|
+
});
|
|
394
|
+
} else {
|
|
395
|
+
var _virtuosoRef$current8;
|
|
396
|
+
var totalItemCount = groupCounts.reduce(function (a, b) {
|
|
397
|
+
return a + b;
|
|
398
|
+
}, 0);
|
|
399
|
+
(_virtuosoRef$current8 = virtuosoRef.current) === null || _virtuosoRef$current8 === void 0 || _virtuosoRef$current8.scrollToIndex({
|
|
400
|
+
index: totalItemCount - 1,
|
|
401
|
+
align: 'end'
|
|
402
|
+
});
|
|
403
|
+
}
|
|
405
404
|
}
|
|
406
405
|
isScrollTopRef.current = false;
|
|
407
406
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";var e=function(){function e(e){this.map=new Map,this.queue=[],this.limit=(null==e?void 0:e.limit)||50}return e.prototype.get=function(e){return this.map.get(e)},Object.defineProperty(e.prototype,"size",{get:function(){return this.map.size},enumerable:!1,configurable:!0}),e.prototype.set=function(e,t){if(this.size>=this.limit){var n=this.queue.shift();n&&this.delete(n)}return this.queue.push(e),this.map.set(e,t)},e.prototype.has=function(e){return this.map.has(e)},e.prototype.delete=function(e){return this.map.delete(e)},e}(),t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,a={};i=a,function(e,t){if("string"!=typeof i.nodeName)t(i);else{var n={};t(n),e.AnsiUp=n.default}}(n,function(e){var t,n=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};!function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"}(t||(t={}));var r=function(){function e(){this.VERSION="5.2.1",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_whitelist={http:1,https:1},this._escape_html=!0}return Object.defineProperty(e.prototype,"use_classes",{get:function(){return this._use_classes},set:function(e){this._use_classes=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url_whitelist",{get:function(){return this._url_whitelist},set:function(e){this._url_whitelist=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"escape_html",{get:function(){return this._escape_html},set:function(e){this._escape_html=e},enumerable:!1,configurable:!0}),e.prototype.setup_palettes=function(){var e=this;this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(function(t){t.forEach(function(t){e.palette_256.push(t)})});for(var t=[0,95,135,175,215,255],n=0;n<6;++n)for(var r=0;r<6;++r)for(var i=0;i<6;++i){var a={rgb:[t[n],t[r],t[i]],class_name:"truecolor"};this.palette_256.push(a)}for(var s=8,o=0;o<24;++o,s+=10){var u={rgb:[s,s,s],class_name:"truecolor"};this.palette_256.push(u)}},e.prototype.escape_txt_for_html=function(e){return this._escape_html?e.replace(/[&<>"']/gm,function(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":void 0}):e},e.prototype.append_buffer=function(e){var t=this._buffer+e;this._buffer=t},e.prototype.get_next_packet=function(){var e={kind:t.EOS,text:"",url:""},r=this._buffer.length;if(0==r)return e;var a,s,o,u,l=this._buffer.indexOf("");if(-1==l)return e.kind=t.Text,e.text=this._buffer,this._buffer="",e;if(l>0)return e.kind=t.Text,e.text=this._buffer.slice(0,l),this._buffer=this._buffer.slice(l),e;if(0==l){if(r<3)return e.kind=t.Incomplete,e;var c=this._buffer.charAt(1);if("["!=c&&"]"!=c&&"("!=c)return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if("["==c){if(this._csi_regex||(this._csi_regex=i(n(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n [ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n [ # CSI\n [ -~]* # anything legal\n ([\0-:]) # anything illegal\n )\n "],["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]))),null===(d=this._buffer.match(this._csi_regex)))return e.kind=t.Incomplete,e;if(d[4])return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;""!=d[1]||"m"!=d[3]?e.kind=t.Unknown:e.kind=t.SGR,e.text=d[2];var h=d[0].length;return this._buffer=this._buffer.slice(h),e}if("]"==c){if(r<4)return e.kind=t.Incomplete,e;if("8"!=this._buffer.charAt(2)||";"!=this._buffer.charAt(3))return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=(a=n(["\n (?: # legal sequence\n (\\) # ESC | # alternate\n () # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-] # anything illegal\n | # alternate\n [\b-] # anything illegal\n | # alternate\n [-] # anything illegal\n )\n "],["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "]),s=a.raw[0],o=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,u=s.replace(o,""),new RegExp(u,"g"))),this._osc_st.lastIndex=0;var f=this._osc_st.exec(this._buffer);if(null===f)return e.kind=t.Incomplete,e;if(f[3])return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;var d,p=this._osc_st.exec(this._buffer);return null===p?(e.kind=t.Incomplete,e):p[3]?(e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e):(this._osc_regex||(this._osc_regex=i(n(["\n ^ # beginning of line\n #\n ]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\\) # ESC | # alternate\n (?:) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n ]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\) # ESC | # alternate\n (?:) # BEL (what xterm did)\n )\n "],["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]))),null===(d=this._buffer.match(this._osc_regex))?(e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e):(e.kind=t.OSCURL,e.url=d[1],e.text=d[2],h=d[0].length,this._buffer=this._buffer.slice(h),e))}if("("==c)return e.kind=t.Unknown,this._buffer=this._buffer.slice(3),e}},e.prototype.ansi_to_html=function(e){this.append_buffer(e);for(var n=[];;){var r=this.get_next_packet();if(r.kind==t.EOS||r.kind==t.Incomplete)break;r.kind!=t.ESC&&r.kind!=t.Unknown&&(r.kind==t.Text?n.push(this.transform_to_html(this.with_state(r))):r.kind==t.SGR?this.process_ansi(r):r.kind==t.OSCURL&&n.push(this.process_hyperlink(r)))}return n.join("")},e.prototype.with_state=function(e){return{bold:this.bold,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}},e.prototype.process_ansi=function(e){for(var t=e.text.split(";");t.length>0;){var n=t.shift(),r=parseInt(n,10);if(isNaN(r)||0===r)this.fg=this.bg=null,this.bold=!1,this.italic=!1,this.underline=!1;else if(1===r)this.bold=!0;else if(3===r)this.italic=!0;else if(4===r)this.underline=!0;else if(22===r)this.bold=!1;else if(23===r)this.italic=!1;else if(24===r)this.underline=!1;else if(39===r)this.fg=null;else if(49===r)this.bg=null;else if(r>=30&&r<38)this.fg=this.ansi_colors[0][r-30];else if(r>=40&&r<48)this.bg=this.ansi_colors[0][r-40];else if(r>=90&&r<98)this.fg=this.ansi_colors[1][r-90];else if(r>=100&&r<108)this.bg=this.ansi_colors[1][r-100];else if((38===r||48===r)&&t.length>0){var i=38===r,a=t.shift();if("5"===a&&t.length>0){var s=parseInt(t.shift(),10);s>=0&&s<=255&&(i?this.fg=this.palette_256[s]:this.bg=this.palette_256[s])}if("2"===a&&t.length>2){var o=parseInt(t.shift(),10),u=parseInt(t.shift(),10),l=parseInt(t.shift(),10);if(o>=0&&o<=255&&u>=0&&u<=255&&l>=0&&l<=255){var c={rgb:[o,u,l],class_name:"truecolor"};i?this.fg=c:this.bg=c}}}}},e.prototype.transform_to_html=function(e){var t=e.text;if(0===t.length)return t;if(t=this.escape_txt_for_html(t),!e.bold&&!e.italic&&!e.underline&&null===e.fg&&null===e.bg)return t;var n=[],r=[],i=e.fg,a=e.bg;e.bold&&n.push("font-weight:bold"),e.italic&&n.push("font-style:italic"),e.underline&&n.push("text-decoration:underline"),this._use_classes?(i&&("truecolor"!==i.class_name?r.push(i.class_name+"-fg"):n.push("color:rgb("+i.rgb.join(",")+")")),a&&("truecolor"!==a.class_name?r.push(a.class_name+"-bg"):n.push("background-color:rgb("+a.rgb.join(",")+")"))):(i&&n.push("color:rgb("+i.rgb.join(",")+")"),a&&n.push("background-color:rgb("+a.rgb+")"));var s="",o="";return r.length&&(s=' class="'+r.join(" ")+'"'),n.length&&(o=' style="'+n.join(";")+'"'),"<span"+o+s+">"+t+"</span>"},e.prototype.process_hyperlink=function(e){var t=e.url.split(":");return t.length<1?"":this._url_whitelist[t[0]]?'<a href="'+this.escape_txt_for_html(e.url)+'">'+this.escape_txt_for_html(e.text)+"</a>":""},e}();function i(e){var t=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r});var s=r(a),o=function(){function e(){this.stages=[],this.currentStage=null,this.flatLines=[]}return e.prototype.parse=function(e){if(e&&Array.isArray(e)){this.stages=[],this.currentStage=null,this.flatLines=[];for(var t=0,n=0;n<e.length;n++){var r=e[n];if(r.startsWith("START_")){var i=r.split("_"),a=i[1],s=i[2],o=i[3],u=i[4];this.currentStage={stepId:a,status:s,startTime:o,name:u,startIndex:t,endIndex:void 0,logs:[]}}else if(r.startsWith("END_")){var l=r.split("_"),c=l[2],h=l[3];this.currentStage&&(this.currentStage.endTime=h,this.currentStage.endStatus=c,t>this.currentStage.startIndex?this.currentStage.endIndex=t-1:this.currentStage.endIndex=this.currentStage.startIndex>0?this.currentStage.startIndex-1:this.currentStage.startIndex,this.stages.push(this.currentStage),this.currentStage=null)}else this.flatLines.push({type:"log",text:r}),t++,this.currentStage&&this.currentStage.logs.push({type:"log",text:r})}this.currentStage&&(t>this.currentStage.startIndex?this.currentStage.endIndex=t-1:this.currentStage.endIndex=this.currentStage.startIndex>0?this.currentStage.startIndex-1:this.currentStage.startIndex,this.stages.push(this.currentStage),this.currentStage=null)}},e}(),u={entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},l={},c=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=new RegExp("[\\-\\.0-9"+c.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),f=new RegExp("^"+c.source+h.source+"*(?::"+c.source+h.source+"*)?$");function d(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,d)}function p(){}function m(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function g(e,t,n,r,i,a){function s(e,t,r){e in n.attributeNames&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,r)}for(var o,u=++t,l=0;;){var c=e.charAt(u);switch(c){case"=":if(1===l)o=e.slice(t,u),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(a.warning('attribute value must after "="'),o=e.slice(t,u)),t=u+1,!((u=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");s(o,h=e.slice(t,u).replace(/&#?\w+;/g,i),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');s(o,h=e.slice(t,u).replace(/&#?\w+;/g,i),t),a.warning('attribute "'+o+'" missed start quot('+c+")!!"),t=u+1,l=5}break;case"/":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:l=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==l&&n.setTagName(e.slice(t,u)),u;case">":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(h=e.slice(t,u)).slice(-1)&&(n.closed=!0,h=h.slice(0,-1));case 2:2===l&&(h=o),4==l?(a.warning('attribute "'+h+'" missed quot(")!'),s(o,h.replace(/&#?\w+;/g,i),t)):("http://www.w3.org/1999/xhtml"===r[""]&&h.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),s(h,h,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"":c=" ";default:if(c<=" ")switch(l){case 0:n.setTagName(e.slice(t,u)),l=6;break;case 1:o=e.slice(t,u),l=2;break;case 4:var h=e.slice(t,u).replace(/&#?\w+;/g,i);a.warning('attribute "'+h+'" missed quot(")!!'),s(o,h,t);case 5:l=6}else switch(l){case 2:n.tagName,"http://www.w3.org/1999/xhtml"===r[""]&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=u,l=1;break;case 5:a.warning('attribute space is required"'+o+'"!!');case 6:l=1,t=u;break;case 3:l=4,t=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function v(e,t,n){for(var r=e.tagName,i=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;if((f=o.indexOf(":"))>0)var l=s.prefix=o.slice(0,f),c=o.slice(f+1),h="xmlns"===l&&c;else c=o,l=null,h="xmlns"===o&&"";s.localName=c,!1!==h&&(null==i&&(i={},N(n,n={})),n[h]=i[h]=u,s.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(h,u))}for(a=e.length;a--;){(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(s.uri=n[l||""]))}var f;(f=r.indexOf(":"))>0?(l=e.prefix=r.slice(0,f),c=e.localName=r.slice(f+1)):(l=null,c=e.localName=r);var d=e.uri=n[l||""];if(t.startElement(d,c,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=i,!0;if(t.endElement(d,c,r),i)for(l in i)t.endPrefixMapping(l)}function b(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("</"+n+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(i.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,r),i.characters(s,0,s.length),a)}return t+1}function x(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf("</"+n+">"))<t&&(i=e.lastIndexOf("</"+n)),r[n]=i),i<t}function N(e,t){for(var n in e)t[n]=e[n]}function w(e,t,n,r){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;i.lastIndex=t,i.exec(e);for(;n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return n.startDTD(o,u,l),n.endDTD(),c.index+c[0].length}return-1}function _(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function y(){this.attributeNames={}}d.prototype=new Error,d.prototype.name=d.name,p.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),N(t,t={}),function(e,t,n,r,i){function a(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?a(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function o(t){if(t>E){var n=e.substring(E,t).replace(/&#?\w+;/g,s);f&&u(E),r.characters(n,0,t-E),E=t}}function u(t,n){for(;t>=c&&(n=h.exec(e));)l=n.index,c=l+n[0].length,f.lineNumber++;f.columnNumber=t-l+1}var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,f=r.locator,p=[{currentNSMap:t}],N={},E=0;for(;;){try{var S=e.indexOf("<",E);if(S<0){if(!e.substr(E).match(/^\s*$/)){var T=r.doc,I=T.createTextNode(e.substr(E));T.appendChild(I),r.currentElement=I}return}switch(S>E&&o(S),e.charAt(S+1)){case"/":var C=e.indexOf(">",S+3),D=e.substring(S+2,C),k=p.pop();C<0?(D=e.substring(S+2).replace(/[\s<].*/,""),i.error("end tag name: "+D+" is not complete:"+k.tagName),C=S+1+D.length):D.match(/\s</)&&(D=D.replace(/[\s<].*/,""),i.error("end tag name: "+D+" maybe not complete"),C=S+1+D.length);var A=k.localNSMap,O=k.tagName==D;if(O||k.tagName&&k.tagName.toLowerCase()==D.toLowerCase()){if(r.endElement(k.uri,k.localName,D),A)for(var R in A)r.endPrefixMapping(R);O||i.fatalError("end tag name: "+D+" is not match the current start tagName:"+k.tagName)}else p.push(k);C++;break;case"?":f&&u(S),C=_(e,S,r);break;case"!":f&&u(S),C=w(e,S,r,i);break;default:f&&u(S);var M=new y,L=p[p.length-1].currentNSMap,U=(C=g(e,S,M,L,s,i),M.length);if(!M.closed&&x(e,C,M.tagName,N)&&(M.closed=!0,n.nbsp||i.warning("unclosed xml attribute")),f&&U){for(var F=m(f,{}),B=0;B<U;B++){var P=M[B];u(P.offset),P.locator=m(f,{})}r.locator=F,v(M,r,L)&&p.push(M),r.locator=f}else v(M,r,L)&&p.push(M);"http://www.w3.org/1999/xhtml"!==M.uri||M.closed?C++:C=b(e,C,M.tagName,s,r)}}catch(e){if(e instanceof d)throw e;i.error("element parse error: "+e),C=-1}C>E?E=C:o(Math.max(S,E)+1)}}(e,t,n,r,this.errorHandler),r.endDocument()}},y.prototype={setTagName:function(e){if(!f.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!f.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},l.XMLReader=p,l.ParseError=d;var E={};function S(e,t){for(var n in e)t[n]=e[n]}function T(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,S(n,r=new r),e.prototype=n=r}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}var I={},C=I.ELEMENT_NODE=1,D=I.ATTRIBUTE_NODE=2,k=I.TEXT_NODE=3,A=I.CDATA_SECTION_NODE=4,O=I.ENTITY_REFERENCE_NODE=5,R=I.ENTITY_NODE=6,M=I.PROCESSING_INSTRUCTION_NODE=7,L=I.COMMENT_NODE=8,U=I.DOCUMENT_NODE=9,F=I.DOCUMENT_TYPE_NODE=10,B=I.DOCUMENT_FRAGMENT_NODE=11,P=I.NOTATION_NODE=12,q={},j={};q.INDEX_SIZE_ERR=(j[1]="Index size error",1),q.DOMSTRING_SIZE_ERR=(j[2]="DOMString size error",2);var $=q.HIERARCHY_REQUEST_ERR=(j[3]="Hierarchy request error",3);q.WRONG_DOCUMENT_ERR=(j[4]="Wrong document",4),q.INVALID_CHARACTER_ERR=(j[5]="Invalid character",5),q.NO_DATA_ALLOWED_ERR=(j[6]="No data allowed",6),q.NO_MODIFICATION_ALLOWED_ERR=(j[7]="No modification allowed",7);var V=q.NOT_FOUND_ERR=(j[8]="Not found",8);q.NOT_SUPPORTED_ERR=(j[9]="Not supported",9);var z=q.INUSE_ATTRIBUTE_ERR=(j[10]="Attribute in use",10);function H(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,j[e]),this.message=j[e],Error.captureStackTrace&&Error.captureStackTrace(this,H);return n.code=e,t&&(this.message=this.message+": "+t),n}function X(){}function Y(e,t){this._node=e,this._refresh=t,G(this)}function G(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);Te(e,"length",n.length),S(n,e),e._inc=t}}function W(){}function K(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function Z(e,t,n,r){if(r?t[K(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&ie(i,e,r),function(e,t,n){e&&e._inc++;var r=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==r&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(i,e,n))}}function Q(e,t,n){var r=K(t,n);if(!(r>=0))throw H(V,new Error(e.tagName+"@"+n));for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(ie(a,e,n),n.ownerElement=null)}}function J(e){if(this._features={},e)for(var t in e)this._features=e[t]}function ee(){}function te(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function ne(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(ne(e,t))return!0}while(e=e.nextSibling)}function re(){}function ie(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function ae(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a}}}function se(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,ae(e.ownerDocument,e),t}function oe(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===B){var i=t.firstChild;if(null==i)return t;var a=t.lastChild}else i=a=t;var s=n?n.previousSibling:e.lastChild;i.previousSibling=s,a.nextSibling=n,s?s.nextSibling=i:e.firstChild=i,null==n?e.lastChild=a:n.previousSibling=a;do{i.parentNode=e}while(i!==a&&(i=i.nextSibling));return ae(e.ownerDocument||e,e),t.nodeType==B&&(t.firstChild=t.lastChild=null),t}function ue(){this._nsMap={}}function le(){}function ce(){}function he(){}function fe(){}function de(){}function pe(){}function me(){}function ge(){}function ve(){}function be(){}function xe(){}function Ne(){}function we(e,t){var n=[],r=9==this.nodeType&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&null==i&&null==(i=r.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return ye(this,n,e,t,s),n.join("")}function _e(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var a=n.length;a--;){var s=n[a];if(s.prefix==r)return s.namespace!=i}return!0}function ye(e,t,n,r,i){if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case C:i||(i=[]),i.length;var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName;n="http://www.w3.org/1999/xhtml"===e.namespaceURI||n,t.push("<",u);for(var l=0;l<s;l++){"xmlns"==(c=a.item(l)).prefix?i.push({prefix:c.localName,namespace:c.value}):"xmlns"==c.nodeName&&i.push({prefix:"",namespace:c.value})}for(l=0;l<s;l++){var c;if(_e(c=a.item(l),0,i)){var h=c.prefix||"",f=c.namespaceURI,d=h?" xmlns:"+h:" xmlns";t.push(d,'="',f,'"'),i.push({prefix:h,namespace:f})}ye(c,t,n,r,i)}if(_e(e,0,i)){h=e.prefix||"";if(f=e.namespaceURI){d=h?" xmlns:"+h:" xmlns";t.push(d,'="',f,'"'),i.push({prefix:h,namespace:f})}}if(o||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):ye(o,t,n,r,i),o=o.nextSibling;else for(;o;)ye(o,t,n,r,i),o=o.nextSibling;t.push("</",u,">")}else t.push("/>");return;case U:case B:for(o=e.firstChild;o;)ye(o,t,n,r,i),o=o.nextSibling;return;case D:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,te),'"');case k:return t.push(e.data.replace(/[<&]/g,te).replace(/]]>/g,"]]>"));case A:return t.push("<![CDATA[",e.data,"]]>");case L:return t.push("\x3c!--",e.data,"--\x3e");case F:var p=e.publicId,m=e.systemId;if(t.push("<!DOCTYPE ",e.name),p)t.push(" PUBLIC ",p),m&&"."!=m&&t.push(" ",m),t.push(">");else if(m&&"."!=m)t.push(" SYSTEM ",m,">");else{var g=e.internalSubset;g&&t.push(" [",g,"]"),t.push(">")}return;case M:return t.push("<?",e.target," ",e.data,"?>");case O:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Ee(e,t,n){var r;switch(t.nodeType){case C:(r=t.cloneNode(!1)).ownerDocument=e;case B:break;case D:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(Ee(e,i,n)),i=i.nextSibling;return r}function Se(e,t,n){var r=new t.constructor;for(var i in t){var a=t[i];"object"!=typeof a&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new X),r.ownerDocument=e,r.nodeType){case C:var s=t.attributes,o=r.attributes=new W,u=s.length;o._ownerElement=r;for(var l=0;l<u;l++)r.setAttributeNode(Se(e,s.item(l),!0));break;case D:n=!0}if(n)for(var c=t.firstChild;c;)r.appendChild(Se(e,c,n)),c=c.nextSibling;return r}function Te(e,t,n){e[t]=n}q.INVALID_STATE_ERR=(j[11]="Invalid state",11),q.SYNTAX_ERR=(j[12]="Syntax error",12),q.INVALID_MODIFICATION_ERR=(j[13]="Invalid modification",13),q.NAMESPACE_ERR=(j[14]="Invalid namespace",14),q.INVALID_ACCESS_ERR=(j[15]="Invalid access",15),H.prototype=Error.prototype,S(q,H),X.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)ye(this[r],n,e,t);return n.join("")}},Y.prototype.item=function(e){return G(this),this[e]},T(Y,X),W.prototype={length:0,item:X.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new H(z);var n=this.getNamedItem(e.nodeName);return Z(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new H(z);return t=this.getNamedItemNS(e.namespaceURI,e.localName),Z(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return Q(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return Q(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}},J.prototype={hasFeature:function(e,t){var n=this._features[e.toLowerCase()];return!(!n||t&&!(t in n))},createDocument:function(e,t,n){var r=new re;if(r.implementation=this,r.childNodes=new X,r.doctype=n,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new pe;return r.name=e,r.nodeName=e,r.publicId=t,r.systemId=n,r}},ee.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return oe(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return se(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return Se(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==k&&e.nodeType==k?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},S(I,ee),S(I,ee.prototype),re.prototype={nodeName:"#document",nodeType:U,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==B){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==C&&(this.documentElement=e),oe(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),se(this,e)},importNode:function(e,t){return Ee(this,e,t)},getElementById:function(e){var t=null;return ne(this.documentElement,function(n){if(n.nodeType==C&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return new Y(this,function(e){var n=[];return ne(e.documentElement,function(r){r!==e&&r.nodeType==C&&t.test(r.getAttribute("class"))&&n.push(r)}),n})},createElement:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new X,(t.attributes=new W)._ownerElement=t,t},createDocumentFragment:function(){var e=new be;return e.ownerDocument=this,e.childNodes=new X,e},createTextNode:function(e){var t=new he;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new fe;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new de;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new xe;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new le;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ve;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new ue,r=t.split(":"),i=n.attributes=new W;return n.childNodes=new X,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new le,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},T(re,ee),ue.prototype={nodeType:C,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===B?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t),r=e.lastChild}return r=e.lastChild,t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,ae(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new Y(this,function(t){var n=[];return ne(t,function(r){r===t||r.nodeType!=C||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new Y(this,function(n){var r=[];return ne(n,function(i){i===n||i.nodeType!==C||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)}),r})}},re.prototype.getElementsByTagName=ue.prototype.getElementsByTagName,re.prototype.getElementsByTagNameNS=ue.prototype.getElementsByTagNameNS,T(ue,ee),le.prototype.nodeType=D,T(le,ee),ce.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(j[$])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},T(ce,ee),he.prototype={nodeName:"#text",nodeType:k,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},T(he,ce),fe.prototype={nodeName:"#comment",nodeType:L},T(fe,ce),de.prototype={nodeName:"#cdata-section",nodeType:A},T(de,ce),pe.prototype.nodeType=F,T(pe,ee),me.prototype.nodeType=P,T(me,ee),ge.prototype.nodeType=R,T(ge,ee),ve.prototype.nodeType=O,T(ve,ee),be.prototype.nodeName="#document-fragment",be.prototype.nodeType=B,T(be,ee),xe.prototype.nodeType=M,T(xe,ee),Ne.prototype.serializeToString=function(e,t,n){return we.call(e,t,n)},ee.prototype.toString=we;try{if(Object.defineProperty){function ze(e){switch(e.nodeType){case C:case B:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(ze(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(Y.prototype,"length",{get:function(){return G(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return ze(this)},set:function(e){switch(this.nodeType){case C:case B:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Te=function(e,t,n){e["$$"+t]=n}}}catch(He){}function Ie(e){this.options=e||{locator:{}}}function Ce(){this.cdata=!1}function De(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function ke(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Ae(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function Oe(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}E.Node=ee,E.DOMException=H,E.DOMImplementation=J,E.XMLSerializer=Ne,Ie.prototype.parseFromString=function(e,t){var n=this.options,r=new Le,i=n.domBuilder||new Ce,a=n.errorHandler,s=n.locator,o=n.xmlns||{},u=/\/x?html?$/.test(t),l=u?Re.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return s&&i.setDocumentLocator(s),r.errorHandler=function(e,t,n){if(!e){if(t instanceof Ce)return t;e=t}var r={},i=e instanceof Function;function a(t){var a=e[t];!a&&i&&(a=2==e.length?function(n){e(t,n)}:e),r[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+ke(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),r}(a,i,s),r.domBuilder=n.domBuilder||i,u&&(o[""]="http://www.w3.org/1999/xhtml"),o.xml=o.xml||"http://www.w3.org/XML/1998/namespace",e&&"string"==typeof e?r.parse(e,o,l):r.errorHandler.error("invalid doc source"),i.doc},Ce.prototype={startDocument:function(){this.doc=(new Fe).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),s=r.length;Oe(this,a),this.currentElement=a,this.locator&&De(this.locator,a);for(var o=0;o<s;o++){e=r.getURI(o);var u=r.getValue(o),l=(n=r.getQName(o),i.createAttributeNS(e,n));this.locator&&De(r.getLocator(o),l),l.value=l.nodeValue=u,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&De(this.locator,n),Oe(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=Ae.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&De(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=Ae.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&De(this.locator,r),Oe(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&De(this.locator,i),Oe(this,i)}},warning:function(e){console.warn("[xmldom warning]\t"+e,ke(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,ke(this.locator))},fatalError:function(e){throw new Ue(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Ce.prototype[e]=function(){return null}});var Re=u,Me=l,Le=Me.XMLReader,Ue=Me.ParseError,Fe=E.DOMImplementation,Be=Ie,Pe=function(){function e(e,t){void 0===t&&(t={className:"terminal-viewer-hl-mark",markedClassName:"terminal-viewer-hl-mark terminal-viewer-hl-marked"}),this.isMarked=!1,this.dom=(new Be).parseFromString("".concat('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',"<html><body>").concat(e,"</body></html>"),"text/html"),this.options=t,this.matchCount=0,this.matchedIndex=0,this.isMarked=!1,this.hlIndex=0}return e.prototype.mark=function(e,t){var n=this;void 0===t&&(t={matchedIndex:0,hlIndex:0});var r=new RegExp(this.escapeStr(e),"gi"),i=Array.from(this.dom.getElementsByTagName("body")[0].childNodes),a=e.length;return this.matchedIndex=t.matchedIndex,this.hlIndex=t.hlIndex,i.forEach(function(e){var t=n.getTextNodes(e);t.forEach(function(e){for(var t=e,i=t.textContent||"";i;){var s=i.search(r);if(-1===s)break;i=(null==(t=n.wrapRangeInTextNode(t,s,s+a))?void 0:t.textContent)||"",n.matchCount++,n.matchedIndex++}}),t=[]}),i=[],this},e.prototype.escapeStr=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},e.prototype.getStyle=function(e){var t=(e?this.options.markedStyle:this.options.style)||{};return Object.keys(t).filter(function(e){return t[e]}).map(function(e){return"".concat(e,":").concat(t[e],";")}).join("")},e.prototype.getTextNodes=function(e){for(var t=[],n=[e];0!==n.length;){var r=n.shift();if(r&&3===r.nodeType&&t.push(r),r&&r.hasChildNodes()){var i=Array.from(r.childNodes);i.forEach(function(e){3===e.nodeType&&t.push(e)}),n.push.apply(n,i)}}return t},e.prototype.wrapRangeInTextNode=function(e,t,n){var r,i=this.options,a=i.className,s=i.markedClassName,o=e.splitText(t),u=o.splitText(n-t),l=this.dom.createElement("mark"),c=this.getStyle(this.matchedIndex===this.hlIndex);return this.matchedIndex===this.hlIndex&&(this.isMarked=!0),l.setAttribute("class",(this.matchedIndex===this.hlIndex?s:a)||""),c&&l.setAttribute("style",c),l.textContent=o.textContent,null===(r=o.parentNode)||void 0===r||r.replaceChild(l,o),u},e.prototype.toString=function(){var e=this.dom.getElementsByTagName("body")[0].toString().match(/^<body xmlns="http:\/\/www\.w3\.org\/1999\/xhtml">(.[\s\S]*?)<\/body>$/);return e&&e[1]?e[1]:""},e.prototype.distory=function(){this.dom=null},e}(),qe=function(){function e(e){this.options=t({markClassName:"terminal-viewer-hl-mark",markedClassName:"terminal-viewer-hl-mark terminal-viewer-hl-marked"},e||{})}return e.prototype.search=function(e,t,n,r){var i,a,s,o,u;if(void 0===n&&(n=0),void 0===r&&(r=void 0),!Array.isArray(t)||0===t.length||!e)return{count:0,map:{},markedKey:0};for(var l=this.options,c=l.markClassName,h=l.markedClassName,f=l.calculateSearchText,d={color:null===(i=null==r?void 0:r.decorations)||void 0===i?void 0:i.matchForegroundColor,background:null===(a=null==r?void 0:r.decorations)||void 0===a?void 0:a.matchBackground,border:null===(s=null==r?void 0:r.decorations)||void 0===s?void 0:s.matchBorder},p={background:null===(o=null==r?void 0:r.decorations)||void 0===o?void 0:o.activeMatchBackground,border:null===(u=null==r?void 0:r.decorations)||void 0===u?void 0:u.activeMatchBorder},m=0,g=0,v={},b=0,x=t.length;b<x&&!(m>=1e3);b++){var N=t[b],w="";if("object"==typeof N&&(w=(null==f?void 0:f(N))||""),"string"==typeof N&&(w=N),w.toLowerCase().includes(e.toLowerCase())){var _=new Pe(w,{className:c,markedClassName:h,style:d,markedStyle:p}),y=_.mark(e,{matchedIndex:m,hlIndex:n}).toString();_.isMarked&&(g=b),0!==_.matchCount&&(m+=_.matchCount,v[b]=y||w),_.distory(),_=null}}return{count:m,map:v,markedKey:g}},e}(),je=function(){function n(t){var n=t.id,r=t.string;this.id=n,this.string=r,this.searcher=new qe({calculateSearchText:function(e){return e&&"object"==typeof e&&"text"in e&&e.text||""}}),this.parserMap=new e({limit:1}),this.parser=new o,this.ansiUp=new s,this.parse()}return n.prototype.updateString=function(e){this.string!==e&&(this.string=e,this.parserMap.delete(this.id),this.parse())},n.prototype.parse=function(){var e=this;if(0!==this.string.length){if(this.parserMap.has(this.id)){var n=this.parserMap.get(this.id);if(n)return void(this.parser=n)}var r=new o,i=this.string.split("\r\n");r.parse(i),r.flatLines=r.flatLines.map(function(n){return"log"===n.type?t(t({},n),{text:e.ansiUp.ansi_to_html(n.text)}):n}),r.stages=r.stages.map(function(n){return t(t({},n),{logs:n.logs.map(function(n){return"log"===n.type?t(t({},n),{text:e.ansiUp.ansi_to_html(n.text)}):n})})}),this.parser=r,this.parserMap.set(this.id,this.parser)}},n.prototype.getArrayData=function(){return this.parser.flatLines.map(function(e){return e.text})},n.prototype.getStages=function(){return this.parser.stages},n.prototype.getFlatLines=function(){return this.parser.flatLines},n.prototype.mark=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=void 0),e?this.searcher.search(e,this.parser.flatLines,t,n):this.searcher.search(e,[])},n}(),$e=new(function(){function e(e){var t=this;this.events={},this.context=e,this.context.addEventListener("message",function(e){var n=e.data.topic;t.exec(n,e.data)})}return e.prototype.on=function(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),this},e.prototype.exec=function(e,t){var n=this;return Array.isArray(this.events[e])?(this.events[e].forEach(function(e){e(n,t)}),this):this},e.prototype.send=function(e,n){return void 0===n&&(n={}),this.context.postMessage(t({topic:e},n)),this},e}())(self),Ve=new e({limit:8});$e.on("highlight-log",function(e,t){var n=t.id,r=t.string;Ve.has(n)?Ve.get(n).updateString(r):Ve.set(n,new je({id:n,string:r}));var i=Ve.get(n),a=(null==i?void 0:i.getArrayData())||[],s=(null==i?void 0:i.getStages())||[],o=(null==i?void 0:i.getFlatLines())||[];e.send("highlight-log-success",{id:n,logs:a,stages:s,flatLines:o})}),$e.on("search-log",function(e,t){var n=t.id,r=t.searchId,i=t.keyword,a=void 0===i?"":i,s=t.hlIndex,o=t.string,u=void 0===o?"":o,l=t.options;if(a){if(Ve.has(n))Ve.get(n).updateString(u);else Ve.set(n,new je({id:n,string:u}));var c=Ve.get(n);if(c){var h=c.mark(a,s,l);e.send("search-log-success",{id:n,searchId:r,searcherResult:h||{map:{},count:0,markedKey:0}})}else e.send("search-log-success",{id:n,searchId:r,searcherResult:{map:{},count:0,markedKey:0}})}else e.send("search-log-success",{id:n,searchId:r,searcherResult:{map:{},count:0,markedKey:0}})})});
|
|
1
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";var e=function(){function e(e){this.map=new Map,this.queue=[],this.limit=(null==e?void 0:e.limit)||50}return e.prototype.get=function(e){return this.map.get(e)},Object.defineProperty(e.prototype,"size",{get:function(){return this.map.size},enumerable:!1,configurable:!0}),e.prototype.set=function(e,t){if(this.size>=this.limit){var n=this.queue.shift();n&&this.delete(n)}return this.queue.push(e),this.map.set(e,t)},e.prototype.has=function(e){return this.map.has(e)},e.prototype.delete=function(e){return this.map.delete(e)},e}(),t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,a={};i=a,function(e,t){if("string"!=typeof i.nodeName)t(i);else{var n={};t(n),e.AnsiUp=n.default}}(n,function(e){var t,n=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};!function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"}(t||(t={}));var r=function(){function e(){this.VERSION="5.2.1",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_whitelist={http:1,https:1},this._escape_html=!0}return Object.defineProperty(e.prototype,"use_classes",{get:function(){return this._use_classes},set:function(e){this._use_classes=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url_whitelist",{get:function(){return this._url_whitelist},set:function(e){this._url_whitelist=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"escape_html",{get:function(){return this._escape_html},set:function(e){this._escape_html=e},enumerable:!1,configurable:!0}),e.prototype.setup_palettes=function(){var e=this;this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(function(t){t.forEach(function(t){e.palette_256.push(t)})});for(var t=[0,95,135,175,215,255],n=0;n<6;++n)for(var r=0;r<6;++r)for(var i=0;i<6;++i){var a={rgb:[t[n],t[r],t[i]],class_name:"truecolor"};this.palette_256.push(a)}for(var s=8,o=0;o<24;++o,s+=10){var u={rgb:[s,s,s],class_name:"truecolor"};this.palette_256.push(u)}},e.prototype.escape_txt_for_html=function(e){return this._escape_html?e.replace(/[&<>"']/gm,function(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":void 0}):e},e.prototype.append_buffer=function(e){var t=this._buffer+e;this._buffer=t},e.prototype.get_next_packet=function(){var e={kind:t.EOS,text:"",url:""},r=this._buffer.length;if(0==r)return e;var a,s,o,u,l=this._buffer.indexOf("");if(-1==l)return e.kind=t.Text,e.text=this._buffer,this._buffer="",e;if(l>0)return e.kind=t.Text,e.text=this._buffer.slice(0,l),this._buffer=this._buffer.slice(l),e;if(0==l){if(r<3)return e.kind=t.Incomplete,e;var c=this._buffer.charAt(1);if("["!=c&&"]"!=c&&"("!=c)return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if("["==c){if(this._csi_regex||(this._csi_regex=i(n(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n [ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n [ # CSI\n [ -~]* # anything legal\n ([\0-:]) # anything illegal\n )\n "],["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]))),null===(d=this._buffer.match(this._csi_regex)))return e.kind=t.Incomplete,e;if(d[4])return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;""!=d[1]||"m"!=d[3]?e.kind=t.Unknown:e.kind=t.SGR,e.text=d[2];var h=d[0].length;return this._buffer=this._buffer.slice(h),e}if("]"==c){if(r<4)return e.kind=t.Incomplete,e;if("8"!=this._buffer.charAt(2)||";"!=this._buffer.charAt(3))return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=(a=n(["\n (?: # legal sequence\n (\\) # ESC | # alternate\n () # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-] # anything illegal\n | # alternate\n [\b-] # anything illegal\n | # alternate\n [-] # anything illegal\n )\n "],["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "]),s=a.raw[0],o=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,u=s.replace(o,""),new RegExp(u,"g"))),this._osc_st.lastIndex=0;var f=this._osc_st.exec(this._buffer);if(null===f)return e.kind=t.Incomplete,e;if(f[3])return e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;var d,p=this._osc_st.exec(this._buffer);return null===p?(e.kind=t.Incomplete,e):p[3]?(e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e):(this._osc_regex||(this._osc_regex=i(n(["\n ^ # beginning of line\n #\n ]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\\) # ESC | # alternate\n (?:) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n ]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\) # ESC | # alternate\n (?:) # BEL (what xterm did)\n )\n "],["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]))),null===(d=this._buffer.match(this._osc_regex))?(e.kind=t.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e):(e.kind=t.OSCURL,e.url=d[1],e.text=d[2],h=d[0].length,this._buffer=this._buffer.slice(h),e))}if("("==c)return e.kind=t.Unknown,this._buffer=this._buffer.slice(3),e}},e.prototype.ansi_to_html=function(e){this.append_buffer(e);for(var n=[];;){var r=this.get_next_packet();if(r.kind==t.EOS||r.kind==t.Incomplete)break;r.kind!=t.ESC&&r.kind!=t.Unknown&&(r.kind==t.Text?n.push(this.transform_to_html(this.with_state(r))):r.kind==t.SGR?this.process_ansi(r):r.kind==t.OSCURL&&n.push(this.process_hyperlink(r)))}return n.join("")},e.prototype.with_state=function(e){return{bold:this.bold,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}},e.prototype.process_ansi=function(e){for(var t=e.text.split(";");t.length>0;){var n=t.shift(),r=parseInt(n,10);if(isNaN(r)||0===r)this.fg=this.bg=null,this.bold=!1,this.italic=!1,this.underline=!1;else if(1===r)this.bold=!0;else if(3===r)this.italic=!0;else if(4===r)this.underline=!0;else if(22===r)this.bold=!1;else if(23===r)this.italic=!1;else if(24===r)this.underline=!1;else if(39===r)this.fg=null;else if(49===r)this.bg=null;else if(r>=30&&r<38)this.fg=this.ansi_colors[0][r-30];else if(r>=40&&r<48)this.bg=this.ansi_colors[0][r-40];else if(r>=90&&r<98)this.fg=this.ansi_colors[1][r-90];else if(r>=100&&r<108)this.bg=this.ansi_colors[1][r-100];else if((38===r||48===r)&&t.length>0){var i=38===r,a=t.shift();if("5"===a&&t.length>0){var s=parseInt(t.shift(),10);s>=0&&s<=255&&(i?this.fg=this.palette_256[s]:this.bg=this.palette_256[s])}if("2"===a&&t.length>2){var o=parseInt(t.shift(),10),u=parseInt(t.shift(),10),l=parseInt(t.shift(),10);if(o>=0&&o<=255&&u>=0&&u<=255&&l>=0&&l<=255){var c={rgb:[o,u,l],class_name:"truecolor"};i?this.fg=c:this.bg=c}}}}},e.prototype.transform_to_html=function(e){var t=e.text;if(0===t.length)return t;if(t=this.escape_txt_for_html(t),!e.bold&&!e.italic&&!e.underline&&null===e.fg&&null===e.bg)return t;var n=[],r=[],i=e.fg,a=e.bg;e.bold&&n.push("font-weight:bold"),e.italic&&n.push("font-style:italic"),e.underline&&n.push("text-decoration:underline"),this._use_classes?(i&&("truecolor"!==i.class_name?r.push(i.class_name+"-fg"):n.push("color:rgb("+i.rgb.join(",")+")")),a&&("truecolor"!==a.class_name?r.push(a.class_name+"-bg"):n.push("background-color:rgb("+a.rgb.join(",")+")"))):(i&&n.push("color:rgb("+i.rgb.join(",")+")"),a&&n.push("background-color:rgb("+a.rgb+")"));var s="",o="";return r.length&&(s=' class="'+r.join(" ")+'"'),n.length&&(o=' style="'+n.join(";")+'"'),"<span"+o+s+">"+t+"</span>"},e.prototype.process_hyperlink=function(e){var t=e.url.split(":");return t.length<1?"":this._url_whitelist[t[0]]?'<a href="'+this.escape_txt_for_html(e.url)+'">'+this.escape_txt_for_html(e.text)+"</a>":""},e}();function i(e){var t=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r});var s=r(a),o=function(){function e(){this.stages=[],this.currentStage=null,this.flatLines=[]}return e.prototype.parse=function(e){if(e&&Array.isArray(e)){this.stages=[],this.currentStage=null,this.flatLines=[];for(var t=0,n=0;n<e.length;n++){var r=e[n];if(r.startsWith("START_")){var i=r.split("_"),a=i[1],s=i[2],o=i[3],u=i[4];this.currentStage={stepId:a,status:s,startTime:o,name:u,startIndex:t,endIndex:void 0,logs:[]}}else if(r.startsWith("END_")){var l=r.split("_"),c=l[2],h=l[3];this.currentStage&&(this.currentStage.endTime=h,this.currentStage.endStatus=c,t>this.currentStage.startIndex?this.currentStage.endIndex=t-1:this.currentStage.endIndex=this.currentStage.startIndex>0?this.currentStage.startIndex-1:this.currentStage.startIndex,this.stages.push(this.currentStage),this.currentStage=null)}else this.flatLines.push({type:"log",text:r}),t++,this.currentStage&&this.currentStage.logs.push({type:"log",text:r})}this.currentStage&&(t>this.currentStage.startIndex?this.currentStage.endIndex=t-1:this.currentStage.endIndex=this.currentStage.startIndex>0?this.currentStage.startIndex-1:this.currentStage.startIndex,this.stages.push(this.currentStage),this.currentStage=null)}},e}(),u={entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},l={},c=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=new RegExp("[\\-\\.0-9"+c.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),f=new RegExp("^"+c.source+h.source+"*(?::"+c.source+h.source+"*)?$");function d(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,d)}function p(){}function m(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function g(e,t,n,r,i,a){function s(e,t,r){e in n.attributeNames&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,r)}for(var o,u=++t,l=0;;){var c=e.charAt(u);switch(c){case"=":if(1===l)o=e.slice(t,u),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(a.warning('attribute value must after "="'),o=e.slice(t,u)),t=u+1,!((u=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");s(o,h=e.slice(t,u).replace(/&#?\w+;/g,i),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');s(o,h=e.slice(t,u).replace(/&#?\w+;/g,i),t),a.warning('attribute "'+o+'" missed start quot('+c+")!!"),t=u+1,l=5}break;case"/":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:l=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==l&&n.setTagName(e.slice(t,u)),u;case">":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(h=e.slice(t,u)).slice(-1)&&(n.closed=!0,h=h.slice(0,-1));case 2:2===l&&(h=o),4==l?(a.warning('attribute "'+h+'" missed quot(")!'),s(o,h.replace(/&#?\w+;/g,i),t)):("http://www.w3.org/1999/xhtml"===r[""]&&h.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),s(h,h,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"":c=" ";default:if(c<=" ")switch(l){case 0:n.setTagName(e.slice(t,u)),l=6;break;case 1:o=e.slice(t,u),l=2;break;case 4:var h=e.slice(t,u).replace(/&#?\w+;/g,i);a.warning('attribute "'+h+'" missed quot(")!!'),s(o,h,t);case 5:l=6}else switch(l){case 2:n.tagName,"http://www.w3.org/1999/xhtml"===r[""]&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=u,l=1;break;case 5:a.warning('attribute space is required"'+o+'"!!');case 6:l=1,t=u;break;case 3:l=4,t=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function v(e,t,n){for(var r=e.tagName,i=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;if((f=o.indexOf(":"))>0)var l=s.prefix=o.slice(0,f),c=o.slice(f+1),h="xmlns"===l&&c;else c=o,l=null,h="xmlns"===o&&"";s.localName=c,!1!==h&&(null==i&&(i={},N(n,n={})),n[h]=i[h]=u,s.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(h,u))}for(a=e.length;a--;){(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(s.uri=n[l||""]))}var f;(f=r.indexOf(":"))>0?(l=e.prefix=r.slice(0,f),c=e.localName=r.slice(f+1)):(l=null,c=e.localName=r);var d=e.uri=n[l||""];if(t.startElement(d,c,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=i,!0;if(t.endElement(d,c,r),i)for(l in i)t.endPrefixMapping(l)}function b(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("</"+n+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(i.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,r),i.characters(s,0,s.length),a)}return t+1}function x(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf("</"+n+">"))<t&&(i=e.lastIndexOf("</"+n)),r[n]=i),i<t}function N(e,t){for(var n in e)t[n]=e[n]}function w(e,t,n,r){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;i.lastIndex=t,i.exec(e);for(;n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return n.startDTD(o,u,l),n.endDTD(),c.index+c[0].length}return-1}function _(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function y(){this.attributeNames={}}d.prototype=new Error,d.prototype.name=d.name,p.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),N(t,t={}),function(e,t,n,r,i){function a(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?a(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function o(t){if(t>E){var n=e.substring(E,t).replace(/&#?\w+;/g,s);f&&u(E),r.characters(n,0,t-E),E=t}}function u(t,n){for(;t>=c&&(n=h.exec(e));)l=n.index,c=l+n[0].length,f.lineNumber++;f.columnNumber=t-l+1}var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,f=r.locator,p=[{currentNSMap:t}],N={},E=0;for(;;){try{var S=e.indexOf("<",E);if(S<0){if(!e.substr(E).match(/^\s*$/)){var T=r.doc,I=T.createTextNode(e.substr(E));T.appendChild(I),r.currentElement=I}return}switch(S>E&&o(S),e.charAt(S+1)){case"/":var C=e.indexOf(">",S+3),D=e.substring(S+2,C),k=p.pop();C<0?(D=e.substring(S+2).replace(/[\s<].*/,""),i.error("end tag name: "+D+" is not complete:"+k.tagName),C=S+1+D.length):D.match(/\s</)&&(D=D.replace(/[\s<].*/,""),i.error("end tag name: "+D+" maybe not complete"),C=S+1+D.length);var A=k.localNSMap,O=k.tagName==D;if(O||k.tagName&&k.tagName.toLowerCase()==D.toLowerCase()){if(r.endElement(k.uri,k.localName,D),A)for(var R in A)r.endPrefixMapping(R);O||i.fatalError("end tag name: "+D+" is not match the current start tagName:"+k.tagName)}else p.push(k);C++;break;case"?":f&&u(S),C=_(e,S,r);break;case"!":f&&u(S),C=w(e,S,r,i);break;default:f&&u(S);var M=new y,L=p[p.length-1].currentNSMap,U=(C=g(e,S,M,L,s,i),M.length);if(!M.closed&&x(e,C,M.tagName,N)&&(M.closed=!0,n.nbsp||i.warning("unclosed xml attribute")),f&&U){for(var F=m(f,{}),B=0;B<U;B++){var P=M[B];u(P.offset),P.locator=m(f,{})}r.locator=F,v(M,r,L)&&p.push(M),r.locator=f}else v(M,r,L)&&p.push(M);"http://www.w3.org/1999/xhtml"!==M.uri||M.closed?C++:C=b(e,C,M.tagName,s,r)}}catch(e){if(e instanceof d)throw e;i.error("element parse error: "+e),C=-1}C>E?E=C:o(Math.max(S,E)+1)}}(e,t,n,r,this.errorHandler),r.endDocument()}},y.prototype={setTagName:function(e){if(!f.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!f.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},l.XMLReader=p,l.ParseError=d;var E={};function S(e,t){for(var n in e)t[n]=e[n]}function T(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,S(n,r=new r),e.prototype=n=r}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}var I={},C=I.ELEMENT_NODE=1,D=I.ATTRIBUTE_NODE=2,k=I.TEXT_NODE=3,A=I.CDATA_SECTION_NODE=4,O=I.ENTITY_REFERENCE_NODE=5,R=I.ENTITY_NODE=6,M=I.PROCESSING_INSTRUCTION_NODE=7,L=I.COMMENT_NODE=8,U=I.DOCUMENT_NODE=9,F=I.DOCUMENT_TYPE_NODE=10,B=I.DOCUMENT_FRAGMENT_NODE=11,P=I.NOTATION_NODE=12,q={},j={};q.INDEX_SIZE_ERR=(j[1]="Index size error",1),q.DOMSTRING_SIZE_ERR=(j[2]="DOMString size error",2);var $=q.HIERARCHY_REQUEST_ERR=(j[3]="Hierarchy request error",3);q.WRONG_DOCUMENT_ERR=(j[4]="Wrong document",4),q.INVALID_CHARACTER_ERR=(j[5]="Invalid character",5),q.NO_DATA_ALLOWED_ERR=(j[6]="No data allowed",6),q.NO_MODIFICATION_ALLOWED_ERR=(j[7]="No modification allowed",7);var V=q.NOT_FOUND_ERR=(j[8]="Not found",8);q.NOT_SUPPORTED_ERR=(j[9]="Not supported",9);var z=q.INUSE_ATTRIBUTE_ERR=(j[10]="Attribute in use",10);function H(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,j[e]),this.message=j[e],Error.captureStackTrace&&Error.captureStackTrace(this,H);return n.code=e,t&&(this.message=this.message+": "+t),n}function X(){}function Y(e,t){this._node=e,this._refresh=t,G(this)}function G(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);Te(e,"length",n.length),S(n,e),e._inc=t}}function W(){}function K(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function Z(e,t,n,r){if(r?t[K(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&ie(i,e,r),function(e,t,n){e&&e._inc++;var r=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==r&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(i,e,n))}}function Q(e,t,n){var r=K(t,n);if(!(r>=0))throw H(V,new Error(e.tagName+"@"+n));for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(ie(a,e,n),n.ownerElement=null)}}function J(e){if(this._features={},e)for(var t in e)this._features=e[t]}function ee(){}function te(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function ne(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(ne(e,t))return!0}while(e=e.nextSibling)}function re(){}function ie(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function ae(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a}}}function se(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,ae(e.ownerDocument,e),t}function oe(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===B){var i=t.firstChild;if(null==i)return t;var a=t.lastChild}else i=a=t;var s=n?n.previousSibling:e.lastChild;i.previousSibling=s,a.nextSibling=n,s?s.nextSibling=i:e.firstChild=i,null==n?e.lastChild=a:n.previousSibling=a;do{i.parentNode=e}while(i!==a&&(i=i.nextSibling));return ae(e.ownerDocument||e,e),t.nodeType==B&&(t.firstChild=t.lastChild=null),t}function ue(){this._nsMap={}}function le(){}function ce(){}function he(){}function fe(){}function de(){}function pe(){}function me(){}function ge(){}function ve(){}function be(){}function xe(){}function Ne(){}function we(e,t){var n=[],r=9==this.nodeType&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&null==i&&null==(i=r.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return ye(this,n,e,t,s),n.join("")}function _e(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var a=n.length;a--;){var s=n[a];if(s.prefix==r)return s.namespace!=i}return!0}function ye(e,t,n,r,i){if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case C:i||(i=[]),i.length;var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName;n="http://www.w3.org/1999/xhtml"===e.namespaceURI||n,t.push("<",u);for(var l=0;l<s;l++){"xmlns"==(c=a.item(l)).prefix?i.push({prefix:c.localName,namespace:c.value}):"xmlns"==c.nodeName&&i.push({prefix:"",namespace:c.value})}for(l=0;l<s;l++){var c;if(_e(c=a.item(l),0,i)){var h=c.prefix||"",f=c.namespaceURI,d=h?" xmlns:"+h:" xmlns";t.push(d,'="',f,'"'),i.push({prefix:h,namespace:f})}ye(c,t,n,r,i)}if(_e(e,0,i)){h=e.prefix||"";if(f=e.namespaceURI){d=h?" xmlns:"+h:" xmlns";t.push(d,'="',f,'"'),i.push({prefix:h,namespace:f})}}if(o||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):ye(o,t,n,r,i),o=o.nextSibling;else for(;o;)ye(o,t,n,r,i),o=o.nextSibling;t.push("</",u,">")}else t.push("/>");return;case U:case B:for(o=e.firstChild;o;)ye(o,t,n,r,i),o=o.nextSibling;return;case D:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,te),'"');case k:return t.push(e.data.replace(/[<&]/g,te).replace(/]]>/g,"]]>"));case A:return t.push("<![CDATA[",e.data,"]]>");case L:return t.push("\x3c!--",e.data,"--\x3e");case F:var p=e.publicId,m=e.systemId;if(t.push("<!DOCTYPE ",e.name),p)t.push(" PUBLIC ",p),m&&"."!=m&&t.push(" ",m),t.push(">");else if(m&&"."!=m)t.push(" SYSTEM ",m,">");else{var g=e.internalSubset;g&&t.push(" [",g,"]"),t.push(">")}return;case M:return t.push("<?",e.target," ",e.data,"?>");case O:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Ee(e,t,n){var r;switch(t.nodeType){case C:(r=t.cloneNode(!1)).ownerDocument=e;case B:break;case D:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(Ee(e,i,n)),i=i.nextSibling;return r}function Se(e,t,n){var r=new t.constructor;for(var i in t){var a=t[i];"object"!=typeof a&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new X),r.ownerDocument=e,r.nodeType){case C:var s=t.attributes,o=r.attributes=new W,u=s.length;o._ownerElement=r;for(var l=0;l<u;l++)r.setAttributeNode(Se(e,s.item(l),!0));break;case D:n=!0}if(n)for(var c=t.firstChild;c;)r.appendChild(Se(e,c,n)),c=c.nextSibling;return r}function Te(e,t,n){e[t]=n}q.INVALID_STATE_ERR=(j[11]="Invalid state",11),q.SYNTAX_ERR=(j[12]="Syntax error",12),q.INVALID_MODIFICATION_ERR=(j[13]="Invalid modification",13),q.NAMESPACE_ERR=(j[14]="Invalid namespace",14),q.INVALID_ACCESS_ERR=(j[15]="Invalid access",15),H.prototype=Error.prototype,S(q,H),X.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)ye(this[r],n,e,t);return n.join("")}},Y.prototype.item=function(e){return G(this),this[e]},T(Y,X),W.prototype={length:0,item:X.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new H(z);var n=this.getNamedItem(e.nodeName);return Z(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new H(z);return t=this.getNamedItemNS(e.namespaceURI,e.localName),Z(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return Q(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return Q(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}},J.prototype={hasFeature:function(e,t){var n=this._features[e.toLowerCase()];return!(!n||t&&!(t in n))},createDocument:function(e,t,n){var r=new re;if(r.implementation=this,r.childNodes=new X,r.doctype=n,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new pe;return r.name=e,r.nodeName=e,r.publicId=t,r.systemId=n,r}},ee.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return oe(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return se(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return Se(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==k&&e.nodeType==k?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},S(I,ee),S(I,ee.prototype),re.prototype={nodeName:"#document",nodeType:U,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==B){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==C&&(this.documentElement=e),oe(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),se(this,e)},importNode:function(e,t){return Ee(this,e,t)},getElementById:function(e){var t=null;return ne(this.documentElement,function(n){if(n.nodeType==C&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return new Y(this,function(e){var n=[];return ne(e.documentElement,function(r){r!==e&&r.nodeType==C&&t.test(r.getAttribute("class"))&&n.push(r)}),n})},createElement:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new X,(t.attributes=new W)._ownerElement=t,t},createDocumentFragment:function(){var e=new be;return e.ownerDocument=this,e.childNodes=new X,e},createTextNode:function(e){var t=new he;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new fe;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new de;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new xe;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new le;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ve;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new ue,r=t.split(":"),i=n.attributes=new W;return n.childNodes=new X,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new le,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},T(re,ee),ue.prototype={nodeType:C,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===B?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t),r=e.lastChild}return r=e.lastChild,t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,ae(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new Y(this,function(t){var n=[];return ne(t,function(r){r===t||r.nodeType!=C||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new Y(this,function(n){var r=[];return ne(n,function(i){i===n||i.nodeType!==C||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)}),r})}},re.prototype.getElementsByTagName=ue.prototype.getElementsByTagName,re.prototype.getElementsByTagNameNS=ue.prototype.getElementsByTagNameNS,T(ue,ee),le.prototype.nodeType=D,T(le,ee),ce.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(j[$])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},T(ce,ee),he.prototype={nodeName:"#text",nodeType:k,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},T(he,ce),fe.prototype={nodeName:"#comment",nodeType:L},T(fe,ce),de.prototype={nodeName:"#cdata-section",nodeType:A},T(de,ce),pe.prototype.nodeType=F,T(pe,ee),me.prototype.nodeType=P,T(me,ee),ge.prototype.nodeType=R,T(ge,ee),ve.prototype.nodeType=O,T(ve,ee),be.prototype.nodeName="#document-fragment",be.prototype.nodeType=B,T(be,ee),xe.prototype.nodeType=M,T(xe,ee),Ne.prototype.serializeToString=function(e,t,n){return we.call(e,t,n)},ee.prototype.toString=we;try{if(Object.defineProperty){function ze(e){switch(e.nodeType){case C:case B:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(ze(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(Y.prototype,"length",{get:function(){return G(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return ze(this)},set:function(e){switch(this.nodeType){case C:case B:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Te=function(e,t,n){e["$$"+t]=n}}}catch(He){}function Ie(e){this.options=e||{locator:{}}}function Ce(){this.cdata=!1}function De(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function ke(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Ae(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function Oe(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}E.Node=ee,E.DOMException=H,E.DOMImplementation=J,E.XMLSerializer=Ne,Ie.prototype.parseFromString=function(e,t){var n=this.options,r=new Le,i=n.domBuilder||new Ce,a=n.errorHandler,s=n.locator,o=n.xmlns||{},u=/\/x?html?$/.test(t),l=u?Re.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return s&&i.setDocumentLocator(s),r.errorHandler=function(e,t,n){if(!e){if(t instanceof Ce)return t;e=t}var r={},i=e instanceof Function;function a(t){var a=e[t];!a&&i&&(a=2==e.length?function(n){e(t,n)}:e),r[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+ke(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),r}(a,i,s),r.domBuilder=n.domBuilder||i,u&&(o[""]="http://www.w3.org/1999/xhtml"),o.xml=o.xml||"http://www.w3.org/XML/1998/namespace",e&&"string"==typeof e?r.parse(e,o,l):r.errorHandler.error("invalid doc source"),i.doc},Ce.prototype={startDocument:function(){this.doc=(new Fe).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),s=r.length;Oe(this,a),this.currentElement=a,this.locator&&De(this.locator,a);for(var o=0;o<s;o++){e=r.getURI(o);var u=r.getValue(o),l=(n=r.getQName(o),i.createAttributeNS(e,n));this.locator&&De(r.getLocator(o),l),l.value=l.nodeValue=u,a.setAttributeNode(l)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&De(this.locator,n),Oe(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=Ae.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&De(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=Ae.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&De(this.locator,r),Oe(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&De(this.locator,i),Oe(this,i)}},warning:function(e){console.warn("[xmldom warning]\t"+e,ke(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,ke(this.locator))},fatalError:function(e){throw new Ue(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Ce.prototype[e]=function(){return null}});var Re=u,Me=l,Le=Me.XMLReader,Ue=Me.ParseError,Fe=E.DOMImplementation,Be=Ie,Pe=function(){function e(e,t){void 0===t&&(t={className:"terminal-viewer-hl-mark",markedClassName:"terminal-viewer-hl-mark terminal-viewer-hl-marked"}),this.isMarked=!1,this.dom=(new Be).parseFromString("".concat('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',"<html><body>").concat(e,"</body></html>"),"text/html"),this.options=t,this.matchCount=0,this.matchedIndex=0,this.isMarked=!1,this.hlIndex=0}return e.prototype.mark=function(e,t){var n=this;void 0===t&&(t={matchedIndex:0,hlIndex:0});var r=new RegExp(this.escapeStr(e),"gi"),i=Array.from(this.dom.getElementsByTagName("body")[0].childNodes),a=e.length;return this.matchedIndex=t.matchedIndex,this.hlIndex=t.hlIndex,i.forEach(function(e){var t=n.getTextNodes(e);t.forEach(function(e){for(var t=e,i=t.textContent||"";i;){var s=i.search(r);if(-1===s)break;i=(null==(t=n.wrapRangeInTextNode(t,s,s+a))?void 0:t.textContent)||"",n.matchCount++,n.matchedIndex++}}),t=[]}),i=[],this},e.prototype.escapeStr=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},e.prototype.getStyle=function(e){var t=(e?this.options.markedStyle:this.options.style)||{};return Object.keys(t).filter(function(e){return t[e]}).map(function(e){return"".concat(e,":").concat(t[e],";")}).join("")},e.prototype.getTextNodes=function(e){for(var t=[],n=[e];0!==n.length;){var r=n.shift();if(r&&3===r.nodeType&&t.push(r),r&&r.hasChildNodes()){var i=Array.from(r.childNodes);i.forEach(function(e){3===e.nodeType&&t.push(e)}),n.push.apply(n,i)}}return t},e.prototype.wrapRangeInTextNode=function(e,t,n){var r,i=this.options,a=i.className,s=i.markedClassName,o=e.splitText(t),u=o.splitText(n-t),l=this.dom.createElement("mark"),c=this.getStyle(this.matchedIndex===this.hlIndex);return this.matchedIndex===this.hlIndex&&(this.isMarked=!0),l.setAttribute("class",(this.matchedIndex===this.hlIndex?s:a)||""),c&&l.setAttribute("style",c),l.textContent=o.textContent,null===(r=o.parentNode)||void 0===r||r.replaceChild(l,o),u},e.prototype.toString=function(){var e=this.dom.getElementsByTagName("body")[0].toString().match(/^<body xmlns="http:\/\/www\.w3\.org\/1999\/xhtml">(.[\s\S]*?)<\/body>$/);return e&&e[1]?e[1]:""},e.prototype.distory=function(){this.dom=null},e}(),qe=function(){function e(e){this.options=t({markClassName:"terminal-viewer-hl-mark",markedClassName:"terminal-viewer-hl-mark terminal-viewer-hl-marked"},e||{})}return e.prototype.search=function(e,t,n,r){var i,a,s,o,u;if(void 0===n&&(n=0),void 0===r&&(r=void 0),!Array.isArray(t)||0===t.length||!e)return{count:0,map:{},markedKey:0};for(var l=this.options,c=l.markClassName,h=l.markedClassName,f=l.calculateSearchText,d={color:null===(i=null==r?void 0:r.decorations)||void 0===i?void 0:i.matchForegroundColor,background:null===(a=null==r?void 0:r.decorations)||void 0===a?void 0:a.matchBackground,border:null===(s=null==r?void 0:r.decorations)||void 0===s?void 0:s.matchBorder},p={background:null===(o=null==r?void 0:r.decorations)||void 0===o?void 0:o.activeMatchBackground,border:null===(u=null==r?void 0:r.decorations)||void 0===u?void 0:u.activeMatchBorder},m=0,g=0,v={},b=0,x=t.length;b<x&&!(m>=1e3);b++){var N=t[b],w="";if("object"==typeof N&&(w=(null==f?void 0:f(N))||""),"string"==typeof N&&(w=N),w.toLowerCase().includes(e.toLowerCase())){var _=new Pe(w,{className:c,markedClassName:h,style:d,markedStyle:p}),y=_.mark(e,{matchedIndex:m,hlIndex:n}).toString();_.isMarked&&(g=b),0!==_.matchCount&&(m+=_.matchCount,v[b]=y||w),_.distory(),_=null}}return{count:m,map:v,markedKey:g}},e}(),je=function(){function n(t){var n=t.id,r=t.string;this.id=n,this.string=r,this.searcher=new qe({calculateSearchText:function(e){return e&&"object"==typeof e&&"text"in e&&e.text||""}}),this.parserMap=new e({limit:1}),this.parser=new o,this.ansiUp=new s,this.parse()}return n.prototype.updateString=function(e){this.string!==e&&(this.string=e,this.parserMap.delete(this.id),this.parse())},n.prototype.parse=function(){var e=this;if(0!==this.string.length){if(this.parserMap.has(this.id)){var n=this.parserMap.get(this.id);if(n)return void(this.parser=n)}var r=new o,i=(this.string.includes("\n")?this.string:this.string.replace(/\\r\\n|\\n|\\r/g,"\n")).split(/\r\n|\n|\r/);r.parse(i),r.flatLines=r.flatLines.map(function(n){return"log"===n.type?t(t({},n),{text:e.ansiUp.ansi_to_html(n.text)}):n}),r.stages=r.stages.map(function(n){return t(t({},n),{logs:n.logs.map(function(n){return"log"===n.type?t(t({},n),{text:e.ansiUp.ansi_to_html(n.text)}):n})})}),this.parser=r,this.parserMap.set(this.id,this.parser)}},n.prototype.getArrayData=function(){return this.parser.flatLines.map(function(e){return e.text})},n.prototype.getStages=function(){return this.parser.stages},n.prototype.getFlatLines=function(){return this.parser.flatLines},n.prototype.mark=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=void 0),e?this.searcher.search(e,this.parser.flatLines,t,n):this.searcher.search(e,[])},n}(),$e=new(function(){function e(e){var t=this;this.events={},this.context=e,this.context.addEventListener("message",function(e){var n=e.data.topic;t.exec(n,e.data)})}return e.prototype.on=function(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),this},e.prototype.exec=function(e,t){var n=this;return Array.isArray(this.events[e])?(this.events[e].forEach(function(e){e(n,t)}),this):this},e.prototype.send=function(e,n){return void 0===n&&(n={}),this.context.postMessage(t({topic:e},n)),this},e}())(self),Ve=new e({limit:8});$e.on("highlight-log",function(e,t){var n=t.id,r=t.string;Ve.has(n)?Ve.get(n).updateString(r):Ve.set(n,new je({id:n,string:r}));var i=Ve.get(n),a=(null==i?void 0:i.getArrayData())||[],s=(null==i?void 0:i.getStages())||[],o=(null==i?void 0:i.getFlatLines())||[];e.send("highlight-log-success",{id:n,logs:a,stages:s,flatLines:o})}),$e.on("search-log",function(e,t){var n=t.id,r=t.searchId,i=t.keyword,a=void 0===i?"":i,s=t.hlIndex,o=t.string,u=void 0===o?"":o,l=t.options;if(a){if(Ve.has(n))Ve.get(n).updateString(u);else Ve.set(n,new je({id:n,string:u}));var c=Ve.get(n);if(c){var h=c.mark(a,s,l);e.send("search-log-success",{id:n,searchId:r,searcherResult:h||{map:{},count:0,markedKey:0}})}else e.send("search-log-success",{id:n,searchId:r,searcherResult:{map:{},count:0,markedKey:0}})}else e.send("search-log-success",{id:n,searchId:r,searcherResult:{map:{},count:0,markedKey:0}})})});
|
|
2
2
|
//# sourceMappingURL=log.worker.js.map
|