@langsword/trace 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/trace.css +2 -2
- package/dist/trace.es.js +459 -447
- package/dist/trace.umd.js +31 -31
- package/package.json +1 -1
package/dist/trace.umd.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
(function(De,it){typeof exports=="object"&&typeof module<"u"?it(exports,require("pinia"),require("axios"),require("vue")):typeof define=="function"&&define.amd?define(["exports","pinia","axios","vue"],it):(De=typeof globalThis<"u"?globalThis:De||self,it(De.LangswordTrace={},De.Pinia,De.axios,De.Vue))})(this,function(De,it,Jt,Qc){"use strict";var uv=Object.defineProperty;var Xc=De=>{throw TypeError(De)};var cv=(De,it,Jt)=>it in De?uv(De,it,{enumerable:!0,configurable:!0,writable:!0,value:Jt}):De[it]=Jt;var Je=(De,it,Jt)=>cv(De,typeof it!="symbol"?it+"":it,Jt),fv=(De,it,Jt)=>it.has(De)||Xc("Cannot "+Jt);var Yc=(De,it,Jt)=>it.has(De)?Xc("Cannot add the same private member more than once"):it instanceof WeakSet?it.add(De):it.set(De,Jt);var $a=(De,it,Jt)=>(fv(De,it,"access private method"),Jt);var Qn,co,Jc;var fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Pa={exports:{}},ho;function jt(){return ho||(ho=1,function(l,n){(function(r,o){l.exports=o()})(fo,function(){var r=navigator.userAgent,o=navigator.platform,u=/gecko\/\d/i.test(r),f=/MSIE \d/.test(r),p=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),y=/Edge\/(\d+)/.exec(r),m=f||p||y,k=m&&(f?document.documentMode||6:+(y||p)[1]),S=!y&&/WebKit\//.test(r),F=S&&/Qt\/\d+\.\d+/.test(r),L=!y&&/Chrome\/(\d+)/.exec(r),W=L&&+L[1],z=/Opera\//.test(r),D=/Apple Computer/.test(navigator.vendor),$=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),I=/PhantomJS/.test(r),N=D&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),H=/Android/.test(r),V=N||H||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),ne=N||/Mac/.test(o),ue=/\bCrOS\b/.test(r),se=/win/i.test(o),de=z&&r.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,S=!0);var Oe=ne&&(F||z&&(de==null||de<12.11)),Fe=u||m&&k>=9;function ie(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Pe=function(e,t){var a=e.className,i=ie(t).exec(a);if(i){var s=a.slice(i.index+i[0].length);e.className=a.slice(0,i.index)+(s?i[1]+s:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Q(e,t){return j(e).appendChild(t)}function w(e,t,a,i){var s=document.createElement(e);if(a&&(s.className=a),i&&(s.style.cssText=i),typeof t=="string")s.appendChild(document.createTextNode(t));else if(t)for(var c=0;c<t.length;++c)s.appendChild(t[c]);return s}function J(e,t,a,i){var s=w(e,t,a,i);return s.setAttribute("role","presentation"),s}var G;document.createRange?G=function(e,t,a,i){var s=document.createRange();return s.setEnd(i||e,a),s.setStart(e,t),s}:G=function(e,t,a){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch{return i}return i.collapse(!0),i.moveEnd("character",a),i.moveStart("character",t),i};function A(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function M(e){var t=e.ownerDocument||e,a;try{a=e.activeElement}catch{a=t.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function K(e,t){var a=e.className;ie(t).test(a)||(e.className+=(a?" ":"")+t)}function he(e,t){for(var a=e.split(" "),i=0;i<a.length;i++)a[i]&&!ie(a[i]).test(t)&&(t+=" "+a[i]);return t}var E=function(e){e.select()};N?E=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:m&&(E=function(e){try{e.select()}catch{}});function x(e){return e.display.wrapper.ownerDocument}function oe(e){return _e(e.display.wrapper)}function _e(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function Z(e){return x(e).defaultView}function fe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ke(e,t,a){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(a!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function Le(e,t,a,i,s){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var c=i||0,d=s||0;;){var h=e.indexOf(" ",c);if(h<0||h>=t)return d+(t-c);d+=h-c,d+=a-d%a,c=h+1}}var ct=function(){this.id=null,this.f=null,this.time=0,this.handler=fe(this.onTimeout,this)};ct.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ct.prototype.set=function(e,t){this.f=t;var a=+new Date+e;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=a)};function we(e,t){for(var a=0;a<e.length;++a)if(e[a]==t)return a;return-1}var Re=50,Ke={toString:function(){return"CodeMirror.Pass"}},ft={scroll:!1},Pt={origin:"*mouse"},dt={origin:"+move"};function ht(e,t,a){for(var i=0,s=0;;){var c=e.indexOf(" ",i);c==-1&&(c=e.length);var d=c-i;if(c==e.length||s+d>=t)return i+Math.min(d,t-s);if(s+=c-i,s+=a-s%a,i=c+1,s>=t)return i}}var gt=[""];function Kt(e){for(;gt.length<=e;)gt.push(be(gt)+" ");return gt[e]}function be(e){return e[e.length-1]}function St(e,t){for(var a=[],i=0;i<e.length;i++)a[i]=t(e[i],i);return a}function Vt(e,t,a){for(var i=0,s=a(t);i<e.length&&a(e[i])<=s;)i++;e.splice(i,0,t)}function On(){}function Zn(e,t){var a;return Object.create?a=Object.create(e):(On.prototype=e,a=new On),t&&ke(t,a),a}var wr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ye(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||wr.test(e))}function xe(e,t){return t?t.source.indexOf("\\w")>-1&&ye(e)?!0:t.test(e):ye(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Me=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ie(e){return e.charCodeAt(0)>=768&&Me.test(e)}function zt(e,t,a){for(;(a<0?t>0:t<e.length)&&Ie(e.charAt(t));)t+=a;return t}function en(e,t,a){for(var i=t>a?-1:1;;){if(t==a)return t;var s=(t+a)/2,c=i<0?Math.ceil(s):Math.floor(s);if(c==t)return e(c)?t:a;e(c)?a=c:t=c+i}}function Nn(e,t,a,i){if(!e)return i(t,a,"ltr",0);for(var s=!1,c=0;c<e.length;++c){var d=e[c];(d.from<a&&d.to>t||t==a&&d.to==t)&&(i(Math.max(d.from,t),Math.min(d.to,a),d.level==1?"rtl":"ltr",c),s=!0)}s||i(t,a,"ltr")}var er=null;function Rn(e,t,a){var i;er=null;for(var s=0;s<e.length;++s){var c=e[s];if(c.from<t&&c.to>t)return s;c.to==t&&(c.from!=c.to&&a=="before"?i=s:er=s),c.from==t&&(c.from!=c.to&&a!="before"?i=s:er=s)}return i??er}var ps=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,s=/[stwN]/,c=/[LRr]/,d=/[Lb1n]/,h=/[1n]/;function g(v,C,_){this.level=v,this.from=C,this.to=_}return function(v,C){var _=C=="ltr"?"L":"R";if(v.length==0||C=="ltr"&&!i.test(v))return!1;for(var R=v.length,O=[],B=0;B<R;++B)O.push(a(v.charCodeAt(B)));for(var q=0,Y=_;q<R;++q){var ee=O[q];ee=="m"?O[q]=Y:Y=ee}for(var ae=0,te=_;ae<R;++ae){var le=O[ae];le=="1"&&te=="r"?O[ae]="n":c.test(le)&&(te=le,le=="r"&&(O[ae]="R"))}for(var ve=1,ge=O[0];ve<R-1;++ve){var Ae=O[ve];Ae=="+"&&ge=="1"&&O[ve+1]=="1"?O[ve]="1":Ae==","&&ge==O[ve+1]&&(ge=="1"||ge=="n")&&(O[ve]=ge),ge=Ae}for(var Ue=0;Ue<R;++Ue){var xt=O[Ue];if(xt==",")O[Ue]="N";else if(xt=="%"){var Qe=void 0;for(Qe=Ue+1;Qe<R&&O[Qe]=="%";++Qe);for(var Wt=Ue&&O[Ue-1]=="!"||Qe<R&&O[Qe]=="1"?"1":"N",Ft=Ue;Ft<Qe;++Ft)O[Ft]=Wt;Ue=Qe-1}}for(var lt=0,Mt=_;lt<R;++lt){var Ct=O[lt];Mt=="L"&&Ct=="1"?O[lt]="L":c.test(Ct)&&(Mt=Ct)}for(var pt=0;pt<R;++pt)if(s.test(O[pt])){var ut=void 0;for(ut=pt+1;ut<R&&s.test(O[ut]);++ut);for(var rt=(pt?O[pt-1]:_)=="L",$t=(ut<R?O[ut]:_)=="L",Kr=rt==$t?rt?"L":"R":_,Kn=pt;Kn<ut;++Kn)O[Kn]=Kr;pt=ut-1}for(var Et=[],kn,wt=0;wt<R;)if(d.test(O[wt])){var lo=wt;for(++wt;wt<R&&d.test(O[wt]);++wt);Et.push(new g(0,lo,wt))}else{var Dn=wt,cr=Et.length,fr=C=="rtl"?1:0;for(++wt;wt<R&&O[wt]!="L";++wt);for(var At=Dn;At<wt;)if(h.test(O[At])){Dn<At&&(Et.splice(cr,0,new g(1,Dn,At)),cr+=fr);var Vr=At;for(++At;At<wt&&h.test(O[At]);++At);Et.splice(cr,0,new g(2,Vr,At)),cr+=fr,Dn=At}else++At;Dn<wt&&Et.splice(cr,0,new g(1,Dn,wt))}return C=="ltr"&&(Et[0].level==1&&(kn=v.match(/^\s+/))&&(Et[0].from=kn[0].length,Et.unshift(new g(0,0,kn[0].length))),be(Et).level==1&&(kn=v.match(/\s+$/))&&(be(Et).to-=kn[0].length,Et.push(new g(0,R-kn[0].length,R)))),C=="rtl"?Et.reverse():Et}}();function $e(e,t){var a=e.order;return a==null&&(a=e.order=ps(e.text,t)),a}var ia=[],me=function(e,t,a){if(e.addEventListener)e.addEventListener(t,a,!1);else if(e.attachEvent)e.attachEvent("on"+t,a);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||ia).concat(a)}};function Cn(e,t){return e._handlers&&e._handlers[t]||ia}function Tt(e,t,a){if(e.removeEventListener)e.removeEventListener(t,a,!1);else if(e.detachEvent)e.detachEvent("on"+t,a);else{var i=e._handlers,s=i&&i[t];if(s){var c=we(s,a);c>-1&&(i[t]=s.slice(0,c).concat(s.slice(c+1)))}}}function et(e,t){var a=Cn(e,t);if(a.length)for(var i=Array.prototype.slice.call(arguments,2),s=0;s<a.length;++s)a[s].apply(null,i)}function tt(e,t,a){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),et(e,a||t.type,e,t),Dt(t)||t.codemirrorIgnore}function tn(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var a=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)we(a,t[i])==-1&&a.push(t[i])}function Bt(e,t){return Cn(e,t).length>0}function sn(e){e.prototype.on=function(t,a){me(this,t,a)},e.prototype.off=function(t,a){Tt(this,t,a)}}function _t(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function kr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Dt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Fn(e){_t(e),kr(e)}function li(e){return e.target||e.srcElement}function on(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ne&&e.ctrlKey&&t==1&&(t=3),t}var gs=function(){if(m&&k<9)return!1;var e=w("div");return"draggable"in e||"dragDrop"in e}(),Sr;function aa(e){if(Sr==null){var t=w("span","");Q(e,w("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Sr=t.offsetWidth<=1&&t.offsetHeight>2&&!(m&&k<8))}var a=Sr?w("span",""):w("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var ui;function Mn(e){if(ui!=null)return ui;var t=Q(e,document.createTextNode("AخA")),a=G(t,0,1).getBoundingClientRect(),i=G(t,1,2).getBoundingClientRect();return j(e),!a||a.left==a.right?!1:ui=i.right-a.right<3}var nn=`
|
|
1
|
+
(function(De,it){typeof exports=="object"&&typeof module<"u"?it(exports,require("pinia"),require("axios"),require("vue")):typeof define=="function"&&define.amd?define(["exports","pinia","axios","vue"],it):(De=typeof globalThis<"u"?globalThis:De||self,it(De.LangswordTrace={},De.Pinia,De.axios,De.Vue))})(this,function(De,it,Jt,Qc){"use strict";var uv=Object.defineProperty;var Xc=De=>{throw TypeError(De)};var cv=(De,it,Jt)=>it in De?uv(De,it,{enumerable:!0,configurable:!0,writable:!0,value:Jt}):De[it]=Jt;var Je=(De,it,Jt)=>cv(De,typeof it!="symbol"?it+"":it,Jt),fv=(De,it,Jt)=>it.has(De)||Xc("Cannot "+Jt);var Yc=(De,it,Jt)=>it.has(De)?Xc("Cannot add the same private member more than once"):it instanceof WeakSet?it.add(De):it.set(De,Jt);var $a=(De,it,Jt)=>(fv(De,it,"access private method"),Jt);var Qn,co,Jc;var fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Pa={exports:{}},ho;function jt(){return ho||(ho=1,function(l,n){(function(r,o){l.exports=o()})(fo,function(){var r=navigator.userAgent,o=navigator.platform,u=/gecko\/\d/i.test(r),f=/MSIE \d/.test(r),p=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),y=/Edge\/(\d+)/.exec(r),m=f||p||y,k=m&&(f?document.documentMode||6:+(y||p)[1]),S=!y&&/WebKit\//.test(r),R=S&&/Qt\/\d+\.\d+/.test(r),L=!y&&/Chrome\/(\d+)/.exec(r),W=L&&+L[1],z=/Opera\//.test(r),D=/Apple Computer/.test(navigator.vendor),$=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),I=/PhantomJS/.test(r),N=D&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),H=/Android/.test(r),V=N||H||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),ne=N||/Mac/.test(o),ue=/\bCrOS\b/.test(r),se=/win/i.test(o),de=z&&r.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,S=!0);var Oe=ne&&(R||z&&(de==null||de<12.11)),Re=u||m&&k>=9;function ie(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Pe=function(e,t){var a=e.className,i=ie(t).exec(a);if(i){var s=a.slice(i.index+i[0].length);e.className=a.slice(0,i.index)+(s?i[1]+s:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Q(e,t){return j(e).appendChild(t)}function w(e,t,a,i){var s=document.createElement(e);if(a&&(s.className=a),i&&(s.style.cssText=i),typeof t=="string")s.appendChild(document.createTextNode(t));else if(t)for(var c=0;c<t.length;++c)s.appendChild(t[c]);return s}function J(e,t,a,i){var s=w(e,t,a,i);return s.setAttribute("role","presentation"),s}var G;document.createRange?G=function(e,t,a,i){var s=document.createRange();return s.setEnd(i||e,a),s.setStart(e,t),s}:G=function(e,t,a){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch{return i}return i.collapse(!0),i.moveEnd("character",a),i.moveStart("character",t),i};function A(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function M(e){var t=e.ownerDocument||e,a;try{a=e.activeElement}catch{a=t.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function K(e,t){var a=e.className;ie(t).test(a)||(e.className+=(a?" ":"")+t)}function he(e,t){for(var a=e.split(" "),i=0;i<a.length;i++)a[i]&&!ie(a[i]).test(t)&&(t+=" "+a[i]);return t}var E=function(e){e.select()};N?E=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:m&&(E=function(e){try{e.select()}catch{}});function x(e){return e.display.wrapper.ownerDocument}function oe(e){return _e(e.display.wrapper)}function _e(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function Z(e){return x(e).defaultView}function fe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ke(e,t,a){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(a!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function Le(e,t,a,i,s){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var c=i||0,d=s||0;;){var h=e.indexOf(" ",c);if(h<0||h>=t)return d+(t-c);d+=h-c,d+=a-d%a,c=h+1}}var ct=function(){this.id=null,this.f=null,this.time=0,this.handler=fe(this.onTimeout,this)};ct.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ct.prototype.set=function(e,t){this.f=t;var a=+new Date+e;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=a)};function we(e,t){for(var a=0;a<e.length;++a)if(e[a]==t)return a;return-1}var Fe=50,Ke={toString:function(){return"CodeMirror.Pass"}},ft={scroll:!1},Pt={origin:"*mouse"},dt={origin:"+move"};function ht(e,t,a){for(var i=0,s=0;;){var c=e.indexOf(" ",i);c==-1&&(c=e.length);var d=c-i;if(c==e.length||s+d>=t)return i+Math.min(d,t-s);if(s+=c-i,s+=a-s%a,i=c+1,s>=t)return i}}var gt=[""];function Kt(e){for(;gt.length<=e;)gt.push(be(gt)+" ");return gt[e]}function be(e){return e[e.length-1]}function St(e,t){for(var a=[],i=0;i<e.length;i++)a[i]=t(e[i],i);return a}function Vt(e,t,a){for(var i=0,s=a(t);i<e.length&&a(e[i])<=s;)i++;e.splice(i,0,t)}function On(){}function Zn(e,t){var a;return Object.create?a=Object.create(e):(On.prototype=e,a=new On),t&&ke(t,a),a}var wr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ye(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||wr.test(e))}function xe(e,t){return t?t.source.indexOf("\\w")>-1&&ye(e)?!0:t.test(e):ye(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Me=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ie(e){return e.charCodeAt(0)>=768&&Me.test(e)}function zt(e,t,a){for(;(a<0?t>0:t<e.length)&&Ie(e.charAt(t));)t+=a;return t}function en(e,t,a){for(var i=t>a?-1:1;;){if(t==a)return t;var s=(t+a)/2,c=i<0?Math.ceil(s):Math.floor(s);if(c==t)return e(c)?t:a;e(c)?a=c:t=c+i}}function Nn(e,t,a,i){if(!e)return i(t,a,"ltr",0);for(var s=!1,c=0;c<e.length;++c){var d=e[c];(d.from<a&&d.to>t||t==a&&d.to==t)&&(i(Math.max(d.from,t),Math.min(d.to,a),d.level==1?"rtl":"ltr",c),s=!0)}s||i(t,a,"ltr")}var er=null;function Fn(e,t,a){var i;er=null;for(var s=0;s<e.length;++s){var c=e[s];if(c.from<t&&c.to>t)return s;c.to==t&&(c.from!=c.to&&a=="before"?i=s:er=s),c.from==t&&(c.from!=c.to&&a!="before"?i=s:er=s)}return i??er}var ps=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,s=/[stwN]/,c=/[LRr]/,d=/[Lb1n]/,h=/[1n]/;function g(v,C,_){this.level=v,this.from=C,this.to=_}return function(v,C){var _=C=="ltr"?"L":"R";if(v.length==0||C=="ltr"&&!i.test(v))return!1;for(var F=v.length,O=[],B=0;B<F;++B)O.push(a(v.charCodeAt(B)));for(var U=0,Y=_;U<F;++U){var ee=O[U];ee=="m"?O[U]=Y:Y=ee}for(var ae=0,te=_;ae<F;++ae){var le=O[ae];le=="1"&&te=="r"?O[ae]="n":c.test(le)&&(te=le,le=="r"&&(O[ae]="R"))}for(var ve=1,ge=O[0];ve<F-1;++ve){var Ae=O[ve];Ae=="+"&&ge=="1"&&O[ve+1]=="1"?O[ve]="1":Ae==","&&ge==O[ve+1]&&(ge=="1"||ge=="n")&&(O[ve]=ge),ge=Ae}for(var qe=0;qe<F;++qe){var xt=O[qe];if(xt==",")O[qe]="N";else if(xt=="%"){var Qe=void 0;for(Qe=qe+1;Qe<F&&O[Qe]=="%";++Qe);for(var Wt=qe&&O[qe-1]=="!"||Qe<F&&O[Qe]=="1"?"1":"N",Rt=qe;Rt<Qe;++Rt)O[Rt]=Wt;qe=Qe-1}}for(var lt=0,Mt=_;lt<F;++lt){var Ct=O[lt];Mt=="L"&&Ct=="1"?O[lt]="L":c.test(Ct)&&(Mt=Ct)}for(var pt=0;pt<F;++pt)if(s.test(O[pt])){var ut=void 0;for(ut=pt+1;ut<F&&s.test(O[ut]);++ut);for(var rt=(pt?O[pt-1]:_)=="L",$t=(ut<F?O[ut]:_)=="L",Kr=rt==$t?rt?"L":"R":_,Kn=pt;Kn<ut;++Kn)O[Kn]=Kr;pt=ut-1}for(var Et=[],kn,wt=0;wt<F;)if(d.test(O[wt])){var lo=wt;for(++wt;wt<F&&d.test(O[wt]);++wt);Et.push(new g(0,lo,wt))}else{var Dn=wt,cr=Et.length,fr=C=="rtl"?1:0;for(++wt;wt<F&&O[wt]!="L";++wt);for(var At=Dn;At<wt;)if(h.test(O[At])){Dn<At&&(Et.splice(cr,0,new g(1,Dn,At)),cr+=fr);var Vr=At;for(++At;At<wt&&h.test(O[At]);++At);Et.splice(cr,0,new g(2,Vr,At)),cr+=fr,Dn=At}else++At;Dn<wt&&Et.splice(cr,0,new g(1,Dn,wt))}return C=="ltr"&&(Et[0].level==1&&(kn=v.match(/^\s+/))&&(Et[0].from=kn[0].length,Et.unshift(new g(0,0,kn[0].length))),be(Et).level==1&&(kn=v.match(/\s+$/))&&(be(Et).to-=kn[0].length,Et.push(new g(0,F-kn[0].length,F)))),C=="rtl"?Et.reverse():Et}}();function $e(e,t){var a=e.order;return a==null&&(a=e.order=ps(e.text,t)),a}var ia=[],me=function(e,t,a){if(e.addEventListener)e.addEventListener(t,a,!1);else if(e.attachEvent)e.attachEvent("on"+t,a);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||ia).concat(a)}};function Cn(e,t){return e._handlers&&e._handlers[t]||ia}function Tt(e,t,a){if(e.removeEventListener)e.removeEventListener(t,a,!1);else if(e.detachEvent)e.detachEvent("on"+t,a);else{var i=e._handlers,s=i&&i[t];if(s){var c=we(s,a);c>-1&&(i[t]=s.slice(0,c).concat(s.slice(c+1)))}}}function et(e,t){var a=Cn(e,t);if(a.length)for(var i=Array.prototype.slice.call(arguments,2),s=0;s<a.length;++s)a[s].apply(null,i)}function tt(e,t,a){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),et(e,a||t.type,e,t),Dt(t)||t.codemirrorIgnore}function tn(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var a=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)we(a,t[i])==-1&&a.push(t[i])}function Bt(e,t){return Cn(e,t).length>0}function sn(e){e.prototype.on=function(t,a){me(this,t,a)},e.prototype.off=function(t,a){Tt(this,t,a)}}function _t(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function kr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Dt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Rn(e){_t(e),kr(e)}function li(e){return e.target||e.srcElement}function on(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ne&&e.ctrlKey&&t==1&&(t=3),t}var gs=function(){if(m&&k<9)return!1;var e=w("div");return"draggable"in e||"dragDrop"in e}(),Sr;function aa(e){if(Sr==null){var t=w("span","");Q(e,w("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Sr=t.offsetWidth<=1&&t.offsetHeight>2&&!(m&&k<8))}var a=Sr?w("span",""):w("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var ui;function Mn(e){if(ui!=null)return ui;var t=Q(e,document.createTextNode("AخA")),a=G(t,0,1).getBoundingClientRect(),i=G(t,1,2).getBoundingClientRect();return j(e),!a||a.left==a.right?!1:ui=i.right-a.right<3}var nn=`
|
|
2
2
|
|
|
3
3
|
b`.split(/\n/).length!=3?function(e){for(var t=0,a=[],i=e.length;t<=i;){var s=e.indexOf(`
|
|
4
|
-
`,t);s==-1&&(s=e.length);var c=e.slice(t,e.charAt(s-1)=="\r"?s-1:s),d=c.indexOf("\r");d!=-1?(a.push(c.slice(0,d)),t+=d+1):(a.push(c),t=s+1)}return a}:function(e){return e.split(/\r\n?|\n/)},$n=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},sa=function(){var e=w("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ln=null;function ms(e){if(ln!=null)return ln;var t=Q(e,w("span","x")),a=t.getBoundingClientRect(),i=G(t,0,1).getBoundingClientRect();return ln=Math.abs(a.left-i.left)>1}var Cr={},un={};function cn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Cr[e]=t}function tr(e,t){un[e]=t}function Tr(e){if(typeof e=="string"&&un.hasOwnProperty(e))e=un[e];else if(e&&typeof e.name=="string"&&un.hasOwnProperty(e.name)){var t=un[e.name];typeof t=="string"&&(t={name:t}),e=Zn(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function _r(e,t){t=Tr(t);var a=Cr[t.name];if(!a)return _r(e,"text/plain");var i=a(e,t);if(Pn.hasOwnProperty(t.name)){var s=Pn[t.name];for(var c in s)s.hasOwnProperty(c)&&(i.hasOwnProperty(c)&&(i["_"+c]=i[c]),i[c]=s[c])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var d in t.modeProps)i[d]=t.modeProps[d];return i}var Pn={};function Lr(e,t){var a=Pn.hasOwnProperty(e)?Pn[e]:Pn[e]={};ke(t,a)}function yn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var a={};for(var i in t){var s=t[i];s instanceof Array&&(s=s.concat([])),a[i]=s}return a}function ci(e,t){for(var a;e.innerMode&&(a=e.innerMode(t),!(!a||a.mode==e));)t=a.state,e=a.mode;return a||{mode:e,state:t}}function Er(e,t,a){return e.startState?e.startState(t,a):!0}var nt=function(e,t,a){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};nt.prototype.eol=function(){return this.pos>=this.string.length},nt.prototype.sol=function(){return this.pos==this.lineStart},nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},nt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},nt.prototype.eat=function(e){var t=this.string.charAt(this.pos),a;if(typeof e=="string"?a=t==e:a=t&&(e.test?e.test(t):e(t)),a)return++this.pos,t},nt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},nt.prototype.skipToEnd=function(){this.pos=this.string.length},nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},nt.prototype.backUp=function(e){this.pos-=e},nt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},nt.prototype.indentation=function(){return Le(this.string,null,this.tabSize)-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},nt.prototype.match=function(e,t,a){if(typeof e=="string"){var i=function(d){return a?d.toLowerCase():d},s=this.string.substr(this.pos,e.length);if(i(s)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var c=this.string.slice(this.pos).match(e);return c&&c.index>0?null:(c&&t!==!1&&(this.pos+=c[0].length),c)}},nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ce(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var a=e;!a.lines;)for(var i=0;;++i){var s=a.children[i],c=s.chunkSize();if(t<c){a=s;break}t-=c}return a.lines[t]}function Tn(e,t,a){var i=[],s=t.line;return e.iter(t.line,a.line+1,function(c){var d=c.text;s==a.line&&(d=d.slice(0,a.ch)),s==t.line&&(d=d.slice(t.ch)),i.push(d),++s}),i}function fi(e,t,a){var i=[];return e.iter(t,a,function(s){i.push(s.text)}),i}function Xt(e,t){var a=t-e.height;if(a)for(var i=e;i;i=i.parent)i.height+=a}function b(e){if(e.parent==null)return null;for(var t=e.parent,a=we(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var s=0;i.children[s]!=t;++s)a+=i.children[s].chunkSize();return a+t.first}function T(e,t){var a=e.first;e:do{for(var i=0;i<e.children.length;++i){var s=e.children[i],c=s.height;if(t<c){e=s;continue e}t-=c,a+=s.chunkSize()}return a}while(!e.lines);for(var d=0;d<e.lines.length;++d){var h=e.lines[d],g=h.height;if(t<g)break;t-=g}return a+d}function U(e,t){return t>=e.first&&t<e.first+e.size}function X(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function P(e,t,a){if(a===void 0&&(a=null),!(this instanceof P))return new P(e,t,a);this.line=e,this.ch=t,this.sticky=a}function re(e,t){return e.line-t.line||e.ch-t.ch}function ze(e,t){return e.sticky==t.sticky&&re(e,t)==0}function mt(e){return P(e.line,e.ch)}function Ot(e,t){return re(e,t)<0?t:e}function Ir(e,t){return re(e,t)<0?e:t}function Yl(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return P(e.first,0);var a=e.first+e.size-1;return t.line>a?P(a,ce(e,a).text.length):cg(t,ce(e,t.line).text.length)}function cg(e,t){var a=e.ch;return a==null||a>t?P(e.line,t):a<0?P(e.line,0):e}function Jl(e,t){for(var a=[],i=0;i<t.length;i++)a[i]=Ce(e,t[i]);return a}var oa=function(e,t){this.state=e,this.lookAhead=t},bn=function(e,t,a,i){this.state=t,this.doc=e,this.line=a,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};bn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},bn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},bn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},bn.fromSaved=function(e,t,a){return t instanceof oa?new bn(e,yn(e.mode,t.state),a,t.lookAhead):new bn(e,yn(e.mode,t),a)},bn.prototype.save=function(e){var t=e!==!1?yn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new oa(t,this.maxLookAhead):t};function Ql(e,t,a,i){var s=[e.state.modeGen],c={};iu(e,t.text,e.doc.mode,a,function(v,C){return s.push(v,C)},c,i);for(var d=a.state,h=function(v){a.baseTokens=s;var C=e.state.overlays[v],_=1,R=0;a.state=!0,iu(e,t.text,C.mode,a,function(O,B){for(var q=_;R<O;){var Y=s[_];Y>O&&s.splice(_,1,O,s[_+1],Y),_+=2,R=Math.min(O,Y)}if(B)if(C.opaque)s.splice(q,_-q,O,"overlay "+B),_=q+2;else for(;q<_;q+=2){var ee=s[q+1];s[q+1]=(ee?ee+" ":"")+"overlay "+B}},c),a.state=d,a.baseTokens=null,a.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)h(g);return{styles:s,classes:c.bgClass||c.textClass?c:null}}function Zl(e,t,a){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=di(e,b(t)),s=t.text.length>e.options.maxHighlightLength&&yn(e.doc.mode,i.state),c=Ql(e,t,i);s&&(i.state=s),t.stateAfter=i.save(!s),t.styles=c.styles,c.classes?t.styleClasses=c.classes:t.styleClasses&&(t.styleClasses=null),a===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function di(e,t,a){var i=e.doc,s=e.display;if(!i.mode.startState)return new bn(i,!0,t);var c=fg(e,t,a),d=c>i.first&&ce(i,c-1).stateAfter,h=d?bn.fromSaved(i,d,c):new bn(i,Er(i.mode),c);return i.iter(c,t,function(g){vs(e,g.text,h);var v=h.line;g.stateAfter=v==t-1||v%5==0||v>=s.viewFrom&&v<s.viewTo?h.save():null,h.nextLine()}),a&&(i.modeFrontier=h.line),h}function vs(e,t,a,i){var s=e.doc.mode,c=new nt(t,e.options.tabSize,a);for(c.start=c.pos=i||0,t==""&&eu(s,a.state);!c.eol();)ys(s,c,a.state),c.start=c.pos}function eu(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var a=ci(e,t);if(a.mode.blankLine)return a.mode.blankLine(a.state)}}function ys(e,t,a,i){for(var s=0;s<10;s++){i&&(i[0]=ci(e,a).mode);var c=e.token(t,a);if(t.pos>t.start)return c}throw new Error("Mode "+e.name+" failed to advance stream.")}var tu=function(e,t,a){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=a};function nu(e,t,a,i){var s=e.doc,c=s.mode,d;t=Ce(s,t);var h=ce(s,t.line),g=di(e,t.line,a),v=new nt(h.text,e.options.tabSize,g),C;for(i&&(C=[]);(i||v.pos<t.ch)&&!v.eol();)v.start=v.pos,d=ys(c,v,g.state),i&&C.push(new tu(v,d,yn(s.mode,g.state)));return i?C:new tu(v,d,g.state)}function ru(e,t){if(e)for(;;){var a=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;e=e.slice(0,a.index)+e.slice(a.index+a[0].length);var i=a[1]?"bgClass":"textClass";t[i]==null?t[i]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+a[2])}return e}function iu(e,t,a,i,s,c,d){var h=a.flattenSpans;h==null&&(h=e.options.flattenSpans);var g=0,v=null,C=new nt(t,e.options.tabSize,i),_,R=e.options.addModeClass&&[null];for(t==""&&ru(eu(a,i.state),c);!C.eol();){if(C.pos>e.options.maxHighlightLength?(h=!1,d&&vs(e,t,i,C.pos),C.pos=t.length,_=null):_=ru(ys(a,C,i.state,R),c),R){var O=R[0].name;O&&(_="m-"+(_?O+" "+_:O))}if(!h||v!=_){for(;g<C.start;)g=Math.min(C.start,g+5e3),s(g,v);v=_}C.start=C.pos}for(;g<C.pos;){var B=Math.min(C.pos,g+5e3);s(B,v),g=B}}function fg(e,t,a){for(var i,s,c=e.doc,d=a?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>d;--h){if(h<=c.first)return c.first;var g=ce(c,h-1),v=g.stateAfter;if(v&&(!a||h+(v instanceof oa?v.lookAhead:0)<=c.modeFrontier))return h;var C=Le(g.text,null,e.options.tabSize);(s==null||i>C)&&(s=h-1,i=C)}return s}function dg(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var a=e.first,i=t-1;i>a;i--){var s=ce(e,i).stateAfter;if(s&&(!(s instanceof oa)||i+s.lookAhead<t)){a=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,a)}}var au=!1,_n=!1;function hg(){au=!0}function pg(){_n=!0}function la(e,t,a){this.marker=e,this.from=t,this.to=a}function hi(e,t){if(e)for(var a=0;a<e.length;++a){var i=e[a];if(i.marker==t)return i}}function gg(e,t){for(var a,i=0;i<e.length;++i)e[i]!=t&&(a||(a=[])).push(e[i]);return a}function mg(e,t,a){var i=a&&window.WeakSet&&(a.markedSpans||(a.markedSpans=new WeakSet));i&&e.markedSpans&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}function vg(e,t,a){var i;if(e)for(var s=0;s<e.length;++s){var c=e[s],d=c.marker,h=c.from==null||(d.inclusiveLeft?c.from<=t:c.from<t);if(h||c.from==t&&d.type=="bookmark"&&(!a||!c.marker.insertLeft)){var g=c.to==null||(d.inclusiveRight?c.to>=t:c.to>t);(i||(i=[])).push(new la(d,c.from,g?null:c.to))}}return i}function yg(e,t,a){var i;if(e)for(var s=0;s<e.length;++s){var c=e[s],d=c.marker,h=c.to==null||(d.inclusiveRight?c.to>=t:c.to>t);if(h||c.from==t&&d.type=="bookmark"&&(!a||c.marker.insertLeft)){var g=c.from==null||(d.inclusiveLeft?c.from<=t:c.from<t);(i||(i=[])).push(new la(d,g?null:c.from-t,c.to==null?null:c.to-t))}}return i}function bs(e,t){if(t.full)return null;var a=U(e,t.from.line)&&ce(e,t.from.line).markedSpans,i=U(e,t.to.line)&&ce(e,t.to.line).markedSpans;if(!a&&!i)return null;var s=t.from.ch,c=t.to.ch,d=re(t.from,t.to)==0,h=vg(a,s,d),g=yg(i,c,d),v=t.text.length==1,C=be(t.text).length+(v?s:0);if(h)for(var _=0;_<h.length;++_){var R=h[_];if(R.to==null){var O=hi(g,R.marker);O?v&&(R.to=O.to==null?null:O.to+C):R.to=s}}if(g)for(var B=0;B<g.length;++B){var q=g[B];if(q.to!=null&&(q.to+=C),q.from==null){var Y=hi(h,q.marker);Y||(q.from=C,v&&(h||(h=[])).push(q))}else q.from+=C,v&&(h||(h=[])).push(q)}h&&(h=su(h)),g&&g!=h&&(g=su(g));var ee=[h];if(!v){var ae=t.text.length-2,te;if(ae>0&&h)for(var le=0;le<h.length;++le)h[le].to==null&&(te||(te=[])).push(new la(h[le].marker,null,null));for(var ve=0;ve<ae;++ve)ee.push(te);ee.push(g)}return ee}function su(e){for(var t=0;t<e.length;++t){var a=e[t];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function bg(e,t,a){var i=null;if(e.iter(t.line,a.line+1,function(O){if(O.markedSpans)for(var B=0;B<O.markedSpans.length;++B){var q=O.markedSpans[B].marker;q.readOnly&&(!i||we(i,q)==-1)&&(i||(i=[])).push(q)}}),!i)return null;for(var s=[{from:t,to:a}],c=0;c<i.length;++c)for(var d=i[c],h=d.find(0),g=0;g<s.length;++g){var v=s[g];if(!(re(v.to,h.from)<0||re(v.from,h.to)>0)){var C=[g,1],_=re(v.from,h.from),R=re(v.to,h.to);(_<0||!d.inclusiveLeft&&!_)&&C.push({from:v.from,to:h.from}),(R>0||!d.inclusiveRight&&!R)&&C.push({from:h.to,to:v.to}),s.splice.apply(s,C),g+=C.length-3}}return s}function ou(e){var t=e.markedSpans;if(t){for(var a=0;a<t.length;++a)t[a].marker.detachLine(e);e.markedSpans=null}}function lu(e,t){if(t){for(var a=0;a<t.length;++a)t[a].marker.attachLine(e);e.markedSpans=t}}function ua(e){return e.inclusiveLeft?-1:0}function ca(e){return e.inclusiveRight?1:0}function xs(e,t){var a=e.lines.length-t.lines.length;if(a!=0)return a;var i=e.find(),s=t.find(),c=re(i.from,s.from)||ua(e)-ua(t);if(c)return-c;var d=re(i.to,s.to)||ca(e)-ca(t);return d||t.id-e.id}function uu(e,t){var a=_n&&e.markedSpans,i;if(a)for(var s=void 0,c=0;c<a.length;++c)s=a[c],s.marker.collapsed&&(t?s.from:s.to)==null&&(!i||xs(i,s.marker)<0)&&(i=s.marker);return i}function cu(e){return uu(e,!0)}function fa(e){return uu(e,!1)}function xg(e,t){var a=_n&&e.markedSpans,i;if(a)for(var s=0;s<a.length;++s){var c=a[s];c.marker.collapsed&&(c.from==null||c.from<t)&&(c.to==null||c.to>t)&&(!i||xs(i,c.marker)<0)&&(i=c.marker)}return i}function fu(e,t,a,i,s){var c=ce(e,t),d=_n&&c.markedSpans;if(d)for(var h=0;h<d.length;++h){var g=d[h];if(g.marker.collapsed){var v=g.marker.find(0),C=re(v.from,a)||ua(g.marker)-ua(s),_=re(v.to,i)||ca(g.marker)-ca(s);if(!(C>=0&&_<=0||C<=0&&_>=0)&&(C<=0&&(g.marker.inclusiveRight&&s.inclusiveLeft?re(v.to,a)>=0:re(v.to,a)>0)||C>=0&&(g.marker.inclusiveRight&&s.inclusiveLeft?re(v.from,i)<=0:re(v.from,i)<0)))return!0}}}function fn(e){for(var t;t=cu(e);)e=t.find(-1,!0).line;return e}function wg(e){for(var t;t=fa(e);)e=t.find(1,!0).line;return e}function kg(e){for(var t,a;t=fa(e);)e=t.find(1,!0).line,(a||(a=[])).push(e);return a}function ws(e,t){var a=ce(e,t),i=fn(a);return a==i?t:b(i)}function du(e,t){if(t>e.lastLine())return t;var a=ce(e,t),i;if(!zn(e,a))return t;for(;i=fa(a);)a=i.find(1,!0).line;return b(a)+1}function zn(e,t){var a=_n&&t.markedSpans;if(a){for(var i=void 0,s=0;s<a.length;++s)if(i=a[s],!!i.marker.collapsed){if(i.from==null)return!0;if(!i.marker.widgetNode&&i.from==0&&i.marker.inclusiveLeft&&ks(e,t,i))return!0}}}function ks(e,t,a){if(a.to==null){var i=a.marker.find(1,!0);return ks(e,i.line,hi(i.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==t.text.length)return!0;for(var s=void 0,c=0;c<t.markedSpans.length;++c)if(s=t.markedSpans[c],s.marker.collapsed&&!s.marker.widgetNode&&s.from==a.to&&(s.to==null||s.to!=a.from)&&(s.marker.inclusiveLeft||a.marker.inclusiveRight)&&ks(e,t,s))return!0}function Ln(e){e=fn(e);for(var t=0,a=e.parent,i=0;i<a.lines.length;++i){var s=a.lines[i];if(s==e)break;t+=s.height}for(var c=a.parent;c;a=c,c=a.parent)for(var d=0;d<c.children.length;++d){var h=c.children[d];if(h==a)break;t+=h.height}return t}function da(e){if(e.height==0)return 0;for(var t=e.text.length,a,i=e;a=cu(i);){var s=a.find(0,!0);i=s.from.line,t+=s.from.ch-s.to.ch}for(i=e;a=fa(i);){var c=a.find(0,!0);t-=i.text.length-c.from.ch,i=c.to.line,t+=i.text.length-c.to.ch}return t}function Ss(e){var t=e.display,a=e.doc;t.maxLine=ce(a,a.first),t.maxLineLength=da(t.maxLine),t.maxLineChanged=!0,a.iter(function(i){var s=da(i);s>t.maxLineLength&&(t.maxLineLength=s,t.maxLine=i)})}var Ar=function(e,t,a){this.text=e,lu(this,t),this.height=a?a(this):1};Ar.prototype.lineNo=function(){return b(this)},sn(Ar);function Sg(e,t,a,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ou(e),lu(e,a);var s=i?i(e):1;s!=e.height&&Xt(e,s)}function Cg(e){e.parent=null,ou(e)}var Tg={},_g={};function hu(e,t){if(!e||/^\s*$/.test(e))return null;var a=t.addModeClass?_g:Tg;return a[e]||(a[e]=e.replace(/\S+/g,"cm-$&"))}function pu(e,t){var a=J("span",null,null,S?"padding-right: .1px":null),i={pre:J("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var c=s?t.rest[s-1]:t.line,d=void 0;i.pos=0,i.addToken=Eg,Mn(e.display.measure)&&(d=$e(c,e.doc.direction))&&(i.addToken=Ag(i.addToken,d)),i.map=[];var h=t!=e.display.externalMeasured&&b(c);Dg(c,i,Zl(e,c,h)),c.styleClasses&&(c.styleClasses.bgClass&&(i.bgClass=he(c.styleClasses.bgClass,i.bgClass||"")),c.styleClasses.textClass&&(i.textClass=he(c.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(aa(e.display.measure))),s==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(S){var g=i.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return et(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=he(i.pre.className,i.textClass||"")),i}function Lg(e){var t=w("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Eg(e,t,a,i,s,c,d){if(t){var h=e.splitSpaces?Ig(t,e.trailingSpace):t,g=e.cm.state.specialChars,v=!1,C;if(!g.test(t))e.col+=t.length,C=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,C),m&&k<9&&(v=!0),e.pos+=t.length;else{C=document.createDocumentFragment();for(var _=0;;){g.lastIndex=_;var R=g.exec(t),O=R?R.index-_:t.length-_;if(O){var B=document.createTextNode(h.slice(_,_+O));m&&k<9?C.appendChild(w("span",[B])):C.appendChild(B),e.map.push(e.pos,e.pos+O,B),e.col+=O,e.pos+=O}if(!R)break;_+=O+1;var q=void 0;if(R[0]==" "){var Y=e.cm.options.tabSize,ee=Y-e.col%Y;q=C.appendChild(w("span",Kt(ee),"cm-tab")),q.setAttribute("role","presentation"),q.setAttribute("cm-text"," "),e.col+=ee}else R[0]=="\r"||R[0]==`
|
|
5
|
-
`?(q=C.appendChild(w("span",R[0]=="\r"?"␍":"","cm-invalidchar")),q.setAttribute("cm-text",R[0]),e.col+=1):(q=e.cm.options.specialCharPlaceholder(R[0]),q.setAttribute("cm-text",R[0]),m&&k<9?C.appendChild(w("span",[q])):C.appendChild(q),e.col+=1);e.map.push(e.pos,e.pos+1,q),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,a||i||s||v||c||d){var ae=a||"";i&&(ae+=i),s&&(ae+=s);var te=w("span",[C],ae,c);if(d)for(var le in d)d.hasOwnProperty(le)&&le!="style"&&le!="class"&&te.setAttribute(le,d[le]);return e.content.appendChild(te)}e.content.appendChild(C)}}function Ig(e,t){if(e.length>1&&!/ /.test(e))return e;for(var a=t,i="",s=0;s<e.length;s++){var c=e.charAt(s);c==" "&&a&&(s==e.length-1||e.charCodeAt(s+1)==32)&&(c=" "),i+=c,a=c==" "}return i}function Ag(e,t){return function(a,i,s,c,d,h,g){s=s?s+" cm-force-border":"cm-force-border";for(var v=a.pos,C=v+i.length;;){for(var _=void 0,R=0;R<t.length&&(_=t[R],!(_.to>v&&_.from<=v));R++);if(_.to>=C)return e(a,i,s,c,d,h,g);e(a,i.slice(0,_.to-v),s,c,null,h,g),c=null,i=i.slice(_.to-v),v=_.to}}}function gu(e,t,a,i){var s=!i&&a.widgetNode;s&&e.map.push(e.pos,e.pos+t,s),!i&&e.cm.display.input.needsContentAttribute&&(s||(s=e.content.appendChild(document.createElement("span"))),s.setAttribute("cm-marker",a.id)),s&&(e.cm.display.input.setUneditable(s),e.content.appendChild(s)),e.pos+=t,e.trailingSpace=!1}function Dg(e,t,a){var i=e.markedSpans,s=e.text,c=0;if(!i){for(var d=1;d<a.length;d+=2)t.addToken(t,s.slice(c,c=a[d]),hu(a[d+1],t.cm.options));return}for(var h=s.length,g=0,v=1,C="",_,R,O=0,B,q,Y,ee,ae;;){if(O==g){B=q=Y=R="",ae=null,ee=null,O=1/0;for(var te=[],le=void 0,ve=0;ve<i.length;++ve){var ge=i[ve],Ae=ge.marker;if(Ae.type=="bookmark"&&ge.from==g&&Ae.widgetNode)te.push(Ae);else if(ge.from<=g&&(ge.to==null||ge.to>g||Ae.collapsed&&ge.to==g&&ge.from==g)){if(ge.to!=null&&ge.to!=g&&O>ge.to&&(O=ge.to,q=""),Ae.className&&(B+=" "+Ae.className),Ae.css&&(R=(R?R+";":"")+Ae.css),Ae.startStyle&&ge.from==g&&(Y+=" "+Ae.startStyle),Ae.endStyle&&ge.to==O&&(le||(le=[])).push(Ae.endStyle,ge.to),Ae.title&&((ae||(ae={})).title=Ae.title),Ae.attributes)for(var Ue in Ae.attributes)(ae||(ae={}))[Ue]=Ae.attributes[Ue];Ae.collapsed&&(!ee||xs(ee.marker,Ae)<0)&&(ee=ge)}else ge.from>g&&O>ge.from&&(O=ge.from)}if(le)for(var xt=0;xt<le.length;xt+=2)le[xt+1]==O&&(q+=" "+le[xt]);if(!ee||ee.from==g)for(var Qe=0;Qe<te.length;++Qe)gu(t,0,te[Qe]);if(ee&&(ee.from||0)==g){if(gu(t,(ee.to==null?h+1:ee.to)-g,ee.marker,ee.from==null),ee.to==null)return;ee.to==g&&(ee=!1)}}if(g>=h)break;for(var Wt=Math.min(h,O);;){if(C){var Ft=g+C.length;if(!ee){var lt=Ft>Wt?C.slice(0,Wt-g):C;t.addToken(t,lt,_?_+B:B,Y,g+lt.length==O?q:"",R,ae)}if(Ft>=Wt){C=C.slice(Wt-g),g=Wt;break}g=Ft,Y=""}C=s.slice(c,c=a[v++]),_=hu(a[v++],t.cm.options)}}}function mu(e,t,a){this.line=t,this.rest=kg(t),this.size=this.rest?b(be(this.rest))-a+1:1,this.node=this.text=null,this.hidden=zn(e,t)}function ha(e,t,a){for(var i=[],s,c=t;c<a;c=s){var d=new mu(e.doc,ce(e.doc,c),c);s=c+d.size,i.push(d)}return i}var Dr=null;function Og(e){Dr?Dr.ops.push(e):e.ownsGroup=Dr={ops:[e],delayedCallbacks:[]}}function Ng(e){var t=e.delayedCallbacks,a=0;do{for(;a<t.length;a++)t[a].call(null);for(var i=0;i<e.ops.length;i++){var s=e.ops[i];if(s.cursorActivityHandlers)for(;s.cursorActivityCalled<s.cursorActivityHandlers.length;)s.cursorActivityHandlers[s.cursorActivityCalled++].call(null,s.cm)}}while(a<t.length)}function Rg(e,t){var a=e.ownsGroup;if(a)try{Ng(a)}finally{Dr=null,t(a)}}var pi=null;function vt(e,t){var a=Cn(e,t);if(a.length){var i=Array.prototype.slice.call(arguments,2),s;Dr?s=Dr.delayedCallbacks:pi?s=pi:(s=pi=[],setTimeout(Fg,0));for(var c=function(h){s.push(function(){return a[h].apply(null,i)})},d=0;d<a.length;++d)c(d)}}function Fg(){var e=pi;pi=null;for(var t=0;t<e.length;++t)e[t]()}function vu(e,t,a,i){for(var s=0;s<t.changes.length;s++){var c=t.changes[s];c=="text"?$g(e,t):c=="gutter"?bu(e,t,a,i):c=="class"?Cs(e,t):c=="widget"&&Pg(e,t,i)}t.changes=null}function gi(e){return e.node==e.text&&(e.node=w("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),m&&k<8&&(e.node.style.zIndex=2)),e.node}function Mg(e,t){var a=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),t.background)a?t.background.className=a:(t.background.parentNode.removeChild(t.background),t.background=null);else if(a){var i=gi(t);t.background=i.insertBefore(w("div",null,a),i.firstChild),e.display.input.setUneditable(t.background)}}function yu(e,t){var a=e.display.externalMeasured;return a&&a.line==t.line?(e.display.externalMeasured=null,t.measure=a.measure,a.built):pu(e,t)}function $g(e,t){var a=t.text.className,i=yu(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,Cs(e,t)):a&&(t.text.className=a)}function Cs(e,t){Mg(e,t),t.line.wrapClass?gi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var a=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=a||""}function bu(e,t,a,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var s=gi(t);t.gutterBackground=w("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),s.insertBefore(t.gutterBackground,t.text)}var c=t.line.gutterMarkers;if(e.options.lineNumbers||c){var d=gi(t),h=t.gutter=w("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),d.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!c||!c["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(w("div",X(e.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),c)for(var g=0;g<e.display.gutterSpecs.length;++g){var v=e.display.gutterSpecs[g].className,C=c.hasOwnProperty(v)&&c[v];C&&h.appendChild(w("div",[C],"CodeMirror-gutter-elt","left: "+i.gutterLeft[v]+"px; width: "+i.gutterWidth[v]+"px"))}}}function Pg(e,t,a){t.alignable&&(t.alignable=null);for(var i=ie("CodeMirror-linewidget"),s=t.node.firstChild,c=void 0;s;s=c)c=s.nextSibling,i.test(s.className)&&t.node.removeChild(s);xu(e,t,a)}function zg(e,t,a,i){var s=yu(e,t);return t.text=t.node=s.pre,s.bgClass&&(t.bgClass=s.bgClass),s.textClass&&(t.textClass=s.textClass),Cs(e,t),bu(e,t,a,i),xu(e,t,i),t.node}function xu(e,t,a){if(wu(e,t.line,t,a,!0),t.rest)for(var i=0;i<t.rest.length;i++)wu(e,t.rest[i],t,a,!1)}function wu(e,t,a,i,s){if(t.widgets)for(var c=gi(a),d=0,h=t.widgets;d<h.length;++d){var g=h[d],v=w("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),Bg(g,v,a,i),e.display.input.setUneditable(v),s&&g.above?c.insertBefore(v,a.gutter||a.text):c.appendChild(v),vt(g,"redraw")}}function Bg(e,t,a,i){if(e.noHScroll){(a.alignable||(a.alignable=[])).push(t);var s=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(s-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=s+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function mi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var a="position: relative;";e.coverGutter&&(a+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(a+="width: "+t.display.wrapper.clientWidth+"px;"),Q(t.display.measure,w("div",[e.node],null,a))}return e.height=e.node.parentNode.offsetHeight}function En(e,t){for(var a=li(t);a!=e.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==e.sizer&&a!=e.mover)return!0}function pa(e){return e.lineSpace.offsetTop}function Ts(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ku(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Q(e.measure,w("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function xn(e){return Re-e.display.nativeBarWidth}function nr(e){return e.display.scroller.clientWidth-xn(e)-e.display.barWidth}function _s(e){return e.display.scroller.clientHeight-xn(e)-e.display.barHeight}function Hg(e,t,a){var i=e.options.lineWrapping,s=i&&nr(e);if(!t.measure.heights||i&&t.measure.width!=s){var c=t.measure.heights=[];if(i){t.measure.width=s;for(var d=t.text.firstChild.getClientRects(),h=0;h<d.length-1;h++){var g=d[h],v=d[h+1];Math.abs(g.bottom-v.bottom)>2&&c.push((g.bottom+v.top)/2-a.top)}}c.push(a.bottom-a.top)}}function Su(e,t,a){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var s=0;s<e.rest.length;s++)if(b(e.rest[s])>a)return{map:e.measure.maps[s],cache:e.measure.caches[s],before:!0}}}function Wg(e,t){t=fn(t);var a=b(t),i=e.display.externalMeasured=new mu(e.doc,t,a);i.lineN=a;var s=i.built=pu(e,i);return i.text=s.pre,Q(e.display.lineMeasure,s.pre),i}function Cu(e,t,a,i){return wn(e,Or(e,t),a,i)}function Ls(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ar(e,t)];var a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size)return a}function Or(e,t){var a=b(t),i=Ls(e,a);i&&!i.text?i=null:i&&i.changes&&(vu(e,i,a,Os(e)),e.curOp.forceUpdate=!0),i||(i=Wg(e,t));var s=Su(i,t,a);return{line:t,view:i,rect:null,map:s.map,cache:s.cache,before:s.before,hasHeights:!1}}function wn(e,t,a,i,s){t.before&&(a=-1);var c=a+(i||""),d;return t.cache.hasOwnProperty(c)?d=t.cache[c]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Hg(e,t.view,t.rect),t.hasHeights=!0),d=Ug(e,t,a,i),d.bogus||(t.cache[c]=d)),{left:d.left,right:d.right,top:s?d.rtop:d.top,bottom:s?d.rbottom:d.bottom}}var Tu={left:0,right:0,top:0,bottom:0};function _u(e,t,a){for(var i,s,c,d,h,g,v=0;v<e.length;v+=3)if(h=e[v],g=e[v+1],t<h?(s=0,c=1,d="left"):t<g?(s=t-h,c=s+1):(v==e.length-3||t==g&&e[v+3]>t)&&(c=g-h,s=c-1,t>=g&&(d="right")),s!=null){if(i=e[v+2],h==g&&a==(i.insertLeft?"left":"right")&&(d=a),a=="left"&&s==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)i=e[(v-=3)+2],d="left";if(a=="right"&&s==g-h)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)i=e[(v+=3)+2],d="right";break}return{node:i,start:s,end:c,collapse:d,coverStart:h,coverEnd:g}}function jg(e,t){var a=Tu;if(t=="left")for(var i=0;i<e.length&&(a=e[i]).left==a.right;i++);else for(var s=e.length-1;s>=0&&(a=e[s]).left==a.right;s--);return a}function Ug(e,t,a,i){var s=_u(t.map,a,i),c=s.node,d=s.start,h=s.end,g=s.collapse,v;if(c.nodeType==3){for(var C=0;C<4;C++){for(;d&&Ie(t.line.text.charAt(s.coverStart+d));)--d;for(;s.coverStart+h<s.coverEnd&&Ie(t.line.text.charAt(s.coverStart+h));)++h;if(m&&k<9&&d==0&&h==s.coverEnd-s.coverStart?v=c.parentNode.getBoundingClientRect():v=jg(G(c,d,h).getClientRects(),i),v.left||v.right||d==0)break;h=d,d=d-1,g="right"}m&&k<11&&(v=qg(e.display.measure,v))}else{d>0&&(g=i="right");var _;e.options.lineWrapping&&(_=c.getClientRects()).length>1?v=_[i=="right"?_.length-1:0]:v=c.getBoundingClientRect()}if(m&&k<9&&!d&&(!v||!v.left&&!v.right)){var R=c.parentNode.getClientRects()[0];R?v={left:R.left,right:R.left+Rr(e.display),top:R.top,bottom:R.bottom}:v=Tu}for(var O=v.top-t.rect.top,B=v.bottom-t.rect.top,q=(O+B)/2,Y=t.view.measure.heights,ee=0;ee<Y.length-1&&!(q<Y[ee]);ee++);var ae=ee?Y[ee-1]:0,te=Y[ee],le={left:(g=="right"?v.right:v.left)-t.rect.left,right:(g=="left"?v.left:v.right)-t.rect.left,top:ae,bottom:te};return!v.left&&!v.right&&(le.bogus=!0),e.options.singleCursorHeightPerLine||(le.rtop=O,le.rbottom=B),le}function qg(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ms(e))return t;var a=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*a,right:t.right*a,top:t.top*i,bottom:t.bottom*i}}function Lu(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Eu(e){e.display.externalMeasure=null,j(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Lu(e.display.view[t])}function vi(e){Eu(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Iu(e){return L&&H?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Au(e){return L&&H?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Es(e){var t=fn(e),a=t.widgets,i=0;if(a)for(var s=0;s<a.length;++s)a[s].above&&(i+=mi(a[s]));return i}function ga(e,t,a,i,s){if(!s){var c=Es(t);a.top+=c,a.bottom+=c}if(i=="line")return a;i||(i="local");var d=Ln(t);if(i=="local"?d+=pa(e.display):d-=e.display.viewOffset,i=="page"||i=="window"){var h=e.display.lineSpace.getBoundingClientRect();d+=h.top+(i=="window"?0:Au(x(e)));var g=h.left+(i=="window"?0:Iu(x(e)));a.left+=g,a.right+=g}return a.top+=d,a.bottom+=d,a}function Du(e,t,a){if(a=="div")return t;var i=t.left,s=t.top;if(a=="page")i-=Iu(x(e)),s-=Au(x(e));else if(a=="local"||!a){var c=e.display.sizer.getBoundingClientRect();i+=c.left,s+=c.top}var d=e.display.lineSpace.getBoundingClientRect();return{left:i-d.left,top:s-d.top}}function ma(e,t,a,i,s){return i||(i=ce(e.doc,t.line)),ga(e,i,Cu(e,i,t.ch,s),a)}function dn(e,t,a,i,s,c){i=i||ce(e.doc,t.line),s||(s=Or(e,i));function d(B,q){var Y=wn(e,s,B,q?"right":"left",c);return q?Y.left=Y.right:Y.right=Y.left,ga(e,i,Y,a)}var h=$e(i,e.doc.direction),g=t.ch,v=t.sticky;if(g>=i.text.length?(g=i.text.length,v="before"):g<=0&&(g=0,v="after"),!h)return d(v=="before"?g-1:g,v=="before");function C(B,q,Y){var ee=h[q],ae=ee.level==1;return d(Y?B-1:B,ae!=Y)}var _=Rn(h,g,v),R=er,O=C(g,_,v=="before");return R!=null&&(O.other=C(g,R,v!="before")),O}function Ou(e,t){var a=0;t=Ce(e.doc,t),e.options.lineWrapping||(a=Rr(e.display)*t.ch);var i=ce(e.doc,t.line),s=Ln(i)+pa(e.display);return{left:a,right:a,top:s,bottom:s+i.height}}function Is(e,t,a,i,s){var c=P(e,t,a);return c.xRel=s,i&&(c.outside=i),c}function As(e,t,a){var i=e.doc;if(a+=e.display.viewOffset,a<0)return Is(i.first,0,null,-1,-1);var s=T(i,a),c=i.first+i.size-1;if(s>c)return Is(i.first+i.size-1,ce(i,c).text.length,null,1,1);t<0&&(t=0);for(var d=ce(i,s);;){var h=Gg(e,d,s,t,a),g=xg(d,h.ch+(h.xRel>0||h.outside>0?1:0));if(!g)return h;var v=g.find(1);if(v.line==s)return v;d=ce(i,s=v.line)}}function Nu(e,t,a,i){i-=Es(t);var s=t.text.length,c=en(function(d){return wn(e,a,d-1).bottom<=i},s,0);return s=en(function(d){return wn(e,a,d).top>i},c,s),{begin:c,end:s}}function Ru(e,t,a,i){a||(a=Or(e,t));var s=ga(e,t,wn(e,a,i),"line").top;return Nu(e,t,a,s)}function Ds(e,t,a,i){return e.bottom<=a?!1:e.top>a?!0:(i?e.left:e.right)>t}function Gg(e,t,a,i,s){s-=Ln(t);var c=Or(e,t),d=Es(t),h=0,g=t.text.length,v=!0,C=$e(t,e.doc.direction);if(C){var _=(e.options.lineWrapping?Vg:Kg)(e,t,a,c,C,i,s);v=_.level!=1,h=v?_.from:_.to-1,g=v?_.to:_.from-1}var R=null,O=null,B=en(function(ve){var ge=wn(e,c,ve);return ge.top+=d,ge.bottom+=d,Ds(ge,i,s,!1)?(ge.top<=s&&ge.left<=i&&(R=ve,O=ge),!0):!1},h,g),q,Y,ee=!1;if(O){var ae=i-O.left<O.right-i,te=ae==v;B=R+(te?0:1),Y=te?"after":"before",q=ae?O.left:O.right}else{!v&&(B==g||B==h)&&B++,Y=B==0?"after":B==t.text.length?"before":wn(e,c,B-(v?1:0)).bottom+d<=s==v?"after":"before";var le=dn(e,P(a,B,Y),"line",t,c);q=le.left,ee=s<le.top?-1:s>=le.bottom?1:0}return B=zt(t.text,B,1),Is(a,B,Y,ee,i-q)}function Kg(e,t,a,i,s,c,d){var h=en(function(_){var R=s[_],O=R.level!=1;return Ds(dn(e,P(a,O?R.to:R.from,O?"before":"after"),"line",t,i),c,d,!0)},0,s.length-1),g=s[h];if(h>0){var v=g.level!=1,C=dn(e,P(a,v?g.from:g.to,v?"after":"before"),"line",t,i);Ds(C,c,d,!0)&&C.top>d&&(g=s[h-1])}return g}function Vg(e,t,a,i,s,c,d){var h=Nu(e,t,i,d),g=h.begin,v=h.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var C=null,_=null,R=0;R<s.length;R++){var O=s[R];if(!(O.from>=v||O.to<=g)){var B=O.level!=1,q=wn(e,i,B?Math.min(v,O.to)-1:Math.max(g,O.from)).right,Y=q<c?c-q+1e9:q-c;(!C||_>Y)&&(C=O,_=Y)}}return C||(C=s[s.length-1]),C.from<g&&(C={from:g,to:C.to,level:C.level}),C.to>v&&(C={from:C.from,to:v,level:C.level}),C}var rr;function Nr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(rr==null){rr=w("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(w("br"));rr.appendChild(document.createTextNode("x"))}Q(e.measure,rr);var a=rr.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),j(e.measure),a||1}function Rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=w("span","xxxxxxxxxx"),a=w("pre",[t],"CodeMirror-line-like");Q(e.measure,a);var i=t.getBoundingClientRect(),s=(i.right-i.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function Os(e){for(var t=e.display,a={},i={},s=t.gutters.clientLeft,c=t.gutters.firstChild,d=0;c;c=c.nextSibling,++d){var h=e.display.gutterSpecs[d].className;a[h]=c.offsetLeft+c.clientLeft+s,i[h]=c.clientWidth}return{fixedPos:Ns(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ns(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Fu(e){var t=Nr(e.display),a=e.options.lineWrapping,i=a&&Math.max(5,e.display.scroller.clientWidth/Rr(e.display)-3);return function(s){if(zn(e.doc,s))return 0;var c=0;if(s.widgets)for(var d=0;d<s.widgets.length;d++)s.widgets[d].height&&(c+=s.widgets[d].height);return a?c+(Math.ceil(s.text.length/i)||1)*t:c+t}}function Rs(e){var t=e.doc,a=Fu(e);t.iter(function(i){var s=a(i);s!=i.height&&Xt(i,s)})}function ir(e,t,a,i){var s=e.display;if(!a&&li(t).getAttribute("cm-not-content")=="true")return null;var c,d,h=s.lineSpace.getBoundingClientRect();try{c=t.clientX-h.left,d=t.clientY-h.top}catch{return null}var g=As(e,c,d),v;if(i&&g.xRel>0&&(v=ce(e.doc,g.line).text).length==g.ch){var C=Le(v,v.length,e.options.tabSize)-v.length;g=P(g.line,Math.max(0,Math.round((c-ku(e.display).left)/Rr(e.display))-C))}return g}function ar(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var a=e.display.view,i=0;i<a.length;i++)if(t-=a[i].size,t<0)return i}function Nt(e,t,a,i){t==null&&(t=e.doc.first),a==null&&(a=e.doc.first+e.doc.size),i||(i=0);var s=e.display;if(i&&a<s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>t)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo)_n&&ws(e.doc,t)<s.viewTo&&Hn(e);else if(a<=s.viewFrom)_n&&du(e.doc,a+i)>s.viewFrom?Hn(e):(s.viewFrom+=i,s.viewTo+=i);else if(t<=s.viewFrom&&a>=s.viewTo)Hn(e);else if(t<=s.viewFrom){var c=va(e,a,a+i,1);c?(s.view=s.view.slice(c.index),s.viewFrom=c.lineN,s.viewTo+=i):Hn(e)}else if(a>=s.viewTo){var d=va(e,t,t,-1);d?(s.view=s.view.slice(0,d.index),s.viewTo=d.lineN):Hn(e)}else{var h=va(e,t,t,-1),g=va(e,a,a+i,1);h&&g?(s.view=s.view.slice(0,h.index).concat(ha(e,h.lineN,g.lineN)).concat(s.view.slice(g.index)),s.viewTo+=i):Hn(e)}var v=s.externalMeasured;v&&(a<v.lineN?v.lineN+=i:t<v.lineN+v.size&&(s.externalMeasured=null))}function Bn(e,t,a){e.curOp.viewChanged=!0;var i=e.display,s=e.display.externalMeasured;if(s&&t>=s.lineN&&t<s.lineN+s.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var c=i.view[ar(e,t)];if(c.node!=null){var d=c.changes||(c.changes=[]);we(d,a)==-1&&d.push(a)}}}function Hn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function va(e,t,a,i){var s=ar(e,t),c,d=e.display.view;if(!_n||a==e.doc.first+e.doc.size)return{index:s,lineN:a};for(var h=e.display.viewFrom,g=0;g<s;g++)h+=d[g].size;if(h!=t){if(i>0){if(s==d.length-1)return null;c=h+d[s].size-t,s++}else c=h-t;t+=c,a+=c}for(;ws(e.doc,a)!=a;){if(s==(i<0?0:d.length-1))return null;a+=i*d[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:a}}function Xg(e,t,a){var i=e.display,s=i.view;s.length==0||t>=i.viewTo||a<=i.viewFrom?(i.view=ha(e,t,a),i.viewFrom=t):(i.viewFrom>t?i.view=ha(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ar(e,t))),i.viewFrom=t,i.viewTo<a?i.view=i.view.concat(ha(e,i.viewTo,a)):i.viewTo>a&&(i.view=i.view.slice(0,ar(e,a)))),i.viewTo=a}function Mu(e){for(var t=e.display.view,a=0,i=0;i<t.length;i++){var s=t[i];!s.hidden&&(!s.node||s.changes)&&++a}return a}function yi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function $u(e,t){t===void 0&&(t=!0);var a=e.doc,i={},s=i.cursors=document.createDocumentFragment(),c=i.selection=document.createDocumentFragment(),d=e.options.$customCursor;d&&(t=!0);for(var h=0;h<a.sel.ranges.length;h++)if(!(!t&&h==a.sel.primIndex)){var g=a.sel.ranges[h];if(!(g.from().line>=e.display.viewTo||g.to().line<e.display.viewFrom)){var v=g.empty();if(d){var C=d(e,g);C&&Fs(e,C,s)}else(v||e.options.showCursorWhenSelecting)&&Fs(e,g.head,s);v||Yg(e,g,c)}}return i}function Fs(e,t,a){var i=dn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),s=a.appendChild(w("div"," ","CodeMirror-cursor"));if(s.style.left=i.left+"px",s.style.top=i.top+"px",s.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var c=ma(e,t,"div",null,null),d=c.right-c.left;s.style.width=(d>0?d:e.defaultCharWidth())+"px"}if(i.other){var h=a.appendChild(w("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=i.other.left+"px",h.style.top=i.other.top+"px",h.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function ya(e,t){return e.top-t.top||e.left-t.left}function Yg(e,t,a){var i=e.display,s=e.doc,c=document.createDocumentFragment(),d=ku(e.display),h=d.left,g=Math.max(i.sizerWidth,nr(e)-i.sizer.offsetLeft)-d.right,v=s.direction=="ltr";function C(te,le,ve,ge){le<0&&(le=0),le=Math.round(le),ge=Math.round(ge),c.appendChild(w("div",null,"CodeMirror-selected","position: absolute; left: "+te+`px;
|
|
4
|
+
`,t);s==-1&&(s=e.length);var c=e.slice(t,e.charAt(s-1)=="\r"?s-1:s),d=c.indexOf("\r");d!=-1?(a.push(c.slice(0,d)),t+=d+1):(a.push(c),t=s+1)}return a}:function(e){return e.split(/\r\n?|\n/)},$n=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},sa=function(){var e=w("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ln=null;function ms(e){if(ln!=null)return ln;var t=Q(e,w("span","x")),a=t.getBoundingClientRect(),i=G(t,0,1).getBoundingClientRect();return ln=Math.abs(a.left-i.left)>1}var Cr={},un={};function cn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Cr[e]=t}function tr(e,t){un[e]=t}function Tr(e){if(typeof e=="string"&&un.hasOwnProperty(e))e=un[e];else if(e&&typeof e.name=="string"&&un.hasOwnProperty(e.name)){var t=un[e.name];typeof t=="string"&&(t={name:t}),e=Zn(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function _r(e,t){t=Tr(t);var a=Cr[t.name];if(!a)return _r(e,"text/plain");var i=a(e,t);if(Pn.hasOwnProperty(t.name)){var s=Pn[t.name];for(var c in s)s.hasOwnProperty(c)&&(i.hasOwnProperty(c)&&(i["_"+c]=i[c]),i[c]=s[c])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var d in t.modeProps)i[d]=t.modeProps[d];return i}var Pn={};function Lr(e,t){var a=Pn.hasOwnProperty(e)?Pn[e]:Pn[e]={};ke(t,a)}function yn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var a={};for(var i in t){var s=t[i];s instanceof Array&&(s=s.concat([])),a[i]=s}return a}function ci(e,t){for(var a;e.innerMode&&(a=e.innerMode(t),!(!a||a.mode==e));)t=a.state,e=a.mode;return a||{mode:e,state:t}}function Er(e,t,a){return e.startState?e.startState(t,a):!0}var nt=function(e,t,a){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};nt.prototype.eol=function(){return this.pos>=this.string.length},nt.prototype.sol=function(){return this.pos==this.lineStart},nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},nt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},nt.prototype.eat=function(e){var t=this.string.charAt(this.pos),a;if(typeof e=="string"?a=t==e:a=t&&(e.test?e.test(t):e(t)),a)return++this.pos,t},nt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},nt.prototype.skipToEnd=function(){this.pos=this.string.length},nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},nt.prototype.backUp=function(e){this.pos-=e},nt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},nt.prototype.indentation=function(){return Le(this.string,null,this.tabSize)-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},nt.prototype.match=function(e,t,a){if(typeof e=="string"){var i=function(d){return a?d.toLowerCase():d},s=this.string.substr(this.pos,e.length);if(i(s)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var c=this.string.slice(this.pos).match(e);return c&&c.index>0?null:(c&&t!==!1&&(this.pos+=c[0].length),c)}},nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ce(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var a=e;!a.lines;)for(var i=0;;++i){var s=a.children[i],c=s.chunkSize();if(t<c){a=s;break}t-=c}return a.lines[t]}function Tn(e,t,a){var i=[],s=t.line;return e.iter(t.line,a.line+1,function(c){var d=c.text;s==a.line&&(d=d.slice(0,a.ch)),s==t.line&&(d=d.slice(t.ch)),i.push(d),++s}),i}function fi(e,t,a){var i=[];return e.iter(t,a,function(s){i.push(s.text)}),i}function Xt(e,t){var a=t-e.height;if(a)for(var i=e;i;i=i.parent)i.height+=a}function b(e){if(e.parent==null)return null;for(var t=e.parent,a=we(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var s=0;i.children[s]!=t;++s)a+=i.children[s].chunkSize();return a+t.first}function T(e,t){var a=e.first;e:do{for(var i=0;i<e.children.length;++i){var s=e.children[i],c=s.height;if(t<c){e=s;continue e}t-=c,a+=s.chunkSize()}return a}while(!e.lines);for(var d=0;d<e.lines.length;++d){var h=e.lines[d],g=h.height;if(t<g)break;t-=g}return a+d}function q(e,t){return t>=e.first&&t<e.first+e.size}function X(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function P(e,t,a){if(a===void 0&&(a=null),!(this instanceof P))return new P(e,t,a);this.line=e,this.ch=t,this.sticky=a}function re(e,t){return e.line-t.line||e.ch-t.ch}function ze(e,t){return e.sticky==t.sticky&&re(e,t)==0}function mt(e){return P(e.line,e.ch)}function Ot(e,t){return re(e,t)<0?t:e}function Ir(e,t){return re(e,t)<0?e:t}function Yl(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return P(e.first,0);var a=e.first+e.size-1;return t.line>a?P(a,ce(e,a).text.length):cg(t,ce(e,t.line).text.length)}function cg(e,t){var a=e.ch;return a==null||a>t?P(e.line,t):a<0?P(e.line,0):e}function Jl(e,t){for(var a=[],i=0;i<t.length;i++)a[i]=Ce(e,t[i]);return a}var oa=function(e,t){this.state=e,this.lookAhead=t},bn=function(e,t,a,i){this.state=t,this.doc=e,this.line=a,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};bn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},bn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},bn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},bn.fromSaved=function(e,t,a){return t instanceof oa?new bn(e,yn(e.mode,t.state),a,t.lookAhead):new bn(e,yn(e.mode,t),a)},bn.prototype.save=function(e){var t=e!==!1?yn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new oa(t,this.maxLookAhead):t};function Ql(e,t,a,i){var s=[e.state.modeGen],c={};iu(e,t.text,e.doc.mode,a,function(v,C){return s.push(v,C)},c,i);for(var d=a.state,h=function(v){a.baseTokens=s;var C=e.state.overlays[v],_=1,F=0;a.state=!0,iu(e,t.text,C.mode,a,function(O,B){for(var U=_;F<O;){var Y=s[_];Y>O&&s.splice(_,1,O,s[_+1],Y),_+=2,F=Math.min(O,Y)}if(B)if(C.opaque)s.splice(U,_-U,O,"overlay "+B),_=U+2;else for(;U<_;U+=2){var ee=s[U+1];s[U+1]=(ee?ee+" ":"")+"overlay "+B}},c),a.state=d,a.baseTokens=null,a.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)h(g);return{styles:s,classes:c.bgClass||c.textClass?c:null}}function Zl(e,t,a){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=di(e,b(t)),s=t.text.length>e.options.maxHighlightLength&&yn(e.doc.mode,i.state),c=Ql(e,t,i);s&&(i.state=s),t.stateAfter=i.save(!s),t.styles=c.styles,c.classes?t.styleClasses=c.classes:t.styleClasses&&(t.styleClasses=null),a===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function di(e,t,a){var i=e.doc,s=e.display;if(!i.mode.startState)return new bn(i,!0,t);var c=fg(e,t,a),d=c>i.first&&ce(i,c-1).stateAfter,h=d?bn.fromSaved(i,d,c):new bn(i,Er(i.mode),c);return i.iter(c,t,function(g){vs(e,g.text,h);var v=h.line;g.stateAfter=v==t-1||v%5==0||v>=s.viewFrom&&v<s.viewTo?h.save():null,h.nextLine()}),a&&(i.modeFrontier=h.line),h}function vs(e,t,a,i){var s=e.doc.mode,c=new nt(t,e.options.tabSize,a);for(c.start=c.pos=i||0,t==""&&eu(s,a.state);!c.eol();)ys(s,c,a.state),c.start=c.pos}function eu(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var a=ci(e,t);if(a.mode.blankLine)return a.mode.blankLine(a.state)}}function ys(e,t,a,i){for(var s=0;s<10;s++){i&&(i[0]=ci(e,a).mode);var c=e.token(t,a);if(t.pos>t.start)return c}throw new Error("Mode "+e.name+" failed to advance stream.")}var tu=function(e,t,a){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=a};function nu(e,t,a,i){var s=e.doc,c=s.mode,d;t=Ce(s,t);var h=ce(s,t.line),g=di(e,t.line,a),v=new nt(h.text,e.options.tabSize,g),C;for(i&&(C=[]);(i||v.pos<t.ch)&&!v.eol();)v.start=v.pos,d=ys(c,v,g.state),i&&C.push(new tu(v,d,yn(s.mode,g.state)));return i?C:new tu(v,d,g.state)}function ru(e,t){if(e)for(;;){var a=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;e=e.slice(0,a.index)+e.slice(a.index+a[0].length);var i=a[1]?"bgClass":"textClass";t[i]==null?t[i]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+a[2])}return e}function iu(e,t,a,i,s,c,d){var h=a.flattenSpans;h==null&&(h=e.options.flattenSpans);var g=0,v=null,C=new nt(t,e.options.tabSize,i),_,F=e.options.addModeClass&&[null];for(t==""&&ru(eu(a,i.state),c);!C.eol();){if(C.pos>e.options.maxHighlightLength?(h=!1,d&&vs(e,t,i,C.pos),C.pos=t.length,_=null):_=ru(ys(a,C,i.state,F),c),F){var O=F[0].name;O&&(_="m-"+(_?O+" "+_:O))}if(!h||v!=_){for(;g<C.start;)g=Math.min(C.start,g+5e3),s(g,v);v=_}C.start=C.pos}for(;g<C.pos;){var B=Math.min(C.pos,g+5e3);s(B,v),g=B}}function fg(e,t,a){for(var i,s,c=e.doc,d=a?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>d;--h){if(h<=c.first)return c.first;var g=ce(c,h-1),v=g.stateAfter;if(v&&(!a||h+(v instanceof oa?v.lookAhead:0)<=c.modeFrontier))return h;var C=Le(g.text,null,e.options.tabSize);(s==null||i>C)&&(s=h-1,i=C)}return s}function dg(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var a=e.first,i=t-1;i>a;i--){var s=ce(e,i).stateAfter;if(s&&(!(s instanceof oa)||i+s.lookAhead<t)){a=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,a)}}var au=!1,_n=!1;function hg(){au=!0}function pg(){_n=!0}function la(e,t,a){this.marker=e,this.from=t,this.to=a}function hi(e,t){if(e)for(var a=0;a<e.length;++a){var i=e[a];if(i.marker==t)return i}}function gg(e,t){for(var a,i=0;i<e.length;++i)e[i]!=t&&(a||(a=[])).push(e[i]);return a}function mg(e,t,a){var i=a&&window.WeakSet&&(a.markedSpans||(a.markedSpans=new WeakSet));i&&e.markedSpans&&i.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],i&&i.add(e.markedSpans)),t.marker.attachLine(e)}function vg(e,t,a){var i;if(e)for(var s=0;s<e.length;++s){var c=e[s],d=c.marker,h=c.from==null||(d.inclusiveLeft?c.from<=t:c.from<t);if(h||c.from==t&&d.type=="bookmark"&&(!a||!c.marker.insertLeft)){var g=c.to==null||(d.inclusiveRight?c.to>=t:c.to>t);(i||(i=[])).push(new la(d,c.from,g?null:c.to))}}return i}function yg(e,t,a){var i;if(e)for(var s=0;s<e.length;++s){var c=e[s],d=c.marker,h=c.to==null||(d.inclusiveRight?c.to>=t:c.to>t);if(h||c.from==t&&d.type=="bookmark"&&(!a||c.marker.insertLeft)){var g=c.from==null||(d.inclusiveLeft?c.from<=t:c.from<t);(i||(i=[])).push(new la(d,g?null:c.from-t,c.to==null?null:c.to-t))}}return i}function bs(e,t){if(t.full)return null;var a=q(e,t.from.line)&&ce(e,t.from.line).markedSpans,i=q(e,t.to.line)&&ce(e,t.to.line).markedSpans;if(!a&&!i)return null;var s=t.from.ch,c=t.to.ch,d=re(t.from,t.to)==0,h=vg(a,s,d),g=yg(i,c,d),v=t.text.length==1,C=be(t.text).length+(v?s:0);if(h)for(var _=0;_<h.length;++_){var F=h[_];if(F.to==null){var O=hi(g,F.marker);O?v&&(F.to=O.to==null?null:O.to+C):F.to=s}}if(g)for(var B=0;B<g.length;++B){var U=g[B];if(U.to!=null&&(U.to+=C),U.from==null){var Y=hi(h,U.marker);Y||(U.from=C,v&&(h||(h=[])).push(U))}else U.from+=C,v&&(h||(h=[])).push(U)}h&&(h=su(h)),g&&g!=h&&(g=su(g));var ee=[h];if(!v){var ae=t.text.length-2,te;if(ae>0&&h)for(var le=0;le<h.length;++le)h[le].to==null&&(te||(te=[])).push(new la(h[le].marker,null,null));for(var ve=0;ve<ae;++ve)ee.push(te);ee.push(g)}return ee}function su(e){for(var t=0;t<e.length;++t){var a=e[t];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function bg(e,t,a){var i=null;if(e.iter(t.line,a.line+1,function(O){if(O.markedSpans)for(var B=0;B<O.markedSpans.length;++B){var U=O.markedSpans[B].marker;U.readOnly&&(!i||we(i,U)==-1)&&(i||(i=[])).push(U)}}),!i)return null;for(var s=[{from:t,to:a}],c=0;c<i.length;++c)for(var d=i[c],h=d.find(0),g=0;g<s.length;++g){var v=s[g];if(!(re(v.to,h.from)<0||re(v.from,h.to)>0)){var C=[g,1],_=re(v.from,h.from),F=re(v.to,h.to);(_<0||!d.inclusiveLeft&&!_)&&C.push({from:v.from,to:h.from}),(F>0||!d.inclusiveRight&&!F)&&C.push({from:h.to,to:v.to}),s.splice.apply(s,C),g+=C.length-3}}return s}function ou(e){var t=e.markedSpans;if(t){for(var a=0;a<t.length;++a)t[a].marker.detachLine(e);e.markedSpans=null}}function lu(e,t){if(t){for(var a=0;a<t.length;++a)t[a].marker.attachLine(e);e.markedSpans=t}}function ua(e){return e.inclusiveLeft?-1:0}function ca(e){return e.inclusiveRight?1:0}function xs(e,t){var a=e.lines.length-t.lines.length;if(a!=0)return a;var i=e.find(),s=t.find(),c=re(i.from,s.from)||ua(e)-ua(t);if(c)return-c;var d=re(i.to,s.to)||ca(e)-ca(t);return d||t.id-e.id}function uu(e,t){var a=_n&&e.markedSpans,i;if(a)for(var s=void 0,c=0;c<a.length;++c)s=a[c],s.marker.collapsed&&(t?s.from:s.to)==null&&(!i||xs(i,s.marker)<0)&&(i=s.marker);return i}function cu(e){return uu(e,!0)}function fa(e){return uu(e,!1)}function xg(e,t){var a=_n&&e.markedSpans,i;if(a)for(var s=0;s<a.length;++s){var c=a[s];c.marker.collapsed&&(c.from==null||c.from<t)&&(c.to==null||c.to>t)&&(!i||xs(i,c.marker)<0)&&(i=c.marker)}return i}function fu(e,t,a,i,s){var c=ce(e,t),d=_n&&c.markedSpans;if(d)for(var h=0;h<d.length;++h){var g=d[h];if(g.marker.collapsed){var v=g.marker.find(0),C=re(v.from,a)||ua(g.marker)-ua(s),_=re(v.to,i)||ca(g.marker)-ca(s);if(!(C>=0&&_<=0||C<=0&&_>=0)&&(C<=0&&(g.marker.inclusiveRight&&s.inclusiveLeft?re(v.to,a)>=0:re(v.to,a)>0)||C>=0&&(g.marker.inclusiveRight&&s.inclusiveLeft?re(v.from,i)<=0:re(v.from,i)<0)))return!0}}}function fn(e){for(var t;t=cu(e);)e=t.find(-1,!0).line;return e}function wg(e){for(var t;t=fa(e);)e=t.find(1,!0).line;return e}function kg(e){for(var t,a;t=fa(e);)e=t.find(1,!0).line,(a||(a=[])).push(e);return a}function ws(e,t){var a=ce(e,t),i=fn(a);return a==i?t:b(i)}function du(e,t){if(t>e.lastLine())return t;var a=ce(e,t),i;if(!zn(e,a))return t;for(;i=fa(a);)a=i.find(1,!0).line;return b(a)+1}function zn(e,t){var a=_n&&t.markedSpans;if(a){for(var i=void 0,s=0;s<a.length;++s)if(i=a[s],!!i.marker.collapsed){if(i.from==null)return!0;if(!i.marker.widgetNode&&i.from==0&&i.marker.inclusiveLeft&&ks(e,t,i))return!0}}}function ks(e,t,a){if(a.to==null){var i=a.marker.find(1,!0);return ks(e,i.line,hi(i.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==t.text.length)return!0;for(var s=void 0,c=0;c<t.markedSpans.length;++c)if(s=t.markedSpans[c],s.marker.collapsed&&!s.marker.widgetNode&&s.from==a.to&&(s.to==null||s.to!=a.from)&&(s.marker.inclusiveLeft||a.marker.inclusiveRight)&&ks(e,t,s))return!0}function Ln(e){e=fn(e);for(var t=0,a=e.parent,i=0;i<a.lines.length;++i){var s=a.lines[i];if(s==e)break;t+=s.height}for(var c=a.parent;c;a=c,c=a.parent)for(var d=0;d<c.children.length;++d){var h=c.children[d];if(h==a)break;t+=h.height}return t}function da(e){if(e.height==0)return 0;for(var t=e.text.length,a,i=e;a=cu(i);){var s=a.find(0,!0);i=s.from.line,t+=s.from.ch-s.to.ch}for(i=e;a=fa(i);){var c=a.find(0,!0);t-=i.text.length-c.from.ch,i=c.to.line,t+=i.text.length-c.to.ch}return t}function Ss(e){var t=e.display,a=e.doc;t.maxLine=ce(a,a.first),t.maxLineLength=da(t.maxLine),t.maxLineChanged=!0,a.iter(function(i){var s=da(i);s>t.maxLineLength&&(t.maxLineLength=s,t.maxLine=i)})}var Ar=function(e,t,a){this.text=e,lu(this,t),this.height=a?a(this):1};Ar.prototype.lineNo=function(){return b(this)},sn(Ar);function Sg(e,t,a,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ou(e),lu(e,a);var s=i?i(e):1;s!=e.height&&Xt(e,s)}function Cg(e){e.parent=null,ou(e)}var Tg={},_g={};function hu(e,t){if(!e||/^\s*$/.test(e))return null;var a=t.addModeClass?_g:Tg;return a[e]||(a[e]=e.replace(/\S+/g,"cm-$&"))}function pu(e,t){var a=J("span",null,null,S?"padding-right: .1px":null),i={pre:J("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var c=s?t.rest[s-1]:t.line,d=void 0;i.pos=0,i.addToken=Eg,Mn(e.display.measure)&&(d=$e(c,e.doc.direction))&&(i.addToken=Ag(i.addToken,d)),i.map=[];var h=t!=e.display.externalMeasured&&b(c);Dg(c,i,Zl(e,c,h)),c.styleClasses&&(c.styleClasses.bgClass&&(i.bgClass=he(c.styleClasses.bgClass,i.bgClass||"")),c.styleClasses.textClass&&(i.textClass=he(c.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(aa(e.display.measure))),s==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(S){var g=i.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return et(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=he(i.pre.className,i.textClass||"")),i}function Lg(e){var t=w("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Eg(e,t,a,i,s,c,d){if(t){var h=e.splitSpaces?Ig(t,e.trailingSpace):t,g=e.cm.state.specialChars,v=!1,C;if(!g.test(t))e.col+=t.length,C=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,C),m&&k<9&&(v=!0),e.pos+=t.length;else{C=document.createDocumentFragment();for(var _=0;;){g.lastIndex=_;var F=g.exec(t),O=F?F.index-_:t.length-_;if(O){var B=document.createTextNode(h.slice(_,_+O));m&&k<9?C.appendChild(w("span",[B])):C.appendChild(B),e.map.push(e.pos,e.pos+O,B),e.col+=O,e.pos+=O}if(!F)break;_+=O+1;var U=void 0;if(F[0]==" "){var Y=e.cm.options.tabSize,ee=Y-e.col%Y;U=C.appendChild(w("span",Kt(ee),"cm-tab")),U.setAttribute("role","presentation"),U.setAttribute("cm-text"," "),e.col+=ee}else F[0]=="\r"||F[0]==`
|
|
5
|
+
`?(U=C.appendChild(w("span",F[0]=="\r"?"␍":"","cm-invalidchar")),U.setAttribute("cm-text",F[0]),e.col+=1):(U=e.cm.options.specialCharPlaceholder(F[0]),U.setAttribute("cm-text",F[0]),m&&k<9?C.appendChild(w("span",[U])):C.appendChild(U),e.col+=1);e.map.push(e.pos,e.pos+1,U),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,a||i||s||v||c||d){var ae=a||"";i&&(ae+=i),s&&(ae+=s);var te=w("span",[C],ae,c);if(d)for(var le in d)d.hasOwnProperty(le)&&le!="style"&&le!="class"&&te.setAttribute(le,d[le]);return e.content.appendChild(te)}e.content.appendChild(C)}}function Ig(e,t){if(e.length>1&&!/ /.test(e))return e;for(var a=t,i="",s=0;s<e.length;s++){var c=e.charAt(s);c==" "&&a&&(s==e.length-1||e.charCodeAt(s+1)==32)&&(c=" "),i+=c,a=c==" "}return i}function Ag(e,t){return function(a,i,s,c,d,h,g){s=s?s+" cm-force-border":"cm-force-border";for(var v=a.pos,C=v+i.length;;){for(var _=void 0,F=0;F<t.length&&(_=t[F],!(_.to>v&&_.from<=v));F++);if(_.to>=C)return e(a,i,s,c,d,h,g);e(a,i.slice(0,_.to-v),s,c,null,h,g),c=null,i=i.slice(_.to-v),v=_.to}}}function gu(e,t,a,i){var s=!i&&a.widgetNode;s&&e.map.push(e.pos,e.pos+t,s),!i&&e.cm.display.input.needsContentAttribute&&(s||(s=e.content.appendChild(document.createElement("span"))),s.setAttribute("cm-marker",a.id)),s&&(e.cm.display.input.setUneditable(s),e.content.appendChild(s)),e.pos+=t,e.trailingSpace=!1}function Dg(e,t,a){var i=e.markedSpans,s=e.text,c=0;if(!i){for(var d=1;d<a.length;d+=2)t.addToken(t,s.slice(c,c=a[d]),hu(a[d+1],t.cm.options));return}for(var h=s.length,g=0,v=1,C="",_,F,O=0,B,U,Y,ee,ae;;){if(O==g){B=U=Y=F="",ae=null,ee=null,O=1/0;for(var te=[],le=void 0,ve=0;ve<i.length;++ve){var ge=i[ve],Ae=ge.marker;if(Ae.type=="bookmark"&&ge.from==g&&Ae.widgetNode)te.push(Ae);else if(ge.from<=g&&(ge.to==null||ge.to>g||Ae.collapsed&&ge.to==g&&ge.from==g)){if(ge.to!=null&&ge.to!=g&&O>ge.to&&(O=ge.to,U=""),Ae.className&&(B+=" "+Ae.className),Ae.css&&(F=(F?F+";":"")+Ae.css),Ae.startStyle&&ge.from==g&&(Y+=" "+Ae.startStyle),Ae.endStyle&&ge.to==O&&(le||(le=[])).push(Ae.endStyle,ge.to),Ae.title&&((ae||(ae={})).title=Ae.title),Ae.attributes)for(var qe in Ae.attributes)(ae||(ae={}))[qe]=Ae.attributes[qe];Ae.collapsed&&(!ee||xs(ee.marker,Ae)<0)&&(ee=ge)}else ge.from>g&&O>ge.from&&(O=ge.from)}if(le)for(var xt=0;xt<le.length;xt+=2)le[xt+1]==O&&(U+=" "+le[xt]);if(!ee||ee.from==g)for(var Qe=0;Qe<te.length;++Qe)gu(t,0,te[Qe]);if(ee&&(ee.from||0)==g){if(gu(t,(ee.to==null?h+1:ee.to)-g,ee.marker,ee.from==null),ee.to==null)return;ee.to==g&&(ee=!1)}}if(g>=h)break;for(var Wt=Math.min(h,O);;){if(C){var Rt=g+C.length;if(!ee){var lt=Rt>Wt?C.slice(0,Wt-g):C;t.addToken(t,lt,_?_+B:B,Y,g+lt.length==O?U:"",F,ae)}if(Rt>=Wt){C=C.slice(Wt-g),g=Wt;break}g=Rt,Y=""}C=s.slice(c,c=a[v++]),_=hu(a[v++],t.cm.options)}}}function mu(e,t,a){this.line=t,this.rest=kg(t),this.size=this.rest?b(be(this.rest))-a+1:1,this.node=this.text=null,this.hidden=zn(e,t)}function ha(e,t,a){for(var i=[],s,c=t;c<a;c=s){var d=new mu(e.doc,ce(e.doc,c),c);s=c+d.size,i.push(d)}return i}var Dr=null;function Og(e){Dr?Dr.ops.push(e):e.ownsGroup=Dr={ops:[e],delayedCallbacks:[]}}function Ng(e){var t=e.delayedCallbacks,a=0;do{for(;a<t.length;a++)t[a].call(null);for(var i=0;i<e.ops.length;i++){var s=e.ops[i];if(s.cursorActivityHandlers)for(;s.cursorActivityCalled<s.cursorActivityHandlers.length;)s.cursorActivityHandlers[s.cursorActivityCalled++].call(null,s.cm)}}while(a<t.length)}function Fg(e,t){var a=e.ownsGroup;if(a)try{Ng(a)}finally{Dr=null,t(a)}}var pi=null;function vt(e,t){var a=Cn(e,t);if(a.length){var i=Array.prototype.slice.call(arguments,2),s;Dr?s=Dr.delayedCallbacks:pi?s=pi:(s=pi=[],setTimeout(Rg,0));for(var c=function(h){s.push(function(){return a[h].apply(null,i)})},d=0;d<a.length;++d)c(d)}}function Rg(){var e=pi;pi=null;for(var t=0;t<e.length;++t)e[t]()}function vu(e,t,a,i){for(var s=0;s<t.changes.length;s++){var c=t.changes[s];c=="text"?$g(e,t):c=="gutter"?bu(e,t,a,i):c=="class"?Cs(e,t):c=="widget"&&Pg(e,t,i)}t.changes=null}function gi(e){return e.node==e.text&&(e.node=w("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),m&&k<8&&(e.node.style.zIndex=2)),e.node}function Mg(e,t){var a=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),t.background)a?t.background.className=a:(t.background.parentNode.removeChild(t.background),t.background=null);else if(a){var i=gi(t);t.background=i.insertBefore(w("div",null,a),i.firstChild),e.display.input.setUneditable(t.background)}}function yu(e,t){var a=e.display.externalMeasured;return a&&a.line==t.line?(e.display.externalMeasured=null,t.measure=a.measure,a.built):pu(e,t)}function $g(e,t){var a=t.text.className,i=yu(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,Cs(e,t)):a&&(t.text.className=a)}function Cs(e,t){Mg(e,t),t.line.wrapClass?gi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var a=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=a||""}function bu(e,t,a,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var s=gi(t);t.gutterBackground=w("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),s.insertBefore(t.gutterBackground,t.text)}var c=t.line.gutterMarkers;if(e.options.lineNumbers||c){var d=gi(t),h=t.gutter=w("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),d.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!c||!c["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(w("div",X(e.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),c)for(var g=0;g<e.display.gutterSpecs.length;++g){var v=e.display.gutterSpecs[g].className,C=c.hasOwnProperty(v)&&c[v];C&&h.appendChild(w("div",[C],"CodeMirror-gutter-elt","left: "+i.gutterLeft[v]+"px; width: "+i.gutterWidth[v]+"px"))}}}function Pg(e,t,a){t.alignable&&(t.alignable=null);for(var i=ie("CodeMirror-linewidget"),s=t.node.firstChild,c=void 0;s;s=c)c=s.nextSibling,i.test(s.className)&&t.node.removeChild(s);xu(e,t,a)}function zg(e,t,a,i){var s=yu(e,t);return t.text=t.node=s.pre,s.bgClass&&(t.bgClass=s.bgClass),s.textClass&&(t.textClass=s.textClass),Cs(e,t),bu(e,t,a,i),xu(e,t,i),t.node}function xu(e,t,a){if(wu(e,t.line,t,a,!0),t.rest)for(var i=0;i<t.rest.length;i++)wu(e,t.rest[i],t,a,!1)}function wu(e,t,a,i,s){if(t.widgets)for(var c=gi(a),d=0,h=t.widgets;d<h.length;++d){var g=h[d],v=w("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),Bg(g,v,a,i),e.display.input.setUneditable(v),s&&g.above?c.insertBefore(v,a.gutter||a.text):c.appendChild(v),vt(g,"redraw")}}function Bg(e,t,a,i){if(e.noHScroll){(a.alignable||(a.alignable=[])).push(t);var s=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(s-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=s+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function mi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var a="position: relative;";e.coverGutter&&(a+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(a+="width: "+t.display.wrapper.clientWidth+"px;"),Q(t.display.measure,w("div",[e.node],null,a))}return e.height=e.node.parentNode.offsetHeight}function En(e,t){for(var a=li(t);a!=e.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==e.sizer&&a!=e.mover)return!0}function pa(e){return e.lineSpace.offsetTop}function Ts(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ku(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Q(e.measure,w("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function xn(e){return Fe-e.display.nativeBarWidth}function nr(e){return e.display.scroller.clientWidth-xn(e)-e.display.barWidth}function _s(e){return e.display.scroller.clientHeight-xn(e)-e.display.barHeight}function Hg(e,t,a){var i=e.options.lineWrapping,s=i&&nr(e);if(!t.measure.heights||i&&t.measure.width!=s){var c=t.measure.heights=[];if(i){t.measure.width=s;for(var d=t.text.firstChild.getClientRects(),h=0;h<d.length-1;h++){var g=d[h],v=d[h+1];Math.abs(g.bottom-v.bottom)>2&&c.push((g.bottom+v.top)/2-a.top)}}c.push(a.bottom-a.top)}}function Su(e,t,a){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var s=0;s<e.rest.length;s++)if(b(e.rest[s])>a)return{map:e.measure.maps[s],cache:e.measure.caches[s],before:!0}}}function Wg(e,t){t=fn(t);var a=b(t),i=e.display.externalMeasured=new mu(e.doc,t,a);i.lineN=a;var s=i.built=pu(e,i);return i.text=s.pre,Q(e.display.lineMeasure,s.pre),i}function Cu(e,t,a,i){return wn(e,Or(e,t),a,i)}function Ls(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ar(e,t)];var a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size)return a}function Or(e,t){var a=b(t),i=Ls(e,a);i&&!i.text?i=null:i&&i.changes&&(vu(e,i,a,Os(e)),e.curOp.forceUpdate=!0),i||(i=Wg(e,t));var s=Su(i,t,a);return{line:t,view:i,rect:null,map:s.map,cache:s.cache,before:s.before,hasHeights:!1}}function wn(e,t,a,i,s){t.before&&(a=-1);var c=a+(i||""),d;return t.cache.hasOwnProperty(c)?d=t.cache[c]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Hg(e,t.view,t.rect),t.hasHeights=!0),d=qg(e,t,a,i),d.bogus||(t.cache[c]=d)),{left:d.left,right:d.right,top:s?d.rtop:d.top,bottom:s?d.rbottom:d.bottom}}var Tu={left:0,right:0,top:0,bottom:0};function _u(e,t,a){for(var i,s,c,d,h,g,v=0;v<e.length;v+=3)if(h=e[v],g=e[v+1],t<h?(s=0,c=1,d="left"):t<g?(s=t-h,c=s+1):(v==e.length-3||t==g&&e[v+3]>t)&&(c=g-h,s=c-1,t>=g&&(d="right")),s!=null){if(i=e[v+2],h==g&&a==(i.insertLeft?"left":"right")&&(d=a),a=="left"&&s==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)i=e[(v-=3)+2],d="left";if(a=="right"&&s==g-h)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)i=e[(v+=3)+2],d="right";break}return{node:i,start:s,end:c,collapse:d,coverStart:h,coverEnd:g}}function jg(e,t){var a=Tu;if(t=="left")for(var i=0;i<e.length&&(a=e[i]).left==a.right;i++);else for(var s=e.length-1;s>=0&&(a=e[s]).left==a.right;s--);return a}function qg(e,t,a,i){var s=_u(t.map,a,i),c=s.node,d=s.start,h=s.end,g=s.collapse,v;if(c.nodeType==3){for(var C=0;C<4;C++){for(;d&&Ie(t.line.text.charAt(s.coverStart+d));)--d;for(;s.coverStart+h<s.coverEnd&&Ie(t.line.text.charAt(s.coverStart+h));)++h;if(m&&k<9&&d==0&&h==s.coverEnd-s.coverStart?v=c.parentNode.getBoundingClientRect():v=jg(G(c,d,h).getClientRects(),i),v.left||v.right||d==0)break;h=d,d=d-1,g="right"}m&&k<11&&(v=Ug(e.display.measure,v))}else{d>0&&(g=i="right");var _;e.options.lineWrapping&&(_=c.getClientRects()).length>1?v=_[i=="right"?_.length-1:0]:v=c.getBoundingClientRect()}if(m&&k<9&&!d&&(!v||!v.left&&!v.right)){var F=c.parentNode.getClientRects()[0];F?v={left:F.left,right:F.left+Fr(e.display),top:F.top,bottom:F.bottom}:v=Tu}for(var O=v.top-t.rect.top,B=v.bottom-t.rect.top,U=(O+B)/2,Y=t.view.measure.heights,ee=0;ee<Y.length-1&&!(U<Y[ee]);ee++);var ae=ee?Y[ee-1]:0,te=Y[ee],le={left:(g=="right"?v.right:v.left)-t.rect.left,right:(g=="left"?v.left:v.right)-t.rect.left,top:ae,bottom:te};return!v.left&&!v.right&&(le.bogus=!0),e.options.singleCursorHeightPerLine||(le.rtop=O,le.rbottom=B),le}function Ug(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ms(e))return t;var a=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*a,right:t.right*a,top:t.top*i,bottom:t.bottom*i}}function Lu(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Eu(e){e.display.externalMeasure=null,j(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Lu(e.display.view[t])}function vi(e){Eu(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Iu(e){return L&&H?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Au(e){return L&&H?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Es(e){var t=fn(e),a=t.widgets,i=0;if(a)for(var s=0;s<a.length;++s)a[s].above&&(i+=mi(a[s]));return i}function ga(e,t,a,i,s){if(!s){var c=Es(t);a.top+=c,a.bottom+=c}if(i=="line")return a;i||(i="local");var d=Ln(t);if(i=="local"?d+=pa(e.display):d-=e.display.viewOffset,i=="page"||i=="window"){var h=e.display.lineSpace.getBoundingClientRect();d+=h.top+(i=="window"?0:Au(x(e)));var g=h.left+(i=="window"?0:Iu(x(e)));a.left+=g,a.right+=g}return a.top+=d,a.bottom+=d,a}function Du(e,t,a){if(a=="div")return t;var i=t.left,s=t.top;if(a=="page")i-=Iu(x(e)),s-=Au(x(e));else if(a=="local"||!a){var c=e.display.sizer.getBoundingClientRect();i+=c.left,s+=c.top}var d=e.display.lineSpace.getBoundingClientRect();return{left:i-d.left,top:s-d.top}}function ma(e,t,a,i,s){return i||(i=ce(e.doc,t.line)),ga(e,i,Cu(e,i,t.ch,s),a)}function dn(e,t,a,i,s,c){i=i||ce(e.doc,t.line),s||(s=Or(e,i));function d(B,U){var Y=wn(e,s,B,U?"right":"left",c);return U?Y.left=Y.right:Y.right=Y.left,ga(e,i,Y,a)}var h=$e(i,e.doc.direction),g=t.ch,v=t.sticky;if(g>=i.text.length?(g=i.text.length,v="before"):g<=0&&(g=0,v="after"),!h)return d(v=="before"?g-1:g,v=="before");function C(B,U,Y){var ee=h[U],ae=ee.level==1;return d(Y?B-1:B,ae!=Y)}var _=Fn(h,g,v),F=er,O=C(g,_,v=="before");return F!=null&&(O.other=C(g,F,v!="before")),O}function Ou(e,t){var a=0;t=Ce(e.doc,t),e.options.lineWrapping||(a=Fr(e.display)*t.ch);var i=ce(e.doc,t.line),s=Ln(i)+pa(e.display);return{left:a,right:a,top:s,bottom:s+i.height}}function Is(e,t,a,i,s){var c=P(e,t,a);return c.xRel=s,i&&(c.outside=i),c}function As(e,t,a){var i=e.doc;if(a+=e.display.viewOffset,a<0)return Is(i.first,0,null,-1,-1);var s=T(i,a),c=i.first+i.size-1;if(s>c)return Is(i.first+i.size-1,ce(i,c).text.length,null,1,1);t<0&&(t=0);for(var d=ce(i,s);;){var h=Gg(e,d,s,t,a),g=xg(d,h.ch+(h.xRel>0||h.outside>0?1:0));if(!g)return h;var v=g.find(1);if(v.line==s)return v;d=ce(i,s=v.line)}}function Nu(e,t,a,i){i-=Es(t);var s=t.text.length,c=en(function(d){return wn(e,a,d-1).bottom<=i},s,0);return s=en(function(d){return wn(e,a,d).top>i},c,s),{begin:c,end:s}}function Fu(e,t,a,i){a||(a=Or(e,t));var s=ga(e,t,wn(e,a,i),"line").top;return Nu(e,t,a,s)}function Ds(e,t,a,i){return e.bottom<=a?!1:e.top>a?!0:(i?e.left:e.right)>t}function Gg(e,t,a,i,s){s-=Ln(t);var c=Or(e,t),d=Es(t),h=0,g=t.text.length,v=!0,C=$e(t,e.doc.direction);if(C){var _=(e.options.lineWrapping?Vg:Kg)(e,t,a,c,C,i,s);v=_.level!=1,h=v?_.from:_.to-1,g=v?_.to:_.from-1}var F=null,O=null,B=en(function(ve){var ge=wn(e,c,ve);return ge.top+=d,ge.bottom+=d,Ds(ge,i,s,!1)?(ge.top<=s&&ge.left<=i&&(F=ve,O=ge),!0):!1},h,g),U,Y,ee=!1;if(O){var ae=i-O.left<O.right-i,te=ae==v;B=F+(te?0:1),Y=te?"after":"before",U=ae?O.left:O.right}else{!v&&(B==g||B==h)&&B++,Y=B==0?"after":B==t.text.length?"before":wn(e,c,B-(v?1:0)).bottom+d<=s==v?"after":"before";var le=dn(e,P(a,B,Y),"line",t,c);U=le.left,ee=s<le.top?-1:s>=le.bottom?1:0}return B=zt(t.text,B,1),Is(a,B,Y,ee,i-U)}function Kg(e,t,a,i,s,c,d){var h=en(function(_){var F=s[_],O=F.level!=1;return Ds(dn(e,P(a,O?F.to:F.from,O?"before":"after"),"line",t,i),c,d,!0)},0,s.length-1),g=s[h];if(h>0){var v=g.level!=1,C=dn(e,P(a,v?g.from:g.to,v?"after":"before"),"line",t,i);Ds(C,c,d,!0)&&C.top>d&&(g=s[h-1])}return g}function Vg(e,t,a,i,s,c,d){var h=Nu(e,t,i,d),g=h.begin,v=h.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var C=null,_=null,F=0;F<s.length;F++){var O=s[F];if(!(O.from>=v||O.to<=g)){var B=O.level!=1,U=wn(e,i,B?Math.min(v,O.to)-1:Math.max(g,O.from)).right,Y=U<c?c-U+1e9:U-c;(!C||_>Y)&&(C=O,_=Y)}}return C||(C=s[s.length-1]),C.from<g&&(C={from:g,to:C.to,level:C.level}),C.to>v&&(C={from:C.from,to:v,level:C.level}),C}var rr;function Nr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(rr==null){rr=w("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(w("br"));rr.appendChild(document.createTextNode("x"))}Q(e.measure,rr);var a=rr.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),j(e.measure),a||1}function Fr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=w("span","xxxxxxxxxx"),a=w("pre",[t],"CodeMirror-line-like");Q(e.measure,a);var i=t.getBoundingClientRect(),s=(i.right-i.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function Os(e){for(var t=e.display,a={},i={},s=t.gutters.clientLeft,c=t.gutters.firstChild,d=0;c;c=c.nextSibling,++d){var h=e.display.gutterSpecs[d].className;a[h]=c.offsetLeft+c.clientLeft+s,i[h]=c.clientWidth}return{fixedPos:Ns(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ns(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ru(e){var t=Nr(e.display),a=e.options.lineWrapping,i=a&&Math.max(5,e.display.scroller.clientWidth/Fr(e.display)-3);return function(s){if(zn(e.doc,s))return 0;var c=0;if(s.widgets)for(var d=0;d<s.widgets.length;d++)s.widgets[d].height&&(c+=s.widgets[d].height);return a?c+(Math.ceil(s.text.length/i)||1)*t:c+t}}function Fs(e){var t=e.doc,a=Ru(e);t.iter(function(i){var s=a(i);s!=i.height&&Xt(i,s)})}function ir(e,t,a,i){var s=e.display;if(!a&&li(t).getAttribute("cm-not-content")=="true")return null;var c,d,h=s.lineSpace.getBoundingClientRect();try{c=t.clientX-h.left,d=t.clientY-h.top}catch{return null}var g=As(e,c,d),v;if(i&&g.xRel>0&&(v=ce(e.doc,g.line).text).length==g.ch){var C=Le(v,v.length,e.options.tabSize)-v.length;g=P(g.line,Math.max(0,Math.round((c-ku(e.display).left)/Fr(e.display))-C))}return g}function ar(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var a=e.display.view,i=0;i<a.length;i++)if(t-=a[i].size,t<0)return i}function Nt(e,t,a,i){t==null&&(t=e.doc.first),a==null&&(a=e.doc.first+e.doc.size),i||(i=0);var s=e.display;if(i&&a<s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>t)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo)_n&&ws(e.doc,t)<s.viewTo&&Hn(e);else if(a<=s.viewFrom)_n&&du(e.doc,a+i)>s.viewFrom?Hn(e):(s.viewFrom+=i,s.viewTo+=i);else if(t<=s.viewFrom&&a>=s.viewTo)Hn(e);else if(t<=s.viewFrom){var c=va(e,a,a+i,1);c?(s.view=s.view.slice(c.index),s.viewFrom=c.lineN,s.viewTo+=i):Hn(e)}else if(a>=s.viewTo){var d=va(e,t,t,-1);d?(s.view=s.view.slice(0,d.index),s.viewTo=d.lineN):Hn(e)}else{var h=va(e,t,t,-1),g=va(e,a,a+i,1);h&&g?(s.view=s.view.slice(0,h.index).concat(ha(e,h.lineN,g.lineN)).concat(s.view.slice(g.index)),s.viewTo+=i):Hn(e)}var v=s.externalMeasured;v&&(a<v.lineN?v.lineN+=i:t<v.lineN+v.size&&(s.externalMeasured=null))}function Bn(e,t,a){e.curOp.viewChanged=!0;var i=e.display,s=e.display.externalMeasured;if(s&&t>=s.lineN&&t<s.lineN+s.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var c=i.view[ar(e,t)];if(c.node!=null){var d=c.changes||(c.changes=[]);we(d,a)==-1&&d.push(a)}}}function Hn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function va(e,t,a,i){var s=ar(e,t),c,d=e.display.view;if(!_n||a==e.doc.first+e.doc.size)return{index:s,lineN:a};for(var h=e.display.viewFrom,g=0;g<s;g++)h+=d[g].size;if(h!=t){if(i>0){if(s==d.length-1)return null;c=h+d[s].size-t,s++}else c=h-t;t+=c,a+=c}for(;ws(e.doc,a)!=a;){if(s==(i<0?0:d.length-1))return null;a+=i*d[s-(i<0?1:0)].size,s+=i}return{index:s,lineN:a}}function Xg(e,t,a){var i=e.display,s=i.view;s.length==0||t>=i.viewTo||a<=i.viewFrom?(i.view=ha(e,t,a),i.viewFrom=t):(i.viewFrom>t?i.view=ha(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ar(e,t))),i.viewFrom=t,i.viewTo<a?i.view=i.view.concat(ha(e,i.viewTo,a)):i.viewTo>a&&(i.view=i.view.slice(0,ar(e,a)))),i.viewTo=a}function Mu(e){for(var t=e.display.view,a=0,i=0;i<t.length;i++){var s=t[i];!s.hidden&&(!s.node||s.changes)&&++a}return a}function yi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function $u(e,t){t===void 0&&(t=!0);var a=e.doc,i={},s=i.cursors=document.createDocumentFragment(),c=i.selection=document.createDocumentFragment(),d=e.options.$customCursor;d&&(t=!0);for(var h=0;h<a.sel.ranges.length;h++)if(!(!t&&h==a.sel.primIndex)){var g=a.sel.ranges[h];if(!(g.from().line>=e.display.viewTo||g.to().line<e.display.viewFrom)){var v=g.empty();if(d){var C=d(e,g);C&&Rs(e,C,s)}else(v||e.options.showCursorWhenSelecting)&&Rs(e,g.head,s);v||Yg(e,g,c)}}return i}function Rs(e,t,a){var i=dn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),s=a.appendChild(w("div"," ","CodeMirror-cursor"));if(s.style.left=i.left+"px",s.style.top=i.top+"px",s.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var c=ma(e,t,"div",null,null),d=c.right-c.left;s.style.width=(d>0?d:e.defaultCharWidth())+"px"}if(i.other){var h=a.appendChild(w("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=i.other.left+"px",h.style.top=i.other.top+"px",h.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function ya(e,t){return e.top-t.top||e.left-t.left}function Yg(e,t,a){var i=e.display,s=e.doc,c=document.createDocumentFragment(),d=ku(e.display),h=d.left,g=Math.max(i.sizerWidth,nr(e)-i.sizer.offsetLeft)-d.right,v=s.direction=="ltr";function C(te,le,ve,ge){le<0&&(le=0),le=Math.round(le),ge=Math.round(ge),c.appendChild(w("div",null,"CodeMirror-selected","position: absolute; left: "+te+`px;
|
|
6
6
|
top: `+le+"px; width: "+(ve??g-te)+`px;
|
|
7
|
-
height: `+(ge-le)+"px"))}function _(te,le,ve){var ge=ce(s,te),Ae=ge.text.length,
|
|
7
|
+
height: `+(ge-le)+"px"))}function _(te,le,ve){var ge=ce(s,te),Ae=ge.text.length,qe,xt;function Qe(lt,Mt){return ma(e,P(te,lt),"div",ge,Mt)}function Wt(lt,Mt,Ct){var pt=Fu(e,ge,null,lt),ut=Mt=="ltr"==(Ct=="after")?"left":"right",rt=Ct=="after"?pt.begin:pt.end-(/\s/.test(ge.text.charAt(pt.end-1))?2:1);return Qe(rt,ut)[ut]}var Rt=$e(ge,s.direction);return Nn(Rt,le||0,ve??Ae,function(lt,Mt,Ct,pt){var ut=Ct=="ltr",rt=Qe(lt,ut?"left":"right"),$t=Qe(Mt-1,ut?"right":"left"),Kr=le==null&<==0,Kn=ve==null&&Mt==Ae,Et=pt==0,kn=!Rt||pt==Rt.length-1;if($t.top-rt.top<=3){var wt=(v?Kr:Kn)&&Et,lo=(v?Kn:Kr)&&kn,Dn=wt?h:(ut?rt:$t).left,cr=lo?g:(ut?$t:rt).right;C(Dn,rt.top,cr-Dn,rt.bottom)}else{var fr,At,Vr,uo;ut?(fr=v&&Kr&&Et?h:rt.left,At=v?g:Wt(lt,Ct,"before"),Vr=v?h:Wt(Mt,Ct,"after"),uo=v&&Kn&&kn?g:$t.right):(fr=v?Wt(lt,Ct,"before"):h,At=!v&&Kr&&Et?g:rt.right,Vr=!v&&Kn&&kn?h:$t.left,uo=v?Wt(Mt,Ct,"after"):g),C(fr,rt.top,At-fr,rt.bottom),rt.bottom<$t.top&&C(h,rt.bottom,null,$t.top),C(Vr,$t.top,uo-Vr,$t.bottom)}(!qe||ya(rt,qe)<0)&&(qe=rt),ya($t,qe)<0&&(qe=$t),(!xt||ya(rt,xt)<0)&&(xt=rt),ya($t,xt)<0&&(xt=$t)}),{start:qe,end:xt}}var F=t.from(),O=t.to();if(F.line==O.line)_(F.line,F.ch,O.ch);else{var B=ce(s,F.line),U=ce(s,O.line),Y=fn(B)==fn(U),ee=_(F.line,F.ch,Y?B.text.length+1:null).end,ae=_(O.line,Y?0:null,O.ch).start;Y&&(ee.top<ae.top-2?(C(ee.right,ee.top,null,ee.bottom),C(h,ae.top,ae.left,ae.bottom)):C(ee.right,ee.top,ae.left-ee.right,ee.bottom)),ee.bottom<ae.top&&C(h,ee.bottom,null,ae.top)}a.appendChild(c)}function Ms(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var a=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Rr(e),t.cursorDiv.style.visibility=(a=!a)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Pu(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ps(e))}function $s(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Rr(e))},100)}function Ps(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(et(e,"focus",e,t),e.state.focused=!0,K(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),S&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ms(e))}function Rr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(et(e,"blur",e,t),e.state.focused=!1,Pe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ba(e){for(var t=e.display,a=t.lineDiv.offsetTop,i=Math.max(0,t.scroller.getBoundingClientRect().top),s=t.lineDiv.getBoundingClientRect().top,c=0,d=0;d<t.view.length;d++){var h=t.view[d],g=e.options.lineWrapping,v=void 0,C=0;if(!h.hidden){if(s+=h.line.height,m&&k<8){var _=h.node.offsetTop+h.node.offsetHeight;v=_-a,a=_}else{var F=h.node.getBoundingClientRect();v=F.bottom-F.top,!g&&h.text.firstChild&&(C=h.text.firstChild.getBoundingClientRect().right-F.left-1)}var O=h.line.height-v;if((O>.005||O<-.005)&&(s<i&&(c-=O),Xt(h.line,v),zu(h.line),h.rest))for(var B=0;B<h.rest.length;B++)zu(h.rest[B]);if(C>e.display.sizerWidth){var U=Math.ceil(C/Fr(e.display));U>e.display.maxLineLength&&(e.display.maxLineLength=U,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(c)>2&&(t.scroller.scrollTop+=c)}function zu(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],i=a.node.parentNode;i&&(a.height=i.offsetHeight)}}function xa(e,t,a){var i=a&&a.top!=null?Math.max(0,a.top):e.scroller.scrollTop;i=Math.floor(i-pa(e));var s=a&&a.bottom!=null?a.bottom:i+e.wrapper.clientHeight,c=T(t,i),d=T(t,s);if(a&&a.ensure){var h=a.ensure.from.line,g=a.ensure.to.line;h<c?(c=h,d=T(t,Ln(ce(t,h))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=d&&(c=T(t,Ln(ce(t,g))-e.wrapper.clientHeight),d=g)}return{from:c,to:Math.max(d,c+1)}}function Jg(e,t){if(!tt(e,"scrollCursorIntoView")){var a=e.display,i=a.sizer.getBoundingClientRect(),s=null,c=a.wrapper.ownerDocument;if(t.top+i.top<0?s=!0:t.bottom+i.top>(c.defaultView.innerHeight||c.documentElement.clientHeight)&&(s=!1),s!=null&&!I){var d=w("div","",null,`position: absolute;
|
|
8
8
|
top: `+(t.top-a.viewOffset-pa(e.display))+`px;
|
|
9
9
|
height: `+(t.bottom-t.top+xn(e)+a.barHeight)+`px;
|
|
10
|
-
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(d),d.scrollIntoView(s),e.display.lineSpace.removeChild(d)}}}function Qg(e,t,a,i){i==null&&(i=0);var s;!e.options.lineWrapping&&t==a&&(a=t.sticky=="before"?P(t.line,t.ch+1,"before"):t,t=t.ch?P(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var c=0;c<5;c++){var d=!1,h=dn(e,t),g=!a||a==t?h:dn(e,a);s={left:Math.min(h.left,g.left),top:Math.min(h.top,g.top)-i,right:Math.max(h.left,g.left),bottom:Math.max(h.bottom,g.bottom)+i};var v=zs(e,s),C=e.doc.scrollTop,_=e.doc.scrollLeft;if(v.scrollTop!=null&&(xi(e,v.scrollTop),Math.abs(e.doc.scrollTop-C)>1&&(d=!0)),v.scrollLeft!=null&&(sr(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-_)>1&&(d=!0)),!d)break}return s}function Zg(e,t){var a=zs(e,t);a.scrollTop!=null&&xi(e,a.scrollTop),a.scrollLeft!=null&&sr(e,a.scrollLeft)}function zs(e,t){var a=e.display,i=Nr(e.display);t.top<0&&(t.top=0);var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:a.scroller.scrollTop,c=_s(e),d={};t.bottom-t.top>c&&(t.bottom=t.top+c);var h=e.doc.height+Ts(a),g=t.top<i,v=t.bottom>h-i;if(t.top<s)d.scrollTop=g?0:t.top;else if(t.bottom>s+c){var C=Math.min(t.top,(v?h:t.bottom)-c);C!=s&&(d.scrollTop=C)}var _=e.options.fixedGutter?0:a.gutters.offsetWidth,R=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:a.scroller.scrollLeft-_,O=nr(e)-a.gutters.offsetWidth,B=t.right-t.left>O;return B&&(t.right=t.left+O),t.left<10?d.scrollLeft=0:t.left<R?d.scrollLeft=Math.max(0,t.left+_-(B?0:10)):t.right>O+R-3&&(d.scrollLeft=t.right+(B?0:10)-O),d}function Bs(e,t){t!=null&&(wa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Mr(e){wa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,a){(t!=null||a!=null)&&wa(e),t!=null&&(e.curOp.scrollLeft=t),a!=null&&(e.curOp.scrollTop=a)}function em(e,t){wa(e),e.curOp.scrollToPos=t}function wa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var a=Ou(e,t.from),i=Ou(e,t.to);Bu(e,a,i,t.margin)}}function Bu(e,t,a,i){var s=zs(e,{left:Math.min(t.left,a.left),top:Math.min(t.top,a.top)-i,right:Math.max(t.right,a.right),bottom:Math.max(t.bottom,a.bottom)+i});bi(e,s.scrollLeft,s.scrollTop)}function xi(e,t){Math.abs(e.doc.scrollTop-t)<2||(u||Ws(e,{top:t}),Hu(e,t,!0),u&&Ws(e),Si(e,100))}function Hu(e,t,a){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!a)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function sr(e,t,a,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((a?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)&&(e.doc.scrollLeft=t,Gu(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function wi(e){var t=e.display,a=t.gutters.offsetWidth,i=Math.round(e.doc.height+Ts(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?a:0,docHeight:i,scrollHeight:i+xn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:a}}var or=function(e,t,a){this.cm=a;var i=this.vert=w("div",[w("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=w("div",[w("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=s.tabIndex=-1,e(i),e(s),me(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),me(s,"scroll",function(){s.clientWidth&&t(s.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,m&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};or.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,a=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var s=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+s)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=a?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var c=e.viewWidth-e.barLeft-(a?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+c)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:a?i:0,bottom:t?i:0}},or.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},or.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},or.prototype.zeroWidthHack=function(){var e=ne&&!$?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ct,this.disableVert=new ct},or.prototype.enableZeroWidthBar=function(e,t,a){e.style.visibility="";function i(){var s=e.getBoundingClientRect(),c=a=="vert"?document.elementFromPoint(s.right-1,(s.top+s.bottom)/2):document.elementFromPoint((s.right+s.left)/2,s.bottom-1);c!=e?e.style.visibility="hidden":t.set(1e3,i)}t.set(1e3,i)},or.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ki=function(){};ki.prototype.update=function(){return{bottom:0,right:0}},ki.prototype.setScrollLeft=function(){},ki.prototype.setScrollTop=function(){},ki.prototype.clear=function(){};function $r(e,t){t||(t=wi(e));var a=e.display.barWidth,i=e.display.barHeight;Wu(e,t);for(var s=0;s<4&&a!=e.display.barWidth||i!=e.display.barHeight;s++)a!=e.display.barWidth&&e.options.lineWrapping&&ba(e),Wu(e,wi(e)),a=e.display.barWidth,i=e.display.barHeight}function Wu(e,t){var a=e.display,i=a.scrollbars.update(t);a.sizer.style.paddingRight=(a.barWidth=i.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=i.bottom)+"px",a.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=i.bottom+"px",a.scrollbarFiller.style.width=i.right+"px"):a.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=i.bottom+"px",a.gutterFiller.style.width=t.gutterWidth+"px"):a.gutterFiller.style.display=""}var ju={native:or,null:ki};function Uu(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Pe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ju[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,a){a=="horizontal"?sr(e,t):xi(e,t)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var tm=0;function lr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++tm,markArrays:null},Og(e.curOp)}function ur(e){var t=e.curOp;t&&Rg(t,function(a){for(var i=0;i<a.ops.length;i++)a.ops[i].cm.curOp=null;nm(a)})}function nm(e){for(var t=e.ops,a=0;a<t.length;a++)rm(t[a]);for(var i=0;i<t.length;i++)im(t[i]);for(var s=0;s<t.length;s++)am(t[s]);for(var c=0;c<t.length;c++)sm(t[c]);for(var d=0;d<t.length;d++)om(t[d])}function rm(e){var t=e.cm,a=t.display;um(t),e.updateMaxLine&&Ss(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<a.viewFrom||e.scrollToPos.to.line>=a.viewTo)||a.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ka(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function im(e){e.updatedDisplay=e.mustUpdate&&Hs(e.cm,e.update)}function am(e){var t=e.cm,a=t.display;e.updatedDisplay&&ba(t),e.barMeasure=wi(t),a.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Cu(t,a.maxLine,a.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+e.adjustWidthTo+xn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+e.adjustWidthTo-nr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=a.input.prepareSelection())}function sm(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&sr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var a=e.focus&&e.focus==M(oe(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,a),(e.updatedDisplay||e.startHeight!=t.doc.height)&&$r(t,e.barMeasure),e.updatedDisplay&&Us(t,e.barMeasure),e.selectionChanged&&Ms(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),a&&Pu(e.cm)}function om(e){var t=e.cm,a=t.display,i=t.doc;if(e.updatedDisplay&&qu(t,e.update),a.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(a.wheelStartX=a.wheelStartY=null),e.scrollTop!=null&&Hu(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&sr(t,e.scrollLeft,!0,!0),e.scrollToPos){var s=Qg(t,Ce(i,e.scrollToPos.from),Ce(i,e.scrollToPos.to),e.scrollToPos.margin);Jg(t,s)}var c=e.maybeHiddenMarkers,d=e.maybeUnhiddenMarkers;if(c)for(var h=0;h<c.length;++h)c[h].lines.length||et(c[h],"hide");if(d)for(var g=0;g<d.length;++g)d[g].lines.length&&et(d[g],"unhide");a.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&et(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ht(e,t){if(e.curOp)return t();lr(e);try{return t()}finally{ur(e)}}function yt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);lr(e);try{return t.apply(e,arguments)}finally{ur(e)}}}function It(e){return function(){if(this.curOp)return e.apply(this,arguments);lr(this);try{return e.apply(this,arguments)}finally{ur(this)}}}function bt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);lr(t);try{return e.apply(this,arguments)}finally{ur(t)}}}function Si(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,fe(lm,e))}function lm(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var a=+new Date+e.options.workTime,i=di(e,t.highlightFrontier),s=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(c){if(i.line>=e.display.viewFrom){var d=c.styles,h=c.text.length>e.options.maxHighlightLength?yn(t.mode,i.state):null,g=Ql(e,c,i,!0);h&&(i.state=h),c.styles=g.styles;var v=c.styleClasses,C=g.classes;C?c.styleClasses=C:v&&(c.styleClasses=null);for(var _=!d||d.length!=c.styles.length||v!=C&&(!v||!C||v.bgClass!=C.bgClass||v.textClass!=C.textClass),R=0;!_&&R<d.length;++R)_=d[R]!=c.styles[R];_&&s.push(i.line),c.stateAfter=i.save(),i.nextLine()}else c.text.length<=e.options.maxHighlightLength&&vs(e,c.text,i),c.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>a)return Si(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),s.length&&Ht(e,function(){for(var c=0;c<s.length;c++)Bn(e,s[c],"text")})}}var ka=function(e,t,a){var i=e.display;this.viewport=t,this.visible=xa(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=nr(e),this.force=a,this.dims=Os(e),this.events=[]};ka.prototype.signal=function(e,t){Bt(e,t)&&this.events.push(arguments)},ka.prototype.finish=function(){for(var e=0;e<this.events.length;e++)et.apply(null,this.events[e])};function um(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=xn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=xn(e)+"px",t.scrollbarsClipped=!0)}function cm(e){if(e.hasFocus())return null;var t=M(oe(e));if(!t||!A(e.display.lineDiv,t))return null;var a={activeElt:t};if(window.getSelection){var i=Z(e).getSelection();i.anchorNode&&i.extend&&A(e.display.lineDiv,i.anchorNode)&&(a.anchorNode=i.anchorNode,a.anchorOffset=i.anchorOffset,a.focusNode=i.focusNode,a.focusOffset=i.focusOffset)}return a}function fm(e){if(!(!e||!e.activeElt||e.activeElt==M(_e(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,a=t.defaultView.getSelection(),i=t.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),a.removeAllRanges(),a.addRange(i),a.extend(e.focusNode,e.focusOffset)}}function Hs(e,t){var a=e.display,i=e.doc;if(t.editorIsHidden)return Hn(e),!1;if(!t.force&&t.visible.from>=a.viewFrom&&t.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&Mu(e)==0)return!1;Ku(e)&&(Hn(e),t.dims=Os(e));var s=i.first+i.size,c=Math.max(t.visible.from-e.options.viewportMargin,i.first),d=Math.min(s,t.visible.to+e.options.viewportMargin);a.viewFrom<c&&c-a.viewFrom<20&&(c=Math.max(i.first,a.viewFrom)),a.viewTo>d&&a.viewTo-d<20&&(d=Math.min(s,a.viewTo)),_n&&(c=ws(e.doc,c),d=du(e.doc,d));var h=c!=a.viewFrom||d!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth;Xg(e,c,d),a.viewOffset=Ln(ce(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px";var g=Mu(e);if(!h&&g==0&&!t.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var v=cm(e);return g>4&&(a.lineDiv.style.display="none"),dm(e,a.updateLineNumbers,t.dims),g>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,fm(v),j(a.cursorDiv),j(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,h&&(a.lastWrapHeight=t.wrapperHeight,a.lastWrapWidth=t.wrapperWidth,Si(e,400)),a.updateLineNumbers=null,!0}function qu(e,t){for(var a=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==nr(e)){if(a&&a.top!=null&&(a={top:Math.min(e.doc.height+Ts(e.display)-_s(e),a.top)}),t.visible=xa(e.display,e.doc,a),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=xa(e.display,e.doc,a));if(!Hs(e,t))break;ba(e);var s=wi(e);yi(e),$r(e,s),Us(e,s),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ws(e,t){var a=new ka(e,t);if(Hs(e,a)){ba(e),qu(e,a);var i=wi(e);yi(e),$r(e,i),Us(e,i),a.finish()}}function dm(e,t,a){var i=e.display,s=e.options.lineNumbers,c=i.lineDiv,d=c.firstChild;function h(B){var q=B.nextSibling;return S&&ne&&e.display.currentWheelTarget==B?B.style.display="none":B.parentNode.removeChild(B),q}for(var g=i.view,v=i.viewFrom,C=0;C<g.length;C++){var _=g[C];if(!_.hidden)if(!_.node||_.node.parentNode!=c){var R=zg(e,_,v,a);c.insertBefore(R,d)}else{for(;d!=_.node;)d=h(d);var O=s&&t!=null&&t<=v&&_.lineNumber;_.changes&&(we(_.changes,"gutter")>-1&&(O=!1),vu(e,_,v,a)),O&&(j(_.lineNumber),_.lineNumber.appendChild(document.createTextNode(X(e.options,v)))),d=_.node.nextSibling}v+=_.size}for(;d;)d=h(d)}function js(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",vt(e,"gutterChanged",e)}function Us(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+xn(e)+"px"}function Gu(e){var t=e.display,a=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var i=Ns(t)-t.scroller.scrollLeft+e.doc.scrollLeft,s=t.gutters.offsetWidth,c=i+"px",d=0;d<a.length;d++)if(!a[d].hidden){e.options.fixedGutter&&(a[d].gutter&&(a[d].gutter.style.left=c),a[d].gutterBackground&&(a[d].gutterBackground.style.left=c));var h=a[d].alignable;if(h)for(var g=0;g<h.length;g++)h[g].style.left=c}e.options.fixedGutter&&(t.gutters.style.left=i+s+"px")}}function Ku(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=X(e.options,t.first+t.size-1),i=e.display;if(a.length!=i.lineNumChars){var s=i.measure.appendChild(w("div",[w("div",a)],"CodeMirror-linenumber CodeMirror-gutter-elt")),c=s.firstChild.offsetWidth,d=s.offsetWidth-c;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(c,i.lineGutter.offsetWidth-d)+1,i.lineNumWidth=i.lineNumInnerWidth+d,i.lineNumChars=i.lineNumInnerWidth?a.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",js(e.display),!0}return!1}function qs(e,t){for(var a=[],i=!1,s=0;s<e.length;s++){var c=e[s],d=null;if(typeof c!="string"&&(d=c.style,c=c.className),c=="CodeMirror-linenumbers")if(t)i=!0;else continue;a.push({className:c,style:d})}return t&&!i&&a.push({className:"CodeMirror-linenumbers",style:null}),a}function Vu(e){var t=e.gutters,a=e.gutterSpecs;j(t),e.lineGutter=null;for(var i=0;i<a.length;++i){var s=a[i],c=s.className,d=s.style,h=t.appendChild(w("div",null,"CodeMirror-gutter "+c));d&&(h.style.cssText=d),c=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=a.length?"":"none",js(e)}function Ci(e){Vu(e.display),Nt(e),Gu(e)}function hm(e,t,a,i){var s=this;this.input=a,s.scrollbarFiller=w("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=w("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=J("div",null,"CodeMirror-code"),s.selectionDiv=w("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=w("div",null,"CodeMirror-cursors"),s.measure=w("div",null,"CodeMirror-measure"),s.lineMeasure=w("div",null,"CodeMirror-measure"),s.lineSpace=J("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var c=J("div",[s.lineSpace],"CodeMirror-lines");s.mover=w("div",[c],null,"position: relative"),s.sizer=w("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=w("div",null,null,"position: absolute; height: "+Re+"px; width: 1px;"),s.gutters=w("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=w("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=w("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),L&&W===105&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),m&&k<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),!S&&!(u&&V)&&(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=qs(i.gutters,i.lineNumbers),Vu(s),a.init(s)}var Sa=0,In=null;m?In=-.53:u?In=15:L?In=-.7:D&&(In=-1/3);function Xu(e){var t=e.wheelDeltaX,a=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),a==null&&e.detail&&e.axis==e.VERTICAL_AXIS?a=e.detail:a==null&&(a=e.wheelDelta),{x:t,y:a}}function pm(e){var t=Xu(e);return t.x*=In,t.y*=In,t}function Yu(e,t){L&&W==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var a=Xu(t),i=a.x,s=a.y,c=In;t.deltaMode===0&&(i=t.deltaX,s=t.deltaY,c=1);var d=e.display,h=d.scroller,g=h.scrollWidth>h.clientWidth,v=h.scrollHeight>h.clientHeight;if(i&&g||s&&v){if(s&&ne&&S){e:for(var C=t.target,_=d.view;C!=h;C=C.parentNode)for(var R=0;R<_.length;R++)if(_[R].node==C){e.display.currentWheelTarget=C;break e}}if(i&&!u&&!z&&c!=null){s&&v&&xi(e,Math.max(0,h.scrollTop+s*c)),sr(e,Math.max(0,h.scrollLeft+i*c)),(!s||s&&v)&&_t(t),d.wheelStartX=null;return}if(s&&c!=null){var O=s*c,B=e.doc.scrollTop,q=B+d.wrapper.clientHeight;O<0?B=Math.max(0,B+O-50):q=Math.min(e.doc.height,q+O+50),Ws(e,{top:B,bottom:q})}Sa<20&&t.deltaMode!==0&&(d.wheelStartX==null?(d.wheelStartX=h.scrollLeft,d.wheelStartY=h.scrollTop,d.wheelDX=i,d.wheelDY=s,setTimeout(function(){if(d.wheelStartX!=null){var Y=h.scrollLeft-d.wheelStartX,ee=h.scrollTop-d.wheelStartY,ae=ee&&d.wheelDY&&ee/d.wheelDY||Y&&d.wheelDX&&Y/d.wheelDX;d.wheelStartX=d.wheelStartY=null,ae&&(In=(In*Sa+ae)/(Sa+1),++Sa)}},200)):(d.wheelDX+=i,d.wheelDY+=s))}}var Yt=function(e,t){this.ranges=e,this.primIndex=t};Yt.prototype.primary=function(){return this.ranges[this.primIndex]},Yt.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var a=this.ranges[t],i=e.ranges[t];if(!ze(a.anchor,i.anchor)||!ze(a.head,i.head))return!1}return!0},Yt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Be(mt(this.ranges[t].anchor),mt(this.ranges[t].head));return new Yt(e,this.primIndex)},Yt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yt.prototype.contains=function(e,t){t||(t=e);for(var a=0;a<this.ranges.length;a++){var i=this.ranges[a];if(re(t,i.from())>=0&&re(e,i.to())<=0)return a}return-1};var Be=function(e,t){this.anchor=e,this.head=t};Be.prototype.from=function(){return Ir(this.anchor,this.head)},Be.prototype.to=function(){return Ot(this.anchor,this.head)},Be.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function hn(e,t,a){var i=e&&e.options.selectionsMayTouch,s=t[a];t.sort(function(R,O){return re(R.from(),O.from())}),a=we(t,s);for(var c=1;c<t.length;c++){var d=t[c],h=t[c-1],g=re(h.to(),d.from());if(i&&!d.empty()?g>0:g>=0){var v=Ir(h.from(),d.from()),C=Ot(h.to(),d.to()),_=h.empty()?d.from()==d.head:h.from()==h.head;c<=a&&--a,t.splice(--c,2,new Be(_?C:v,_?v:C))}}return new Yt(t,a)}function Wn(e,t){return new Yt([new Be(e,t||e)],0)}function jn(e){return e.text?P(e.from.line+e.text.length-1,be(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ju(e,t){if(re(e,t.from)<0)return e;if(re(e,t.to)<=0)return jn(t);var a=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=jn(t).ch-t.to.ch),P(a,i)}function Gs(e,t){for(var a=[],i=0;i<e.sel.ranges.length;i++){var s=e.sel.ranges[i];a.push(new Be(Ju(s.anchor,t),Ju(s.head,t)))}return hn(e.cm,a,e.sel.primIndex)}function Qu(e,t,a){return e.line==t.line?P(a.line,e.ch-t.ch+a.ch):P(a.line+(e.line-t.line),e.ch)}function gm(e,t,a){for(var i=[],s=P(e.first,0),c=s,d=0;d<t.length;d++){var h=t[d],g=Qu(h.from,s,c),v=Qu(jn(h),s,c);if(s=h.to,c=v,a=="around"){var C=e.sel.ranges[d],_=re(C.head,C.anchor)<0;i[d]=new Be(_?v:g,_?g:v)}else i[d]=new Be(g,g)}return new Yt(i,e.sel.primIndex)}function Ks(e){e.doc.mode=_r(e.options,e.doc.modeOption),Ti(e)}function Ti(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Si(e,100),e.state.modeGen++,e.curOp&&Nt(e)}function Zu(e,t){return t.from.ch==0&&t.to.ch==0&&be(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Vs(e,t,a,i){function s(ae){return a?a[ae]:null}function c(ae,te,le){Sg(ae,te,le,i),vt(ae,"change",ae,t)}function d(ae,te){for(var le=[],ve=ae;ve<te;++ve)le.push(new Ar(v[ve],s(ve),i));return le}var h=t.from,g=t.to,v=t.text,C=ce(e,h.line),_=ce(e,g.line),R=be(v),O=s(v.length-1),B=g.line-h.line;if(t.full)e.insert(0,d(0,v.length)),e.remove(v.length,e.size-v.length);else if(Zu(e,t)){var q=d(0,v.length-1);c(_,_.text,O),B&&e.remove(h.line,B),q.length&&e.insert(h.line,q)}else if(C==_)if(v.length==1)c(C,C.text.slice(0,h.ch)+R+C.text.slice(g.ch),O);else{var Y=d(1,v.length-1);Y.push(new Ar(R+C.text.slice(g.ch),O,i)),c(C,C.text.slice(0,h.ch)+v[0],s(0)),e.insert(h.line+1,Y)}else if(v.length==1)c(C,C.text.slice(0,h.ch)+v[0]+_.text.slice(g.ch),s(0)),e.remove(h.line+1,B);else{c(C,C.text.slice(0,h.ch)+v[0],s(0)),c(_,R+_.text.slice(g.ch),O);var ee=d(1,v.length-1);B>1&&e.remove(h.line+1,B-1),e.insert(h.line+1,ee)}vt(e,"change",e,t)}function Un(e,t,a){function i(s,c,d){if(s.linked)for(var h=0;h<s.linked.length;++h){var g=s.linked[h];if(g.doc!=c){var v=d&&g.sharedHist;a&&!v||(t(g.doc,v),i(g.doc,s,v))}}}i(e,null,!0)}function ec(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Rs(e),Ks(e),tc(e),e.options.direction=t.direction,e.options.lineWrapping||Ss(e),e.options.mode=t.modeOption,Nt(e)}function tc(e){(e.doc.direction=="rtl"?K:Pe)(e.display.lineDiv,"CodeMirror-rtl")}function mm(e){Ht(e,function(){tc(e),Nt(e)})}function Ca(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Xs(e,t){var a={from:mt(t.from),to:jn(t),text:Tn(e,t.from,t.to)};return ic(e,a,t.from.line,t.to.line+1),Un(e,function(i){return ic(i,a,t.from.line,t.to.line+1)},!0),a}function nc(e){for(;e.length;){var t=be(e);if(t.ranges)e.pop();else break}}function vm(e,t){if(t)return nc(e.done),be(e.done);if(e.done.length&&!be(e.done).ranges)return be(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),be(e.done)}function rc(e,t,a,i){var s=e.history;s.undone.length=0;var c=+new Date,d,h;if((s.lastOp==i||s.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&s.lastModTime>c-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(d=vm(s,s.lastOp==i)))h=be(d.changes),re(t.from,t.to)==0&&re(t.from,h.to)==0?h.to=jn(t):d.changes.push(Xs(e,t));else{var g=be(s.done);for((!g||!g.ranges)&&Ta(e.sel,s.done),d={changes:[Xs(e,t)],generation:s.generation},s.done.push(d);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(a),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=c,s.lastOp=s.lastSelOp=i,s.lastOrigin=s.lastSelOrigin=t.origin,h||et(e,"historyAdded")}function ym(e,t,a,i){var s=t.charAt(0);return s=="*"||s=="+"&&a.ranges.length==i.ranges.length&&a.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function bm(e,t,a,i){var s=e.history,c=i&&i.origin;a==s.lastSelOp||c&&s.lastSelOrigin==c&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==c||ym(e,c,be(s.done),t))?s.done[s.done.length-1]=t:Ta(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=c,s.lastSelOp=a,i&&i.clearRedo!==!1&&nc(s.undone)}function Ta(e,t){var a=be(t);a&&a.ranges&&a.equals(e)||t.push(e)}function ic(e,t,a,i){var s=t["spans_"+e.id],c=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,i),function(d){d.markedSpans&&((s||(s=t["spans_"+e.id]={}))[c]=d.markedSpans),++c})}function xm(e){if(!e)return null;for(var t,a=0;a<e.length;++a)e[a].marker.explicitlyCleared?t||(t=e.slice(0,a)):t&&t.push(e[a]);return t?t.length?t:null:e}function wm(e,t){var a=t["spans_"+e.id];if(!a)return null;for(var i=[],s=0;s<t.text.length;++s)i.push(xm(a[s]));return i}function ac(e,t){var a=wm(e,t),i=bs(e,t);if(!a)return i;if(!i)return a;for(var s=0;s<a.length;++s){var c=a[s],d=i[s];if(c&&d)e:for(var h=0;h<d.length;++h){for(var g=d[h],v=0;v<c.length;++v)if(c[v].marker==g.marker)continue e;c.push(g)}else d&&(a[s]=d)}return a}function Pr(e,t,a){for(var i=[],s=0;s<e.length;++s){var c=e[s];if(c.ranges){i.push(a?Yt.prototype.deepCopy.call(c):c);continue}var d=c.changes,h=[];i.push({changes:h});for(var g=0;g<d.length;++g){var v=d[g],C=void 0;if(h.push({from:v.from,to:v.to,text:v.text}),t)for(var _ in v)(C=_.match(/^spans_(\d+)$/))&&we(t,Number(C[1]))>-1&&(be(h)[_]=v[_],delete v[_])}}return i}function Ys(e,t,a,i){if(i){var s=e.anchor;if(a){var c=re(t,s)<0;c!=re(a,s)<0?(s=t,t=a):c!=re(t,a)<0&&(t=a)}return new Be(s,t)}else return new Be(a||t,t)}function _a(e,t,a,i,s){s==null&&(s=e.cm&&(e.cm.display.shift||e.extend)),Lt(e,new Yt([Ys(e.sel.primary(),t,a,s)],0),i)}function sc(e,t,a){for(var i=[],s=e.cm&&(e.cm.display.shift||e.extend),c=0;c<e.sel.ranges.length;c++)i[c]=Ys(e.sel.ranges[c],t[c],null,s);var d=hn(e.cm,i,e.sel.primIndex);Lt(e,d,a)}function Js(e,t,a,i){var s=e.sel.ranges.slice(0);s[t]=a,Lt(e,hn(e.cm,s,e.sel.primIndex),i)}function oc(e,t,a,i){Lt(e,Wn(t,a),i)}function km(e,t,a){var i={ranges:t.ranges,update:function(s){this.ranges=[];for(var c=0;c<s.length;c++)this.ranges[c]=new Be(Ce(e,s[c].anchor),Ce(e,s[c].head))},origin:a&&a.origin};return et(e,"beforeSelectionChange",e,i),e.cm&&et(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?hn(e.cm,i.ranges,i.ranges.length-1):t}function lc(e,t,a){var i=e.history.done,s=be(i);s&&s.ranges?(i[i.length-1]=t,La(e,t,a)):Lt(e,t,a)}function Lt(e,t,a){La(e,t,a),bm(e,e.sel,e.cm?e.cm.curOp.id:NaN,a)}function La(e,t,a){(Bt(e,"beforeSelectionChange")||e.cm&&Bt(e.cm,"beforeSelectionChange"))&&(t=km(e,t,a));var i=a&&a.bias||(re(t.primary().head,e.sel.primary().head)<0?-1:1);uc(e,fc(e,t,i,!0)),!(a&&a.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Mr(e.cm)}function uc(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,tn(e.cm)),vt(e,"cursorActivity",e))}function cc(e){uc(e,fc(e,e.sel,null,!1))}function fc(e,t,a,i){for(var s,c=0;c<t.ranges.length;c++){var d=t.ranges[c],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[c],g=Ea(e,d.anchor,h&&h.anchor,a,i),v=d.head==d.anchor?g:Ea(e,d.head,h&&h.head,a,i);(s||g!=d.anchor||v!=d.head)&&(s||(s=t.ranges.slice(0,c)),s[c]=new Be(g,v))}return s?hn(e.cm,s,t.primIndex):t}function zr(e,t,a,i,s){var c=ce(e,t.line);if(c.markedSpans)for(var d=0;d<c.markedSpans.length;++d){var h=c.markedSpans[d],g=h.marker,v="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,C="selectRight"in g?!g.selectRight:g.inclusiveRight;if((h.from==null||(v?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(C?h.to>=t.ch:h.to>t.ch))){if(s&&(et(g,"beforeCursorEnter"),g.explicitlyCleared))if(c.markedSpans){--d;continue}else break;if(!g.atomic)continue;if(a){var _=g.find(i<0?1:-1),R=void 0;if((i<0?C:v)&&(_=dc(e,_,-i,_&&_.line==t.line?c:null)),_&&_.line==t.line&&(R=re(_,a))&&(i<0?R<0:R>0))return zr(e,_,t,i,s)}var O=g.find(i<0?-1:1);return(i<0?v:C)&&(O=dc(e,O,i,O.line==t.line?c:null)),O?zr(e,O,t,i,s):null}}return t}function Ea(e,t,a,i,s){var c=i||1,d=zr(e,t,a,c,s)||!s&&zr(e,t,a,c,!0)||zr(e,t,a,-c,s)||!s&&zr(e,t,a,-c,!0);return d||(e.cantEdit=!0,P(e.first,0))}function dc(e,t,a,i){return a<0&&t.ch==0?t.line>e.first?Ce(e,P(t.line-1)):null:a>0&&t.ch==(i||ce(e,t.line)).text.length?t.line<e.first+e.size-1?P(t.line+1,0):null:new P(t.line,t.ch+a)}function hc(e){e.setSelection(P(e.firstLine(),0),P(e.lastLine()),ft)}function pc(e,t,a){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return a&&(i.update=function(s,c,d,h){s&&(i.from=Ce(e,s)),c&&(i.to=Ce(e,c)),d&&(i.text=d),h!==void 0&&(i.origin=h)}),et(e,"beforeChange",e,i),e.cm&&et(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Br(e,t,a){if(e.cm){if(!e.cm.curOp)return yt(e.cm,Br)(e,t,a);if(e.cm.state.suppressEdits)return}if(!((Bt(e,"beforeChange")||e.cm&&Bt(e.cm,"beforeChange"))&&(t=pc(e,t,!0),!t))){var i=au&&!a&&bg(e,t.from,t.to);if(i)for(var s=i.length-1;s>=0;--s)gc(e,{from:i[s].from,to:i[s].to,text:s?[""]:t.text,origin:t.origin});else gc(e,t)}}function gc(e,t){if(!(t.text.length==1&&t.text[0]==""&&re(t.from,t.to)==0)){var a=Gs(e,t);rc(e,t,a,e.cm?e.cm.curOp.id:NaN),_i(e,t,a,bs(e,t));var i=[];Un(e,function(s,c){!c&&we(i,s.history)==-1&&(bc(s.history,t),i.push(s.history)),_i(s,t,null,bs(s,t))})}}function Ia(e,t,a){var i=e.cm&&e.cm.state.suppressEdits;if(!(i&&!a)){for(var s=e.history,c,d=e.sel,h=t=="undo"?s.done:s.undone,g=t=="undo"?s.undone:s.done,v=0;v<h.length&&(c=h[v],!(a?c.ranges&&!c.equals(e.sel):!c.ranges));v++);if(v!=h.length){for(s.lastOrigin=s.lastSelOrigin=null;;)if(c=h.pop(),c.ranges){if(Ta(c,g),a&&!c.equals(e.sel)){Lt(e,c,{clearRedo:!1});return}d=c}else if(i){h.push(c);return}else break;var C=[];Ta(d,g),g.push({changes:C,generation:s.generation}),s.generation=c.generation||++s.maxGeneration;for(var _=Bt(e,"beforeChange")||e.cm&&Bt(e.cm,"beforeChange"),R=function(q){var Y=c.changes[q];if(Y.origin=t,_&&!pc(e,Y,!1))return h.length=0,{};C.push(Xs(e,Y));var ee=q?Gs(e,Y):be(h);_i(e,Y,ee,ac(e,Y)),!q&&e.cm&&e.cm.scrollIntoView({from:Y.from,to:jn(Y)});var ae=[];Un(e,function(te,le){!le&&we(ae,te.history)==-1&&(bc(te.history,Y),ae.push(te.history)),_i(te,Y,null,ac(te,Y))})},O=c.changes.length-1;O>=0;--O){var B=R(O);if(B)return B.v}}}}function mc(e,t){if(t!=0&&(e.first+=t,e.sel=new Yt(St(e.sel.ranges,function(s){return new Be(P(s.anchor.line+t,s.anchor.ch),P(s.head.line+t,s.head.ch))}),e.sel.primIndex),e.cm)){Nt(e.cm,e.first,e.first-t,t);for(var a=e.cm.display,i=a.viewFrom;i<a.viewTo;i++)Bn(e.cm,i,"gutter")}}function _i(e,t,a,i){if(e.cm&&!e.cm.curOp)return yt(e.cm,_i)(e,t,a,i);if(t.to.line<e.first){mc(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var s=t.text.length-1-(e.first-t.from.line);mc(e,s),t={from:P(e.first,0),to:P(t.to.line+s,t.to.ch),text:[be(t.text)],origin:t.origin}}var c=e.lastLine();t.to.line>c&&(t={from:t.from,to:P(c,ce(e,c).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Tn(e,t.from,t.to),a||(a=Gs(e,t)),e.cm?Sm(e.cm,t,i):Vs(e,t,i),La(e,a,ft),e.cantEdit&&Ea(e,P(e.firstLine(),0))&&(e.cantEdit=!1)}}function Sm(e,t,a){var i=e.doc,s=e.display,c=t.from,d=t.to,h=!1,g=c.line;e.options.lineWrapping||(g=b(fn(ce(i,c.line))),i.iter(g,d.line+1,function(O){if(O==s.maxLine)return h=!0,!0})),i.sel.contains(t.from,t.to)>-1&&tn(e),Vs(i,t,a,Fu(e)),e.options.lineWrapping||(i.iter(g,c.line+t.text.length,function(O){var B=da(O);B>s.maxLineLength&&(s.maxLine=O,s.maxLineLength=B,s.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),dg(i,c.line),Si(e,400);var v=t.text.length-(d.line-c.line)-1;t.full?Nt(e):c.line==d.line&&t.text.length==1&&!Zu(e.doc,t)?Bn(e,c.line,"text"):Nt(e,c.line,d.line+1,v);var C=Bt(e,"changes"),_=Bt(e,"change");if(_||C){var R={from:c,to:d,text:t.text,removed:t.removed,origin:t.origin};_&&vt(e,"change",e,R),C&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(R)}e.display.selForContextMenu=null}function Hr(e,t,a,i,s){var c;i||(i=a),re(i,a)<0&&(c=[i,a],a=c[0],i=c[1]),typeof t=="string"&&(t=e.splitLines(t)),Br(e,{from:a,to:i,text:t,origin:s})}function vc(e,t,a,i){a<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function yc(e,t,a,i){for(var s=0;s<e.length;++s){var c=e[s],d=!0;if(c.ranges){c.copied||(c=e[s]=c.deepCopy(),c.copied=!0);for(var h=0;h<c.ranges.length;h++)vc(c.ranges[h].anchor,t,a,i),vc(c.ranges[h].head,t,a,i);continue}for(var g=0;g<c.changes.length;++g){var v=c.changes[g];if(a<v.from.line)v.from=P(v.from.line+i,v.from.ch),v.to=P(v.to.line+i,v.to.ch);else if(t<=v.to.line){d=!1;break}}d||(e.splice(0,s+1),s=0)}}function bc(e,t){var a=t.from.line,i=t.to.line,s=t.text.length-(i-a)-1;yc(e.done,a,i,s),yc(e.undone,a,i,s)}function Li(e,t,a,i){var s=t,c=t;return typeof t=="number"?c=ce(e,Yl(e,t)):s=b(t),s==null?null:(i(c,s)&&e.cm&&Bn(e.cm,s,a),c)}function Ei(e){this.lines=e,this.parent=null;for(var t=0,a=0;a<e.length;++a)e[a].parent=this,t+=e[a].height;this.height=t}Ei.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var a=e,i=e+t;a<i;++a){var s=this.lines[a];this.height-=s.height,Cg(s),vt(s,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,a){this.height+=a,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,a){for(var i=e+t;e<i;++e)if(a(this.lines[e]))return!0}};function Ii(e){this.children=e;for(var t=0,a=0,i=0;i<e.length;++i){var s=e[i];t+=s.chunkSize(),a+=s.height,s.parent=this}this.size=t,this.height=a,this.parent=null}Ii.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var a=0;a<this.children.length;++a){var i=this.children[a],s=i.chunkSize();if(e<s){var c=Math.min(t,s-e),d=i.height;if(i.removeInner(e,c),this.height-=d-i.height,s==c&&(this.children.splice(a--,1),i.parent=null),(t-=c)==0)break;e=0}else e-=s}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ei))){var h=[];this.collapse(h),this.children=[new Ei(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,a){this.size+=t.length,this.height+=a;for(var i=0;i<this.children.length;++i){var s=this.children[i],c=s.chunkSize();if(e<=c){if(s.insertInner(e,t,a),s.lines&&s.lines.length>50){for(var d=s.lines.length%25+25,h=d;h<s.lines.length;){var g=new Ei(s.lines.slice(h,h+=25));s.height-=g.height,this.children.splice(++i,0,g),g.parent=this}s.lines=s.lines.slice(0,d),this.maybeSpill()}break}e-=c}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),a=new Ii(t);if(e.parent){e.size-=a.size,e.height-=a.height;var s=we(e.parent.children,e);e.parent.children.splice(s+1,0,a)}else{var i=new Ii(e.children);i.parent=e,e.children=[i,a],e=i}a.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,a){for(var i=0;i<this.children.length;++i){var s=this.children[i],c=s.chunkSize();if(e<c){var d=Math.min(t,c-e);if(s.iterN(e,d,a))return!0;if((t-=d)==0)break;e=0}else e-=c}}};var Ai=function(e,t,a){if(a)for(var i in a)a.hasOwnProperty(i)&&(this[i]=a[i]);this.doc=e,this.node=t};Ai.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,a=this.line,i=b(a);if(!(i==null||!t)){for(var s=0;s<t.length;++s)t[s]==this&&t.splice(s--,1);t.length||(a.widgets=null);var c=mi(this);Xt(a,Math.max(0,a.height-c)),e&&(Ht(e,function(){xc(e,a,-c),Bn(e,i,"widget")}),vt(e,"lineWidgetCleared",e,this,i))}},Ai.prototype.changed=function(){var e=this,t=this.height,a=this.doc.cm,i=this.line;this.height=null;var s=mi(this)-t;s&&(zn(this.doc,i)||Xt(i,i.height+s),a&&Ht(a,function(){a.curOp.forceUpdate=!0,xc(a,i,s),vt(a,"lineWidgetChanged",a,e,b(i))}))},sn(Ai);function xc(e,t,a){Ln(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Bs(e,a)}function Cm(e,t,a,i){var s=new Ai(e,a,i),c=e.cm;return c&&s.noHScroll&&(c.display.alignWidgets=!0),Li(e,t,"widget",function(d){var h=d.widgets||(d.widgets=[]);if(s.insertAt==null?h.push(s):h.splice(Math.min(h.length,Math.max(0,s.insertAt)),0,s),s.line=d,c&&!zn(e,d)){var g=Ln(d)<e.scrollTop;Xt(d,d.height+mi(s)),g&&Bs(c,s.height),c.curOp.forceUpdate=!0}return!0}),c&&vt(c,"lineWidgetAdded",c,s,typeof t=="number"?t:b(t)),s}var wc=0,qn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++wc};qn.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&lr(e),Bt(this,"clear")){var a=this.find();a&&vt(this,"clear",a.from,a.to)}for(var i=null,s=null,c=0;c<this.lines.length;++c){var d=this.lines[c],h=hi(d.markedSpans,this);e&&!this.collapsed?Bn(e,b(d),"text"):e&&(h.to!=null&&(s=b(d)),h.from!=null&&(i=b(d))),d.markedSpans=gg(d.markedSpans,h),h.from==null&&this.collapsed&&!zn(this.doc,d)&&e&&Xt(d,Nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var v=fn(this.lines[g]),C=da(v);C>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=C,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Nt(e,i,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&cc(e.doc)),e&&vt(e,"markerCleared",e,this,i,s),t&&ur(e),this.parent&&this.parent.clear()}},qn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var a,i,s=0;s<this.lines.length;++s){var c=this.lines[s],d=hi(c.markedSpans,this);if(d.from!=null&&(a=P(t?c:b(c),d.from),e==-1))return a;if(d.to!=null&&(i=P(t?c:b(c),d.to),e==1))return i}return a&&{from:a,to:i}},qn.prototype.changed=function(){var e=this,t=this.find(-1,!0),a=this,i=this.doc.cm;!t||!i||Ht(i,function(){var s=t.line,c=b(t.line),d=Ls(i,c);if(d&&(Lu(d),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!zn(a.doc,s)&&a.height!=null){var h=a.height;a.height=null;var g=mi(a)-h;g&&Xt(s,s.height+g)}vt(i,"markerChanged",i,e)})},qn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||we(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qn.prototype.detachLine=function(e){if(this.lines.splice(we(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},sn(qn);function Wr(e,t,a,i,s){if(i&&i.shared)return Tm(e,t,a,i,s);if(e.cm&&!e.cm.curOp)return yt(e.cm,Wr)(e,t,a,i,s);var c=new qn(e,s),d=re(t,a);if(i&&ke(i,c,!1),d>0||d==0&&c.clearWhenEmpty!==!1)return c;if(c.replacedWith&&(c.collapsed=!0,c.widgetNode=J("span",[c.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||c.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(c.widgetNode.insertLeft=!0)),c.collapsed){if(fu(e,t.line,t,a,c)||t.line!=a.line&&fu(e,a.line,t,a,c))throw new Error("Inserting collapsed marker partially overlapping an existing one");pg()}c.addToHistory&&rc(e,{from:t,to:a,origin:"markText"},e.sel,NaN);var h=t.line,g=e.cm,v;if(e.iter(h,a.line+1,function(_){g&&c.collapsed&&!g.options.lineWrapping&&fn(_)==g.display.maxLine&&(v=!0),c.collapsed&&h!=t.line&&Xt(_,0),mg(_,new la(c,h==t.line?t.ch:null,h==a.line?a.ch:null),e.cm&&e.cm.curOp),++h}),c.collapsed&&e.iter(t.line,a.line+1,function(_){zn(e,_)&&Xt(_,0)}),c.clearOnEnter&&me(c,"beforeCursorEnter",function(){return c.clear()}),c.readOnly&&(hg(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),c.collapsed&&(c.id=++wc,c.atomic=!0),g){if(v&&(g.curOp.updateMaxLine=!0),c.collapsed)Nt(g,t.line,a.line+1);else if(c.className||c.startStyle||c.endStyle||c.css||c.attributes||c.title)for(var C=t.line;C<=a.line;C++)Bn(g,C,"text");c.atomic&&cc(g.doc),vt(g,"markerAdded",g,c)}return c}var Di=function(e,t){this.markers=e,this.primary=t;for(var a=0;a<e.length;++a)e[a].parent=this};Di.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();vt(this,"clear")}},Di.prototype.find=function(e,t){return this.primary.find(e,t)},sn(Di);function Tm(e,t,a,i,s){i=ke(i),i.shared=!1;var c=[Wr(e,t,a,i,s)],d=c[0],h=i.widgetNode;return Un(e,function(g){h&&(i.widgetNode=h.cloneNode(!0)),c.push(Wr(g,Ce(g,t),Ce(g,a),i,s));for(var v=0;v<g.linked.length;++v)if(g.linked[v].isParent)return;d=be(c)}),new Di(c,d)}function kc(e){return e.findMarks(P(e.first,0),e.clipPos(P(e.lastLine())),function(t){return t.parent})}function _m(e,t){for(var a=0;a<t.length;a++){var i=t[a],s=i.find(),c=e.clipPos(s.from),d=e.clipPos(s.to);if(re(c,d)){var h=Wr(e,c,d,i.primary,i.primary.type);i.markers.push(h),h.parent=i}}}function Lm(e){for(var t=function(i){var s=e[i],c=[s.primary.doc];Un(s.primary.doc,function(g){return c.push(g)});for(var d=0;d<s.markers.length;d++){var h=s.markers[d];we(c,h.doc)==-1&&(h.parent=null,s.markers.splice(d--,1))}},a=0;a<e.length;a++)t(a)}var Em=0,Rt=function(e,t,a,i,s){if(!(this instanceof Rt))return new Rt(e,t,a,i,s);a==null&&(a=0),Ii.call(this,[new Ei([new Ar("",null)])]),this.first=a,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=a;var c=P(a,0);this.sel=Wn(c),this.history=new Ca(null),this.id=++Em,this.modeOption=t,this.lineSep=i,this.direction=s=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Vs(this,{from:c,to:c,text:e}),Lt(this,Wn(c),ft)};Rt.prototype=Zn(Ii.prototype,{constructor:Rt,iter:function(e,t,a){a?this.iterN(e-this.first,t-e,a):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var a=0,i=0;i<t.length;++i)a+=t[i].height;this.insertInner(e-this.first,t,a)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=fi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:bt(function(e){var t=P(this.first,0),a=this.first+this.size-1;Br(this,{from:t,to:P(a,ce(this,a).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&bi(this.cm,0,0),Lt(this,Wn(t),ft)}),replaceRange:function(e,t,a,i){t=Ce(this,t),a=a?Ce(this,a):t,Hr(this,e,t,a,i)},getRange:function(e,t,a){var i=Tn(this,Ce(this,e),Ce(this,t));return a===!1?i:a===""?i.join(""):i.join(a||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(U(this,e))return ce(this,e)},getLineNumber:function(e){return b(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ce(this,e)),fn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(this,e)},getCursor:function(e){var t=this.sel.primary(),a;return e==null||e=="head"?a=t.head:e=="anchor"?a=t.anchor:e=="end"||e=="to"||e===!1?a=t.to():a=t.from(),a},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:bt(function(e,t,a){oc(this,Ce(this,typeof e=="number"?P(e,t||0):e),null,a)}),setSelection:bt(function(e,t,a){oc(this,Ce(this,e),Ce(this,t||e),a)}),extendSelection:bt(function(e,t,a){_a(this,Ce(this,e),t&&Ce(this,t),a)}),extendSelections:bt(function(e,t){sc(this,Jl(this,e),t)}),extendSelectionsBy:bt(function(e,t){var a=St(this.sel.ranges,e);sc(this,Jl(this,a),t)}),setSelections:bt(function(e,t,a){if(e.length){for(var i=[],s=0;s<e.length;s++)i[s]=new Be(Ce(this,e[s].anchor),Ce(this,e[s].head||e[s].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Lt(this,hn(this.cm,i,t),a)}}),addSelection:bt(function(e,t,a){var i=this.sel.ranges.slice(0);i.push(new Be(Ce(this,e),Ce(this,t||e))),Lt(this,hn(this.cm,i,i.length-1),a)}),getSelection:function(e){for(var t=this.sel.ranges,a,i=0;i<t.length;i++){var s=Tn(this,t[i].from(),t[i].to());a=a?a.concat(s):s}return e===!1?a:a.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],a=this.sel.ranges,i=0;i<a.length;i++){var s=Tn(this,a[i].from(),a[i].to());e!==!1&&(s=s.join(e||this.lineSeparator())),t[i]=s}return t},replaceSelection:function(e,t,a){for(var i=[],s=0;s<this.sel.ranges.length;s++)i[s]=e;this.replaceSelections(i,t,a||"+input")},replaceSelections:bt(function(e,t,a){for(var i=[],s=this.sel,c=0;c<s.ranges.length;c++){var d=s.ranges[c];i[c]={from:d.from(),to:d.to(),text:this.splitLines(e[c]),origin:a}}for(var h=t&&t!="end"&&gm(this,i,t),g=i.length-1;g>=0;g--)Br(this,i[g]);h?lc(this,h):this.cm&&Mr(this.cm)}),undo:bt(function(){Ia(this,"undo")}),redo:bt(function(){Ia(this,"redo")}),undoSelection:bt(function(){Ia(this,"undo",!0)}),redoSelection:bt(function(){Ia(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,a=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var s=0;s<e.undone.length;s++)e.undone[s].ranges||++a;return{undo:t,redo:a}},clearHistory:function(){var e=this;this.history=new Ca(this.history),Un(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Pr(this.history.done),undone:Pr(this.history.undone)}},setHistory:function(e){var t=this.history=new Ca(this.history);t.done=Pr(e.done.slice(0),null,!0),t.undone=Pr(e.undone.slice(0),null,!0)},setGutterMarker:bt(function(e,t,a){return Li(this,e,"gutter",function(i){var s=i.gutterMarkers||(i.gutterMarkers={});return s[t]=a,!a&&pe(s)&&(i.gutterMarkers=null),!0})}),clearGutter:bt(function(e){var t=this;this.iter(function(a){a.gutterMarkers&&a.gutterMarkers[e]&&Li(t,a,"gutter",function(){return a.gutterMarkers[e]=null,pe(a.gutterMarkers)&&(a.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!U(this,e)||(t=e,e=ce(this,e),!e))return null}else if(t=b(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:bt(function(e,t,a){return Li(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[s])i[s]=a;else{if(ie(a).test(i[s]))return!1;i[s]+=" "+a}return!0})}),removeLineClass:bt(function(e,t,a){return Li(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",c=i[s];if(c)if(a==null)i[s]=null;else{var d=c.match(ie(a));if(!d)return!1;var h=d.index+d[0].length;i[s]=c.slice(0,d.index)+(!d.index||h==c.length?"":" ")+c.slice(h)||null}else return!1;return!0})}),addLineWidget:bt(function(e,t,a){return Cm(this,e,t,a)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,a){return Wr(this,Ce(this,e),Ce(this,t),a,a&&a.type||"range")},setBookmark:function(e,t){var a={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Ce(this,e),Wr(this,e,e,a,"bookmark")},findMarksAt:function(e){e=Ce(this,e);var t=[],a=ce(this,e.line).markedSpans;if(a)for(var i=0;i<a.length;++i){var s=a[i];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker.parent||s.marker)}return t},findMarks:function(e,t,a){e=Ce(this,e),t=Ce(this,t);var i=[],s=e.line;return this.iter(e.line,t.line+1,function(c){var d=c.markedSpans;if(d)for(var h=0;h<d.length;h++){var g=d[h];!(g.to!=null&&s==e.line&&e.ch>=g.to||g.from==null&&s!=e.line||g.from!=null&&s==t.line&&g.from>=t.ch)&&(!a||a(g.marker))&&i.push(g.marker.parent||g.marker)}++s}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var a=t.markedSpans;if(a)for(var i=0;i<a.length;++i)a[i].from!=null&&e.push(a[i].marker)}),e},posFromIndex:function(e){var t,a=this.first,i=this.lineSeparator().length;return this.iter(function(s){var c=s.text.length+i;if(c>e)return t=e,!0;e-=c,++a}),Ce(this,P(a,t))},indexFromPos:function(e){e=Ce(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var a=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+a}),t},copy:function(e){var t=new Rt(fi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,a=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<a&&(a=e.to);var i=new Rt(fi(this,t,a),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],_m(i,kc(this)),i},unlinkDoc:function(e){if(e instanceof Ye&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var a=this.linked[t];if(a.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Lm(kc(this));break}}if(e.history==this.history){var i=[e.id];Un(e,function(s){return i.push(s.id)},!0),e.history=new Ca(null),e.history.done=Pr(this.history.done,i),e.history.undone=Pr(this.history.undone,i)}},iterLinkedDocs:function(e){Un(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):nn(e)},lineSeparator:function(){return this.lineSep||`
|
|
11
|
-
`},setDirection:bt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&mm(this.cm))})}),Rt.prototype.eachLine=Rt.prototype.iter;var Sc=0;function Im(e){var t=this;if(Cc(t),!(tt(t,e)||En(t.display,e))){_t(e),m&&(Sc=+new Date);var a=ir(t,e,!0),i=e.dataTransfer.files;if(!(!a||t.isReadOnly()))if(i&&i.length&&window.FileReader&&window.File)for(var s=i.length,c=Array(s),d=0,h=function(){++d==s&&yt(t,function(){a=Ce(t.doc,a);var O={from:a,to:a,text:t.doc.splitLines(c.filter(function(B){return B!=null}).join(t.doc.lineSeparator())),origin:"paste"};Br(t.doc,O),lc(t.doc,Wn(Ce(t.doc,a),Ce(t.doc,jn(O))))})()},g=function(O,B){if(t.options.allowDropFileTypes&&we(t.options.allowDropFileTypes,O.type)==-1){h();return}var q=new FileReader;q.onerror=function(){return h()},q.onload=function(){var Y=q.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Y)){h();return}c[B]=Y,h()},q.readAsText(O)},v=0;v<i.length;v++)g(i[v],v);else{if(t.state.draggingText&&t.doc.sel.contains(a)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var C=e.dataTransfer.getData("Text");if(C){var _;if(t.state.draggingText&&!t.state.draggingText.copy&&(_=t.listSelections()),La(t.doc,Wn(a,a)),_)for(var R=0;R<_.length;++R)Hr(t.doc,"",_[R].anchor,_[R].head,"drag");t.replaceSelection(C,"around","paste"),t.display.input.focus()}}catch{}}}}function Am(e,t){if(m&&(!e.state.draggingText||+new Date-Sc<100)){Fn(t);return}if(!(tt(e,t)||En(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!D)){var a=w("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",z&&(a.width=a.height=1,e.display.wrapper.appendChild(a),a._top=a.offsetTop),t.dataTransfer.setDragImage(a,0,0),z&&a.parentNode.removeChild(a)}}function Dm(e,t){var a=ir(e,t);if(a){var i=document.createDocumentFragment();Fs(e,a,i),e.display.dragCursor||(e.display.dragCursor=w("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Q(e.display.dragCursor,i)}}function Cc(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Tc(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),a=[],i=0;i<t.length;i++){var s=t[i].CodeMirror;s&&a.push(s)}a.length&&a[0].operation(function(){for(var c=0;c<a.length;c++)e(a[c])})}}var _c=!1;function Om(){_c||(Nm(),_c=!0)}function Nm(){var e;me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Tc(Rm)},100))}),me(window,"blur",function(){return Tc(Fr)})}function Rm(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Gn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Oi=0;Oi<10;Oi++)Gn[Oi+48]=Gn[Oi+96]=String(Oi);for(var Aa=65;Aa<=90;Aa++)Gn[Aa]=String.fromCharCode(Aa);for(var Ni=1;Ni<=12;Ni++)Gn[Ni+111]=Gn[Ni+63235]="F"+Ni;var An={};An.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},An.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},An.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},An.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},An.default=ne?An.macDefault:An.pcDefault;function Fm(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var a,i,s,c,d=0;d<t.length-1;d++){var h=t[d];if(/^(cmd|meta|m)$/i.test(h))c=!0;else if(/^a(lt)?$/i.test(h))a=!0;else if(/^(c|ctrl|control)$/i.test(h))i=!0;else if(/^s(hift)?$/i.test(h))s=!0;else throw new Error("Unrecognized modifier name: "+h)}return a&&(e="Alt-"+e),i&&(e="Ctrl-"+e),c&&(e="Cmd-"+e),s&&(e="Shift-"+e),e}function Mm(e){var t={};for(var a in e)if(e.hasOwnProperty(a)){var i=e[a];if(/^(name|fallthrough|(de|at)tach)$/.test(a))continue;if(i=="..."){delete e[a];continue}for(var s=St(a.split(" "),Fm),c=0;c<s.length;c++){var d=void 0,h=void 0;c==s.length-1?(h=s.join(" "),d=i):(h=s.slice(0,c+1).join(" "),d="...");var g=t[h];if(!g)t[h]=d;else if(g!=d)throw new Error("Inconsistent bindings for "+h)}delete e[a]}for(var v in t)e[v]=t[v];return e}function jr(e,t,a,i){t=Da(t);var s=t.call?t.call(e,i):t[e];if(s===!1)return"nothing";if(s==="...")return"multi";if(s!=null&&a(s))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return jr(e,t.fallthrough,a,i);for(var c=0;c<t.fallthrough.length;c++){var d=jr(e,t.fallthrough[c],a,i);if(d)return d}}}function Lc(e){var t=typeof e=="string"?e:Gn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ec(e,t,a){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(Oe?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(Oe?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!a&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function Ic(e,t){if(z&&e.keyCode==34&&e.char)return!1;var a=Gn[e.keyCode];return a==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(a=e.code),Ec(a,e,t))}function Da(e){return typeof e=="string"?An[e]:e}function Ur(e,t){for(var a=e.doc.sel.ranges,i=[],s=0;s<a.length;s++){for(var c=t(a[s]);i.length&&re(c.from,be(i).to)<=0;){var d=i.pop();if(re(d.from,c.from)<0){c.from=d.from;break}}i.push(c)}Ht(e,function(){for(var h=i.length-1;h>=0;h--)Hr(e.doc,"",i[h].from,i[h].to,"+delete");Mr(e)})}function Qs(e,t,a){var i=zt(e.text,t+a,a);return i<0||i>e.text.length?null:i}function Zs(e,t,a){var i=Qs(e,t.ch,a);return i==null?null:new P(t.line,i,a<0?"after":"before")}function eo(e,t,a,i,s){if(e){t.doc.direction=="rtl"&&(s=-s);var c=$e(a,t.doc.direction);if(c){var d=s<0?be(c):c[0],h=s<0==(d.level==1),g=h?"after":"before",v;if(d.level>0||t.doc.direction=="rtl"){var C=Or(t,a);v=s<0?a.text.length-1:0;var _=wn(t,C,v).top;v=en(function(R){return wn(t,C,R).top==_},s<0==(d.level==1)?d.from:d.to-1,v),g=="before"&&(v=Qs(a,v,1))}else v=s<0?d.to:d.from;return new P(i,v,g)}}return new P(i,s<0?a.text.length:0,s<0?"before":"after")}function $m(e,t,a,i){var s=$e(t,e.doc.direction);if(!s)return Zs(t,a,i);a.ch>=t.text.length?(a.ch=t.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var c=Rn(s,a.ch,a.sticky),d=s[c];if(e.doc.direction=="ltr"&&d.level%2==0&&(i>0?d.to>a.ch:d.from<a.ch))return Zs(t,a,i);var h=function(ee,ae){return Qs(t,ee instanceof P?ee.ch:ee,ae)},g,v=function(ee){return e.options.lineWrapping?(g=g||Or(e,t),Ru(e,t,g,ee)):{begin:0,end:t.text.length}},C=v(a.sticky=="before"?h(a,-1):a.ch);if(e.doc.direction=="rtl"||d.level==1){var _=d.level==1==i<0,R=h(a,_?1:-1);if(R!=null&&(_?R<=d.to&&R<=C.end:R>=d.from&&R>=C.begin)){var O=_?"before":"after";return new P(a.line,R,O)}}var B=function(ee,ae,te){for(var le=function(Ue,xt){return xt?new P(a.line,h(Ue,1),"before"):new P(a.line,Ue,"after")};ee>=0&&ee<s.length;ee+=ae){var ve=s[ee],ge=ae>0==(ve.level!=1),Ae=ge?te.begin:h(te.end,-1);if(ve.from<=Ae&&Ae<ve.to||(Ae=ge?ve.from:h(ve.to,-1),te.begin<=Ae&&Ae<te.end))return le(Ae,ge)}},q=B(c+i,i,C);if(q)return q;var Y=i>0?C.end:h(C.begin,-1);return Y!=null&&!(i>0&&Y==t.text.length)&&(q=B(i>0?0:s.length-1,i,v(Y)),q)?q:null}var Ri={selectAll:hc,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ft)},killLine:function(e){return Ur(e,function(t){if(t.empty()){var a=ce(e.doc,t.head.line).text.length;return t.head.ch==a&&t.head.line<e.lastLine()?{from:t.head,to:P(t.head.line+1,0)}:{from:t.head,to:P(t.head.line,a)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ur(e,function(t){return{from:P(t.from().line,0),to:Ce(e.doc,P(t.to().line+1,0))}})},delLineLeft:function(e){return Ur(e,function(t){return{from:P(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ur(e,function(t){var a=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:a},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return Ur(e,function(t){var a=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(P(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(P(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ac(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Dc(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pm(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div")},dt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:a},"div")},dt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:a},"div");return i.ch<e.getLine(i.line).search(/\S/)?Dc(e,t.head):i},dt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],a=e.listSelections(),i=e.options.tabSize,s=0;s<a.length;s++){var c=a[s].from(),d=Le(e.getLine(c.line),c.ch,i);t.push(Kt(i-d%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ht(e,function(){for(var t=e.listSelections(),a=[],i=0;i<t.length;i++)if(t[i].empty()){var s=t[i].head,c=ce(e.doc,s.line).text;if(c){if(s.ch==c.length&&(s=new P(s.line,s.ch-1)),s.ch>0)s=new P(s.line,s.ch+1),e.replaceRange(c.charAt(s.ch-1)+c.charAt(s.ch-2),P(s.line,s.ch-2),s,"+transpose");else if(s.line>e.doc.first){var d=ce(e.doc,s.line-1).text;d&&(s=new P(s.line,1),e.replaceRange(c.charAt(0)+e.doc.lineSeparator()+d.charAt(d.length-1),P(s.line-1,d.length-1),s,"+transpose"))}}a.push(new Be(s,s))}e.setSelections(a)})},newlineAndIndent:function(e){return Ht(e,function(){for(var t=e.listSelections(),a=t.length-1;a>=0;a--)e.replaceRange(e.doc.lineSeparator(),t[a].anchor,t[a].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Mr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
12
|
-
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ac(e,t){var a=ce(e.doc,t),i=fn(a);return i!=a&&(t=b(i)),eo(!0,e,i,t,1)}function Pm(e,t){var a=ce(e.doc,t),i=wg(a);return i!=a&&(t=b(i)),eo(!0,e,a,t,-1)}function Dc(e,t){var a=Ac(e,t.line),i=ce(e.doc,a.line),s=$e(i,e.doc.direction);if(!s||s[0].level==0){var c=Math.max(a.ch,i.text.search(/\S/)),d=t.line==a.line&&t.ch<=c&&t.ch;return P(a.line,d?0:c,a.sticky)}return a}function Oa(e,t,a){if(typeof t=="string"&&(t=Ri[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a&&(e.display.shift=!1),s=t(e)!=Ke}finally{e.display.shift=i,e.state.suppressEdits=!1}return s}function zm(e,t,a){for(var i=0;i<e.state.keyMaps.length;i++){var s=jr(t,e.state.keyMaps[i],a,e);if(s)return s}return e.options.extraKeys&&jr(t,e.options.extraKeys,a,e)||jr(t,e.options.keyMap,a,e)}var Bm=new ct;function Fi(e,t,a,i){var s=e.state.keySeq;if(s){if(Lc(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bm.set(50,function(){e.state.keySeq==s&&(e.state.keySeq=null,e.display.input.reset())}),Oc(e,s+" "+t,a,i))return!0}return Oc(e,t,a,i)}function Oc(e,t,a,i){var s=zm(e,t,i);return s=="multi"&&(e.state.keySeq=t),s=="handled"&&vt(e,"keyHandled",e,t,a),(s=="handled"||s=="multi")&&(_t(a),Ms(e)),!!s}function Nc(e,t){var a=Ic(t,!0);return a?t.shiftKey&&!e.state.keySeq?Fi(e,"Shift-"+a,t,function(i){return Oa(e,i,!0)})||Fi(e,a,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return Oa(e,i)}):Fi(e,a,t,function(i){return Oa(e,i)}):!1}function Hm(e,t,a){return Fi(e,"'"+a+"'",t,function(i){return Oa(e,i,!0)})}var to=null;function Rc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=M(oe(t)),!tt(t,e))){m&&k<11&&e.keyCode==27&&(e.returnValue=!1);var a=e.keyCode;t.display.shift=a==16||e.shiftKey;var i=Nc(t,e);z&&(to=i?a:null,!i&&a==88&&!sa&&(ne?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),u&&!ne&&!i&&a==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Wm(t)}}function Wm(e){var t=e.display.lineDiv;K(t,"CodeMirror-crosshair");function a(i){(i.keyCode==18||!i.altKey)&&(Pe(t,"CodeMirror-crosshair"),Tt(document,"keyup",a),Tt(document,"mouseover",a))}me(document,"keyup",a),me(document,"mouseover",a)}function Fc(e){e.keyCode==16&&(this.doc.sel.shift=!1),tt(this,e)}function Mc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(En(t.display,e)||tt(t,e)||e.ctrlKey&&!e.altKey||ne&&e.metaKey)){var a=e.keyCode,i=e.charCode;if(z&&a==to){to=null,_t(e);return}if(!(z&&(!e.which||e.which<10)&&Nc(t,e))){var s=String.fromCharCode(i??a);s!="\b"&&(Hm(t,e,s)||t.display.input.onKeyPress(e))}}}var jm=400,no=function(e,t,a){this.time=e,this.pos=t,this.button=a};no.prototype.compare=function(e,t,a){return this.time+jm>e&&re(t,this.pos)==0&&a==this.button};var Mi,$i;function Um(e,t){var a=+new Date;return $i&&$i.compare(a,e,t)?(Mi=$i=null,"triple"):Mi&&Mi.compare(a,e,t)?($i=new no(a,e,t),Mi=null,"double"):(Mi=new no(a,e,t),$i=null,"single")}function $c(e){var t=this,a=t.display;if(!(tt(t,e)||a.activeTouch&&a.input.supportsTouch())){if(a.input.ensurePolled(),a.shift=e.shiftKey,En(a,e)){S||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(!ro(t,e)){var i=ir(t,e),s=on(e),c=i?Um(i,s):"single";Z(t).focus(),s==1&&t.state.selectingText&&t.state.selectingText(e),!(i&&qm(t,s,i,c,e))&&(s==1?i?Km(t,i,c,e):li(e)==a.scroller&&_t(e):s==2?(i&&_a(t.doc,i),setTimeout(function(){return a.input.focus()},20)):s==3&&(Fe?t.display.input.onContextMenu(e):$s(t)))}}}function qm(e,t,a,i,s){var c="Click";return i=="double"?c="Double"+c:i=="triple"&&(c="Triple"+c),c=(t==1?"Left":t==2?"Middle":"Right")+c,Fi(e,Ec(c,s),s,function(d){if(typeof d=="string"&&(d=Ri[d]),!d)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=d(e,a)!=Ke}finally{e.state.suppressEdits=!1}return h})}function Gm(e,t,a){var i=e.getOption("configureMouse"),s=i?i(e,t,a):{};if(s.unit==null){var c=ue?a.shiftKey&&a.metaKey:a.altKey;s.unit=c?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(s.extend==null||e.doc.extend)&&(s.extend=e.doc.extend||a.shiftKey),s.addNew==null&&(s.addNew=ne?a.metaKey:a.ctrlKey),s.moveOnDrag==null&&(s.moveOnDrag=!(ne?a.altKey:a.ctrlKey)),s}function Km(e,t,a,i){m?setTimeout(fe(Pu,e),0):e.curOp.focus=M(oe(e));var s=Gm(e,a,i),c=e.doc.sel,d;e.options.dragDrop&&gs&&!e.isReadOnly()&&a=="single"&&(d=c.contains(t))>-1&&(re((d=c.ranges[d]).from(),t)<0||t.xRel>0)&&(re(d.to(),t)>0||t.xRel<0)?Vm(e,i,t,s):Xm(e,i,t,s)}function Vm(e,t,a,i){var s=e.display,c=!1,d=yt(e,function(v){S&&(s.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:$s(e)),Tt(s.wrapper.ownerDocument,"mouseup",d),Tt(s.wrapper.ownerDocument,"mousemove",h),Tt(s.scroller,"dragstart",g),Tt(s.scroller,"drop",d),c||(_t(v),i.addNew||_a(e.doc,a,null,null,i.extend),S&&!D||m&&k==9?setTimeout(function(){s.wrapper.ownerDocument.body.focus({preventScroll:!0}),s.input.focus()},20):s.input.focus())}),h=function(v){c=c||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},g=function(){return c=!0};S&&(s.scroller.draggable=!0),e.state.draggingText=d,d.copy=!i.moveOnDrag,me(s.wrapper.ownerDocument,"mouseup",d),me(s.wrapper.ownerDocument,"mousemove",h),me(s.scroller,"dragstart",g),me(s.scroller,"drop",d),e.state.delayingBlurEvent=!0,setTimeout(function(){return s.input.focus()},20),s.scroller.dragDrop&&s.scroller.dragDrop()}function Pc(e,t,a){if(a=="char")return new Be(t,t);if(a=="word")return e.findWordAt(t);if(a=="line")return new Be(P(t.line,0),Ce(e.doc,P(t.line+1,0)));var i=a(e,t);return new Be(i.from,i.to)}function Xm(e,t,a,i){m&&$s(e);var s=e.display,c=e.doc;_t(t);var d,h,g=c.sel,v=g.ranges;if(i.addNew&&!i.extend?(h=c.sel.contains(a),h>-1?d=v[h]:d=new Be(a,a)):(d=c.sel.primary(),h=c.sel.primIndex),i.unit=="rectangle")i.addNew||(d=new Be(a,a)),a=ir(e,t,!0,!0),h=-1;else{var C=Pc(e,a,i.unit);i.extend?d=Ys(d,C.anchor,C.head,i.extend):d=C}i.addNew?h==-1?(h=v.length,Lt(c,hn(e,v.concat([d]),h),{scroll:!1,origin:"*mouse"})):v.length>1&&v[h].empty()&&i.unit=="char"&&!i.extend?(Lt(c,hn(e,v.slice(0,h).concat(v.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),g=c.sel):Js(c,h,d,Pt):(h=0,Lt(c,new Yt([d],0),Pt),g=c.sel);var _=a;function R(te){if(re(_,te)!=0)if(_=te,i.unit=="rectangle"){for(var le=[],ve=e.options.tabSize,ge=Le(ce(c,a.line).text,a.ch,ve),Ae=Le(ce(c,te.line).text,te.ch,ve),Ue=Math.min(ge,Ae),xt=Math.max(ge,Ae),Qe=Math.min(a.line,te.line),Wt=Math.min(e.lastLine(),Math.max(a.line,te.line));Qe<=Wt;Qe++){var Ft=ce(c,Qe).text,lt=ht(Ft,Ue,ve);Ue==xt?le.push(new Be(P(Qe,lt),P(Qe,lt))):Ft.length>lt&&le.push(new Be(P(Qe,lt),P(Qe,ht(Ft,xt,ve))))}le.length||le.push(new Be(a,a)),Lt(c,hn(e,g.ranges.slice(0,h).concat(le),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(te)}else{var Mt=d,Ct=Pc(e,te,i.unit),pt=Mt.anchor,ut;re(Ct.anchor,pt)>0?(ut=Ct.head,pt=Ir(Mt.from(),Ct.anchor)):(ut=Ct.anchor,pt=Ot(Mt.to(),Ct.head));var rt=g.ranges.slice(0);rt[h]=Ym(e,new Be(Ce(c,pt),ut)),Lt(c,hn(e,rt,h),Pt)}}var O=s.wrapper.getBoundingClientRect(),B=0;function q(te){var le=++B,ve=ir(e,te,!0,i.unit=="rectangle");if(ve)if(re(ve,_)!=0){e.curOp.focus=M(oe(e)),R(ve);var ge=xa(s,c);(ve.line>=ge.to||ve.line<ge.from)&&setTimeout(yt(e,function(){B==le&&q(te)}),150)}else{var Ae=te.clientY<O.top?-20:te.clientY>O.bottom?20:0;Ae&&setTimeout(yt(e,function(){B==le&&(s.scroller.scrollTop+=Ae,q(te))}),50)}}function Y(te){e.state.selectingText=!1,B=1/0,te&&(_t(te),s.input.focus()),Tt(s.wrapper.ownerDocument,"mousemove",ee),Tt(s.wrapper.ownerDocument,"mouseup",ae),c.history.lastSelOrigin=null}var ee=yt(e,function(te){te.buttons===0||!on(te)?Y(te):q(te)}),ae=yt(e,Y);e.state.selectingText=ae,me(s.wrapper.ownerDocument,"mousemove",ee),me(s.wrapper.ownerDocument,"mouseup",ae)}function Ym(e,t){var a=t.anchor,i=t.head,s=ce(e.doc,a.line);if(re(a,i)==0&&a.sticky==i.sticky)return t;var c=$e(s);if(!c)return t;var d=Rn(c,a.ch,a.sticky),h=c[d];if(h.from!=a.ch&&h.to!=a.ch)return t;var g=d+(h.from==a.ch==(h.level!=1)?0:1);if(g==0||g==c.length)return t;var v;if(i.line!=a.line)v=(i.line-a.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var C=Rn(c,i.ch,i.sticky),_=C-d||(i.ch-a.ch)*(h.level==1?-1:1);C==g-1||C==g?v=_<0:v=_>0}var R=c[g+(v?-1:0)],O=v==(R.level==1),B=O?R.from:R.to,q=O?"after":"before";return a.ch==B&&a.sticky==q?t:new Be(new P(a.line,B,q),i)}function zc(e,t,a,i){var s,c;if(t.touches)s=t.touches[0].clientX,c=t.touches[0].clientY;else try{s=t.clientX,c=t.clientY}catch{return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&_t(t);var d=e.display,h=d.lineDiv.getBoundingClientRect();if(c>h.bottom||!Bt(e,a))return Dt(t);c-=h.top-d.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var v=d.gutters.childNodes[g];if(v&&v.getBoundingClientRect().right>=s){var C=T(e.doc,c),_=e.display.gutterSpecs[g];return et(e,a,e,C,_.className,t),Dt(t)}}}function ro(e,t){return zc(e,t,"gutterClick",!0)}function Bc(e,t){En(e.display,t)||Jm(e,t)||tt(e,t,"contextmenu")||Fe||e.display.input.onContextMenu(t)}function Jm(e,t){return Bt(e,"gutterContextMenu")?zc(e,t,"gutterContextMenu",!1):!1}function Hc(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vi(e)}var qr={toString:function(){return"CodeMirror.Init"}},Wc={},Na={};function Qm(e){var t=e.optionHandlers;function a(i,s,c,d){e.defaults[i]=s,c&&(t[i]=d?function(h,g,v){v!=qr&&c(h,g,v)}:c)}e.defineOption=a,e.Init=qr,a("value","",function(i,s){return i.setValue(s)},!0),a("mode",null,function(i,s){i.doc.modeOption=s,Ks(i)},!0),a("indentUnit",2,Ks,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(i){Ti(i),vi(i),Nt(i)},!0),a("lineSeparator",null,function(i,s){if(i.doc.lineSep=s,!!s){var c=[],d=i.doc.first;i.doc.iter(function(g){for(var v=0;;){var C=g.text.indexOf(s,v);if(C==-1)break;v=C+s.length,c.push(P(d,C))}d++});for(var h=c.length-1;h>=0;h--)Hr(i.doc,s,c[h],P(c[h].line,c[h].ch+s.length))}}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(i,s,c){i.state.specialChars=new RegExp(s.source+(s.test(" ")?"":"| "),"g"),c!=qr&&i.refresh()}),a("specialCharPlaceholder",Lg,function(i){return i.refresh()},!0),a("electricChars",!0),a("inputStyle",V?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(i,s){return i.getInputField().spellcheck=s},!0),a("autocorrect",!1,function(i,s){return i.getInputField().autocorrect=s},!0),a("autocapitalize",!1,function(i,s){return i.getInputField().autocapitalize=s},!0),a("rtlMoveVisually",!se),a("wholeLineUpdateBefore",!0),a("theme","default",function(i){Hc(i),Ci(i)},!0),a("keyMap","default",function(i,s,c){var d=Da(s),h=c!=qr&&Da(c);h&&h.detach&&h.detach(i,d),d.attach&&d.attach(i,h||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,ev,!0),a("gutters",[],function(i,s){i.display.gutterSpecs=qs(s,i.options.lineNumbers),Ci(i)},!0),a("fixedGutter",!0,function(i,s){i.display.gutters.style.left=s?Ns(i.display)+"px":"0",i.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(i){return $r(i)},!0),a("scrollbarStyle","native",function(i){Uu(i),$r(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),a("lineNumbers",!1,function(i,s){i.display.gutterSpecs=qs(i.options.gutters,s),Ci(i)},!0),a("firstLineNumber",1,Ci,!0),a("lineNumberFormatter",function(i){return i},Ci,!0),a("showCursorWhenSelecting",!1,yi,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(i,s){s=="nocursor"&&(Fr(i),i.display.input.blur()),i.display.input.readOnlyChanged(s)}),a("screenReaderLabel",null,function(i,s){s=s===""?null:s,i.display.input.screenReaderLabelChanged(s)}),a("disableInput",!1,function(i,s){s||i.display.input.reset()},!0),a("dragDrop",!0,Zm),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,yi,!0),a("singleCursorHeightPerLine",!0,yi,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,Ti,!0),a("addModeClass",!1,Ti,!0),a("pollInterval",100),a("undoDepth",200,function(i,s){return i.doc.history.undoDepth=s}),a("historyEventDelay",1250),a("viewportMargin",10,function(i){return i.refresh()},!0),a("maxHighlightLength",1e4,Ti,!0),a("moveInputWithCursor",!0,function(i,s){s||i.display.input.resetPosition()}),a("tabindex",null,function(i,s){return i.display.input.getField().tabIndex=s||""}),a("autofocus",null),a("direction","ltr",function(i,s){return i.doc.setDirection(s)},!0),a("phrases",null)}function Zm(e,t,a){var i=a&&a!=qr;if(!t!=!i){var s=e.display.dragFunctions,c=t?me:Tt;c(e.display.scroller,"dragstart",s.start),c(e.display.scroller,"dragenter",s.enter),c(e.display.scroller,"dragover",s.over),c(e.display.scroller,"dragleave",s.leave),c(e.display.scroller,"drop",s.drop)}}function ev(e){e.options.lineWrapping?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Pe(e.display.wrapper,"CodeMirror-wrap"),Ss(e)),Rs(e),Nt(e),vi(e),setTimeout(function(){return $r(e)},100)}function Ye(e,t){var a=this;if(!(this instanceof Ye))return new Ye(e,t);this.options=t=t?ke(t):{},ke(Wc,t,!1);var i=t.value;typeof i=="string"?i=new Rt(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var s=new Ye.inputStyles[t.inputStyle](this),c=this.display=new hm(e,i,s,t);c.wrapper.CodeMirror=this,Hc(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Uu(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ct,keySeq:null,specialChars:null},t.autofocus&&!V&&c.input.focus(),m&&k<11&&setTimeout(function(){return a.display.input.reset(!0)},20),tv(this),Om(),lr(this),this.curOp.forceUpdate=!0,ec(this,i),t.autofocus&&!V||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&Ps(a)},20):Fr(this);for(var d in Na)Na.hasOwnProperty(d)&&Na[d](this,t[d],qr);Ku(this),t.finishInit&&t.finishInit(this);for(var h=0;h<io.length;++h)io[h](this);ur(this),S&&t.lineWrapping&&getComputedStyle(c.lineDiv).textRendering=="optimizelegibility"&&(c.lineDiv.style.textRendering="auto")}Ye.defaults=Wc,Ye.optionHandlers=Na;function tv(e){var t=e.display;me(t.scroller,"mousedown",yt(e,$c)),m&&k<11?me(t.scroller,"dblclick",yt(e,function(g){if(!tt(e,g)){var v=ir(e,g);if(!(!v||ro(e,g)||En(e.display,g))){_t(g);var C=e.findWordAt(v);_a(e.doc,C.anchor,C.head)}}})):me(t.scroller,"dblclick",function(g){return tt(e,g)||_t(g)}),me(t.scroller,"contextmenu",function(g){return Bc(e,g)}),me(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||Bc(e,g)});var a,i={end:0};function s(){t.activeTouch&&(a=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function c(g){if(g.touches.length!=1)return!1;var v=g.touches[0];return v.radiusX<=1&&v.radiusY<=1}function d(g,v){if(v.left==null)return!0;var C=v.left-g.left,_=v.top-g.top;return C*C+_*_>20*20}me(t.scroller,"touchstart",function(g){if(!tt(e,g)&&!c(g)&&!ro(e,g)){t.input.ensurePolled(),clearTimeout(a);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-i.end<=300?i:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),me(t.scroller,"touchend",function(g){var v=t.activeTouch;if(v&&!En(t,g)&&v.left!=null&&!v.moved&&new Date-v.start<300){var C=e.coordsChar(t.activeTouch,"page"),_;!v.prev||d(v,v.prev)?_=new Be(C,C):!v.prev.prev||d(v,v.prev.prev)?_=e.findWordAt(C):_=new Be(P(C.line,0),Ce(e.doc,P(C.line+1,0))),e.setSelection(_.anchor,_.head),e.focus(),_t(g)}s()}),me(t.scroller,"touchcancel",s),me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xi(e,t.scroller.scrollTop),sr(e,t.scroller.scrollLeft,!0),et(e,"scroll",e))}),me(t.scroller,"mousewheel",function(g){return Yu(e,g)}),me(t.scroller,"DOMMouseScroll",function(g){return Yu(e,g)}),me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){tt(e,g)||Fn(g)},over:function(g){tt(e,g)||(Dm(e,g),Fn(g))},start:function(g){return Am(e,g)},drop:yt(e,Im),leave:function(g){tt(e,g)||Cc(e)}};var h=t.input.getField();me(h,"keyup",function(g){return Fc.call(e,g)}),me(h,"keydown",yt(e,Rc)),me(h,"keypress",yt(e,Mc)),me(h,"focus",function(g){return Ps(e,g)}),me(h,"blur",function(g){return Fr(e,g)})}var io=[];Ye.defineInitHook=function(e){return io.push(e)};function Pi(e,t,a,i){var s=e.doc,c;a==null&&(a="add"),a=="smart"&&(s.mode.indent?c=di(e,t).state:a="prev");var d=e.options.tabSize,h=ce(s,t),g=Le(h.text,null,d);h.stateAfter&&(h.stateAfter=null);var v=h.text.match(/^\s*/)[0],C;if(!i&&!/\S/.test(h.text))C=0,a="not";else if(a=="smart"&&(C=s.mode.indent(c,h.text.slice(v.length),h.text),C==Ke||C>150)){if(!i)return;a="prev"}a=="prev"?t>s.first?C=Le(ce(s,t-1).text,null,d):C=0:a=="add"?C=g+e.options.indentUnit:a=="subtract"?C=g-e.options.indentUnit:typeof a=="number"&&(C=g+a),C=Math.max(0,C);var _="",R=0;if(e.options.indentWithTabs)for(var O=Math.floor(C/d);O;--O)R+=d,_+=" ";if(R<C&&(_+=Kt(C-R)),_!=v)return Hr(s,_,P(t,0),P(t,v.length),"+input"),h.stateAfter=null,!0;for(var B=0;B<s.sel.ranges.length;B++){var q=s.sel.ranges[B];if(q.head.line==t&&q.head.ch<v.length){var Y=P(t,v.length);Js(s,B,new Be(Y,Y));break}}}var pn=null;function Ra(e){pn=e}function ao(e,t,a,i,s){var c=e.doc;e.display.shift=!1,i||(i=c.sel);var d=+new Date-200,h=s=="paste"||e.state.pasteIncoming>d,g=nn(t),v=null;if(h&&i.ranges.length>1)if(pn&&pn.text.join(`
|
|
13
|
-
`)==t){if(i.ranges.length%pn.text.length==0){v=[];for(var C=0;C<pn.text.length;C++)v.push(c.splitLines(pn.text[C]))}}else g.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(v=St(g,function(ee){return[ee]}));for(var _=e.curOp.updateInput,
|
|
10
|
+
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(d),d.scrollIntoView(s),e.display.lineSpace.removeChild(d)}}}function Qg(e,t,a,i){i==null&&(i=0);var s;!e.options.lineWrapping&&t==a&&(a=t.sticky=="before"?P(t.line,t.ch+1,"before"):t,t=t.ch?P(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var c=0;c<5;c++){var d=!1,h=dn(e,t),g=!a||a==t?h:dn(e,a);s={left:Math.min(h.left,g.left),top:Math.min(h.top,g.top)-i,right:Math.max(h.left,g.left),bottom:Math.max(h.bottom,g.bottom)+i};var v=zs(e,s),C=e.doc.scrollTop,_=e.doc.scrollLeft;if(v.scrollTop!=null&&(xi(e,v.scrollTop),Math.abs(e.doc.scrollTop-C)>1&&(d=!0)),v.scrollLeft!=null&&(sr(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-_)>1&&(d=!0)),!d)break}return s}function Zg(e,t){var a=zs(e,t);a.scrollTop!=null&&xi(e,a.scrollTop),a.scrollLeft!=null&&sr(e,a.scrollLeft)}function zs(e,t){var a=e.display,i=Nr(e.display);t.top<0&&(t.top=0);var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:a.scroller.scrollTop,c=_s(e),d={};t.bottom-t.top>c&&(t.bottom=t.top+c);var h=e.doc.height+Ts(a),g=t.top<i,v=t.bottom>h-i;if(t.top<s)d.scrollTop=g?0:t.top;else if(t.bottom>s+c){var C=Math.min(t.top,(v?h:t.bottom)-c);C!=s&&(d.scrollTop=C)}var _=e.options.fixedGutter?0:a.gutters.offsetWidth,F=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:a.scroller.scrollLeft-_,O=nr(e)-a.gutters.offsetWidth,B=t.right-t.left>O;return B&&(t.right=t.left+O),t.left<10?d.scrollLeft=0:t.left<F?d.scrollLeft=Math.max(0,t.left+_-(B?0:10)):t.right>O+F-3&&(d.scrollLeft=t.right+(B?0:10)-O),d}function Bs(e,t){t!=null&&(wa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Mr(e){wa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,a){(t!=null||a!=null)&&wa(e),t!=null&&(e.curOp.scrollLeft=t),a!=null&&(e.curOp.scrollTop=a)}function em(e,t){wa(e),e.curOp.scrollToPos=t}function wa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var a=Ou(e,t.from),i=Ou(e,t.to);Bu(e,a,i,t.margin)}}function Bu(e,t,a,i){var s=zs(e,{left:Math.min(t.left,a.left),top:Math.min(t.top,a.top)-i,right:Math.max(t.right,a.right),bottom:Math.max(t.bottom,a.bottom)+i});bi(e,s.scrollLeft,s.scrollTop)}function xi(e,t){Math.abs(e.doc.scrollTop-t)<2||(u||Ws(e,{top:t}),Hu(e,t,!0),u&&Ws(e),Si(e,100))}function Hu(e,t,a){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!a)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function sr(e,t,a,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((a?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)&&(e.doc.scrollLeft=t,Gu(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function wi(e){var t=e.display,a=t.gutters.offsetWidth,i=Math.round(e.doc.height+Ts(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?a:0,docHeight:i,scrollHeight:i+xn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:a}}var or=function(e,t,a){this.cm=a;var i=this.vert=w("div",[w("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=w("div",[w("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=s.tabIndex=-1,e(i),e(s),me(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),me(s,"scroll",function(){s.clientWidth&&t(s.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,m&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};or.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,a=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var s=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+s)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=a?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var c=e.viewWidth-e.barLeft-(a?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+c)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:a?i:0,bottom:t?i:0}},or.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},or.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},or.prototype.zeroWidthHack=function(){var e=ne&&!$?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ct,this.disableVert=new ct},or.prototype.enableZeroWidthBar=function(e,t,a){e.style.visibility="";function i(){var s=e.getBoundingClientRect(),c=a=="vert"?document.elementFromPoint(s.right-1,(s.top+s.bottom)/2):document.elementFromPoint((s.right+s.left)/2,s.bottom-1);c!=e?e.style.visibility="hidden":t.set(1e3,i)}t.set(1e3,i)},or.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ki=function(){};ki.prototype.update=function(){return{bottom:0,right:0}},ki.prototype.setScrollLeft=function(){},ki.prototype.setScrollTop=function(){},ki.prototype.clear=function(){};function $r(e,t){t||(t=wi(e));var a=e.display.barWidth,i=e.display.barHeight;Wu(e,t);for(var s=0;s<4&&a!=e.display.barWidth||i!=e.display.barHeight;s++)a!=e.display.barWidth&&e.options.lineWrapping&&ba(e),Wu(e,wi(e)),a=e.display.barWidth,i=e.display.barHeight}function Wu(e,t){var a=e.display,i=a.scrollbars.update(t);a.sizer.style.paddingRight=(a.barWidth=i.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=i.bottom)+"px",a.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=i.bottom+"px",a.scrollbarFiller.style.width=i.right+"px"):a.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=i.bottom+"px",a.gutterFiller.style.width=t.gutterWidth+"px"):a.gutterFiller.style.display=""}var ju={native:or,null:ki};function qu(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Pe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ju[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,a){a=="horizontal"?sr(e,t):xi(e,t)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var tm=0;function lr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++tm,markArrays:null},Og(e.curOp)}function ur(e){var t=e.curOp;t&&Fg(t,function(a){for(var i=0;i<a.ops.length;i++)a.ops[i].cm.curOp=null;nm(a)})}function nm(e){for(var t=e.ops,a=0;a<t.length;a++)rm(t[a]);for(var i=0;i<t.length;i++)im(t[i]);for(var s=0;s<t.length;s++)am(t[s]);for(var c=0;c<t.length;c++)sm(t[c]);for(var d=0;d<t.length;d++)om(t[d])}function rm(e){var t=e.cm,a=t.display;um(t),e.updateMaxLine&&Ss(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<a.viewFrom||e.scrollToPos.to.line>=a.viewTo)||a.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ka(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function im(e){e.updatedDisplay=e.mustUpdate&&Hs(e.cm,e.update)}function am(e){var t=e.cm,a=t.display;e.updatedDisplay&&ba(t),e.barMeasure=wi(t),a.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Cu(t,a.maxLine,a.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+e.adjustWidthTo+xn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+e.adjustWidthTo-nr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=a.input.prepareSelection())}function sm(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&sr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var a=e.focus&&e.focus==M(oe(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,a),(e.updatedDisplay||e.startHeight!=t.doc.height)&&$r(t,e.barMeasure),e.updatedDisplay&&qs(t,e.barMeasure),e.selectionChanged&&Ms(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),a&&Pu(e.cm)}function om(e){var t=e.cm,a=t.display,i=t.doc;if(e.updatedDisplay&&Uu(t,e.update),a.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(a.wheelStartX=a.wheelStartY=null),e.scrollTop!=null&&Hu(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&sr(t,e.scrollLeft,!0,!0),e.scrollToPos){var s=Qg(t,Ce(i,e.scrollToPos.from),Ce(i,e.scrollToPos.to),e.scrollToPos.margin);Jg(t,s)}var c=e.maybeHiddenMarkers,d=e.maybeUnhiddenMarkers;if(c)for(var h=0;h<c.length;++h)c[h].lines.length||et(c[h],"hide");if(d)for(var g=0;g<d.length;++g)d[g].lines.length&&et(d[g],"unhide");a.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&et(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ht(e,t){if(e.curOp)return t();lr(e);try{return t()}finally{ur(e)}}function yt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);lr(e);try{return t.apply(e,arguments)}finally{ur(e)}}}function It(e){return function(){if(this.curOp)return e.apply(this,arguments);lr(this);try{return e.apply(this,arguments)}finally{ur(this)}}}function bt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);lr(t);try{return e.apply(this,arguments)}finally{ur(t)}}}function Si(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,fe(lm,e))}function lm(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var a=+new Date+e.options.workTime,i=di(e,t.highlightFrontier),s=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(c){if(i.line>=e.display.viewFrom){var d=c.styles,h=c.text.length>e.options.maxHighlightLength?yn(t.mode,i.state):null,g=Ql(e,c,i,!0);h&&(i.state=h),c.styles=g.styles;var v=c.styleClasses,C=g.classes;C?c.styleClasses=C:v&&(c.styleClasses=null);for(var _=!d||d.length!=c.styles.length||v!=C&&(!v||!C||v.bgClass!=C.bgClass||v.textClass!=C.textClass),F=0;!_&&F<d.length;++F)_=d[F]!=c.styles[F];_&&s.push(i.line),c.stateAfter=i.save(),i.nextLine()}else c.text.length<=e.options.maxHighlightLength&&vs(e,c.text,i),c.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>a)return Si(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),s.length&&Ht(e,function(){for(var c=0;c<s.length;c++)Bn(e,s[c],"text")})}}var ka=function(e,t,a){var i=e.display;this.viewport=t,this.visible=xa(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=nr(e),this.force=a,this.dims=Os(e),this.events=[]};ka.prototype.signal=function(e,t){Bt(e,t)&&this.events.push(arguments)},ka.prototype.finish=function(){for(var e=0;e<this.events.length;e++)et.apply(null,this.events[e])};function um(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=xn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=xn(e)+"px",t.scrollbarsClipped=!0)}function cm(e){if(e.hasFocus())return null;var t=M(oe(e));if(!t||!A(e.display.lineDiv,t))return null;var a={activeElt:t};if(window.getSelection){var i=Z(e).getSelection();i.anchorNode&&i.extend&&A(e.display.lineDiv,i.anchorNode)&&(a.anchorNode=i.anchorNode,a.anchorOffset=i.anchorOffset,a.focusNode=i.focusNode,a.focusOffset=i.focusOffset)}return a}function fm(e){if(!(!e||!e.activeElt||e.activeElt==M(_e(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,a=t.defaultView.getSelection(),i=t.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),a.removeAllRanges(),a.addRange(i),a.extend(e.focusNode,e.focusOffset)}}function Hs(e,t){var a=e.display,i=e.doc;if(t.editorIsHidden)return Hn(e),!1;if(!t.force&&t.visible.from>=a.viewFrom&&t.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&Mu(e)==0)return!1;Ku(e)&&(Hn(e),t.dims=Os(e));var s=i.first+i.size,c=Math.max(t.visible.from-e.options.viewportMargin,i.first),d=Math.min(s,t.visible.to+e.options.viewportMargin);a.viewFrom<c&&c-a.viewFrom<20&&(c=Math.max(i.first,a.viewFrom)),a.viewTo>d&&a.viewTo-d<20&&(d=Math.min(s,a.viewTo)),_n&&(c=ws(e.doc,c),d=du(e.doc,d));var h=c!=a.viewFrom||d!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth;Xg(e,c,d),a.viewOffset=Ln(ce(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px";var g=Mu(e);if(!h&&g==0&&!t.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var v=cm(e);return g>4&&(a.lineDiv.style.display="none"),dm(e,a.updateLineNumbers,t.dims),g>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,fm(v),j(a.cursorDiv),j(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,h&&(a.lastWrapHeight=t.wrapperHeight,a.lastWrapWidth=t.wrapperWidth,Si(e,400)),a.updateLineNumbers=null,!0}function Uu(e,t){for(var a=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==nr(e)){if(a&&a.top!=null&&(a={top:Math.min(e.doc.height+Ts(e.display)-_s(e),a.top)}),t.visible=xa(e.display,e.doc,a),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=xa(e.display,e.doc,a));if(!Hs(e,t))break;ba(e);var s=wi(e);yi(e),$r(e,s),qs(e,s),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ws(e,t){var a=new ka(e,t);if(Hs(e,a)){ba(e),Uu(e,a);var i=wi(e);yi(e),$r(e,i),qs(e,i),a.finish()}}function dm(e,t,a){var i=e.display,s=e.options.lineNumbers,c=i.lineDiv,d=c.firstChild;function h(B){var U=B.nextSibling;return S&&ne&&e.display.currentWheelTarget==B?B.style.display="none":B.parentNode.removeChild(B),U}for(var g=i.view,v=i.viewFrom,C=0;C<g.length;C++){var _=g[C];if(!_.hidden)if(!_.node||_.node.parentNode!=c){var F=zg(e,_,v,a);c.insertBefore(F,d)}else{for(;d!=_.node;)d=h(d);var O=s&&t!=null&&t<=v&&_.lineNumber;_.changes&&(we(_.changes,"gutter")>-1&&(O=!1),vu(e,_,v,a)),O&&(j(_.lineNumber),_.lineNumber.appendChild(document.createTextNode(X(e.options,v)))),d=_.node.nextSibling}v+=_.size}for(;d;)d=h(d)}function js(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",vt(e,"gutterChanged",e)}function qs(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+xn(e)+"px"}function Gu(e){var t=e.display,a=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var i=Ns(t)-t.scroller.scrollLeft+e.doc.scrollLeft,s=t.gutters.offsetWidth,c=i+"px",d=0;d<a.length;d++)if(!a[d].hidden){e.options.fixedGutter&&(a[d].gutter&&(a[d].gutter.style.left=c),a[d].gutterBackground&&(a[d].gutterBackground.style.left=c));var h=a[d].alignable;if(h)for(var g=0;g<h.length;g++)h[g].style.left=c}e.options.fixedGutter&&(t.gutters.style.left=i+s+"px")}}function Ku(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=X(e.options,t.first+t.size-1),i=e.display;if(a.length!=i.lineNumChars){var s=i.measure.appendChild(w("div",[w("div",a)],"CodeMirror-linenumber CodeMirror-gutter-elt")),c=s.firstChild.offsetWidth,d=s.offsetWidth-c;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(c,i.lineGutter.offsetWidth-d)+1,i.lineNumWidth=i.lineNumInnerWidth+d,i.lineNumChars=i.lineNumInnerWidth?a.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",js(e.display),!0}return!1}function Us(e,t){for(var a=[],i=!1,s=0;s<e.length;s++){var c=e[s],d=null;if(typeof c!="string"&&(d=c.style,c=c.className),c=="CodeMirror-linenumbers")if(t)i=!0;else continue;a.push({className:c,style:d})}return t&&!i&&a.push({className:"CodeMirror-linenumbers",style:null}),a}function Vu(e){var t=e.gutters,a=e.gutterSpecs;j(t),e.lineGutter=null;for(var i=0;i<a.length;++i){var s=a[i],c=s.className,d=s.style,h=t.appendChild(w("div",null,"CodeMirror-gutter "+c));d&&(h.style.cssText=d),c=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=a.length?"":"none",js(e)}function Ci(e){Vu(e.display),Nt(e),Gu(e)}function hm(e,t,a,i){var s=this;this.input=a,s.scrollbarFiller=w("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=w("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=J("div",null,"CodeMirror-code"),s.selectionDiv=w("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=w("div",null,"CodeMirror-cursors"),s.measure=w("div",null,"CodeMirror-measure"),s.lineMeasure=w("div",null,"CodeMirror-measure"),s.lineSpace=J("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var c=J("div",[s.lineSpace],"CodeMirror-lines");s.mover=w("div",[c],null,"position: relative"),s.sizer=w("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=w("div",null,null,"position: absolute; height: "+Fe+"px; width: 1px;"),s.gutters=w("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=w("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=w("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),L&&W===105&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),m&&k<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),!S&&!(u&&V)&&(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=Us(i.gutters,i.lineNumbers),Vu(s),a.init(s)}var Sa=0,In=null;m?In=-.53:u?In=15:L?In=-.7:D&&(In=-1/3);function Xu(e){var t=e.wheelDeltaX,a=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),a==null&&e.detail&&e.axis==e.VERTICAL_AXIS?a=e.detail:a==null&&(a=e.wheelDelta),{x:t,y:a}}function pm(e){var t=Xu(e);return t.x*=In,t.y*=In,t}function Yu(e,t){L&&W==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var a=Xu(t),i=a.x,s=a.y,c=In;t.deltaMode===0&&(i=t.deltaX,s=t.deltaY,c=1);var d=e.display,h=d.scroller,g=h.scrollWidth>h.clientWidth,v=h.scrollHeight>h.clientHeight;if(i&&g||s&&v){if(s&&ne&&S){e:for(var C=t.target,_=d.view;C!=h;C=C.parentNode)for(var F=0;F<_.length;F++)if(_[F].node==C){e.display.currentWheelTarget=C;break e}}if(i&&!u&&!z&&c!=null){s&&v&&xi(e,Math.max(0,h.scrollTop+s*c)),sr(e,Math.max(0,h.scrollLeft+i*c)),(!s||s&&v)&&_t(t),d.wheelStartX=null;return}if(s&&c!=null){var O=s*c,B=e.doc.scrollTop,U=B+d.wrapper.clientHeight;O<0?B=Math.max(0,B+O-50):U=Math.min(e.doc.height,U+O+50),Ws(e,{top:B,bottom:U})}Sa<20&&t.deltaMode!==0&&(d.wheelStartX==null?(d.wheelStartX=h.scrollLeft,d.wheelStartY=h.scrollTop,d.wheelDX=i,d.wheelDY=s,setTimeout(function(){if(d.wheelStartX!=null){var Y=h.scrollLeft-d.wheelStartX,ee=h.scrollTop-d.wheelStartY,ae=ee&&d.wheelDY&&ee/d.wheelDY||Y&&d.wheelDX&&Y/d.wheelDX;d.wheelStartX=d.wheelStartY=null,ae&&(In=(In*Sa+ae)/(Sa+1),++Sa)}},200)):(d.wheelDX+=i,d.wheelDY+=s))}}var Yt=function(e,t){this.ranges=e,this.primIndex=t};Yt.prototype.primary=function(){return this.ranges[this.primIndex]},Yt.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var a=this.ranges[t],i=e.ranges[t];if(!ze(a.anchor,i.anchor)||!ze(a.head,i.head))return!1}return!0},Yt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Be(mt(this.ranges[t].anchor),mt(this.ranges[t].head));return new Yt(e,this.primIndex)},Yt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yt.prototype.contains=function(e,t){t||(t=e);for(var a=0;a<this.ranges.length;a++){var i=this.ranges[a];if(re(t,i.from())>=0&&re(e,i.to())<=0)return a}return-1};var Be=function(e,t){this.anchor=e,this.head=t};Be.prototype.from=function(){return Ir(this.anchor,this.head)},Be.prototype.to=function(){return Ot(this.anchor,this.head)},Be.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function hn(e,t,a){var i=e&&e.options.selectionsMayTouch,s=t[a];t.sort(function(F,O){return re(F.from(),O.from())}),a=we(t,s);for(var c=1;c<t.length;c++){var d=t[c],h=t[c-1],g=re(h.to(),d.from());if(i&&!d.empty()?g>0:g>=0){var v=Ir(h.from(),d.from()),C=Ot(h.to(),d.to()),_=h.empty()?d.from()==d.head:h.from()==h.head;c<=a&&--a,t.splice(--c,2,new Be(_?C:v,_?v:C))}}return new Yt(t,a)}function Wn(e,t){return new Yt([new Be(e,t||e)],0)}function jn(e){return e.text?P(e.from.line+e.text.length-1,be(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ju(e,t){if(re(e,t.from)<0)return e;if(re(e,t.to)<=0)return jn(t);var a=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=jn(t).ch-t.to.ch),P(a,i)}function Gs(e,t){for(var a=[],i=0;i<e.sel.ranges.length;i++){var s=e.sel.ranges[i];a.push(new Be(Ju(s.anchor,t),Ju(s.head,t)))}return hn(e.cm,a,e.sel.primIndex)}function Qu(e,t,a){return e.line==t.line?P(a.line,e.ch-t.ch+a.ch):P(a.line+(e.line-t.line),e.ch)}function gm(e,t,a){for(var i=[],s=P(e.first,0),c=s,d=0;d<t.length;d++){var h=t[d],g=Qu(h.from,s,c),v=Qu(jn(h),s,c);if(s=h.to,c=v,a=="around"){var C=e.sel.ranges[d],_=re(C.head,C.anchor)<0;i[d]=new Be(_?v:g,_?g:v)}else i[d]=new Be(g,g)}return new Yt(i,e.sel.primIndex)}function Ks(e){e.doc.mode=_r(e.options,e.doc.modeOption),Ti(e)}function Ti(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Si(e,100),e.state.modeGen++,e.curOp&&Nt(e)}function Zu(e,t){return t.from.ch==0&&t.to.ch==0&&be(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Vs(e,t,a,i){function s(ae){return a?a[ae]:null}function c(ae,te,le){Sg(ae,te,le,i),vt(ae,"change",ae,t)}function d(ae,te){for(var le=[],ve=ae;ve<te;++ve)le.push(new Ar(v[ve],s(ve),i));return le}var h=t.from,g=t.to,v=t.text,C=ce(e,h.line),_=ce(e,g.line),F=be(v),O=s(v.length-1),B=g.line-h.line;if(t.full)e.insert(0,d(0,v.length)),e.remove(v.length,e.size-v.length);else if(Zu(e,t)){var U=d(0,v.length-1);c(_,_.text,O),B&&e.remove(h.line,B),U.length&&e.insert(h.line,U)}else if(C==_)if(v.length==1)c(C,C.text.slice(0,h.ch)+F+C.text.slice(g.ch),O);else{var Y=d(1,v.length-1);Y.push(new Ar(F+C.text.slice(g.ch),O,i)),c(C,C.text.slice(0,h.ch)+v[0],s(0)),e.insert(h.line+1,Y)}else if(v.length==1)c(C,C.text.slice(0,h.ch)+v[0]+_.text.slice(g.ch),s(0)),e.remove(h.line+1,B);else{c(C,C.text.slice(0,h.ch)+v[0],s(0)),c(_,F+_.text.slice(g.ch),O);var ee=d(1,v.length-1);B>1&&e.remove(h.line+1,B-1),e.insert(h.line+1,ee)}vt(e,"change",e,t)}function qn(e,t,a){function i(s,c,d){if(s.linked)for(var h=0;h<s.linked.length;++h){var g=s.linked[h];if(g.doc!=c){var v=d&&g.sharedHist;a&&!v||(t(g.doc,v),i(g.doc,s,v))}}}i(e,null,!0)}function ec(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Fs(e),Ks(e),tc(e),e.options.direction=t.direction,e.options.lineWrapping||Ss(e),e.options.mode=t.modeOption,Nt(e)}function tc(e){(e.doc.direction=="rtl"?K:Pe)(e.display.lineDiv,"CodeMirror-rtl")}function mm(e){Ht(e,function(){tc(e),Nt(e)})}function Ca(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Xs(e,t){var a={from:mt(t.from),to:jn(t),text:Tn(e,t.from,t.to)};return ic(e,a,t.from.line,t.to.line+1),qn(e,function(i){return ic(i,a,t.from.line,t.to.line+1)},!0),a}function nc(e){for(;e.length;){var t=be(e);if(t.ranges)e.pop();else break}}function vm(e,t){if(t)return nc(e.done),be(e.done);if(e.done.length&&!be(e.done).ranges)return be(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),be(e.done)}function rc(e,t,a,i){var s=e.history;s.undone.length=0;var c=+new Date,d,h;if((s.lastOp==i||s.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&s.lastModTime>c-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(d=vm(s,s.lastOp==i)))h=be(d.changes),re(t.from,t.to)==0&&re(t.from,h.to)==0?h.to=jn(t):d.changes.push(Xs(e,t));else{var g=be(s.done);for((!g||!g.ranges)&&Ta(e.sel,s.done),d={changes:[Xs(e,t)],generation:s.generation},s.done.push(d);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(a),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=c,s.lastOp=s.lastSelOp=i,s.lastOrigin=s.lastSelOrigin=t.origin,h||et(e,"historyAdded")}function ym(e,t,a,i){var s=t.charAt(0);return s=="*"||s=="+"&&a.ranges.length==i.ranges.length&&a.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function bm(e,t,a,i){var s=e.history,c=i&&i.origin;a==s.lastSelOp||c&&s.lastSelOrigin==c&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==c||ym(e,c,be(s.done),t))?s.done[s.done.length-1]=t:Ta(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=c,s.lastSelOp=a,i&&i.clearRedo!==!1&&nc(s.undone)}function Ta(e,t){var a=be(t);a&&a.ranges&&a.equals(e)||t.push(e)}function ic(e,t,a,i){var s=t["spans_"+e.id],c=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,i),function(d){d.markedSpans&&((s||(s=t["spans_"+e.id]={}))[c]=d.markedSpans),++c})}function xm(e){if(!e)return null;for(var t,a=0;a<e.length;++a)e[a].marker.explicitlyCleared?t||(t=e.slice(0,a)):t&&t.push(e[a]);return t?t.length?t:null:e}function wm(e,t){var a=t["spans_"+e.id];if(!a)return null;for(var i=[],s=0;s<t.text.length;++s)i.push(xm(a[s]));return i}function ac(e,t){var a=wm(e,t),i=bs(e,t);if(!a)return i;if(!i)return a;for(var s=0;s<a.length;++s){var c=a[s],d=i[s];if(c&&d)e:for(var h=0;h<d.length;++h){for(var g=d[h],v=0;v<c.length;++v)if(c[v].marker==g.marker)continue e;c.push(g)}else d&&(a[s]=d)}return a}function Pr(e,t,a){for(var i=[],s=0;s<e.length;++s){var c=e[s];if(c.ranges){i.push(a?Yt.prototype.deepCopy.call(c):c);continue}var d=c.changes,h=[];i.push({changes:h});for(var g=0;g<d.length;++g){var v=d[g],C=void 0;if(h.push({from:v.from,to:v.to,text:v.text}),t)for(var _ in v)(C=_.match(/^spans_(\d+)$/))&&we(t,Number(C[1]))>-1&&(be(h)[_]=v[_],delete v[_])}}return i}function Ys(e,t,a,i){if(i){var s=e.anchor;if(a){var c=re(t,s)<0;c!=re(a,s)<0?(s=t,t=a):c!=re(t,a)<0&&(t=a)}return new Be(s,t)}else return new Be(a||t,t)}function _a(e,t,a,i,s){s==null&&(s=e.cm&&(e.cm.display.shift||e.extend)),Lt(e,new Yt([Ys(e.sel.primary(),t,a,s)],0),i)}function sc(e,t,a){for(var i=[],s=e.cm&&(e.cm.display.shift||e.extend),c=0;c<e.sel.ranges.length;c++)i[c]=Ys(e.sel.ranges[c],t[c],null,s);var d=hn(e.cm,i,e.sel.primIndex);Lt(e,d,a)}function Js(e,t,a,i){var s=e.sel.ranges.slice(0);s[t]=a,Lt(e,hn(e.cm,s,e.sel.primIndex),i)}function oc(e,t,a,i){Lt(e,Wn(t,a),i)}function km(e,t,a){var i={ranges:t.ranges,update:function(s){this.ranges=[];for(var c=0;c<s.length;c++)this.ranges[c]=new Be(Ce(e,s[c].anchor),Ce(e,s[c].head))},origin:a&&a.origin};return et(e,"beforeSelectionChange",e,i),e.cm&&et(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?hn(e.cm,i.ranges,i.ranges.length-1):t}function lc(e,t,a){var i=e.history.done,s=be(i);s&&s.ranges?(i[i.length-1]=t,La(e,t,a)):Lt(e,t,a)}function Lt(e,t,a){La(e,t,a),bm(e,e.sel,e.cm?e.cm.curOp.id:NaN,a)}function La(e,t,a){(Bt(e,"beforeSelectionChange")||e.cm&&Bt(e.cm,"beforeSelectionChange"))&&(t=km(e,t,a));var i=a&&a.bias||(re(t.primary().head,e.sel.primary().head)<0?-1:1);uc(e,fc(e,t,i,!0)),!(a&&a.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Mr(e.cm)}function uc(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,tn(e.cm)),vt(e,"cursorActivity",e))}function cc(e){uc(e,fc(e,e.sel,null,!1))}function fc(e,t,a,i){for(var s,c=0;c<t.ranges.length;c++){var d=t.ranges[c],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[c],g=Ea(e,d.anchor,h&&h.anchor,a,i),v=d.head==d.anchor?g:Ea(e,d.head,h&&h.head,a,i);(s||g!=d.anchor||v!=d.head)&&(s||(s=t.ranges.slice(0,c)),s[c]=new Be(g,v))}return s?hn(e.cm,s,t.primIndex):t}function zr(e,t,a,i,s){var c=ce(e,t.line);if(c.markedSpans)for(var d=0;d<c.markedSpans.length;++d){var h=c.markedSpans[d],g=h.marker,v="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,C="selectRight"in g?!g.selectRight:g.inclusiveRight;if((h.from==null||(v?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(C?h.to>=t.ch:h.to>t.ch))){if(s&&(et(g,"beforeCursorEnter"),g.explicitlyCleared))if(c.markedSpans){--d;continue}else break;if(!g.atomic)continue;if(a){var _=g.find(i<0?1:-1),F=void 0;if((i<0?C:v)&&(_=dc(e,_,-i,_&&_.line==t.line?c:null)),_&&_.line==t.line&&(F=re(_,a))&&(i<0?F<0:F>0))return zr(e,_,t,i,s)}var O=g.find(i<0?-1:1);return(i<0?v:C)&&(O=dc(e,O,i,O.line==t.line?c:null)),O?zr(e,O,t,i,s):null}}return t}function Ea(e,t,a,i,s){var c=i||1,d=zr(e,t,a,c,s)||!s&&zr(e,t,a,c,!0)||zr(e,t,a,-c,s)||!s&&zr(e,t,a,-c,!0);return d||(e.cantEdit=!0,P(e.first,0))}function dc(e,t,a,i){return a<0&&t.ch==0?t.line>e.first?Ce(e,P(t.line-1)):null:a>0&&t.ch==(i||ce(e,t.line)).text.length?t.line<e.first+e.size-1?P(t.line+1,0):null:new P(t.line,t.ch+a)}function hc(e){e.setSelection(P(e.firstLine(),0),P(e.lastLine()),ft)}function pc(e,t,a){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return a&&(i.update=function(s,c,d,h){s&&(i.from=Ce(e,s)),c&&(i.to=Ce(e,c)),d&&(i.text=d),h!==void 0&&(i.origin=h)}),et(e,"beforeChange",e,i),e.cm&&et(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Br(e,t,a){if(e.cm){if(!e.cm.curOp)return yt(e.cm,Br)(e,t,a);if(e.cm.state.suppressEdits)return}if(!((Bt(e,"beforeChange")||e.cm&&Bt(e.cm,"beforeChange"))&&(t=pc(e,t,!0),!t))){var i=au&&!a&&bg(e,t.from,t.to);if(i)for(var s=i.length-1;s>=0;--s)gc(e,{from:i[s].from,to:i[s].to,text:s?[""]:t.text,origin:t.origin});else gc(e,t)}}function gc(e,t){if(!(t.text.length==1&&t.text[0]==""&&re(t.from,t.to)==0)){var a=Gs(e,t);rc(e,t,a,e.cm?e.cm.curOp.id:NaN),_i(e,t,a,bs(e,t));var i=[];qn(e,function(s,c){!c&&we(i,s.history)==-1&&(bc(s.history,t),i.push(s.history)),_i(s,t,null,bs(s,t))})}}function Ia(e,t,a){var i=e.cm&&e.cm.state.suppressEdits;if(!(i&&!a)){for(var s=e.history,c,d=e.sel,h=t=="undo"?s.done:s.undone,g=t=="undo"?s.undone:s.done,v=0;v<h.length&&(c=h[v],!(a?c.ranges&&!c.equals(e.sel):!c.ranges));v++);if(v!=h.length){for(s.lastOrigin=s.lastSelOrigin=null;;)if(c=h.pop(),c.ranges){if(Ta(c,g),a&&!c.equals(e.sel)){Lt(e,c,{clearRedo:!1});return}d=c}else if(i){h.push(c);return}else break;var C=[];Ta(d,g),g.push({changes:C,generation:s.generation}),s.generation=c.generation||++s.maxGeneration;for(var _=Bt(e,"beforeChange")||e.cm&&Bt(e.cm,"beforeChange"),F=function(U){var Y=c.changes[U];if(Y.origin=t,_&&!pc(e,Y,!1))return h.length=0,{};C.push(Xs(e,Y));var ee=U?Gs(e,Y):be(h);_i(e,Y,ee,ac(e,Y)),!U&&e.cm&&e.cm.scrollIntoView({from:Y.from,to:jn(Y)});var ae=[];qn(e,function(te,le){!le&&we(ae,te.history)==-1&&(bc(te.history,Y),ae.push(te.history)),_i(te,Y,null,ac(te,Y))})},O=c.changes.length-1;O>=0;--O){var B=F(O);if(B)return B.v}}}}function mc(e,t){if(t!=0&&(e.first+=t,e.sel=new Yt(St(e.sel.ranges,function(s){return new Be(P(s.anchor.line+t,s.anchor.ch),P(s.head.line+t,s.head.ch))}),e.sel.primIndex),e.cm)){Nt(e.cm,e.first,e.first-t,t);for(var a=e.cm.display,i=a.viewFrom;i<a.viewTo;i++)Bn(e.cm,i,"gutter")}}function _i(e,t,a,i){if(e.cm&&!e.cm.curOp)return yt(e.cm,_i)(e,t,a,i);if(t.to.line<e.first){mc(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var s=t.text.length-1-(e.first-t.from.line);mc(e,s),t={from:P(e.first,0),to:P(t.to.line+s,t.to.ch),text:[be(t.text)],origin:t.origin}}var c=e.lastLine();t.to.line>c&&(t={from:t.from,to:P(c,ce(e,c).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Tn(e,t.from,t.to),a||(a=Gs(e,t)),e.cm?Sm(e.cm,t,i):Vs(e,t,i),La(e,a,ft),e.cantEdit&&Ea(e,P(e.firstLine(),0))&&(e.cantEdit=!1)}}function Sm(e,t,a){var i=e.doc,s=e.display,c=t.from,d=t.to,h=!1,g=c.line;e.options.lineWrapping||(g=b(fn(ce(i,c.line))),i.iter(g,d.line+1,function(O){if(O==s.maxLine)return h=!0,!0})),i.sel.contains(t.from,t.to)>-1&&tn(e),Vs(i,t,a,Ru(e)),e.options.lineWrapping||(i.iter(g,c.line+t.text.length,function(O){var B=da(O);B>s.maxLineLength&&(s.maxLine=O,s.maxLineLength=B,s.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),dg(i,c.line),Si(e,400);var v=t.text.length-(d.line-c.line)-1;t.full?Nt(e):c.line==d.line&&t.text.length==1&&!Zu(e.doc,t)?Bn(e,c.line,"text"):Nt(e,c.line,d.line+1,v);var C=Bt(e,"changes"),_=Bt(e,"change");if(_||C){var F={from:c,to:d,text:t.text,removed:t.removed,origin:t.origin};_&&vt(e,"change",e,F),C&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(F)}e.display.selForContextMenu=null}function Hr(e,t,a,i,s){var c;i||(i=a),re(i,a)<0&&(c=[i,a],a=c[0],i=c[1]),typeof t=="string"&&(t=e.splitLines(t)),Br(e,{from:a,to:i,text:t,origin:s})}function vc(e,t,a,i){a<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function yc(e,t,a,i){for(var s=0;s<e.length;++s){var c=e[s],d=!0;if(c.ranges){c.copied||(c=e[s]=c.deepCopy(),c.copied=!0);for(var h=0;h<c.ranges.length;h++)vc(c.ranges[h].anchor,t,a,i),vc(c.ranges[h].head,t,a,i);continue}for(var g=0;g<c.changes.length;++g){var v=c.changes[g];if(a<v.from.line)v.from=P(v.from.line+i,v.from.ch),v.to=P(v.to.line+i,v.to.ch);else if(t<=v.to.line){d=!1;break}}d||(e.splice(0,s+1),s=0)}}function bc(e,t){var a=t.from.line,i=t.to.line,s=t.text.length-(i-a)-1;yc(e.done,a,i,s),yc(e.undone,a,i,s)}function Li(e,t,a,i){var s=t,c=t;return typeof t=="number"?c=ce(e,Yl(e,t)):s=b(t),s==null?null:(i(c,s)&&e.cm&&Bn(e.cm,s,a),c)}function Ei(e){this.lines=e,this.parent=null;for(var t=0,a=0;a<e.length;++a)e[a].parent=this,t+=e[a].height;this.height=t}Ei.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var a=e,i=e+t;a<i;++a){var s=this.lines[a];this.height-=s.height,Cg(s),vt(s,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,a){this.height+=a,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,a){for(var i=e+t;e<i;++e)if(a(this.lines[e]))return!0}};function Ii(e){this.children=e;for(var t=0,a=0,i=0;i<e.length;++i){var s=e[i];t+=s.chunkSize(),a+=s.height,s.parent=this}this.size=t,this.height=a,this.parent=null}Ii.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var a=0;a<this.children.length;++a){var i=this.children[a],s=i.chunkSize();if(e<s){var c=Math.min(t,s-e),d=i.height;if(i.removeInner(e,c),this.height-=d-i.height,s==c&&(this.children.splice(a--,1),i.parent=null),(t-=c)==0)break;e=0}else e-=s}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ei))){var h=[];this.collapse(h),this.children=[new Ei(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,a){this.size+=t.length,this.height+=a;for(var i=0;i<this.children.length;++i){var s=this.children[i],c=s.chunkSize();if(e<=c){if(s.insertInner(e,t,a),s.lines&&s.lines.length>50){for(var d=s.lines.length%25+25,h=d;h<s.lines.length;){var g=new Ei(s.lines.slice(h,h+=25));s.height-=g.height,this.children.splice(++i,0,g),g.parent=this}s.lines=s.lines.slice(0,d),this.maybeSpill()}break}e-=c}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),a=new Ii(t);if(e.parent){e.size-=a.size,e.height-=a.height;var s=we(e.parent.children,e);e.parent.children.splice(s+1,0,a)}else{var i=new Ii(e.children);i.parent=e,e.children=[i,a],e=i}a.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,a){for(var i=0;i<this.children.length;++i){var s=this.children[i],c=s.chunkSize();if(e<c){var d=Math.min(t,c-e);if(s.iterN(e,d,a))return!0;if((t-=d)==0)break;e=0}else e-=c}}};var Ai=function(e,t,a){if(a)for(var i in a)a.hasOwnProperty(i)&&(this[i]=a[i]);this.doc=e,this.node=t};Ai.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,a=this.line,i=b(a);if(!(i==null||!t)){for(var s=0;s<t.length;++s)t[s]==this&&t.splice(s--,1);t.length||(a.widgets=null);var c=mi(this);Xt(a,Math.max(0,a.height-c)),e&&(Ht(e,function(){xc(e,a,-c),Bn(e,i,"widget")}),vt(e,"lineWidgetCleared",e,this,i))}},Ai.prototype.changed=function(){var e=this,t=this.height,a=this.doc.cm,i=this.line;this.height=null;var s=mi(this)-t;s&&(zn(this.doc,i)||Xt(i,i.height+s),a&&Ht(a,function(){a.curOp.forceUpdate=!0,xc(a,i,s),vt(a,"lineWidgetChanged",a,e,b(i))}))},sn(Ai);function xc(e,t,a){Ln(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Bs(e,a)}function Cm(e,t,a,i){var s=new Ai(e,a,i),c=e.cm;return c&&s.noHScroll&&(c.display.alignWidgets=!0),Li(e,t,"widget",function(d){var h=d.widgets||(d.widgets=[]);if(s.insertAt==null?h.push(s):h.splice(Math.min(h.length,Math.max(0,s.insertAt)),0,s),s.line=d,c&&!zn(e,d)){var g=Ln(d)<e.scrollTop;Xt(d,d.height+mi(s)),g&&Bs(c,s.height),c.curOp.forceUpdate=!0}return!0}),c&&vt(c,"lineWidgetAdded",c,s,typeof t=="number"?t:b(t)),s}var wc=0,Un=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++wc};Un.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&lr(e),Bt(this,"clear")){var a=this.find();a&&vt(this,"clear",a.from,a.to)}for(var i=null,s=null,c=0;c<this.lines.length;++c){var d=this.lines[c],h=hi(d.markedSpans,this);e&&!this.collapsed?Bn(e,b(d),"text"):e&&(h.to!=null&&(s=b(d)),h.from!=null&&(i=b(d))),d.markedSpans=gg(d.markedSpans,h),h.from==null&&this.collapsed&&!zn(this.doc,d)&&e&&Xt(d,Nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var v=fn(this.lines[g]),C=da(v);C>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=C,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Nt(e,i,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&cc(e.doc)),e&&vt(e,"markerCleared",e,this,i,s),t&&ur(e),this.parent&&this.parent.clear()}},Un.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var a,i,s=0;s<this.lines.length;++s){var c=this.lines[s],d=hi(c.markedSpans,this);if(d.from!=null&&(a=P(t?c:b(c),d.from),e==-1))return a;if(d.to!=null&&(i=P(t?c:b(c),d.to),e==1))return i}return a&&{from:a,to:i}},Un.prototype.changed=function(){var e=this,t=this.find(-1,!0),a=this,i=this.doc.cm;!t||!i||Ht(i,function(){var s=t.line,c=b(t.line),d=Ls(i,c);if(d&&(Lu(d),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!zn(a.doc,s)&&a.height!=null){var h=a.height;a.height=null;var g=mi(a)-h;g&&Xt(s,s.height+g)}vt(i,"markerChanged",i,e)})},Un.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||we(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Un.prototype.detachLine=function(e){if(this.lines.splice(we(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},sn(Un);function Wr(e,t,a,i,s){if(i&&i.shared)return Tm(e,t,a,i,s);if(e.cm&&!e.cm.curOp)return yt(e.cm,Wr)(e,t,a,i,s);var c=new Un(e,s),d=re(t,a);if(i&&ke(i,c,!1),d>0||d==0&&c.clearWhenEmpty!==!1)return c;if(c.replacedWith&&(c.collapsed=!0,c.widgetNode=J("span",[c.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||c.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(c.widgetNode.insertLeft=!0)),c.collapsed){if(fu(e,t.line,t,a,c)||t.line!=a.line&&fu(e,a.line,t,a,c))throw new Error("Inserting collapsed marker partially overlapping an existing one");pg()}c.addToHistory&&rc(e,{from:t,to:a,origin:"markText"},e.sel,NaN);var h=t.line,g=e.cm,v;if(e.iter(h,a.line+1,function(_){g&&c.collapsed&&!g.options.lineWrapping&&fn(_)==g.display.maxLine&&(v=!0),c.collapsed&&h!=t.line&&Xt(_,0),mg(_,new la(c,h==t.line?t.ch:null,h==a.line?a.ch:null),e.cm&&e.cm.curOp),++h}),c.collapsed&&e.iter(t.line,a.line+1,function(_){zn(e,_)&&Xt(_,0)}),c.clearOnEnter&&me(c,"beforeCursorEnter",function(){return c.clear()}),c.readOnly&&(hg(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),c.collapsed&&(c.id=++wc,c.atomic=!0),g){if(v&&(g.curOp.updateMaxLine=!0),c.collapsed)Nt(g,t.line,a.line+1);else if(c.className||c.startStyle||c.endStyle||c.css||c.attributes||c.title)for(var C=t.line;C<=a.line;C++)Bn(g,C,"text");c.atomic&&cc(g.doc),vt(g,"markerAdded",g,c)}return c}var Di=function(e,t){this.markers=e,this.primary=t;for(var a=0;a<e.length;++a)e[a].parent=this};Di.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();vt(this,"clear")}},Di.prototype.find=function(e,t){return this.primary.find(e,t)},sn(Di);function Tm(e,t,a,i,s){i=ke(i),i.shared=!1;var c=[Wr(e,t,a,i,s)],d=c[0],h=i.widgetNode;return qn(e,function(g){h&&(i.widgetNode=h.cloneNode(!0)),c.push(Wr(g,Ce(g,t),Ce(g,a),i,s));for(var v=0;v<g.linked.length;++v)if(g.linked[v].isParent)return;d=be(c)}),new Di(c,d)}function kc(e){return e.findMarks(P(e.first,0),e.clipPos(P(e.lastLine())),function(t){return t.parent})}function _m(e,t){for(var a=0;a<t.length;a++){var i=t[a],s=i.find(),c=e.clipPos(s.from),d=e.clipPos(s.to);if(re(c,d)){var h=Wr(e,c,d,i.primary,i.primary.type);i.markers.push(h),h.parent=i}}}function Lm(e){for(var t=function(i){var s=e[i],c=[s.primary.doc];qn(s.primary.doc,function(g){return c.push(g)});for(var d=0;d<s.markers.length;d++){var h=s.markers[d];we(c,h.doc)==-1&&(h.parent=null,s.markers.splice(d--,1))}},a=0;a<e.length;a++)t(a)}var Em=0,Ft=function(e,t,a,i,s){if(!(this instanceof Ft))return new Ft(e,t,a,i,s);a==null&&(a=0),Ii.call(this,[new Ei([new Ar("",null)])]),this.first=a,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=a;var c=P(a,0);this.sel=Wn(c),this.history=new Ca(null),this.id=++Em,this.modeOption=t,this.lineSep=i,this.direction=s=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Vs(this,{from:c,to:c,text:e}),Lt(this,Wn(c),ft)};Ft.prototype=Zn(Ii.prototype,{constructor:Ft,iter:function(e,t,a){a?this.iterN(e-this.first,t-e,a):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var a=0,i=0;i<t.length;++i)a+=t[i].height;this.insertInner(e-this.first,t,a)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=fi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:bt(function(e){var t=P(this.first,0),a=this.first+this.size-1;Br(this,{from:t,to:P(a,ce(this,a).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&bi(this.cm,0,0),Lt(this,Wn(t),ft)}),replaceRange:function(e,t,a,i){t=Ce(this,t),a=a?Ce(this,a):t,Hr(this,e,t,a,i)},getRange:function(e,t,a){var i=Tn(this,Ce(this,e),Ce(this,t));return a===!1?i:a===""?i.join(""):i.join(a||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(q(this,e))return ce(this,e)},getLineNumber:function(e){return b(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ce(this,e)),fn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ce(this,e)},getCursor:function(e){var t=this.sel.primary(),a;return e==null||e=="head"?a=t.head:e=="anchor"?a=t.anchor:e=="end"||e=="to"||e===!1?a=t.to():a=t.from(),a},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:bt(function(e,t,a){oc(this,Ce(this,typeof e=="number"?P(e,t||0):e),null,a)}),setSelection:bt(function(e,t,a){oc(this,Ce(this,e),Ce(this,t||e),a)}),extendSelection:bt(function(e,t,a){_a(this,Ce(this,e),t&&Ce(this,t),a)}),extendSelections:bt(function(e,t){sc(this,Jl(this,e),t)}),extendSelectionsBy:bt(function(e,t){var a=St(this.sel.ranges,e);sc(this,Jl(this,a),t)}),setSelections:bt(function(e,t,a){if(e.length){for(var i=[],s=0;s<e.length;s++)i[s]=new Be(Ce(this,e[s].anchor),Ce(this,e[s].head||e[s].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Lt(this,hn(this.cm,i,t),a)}}),addSelection:bt(function(e,t,a){var i=this.sel.ranges.slice(0);i.push(new Be(Ce(this,e),Ce(this,t||e))),Lt(this,hn(this.cm,i,i.length-1),a)}),getSelection:function(e){for(var t=this.sel.ranges,a,i=0;i<t.length;i++){var s=Tn(this,t[i].from(),t[i].to());a=a?a.concat(s):s}return e===!1?a:a.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],a=this.sel.ranges,i=0;i<a.length;i++){var s=Tn(this,a[i].from(),a[i].to());e!==!1&&(s=s.join(e||this.lineSeparator())),t[i]=s}return t},replaceSelection:function(e,t,a){for(var i=[],s=0;s<this.sel.ranges.length;s++)i[s]=e;this.replaceSelections(i,t,a||"+input")},replaceSelections:bt(function(e,t,a){for(var i=[],s=this.sel,c=0;c<s.ranges.length;c++){var d=s.ranges[c];i[c]={from:d.from(),to:d.to(),text:this.splitLines(e[c]),origin:a}}for(var h=t&&t!="end"&&gm(this,i,t),g=i.length-1;g>=0;g--)Br(this,i[g]);h?lc(this,h):this.cm&&Mr(this.cm)}),undo:bt(function(){Ia(this,"undo")}),redo:bt(function(){Ia(this,"redo")}),undoSelection:bt(function(){Ia(this,"undo",!0)}),redoSelection:bt(function(){Ia(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,a=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var s=0;s<e.undone.length;s++)e.undone[s].ranges||++a;return{undo:t,redo:a}},clearHistory:function(){var e=this;this.history=new Ca(this.history),qn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Pr(this.history.done),undone:Pr(this.history.undone)}},setHistory:function(e){var t=this.history=new Ca(this.history);t.done=Pr(e.done.slice(0),null,!0),t.undone=Pr(e.undone.slice(0),null,!0)},setGutterMarker:bt(function(e,t,a){return Li(this,e,"gutter",function(i){var s=i.gutterMarkers||(i.gutterMarkers={});return s[t]=a,!a&&pe(s)&&(i.gutterMarkers=null),!0})}),clearGutter:bt(function(e){var t=this;this.iter(function(a){a.gutterMarkers&&a.gutterMarkers[e]&&Li(t,a,"gutter",function(){return a.gutterMarkers[e]=null,pe(a.gutterMarkers)&&(a.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!q(this,e)||(t=e,e=ce(this,e),!e))return null}else if(t=b(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:bt(function(e,t,a){return Li(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[s])i[s]=a;else{if(ie(a).test(i[s]))return!1;i[s]+=" "+a}return!0})}),removeLineClass:bt(function(e,t,a){return Li(this,e,t=="gutter"?"gutter":"class",function(i){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",c=i[s];if(c)if(a==null)i[s]=null;else{var d=c.match(ie(a));if(!d)return!1;var h=d.index+d[0].length;i[s]=c.slice(0,d.index)+(!d.index||h==c.length?"":" ")+c.slice(h)||null}else return!1;return!0})}),addLineWidget:bt(function(e,t,a){return Cm(this,e,t,a)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,a){return Wr(this,Ce(this,e),Ce(this,t),a,a&&a.type||"range")},setBookmark:function(e,t){var a={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Ce(this,e),Wr(this,e,e,a,"bookmark")},findMarksAt:function(e){e=Ce(this,e);var t=[],a=ce(this,e.line).markedSpans;if(a)for(var i=0;i<a.length;++i){var s=a[i];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker.parent||s.marker)}return t},findMarks:function(e,t,a){e=Ce(this,e),t=Ce(this,t);var i=[],s=e.line;return this.iter(e.line,t.line+1,function(c){var d=c.markedSpans;if(d)for(var h=0;h<d.length;h++){var g=d[h];!(g.to!=null&&s==e.line&&e.ch>=g.to||g.from==null&&s!=e.line||g.from!=null&&s==t.line&&g.from>=t.ch)&&(!a||a(g.marker))&&i.push(g.marker.parent||g.marker)}++s}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var a=t.markedSpans;if(a)for(var i=0;i<a.length;++i)a[i].from!=null&&e.push(a[i].marker)}),e},posFromIndex:function(e){var t,a=this.first,i=this.lineSeparator().length;return this.iter(function(s){var c=s.text.length+i;if(c>e)return t=e,!0;e-=c,++a}),Ce(this,P(a,t))},indexFromPos:function(e){e=Ce(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var a=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+a}),t},copy:function(e){var t=new Ft(fi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,a=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<a&&(a=e.to);var i=new Ft(fi(this,t,a),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],_m(i,kc(this)),i},unlinkDoc:function(e){if(e instanceof Ye&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var a=this.linked[t];if(a.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Lm(kc(this));break}}if(e.history==this.history){var i=[e.id];qn(e,function(s){return i.push(s.id)},!0),e.history=new Ca(null),e.history.done=Pr(this.history.done,i),e.history.undone=Pr(this.history.undone,i)}},iterLinkedDocs:function(e){qn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):nn(e)},lineSeparator:function(){return this.lineSep||`
|
|
11
|
+
`},setDirection:bt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&mm(this.cm))})}),Ft.prototype.eachLine=Ft.prototype.iter;var Sc=0;function Im(e){var t=this;if(Cc(t),!(tt(t,e)||En(t.display,e))){_t(e),m&&(Sc=+new Date);var a=ir(t,e,!0),i=e.dataTransfer.files;if(!(!a||t.isReadOnly()))if(i&&i.length&&window.FileReader&&window.File)for(var s=i.length,c=Array(s),d=0,h=function(){++d==s&&yt(t,function(){a=Ce(t.doc,a);var O={from:a,to:a,text:t.doc.splitLines(c.filter(function(B){return B!=null}).join(t.doc.lineSeparator())),origin:"paste"};Br(t.doc,O),lc(t.doc,Wn(Ce(t.doc,a),Ce(t.doc,jn(O))))})()},g=function(O,B){if(t.options.allowDropFileTypes&&we(t.options.allowDropFileTypes,O.type)==-1){h();return}var U=new FileReader;U.onerror=function(){return h()},U.onload=function(){var Y=U.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Y)){h();return}c[B]=Y,h()},U.readAsText(O)},v=0;v<i.length;v++)g(i[v],v);else{if(t.state.draggingText&&t.doc.sel.contains(a)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var C=e.dataTransfer.getData("Text");if(C){var _;if(t.state.draggingText&&!t.state.draggingText.copy&&(_=t.listSelections()),La(t.doc,Wn(a,a)),_)for(var F=0;F<_.length;++F)Hr(t.doc,"",_[F].anchor,_[F].head,"drag");t.replaceSelection(C,"around","paste"),t.display.input.focus()}}catch{}}}}function Am(e,t){if(m&&(!e.state.draggingText||+new Date-Sc<100)){Rn(t);return}if(!(tt(e,t)||En(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!D)){var a=w("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",z&&(a.width=a.height=1,e.display.wrapper.appendChild(a),a._top=a.offsetTop),t.dataTransfer.setDragImage(a,0,0),z&&a.parentNode.removeChild(a)}}function Dm(e,t){var a=ir(e,t);if(a){var i=document.createDocumentFragment();Rs(e,a,i),e.display.dragCursor||(e.display.dragCursor=w("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Q(e.display.dragCursor,i)}}function Cc(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Tc(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),a=[],i=0;i<t.length;i++){var s=t[i].CodeMirror;s&&a.push(s)}a.length&&a[0].operation(function(){for(var c=0;c<a.length;c++)e(a[c])})}}var _c=!1;function Om(){_c||(Nm(),_c=!0)}function Nm(){var e;me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Tc(Fm)},100))}),me(window,"blur",function(){return Tc(Rr)})}function Fm(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Gn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Oi=0;Oi<10;Oi++)Gn[Oi+48]=Gn[Oi+96]=String(Oi);for(var Aa=65;Aa<=90;Aa++)Gn[Aa]=String.fromCharCode(Aa);for(var Ni=1;Ni<=12;Ni++)Gn[Ni+111]=Gn[Ni+63235]="F"+Ni;var An={};An.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},An.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},An.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},An.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},An.default=ne?An.macDefault:An.pcDefault;function Rm(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var a,i,s,c,d=0;d<t.length-1;d++){var h=t[d];if(/^(cmd|meta|m)$/i.test(h))c=!0;else if(/^a(lt)?$/i.test(h))a=!0;else if(/^(c|ctrl|control)$/i.test(h))i=!0;else if(/^s(hift)?$/i.test(h))s=!0;else throw new Error("Unrecognized modifier name: "+h)}return a&&(e="Alt-"+e),i&&(e="Ctrl-"+e),c&&(e="Cmd-"+e),s&&(e="Shift-"+e),e}function Mm(e){var t={};for(var a in e)if(e.hasOwnProperty(a)){var i=e[a];if(/^(name|fallthrough|(de|at)tach)$/.test(a))continue;if(i=="..."){delete e[a];continue}for(var s=St(a.split(" "),Rm),c=0;c<s.length;c++){var d=void 0,h=void 0;c==s.length-1?(h=s.join(" "),d=i):(h=s.slice(0,c+1).join(" "),d="...");var g=t[h];if(!g)t[h]=d;else if(g!=d)throw new Error("Inconsistent bindings for "+h)}delete e[a]}for(var v in t)e[v]=t[v];return e}function jr(e,t,a,i){t=Da(t);var s=t.call?t.call(e,i):t[e];if(s===!1)return"nothing";if(s==="...")return"multi";if(s!=null&&a(s))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return jr(e,t.fallthrough,a,i);for(var c=0;c<t.fallthrough.length;c++){var d=jr(e,t.fallthrough[c],a,i);if(d)return d}}}function Lc(e){var t=typeof e=="string"?e:Gn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ec(e,t,a){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(Oe?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(Oe?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!a&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function Ic(e,t){if(z&&e.keyCode==34&&e.char)return!1;var a=Gn[e.keyCode];return a==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(a=e.code),Ec(a,e,t))}function Da(e){return typeof e=="string"?An[e]:e}function qr(e,t){for(var a=e.doc.sel.ranges,i=[],s=0;s<a.length;s++){for(var c=t(a[s]);i.length&&re(c.from,be(i).to)<=0;){var d=i.pop();if(re(d.from,c.from)<0){c.from=d.from;break}}i.push(c)}Ht(e,function(){for(var h=i.length-1;h>=0;h--)Hr(e.doc,"",i[h].from,i[h].to,"+delete");Mr(e)})}function Qs(e,t,a){var i=zt(e.text,t+a,a);return i<0||i>e.text.length?null:i}function Zs(e,t,a){var i=Qs(e,t.ch,a);return i==null?null:new P(t.line,i,a<0?"after":"before")}function eo(e,t,a,i,s){if(e){t.doc.direction=="rtl"&&(s=-s);var c=$e(a,t.doc.direction);if(c){var d=s<0?be(c):c[0],h=s<0==(d.level==1),g=h?"after":"before",v;if(d.level>0||t.doc.direction=="rtl"){var C=Or(t,a);v=s<0?a.text.length-1:0;var _=wn(t,C,v).top;v=en(function(F){return wn(t,C,F).top==_},s<0==(d.level==1)?d.from:d.to-1,v),g=="before"&&(v=Qs(a,v,1))}else v=s<0?d.to:d.from;return new P(i,v,g)}}return new P(i,s<0?a.text.length:0,s<0?"before":"after")}function $m(e,t,a,i){var s=$e(t,e.doc.direction);if(!s)return Zs(t,a,i);a.ch>=t.text.length?(a.ch=t.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var c=Fn(s,a.ch,a.sticky),d=s[c];if(e.doc.direction=="ltr"&&d.level%2==0&&(i>0?d.to>a.ch:d.from<a.ch))return Zs(t,a,i);var h=function(ee,ae){return Qs(t,ee instanceof P?ee.ch:ee,ae)},g,v=function(ee){return e.options.lineWrapping?(g=g||Or(e,t),Fu(e,t,g,ee)):{begin:0,end:t.text.length}},C=v(a.sticky=="before"?h(a,-1):a.ch);if(e.doc.direction=="rtl"||d.level==1){var _=d.level==1==i<0,F=h(a,_?1:-1);if(F!=null&&(_?F<=d.to&&F<=C.end:F>=d.from&&F>=C.begin)){var O=_?"before":"after";return new P(a.line,F,O)}}var B=function(ee,ae,te){for(var le=function(qe,xt){return xt?new P(a.line,h(qe,1),"before"):new P(a.line,qe,"after")};ee>=0&&ee<s.length;ee+=ae){var ve=s[ee],ge=ae>0==(ve.level!=1),Ae=ge?te.begin:h(te.end,-1);if(ve.from<=Ae&&Ae<ve.to||(Ae=ge?ve.from:h(ve.to,-1),te.begin<=Ae&&Ae<te.end))return le(Ae,ge)}},U=B(c+i,i,C);if(U)return U;var Y=i>0?C.end:h(C.begin,-1);return Y!=null&&!(i>0&&Y==t.text.length)&&(U=B(i>0?0:s.length-1,i,v(Y)),U)?U:null}var Fi={selectAll:hc,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ft)},killLine:function(e){return qr(e,function(t){if(t.empty()){var a=ce(e.doc,t.head.line).text.length;return t.head.ch==a&&t.head.line<e.lastLine()?{from:t.head,to:P(t.head.line+1,0)}:{from:t.head,to:P(t.head.line,a)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return qr(e,function(t){return{from:P(t.from().line,0),to:Ce(e.doc,P(t.to().line+1,0))}})},delLineLeft:function(e){return qr(e,function(t){return{from:P(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return qr(e,function(t){var a=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:a},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return qr(e,function(t){var a=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(P(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(P(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ac(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Dc(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pm(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div")},dt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:a},"div")},dt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:a},"div");return i.ch<e.getLine(i.line).search(/\S/)?Dc(e,t.head):i},dt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],a=e.listSelections(),i=e.options.tabSize,s=0;s<a.length;s++){var c=a[s].from(),d=Le(e.getLine(c.line),c.ch,i);t.push(Kt(i-d%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ht(e,function(){for(var t=e.listSelections(),a=[],i=0;i<t.length;i++)if(t[i].empty()){var s=t[i].head,c=ce(e.doc,s.line).text;if(c){if(s.ch==c.length&&(s=new P(s.line,s.ch-1)),s.ch>0)s=new P(s.line,s.ch+1),e.replaceRange(c.charAt(s.ch-1)+c.charAt(s.ch-2),P(s.line,s.ch-2),s,"+transpose");else if(s.line>e.doc.first){var d=ce(e.doc,s.line-1).text;d&&(s=new P(s.line,1),e.replaceRange(c.charAt(0)+e.doc.lineSeparator()+d.charAt(d.length-1),P(s.line-1,d.length-1),s,"+transpose"))}}a.push(new Be(s,s))}e.setSelections(a)})},newlineAndIndent:function(e){return Ht(e,function(){for(var t=e.listSelections(),a=t.length-1;a>=0;a--)e.replaceRange(e.doc.lineSeparator(),t[a].anchor,t[a].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Mr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
12
|
+
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ac(e,t){var a=ce(e.doc,t),i=fn(a);return i!=a&&(t=b(i)),eo(!0,e,i,t,1)}function Pm(e,t){var a=ce(e.doc,t),i=wg(a);return i!=a&&(t=b(i)),eo(!0,e,a,t,-1)}function Dc(e,t){var a=Ac(e,t.line),i=ce(e.doc,a.line),s=$e(i,e.doc.direction);if(!s||s[0].level==0){var c=Math.max(a.ch,i.text.search(/\S/)),d=t.line==a.line&&t.ch<=c&&t.ch;return P(a.line,d?0:c,a.sticky)}return a}function Oa(e,t,a){if(typeof t=="string"&&(t=Fi[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a&&(e.display.shift=!1),s=t(e)!=Ke}finally{e.display.shift=i,e.state.suppressEdits=!1}return s}function zm(e,t,a){for(var i=0;i<e.state.keyMaps.length;i++){var s=jr(t,e.state.keyMaps[i],a,e);if(s)return s}return e.options.extraKeys&&jr(t,e.options.extraKeys,a,e)||jr(t,e.options.keyMap,a,e)}var Bm=new ct;function Ri(e,t,a,i){var s=e.state.keySeq;if(s){if(Lc(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bm.set(50,function(){e.state.keySeq==s&&(e.state.keySeq=null,e.display.input.reset())}),Oc(e,s+" "+t,a,i))return!0}return Oc(e,t,a,i)}function Oc(e,t,a,i){var s=zm(e,t,i);return s=="multi"&&(e.state.keySeq=t),s=="handled"&&vt(e,"keyHandled",e,t,a),(s=="handled"||s=="multi")&&(_t(a),Ms(e)),!!s}function Nc(e,t){var a=Ic(t,!0);return a?t.shiftKey&&!e.state.keySeq?Ri(e,"Shift-"+a,t,function(i){return Oa(e,i,!0)})||Ri(e,a,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return Oa(e,i)}):Ri(e,a,t,function(i){return Oa(e,i)}):!1}function Hm(e,t,a){return Ri(e,"'"+a+"'",t,function(i){return Oa(e,i,!0)})}var to=null;function Fc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=M(oe(t)),!tt(t,e))){m&&k<11&&e.keyCode==27&&(e.returnValue=!1);var a=e.keyCode;t.display.shift=a==16||e.shiftKey;var i=Nc(t,e);z&&(to=i?a:null,!i&&a==88&&!sa&&(ne?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),u&&!ne&&!i&&a==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Wm(t)}}function Wm(e){var t=e.display.lineDiv;K(t,"CodeMirror-crosshair");function a(i){(i.keyCode==18||!i.altKey)&&(Pe(t,"CodeMirror-crosshair"),Tt(document,"keyup",a),Tt(document,"mouseover",a))}me(document,"keyup",a),me(document,"mouseover",a)}function Rc(e){e.keyCode==16&&(this.doc.sel.shift=!1),tt(this,e)}function Mc(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(En(t.display,e)||tt(t,e)||e.ctrlKey&&!e.altKey||ne&&e.metaKey)){var a=e.keyCode,i=e.charCode;if(z&&a==to){to=null,_t(e);return}if(!(z&&(!e.which||e.which<10)&&Nc(t,e))){var s=String.fromCharCode(i??a);s!="\b"&&(Hm(t,e,s)||t.display.input.onKeyPress(e))}}}var jm=400,no=function(e,t,a){this.time=e,this.pos=t,this.button=a};no.prototype.compare=function(e,t,a){return this.time+jm>e&&re(t,this.pos)==0&&a==this.button};var Mi,$i;function qm(e,t){var a=+new Date;return $i&&$i.compare(a,e,t)?(Mi=$i=null,"triple"):Mi&&Mi.compare(a,e,t)?($i=new no(a,e,t),Mi=null,"double"):(Mi=new no(a,e,t),$i=null,"single")}function $c(e){var t=this,a=t.display;if(!(tt(t,e)||a.activeTouch&&a.input.supportsTouch())){if(a.input.ensurePolled(),a.shift=e.shiftKey,En(a,e)){S||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(!ro(t,e)){var i=ir(t,e),s=on(e),c=i?qm(i,s):"single";Z(t).focus(),s==1&&t.state.selectingText&&t.state.selectingText(e),!(i&&Um(t,s,i,c,e))&&(s==1?i?Km(t,i,c,e):li(e)==a.scroller&&_t(e):s==2?(i&&_a(t.doc,i),setTimeout(function(){return a.input.focus()},20)):s==3&&(Re?t.display.input.onContextMenu(e):$s(t)))}}}function Um(e,t,a,i,s){var c="Click";return i=="double"?c="Double"+c:i=="triple"&&(c="Triple"+c),c=(t==1?"Left":t==2?"Middle":"Right")+c,Ri(e,Ec(c,s),s,function(d){if(typeof d=="string"&&(d=Fi[d]),!d)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=d(e,a)!=Ke}finally{e.state.suppressEdits=!1}return h})}function Gm(e,t,a){var i=e.getOption("configureMouse"),s=i?i(e,t,a):{};if(s.unit==null){var c=ue?a.shiftKey&&a.metaKey:a.altKey;s.unit=c?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(s.extend==null||e.doc.extend)&&(s.extend=e.doc.extend||a.shiftKey),s.addNew==null&&(s.addNew=ne?a.metaKey:a.ctrlKey),s.moveOnDrag==null&&(s.moveOnDrag=!(ne?a.altKey:a.ctrlKey)),s}function Km(e,t,a,i){m?setTimeout(fe(Pu,e),0):e.curOp.focus=M(oe(e));var s=Gm(e,a,i),c=e.doc.sel,d;e.options.dragDrop&&gs&&!e.isReadOnly()&&a=="single"&&(d=c.contains(t))>-1&&(re((d=c.ranges[d]).from(),t)<0||t.xRel>0)&&(re(d.to(),t)>0||t.xRel<0)?Vm(e,i,t,s):Xm(e,i,t,s)}function Vm(e,t,a,i){var s=e.display,c=!1,d=yt(e,function(v){S&&(s.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:$s(e)),Tt(s.wrapper.ownerDocument,"mouseup",d),Tt(s.wrapper.ownerDocument,"mousemove",h),Tt(s.scroller,"dragstart",g),Tt(s.scroller,"drop",d),c||(_t(v),i.addNew||_a(e.doc,a,null,null,i.extend),S&&!D||m&&k==9?setTimeout(function(){s.wrapper.ownerDocument.body.focus({preventScroll:!0}),s.input.focus()},20):s.input.focus())}),h=function(v){c=c||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},g=function(){return c=!0};S&&(s.scroller.draggable=!0),e.state.draggingText=d,d.copy=!i.moveOnDrag,me(s.wrapper.ownerDocument,"mouseup",d),me(s.wrapper.ownerDocument,"mousemove",h),me(s.scroller,"dragstart",g),me(s.scroller,"drop",d),e.state.delayingBlurEvent=!0,setTimeout(function(){return s.input.focus()},20),s.scroller.dragDrop&&s.scroller.dragDrop()}function Pc(e,t,a){if(a=="char")return new Be(t,t);if(a=="word")return e.findWordAt(t);if(a=="line")return new Be(P(t.line,0),Ce(e.doc,P(t.line+1,0)));var i=a(e,t);return new Be(i.from,i.to)}function Xm(e,t,a,i){m&&$s(e);var s=e.display,c=e.doc;_t(t);var d,h,g=c.sel,v=g.ranges;if(i.addNew&&!i.extend?(h=c.sel.contains(a),h>-1?d=v[h]:d=new Be(a,a)):(d=c.sel.primary(),h=c.sel.primIndex),i.unit=="rectangle")i.addNew||(d=new Be(a,a)),a=ir(e,t,!0,!0),h=-1;else{var C=Pc(e,a,i.unit);i.extend?d=Ys(d,C.anchor,C.head,i.extend):d=C}i.addNew?h==-1?(h=v.length,Lt(c,hn(e,v.concat([d]),h),{scroll:!1,origin:"*mouse"})):v.length>1&&v[h].empty()&&i.unit=="char"&&!i.extend?(Lt(c,hn(e,v.slice(0,h).concat(v.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),g=c.sel):Js(c,h,d,Pt):(h=0,Lt(c,new Yt([d],0),Pt),g=c.sel);var _=a;function F(te){if(re(_,te)!=0)if(_=te,i.unit=="rectangle"){for(var le=[],ve=e.options.tabSize,ge=Le(ce(c,a.line).text,a.ch,ve),Ae=Le(ce(c,te.line).text,te.ch,ve),qe=Math.min(ge,Ae),xt=Math.max(ge,Ae),Qe=Math.min(a.line,te.line),Wt=Math.min(e.lastLine(),Math.max(a.line,te.line));Qe<=Wt;Qe++){var Rt=ce(c,Qe).text,lt=ht(Rt,qe,ve);qe==xt?le.push(new Be(P(Qe,lt),P(Qe,lt))):Rt.length>lt&&le.push(new Be(P(Qe,lt),P(Qe,ht(Rt,xt,ve))))}le.length||le.push(new Be(a,a)),Lt(c,hn(e,g.ranges.slice(0,h).concat(le),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(te)}else{var Mt=d,Ct=Pc(e,te,i.unit),pt=Mt.anchor,ut;re(Ct.anchor,pt)>0?(ut=Ct.head,pt=Ir(Mt.from(),Ct.anchor)):(ut=Ct.anchor,pt=Ot(Mt.to(),Ct.head));var rt=g.ranges.slice(0);rt[h]=Ym(e,new Be(Ce(c,pt),ut)),Lt(c,hn(e,rt,h),Pt)}}var O=s.wrapper.getBoundingClientRect(),B=0;function U(te){var le=++B,ve=ir(e,te,!0,i.unit=="rectangle");if(ve)if(re(ve,_)!=0){e.curOp.focus=M(oe(e)),F(ve);var ge=xa(s,c);(ve.line>=ge.to||ve.line<ge.from)&&setTimeout(yt(e,function(){B==le&&U(te)}),150)}else{var Ae=te.clientY<O.top?-20:te.clientY>O.bottom?20:0;Ae&&setTimeout(yt(e,function(){B==le&&(s.scroller.scrollTop+=Ae,U(te))}),50)}}function Y(te){e.state.selectingText=!1,B=1/0,te&&(_t(te),s.input.focus()),Tt(s.wrapper.ownerDocument,"mousemove",ee),Tt(s.wrapper.ownerDocument,"mouseup",ae),c.history.lastSelOrigin=null}var ee=yt(e,function(te){te.buttons===0||!on(te)?Y(te):U(te)}),ae=yt(e,Y);e.state.selectingText=ae,me(s.wrapper.ownerDocument,"mousemove",ee),me(s.wrapper.ownerDocument,"mouseup",ae)}function Ym(e,t){var a=t.anchor,i=t.head,s=ce(e.doc,a.line);if(re(a,i)==0&&a.sticky==i.sticky)return t;var c=$e(s);if(!c)return t;var d=Fn(c,a.ch,a.sticky),h=c[d];if(h.from!=a.ch&&h.to!=a.ch)return t;var g=d+(h.from==a.ch==(h.level!=1)?0:1);if(g==0||g==c.length)return t;var v;if(i.line!=a.line)v=(i.line-a.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var C=Fn(c,i.ch,i.sticky),_=C-d||(i.ch-a.ch)*(h.level==1?-1:1);C==g-1||C==g?v=_<0:v=_>0}var F=c[g+(v?-1:0)],O=v==(F.level==1),B=O?F.from:F.to,U=O?"after":"before";return a.ch==B&&a.sticky==U?t:new Be(new P(a.line,B,U),i)}function zc(e,t,a,i){var s,c;if(t.touches)s=t.touches[0].clientX,c=t.touches[0].clientY;else try{s=t.clientX,c=t.clientY}catch{return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&_t(t);var d=e.display,h=d.lineDiv.getBoundingClientRect();if(c>h.bottom||!Bt(e,a))return Dt(t);c-=h.top-d.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var v=d.gutters.childNodes[g];if(v&&v.getBoundingClientRect().right>=s){var C=T(e.doc,c),_=e.display.gutterSpecs[g];return et(e,a,e,C,_.className,t),Dt(t)}}}function ro(e,t){return zc(e,t,"gutterClick",!0)}function Bc(e,t){En(e.display,t)||Jm(e,t)||tt(e,t,"contextmenu")||Re||e.display.input.onContextMenu(t)}function Jm(e,t){return Bt(e,"gutterContextMenu")?zc(e,t,"gutterContextMenu",!1):!1}function Hc(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vi(e)}var Ur={toString:function(){return"CodeMirror.Init"}},Wc={},Na={};function Qm(e){var t=e.optionHandlers;function a(i,s,c,d){e.defaults[i]=s,c&&(t[i]=d?function(h,g,v){v!=Ur&&c(h,g,v)}:c)}e.defineOption=a,e.Init=Ur,a("value","",function(i,s){return i.setValue(s)},!0),a("mode",null,function(i,s){i.doc.modeOption=s,Ks(i)},!0),a("indentUnit",2,Ks,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(i){Ti(i),vi(i),Nt(i)},!0),a("lineSeparator",null,function(i,s){if(i.doc.lineSep=s,!!s){var c=[],d=i.doc.first;i.doc.iter(function(g){for(var v=0;;){var C=g.text.indexOf(s,v);if(C==-1)break;v=C+s.length,c.push(P(d,C))}d++});for(var h=c.length-1;h>=0;h--)Hr(i.doc,s,c[h],P(c[h].line,c[h].ch+s.length))}}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(i,s,c){i.state.specialChars=new RegExp(s.source+(s.test(" ")?"":"| "),"g"),c!=Ur&&i.refresh()}),a("specialCharPlaceholder",Lg,function(i){return i.refresh()},!0),a("electricChars",!0),a("inputStyle",V?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(i,s){return i.getInputField().spellcheck=s},!0),a("autocorrect",!1,function(i,s){return i.getInputField().autocorrect=s},!0),a("autocapitalize",!1,function(i,s){return i.getInputField().autocapitalize=s},!0),a("rtlMoveVisually",!se),a("wholeLineUpdateBefore",!0),a("theme","default",function(i){Hc(i),Ci(i)},!0),a("keyMap","default",function(i,s,c){var d=Da(s),h=c!=Ur&&Da(c);h&&h.detach&&h.detach(i,d),d.attach&&d.attach(i,h||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,ev,!0),a("gutters",[],function(i,s){i.display.gutterSpecs=Us(s,i.options.lineNumbers),Ci(i)},!0),a("fixedGutter",!0,function(i,s){i.display.gutters.style.left=s?Ns(i.display)+"px":"0",i.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(i){return $r(i)},!0),a("scrollbarStyle","native",function(i){qu(i),$r(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),a("lineNumbers",!1,function(i,s){i.display.gutterSpecs=Us(i.options.gutters,s),Ci(i)},!0),a("firstLineNumber",1,Ci,!0),a("lineNumberFormatter",function(i){return i},Ci,!0),a("showCursorWhenSelecting",!1,yi,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(i,s){s=="nocursor"&&(Rr(i),i.display.input.blur()),i.display.input.readOnlyChanged(s)}),a("screenReaderLabel",null,function(i,s){s=s===""?null:s,i.display.input.screenReaderLabelChanged(s)}),a("disableInput",!1,function(i,s){s||i.display.input.reset()},!0),a("dragDrop",!0,Zm),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,yi,!0),a("singleCursorHeightPerLine",!0,yi,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,Ti,!0),a("addModeClass",!1,Ti,!0),a("pollInterval",100),a("undoDepth",200,function(i,s){return i.doc.history.undoDepth=s}),a("historyEventDelay",1250),a("viewportMargin",10,function(i){return i.refresh()},!0),a("maxHighlightLength",1e4,Ti,!0),a("moveInputWithCursor",!0,function(i,s){s||i.display.input.resetPosition()}),a("tabindex",null,function(i,s){return i.display.input.getField().tabIndex=s||""}),a("autofocus",null),a("direction","ltr",function(i,s){return i.doc.setDirection(s)},!0),a("phrases",null)}function Zm(e,t,a){var i=a&&a!=Ur;if(!t!=!i){var s=e.display.dragFunctions,c=t?me:Tt;c(e.display.scroller,"dragstart",s.start),c(e.display.scroller,"dragenter",s.enter),c(e.display.scroller,"dragover",s.over),c(e.display.scroller,"dragleave",s.leave),c(e.display.scroller,"drop",s.drop)}}function ev(e){e.options.lineWrapping?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Pe(e.display.wrapper,"CodeMirror-wrap"),Ss(e)),Fs(e),Nt(e),vi(e),setTimeout(function(){return $r(e)},100)}function Ye(e,t){var a=this;if(!(this instanceof Ye))return new Ye(e,t);this.options=t=t?ke(t):{},ke(Wc,t,!1);var i=t.value;typeof i=="string"?i=new Ft(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var s=new Ye.inputStyles[t.inputStyle](this),c=this.display=new hm(e,i,s,t);c.wrapper.CodeMirror=this,Hc(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qu(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ct,keySeq:null,specialChars:null},t.autofocus&&!V&&c.input.focus(),m&&k<11&&setTimeout(function(){return a.display.input.reset(!0)},20),tv(this),Om(),lr(this),this.curOp.forceUpdate=!0,ec(this,i),t.autofocus&&!V||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&Ps(a)},20):Rr(this);for(var d in Na)Na.hasOwnProperty(d)&&Na[d](this,t[d],Ur);Ku(this),t.finishInit&&t.finishInit(this);for(var h=0;h<io.length;++h)io[h](this);ur(this),S&&t.lineWrapping&&getComputedStyle(c.lineDiv).textRendering=="optimizelegibility"&&(c.lineDiv.style.textRendering="auto")}Ye.defaults=Wc,Ye.optionHandlers=Na;function tv(e){var t=e.display;me(t.scroller,"mousedown",yt(e,$c)),m&&k<11?me(t.scroller,"dblclick",yt(e,function(g){if(!tt(e,g)){var v=ir(e,g);if(!(!v||ro(e,g)||En(e.display,g))){_t(g);var C=e.findWordAt(v);_a(e.doc,C.anchor,C.head)}}})):me(t.scroller,"dblclick",function(g){return tt(e,g)||_t(g)}),me(t.scroller,"contextmenu",function(g){return Bc(e,g)}),me(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||Bc(e,g)});var a,i={end:0};function s(){t.activeTouch&&(a=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function c(g){if(g.touches.length!=1)return!1;var v=g.touches[0];return v.radiusX<=1&&v.radiusY<=1}function d(g,v){if(v.left==null)return!0;var C=v.left-g.left,_=v.top-g.top;return C*C+_*_>20*20}me(t.scroller,"touchstart",function(g){if(!tt(e,g)&&!c(g)&&!ro(e,g)){t.input.ensurePolled(),clearTimeout(a);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-i.end<=300?i:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),me(t.scroller,"touchend",function(g){var v=t.activeTouch;if(v&&!En(t,g)&&v.left!=null&&!v.moved&&new Date-v.start<300){var C=e.coordsChar(t.activeTouch,"page"),_;!v.prev||d(v,v.prev)?_=new Be(C,C):!v.prev.prev||d(v,v.prev.prev)?_=e.findWordAt(C):_=new Be(P(C.line,0),Ce(e.doc,P(C.line+1,0))),e.setSelection(_.anchor,_.head),e.focus(),_t(g)}s()}),me(t.scroller,"touchcancel",s),me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xi(e,t.scroller.scrollTop),sr(e,t.scroller.scrollLeft,!0),et(e,"scroll",e))}),me(t.scroller,"mousewheel",function(g){return Yu(e,g)}),me(t.scroller,"DOMMouseScroll",function(g){return Yu(e,g)}),me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){tt(e,g)||Rn(g)},over:function(g){tt(e,g)||(Dm(e,g),Rn(g))},start:function(g){return Am(e,g)},drop:yt(e,Im),leave:function(g){tt(e,g)||Cc(e)}};var h=t.input.getField();me(h,"keyup",function(g){return Rc.call(e,g)}),me(h,"keydown",yt(e,Fc)),me(h,"keypress",yt(e,Mc)),me(h,"focus",function(g){return Ps(e,g)}),me(h,"blur",function(g){return Rr(e,g)})}var io=[];Ye.defineInitHook=function(e){return io.push(e)};function Pi(e,t,a,i){var s=e.doc,c;a==null&&(a="add"),a=="smart"&&(s.mode.indent?c=di(e,t).state:a="prev");var d=e.options.tabSize,h=ce(s,t),g=Le(h.text,null,d);h.stateAfter&&(h.stateAfter=null);var v=h.text.match(/^\s*/)[0],C;if(!i&&!/\S/.test(h.text))C=0,a="not";else if(a=="smart"&&(C=s.mode.indent(c,h.text.slice(v.length),h.text),C==Ke||C>150)){if(!i)return;a="prev"}a=="prev"?t>s.first?C=Le(ce(s,t-1).text,null,d):C=0:a=="add"?C=g+e.options.indentUnit:a=="subtract"?C=g-e.options.indentUnit:typeof a=="number"&&(C=g+a),C=Math.max(0,C);var _="",F=0;if(e.options.indentWithTabs)for(var O=Math.floor(C/d);O;--O)F+=d,_+=" ";if(F<C&&(_+=Kt(C-F)),_!=v)return Hr(s,_,P(t,0),P(t,v.length),"+input"),h.stateAfter=null,!0;for(var B=0;B<s.sel.ranges.length;B++){var U=s.sel.ranges[B];if(U.head.line==t&&U.head.ch<v.length){var Y=P(t,v.length);Js(s,B,new Be(Y,Y));break}}}var pn=null;function Fa(e){pn=e}function ao(e,t,a,i,s){var c=e.doc;e.display.shift=!1,i||(i=c.sel);var d=+new Date-200,h=s=="paste"||e.state.pasteIncoming>d,g=nn(t),v=null;if(h&&i.ranges.length>1)if(pn&&pn.text.join(`
|
|
13
|
+
`)==t){if(i.ranges.length%pn.text.length==0){v=[];for(var C=0;C<pn.text.length;C++)v.push(c.splitLines(pn.text[C]))}}else g.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(v=St(g,function(ee){return[ee]}));for(var _=e.curOp.updateInput,F=i.ranges.length-1;F>=0;F--){var O=i.ranges[F],B=O.from(),U=O.to();O.empty()&&(a&&a>0?B=P(B.line,B.ch-a):e.state.overwrite&&!h?U=P(U.line,Math.min(ce(c,U.line).text.length,U.ch+be(g).length)):h&&pn&&pn.lineWise&&pn.text.join(`
|
|
14
14
|
`)==g.join(`
|
|
15
|
-
`)&&(B=q=P(B.line,0)));var Y={from:B,to:q,text:v?v[R%v.length]:g,origin:s||(h?"paste":e.state.cutIncoming>d?"cut":"+input")};Br(e.doc,Y),vt(e,"inputRead",e,Y)}t&&!h&&Uc(e,t),Mr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=_),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function jc(e,t){var a=e.clipboardData&&e.clipboardData.getData("Text");if(a)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Ht(t,function(){return ao(t,a,0,null,"paste")}),!0}function Uc(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var a=e.doc.sel,i=a.ranges.length-1;i>=0;i--){var s=a.ranges[i];if(!(s.head.ch>100||i&&a.ranges[i-1].head.line==s.head.line)){var c=e.getModeAt(s.head),d=!1;if(c.electricChars){for(var h=0;h<c.electricChars.length;h++)if(t.indexOf(c.electricChars.charAt(h))>-1){d=Pi(e,s.head.line,"smart");break}}else c.electricInput&&c.electricInput.test(ce(e.doc,s.head.line).text.slice(0,s.head.ch))&&(d=Pi(e,s.head.line,"smart"));d&&vt(e,"electricInput",e,s.head.line)}}}function qc(e){for(var t=[],a=[],i=0;i<e.doc.sel.ranges.length;i++){var s=e.doc.sel.ranges[i].head.line,c={anchor:P(s,0),head:P(s+1,0)};a.push(c),t.push(e.getRange(c.anchor,c.head))}return{text:t,ranges:a}}function so(e,t,a,i){e.setAttribute("autocorrect",a?"on":"off"),e.setAttribute("autocapitalize",i?"on":"off"),e.setAttribute("spellcheck",!!t)}function Gc(){var e=w("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=w("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return S?e.style.width="1000px":e.setAttribute("wrap","off"),N&&(e.style.border="1px solid black"),t}function nv(e){var t=e.optionHandlers,a=e.helpers={};e.prototype={constructor:e,focus:function(){Z(this).focus(),this.display.input.focus()},setOption:function(i,s){var c=this.options,d=c[i];c[i]==s&&i!="mode"||(c[i]=s,t.hasOwnProperty(i)&&yt(this,t[i])(this,s,d),et(this,"optionChange",this,i))},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,s){this.state.keyMaps[s?"push":"unshift"](Da(i))},removeKeyMap:function(i){for(var s=this.state.keyMaps,c=0;c<s.length;++c)if(s[c]==i||s[c].name==i)return s.splice(c,1),!0},addOverlay:It(function(i,s){var c=i.token?i:e.getMode(this.options,i);if(c.startState)throw new Error("Overlays may not be stateful.");Vt(this.state.overlays,{mode:c,modeSpec:i,opaque:s&&s.opaque,priority:s&&s.priority||0},function(d){return d.priority}),this.state.modeGen++,Nt(this)}),removeOverlay:It(function(i){for(var s=this.state.overlays,c=0;c<s.length;++c){var d=s[c].modeSpec;if(d==i||typeof i=="string"&&d.name==i){s.splice(c,1),this.state.modeGen++,Nt(this);return}}}),indentLine:It(function(i,s,c){typeof s!="string"&&typeof s!="number"&&(s==null?s=this.options.smartIndent?"smart":"prev":s=s?"add":"subtract"),U(this.doc,i)&&Pi(this,i,s,c)}),indentSelection:It(function(i){for(var s=this.doc.sel.ranges,c=-1,d=0;d<s.length;d++){var h=s[d];if(h.empty())h.head.line>c&&(Pi(this,h.head.line,i,!0),c=h.head.line,d==this.doc.sel.primIndex&&Mr(this));else{var g=h.from(),v=h.to(),C=Math.max(c,g.line);c=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var _=C;_<c;++_)Pi(this,_,i);var R=this.doc.sel.ranges;g.ch==0&&s.length==R.length&&R[d].from().ch>0&&Js(this.doc,d,new Be(g,R[d].to()),ft)}}}),getTokenAt:function(i,s){return nu(this,i,s)},getLineTokens:function(i,s){return nu(this,P(i),s,!0)},getTokenTypeAt:function(i){i=Ce(this.doc,i);var s=Zl(this,ce(this.doc,i.line)),c=0,d=(s.length-1)/2,h=i.ch,g;if(h==0)g=s[2];else for(;;){var v=c+d>>1;if((v?s[v*2-1]:0)>=h)d=v;else if(s[v*2+1]<h)c=v+1;else{g=s[v*2+2];break}}var C=g?g.indexOf("overlay "):-1;return C<0?g:C==0?null:g.slice(0,C-1)},getModeAt:function(i){var s=this.doc.mode;return s.innerMode?e.innerMode(s,this.getTokenAt(i).state).mode:s},getHelper:function(i,s){return this.getHelpers(i,s)[0]},getHelpers:function(i,s){var c=[];if(!a.hasOwnProperty(s))return c;var d=a[s],h=this.getModeAt(i);if(typeof h[s]=="string")d[h[s]]&&c.push(d[h[s]]);else if(h[s])for(var g=0;g<h[s].length;g++){var v=d[h[s][g]];v&&c.push(v)}else h.helperType&&d[h.helperType]?c.push(d[h.helperType]):d[h.name]&&c.push(d[h.name]);for(var C=0;C<d._global.length;C++){var _=d._global[C];_.pred(h,this)&&we(c,_.val)==-1&&c.push(_.val)}return c},getStateAfter:function(i,s){var c=this.doc;return i=Yl(c,i??c.first+c.size-1),di(this,i+1,s).state},cursorCoords:function(i,s){var c,d=this.doc.sel.primary();return i==null?c=d.head:typeof i=="object"?c=Ce(this.doc,i):c=i?d.from():d.to(),dn(this,c,s||"page")},charCoords:function(i,s){return ma(this,Ce(this.doc,i),s||"page")},coordsChar:function(i,s){return i=Du(this,i,s||"page"),As(this,i.left,i.top)},lineAtHeight:function(i,s){return i=Du(this,{top:i,left:0},s||"page").top,T(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,s,c){var d=!1,h;if(typeof i=="number"){var g=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>g&&(i=g,d=!0),h=ce(this.doc,i)}else h=i;return ga(this,h,{top:0,left:0},s||"page",c||d).top+(d?this.doc.height-Ln(h):0)},defaultTextHeight:function(){return Nr(this.display)},defaultCharWidth:function(){return Rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,s,c,d,h){var g=this.display;i=dn(this,Ce(this.doc,i));var v=i.bottom,C=i.left;if(s.style.position="absolute",s.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(s),g.sizer.appendChild(s),d=="over")v=i.top;else if(d=="above"||d=="near"){var _=Math.max(g.wrapper.clientHeight,this.doc.height),R=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(d=="above"||i.bottom+s.offsetHeight>_)&&i.top>s.offsetHeight?v=i.top-s.offsetHeight:i.bottom+s.offsetHeight<=_&&(v=i.bottom),C+s.offsetWidth>R&&(C=R-s.offsetWidth)}s.style.top=v+"px",s.style.left=s.style.right="",h=="right"?(C=g.sizer.clientWidth-s.offsetWidth,s.style.right="0px"):(h=="left"?C=0:h=="middle"&&(C=(g.sizer.clientWidth-s.offsetWidth)/2),s.style.left=C+"px"),c&&Zg(this,{left:C,top:v,right:C+s.offsetWidth,bottom:v+s.offsetHeight})},triggerOnKeyDown:It(Rc),triggerOnKeyPress:It(Mc),triggerOnKeyUp:Fc,triggerOnMouseDown:It($c),execCommand:function(i){if(Ri.hasOwnProperty(i))return Ri[i].call(null,this)},triggerElectric:It(function(i){Uc(this,i)}),findPosH:function(i,s,c,d){var h=1;s<0&&(h=-1,s=-s);for(var g=Ce(this.doc,i),v=0;v<s&&(g=oo(this.doc,g,h,c,d),!g.hitSide);++v);return g},moveH:It(function(i,s){var c=this;this.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?oo(c.doc,d.head,i,s,c.options.rtlMoveVisually):i<0?d.from():d.to()},dt)}),deleteH:It(function(i,s){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Ur(this,function(h){var g=oo(d,h.head,i,s,!1);return i<0?{from:g,to:h.head}:{from:h.head,to:g}})}),findPosV:function(i,s,c,d){var h=1,g=d;s<0&&(h=-1,s=-s);for(var v=Ce(this.doc,i),C=0;C<s;++C){var _=dn(this,v,"div");if(g==null?g=_.left:_.left=g,v=Kc(this,_,h,c),v.hitSide)break}return v},moveV:It(function(i,s){var c=this,d=this.doc,h=[],g=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(C){if(g)return i<0?C.from():C.to();var _=dn(c,C.head,"div");C.goalColumn!=null&&(_.left=C.goalColumn),h.push(_.left);var R=Kc(c,_,i,s);return s=="page"&&C==d.sel.primary()&&Bs(c,ma(c,R,"div").top-_.top),R},dt),h.length)for(var v=0;v<d.sel.ranges.length;v++)d.sel.ranges[v].goalColumn=h[v]}),findWordAt:function(i){var s=this.doc,c=ce(s,i.line).text,d=i.ch,h=i.ch;if(c){var g=this.getHelper(i,"wordChars");(i.sticky=="before"||h==c.length)&&d?--d:++h;for(var v=c.charAt(d),C=xe(v,g)?function(_){return xe(_,g)}:/\s/.test(v)?function(_){return/\s/.test(_)}:function(_){return!/\s/.test(_)&&!xe(_)};d>0&&C(c.charAt(d-1));)--d;for(;h<c.length&&C(c.charAt(h));)++h}return new Be(P(i.line,d),P(i.line,h))},toggleOverwrite:function(i){i!=null&&i==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?K(this.display.cursorDiv,"CodeMirror-overwrite"):Pe(this.display.cursorDiv,"CodeMirror-overwrite"),et(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M(oe(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:It(function(i,s){bi(this,i,s)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-xn(this)-this.display.barHeight,width:i.scrollWidth-xn(this)-this.display.barWidth,clientHeight:_s(this),clientWidth:nr(this)}},scrollIntoView:It(function(i,s){i==null?(i={from:this.doc.sel.primary().head,to:null},s==null&&(s=this.options.cursorScrollMargin)):typeof i=="number"?i={from:P(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=s||0,i.from.line!=null?em(this,i):Bu(this,i.from,i.to,i.margin)}),setSize:It(function(i,s){var c=this,d=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};i!=null&&(this.display.wrapper.style.width=d(i)),s!=null&&(this.display.wrapper.style.height=d(s)),this.options.lineWrapping&&Eu(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(g){if(g.widgets){for(var v=0;v<g.widgets.length;v++)if(g.widgets[v].noHScroll){Bn(c,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,et(this,"refresh",this)}),operation:function(i){return Ht(this,i)},startOperation:function(){return lr(this)},endOperation:function(){return ur(this)},refresh:It(function(){var i=this.display.cachedTextHeight;Nt(this),this.curOp.forceUpdate=!0,vi(this),bi(this,this.doc.scrollLeft,this.doc.scrollTop),js(this.display),(i==null||Math.abs(i-Nr(this.display))>.5||this.options.lineWrapping)&&Rs(this),et(this,"refresh",this)}),swapDoc:It(function(i){var s=this.doc;return s.cm=null,this.state.selectingText&&this.state.selectingText(),ec(this,i),vi(this),this.display.input.reset(),bi(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,vt(this,"swapDoc",this,s),s}),phrase:function(i){var s=this.options.phrases;return s&&Object.prototype.hasOwnProperty.call(s,i)?s[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},sn(e),e.registerHelper=function(i,s,c){a.hasOwnProperty(i)||(a[i]=e[i]={_global:[]}),a[i][s]=c},e.registerGlobalHelper=function(i,s,c,d){e.registerHelper(i,s,d),a[i]._global.push({pred:c,val:d})}}function oo(e,t,a,i,s){var c=t,d=a,h=ce(e,t.line),g=s&&e.direction=="rtl"?-a:a;function v(){var ae=t.line+g;return ae<e.first||ae>=e.first+e.size?!1:(t=new P(ae,t.ch,t.sticky),h=ce(e,ae))}function C(ae){var te;if(i=="codepoint"){var le=h.text.charCodeAt(t.ch+(a>0?0:-1));if(isNaN(le))te=null;else{var ve=a>0?le>=55296&&le<56320:le>=56320&&le<57343;te=new P(t.line,Math.max(0,Math.min(h.text.length,t.ch+a*(ve?2:1))),-a)}}else s?te=$m(e.cm,h,t,a):te=Zs(h,t,a);if(te==null)if(!ae&&v())t=eo(s,e.cm,h,t.line,g);else return!1;else t=te;return!0}if(i=="char"||i=="codepoint")C();else if(i=="column")C(!0);else if(i=="word"||i=="group")for(var _=null,R=i=="group",O=e.cm&&e.cm.getHelper(t,"wordChars"),B=!0;!(a<0&&!C(!B));B=!1){var q=h.text.charAt(t.ch)||`
|
|
16
|
-
`,Y=xe(
|
|
17
|
-
`?"n":!
|
|
15
|
+
`)&&(B=U=P(B.line,0)));var Y={from:B,to:U,text:v?v[F%v.length]:g,origin:s||(h?"paste":e.state.cutIncoming>d?"cut":"+input")};Br(e.doc,Y),vt(e,"inputRead",e,Y)}t&&!h&&qc(e,t),Mr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=_),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function jc(e,t){var a=e.clipboardData&&e.clipboardData.getData("Text");if(a)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Ht(t,function(){return ao(t,a,0,null,"paste")}),!0}function qc(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var a=e.doc.sel,i=a.ranges.length-1;i>=0;i--){var s=a.ranges[i];if(!(s.head.ch>100||i&&a.ranges[i-1].head.line==s.head.line)){var c=e.getModeAt(s.head),d=!1;if(c.electricChars){for(var h=0;h<c.electricChars.length;h++)if(t.indexOf(c.electricChars.charAt(h))>-1){d=Pi(e,s.head.line,"smart");break}}else c.electricInput&&c.electricInput.test(ce(e.doc,s.head.line).text.slice(0,s.head.ch))&&(d=Pi(e,s.head.line,"smart"));d&&vt(e,"electricInput",e,s.head.line)}}}function Uc(e){for(var t=[],a=[],i=0;i<e.doc.sel.ranges.length;i++){var s=e.doc.sel.ranges[i].head.line,c={anchor:P(s,0),head:P(s+1,0)};a.push(c),t.push(e.getRange(c.anchor,c.head))}return{text:t,ranges:a}}function so(e,t,a,i){e.setAttribute("autocorrect",a?"on":"off"),e.setAttribute("autocapitalize",i?"on":"off"),e.setAttribute("spellcheck",!!t)}function Gc(){var e=w("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=w("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return S?e.style.width="1000px":e.setAttribute("wrap","off"),N&&(e.style.border="1px solid black"),t}function nv(e){var t=e.optionHandlers,a=e.helpers={};e.prototype={constructor:e,focus:function(){Z(this).focus(),this.display.input.focus()},setOption:function(i,s){var c=this.options,d=c[i];c[i]==s&&i!="mode"||(c[i]=s,t.hasOwnProperty(i)&&yt(this,t[i])(this,s,d),et(this,"optionChange",this,i))},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,s){this.state.keyMaps[s?"push":"unshift"](Da(i))},removeKeyMap:function(i){for(var s=this.state.keyMaps,c=0;c<s.length;++c)if(s[c]==i||s[c].name==i)return s.splice(c,1),!0},addOverlay:It(function(i,s){var c=i.token?i:e.getMode(this.options,i);if(c.startState)throw new Error("Overlays may not be stateful.");Vt(this.state.overlays,{mode:c,modeSpec:i,opaque:s&&s.opaque,priority:s&&s.priority||0},function(d){return d.priority}),this.state.modeGen++,Nt(this)}),removeOverlay:It(function(i){for(var s=this.state.overlays,c=0;c<s.length;++c){var d=s[c].modeSpec;if(d==i||typeof i=="string"&&d.name==i){s.splice(c,1),this.state.modeGen++,Nt(this);return}}}),indentLine:It(function(i,s,c){typeof s!="string"&&typeof s!="number"&&(s==null?s=this.options.smartIndent?"smart":"prev":s=s?"add":"subtract"),q(this.doc,i)&&Pi(this,i,s,c)}),indentSelection:It(function(i){for(var s=this.doc.sel.ranges,c=-1,d=0;d<s.length;d++){var h=s[d];if(h.empty())h.head.line>c&&(Pi(this,h.head.line,i,!0),c=h.head.line,d==this.doc.sel.primIndex&&Mr(this));else{var g=h.from(),v=h.to(),C=Math.max(c,g.line);c=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var _=C;_<c;++_)Pi(this,_,i);var F=this.doc.sel.ranges;g.ch==0&&s.length==F.length&&F[d].from().ch>0&&Js(this.doc,d,new Be(g,F[d].to()),ft)}}}),getTokenAt:function(i,s){return nu(this,i,s)},getLineTokens:function(i,s){return nu(this,P(i),s,!0)},getTokenTypeAt:function(i){i=Ce(this.doc,i);var s=Zl(this,ce(this.doc,i.line)),c=0,d=(s.length-1)/2,h=i.ch,g;if(h==0)g=s[2];else for(;;){var v=c+d>>1;if((v?s[v*2-1]:0)>=h)d=v;else if(s[v*2+1]<h)c=v+1;else{g=s[v*2+2];break}}var C=g?g.indexOf("overlay "):-1;return C<0?g:C==0?null:g.slice(0,C-1)},getModeAt:function(i){var s=this.doc.mode;return s.innerMode?e.innerMode(s,this.getTokenAt(i).state).mode:s},getHelper:function(i,s){return this.getHelpers(i,s)[0]},getHelpers:function(i,s){var c=[];if(!a.hasOwnProperty(s))return c;var d=a[s],h=this.getModeAt(i);if(typeof h[s]=="string")d[h[s]]&&c.push(d[h[s]]);else if(h[s])for(var g=0;g<h[s].length;g++){var v=d[h[s][g]];v&&c.push(v)}else h.helperType&&d[h.helperType]?c.push(d[h.helperType]):d[h.name]&&c.push(d[h.name]);for(var C=0;C<d._global.length;C++){var _=d._global[C];_.pred(h,this)&&we(c,_.val)==-1&&c.push(_.val)}return c},getStateAfter:function(i,s){var c=this.doc;return i=Yl(c,i??c.first+c.size-1),di(this,i+1,s).state},cursorCoords:function(i,s){var c,d=this.doc.sel.primary();return i==null?c=d.head:typeof i=="object"?c=Ce(this.doc,i):c=i?d.from():d.to(),dn(this,c,s||"page")},charCoords:function(i,s){return ma(this,Ce(this.doc,i),s||"page")},coordsChar:function(i,s){return i=Du(this,i,s||"page"),As(this,i.left,i.top)},lineAtHeight:function(i,s){return i=Du(this,{top:i,left:0},s||"page").top,T(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,s,c){var d=!1,h;if(typeof i=="number"){var g=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>g&&(i=g,d=!0),h=ce(this.doc,i)}else h=i;return ga(this,h,{top:0,left:0},s||"page",c||d).top+(d?this.doc.height-Ln(h):0)},defaultTextHeight:function(){return Nr(this.display)},defaultCharWidth:function(){return Fr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,s,c,d,h){var g=this.display;i=dn(this,Ce(this.doc,i));var v=i.bottom,C=i.left;if(s.style.position="absolute",s.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(s),g.sizer.appendChild(s),d=="over")v=i.top;else if(d=="above"||d=="near"){var _=Math.max(g.wrapper.clientHeight,this.doc.height),F=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(d=="above"||i.bottom+s.offsetHeight>_)&&i.top>s.offsetHeight?v=i.top-s.offsetHeight:i.bottom+s.offsetHeight<=_&&(v=i.bottom),C+s.offsetWidth>F&&(C=F-s.offsetWidth)}s.style.top=v+"px",s.style.left=s.style.right="",h=="right"?(C=g.sizer.clientWidth-s.offsetWidth,s.style.right="0px"):(h=="left"?C=0:h=="middle"&&(C=(g.sizer.clientWidth-s.offsetWidth)/2),s.style.left=C+"px"),c&&Zg(this,{left:C,top:v,right:C+s.offsetWidth,bottom:v+s.offsetHeight})},triggerOnKeyDown:It(Fc),triggerOnKeyPress:It(Mc),triggerOnKeyUp:Rc,triggerOnMouseDown:It($c),execCommand:function(i){if(Fi.hasOwnProperty(i))return Fi[i].call(null,this)},triggerElectric:It(function(i){qc(this,i)}),findPosH:function(i,s,c,d){var h=1;s<0&&(h=-1,s=-s);for(var g=Ce(this.doc,i),v=0;v<s&&(g=oo(this.doc,g,h,c,d),!g.hitSide);++v);return g},moveH:It(function(i,s){var c=this;this.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?oo(c.doc,d.head,i,s,c.options.rtlMoveVisually):i<0?d.from():d.to()},dt)}),deleteH:It(function(i,s){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):qr(this,function(h){var g=oo(d,h.head,i,s,!1);return i<0?{from:g,to:h.head}:{from:h.head,to:g}})}),findPosV:function(i,s,c,d){var h=1,g=d;s<0&&(h=-1,s=-s);for(var v=Ce(this.doc,i),C=0;C<s;++C){var _=dn(this,v,"div");if(g==null?g=_.left:_.left=g,v=Kc(this,_,h,c),v.hitSide)break}return v},moveV:It(function(i,s){var c=this,d=this.doc,h=[],g=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(C){if(g)return i<0?C.from():C.to();var _=dn(c,C.head,"div");C.goalColumn!=null&&(_.left=C.goalColumn),h.push(_.left);var F=Kc(c,_,i,s);return s=="page"&&C==d.sel.primary()&&Bs(c,ma(c,F,"div").top-_.top),F},dt),h.length)for(var v=0;v<d.sel.ranges.length;v++)d.sel.ranges[v].goalColumn=h[v]}),findWordAt:function(i){var s=this.doc,c=ce(s,i.line).text,d=i.ch,h=i.ch;if(c){var g=this.getHelper(i,"wordChars");(i.sticky=="before"||h==c.length)&&d?--d:++h;for(var v=c.charAt(d),C=xe(v,g)?function(_){return xe(_,g)}:/\s/.test(v)?function(_){return/\s/.test(_)}:function(_){return!/\s/.test(_)&&!xe(_)};d>0&&C(c.charAt(d-1));)--d;for(;h<c.length&&C(c.charAt(h));)++h}return new Be(P(i.line,d),P(i.line,h))},toggleOverwrite:function(i){i!=null&&i==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?K(this.display.cursorDiv,"CodeMirror-overwrite"):Pe(this.display.cursorDiv,"CodeMirror-overwrite"),et(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M(oe(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:It(function(i,s){bi(this,i,s)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-xn(this)-this.display.barHeight,width:i.scrollWidth-xn(this)-this.display.barWidth,clientHeight:_s(this),clientWidth:nr(this)}},scrollIntoView:It(function(i,s){i==null?(i={from:this.doc.sel.primary().head,to:null},s==null&&(s=this.options.cursorScrollMargin)):typeof i=="number"?i={from:P(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=s||0,i.from.line!=null?em(this,i):Bu(this,i.from,i.to,i.margin)}),setSize:It(function(i,s){var c=this,d=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};i!=null&&(this.display.wrapper.style.width=d(i)),s!=null&&(this.display.wrapper.style.height=d(s)),this.options.lineWrapping&&Eu(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(g){if(g.widgets){for(var v=0;v<g.widgets.length;v++)if(g.widgets[v].noHScroll){Bn(c,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,et(this,"refresh",this)}),operation:function(i){return Ht(this,i)},startOperation:function(){return lr(this)},endOperation:function(){return ur(this)},refresh:It(function(){var i=this.display.cachedTextHeight;Nt(this),this.curOp.forceUpdate=!0,vi(this),bi(this,this.doc.scrollLeft,this.doc.scrollTop),js(this.display),(i==null||Math.abs(i-Nr(this.display))>.5||this.options.lineWrapping)&&Fs(this),et(this,"refresh",this)}),swapDoc:It(function(i){var s=this.doc;return s.cm=null,this.state.selectingText&&this.state.selectingText(),ec(this,i),vi(this),this.display.input.reset(),bi(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,vt(this,"swapDoc",this,s),s}),phrase:function(i){var s=this.options.phrases;return s&&Object.prototype.hasOwnProperty.call(s,i)?s[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},sn(e),e.registerHelper=function(i,s,c){a.hasOwnProperty(i)||(a[i]=e[i]={_global:[]}),a[i][s]=c},e.registerGlobalHelper=function(i,s,c,d){e.registerHelper(i,s,d),a[i]._global.push({pred:c,val:d})}}function oo(e,t,a,i,s){var c=t,d=a,h=ce(e,t.line),g=s&&e.direction=="rtl"?-a:a;function v(){var ae=t.line+g;return ae<e.first||ae>=e.first+e.size?!1:(t=new P(ae,t.ch,t.sticky),h=ce(e,ae))}function C(ae){var te;if(i=="codepoint"){var le=h.text.charCodeAt(t.ch+(a>0?0:-1));if(isNaN(le))te=null;else{var ve=a>0?le>=55296&&le<56320:le>=56320&&le<57343;te=new P(t.line,Math.max(0,Math.min(h.text.length,t.ch+a*(ve?2:1))),-a)}}else s?te=$m(e.cm,h,t,a):te=Zs(h,t,a);if(te==null)if(!ae&&v())t=eo(s,e.cm,h,t.line,g);else return!1;else t=te;return!0}if(i=="char"||i=="codepoint")C();else if(i=="column")C(!0);else if(i=="word"||i=="group")for(var _=null,F=i=="group",O=e.cm&&e.cm.getHelper(t,"wordChars"),B=!0;!(a<0&&!C(!B));B=!1){var U=h.text.charAt(t.ch)||`
|
|
16
|
+
`,Y=xe(U,O)?"w":F&&U==`
|
|
17
|
+
`?"n":!F||/\s/.test(U)?null:"p";if(F&&!B&&!Y&&(Y="s"),_&&_!=Y){a<0&&(a=1,C(),t.sticky="after");break}if(Y&&(_=Y),a>0&&!C(!B))break}var ee=Ea(e,t,c,d,!0);return ze(c,ee)&&(ee.hitSide=!0),ee}function Kc(e,t,a,i){var s=e.doc,c=t.left,d;if(i=="page"){var h=Math.min(e.display.wrapper.clientHeight,Z(e).innerHeight||s(e).documentElement.clientHeight),g=Math.max(h-.5*Nr(e.display),3);d=(a>0?t.bottom:t.top)+a*g}else i=="line"&&(d=a>0?t.bottom+3:t.top-3);for(var v;v=As(e,c,d),!!v.outside;){if(a<0?d<=0:d>=s.height){v.hitSide=!0;break}d+=a*5}return v}var We=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ct,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};We.prototype.init=function(e){var t=this,a=this,i=a.cm,s=a.div=e.lineDiv;s.contentEditable=!0,so(s,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function c(h){for(var g=h.target;g;g=g.parentNode){if(g==s)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}me(s,"paste",function(h){!c(h)||tt(i,h)||jc(h,i)||k<=11&&setTimeout(yt(i,function(){return t.updateFromDOM()}),20)}),me(s,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),me(s,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),me(s,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),me(s,"touchstart",function(){return a.forceCompositionEnd()}),me(s,"input",function(){t.composing||t.readFromDOMSoon()});function d(h){if(!(!c(h)||tt(i,h))){if(i.somethingSelected())Fa({lineWise:!1,text:i.getSelections()}),h.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var g=Uc(i);Fa({lineWise:!0,text:g.text}),h.type=="cut"&&i.operation(function(){i.setSelections(g.ranges,0,ft),i.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var v=pn.text.join(`
|
|
18
18
|
`);if(h.clipboardData.setData("Text",v),h.clipboardData.getData("Text")==v){h.preventDefault();return}}var C=Gc(),_=C.firstChild;so(_),i.display.lineSpace.insertBefore(C,i.display.lineSpace.firstChild),_.value=pn.text.join(`
|
|
19
|
-
`);var
|
|
19
|
+
`);var F=M(_e(s));E(_),setTimeout(function(){i.display.lineSpace.removeChild(C),F.focus(),F==s&&a.showPrimarySelection()},50)}}me(s,"copy",d),me(s,"cut",d)},We.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},We.prototype.prepareSelection=function(){var e=$u(this.cm,!1);return e.focus=M(_e(this.div))==this.div,e},We.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},We.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},We.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,a=t.doc.sel.primary(),i=a.from(),s=a.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||s.line<t.display.viewFrom){e.removeAllRanges();return}var c=Ra(t,e.anchorNode,e.anchorOffset),d=Ra(t,e.focusNode,e.focusOffset);if(!(c&&!c.bad&&d&&!d.bad&&re(Ir(c,d),i)==0&&re(Ot(c,d),s)==0)){var h=t.display.view,g=i.line>=t.display.viewFrom&&Vc(t,i)||{node:h[0].measure.map[2],offset:0},v=s.line<t.display.viewTo&&Vc(t,s);if(!v){var C=h[h.length-1].measure,_=C.maps?C.maps[C.maps.length-1]:C.map;v={node:_[_.length-1],offset:_[_.length-2]-_[_.length-3]}}if(!g||!v){e.removeAllRanges();return}var F=e.rangeCount&&e.getRangeAt(0),O;try{O=G(g.node,g.offset,v.offset,v.node)}catch{}O&&(!u&&t.state.focused?(e.collapse(g.node,g.offset),O.collapsed||(e.removeAllRanges(),e.addRange(O))):(e.removeAllRanges(),e.addRange(O)),F&&e.anchorNode==null?e.addRange(F):u&&this.startGracePeriod()),this.rememberSelection()}},We.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},We.prototype.showMultipleSelections=function(e){Q(this.cm.display.cursorDiv,e.cursors),Q(this.cm.display.selectionDiv,e.selection)},We.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},We.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},We.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||M(_e(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},We.prototype.blur=function(){this.div.blur()},We.prototype.getField=function(){return this.div},We.prototype.supportsTouch=function(){return!0},We.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Ht(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function a(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,a))}this.polling.set(this.cm.options.pollInterval,a)},We.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},We.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(H&&L&&this.cm.display.gutterSpecs.length&&rv(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var a=Ra(t,e.anchorNode,e.anchorOffset),i=Ra(t,e.focusNode,e.focusOffset);a&&i&&Ht(t,function(){Lt(t.doc,Wn(a,i),ft),(a.bad||i.bad)&&(t.curOp.selectionChanged=!0)})}}},We.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,a=e.doc.sel.primary(),i=a.from(),s=a.to();if(i.ch==0&&i.line>e.firstLine()&&(i=P(i.line-1,ce(e.doc,i.line-1).length)),s.ch==ce(e.doc,s.line).text.length&&s.line<e.lastLine()&&(s=P(s.line+1,0)),i.line<t.viewFrom||s.line>t.viewTo-1)return!1;var c,d,h;i.line==t.viewFrom||(c=ar(e,i.line))==0?(d=b(t.view[0].line),h=t.view[0].node):(d=b(t.view[c].line),h=t.view[c-1].node.nextSibling);var g=ar(e,s.line),v,C;if(g==t.view.length-1?(v=t.viewTo-1,C=t.lineDiv.lastChild):(v=b(t.view[g+1].line)-1,C=t.view[g+1].node.previousSibling),!h)return!1;for(var _=e.doc.splitLines(iv(e,h,C,d,v)),F=Tn(e.doc,P(d,0),P(v,ce(e.doc,v).text.length));_.length>1&&F.length>1;)if(be(_)==be(F))_.pop(),F.pop(),v--;else if(_[0]==F[0])_.shift(),F.shift(),d++;else break;for(var O=0,B=0,U=_[0],Y=F[0],ee=Math.min(U.length,Y.length);O<ee&&U.charCodeAt(O)==Y.charCodeAt(O);)++O;for(var ae=be(_),te=be(F),le=Math.min(ae.length-(_.length==1?O:0),te.length-(F.length==1?O:0));B<le&&ae.charCodeAt(ae.length-B-1)==te.charCodeAt(te.length-B-1);)++B;if(_.length==1&&F.length==1&&d==i.line)for(;O&&O>i.ch&&ae.charCodeAt(ae.length-B-1)==te.charCodeAt(te.length-B-1);)O--,B++;_[_.length-1]=ae.slice(0,ae.length-B).replace(/^\u200b+/,""),_[0]=_[0].slice(O).replace(/\u200b+$/,"");var ve=P(d,O),ge=P(v,F.length?be(F).length-B:0);if(_.length>1||_[0]||re(ve,ge))return Hr(e.doc,_,ve,ge,"+input"),!0},We.prototype.ensurePolled=function(){this.forceCompositionEnd()},We.prototype.reset=function(){this.forceCompositionEnd()},We.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},We.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},We.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ht(this.cm,function(){return Nt(e.cm)})},We.prototype.setUneditable=function(e){e.contentEditable="false"},We.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||yt(this.cm,ao)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},We.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},We.prototype.onContextMenu=function(){},We.prototype.resetPosition=function(){},We.prototype.needsContentAttribute=!0;function Vc(e,t){var a=Ls(e,t.line);if(!a||a.hidden)return null;var i=ce(e.doc,t.line),s=Su(a,i,t.line),c=$e(i,e.doc.direction),d="left";if(c){var h=Fn(c,t.ch);d=h%2?"right":"left"}var g=_u(s.map,t.ch,d);return g.offset=g.collapse=="right"?g.end:g.start,g}function rv(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Gr(e,t){return t&&(e.bad=!0),e}function iv(e,t,a,i,s){var c="",d=!1,h=e.doc.lineSeparator(),g=!1;function v(O){return function(B){return B.id==O}}function C(){d&&(c+=h,g&&(c+=h),d=g=!1)}function _(O){O&&(C(),c+=O)}function F(O){if(O.nodeType==1){var B=O.getAttribute("cm-text");if(B){_(B);return}var U=O.getAttribute("cm-marker"),Y;if(U){var ee=e.findMarks(P(i,0),P(s+1,0),v(+U));ee.length&&(Y=ee[0].find(0))&&_(Tn(e.doc,Y.from,Y.to).join(h));return}if(O.getAttribute("contenteditable")=="false")return;var ae=/^(pre|div|p|li|table|br)$/i.test(O.nodeName);if(!/^br$/i.test(O.nodeName)&&O.textContent.length==0)return;ae&&C();for(var te=0;te<O.childNodes.length;te++)F(O.childNodes[te]);/^(pre|p)$/i.test(O.nodeName)&&(g=!0),ae&&(d=!0)}else O.nodeType==3&&_(O.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;F(t),t!=a;)t=t.nextSibling,g=!1;return c}function Ra(e,t,a){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[a],!i)return Gr(e.clipPos(P(e.display.viewTo-1)),!0);t=null,a=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var s=0;s<e.display.view.length;s++){var c=e.display.view[s];if(c.node==i)return av(c,t,a)}}function av(e,t,a){var i=e.text.firstChild,s=!1;if(!t||!A(i,t))return Gr(P(b(e.line),0),!0);if(t==i&&(s=!0,t=i.childNodes[a],a=0,!t)){var c=e.rest?be(e.rest):e.line;return Gr(P(b(c),c.text.length),s)}var d=t.nodeType==3?t:null,h=t;for(!d&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(d=t.firstChild,a&&(a=d.nodeValue.length));h.parentNode!=i;)h=h.parentNode;var g=e.measure,v=g.maps;function C(Y,ee,ae){for(var te=-1;te<(v?v.length:0);te++)for(var le=te<0?g.map:v[te],ve=0;ve<le.length;ve+=3){var ge=le[ve+2];if(ge==Y||ge==ee){var Ae=b(te<0?e.line:e.rest[te]),qe=le[ve]+ae;return(ae<0||ge!=Y)&&(qe=le[ve+(ae?1:0)]),P(Ae,qe)}}}var _=C(d,h,a);if(_)return Gr(_,s);for(var F=h.nextSibling,O=d?d.nodeValue.length-a:0;F;F=F.nextSibling){if(_=C(F,F.firstChild,0),_)return Gr(P(_.line,_.ch-O),s);O+=F.textContent.length}for(var B=h.previousSibling,U=a;B;B=B.previousSibling){if(_=C(B,B.firstChild,-1),_)return Gr(P(_.line,_.ch+U),s);U+=B.textContent.length}}var st=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ct,this.hasSelection=!1,this.composing=null,this.resetting=!1};st.prototype.init=function(e){var t=this,a=this,i=this.cm;this.createField(e);var s=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),N&&(s.style.width="0px"),me(s,"input",function(){m&&k>=9&&t.hasSelection&&(t.hasSelection=null),a.poll()}),me(s,"paste",function(d){tt(i,d)||jc(d,i)||(i.state.pasteIncoming=+new Date,a.fastPoll())});function c(d){if(!tt(i,d)){if(i.somethingSelected())Fa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var h=Uc(i);Fa({lineWise:!0,text:h.text}),d.type=="cut"?i.setSelections(h.ranges,null,ft):(a.prevInput="",s.value=h.text.join(`
|
|
20
20
|
`),E(s))}else return;d.type=="cut"&&(i.state.cutIncoming=+new Date)}}me(s,"cut",c),me(s,"copy",c),me(e.scroller,"paste",function(d){if(!(En(e,d)||tt(i,d))){if(!s.dispatchEvent){i.state.pasteIncoming=+new Date,a.focus();return}var h=new Event("paste");h.clipboardData=d.clipboardData,s.dispatchEvent(h)}}),me(e.lineSpace,"selectstart",function(d){En(e,d)||_t(d)}),me(s,"compositionstart",function(){var d=i.getCursor("from");a.composing&&a.composing.range.clear(),a.composing={start:d,range:i.markText(d,i.getCursor("to"),{className:"CodeMirror-composing"})}}),me(s,"compositionend",function(){a.composing&&(a.poll(),a.composing.range.clear(),a.composing=null)})},st.prototype.createField=function(e){this.wrapper=Gc(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},st.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},st.prototype.prepareSelection=function(){var e=this.cm,t=e.display,a=e.doc,i=$u(e);if(e.options.moveInputWithCursor){var s=dn(e,a.sel.primary().head,"div"),c=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,s.top+d.top-c.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,s.left+d.left-c.left))}return i},st.prototype.showSelection=function(e){var t=this.cm,a=t.display;Q(a.cursorDiv,e.cursors),Q(a.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},st.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var a=t.getSelection();this.textarea.value=a,t.state.focused&&E(this.textarea),m&&k>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",m&&k>=9&&(this.hasSelection=null));this.resetting=!1}},st.prototype.getField=function(){return this.textarea},st.prototype.supportsTouch=function(){return!1},st.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!V||M(_e(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},st.prototype.blur=function(){this.textarea.blur()},st.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},st.prototype.receivedFocus=function(){this.slowPoll()},st.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},st.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function a(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,a)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,a)},st.prototype.poll=function(){var e=this,t=this.cm,a=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||$n(a)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var s=a.value;if(s==i&&!t.somethingSelected())return!1;if(m&&k>=9&&this.hasSelection===s||ne&&/[\uf700-\uf7ff]/.test(s))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var c=s.charCodeAt(0);if(c==8203&&!i&&(i=""),c==8666)return this.reset(),this.cm.execCommand("undo")}for(var d=0,h=Math.min(i.length,s.length);d<h&&i.charCodeAt(d)==s.charCodeAt(d);)++d;return Ht(t,function(){ao(t,s.slice(d),i.length-d,null,e.composing?"*compose":null),s.length>1e3||s.indexOf(`
|
|
21
21
|
`)>-1?a.value=e.prevInput="":e.prevInput=s,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},st.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},st.prototype.onKeyPress=function(){m&&k>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,a=t.cm,i=a.display,s=t.textarea;t.contextMenuPending&&t.contextMenuPending();var c=ir(a,e),d=i.scroller.scrollTop;if(!c||z)return;var h=a.options.resetSelectionOnContextMenu;h&&a.doc.sel.contains(c)==-1&&yt(a,Lt)(a.doc,Wn(c),ft);var g=s.style.cssText,v=t.wrapper.style.cssText,C=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",s.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
22
22
|
top: `+(e.clientY-C.top-5)+"px; left: "+(e.clientX-C.left-5)+`px;
|
|
23
23
|
z-index: 1000; background: `+(m?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
24
|
-
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var _;S&&(_=s.ownerDocument.defaultView.scrollY),i.input.focus(),S&&s.ownerDocument.defaultView.scrollTo(null,_),i.input.reset(),a.somethingSelected()||(s.value=t.prevInput=" "),t.contextMenuPending=O,i.selForContextMenu=a.doc.sel,clearTimeout(i.detectingSelectAll);function R(){if(s.selectionStart!=null){var q=a.somethingSelected(),Y=""+(q?s.value:"");s.value="⇚",s.value=Y,t.prevInput=q?"":"",s.selectionStart=1,s.selectionEnd=Y.length,i.selForContextMenu=a.doc.sel}}function O(){if(t.contextMenuPending==O&&(t.contextMenuPending=!1,t.wrapper.style.cssText=v,s.style.cssText=g,m&&k<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=d),s.selectionStart!=null)){(!m||m&&k<9)&&R();var q=0,Y=function(){i.selForContextMenu==a.doc.sel&&s.selectionStart==0&&s.selectionEnd>0&&t.prevInput==""?yt(a,hc)(a):q++<10?i.detectingSelectAll=setTimeout(Y,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Y,200)}}if(m&&k>=9&&R(),Fe){Fn(e);var B=function(){Tt(window,"mouseup",B),setTimeout(O,20)};me(window,"mouseup",B)}else setTimeout(O,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function sv(e,t){if(t=t?ke(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var a=M(_e(e));t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body}function i(){e.value=h.getValue()}var s;if(e.form&&(me(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var c=e.form;s=c.submit;try{var d=c.submit=function(){i(),c.submit=s,c.submit(),c.submit=d}}catch{}}t.finishInit=function(g){g.save=i,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,i(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(Tt(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var h=Ye(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return h}function ov(e){e.off=Tt,e.on=me,e.wheelEventPixels=pm,e.Doc=Rt,e.splitLines=nn,e.countColumn=Le,e.findColumn=ht,e.isWordChar=ye,e.Pass=Ke,e.signal=et,e.Line=Ar,e.changeEnd=jn,e.scrollbarModel=ju,e.Pos=P,e.cmpPos=re,e.modes=Cr,e.mimeModes=un,e.resolveMode=Tr,e.getMode=_r,e.modeExtensions=Pn,e.extendMode=Lr,e.copyState=yn,e.startState=Er,e.innerMode=ci,e.commands=Ri,e.keyMap=An,e.keyName=Ic,e.isModifierKey=Lc,e.lookupKey=jr,e.normalizeKeyMap=Mm,e.StringStream=nt,e.SharedTextMarker=Di,e.TextMarker=qn,e.LineWidget=Ai,e.e_preventDefault=_t,e.e_stopPropagation=kr,e.e_stop=Fn,e.addClass=K,e.contains=A,e.rmClass=Pe,e.keyNames=Gn}Qm(Ye),nv(Ye);var lv="iter insert remove copy getEditor constructor".split(" ");for(var Ma in Rt.prototype)Rt.prototype.hasOwnProperty(Ma)&&we(lv,Ma)<0&&(Ye.prototype[Ma]=function(e){return function(){return e.apply(this.doc,arguments)}}(Rt.prototype[Ma]));return sn(Rt),Ye.inputStyles={textarea:st,contenteditable:We},Ye.defineMode=function(e){!Ye.defaults.mode&&e!="null"&&(Ye.defaults.mode=e),cn.apply(this,arguments)},Ye.defineMIME=tr,Ye.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ye.defineMIME("text/plain","null"),Ye.defineExtension=function(e,t){Ye.prototype[e]=t},Ye.defineDocExtension=function(e,t){Rt.prototype[e]=t},Ye.fromTextArea=sv,ov(Ye),Ye.version="5.65.20",Ye})}(Pa)),Pa.exports}(function(l,n){(function(r){r(jt())})(function(r){r.defineMode("javascript",function(o,u){var f=o.indentUnit,p=u.statementIndent,y=u.jsonld,m=u.json||y,k=u.trackScope!==!1,S=u.typescript,F=u.wordCharacters||/[\w$\xa1-\uffff]/,L=function(){function b(mt){return{type:mt,style:"keyword"}}var T=b("keyword a"),U=b("keyword b"),X=b("keyword c"),P=b("keyword d"),re=b("operator"),ze={type:"atom",style:"atom"};return{if:b("if"),while:T,with:T,else:U,do:U,try:U,finally:U,return:P,break:P,continue:P,new:b("new"),delete:X,void:X,throw:X,debugger:b("debugger"),var:b("var"),const:b("var"),let:b("var"),function:b("function"),catch:b("catch"),for:b("for"),switch:b("switch"),case:b("case"),default:b("default"),in:re,typeof:re,instanceof:re,true:ze,false:ze,null:ze,undefined:ze,NaN:ze,Infinity:ze,this:b("this"),class:b("class"),super:b("atom"),yield:X,export:b("export"),import:b("import"),extends:X,await:X}}(),W=/[+\-*&%=<>!?|~^@]/,z=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function D(b){for(var T=!1,U,X=!1;(U=b.next())!=null;){if(!T){if(U=="/"&&!X)return;U=="["?X=!0:X&&U=="]"&&(X=!1)}T=!T&&U=="\\"}}var $,I;function N(b,T,U){return $=b,I=U,T}function H(b,T){var U=b.next();if(U=='"'||U=="'")return T.tokenize=V(U),T.tokenize(b,T);if(U=="."&&b.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return N("number","number");if(U=="."&&b.match(".."))return N("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(U))return N(U);if(U=="="&&b.eat(">"))return N("=>","operator");if(U=="0"&&b.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return N("number","number");if(/\d/.test(U))return b.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),N("number","number");if(U=="/")return b.eat("*")?(T.tokenize=ne,ne(b,T)):b.eat("/")?(b.skipToEnd(),N("comment","comment")):Xt(b,T,1)?(D(b),b.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),N("regexp","string-2")):(b.eat("="),N("operator","operator",b.current()));if(U=="`")return T.tokenize=ue,ue(b,T);if(U=="#"&&b.peek()=="!")return b.skipToEnd(),N("meta","meta");if(U=="#"&&b.eatWhile(F))return N("variable","property");if(U=="<"&&b.match("!--")||U=="-"&&b.match("->")&&!/\S/.test(b.string.slice(0,b.start)))return b.skipToEnd(),N("comment","comment");if(W.test(U))return(U!=">"||!T.lexical||T.lexical.type!=">")&&(b.eat("=")?(U=="!"||U=="=")&&b.eat("="):/[<>*+\-|&?]/.test(U)&&(b.eat(U),U==">"&&b.eat(U))),U=="?"&&b.eat(".")?N("."):N("operator","operator",b.current());if(F.test(U)){b.eatWhile(F);var X=b.current();if(T.lastType!="."){if(L.propertyIsEnumerable(X)){var P=L[X];return N(P.type,P.style,X)}if(X=="async"&&b.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return N("async","keyword",X)}return N("variable","variable",X)}}function V(b){return function(T,U){var X=!1,P;if(y&&T.peek()=="@"&&T.match(z))return U.tokenize=H,N("jsonld-keyword","meta");for(;(P=T.next())!=null&&!(P==b&&!X);)X=!X&&P=="\\";return X||(U.tokenize=H),N("string","string")}}function ne(b,T){for(var U=!1,X;X=b.next();){if(X=="/"&&U){T.tokenize=H;break}U=X=="*"}return N("comment","comment")}function ue(b,T){for(var U=!1,X;(X=b.next())!=null;){if(!U&&(X=="`"||X=="$"&&b.eat("{"))){T.tokenize=H;break}U=!U&&X=="\\"}return N("quasi","string-2",b.current())}var se="([{}])";function de(b,T){T.fatArrowAt&&(T.fatArrowAt=null);var U=b.string.indexOf("=>",b.start);if(!(U<0)){if(S){var X=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(b.string.slice(b.start,U));X&&(U=X.index)}for(var P=0,re=!1,ze=U-1;ze>=0;--ze){var mt=b.string.charAt(ze),Ot=se.indexOf(mt);if(Ot>=0&&Ot<3){if(!P){++ze;break}if(--P==0){mt=="("&&(re=!0);break}}else if(Ot>=3&&Ot<6)++P;else if(F.test(mt))re=!0;else if(/["'\/`]/.test(mt))for(;;--ze){if(ze==0)return;var Ir=b.string.charAt(ze-1);if(Ir==mt&&b.string.charAt(ze-2)!="\\"){ze--;break}}else if(re&&!P){++ze;break}}re&&!P&&(T.fatArrowAt=ze)}}var Oe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function Fe(b,T,U,X,P,re){this.indented=b,this.column=T,this.type=U,this.prev=P,this.info=re,X!=null&&(this.align=X)}function ie(b,T){if(!k)return!1;for(var U=b.localVars;U;U=U.next)if(U.name==T)return!0;for(var X=b.context;X;X=X.prev)for(var U=X.vars;U;U=U.next)if(U.name==T)return!0}function Pe(b,T,U,X,P){var re=b.cc;for(j.state=b,j.stream=P,j.marked=null,j.cc=re,j.style=T,b.lexical.hasOwnProperty("align")||(b.lexical.align=!0);;){var ze=re.length?re.pop():m?we:Le;if(ze(U,X)){for(;re.length&&re[re.length-1].lex;)re.pop()();return j.marked?j.marked:U=="variable"&&ie(b,X)?"variable-2":T}}}var j={state:null,marked:null,cc:null};function Q(){for(var b=arguments.length-1;b>=0;b--)j.cc.push(arguments[b])}function w(){return Q.apply(null,arguments),!0}function J(b,T){for(var U=T;U;U=U.next)if(U.name==b)return!0;return!1}function G(b){var T=j.state;if(j.marked="def",!!k){if(T.context){if(T.lexical.info=="var"&&T.context&&T.context.block){var U=A(b,T.context);if(U!=null){T.context=U;return}}else if(!J(b,T.localVars)){T.localVars=new he(b,T.localVars);return}}u.globalVars&&!J(b,T.globalVars)&&(T.globalVars=new he(b,T.globalVars))}}function A(b,T){if(T)if(T.block){var U=A(b,T.prev);return U?U==T.prev?T:new K(U,T.vars,!0):null}else return J(b,T.vars)?T:new K(T.prev,new he(b,T.vars),!1);else return null}function M(b){return b=="public"||b=="private"||b=="protected"||b=="abstract"||b=="readonly"}function K(b,T,U){this.prev=b,this.vars=T,this.block=U}function he(b,T){this.name=b,this.next=T}var E=new he("this",new he("arguments",null));function x(){j.state.context=new K(j.state.context,j.state.localVars,!1),j.state.localVars=E}function oe(){j.state.context=new K(j.state.context,j.state.localVars,!0),j.state.localVars=null}x.lex=oe.lex=!0;function _e(){j.state.localVars=j.state.context.vars,j.state.context=j.state.context.prev}_e.lex=!0;function Z(b,T){var U=function(){var X=j.state,P=X.indented;if(X.lexical.type=="stat")P=X.lexical.indented;else for(var re=X.lexical;re&&re.type==")"&&re.align;re=re.prev)P=re.indented;X.lexical=new Fe(P,j.stream.column(),b,null,X.lexical,T)};return U.lex=!0,U}function fe(){var b=j.state;b.lexical.prev&&(b.lexical.type==")"&&(b.indented=b.lexical.indented),b.lexical=b.lexical.prev)}fe.lex=!0;function ke(b){function T(U){return U==b?w():b==";"||U=="}"||U==")"||U=="]"?Q():w(T)}return T}function Le(b,T){return b=="var"?w(Z("vardef",T),kr,ke(";"),fe):b=="keyword a"?w(Z("form"),Ke,Le,fe):b=="keyword b"?w(Z("form"),Le,fe):b=="keyword d"?j.stream.match(/^\s*$/,!1)?w():w(Z("stat"),Pt,ke(";"),fe):b=="debugger"?w(ke(";")):b=="{"?w(Z("}"),oe,en,fe,_e):b==";"?w():b=="if"?(j.state.lexical.info=="else"&&j.state.cc[j.state.cc.length-1]==fe&&j.state.cc.pop()(),w(Z("form"),Ke,Le,fe,Sr)):b=="function"?w(nn):b=="for"?w(Z("form"),oe,aa,Le,_e,fe):b=="class"||S&&T=="interface"?(j.marked="keyword",w(Z("form",b=="class"?b:T),Cr,fe)):b=="variable"?S&&T=="declare"?(j.marked="keyword",w(Le)):S&&(T=="module"||T=="enum"||T=="type")&&j.stream.match(/^\s*\w/,!1)?(j.marked="keyword",T=="enum"?w(ce):T=="type"?w(sa,ke("operator"),$e,ke(";")):w(Z("form"),Dt,ke("{"),Z("}"),en,fe,fe)):S&&T=="namespace"?(j.marked="keyword",w(Z("form"),we,Le,fe)):S&&T=="abstract"?(j.marked="keyword",w(Le)):w(Z("stat"),wr):b=="switch"?w(Z("form"),Ke,ke("{"),Z("}","switch"),oe,en,fe,fe,_e):b=="case"?w(we,ke(":")):b=="default"?w(ke(":")):b=="catch"?w(Z("form"),x,ct,Le,fe,_e):b=="export"?w(Z("stat"),Tr,fe):b=="import"?w(Z("stat"),Pn,fe):b=="async"?w(Le):T=="@"?w(we,Le):Q(Z("stat"),we,ke(";"),fe)}function ct(b){if(b=="(")return w(ln,ke(")"))}function we(b,T){return ft(b,T,!1)}function Re(b,T){return ft(b,T,!0)}function Ke(b){return b!="("?Q():w(Z(")"),Pt,ke(")"),fe)}function ft(b,T,U){if(j.state.fatArrowAt==j.stream.start){var X=U?St:be;if(b=="(")return w(x,Z(")"),Ie(ln,")"),fe,ke("=>"),X,_e);if(b=="variable")return Q(x,Dt,ke("=>"),X,_e)}var P=U?ht:dt;return Oe.hasOwnProperty(b)?w(P):b=="function"?w(nn,P):b=="class"||S&&T=="interface"?(j.marked="keyword",w(Z("form"),ms,fe)):b=="keyword c"||b=="async"?w(U?Re:we):b=="("?w(Z(")"),Pt,ke(")"),fe,P):b=="operator"||b=="spread"?w(U?Re:we):b=="["?w(Z("]"),nt,fe,P):b=="{"?zt(xe,"}",null,P):b=="quasi"?Q(gt,P):b=="new"?w(Vt(U)):w()}function Pt(b){return b.match(/[;\}\)\],]/)?Q():Q(we)}function dt(b,T){return b==","?w(Pt):ht(b,T,!1)}function ht(b,T,U){var X=U==!1?dt:ht,P=U==!1?we:Re;if(b=="=>")return w(x,U?St:be,_e);if(b=="operator")return/\+\+|--/.test(T)||S&&T=="!"?w(X):S&&T=="<"&&j.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?w(Z(">"),Ie($e,">"),fe,X):T=="?"?w(we,ke(":"),P):w(P);if(b=="quasi")return Q(gt,X);if(b!=";"){if(b=="(")return zt(Re,")","call",X);if(b==".")return w(ye,X);if(b=="[")return w(Z("]"),Pt,ke("]"),fe,X);if(S&&T=="as")return j.marked="keyword",w($e,X);if(b=="regexp")return j.state.lastType=j.marked="operator",j.stream.backUp(j.stream.pos-j.stream.start-1),w(P)}}function gt(b,T){return b!="quasi"?Q():T.slice(T.length-2)!="${"?w(gt):w(Pt,Kt)}function Kt(b){if(b=="}")return j.marked="string-2",j.state.tokenize=ue,w(gt)}function be(b){return de(j.stream,j.state),Q(b=="{"?Le:we)}function St(b){return de(j.stream,j.state),Q(b=="{"?Le:Re)}function Vt(b){return function(T){return T=="."?w(b?Zn:On):T=="variable"&&S?w(Bt,b?ht:dt):Q(b?Re:we)}}function On(b,T){if(T=="target")return j.marked="keyword",w(dt)}function Zn(b,T){if(T=="target")return j.marked="keyword",w(ht)}function wr(b){return b==":"?w(fe,Le):Q(dt,ke(";"),fe)}function ye(b){if(b=="variable")return j.marked="property",w()}function xe(b,T){if(b=="async")return j.marked="property",w(xe);if(b=="variable"||j.style=="keyword"){if(j.marked="property",T=="get"||T=="set")return w(pe);var U;return S&&j.state.fatArrowAt==j.stream.start&&(U=j.stream.match(/^\s*:\s*/,!1))&&(j.state.fatArrowAt=j.stream.pos+U[0].length),w(Me)}else{if(b=="number"||b=="string")return j.marked=y?"property":j.style+" property",w(Me);if(b=="jsonld-keyword")return w(Me);if(S&&M(T))return j.marked="keyword",w(xe);if(b=="[")return w(we,Nn,ke("]"),Me);if(b=="spread")return w(Re,Me);if(T=="*")return j.marked="keyword",w(xe);if(b==":")return Q(Me)}}function pe(b){return b!="variable"?Q(Me):(j.marked="property",w(nn))}function Me(b){if(b==":")return w(Re);if(b=="(")return Q(nn)}function Ie(b,T,U){function X(P,re){if(U?U.indexOf(P)>-1:P==","){var ze=j.state.lexical;return ze.info=="call"&&(ze.pos=(ze.pos||0)+1),w(function(mt,Ot){return mt==T||Ot==T?Q():Q(b)},X)}return P==T||re==T?w():U&&U.indexOf(";")>-1?Q(b):w(ke(T))}return function(P,re){return P==T||re==T?w():Q(b,X)}}function zt(b,T,U){for(var X=3;X<arguments.length;X++)j.cc.push(arguments[X]);return w(Z(T,U),Ie(b,T),fe)}function en(b){return b=="}"?w():Q(Le,en)}function Nn(b,T){if(S){if(b==":")return w($e);if(T=="?")return w(Nn)}}function er(b,T){if(S&&(b==":"||T=="in"))return w($e)}function Rn(b){if(S&&b==":")return j.stream.match(/^\s*\w+\s+is\b/,!1)?w(we,ps,$e):w($e)}function ps(b,T){if(T=="is")return j.marked="keyword",w()}function $e(b,T){if(T=="keyof"||T=="typeof"||T=="infer"||T=="readonly")return j.marked="keyword",w(T=="typeof"?Re:$e);if(b=="variable"||T=="void")return j.marked="type",w(tn);if(T=="|"||T=="&")return w($e);if(b=="string"||b=="number"||b=="atom")return w(tn);if(b=="[")return w(Z("]"),Ie($e,"]",","),fe,tn);if(b=="{")return w(Z("}"),me,fe,tn);if(b=="(")return w(Ie(tt,")"),ia,tn);if(b=="<")return w(Ie($e,">"),$e);if(b=="quasi")return Q(Tt,tn)}function ia(b){if(b=="=>")return w($e)}function me(b){return b.match(/[\}\)\]]/)?w():b==","||b==";"?w(me):Q(Cn,me)}function Cn(b,T){if(b=="variable"||j.style=="keyword")return j.marked="property",w(Cn);if(T=="?"||b=="number"||b=="string")return w(Cn);if(b==":")return w($e);if(b=="[")return w(ke("variable"),er,ke("]"),Cn);if(b=="(")return Q($n,Cn);if(!b.match(/[;\}\)\],]/))return w()}function Tt(b,T){return b!="quasi"?Q():T.slice(T.length-2)!="${"?w(Tt):w($e,et)}function et(b){if(b=="}")return j.marked="string-2",j.state.tokenize=ue,w(Tt)}function tt(b,T){return b=="variable"&&j.stream.match(/^\s*[?:]/,!1)||T=="?"?w(tt):b==":"?w($e):b=="spread"?w(tt):Q($e)}function tn(b,T){if(T=="<")return w(Z(">"),Ie($e,">"),fe,tn);if(T=="|"||b=="."||T=="&")return w($e);if(b=="[")return w($e,ke("]"),tn);if(T=="extends"||T=="implements")return j.marked="keyword",w($e);if(T=="?")return w($e,ke(":"),$e)}function Bt(b,T){if(T=="<")return w(Z(">"),Ie($e,">"),fe,tn)}function sn(){return Q($e,_t)}function _t(b,T){if(T=="=")return w($e)}function kr(b,T){return T=="enum"?(j.marked="keyword",w(ce)):Q(Dt,Nn,on,gs)}function Dt(b,T){if(S&&M(T))return j.marked="keyword",w(Dt);if(b=="variable")return G(T),w();if(b=="spread")return w(Dt);if(b=="[")return zt(li,"]");if(b=="{")return zt(Fn,"}")}function Fn(b,T){return b=="variable"&&!j.stream.match(/^\s*:/,!1)?(G(T),w(on)):(b=="variable"&&(j.marked="property"),b=="spread"?w(Dt):b=="}"?Q():b=="["?w(we,ke("]"),ke(":"),Fn):w(ke(":"),Dt,on))}function li(){return Q(Dt,on)}function on(b,T){if(T=="=")return w(Re)}function gs(b){if(b==",")return w(kr)}function Sr(b,T){if(b=="keyword b"&&T=="else")return w(Z("form","else"),Le,fe)}function aa(b,T){if(T=="await")return w(aa);if(b=="(")return w(Z(")"),ui,fe)}function ui(b){return b=="var"?w(kr,Mn):b=="variable"?w(Mn):Q(Mn)}function Mn(b,T){return b==")"?w():b==";"?w(Mn):T=="in"||T=="of"?(j.marked="keyword",w(we,Mn)):Q(we,Mn)}function nn(b,T){if(T=="*")return j.marked="keyword",w(nn);if(b=="variable")return G(T),w(nn);if(b=="(")return w(x,Z(")"),Ie(ln,")"),fe,Rn,Le,_e);if(S&&T=="<")return w(Z(">"),Ie(sn,">"),fe,nn)}function $n(b,T){if(T=="*")return j.marked="keyword",w($n);if(b=="variable")return G(T),w($n);if(b=="(")return w(x,Z(")"),Ie(ln,")"),fe,Rn,_e);if(S&&T=="<")return w(Z(">"),Ie(sn,">"),fe,$n)}function sa(b,T){if(b=="keyword"||b=="variable")return j.marked="type",w(sa);if(T=="<")return w(Z(">"),Ie(sn,">"),fe)}function ln(b,T){return T=="@"&&w(we,ln),b=="spread"?w(ln):S&&M(T)?(j.marked="keyword",w(ln)):S&&b=="this"?w(Nn,on):Q(Dt,Nn,on)}function ms(b,T){return b=="variable"?Cr(b,T):un(b,T)}function Cr(b,T){if(b=="variable")return G(T),w(un)}function un(b,T){if(T=="<")return w(Z(">"),Ie(sn,">"),fe,un);if(T=="extends"||T=="implements"||S&&b==",")return T=="implements"&&(j.marked="keyword"),w(S?$e:we,un);if(b=="{")return w(Z("}"),cn,fe)}function cn(b,T){if(b=="async"||b=="variable"&&(T=="static"||T=="get"||T=="set"||S&&M(T))&&j.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return j.marked="keyword",w(cn);if(b=="variable"||j.style=="keyword")return j.marked="property",w(tr,cn);if(b=="number"||b=="string")return w(tr,cn);if(b=="[")return w(we,Nn,ke("]"),tr,cn);if(T=="*")return j.marked="keyword",w(cn);if(S&&b=="(")return Q($n,cn);if(b==";"||b==",")return w(cn);if(b=="}")return w();if(T=="@")return w(we,cn)}function tr(b,T){if(T=="!"||T=="?")return w(tr);if(b==":")return w($e,on);if(T=="=")return w(Re);var U=j.state.lexical.prev,X=U&&U.info=="interface";return Q(X?$n:nn)}function Tr(b,T){return T=="*"?(j.marked="keyword",w(Er,ke(";"))):T=="default"?(j.marked="keyword",w(we,ke(";"))):b=="{"?w(Ie(_r,"}"),Er,ke(";")):Q(Le)}function _r(b,T){if(T=="as")return j.marked="keyword",w(ke("variable"));if(b=="variable")return Q(Re,_r)}function Pn(b){return b=="string"?w():b=="("?Q(we):b=="."?Q(dt):Q(Lr,yn,Er)}function Lr(b,T){return b=="{"?zt(Lr,"}"):(b=="variable"&&G(T),T=="*"&&(j.marked="keyword"),w(ci))}function yn(b){if(b==",")return w(Lr,yn)}function ci(b,T){if(T=="as")return j.marked="keyword",w(Lr)}function Er(b,T){if(T=="from")return j.marked="keyword",w(we)}function nt(b){return b=="]"?w():Q(Ie(Re,"]"))}function ce(){return Q(Z("form"),Dt,ke("{"),Z("}"),Ie(Tn,"}"),fe,fe)}function Tn(){return Q(Dt,on)}function fi(b,T){return b.lastType=="operator"||b.lastType==","||W.test(T.charAt(0))||/[,.]/.test(T.charAt(0))}function Xt(b,T,U){return T.tokenize==H&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(T.lastType)||T.lastType=="quasi"&&/\{\s*$/.test(b.string.slice(0,b.pos-(U||0)))}return{startState:function(b){var T={tokenize:H,lastType:"sof",cc:[],lexical:new Fe((b||0)-f,0,"block",!1),localVars:u.localVars,context:u.localVars&&new K(null,null,!1),indented:b||0};return u.globalVars&&typeof u.globalVars=="object"&&(T.globalVars=u.globalVars),T},token:function(b,T){if(b.sol()&&(T.lexical.hasOwnProperty("align")||(T.lexical.align=!1),T.indented=b.indentation(),de(b,T)),T.tokenize!=ne&&b.eatSpace())return null;var U=T.tokenize(b,T);return $=="comment"?U:(T.lastType=$=="operator"&&(I=="++"||I=="--")?"incdec":$,Pe(T,U,$,I,b))},indent:function(b,T){if(b.tokenize==ne||b.tokenize==ue)return r.Pass;if(b.tokenize!=H)return 0;var U=T&&T.charAt(0),X=b.lexical,P;if(!/^\s*else\b/.test(T))for(var re=b.cc.length-1;re>=0;--re){var ze=b.cc[re];if(ze==fe)X=X.prev;else if(ze!=Sr&&ze!=_e)break}for(;(X.type=="stat"||X.type=="form")&&(U=="}"||(P=b.cc[b.cc.length-1])&&(P==dt||P==ht)&&!/^[,\.=+\-*:?[\(]/.test(T));)X=X.prev;p&&X.type==")"&&X.prev.type=="stat"&&(X=X.prev);var mt=X.type,Ot=U==mt;return mt=="vardef"?X.indented+(b.lastType=="operator"||b.lastType==","?X.info.length+1:0):mt=="form"&&U=="{"?X.indented:mt=="form"?X.indented+f:mt=="stat"?X.indented+(fi(b,T)?p||f:0):X.info=="switch"&&!Ot&&u.doubleIndentSwitch!=!1?X.indented+(/^(?:case|default)\b/.test(T)?f:2*f):X.align?X.column+(Ot?0:1):X.indented+(Ot?0:f)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:m?null:"/*",blockCommentEnd:m?null:"*/",blockCommentContinue:m?null:" * ",lineComment:m?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:m?"json":"javascript",jsonldMode:y,jsonMode:m,expressionAllowed:Xt,skipExpression:function(b){Pe(b,"atom","atom","true",new r.StringStream("",2,null))}}}),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})(),function(l,n){(function(r){r(jt())})(function(r){var o={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},u=r.Pos;r.defineOption("autoCloseBrackets",!1,function(I,N,H){H&&H!=r.Init&&(I.removeKeyMap(p),I.state.closeBrackets=null),N&&(y(f(N,"pairs")),I.state.closeBrackets=N,I.addKeyMap(p))});function f(I,N){return N=="pairs"&&typeof I=="string"?I:typeof I=="object"&&I[N]!=null?I[N]:o[N]}var p={Backspace:S,Enter:F};function y(I){for(var N=0;N<I.length;N++){var H=I.charAt(N),V="'"+H+"'";p[V]||(p[V]=m(H))}}y(o.pairs+"`");function m(I){return function(N){return z(N,I)}}function k(I){var N=I.state.closeBrackets;if(!N||N.override)return N;var H=I.getModeAt(I.getCursor());return H.closeBrackets||N}function S(I){var N=k(I);if(!N||I.getOption("disableInput"))return r.Pass;for(var H=f(N,"pairs"),V=I.listSelections(),ne=0;ne<V.length;ne++){if(!V[ne].empty())return r.Pass;var ue=D(I,V[ne].head);if(!ue||H.indexOf(ue)%2!=0)return r.Pass}for(var ne=V.length-1;ne>=0;ne--){var se=V[ne].head;I.replaceRange("",u(se.line,se.ch-1),u(se.line,se.ch+1),"+delete")}}function F(I){var N=k(I),H=N&&f(N,"explode");if(!H||I.getOption("disableInput"))return r.Pass;for(var V=I.listSelections(),ne=0;ne<V.length;ne++){if(!V[ne].empty())return r.Pass;var ue=D(I,V[ne].head);if(!ue||H.indexOf(ue)%2!=0)return r.Pass}I.operation(function(){var se=I.lineSeparator()||`
|
|
25
|
-
`;I.replaceSelection(se+se,null),L(I,-1),V=I.listSelections();for(var de=0;de<V.length;de++){var Oe=V[de].head.line;I.indentLine(Oe,null,!0),I.indentLine(Oe+1,null,!0)}})}function L(I,N){for(var H=[],V=I.listSelections(),ne=0,ue=0;ue<V.length;ue++){var se=V[ue];se.head==I.getCursor()&&(ne=ue);var de=se.head.ch||N>0?{line:se.head.line,ch:se.head.ch+N}:{line:se.head.line-1};H.push({anchor:de,head:de})}I.setSelections(H,ne)}function W(I){var N=r.cmpPos(I.anchor,I.head)>0;return{anchor:new u(I.anchor.line,I.anchor.ch+(N?-1:1)),head:new u(I.head.line,I.head.ch+(N?1:-1))}}function z(I,N){var H=k(I);if(!H||I.getOption("disableInput"))return r.Pass;var V=f(H,"pairs"),ne=V.indexOf(N);if(ne==-1)return r.Pass;for(var ue=f(H,"closeBefore"),se=f(H,"triples"),de=V.charAt(ne+1)==N,Oe=I.listSelections(),Fe=ne%2==0,ie,Pe=0;Pe<Oe.length;Pe++){var j=Oe[Pe],Q=j.head,w,J=I.getRange(Q,u(Q.line,Q.ch+1));if(Fe&&!j.empty())w="surround";else if((de||!Fe)&&J==N)de&&$(I,Q)?w="both":se.indexOf(N)>=0&&I.getRange(Q,u(Q.line,Q.ch+3))==N+N+N?w="skipThree":w="skip";else if(de&&Q.ch>1&&se.indexOf(N)>=0&&I.getRange(u(Q.line,Q.ch-2),Q)==N+N){if(Q.ch>2&&/\bstring/.test(I.getTokenTypeAt(u(Q.line,Q.ch-2))))return r.Pass;w="addFour"}else if(de){var G=Q.ch==0?" ":I.getRange(u(Q.line,Q.ch-1),Q);if(!r.isWordChar(J)&&G!=N&&!r.isWordChar(G))w="both";else return r.Pass}else if(Fe&&(J.length===0||/\s/.test(J)||ue.indexOf(J)>-1))w="both";else return r.Pass;if(!ie)ie=w;else if(ie!=w)return r.Pass}var A=ne%2?V.charAt(ne-1):N,M=ne%2?N:V.charAt(ne+1);I.operation(function(){if(ie=="skip")L(I,1);else if(ie=="skipThree")L(I,3);else if(ie=="surround"){for(var K=I.getSelections(),he=0;he<K.length;he++)K[he]=A+K[he]+M;I.replaceSelections(K,"around"),K=I.listSelections().slice();for(var he=0;he<K.length;he++)K[he]=W(K[he]);I.setSelections(K)}else ie=="both"?(I.replaceSelection(A+M,null),I.triggerElectric(A+M),L(I,-1)):ie=="addFour"&&(I.replaceSelection(A+A+A+A,"before"),L(I,1))})}function D(I,N){var H=I.getRange(u(N.line,N.ch-1),u(N.line,N.ch+1));return H.length==2?H:null}function $(I,N){var H=I.getTokenAt(u(N.line,N.ch+1));return/\bstring/.test(H.type)&&H.start==N.ch&&(N.ch==0||!/\bstring/.test(I.getTokenTypeAt(N)))}})}(),function(l,n){(function(r){r(jt())})(function(r){var o=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),u=r.Pos,f={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function p(L){return L&&L.bracketRegex||/[(){}[\]]/}function y(L,W,z){var D=L.getLineHandle(W.line),$=W.ch-1,I=z&&z.afterCursor;I==null&&(I=/(^| )cm-fat-cursor($| )/.test(L.getWrapperElement().className));var N=p(z),H=!I&&$>=0&&N.test(D.text.charAt($))&&f[D.text.charAt($)]||N.test(D.text.charAt($+1))&&f[D.text.charAt(++$)];if(!H)return null;var V=H.charAt(1)==">"?1:-1;if(z&&z.strict&&V>0!=($==W.ch))return null;var ne=L.getTokenTypeAt(u(W.line,$+1)),ue=m(L,u(W.line,$+(V>0?1:0)),V,ne,z);return ue==null?null:{from:u(W.line,$),to:ue&&ue.pos,match:ue&&ue.ch==H.charAt(0),forward:V>0}}function m(L,W,z,D,$){for(var I=$&&$.maxScanLineLength||1e4,N=$&&$.maxScanLines||1e3,H=[],V=p($),ne=z>0?Math.min(W.line+N,L.lastLine()+1):Math.max(L.firstLine()-1,W.line-N),ue=W.line;ue!=ne;ue+=z){var se=L.getLine(ue);if(se){var de=z>0?0:se.length-1,Oe=z>0?se.length:-1;if(!(se.length>I))for(ue==W.line&&(de=W.ch-(z<0?1:0));de!=Oe;de+=z){var Fe=se.charAt(de);if(V.test(Fe)&&(D===void 0||(L.getTokenTypeAt(u(ue,de+1))||"")==(D||""))){var ie=f[Fe];if(ie&&ie.charAt(1)==">"==z>0)H.push(Fe);else if(H.length)H.pop();else return{pos:u(ue,de),ch:Fe}}}}}return ue-z==(z>0?L.lastLine():L.firstLine())?!1:null}function k(L,W,z){for(var D=L.state.matchBrackets.maxHighlightLineLength||1e3,$=z&&z.highlightNonMatching,I=[],N=L.listSelections(),H=0;H<N.length;H++){var V=N[H].empty()&&y(L,N[H].head,z);if(V&&(V.match||$!==!1)&&L.getLine(V.from.line).length<=D){var ne=V.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";I.push(L.markText(V.from,u(V.from.line,V.from.ch+1),{className:ne})),V.to&&L.getLine(V.to.line).length<=D&&I.push(L.markText(V.to,u(V.to.line,V.to.ch+1),{className:ne}))}}if(I.length){o&&L.state.focused&&L.focus();var ue=function(){L.operation(function(){for(var se=0;se<I.length;se++)I[se].clear()})};if(W)setTimeout(ue,800);else return ue}}function S(L){L.operation(function(){L.state.matchBrackets.currentlyHighlighted&&(L.state.matchBrackets.currentlyHighlighted(),L.state.matchBrackets.currentlyHighlighted=null),L.state.matchBrackets.currentlyHighlighted=k(L,!1,L.state.matchBrackets)})}function F(L){L.state.matchBrackets&&L.state.matchBrackets.currentlyHighlighted&&(L.state.matchBrackets.currentlyHighlighted(),L.state.matchBrackets.currentlyHighlighted=null)}r.defineOption("matchBrackets",!1,function(L,W,z){z&&z!=r.Init&&(L.off("cursorActivity",S),L.off("focus",S),L.off("blur",F),F(L)),W&&(L.state.matchBrackets=typeof W=="object"?W:{},L.on("cursorActivity",S),L.on("focus",S),L.on("blur",F))}),r.defineExtension("matchBrackets",function(){k(this,!0)}),r.defineExtension("findMatchingBracket",function(L,W,z){return(z||typeof W=="boolean")&&(z?(z.strict=W,W=z):W=W?{strict:!0}:null),y(this,L,W)}),r.defineExtension("scanForBracket",function(L,W,z,D){return m(this,L,W,z,D)})})}();var Zc={exports:{}};(function(l,n){(function(r){r(jt())})(function(r){function o(y,m,k,S){if(k&&k.call){var F=k;k=null}else var F=p(y,k,"rangeFinder");typeof m=="number"&&(m=r.Pos(m,0));var L=p(y,k,"minFoldSize");function W(I){var N=F(y,m);if(!N||N.to.line-N.from.line<L)return null;if(S==="fold")return N;for(var H=y.findMarksAt(N.from),V=0;V<H.length;++V)if(H[V].__isFold){if(!I)return null;N.cleared=!0,H[V].clear()}return N}var z=W(!0);if(p(y,k,"scanUp"))for(;!z&&m.line>y.firstLine();)m=r.Pos(m.line-1,0),z=W(!1);if(!(!z||z.cleared||S==="unfold")){var D=u(y,k,z);r.on(D,"mousedown",function(I){$.clear(),r.e_preventDefault(I)});var $=y.markText(z.from,z.to,{replacedWith:D,clearOnEnter:p(y,k,"clearOnEnter"),__isFold:!0});$.on("clear",function(I,N){r.signal(y,"unfold",y,I,N)}),r.signal(y,"fold",y,z.from,z.to)}}function u(y,m,k){var S=p(y,m,"widget");if(typeof S=="function"&&(S=S(k.from,k.to)),typeof S=="string"){var F=document.createTextNode(S);S=document.createElement("span"),S.appendChild(F),S.className="CodeMirror-foldmarker"}else S&&(S=S.cloneNode(!0));return S}r.newFoldFunction=function(y,m){return function(k,S){o(k,S,{rangeFinder:y,widget:m})}},r.defineExtension("foldCode",function(y,m,k){o(this,y,m,k)}),r.defineExtension("isFolded",function(y){for(var m=this.findMarksAt(y),k=0;k<m.length;++k)if(m[k].__isFold)return!0}),r.commands.toggleFold=function(y){y.foldCode(y.getCursor())},r.commands.fold=function(y){y.foldCode(y.getCursor(),null,"fold")},r.commands.unfold=function(y){y.foldCode(y.getCursor(),{scanUp:!1},"unfold")},r.commands.foldAll=function(y){y.operation(function(){for(var m=y.firstLine(),k=y.lastLine();m<=k;m++)y.foldCode(r.Pos(m,0),{scanUp:!1},"fold")})},r.commands.unfoldAll=function(y){y.operation(function(){for(var m=y.firstLine(),k=y.lastLine();m<=k;m++)y.foldCode(r.Pos(m,0),{scanUp:!1},"unfold")})},r.registerHelper("fold","combine",function(){var y=Array.prototype.slice.call(arguments,0);return function(m,k){for(var S=0;S<y.length;++S){var F=y[S](m,k);if(F)return F}}}),r.registerHelper("fold","auto",function(y,m){for(var k=y.getHelpers(m,"fold"),S=0;S<k.length;S++){var F=k[S](y,m);if(F)return F}});var f={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};r.defineOption("foldOptions",null);function p(y,m,k){if(m&&m[k]!==void 0)return m[k];var S=y.options.foldOptions;return S&&S[k]!==void 0?S[k]:f[k]}r.defineExtension("foldOption",function(y,m){return p(this,y,m)})})})();var ef=Zc.exports;(function(l,n){(function(r){r(jt(),ef)})(function(r){r.defineOption("foldGutter",!1,function($,I,N){N&&N!=r.Init&&($.clearGutter($.state.foldGutter.options.gutter),$.state.foldGutter=null,$.off("gutterClick",F),$.off("changes",W),$.off("viewportChange",z),$.off("fold",D),$.off("unfold",D),$.off("swapDoc",W),$.off("optionChange",L)),I&&($.state.foldGutter=new u(f(I)),S($),$.on("gutterClick",F),$.on("changes",W),$.on("viewportChange",z),$.on("fold",D),$.on("unfold",D),$.on("swapDoc",W),$.on("optionChange",L))});var o=r.Pos;function u($){this.options=$,this.from=this.to=0}function f($){return $===!0&&($={}),$.gutter==null&&($.gutter="CodeMirror-foldgutter"),$.indicatorOpen==null&&($.indicatorOpen="CodeMirror-foldgutter-open"),$.indicatorFolded==null&&($.indicatorFolded="CodeMirror-foldgutter-folded"),$}function p($,I){for(var N=$.findMarks(o(I,0),o(I+1,0)),H=0;H<N.length;++H)if(N[H].__isFold){var V=N[H].find(-1);if(V&&V.line===I)return N[H]}}function y($){if(typeof $=="string"){var I=document.createElement("div");return I.className=$+" CodeMirror-guttermarker-subtle",I}else return $.cloneNode(!0)}function m($,I,N){var H=$.state.foldGutter.options,V=I-1,ne=$.foldOption(H,"minFoldSize"),ue=$.foldOption(H,"rangeFinder"),se=typeof H.indicatorFolded=="string"&&k(H.indicatorFolded),de=typeof H.indicatorOpen=="string"&&k(H.indicatorOpen);$.eachLine(I,N,function(Oe){++V;var Fe=null,ie=Oe.gutterMarkers;if(ie&&(ie=ie[H.gutter]),p($,V)){if(se&&ie&&se.test(ie.className))return;Fe=y(H.indicatorFolded)}else{var Pe=o(V,0),j=ue&&ue($,Pe);if(j&&j.to.line-j.from.line>=ne){if(de&&ie&&de.test(ie.className))return;Fe=y(H.indicatorOpen)}}!Fe&&!ie||$.setGutterMarker(Oe,H.gutter,Fe)})}function k($){return new RegExp("(^|\\s)"+$+"(?:$|\\s)\\s*")}function S($){var I=$.getViewport(),N=$.state.foldGutter;N&&($.operation(function(){m($,I.from,I.to)}),N.from=I.from,N.to=I.to)}function F($,I,N){var H=$.state.foldGutter;if(H){var V=H.options;if(N==V.gutter){var ne=p($,I);ne?ne.clear():$.foldCode(o(I,0),V)}}}function L($,I){I=="mode"&&W($)}function W($){var I=$.state.foldGutter;if(I){var N=I.options;I.from=I.to=0,clearTimeout(I.changeUpdate),I.changeUpdate=setTimeout(function(){S($)},N.foldOnChangeTimeSpan||600)}}function z($){var I=$.state.foldGutter;if(I){var N=I.options;clearTimeout(I.changeUpdate),I.changeUpdate=setTimeout(function(){var H=$.getViewport();I.from==I.to||H.from-I.to>20||I.from-H.to>20?S($):$.operation(function(){H.from<I.from&&(m($,H.from,I.from),I.from=H.from),H.to>I.to&&(m($,I.to,H.to),I.to=H.to)})},N.updateViewportTimeSpan||400)}}function D($,I){var N=$.state.foldGutter;if(N){var H=I.line;H>=N.from&&H<N.to&&m($,H,H+1)}}})})(),function(l,n){(function(r){r(jt())})(function(r){function o(u){return function(f,p){var y=p.line,m=f.getLine(y);function k(D){for(var $,I=p.ch,N=0;;){var H=I<=0?-1:m.lastIndexOf(D[0],I-1);if(H==-1){if(N==1)break;N=1,I=m.length;continue}if(N==1&&H<p.ch)break;if($=f.getTokenTypeAt(r.Pos(y,H+1)),!/^(comment|string)/.test($))return{ch:H+1,tokenType:$,pair:D};I=H-1}}function S(D){var $=1,I=f.lastLine(),N,H=D.ch,V;e:for(var ne=y;ne<=I;++ne)for(var ue=f.getLine(ne),se=ne==y?H:0;;){var de=ue.indexOf(D.pair[0],se),Oe=ue.indexOf(D.pair[1],se);if(de<0&&(de=ue.length),Oe<0&&(Oe=ue.length),se=Math.min(de,Oe),se==ue.length)break;if(f.getTokenTypeAt(r.Pos(ne,se+1))==D.tokenType){if(se==de)++$;else if(!--$){N=ne,V=se;break e}}++se}return N==null||y==N?null:{from:r.Pos(y,H),to:r.Pos(N,V)}}for(var F=[],L=0;L<u.length;L++){var W=k(u[L]);W&&F.push(W)}F.sort(function(D,$){return D.ch-$.ch});for(var L=0;L<F.length;L++){var z=S(F[L]);if(z)return z}return null}}r.registerHelper("fold","brace",o([["{","}"],["[","]"]])),r.registerHelper("fold","brace-paren",o([["{","}"],["[","]"],["(",")"]])),r.registerHelper("fold","import",function(u,f){function p(L){if(L<u.firstLine()||L>u.lastLine())return null;var W=u.getTokenAt(r.Pos(L,1));if(/\S/.test(W.string)||(W=u.getTokenAt(r.Pos(L,W.end+1))),W.type!="keyword"||W.string!="import")return null;for(var z=L,D=Math.min(u.lastLine(),L+10);z<=D;++z){var $=u.getLine(z),I=$.indexOf(";");if(I!=-1)return{startCh:W.end,end:r.Pos(z,I)}}}var y=f.line,m=p(y),k;if(!m||p(y-1)||(k=p(y-2))&&k.end.line==y-1)return null;for(var S=m.end;;){var F=p(S.line+1);if(F==null)break;S=F.end}return{from:u.clipPos(r.Pos(y,m.startCh+1)),to:S}}),r.registerHelper("fold","include",function(u,f){function p(F){if(F<u.firstLine()||F>u.lastLine())return null;var L=u.getTokenAt(r.Pos(F,1));if(/\S/.test(L.string)||(L=u.getTokenAt(r.Pos(F,L.end+1))),L.type=="meta"&&L.string.slice(0,8)=="#include")return L.start+8}var y=f.line,m=p(y);if(m==null||p(y-1)!=null)return null;for(var k=y;;){var S=p(k+1);if(S==null)break;++k}return{from:r.Pos(y,m+1),to:u.clipPos(r.Pos(k))}})})}(),function(l,n){(function(r){r(jt())})(function(r){function o(u,f){var p=u.getLine(f),y=p.search(/\S/);return y==-1||/\bcomment\b/.test(u.getTokenTypeAt(r.Pos(f,y+1)))?-1:r.countColumn(p,null,u.getOption("tabSize"))}r.registerHelper("fold","indent",function(u,f){var p=o(u,f.line);if(!(p<0)){for(var y=null,m=f.line+1,k=u.lastLine();m<=k;++m){var S=o(u,m);if(S!=-1)if(S>p)y=m;else break}if(y)return{from:r.Pos(f.line,u.getLine(f.line).length),to:r.Pos(y,u.getLine(y).length)}}})})}(),function(l,n){(function(r){r(jt())})(function(r){r.defineOption("autoRefresh",!1,function(f,p){f.state.autoRefresh&&(u(f,f.state.autoRefresh),f.state.autoRefresh=null),p&&f.display.wrapper.offsetHeight==0&&o(f,f.state.autoRefresh={delay:p.delay||250})});function o(f,p){function y(){f.display.wrapper.offsetHeight?(u(f,p),f.display.lastWrapHeight!=f.display.wrapper.clientHeight&&f.refresh()):p.timeout=setTimeout(y,p.delay)}p.timeout=setTimeout(y,p.delay),p.hurry=function(){clearTimeout(p.timeout),p.timeout=setTimeout(y,50)},r.on(window,"mouseup",p.hurry),r.on(window,"keyup",p.hurry)}function u(f,p){clearTimeout(p.timeout),r.off(window,"mouseup",p.hurry),r.off(window,"keyup",p.hurry)}})}();const po=it.defineStore("trace",{state:()=>({traces:[],currentTrace:null}),getters:{getTraces:l=>l.traces,getCurrentTrace:l=>l.currentTrace},actions:{setTraces(l){this.traces=l},setCurrentTrace(l){this.currentTrace=l}}}),go=()=>typeof __TRACE_API_BASE_URL__<"u"?__TRACE_API_BASE_URL__:typeof window<"u"&&window.__TRACE_API_BASE_URL__?window.__TRACE_API_BASE_URL__:typeof process<"u"&&process.env&&process.env.TRACE_API_BASE_URL?process.env.TRACE_API_BASE_URL:"/tracing",zi=l=>{if(!l||typeof l!="string")return"";const n=go(),r=typeof window<"u"&&n.startsWith("/")?window.location.origin:"";return`${n.startsWith("http")?n:r+n}/v1/file/download?url=${encodeURIComponent(l)}`},Ut=Jt.create({baseURL:go(),timeout:36e5}),kt={getExperiments(){return Ut.post("/experiments/search").then(l=>l.data)},getDictList(){return Ut.get("/v1/dict/list").then(l=>l.data)},getSetting(){return Ut.get("/setting").then(l=>l.data)},getTraceList(l,n,r,o,u,f,p,y,m){const k={};return l&&(k.query=l),n&&(k.startTime=n),r&&(k.endTime=r),o&&(k.pageNum=o),u&&(k.pageSize=u),f&&(k.experimentId=f),p&&(k.status=p),y&&(k.traceType=y),m&&(k.sortBy=m),Ut.get("/v1/trace",{params:k}).then(S=>S.data)},getTraceDetail(l){return Ut.get(`/v1/trace/${l}`).then(n=>n.data)},getTraceSpans(l,n={}){const{query:r="",has_events:o,page_num:u=1,page_size:f=100,span_type:p}=n,y={query:r||"",page_num:u,page_size:f};return o===!0&&(y.has_events=!0),p&&(y.span_type=p),Ut.post(`/v1/trace/${l}/spans`,y).then(m=>m.data)},getSpanContent(l,n){return Ut.get(`/v1/trace/${l}/span/${n}/content`).then(r=>r.data)},removeTraces(l){return!Array.isArray(l)||l.length===0?Promise.resolve():Ut.post("/v1/trace/removeTraces",l).then(n=>n.data)},exportTraces(l){return!Array.isArray(l)||l.length===0?Promise.reject(new Error("traceIds is required")):Ut.post("/v1/trace/exportTraces",l,{headers:{"Content-Type":"application/json"}}).then(n=>n.data)},importTraces(l){if(!l)return Promise.reject(new Error("file is required"));const n=new FormData;return n.append("file",l),Ut.post("/v1/trace/importTraces",n).then(r=>r.data)},deleteTraces(l,n,r,o,u){const f={};return l&&(f.query=l),n&&(f.startTime=n),r&&(f.endTime=r),o&&(f.experimentId=o),u&&(f.status=u),Ut.delete("/v1/trace",{params:f}).then(p=>p.data)},debugTrace(l,n={}){return Ut.post("/debug",l,{headers:n}).then(r=>r.data)},getPromptTokens(l){return Ut.post("/v1/trace/getPromptTokens",l).then(n=>n.data)}};function tf(l){const n=document.createElement("textarea");n.value=l,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",n.style.top="0",document.body.appendChild(n),n.select();try{const r=document.execCommand("copy");return document.body.removeChild(n),r}catch{return document.body.removeChild(n),!1}}function Bi(l,n){if(!l){n.$message.warning(n.$t("debug.copyEmpty"));return}const r=String(l);tf(r)?n.$message.success(n.$t("debug.copySuccess")):n.$message.error(n.$t("debug.copyFailed"))}function mo(l){if(!l)return"-";const n=l/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`}function vo(l){if(!l)return"-";const n=l/1e6,r=new Date(n),o=r.getFullYear(),u=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0"),p=String(r.getHours()).padStart(2,"0"),y=String(r.getMinutes()).padStart(2,"0"),m=String(r.getSeconds()).padStart(2,"0");return`${o}/${u}/${f} ${p}:${y}:${m}`}function nf(l,n,r="-"){return!l||!n?"-":`${vo(l)} ${r} ${vo(n)}`}function yo(l){const n={SERVER:"primary",CHAT_MODEL:"success",LLM:"success",CLIENT:"",INTERNAL:"info",EMBEDDING:"",CHAIN:"warning",AGENT:"danger",TOOL:"info",JOB:"warning",FUNCTION:"info"};return n[l]!==void 0?n[l]:"info"}function bo(l){return{CLIENT:"rgb(141 252 245)",EMBEDDING:"rgb(248 246 130)"}[l]||void 0}function xo(l){return l.status_description?l.status_description:""}function wo(l,n,r){if(!n||!r||n===r)return{width:"100%"};const o=r-n,u=l.start_time_unix_nano-n,f=l.duration_ns,p=u/o*100,y=f/o*100;return{left:`${p}%`,width:`${y}%`}}var ko={exports:{}};(function(l,n){(function(r,o){l.exports=o(jt())})(fo,function(r){return function(o){function u(p){if(f[p])return f[p].exports;var y=f[p]={i:p,l:!1,exports:{}};return o[p].call(y.exports,y,y.exports,u),y.l=!0,y.exports}var f={};return u.m=o,u.c=f,u.i=function(p){return p},u.d=function(p,y,m){u.o(p,y)||Object.defineProperty(p,y,{configurable:!1,enumerable:!0,get:m})},u.n=function(p){var y=p&&p.__esModule?function(){return p.default}:function(){return p};return u.d(y,"a",y),y},u.o=function(p,y){return Object.prototype.hasOwnProperty.call(p,y)},u.p="/",u(u.s=3)}([function(o,u){o.exports=r},function(o,u,f){Object.defineProperty(u,"__esModule",{value:!0});var p=f(0),y=function(k){return k&&k.__esModule?k:{default:k}}(p),m=window.CodeMirror||y.default;typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(k,S){if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var F=Object(k),L=1;L<arguments.length;L++){var W=arguments[L];if(W!=null)for(var z in W)Object.prototype.hasOwnProperty.call(W,z)&&(F[z]=W[z])}return F},writable:!0,configurable:!0}),u.default={name:"codemirror",data:function(){return{content:"",codemirror:null,cminstance:null}},props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:"codemirror"},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},events:{type:Array,default:function(){return[]}},globalOptions:{type:Object,default:function(){return{}}},globalEvents:{type:Array,default:function(){return[]}}},watch:{options:{deep:!0,handler:function(k){for(var S in k)this.cminstance.setOption(S,k[S])}},merge:function(){this.$nextTick(this.switchMerge)},code:function(k){this.handerCodeChange(k)},value:function(k){this.handerCodeChange(k)}},methods:{initialize:function(){var k=this,S=Object.assign({},this.globalOptions,this.options);this.merge?(this.codemirror=m.MergeView(this.$refs.mergeview,S),this.cminstance=this.codemirror.edit):(this.codemirror=m.fromTextArea(this.$refs.textarea,S),this.cminstance=this.codemirror,this.cminstance.setValue(this.code||this.value||this.content)),this.cminstance.on("change",function(L){k.content=L.getValue(),k.$emit&&k.$emit("input",k.content)});var F={};["scroll","changes","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"].concat(this.events).concat(this.globalEvents).filter(function(L){return!F[L]&&(F[L]=!0)}).forEach(function(L){k.cminstance.on(L,function(){for(var W=arguments.length,z=Array(W),D=0;D<W;D++)z[D]=arguments[D];k.$emit.apply(k,[L].concat(z));var $=L.replace(/([A-Z])/g,"-$1").toLowerCase();$!==L&&k.$emit.apply(k,[$].concat(z))})}),this.$emit("ready",this.codemirror),this.unseenLineMarkers(),this.refresh()},refresh:function(){var k=this;this.$nextTick(function(){k.cminstance.refresh()})},destroy:function(){var k=this.cminstance.doc.cm.getWrapperElement();k&&k.remove&&k.remove()},handerCodeChange:function(k){if(k!==this.cminstance.getValue()){var S=this.cminstance.getScrollInfo();this.cminstance.setValue(k),this.content=k,this.cminstance.scrollTo(S.left,S.top)}this.unseenLineMarkers()},unseenLineMarkers:function(){var k=this;this.unseenLines!==void 0&&this.marker!==void 0&&this.unseenLines.forEach(function(S){var F=k.cminstance.lineInfo(S);k.cminstance.setGutterMarker(S,"breakpoints",F.gutterMarkers?null:k.marker())})},switchMerge:function(){var k=this.cminstance.doc.history,S=this.cminstance.doc.cleanGeneration;this.options.value=this.cminstance.getValue(),this.destroy(),this.initialize(),this.cminstance.doc.history=k,this.cminstance.doc.cleanGeneration=S}},mounted:function(){this.initialize()},beforeDestroy:function(){this.destroy()}}},function(o,u,f){Object.defineProperty(u,"__esModule",{value:!0});var p=f(1),y=f.n(p);for(var m in p)["default","default"].indexOf(m)<0&&function(L){f.d(u,L,function(){return p[L]})}(m);var k=f(5),S=f(4),F=S(y.a,k.a,!1,null,null,null);u.default=F.exports},function(o,u,f){function p(z){return z&&z.__esModule?z:{default:z}}Object.defineProperty(u,"__esModule",{value:!0}),u.install=u.codemirror=u.CodeMirror=void 0;var y=f(0),m=p(y),k=f(2),S=p(k),F=window.CodeMirror||m.default,L=function(z,D){D&&(D.options&&(S.default.props.globalOptions.default=function(){return D.options}),D.events&&(S.default.props.globalEvents.default=function(){return D.events})),z.component(S.default.name,S.default)},W={CodeMirror:F,codemirror:S.default,install:L};u.default=W,u.CodeMirror=F,u.codemirror=S.default,u.install=L},function(o,u){o.exports=function(f,p,y,m,k,S){var F,L=f=f||{},W=typeof f.default;W!=="object"&&W!=="function"||(F=f,L=f.default);var z=typeof L=="function"?L.options:L;p&&(z.render=p.render,z.staticRenderFns=p.staticRenderFns,z._compiled=!0),y&&(z.functional=!0),k&&(z._scopeId=k);var D;if(S?(D=function(N){N=N||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,N||typeof __VUE_SSR_CONTEXT__>"u"||(N=__VUE_SSR_CONTEXT__),m&&m.call(this,N),N&&N._registeredComponents&&N._registeredComponents.add(S)},z._ssrRegister=D):m&&(D=m),D){var $=z.functional,I=$?z.render:z.beforeCreate;$?(z._injectStyles=D,z.render=function(N,H){return D.call(H),I(N,H)}):z.beforeCreate=I?[].concat(I,D):[D]}return{esModule:F,exports:L,options:z}}},function(o,u,f){var p=function(){var k=this,S=k.$createElement,F=k._self._c||S;return F("div",{staticClass:"vue-codemirror",class:{merge:k.merge}},[k.merge?F("div",{ref:"mergeview"}):F("textarea",{ref:"textarea",attrs:{name:k.name,placeholder:k.placeholder}})])},y=[],m={render:p,staticRenderFns:y};u.a=m}])})})(ko);var za=ko.exports;function Ba(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Vn=Ba();function So(l){Vn=l}const Co=/[&<>"']/,rf=new RegExp(Co.source,"g"),To=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,af=new RegExp(To.source,"g"),sf={"&":"&","<":"<",">":">",'"':""","'":"'"},_o=l=>sf[l];function qt(l,n){if(n){if(Co.test(l))return l.replace(rf,_o)}else if(To.test(l))return l.replace(af,_o);return l}const of=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function lf(l){return l.replace(of,(n,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const uf=/(^|[^\[])\^/g;function je(l,n){let r=typeof l=="string"?l:l.source;n=n||"";const o={replace:(u,f)=>{let p=typeof f=="string"?f:f.source;return p=p.replace(uf,"$1"),r=r.replace(u,p),o},getRegex:()=>new RegExp(r,n)};return o}function Lo(l){try{l=encodeURI(l).replace(/%25/g,"%")}catch{return null}return l}const Xr={exec:()=>null};function Eo(l,n){const r=l.replace(/\|/g,(f,p,y)=>{let m=!1,k=p;for(;--k>=0&&y[k]==="\\";)m=!m;return m?"|":" |"}),o=r.split(/ \|/);let u=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),n)if(o.length>n)o.splice(n);else for(;o.length<n;)o.push("");for(;u<o.length;u++)o[u]=o[u].trim().replace(/\\\|/g,"|");return o}function Hi(l,n,r){const o=l.length;if(o===0)return"";let u=0;for(;u<o&&l.charAt(o-u-1)===n;)u++;return l.slice(0,o-u)}function cf(l,n){if(l.indexOf(n[1])===-1)return-1;let r=0;for(let o=0;o<l.length;o++)if(l[o]==="\\")o++;else if(l[o]===n[0])r++;else if(l[o]===n[1]&&(r--,r<0))return o;return-1}function Io(l,n,r,o){const u=n.href,f=n.title?qt(n.title):null,p=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){o.state.inLink=!0;const y={type:"link",raw:r,href:u,title:f,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,y}return{type:"image",raw:r,href:u,title:f,text:qt(p)}}function ff(l,n){const r=l.match(/^(\s+)(?:```)/);if(r===null)return n;const o=r[1];return n.split(`
|
|
24
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var _;S&&(_=s.ownerDocument.defaultView.scrollY),i.input.focus(),S&&s.ownerDocument.defaultView.scrollTo(null,_),i.input.reset(),a.somethingSelected()||(s.value=t.prevInput=" "),t.contextMenuPending=O,i.selForContextMenu=a.doc.sel,clearTimeout(i.detectingSelectAll);function F(){if(s.selectionStart!=null){var U=a.somethingSelected(),Y=""+(U?s.value:"");s.value="⇚",s.value=Y,t.prevInput=U?"":"",s.selectionStart=1,s.selectionEnd=Y.length,i.selForContextMenu=a.doc.sel}}function O(){if(t.contextMenuPending==O&&(t.contextMenuPending=!1,t.wrapper.style.cssText=v,s.style.cssText=g,m&&k<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=d),s.selectionStart!=null)){(!m||m&&k<9)&&F();var U=0,Y=function(){i.selForContextMenu==a.doc.sel&&s.selectionStart==0&&s.selectionEnd>0&&t.prevInput==""?yt(a,hc)(a):U++<10?i.detectingSelectAll=setTimeout(Y,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Y,200)}}if(m&&k>=9&&F(),Re){Rn(e);var B=function(){Tt(window,"mouseup",B),setTimeout(O,20)};me(window,"mouseup",B)}else setTimeout(O,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function sv(e,t){if(t=t?ke(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var a=M(_e(e));t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body}function i(){e.value=h.getValue()}var s;if(e.form&&(me(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var c=e.form;s=c.submit;try{var d=c.submit=function(){i(),c.submit=s,c.submit(),c.submit=d}}catch{}}t.finishInit=function(g){g.save=i,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,i(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(Tt(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var h=Ye(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return h}function ov(e){e.off=Tt,e.on=me,e.wheelEventPixels=pm,e.Doc=Ft,e.splitLines=nn,e.countColumn=Le,e.findColumn=ht,e.isWordChar=ye,e.Pass=Ke,e.signal=et,e.Line=Ar,e.changeEnd=jn,e.scrollbarModel=ju,e.Pos=P,e.cmpPos=re,e.modes=Cr,e.mimeModes=un,e.resolveMode=Tr,e.getMode=_r,e.modeExtensions=Pn,e.extendMode=Lr,e.copyState=yn,e.startState=Er,e.innerMode=ci,e.commands=Fi,e.keyMap=An,e.keyName=Ic,e.isModifierKey=Lc,e.lookupKey=jr,e.normalizeKeyMap=Mm,e.StringStream=nt,e.SharedTextMarker=Di,e.TextMarker=Un,e.LineWidget=Ai,e.e_preventDefault=_t,e.e_stopPropagation=kr,e.e_stop=Rn,e.addClass=K,e.contains=A,e.rmClass=Pe,e.keyNames=Gn}Qm(Ye),nv(Ye);var lv="iter insert remove copy getEditor constructor".split(" ");for(var Ma in Ft.prototype)Ft.prototype.hasOwnProperty(Ma)&&we(lv,Ma)<0&&(Ye.prototype[Ma]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ft.prototype[Ma]));return sn(Ft),Ye.inputStyles={textarea:st,contenteditable:We},Ye.defineMode=function(e){!Ye.defaults.mode&&e!="null"&&(Ye.defaults.mode=e),cn.apply(this,arguments)},Ye.defineMIME=tr,Ye.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ye.defineMIME("text/plain","null"),Ye.defineExtension=function(e,t){Ye.prototype[e]=t},Ye.defineDocExtension=function(e,t){Ft.prototype[e]=t},Ye.fromTextArea=sv,ov(Ye),Ye.version="5.65.20",Ye})}(Pa)),Pa.exports}(function(l,n){(function(r){r(jt())})(function(r){r.defineMode("javascript",function(o,u){var f=o.indentUnit,p=u.statementIndent,y=u.jsonld,m=u.json||y,k=u.trackScope!==!1,S=u.typescript,R=u.wordCharacters||/[\w$\xa1-\uffff]/,L=function(){function b(mt){return{type:mt,style:"keyword"}}var T=b("keyword a"),q=b("keyword b"),X=b("keyword c"),P=b("keyword d"),re=b("operator"),ze={type:"atom",style:"atom"};return{if:b("if"),while:T,with:T,else:q,do:q,try:q,finally:q,return:P,break:P,continue:P,new:b("new"),delete:X,void:X,throw:X,debugger:b("debugger"),var:b("var"),const:b("var"),let:b("var"),function:b("function"),catch:b("catch"),for:b("for"),switch:b("switch"),case:b("case"),default:b("default"),in:re,typeof:re,instanceof:re,true:ze,false:ze,null:ze,undefined:ze,NaN:ze,Infinity:ze,this:b("this"),class:b("class"),super:b("atom"),yield:X,export:b("export"),import:b("import"),extends:X,await:X}}(),W=/[+\-*&%=<>!?|~^@]/,z=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function D(b){for(var T=!1,q,X=!1;(q=b.next())!=null;){if(!T){if(q=="/"&&!X)return;q=="["?X=!0:X&&q=="]"&&(X=!1)}T=!T&&q=="\\"}}var $,I;function N(b,T,q){return $=b,I=q,T}function H(b,T){var q=b.next();if(q=='"'||q=="'")return T.tokenize=V(q),T.tokenize(b,T);if(q=="."&&b.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return N("number","number");if(q=="."&&b.match(".."))return N("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(q))return N(q);if(q=="="&&b.eat(">"))return N("=>","operator");if(q=="0"&&b.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return N("number","number");if(/\d/.test(q))return b.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),N("number","number");if(q=="/")return b.eat("*")?(T.tokenize=ne,ne(b,T)):b.eat("/")?(b.skipToEnd(),N("comment","comment")):Xt(b,T,1)?(D(b),b.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),N("regexp","string-2")):(b.eat("="),N("operator","operator",b.current()));if(q=="`")return T.tokenize=ue,ue(b,T);if(q=="#"&&b.peek()=="!")return b.skipToEnd(),N("meta","meta");if(q=="#"&&b.eatWhile(R))return N("variable","property");if(q=="<"&&b.match("!--")||q=="-"&&b.match("->")&&!/\S/.test(b.string.slice(0,b.start)))return b.skipToEnd(),N("comment","comment");if(W.test(q))return(q!=">"||!T.lexical||T.lexical.type!=">")&&(b.eat("=")?(q=="!"||q=="=")&&b.eat("="):/[<>*+\-|&?]/.test(q)&&(b.eat(q),q==">"&&b.eat(q))),q=="?"&&b.eat(".")?N("."):N("operator","operator",b.current());if(R.test(q)){b.eatWhile(R);var X=b.current();if(T.lastType!="."){if(L.propertyIsEnumerable(X)){var P=L[X];return N(P.type,P.style,X)}if(X=="async"&&b.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return N("async","keyword",X)}return N("variable","variable",X)}}function V(b){return function(T,q){var X=!1,P;if(y&&T.peek()=="@"&&T.match(z))return q.tokenize=H,N("jsonld-keyword","meta");for(;(P=T.next())!=null&&!(P==b&&!X);)X=!X&&P=="\\";return X||(q.tokenize=H),N("string","string")}}function ne(b,T){for(var q=!1,X;X=b.next();){if(X=="/"&&q){T.tokenize=H;break}q=X=="*"}return N("comment","comment")}function ue(b,T){for(var q=!1,X;(X=b.next())!=null;){if(!q&&(X=="`"||X=="$"&&b.eat("{"))){T.tokenize=H;break}q=!q&&X=="\\"}return N("quasi","string-2",b.current())}var se="([{}])";function de(b,T){T.fatArrowAt&&(T.fatArrowAt=null);var q=b.string.indexOf("=>",b.start);if(!(q<0)){if(S){var X=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(b.string.slice(b.start,q));X&&(q=X.index)}for(var P=0,re=!1,ze=q-1;ze>=0;--ze){var mt=b.string.charAt(ze),Ot=se.indexOf(mt);if(Ot>=0&&Ot<3){if(!P){++ze;break}if(--P==0){mt=="("&&(re=!0);break}}else if(Ot>=3&&Ot<6)++P;else if(R.test(mt))re=!0;else if(/["'\/`]/.test(mt))for(;;--ze){if(ze==0)return;var Ir=b.string.charAt(ze-1);if(Ir==mt&&b.string.charAt(ze-2)!="\\"){ze--;break}}else if(re&&!P){++ze;break}}re&&!P&&(T.fatArrowAt=ze)}}var Oe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function Re(b,T,q,X,P,re){this.indented=b,this.column=T,this.type=q,this.prev=P,this.info=re,X!=null&&(this.align=X)}function ie(b,T){if(!k)return!1;for(var q=b.localVars;q;q=q.next)if(q.name==T)return!0;for(var X=b.context;X;X=X.prev)for(var q=X.vars;q;q=q.next)if(q.name==T)return!0}function Pe(b,T,q,X,P){var re=b.cc;for(j.state=b,j.stream=P,j.marked=null,j.cc=re,j.style=T,b.lexical.hasOwnProperty("align")||(b.lexical.align=!0);;){var ze=re.length?re.pop():m?we:Le;if(ze(q,X)){for(;re.length&&re[re.length-1].lex;)re.pop()();return j.marked?j.marked:q=="variable"&&ie(b,X)?"variable-2":T}}}var j={state:null,marked:null,cc:null};function Q(){for(var b=arguments.length-1;b>=0;b--)j.cc.push(arguments[b])}function w(){return Q.apply(null,arguments),!0}function J(b,T){for(var q=T;q;q=q.next)if(q.name==b)return!0;return!1}function G(b){var T=j.state;if(j.marked="def",!!k){if(T.context){if(T.lexical.info=="var"&&T.context&&T.context.block){var q=A(b,T.context);if(q!=null){T.context=q;return}}else if(!J(b,T.localVars)){T.localVars=new he(b,T.localVars);return}}u.globalVars&&!J(b,T.globalVars)&&(T.globalVars=new he(b,T.globalVars))}}function A(b,T){if(T)if(T.block){var q=A(b,T.prev);return q?q==T.prev?T:new K(q,T.vars,!0):null}else return J(b,T.vars)?T:new K(T.prev,new he(b,T.vars),!1);else return null}function M(b){return b=="public"||b=="private"||b=="protected"||b=="abstract"||b=="readonly"}function K(b,T,q){this.prev=b,this.vars=T,this.block=q}function he(b,T){this.name=b,this.next=T}var E=new he("this",new he("arguments",null));function x(){j.state.context=new K(j.state.context,j.state.localVars,!1),j.state.localVars=E}function oe(){j.state.context=new K(j.state.context,j.state.localVars,!0),j.state.localVars=null}x.lex=oe.lex=!0;function _e(){j.state.localVars=j.state.context.vars,j.state.context=j.state.context.prev}_e.lex=!0;function Z(b,T){var q=function(){var X=j.state,P=X.indented;if(X.lexical.type=="stat")P=X.lexical.indented;else for(var re=X.lexical;re&&re.type==")"&&re.align;re=re.prev)P=re.indented;X.lexical=new Re(P,j.stream.column(),b,null,X.lexical,T)};return q.lex=!0,q}function fe(){var b=j.state;b.lexical.prev&&(b.lexical.type==")"&&(b.indented=b.lexical.indented),b.lexical=b.lexical.prev)}fe.lex=!0;function ke(b){function T(q){return q==b?w():b==";"||q=="}"||q==")"||q=="]"?Q():w(T)}return T}function Le(b,T){return b=="var"?w(Z("vardef",T),kr,ke(";"),fe):b=="keyword a"?w(Z("form"),Ke,Le,fe):b=="keyword b"?w(Z("form"),Le,fe):b=="keyword d"?j.stream.match(/^\s*$/,!1)?w():w(Z("stat"),Pt,ke(";"),fe):b=="debugger"?w(ke(";")):b=="{"?w(Z("}"),oe,en,fe,_e):b==";"?w():b=="if"?(j.state.lexical.info=="else"&&j.state.cc[j.state.cc.length-1]==fe&&j.state.cc.pop()(),w(Z("form"),Ke,Le,fe,Sr)):b=="function"?w(nn):b=="for"?w(Z("form"),oe,aa,Le,_e,fe):b=="class"||S&&T=="interface"?(j.marked="keyword",w(Z("form",b=="class"?b:T),Cr,fe)):b=="variable"?S&&T=="declare"?(j.marked="keyword",w(Le)):S&&(T=="module"||T=="enum"||T=="type")&&j.stream.match(/^\s*\w/,!1)?(j.marked="keyword",T=="enum"?w(ce):T=="type"?w(sa,ke("operator"),$e,ke(";")):w(Z("form"),Dt,ke("{"),Z("}"),en,fe,fe)):S&&T=="namespace"?(j.marked="keyword",w(Z("form"),we,Le,fe)):S&&T=="abstract"?(j.marked="keyword",w(Le)):w(Z("stat"),wr):b=="switch"?w(Z("form"),Ke,ke("{"),Z("}","switch"),oe,en,fe,fe,_e):b=="case"?w(we,ke(":")):b=="default"?w(ke(":")):b=="catch"?w(Z("form"),x,ct,Le,fe,_e):b=="export"?w(Z("stat"),Tr,fe):b=="import"?w(Z("stat"),Pn,fe):b=="async"?w(Le):T=="@"?w(we,Le):Q(Z("stat"),we,ke(";"),fe)}function ct(b){if(b=="(")return w(ln,ke(")"))}function we(b,T){return ft(b,T,!1)}function Fe(b,T){return ft(b,T,!0)}function Ke(b){return b!="("?Q():w(Z(")"),Pt,ke(")"),fe)}function ft(b,T,q){if(j.state.fatArrowAt==j.stream.start){var X=q?St:be;if(b=="(")return w(x,Z(")"),Ie(ln,")"),fe,ke("=>"),X,_e);if(b=="variable")return Q(x,Dt,ke("=>"),X,_e)}var P=q?ht:dt;return Oe.hasOwnProperty(b)?w(P):b=="function"?w(nn,P):b=="class"||S&&T=="interface"?(j.marked="keyword",w(Z("form"),ms,fe)):b=="keyword c"||b=="async"?w(q?Fe:we):b=="("?w(Z(")"),Pt,ke(")"),fe,P):b=="operator"||b=="spread"?w(q?Fe:we):b=="["?w(Z("]"),nt,fe,P):b=="{"?zt(xe,"}",null,P):b=="quasi"?Q(gt,P):b=="new"?w(Vt(q)):w()}function Pt(b){return b.match(/[;\}\)\],]/)?Q():Q(we)}function dt(b,T){return b==","?w(Pt):ht(b,T,!1)}function ht(b,T,q){var X=q==!1?dt:ht,P=q==!1?we:Fe;if(b=="=>")return w(x,q?St:be,_e);if(b=="operator")return/\+\+|--/.test(T)||S&&T=="!"?w(X):S&&T=="<"&&j.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?w(Z(">"),Ie($e,">"),fe,X):T=="?"?w(we,ke(":"),P):w(P);if(b=="quasi")return Q(gt,X);if(b!=";"){if(b=="(")return zt(Fe,")","call",X);if(b==".")return w(ye,X);if(b=="[")return w(Z("]"),Pt,ke("]"),fe,X);if(S&&T=="as")return j.marked="keyword",w($e,X);if(b=="regexp")return j.state.lastType=j.marked="operator",j.stream.backUp(j.stream.pos-j.stream.start-1),w(P)}}function gt(b,T){return b!="quasi"?Q():T.slice(T.length-2)!="${"?w(gt):w(Pt,Kt)}function Kt(b){if(b=="}")return j.marked="string-2",j.state.tokenize=ue,w(gt)}function be(b){return de(j.stream,j.state),Q(b=="{"?Le:we)}function St(b){return de(j.stream,j.state),Q(b=="{"?Le:Fe)}function Vt(b){return function(T){return T=="."?w(b?Zn:On):T=="variable"&&S?w(Bt,b?ht:dt):Q(b?Fe:we)}}function On(b,T){if(T=="target")return j.marked="keyword",w(dt)}function Zn(b,T){if(T=="target")return j.marked="keyword",w(ht)}function wr(b){return b==":"?w(fe,Le):Q(dt,ke(";"),fe)}function ye(b){if(b=="variable")return j.marked="property",w()}function xe(b,T){if(b=="async")return j.marked="property",w(xe);if(b=="variable"||j.style=="keyword"){if(j.marked="property",T=="get"||T=="set")return w(pe);var q;return S&&j.state.fatArrowAt==j.stream.start&&(q=j.stream.match(/^\s*:\s*/,!1))&&(j.state.fatArrowAt=j.stream.pos+q[0].length),w(Me)}else{if(b=="number"||b=="string")return j.marked=y?"property":j.style+" property",w(Me);if(b=="jsonld-keyword")return w(Me);if(S&&M(T))return j.marked="keyword",w(xe);if(b=="[")return w(we,Nn,ke("]"),Me);if(b=="spread")return w(Fe,Me);if(T=="*")return j.marked="keyword",w(xe);if(b==":")return Q(Me)}}function pe(b){return b!="variable"?Q(Me):(j.marked="property",w(nn))}function Me(b){if(b==":")return w(Fe);if(b=="(")return Q(nn)}function Ie(b,T,q){function X(P,re){if(q?q.indexOf(P)>-1:P==","){var ze=j.state.lexical;return ze.info=="call"&&(ze.pos=(ze.pos||0)+1),w(function(mt,Ot){return mt==T||Ot==T?Q():Q(b)},X)}return P==T||re==T?w():q&&q.indexOf(";")>-1?Q(b):w(ke(T))}return function(P,re){return P==T||re==T?w():Q(b,X)}}function zt(b,T,q){for(var X=3;X<arguments.length;X++)j.cc.push(arguments[X]);return w(Z(T,q),Ie(b,T),fe)}function en(b){return b=="}"?w():Q(Le,en)}function Nn(b,T){if(S){if(b==":")return w($e);if(T=="?")return w(Nn)}}function er(b,T){if(S&&(b==":"||T=="in"))return w($e)}function Fn(b){if(S&&b==":")return j.stream.match(/^\s*\w+\s+is\b/,!1)?w(we,ps,$e):w($e)}function ps(b,T){if(T=="is")return j.marked="keyword",w()}function $e(b,T){if(T=="keyof"||T=="typeof"||T=="infer"||T=="readonly")return j.marked="keyword",w(T=="typeof"?Fe:$e);if(b=="variable"||T=="void")return j.marked="type",w(tn);if(T=="|"||T=="&")return w($e);if(b=="string"||b=="number"||b=="atom")return w(tn);if(b=="[")return w(Z("]"),Ie($e,"]",","),fe,tn);if(b=="{")return w(Z("}"),me,fe,tn);if(b=="(")return w(Ie(tt,")"),ia,tn);if(b=="<")return w(Ie($e,">"),$e);if(b=="quasi")return Q(Tt,tn)}function ia(b){if(b=="=>")return w($e)}function me(b){return b.match(/[\}\)\]]/)?w():b==","||b==";"?w(me):Q(Cn,me)}function Cn(b,T){if(b=="variable"||j.style=="keyword")return j.marked="property",w(Cn);if(T=="?"||b=="number"||b=="string")return w(Cn);if(b==":")return w($e);if(b=="[")return w(ke("variable"),er,ke("]"),Cn);if(b=="(")return Q($n,Cn);if(!b.match(/[;\}\)\],]/))return w()}function Tt(b,T){return b!="quasi"?Q():T.slice(T.length-2)!="${"?w(Tt):w($e,et)}function et(b){if(b=="}")return j.marked="string-2",j.state.tokenize=ue,w(Tt)}function tt(b,T){return b=="variable"&&j.stream.match(/^\s*[?:]/,!1)||T=="?"?w(tt):b==":"?w($e):b=="spread"?w(tt):Q($e)}function tn(b,T){if(T=="<")return w(Z(">"),Ie($e,">"),fe,tn);if(T=="|"||b=="."||T=="&")return w($e);if(b=="[")return w($e,ke("]"),tn);if(T=="extends"||T=="implements")return j.marked="keyword",w($e);if(T=="?")return w($e,ke(":"),$e)}function Bt(b,T){if(T=="<")return w(Z(">"),Ie($e,">"),fe,tn)}function sn(){return Q($e,_t)}function _t(b,T){if(T=="=")return w($e)}function kr(b,T){return T=="enum"?(j.marked="keyword",w(ce)):Q(Dt,Nn,on,gs)}function Dt(b,T){if(S&&M(T))return j.marked="keyword",w(Dt);if(b=="variable")return G(T),w();if(b=="spread")return w(Dt);if(b=="[")return zt(li,"]");if(b=="{")return zt(Rn,"}")}function Rn(b,T){return b=="variable"&&!j.stream.match(/^\s*:/,!1)?(G(T),w(on)):(b=="variable"&&(j.marked="property"),b=="spread"?w(Dt):b=="}"?Q():b=="["?w(we,ke("]"),ke(":"),Rn):w(ke(":"),Dt,on))}function li(){return Q(Dt,on)}function on(b,T){if(T=="=")return w(Fe)}function gs(b){if(b==",")return w(kr)}function Sr(b,T){if(b=="keyword b"&&T=="else")return w(Z("form","else"),Le,fe)}function aa(b,T){if(T=="await")return w(aa);if(b=="(")return w(Z(")"),ui,fe)}function ui(b){return b=="var"?w(kr,Mn):b=="variable"?w(Mn):Q(Mn)}function Mn(b,T){return b==")"?w():b==";"?w(Mn):T=="in"||T=="of"?(j.marked="keyword",w(we,Mn)):Q(we,Mn)}function nn(b,T){if(T=="*")return j.marked="keyword",w(nn);if(b=="variable")return G(T),w(nn);if(b=="(")return w(x,Z(")"),Ie(ln,")"),fe,Fn,Le,_e);if(S&&T=="<")return w(Z(">"),Ie(sn,">"),fe,nn)}function $n(b,T){if(T=="*")return j.marked="keyword",w($n);if(b=="variable")return G(T),w($n);if(b=="(")return w(x,Z(")"),Ie(ln,")"),fe,Fn,_e);if(S&&T=="<")return w(Z(">"),Ie(sn,">"),fe,$n)}function sa(b,T){if(b=="keyword"||b=="variable")return j.marked="type",w(sa);if(T=="<")return w(Z(">"),Ie(sn,">"),fe)}function ln(b,T){return T=="@"&&w(we,ln),b=="spread"?w(ln):S&&M(T)?(j.marked="keyword",w(ln)):S&&b=="this"?w(Nn,on):Q(Dt,Nn,on)}function ms(b,T){return b=="variable"?Cr(b,T):un(b,T)}function Cr(b,T){if(b=="variable")return G(T),w(un)}function un(b,T){if(T=="<")return w(Z(">"),Ie(sn,">"),fe,un);if(T=="extends"||T=="implements"||S&&b==",")return T=="implements"&&(j.marked="keyword"),w(S?$e:we,un);if(b=="{")return w(Z("}"),cn,fe)}function cn(b,T){if(b=="async"||b=="variable"&&(T=="static"||T=="get"||T=="set"||S&&M(T))&&j.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return j.marked="keyword",w(cn);if(b=="variable"||j.style=="keyword")return j.marked="property",w(tr,cn);if(b=="number"||b=="string")return w(tr,cn);if(b=="[")return w(we,Nn,ke("]"),tr,cn);if(T=="*")return j.marked="keyword",w(cn);if(S&&b=="(")return Q($n,cn);if(b==";"||b==",")return w(cn);if(b=="}")return w();if(T=="@")return w(we,cn)}function tr(b,T){if(T=="!"||T=="?")return w(tr);if(b==":")return w($e,on);if(T=="=")return w(Fe);var q=j.state.lexical.prev,X=q&&q.info=="interface";return Q(X?$n:nn)}function Tr(b,T){return T=="*"?(j.marked="keyword",w(Er,ke(";"))):T=="default"?(j.marked="keyword",w(we,ke(";"))):b=="{"?w(Ie(_r,"}"),Er,ke(";")):Q(Le)}function _r(b,T){if(T=="as")return j.marked="keyword",w(ke("variable"));if(b=="variable")return Q(Fe,_r)}function Pn(b){return b=="string"?w():b=="("?Q(we):b=="."?Q(dt):Q(Lr,yn,Er)}function Lr(b,T){return b=="{"?zt(Lr,"}"):(b=="variable"&&G(T),T=="*"&&(j.marked="keyword"),w(ci))}function yn(b){if(b==",")return w(Lr,yn)}function ci(b,T){if(T=="as")return j.marked="keyword",w(Lr)}function Er(b,T){if(T=="from")return j.marked="keyword",w(we)}function nt(b){return b=="]"?w():Q(Ie(Fe,"]"))}function ce(){return Q(Z("form"),Dt,ke("{"),Z("}"),Ie(Tn,"}"),fe,fe)}function Tn(){return Q(Dt,on)}function fi(b,T){return b.lastType=="operator"||b.lastType==","||W.test(T.charAt(0))||/[,.]/.test(T.charAt(0))}function Xt(b,T,q){return T.tokenize==H&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(T.lastType)||T.lastType=="quasi"&&/\{\s*$/.test(b.string.slice(0,b.pos-(q||0)))}return{startState:function(b){var T={tokenize:H,lastType:"sof",cc:[],lexical:new Re((b||0)-f,0,"block",!1),localVars:u.localVars,context:u.localVars&&new K(null,null,!1),indented:b||0};return u.globalVars&&typeof u.globalVars=="object"&&(T.globalVars=u.globalVars),T},token:function(b,T){if(b.sol()&&(T.lexical.hasOwnProperty("align")||(T.lexical.align=!1),T.indented=b.indentation(),de(b,T)),T.tokenize!=ne&&b.eatSpace())return null;var q=T.tokenize(b,T);return $=="comment"?q:(T.lastType=$=="operator"&&(I=="++"||I=="--")?"incdec":$,Pe(T,q,$,I,b))},indent:function(b,T){if(b.tokenize==ne||b.tokenize==ue)return r.Pass;if(b.tokenize!=H)return 0;var q=T&&T.charAt(0),X=b.lexical,P;if(!/^\s*else\b/.test(T))for(var re=b.cc.length-1;re>=0;--re){var ze=b.cc[re];if(ze==fe)X=X.prev;else if(ze!=Sr&&ze!=_e)break}for(;(X.type=="stat"||X.type=="form")&&(q=="}"||(P=b.cc[b.cc.length-1])&&(P==dt||P==ht)&&!/^[,\.=+\-*:?[\(]/.test(T));)X=X.prev;p&&X.type==")"&&X.prev.type=="stat"&&(X=X.prev);var mt=X.type,Ot=q==mt;return mt=="vardef"?X.indented+(b.lastType=="operator"||b.lastType==","?X.info.length+1:0):mt=="form"&&q=="{"?X.indented:mt=="form"?X.indented+f:mt=="stat"?X.indented+(fi(b,T)?p||f:0):X.info=="switch"&&!Ot&&u.doubleIndentSwitch!=!1?X.indented+(/^(?:case|default)\b/.test(T)?f:2*f):X.align?X.column+(Ot?0:1):X.indented+(Ot?0:f)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:m?null:"/*",blockCommentEnd:m?null:"*/",blockCommentContinue:m?null:" * ",lineComment:m?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:m?"json":"javascript",jsonldMode:y,jsonMode:m,expressionAllowed:Xt,skipExpression:function(b){Pe(b,"atom","atom","true",new r.StringStream("",2,null))}}}),r.registerHelper("wordChars","javascript",/[\w$]/),r.defineMIME("text/javascript","javascript"),r.defineMIME("text/ecmascript","javascript"),r.defineMIME("application/javascript","javascript"),r.defineMIME("application/x-javascript","javascript"),r.defineMIME("application/ecmascript","javascript"),r.defineMIME("application/json",{name:"javascript",json:!0}),r.defineMIME("application/x-json",{name:"javascript",json:!0}),r.defineMIME("application/manifest+json",{name:"javascript",json:!0}),r.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),r.defineMIME("text/typescript",{name:"javascript",typescript:!0}),r.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})(),function(l,n){(function(r){r(jt())})(function(r){var o={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},u=r.Pos;r.defineOption("autoCloseBrackets",!1,function(I,N,H){H&&H!=r.Init&&(I.removeKeyMap(p),I.state.closeBrackets=null),N&&(y(f(N,"pairs")),I.state.closeBrackets=N,I.addKeyMap(p))});function f(I,N){return N=="pairs"&&typeof I=="string"?I:typeof I=="object"&&I[N]!=null?I[N]:o[N]}var p={Backspace:S,Enter:R};function y(I){for(var N=0;N<I.length;N++){var H=I.charAt(N),V="'"+H+"'";p[V]||(p[V]=m(H))}}y(o.pairs+"`");function m(I){return function(N){return z(N,I)}}function k(I){var N=I.state.closeBrackets;if(!N||N.override)return N;var H=I.getModeAt(I.getCursor());return H.closeBrackets||N}function S(I){var N=k(I);if(!N||I.getOption("disableInput"))return r.Pass;for(var H=f(N,"pairs"),V=I.listSelections(),ne=0;ne<V.length;ne++){if(!V[ne].empty())return r.Pass;var ue=D(I,V[ne].head);if(!ue||H.indexOf(ue)%2!=0)return r.Pass}for(var ne=V.length-1;ne>=0;ne--){var se=V[ne].head;I.replaceRange("",u(se.line,se.ch-1),u(se.line,se.ch+1),"+delete")}}function R(I){var N=k(I),H=N&&f(N,"explode");if(!H||I.getOption("disableInput"))return r.Pass;for(var V=I.listSelections(),ne=0;ne<V.length;ne++){if(!V[ne].empty())return r.Pass;var ue=D(I,V[ne].head);if(!ue||H.indexOf(ue)%2!=0)return r.Pass}I.operation(function(){var se=I.lineSeparator()||`
|
|
25
|
+
`;I.replaceSelection(se+se,null),L(I,-1),V=I.listSelections();for(var de=0;de<V.length;de++){var Oe=V[de].head.line;I.indentLine(Oe,null,!0),I.indentLine(Oe+1,null,!0)}})}function L(I,N){for(var H=[],V=I.listSelections(),ne=0,ue=0;ue<V.length;ue++){var se=V[ue];se.head==I.getCursor()&&(ne=ue);var de=se.head.ch||N>0?{line:se.head.line,ch:se.head.ch+N}:{line:se.head.line-1};H.push({anchor:de,head:de})}I.setSelections(H,ne)}function W(I){var N=r.cmpPos(I.anchor,I.head)>0;return{anchor:new u(I.anchor.line,I.anchor.ch+(N?-1:1)),head:new u(I.head.line,I.head.ch+(N?1:-1))}}function z(I,N){var H=k(I);if(!H||I.getOption("disableInput"))return r.Pass;var V=f(H,"pairs"),ne=V.indexOf(N);if(ne==-1)return r.Pass;for(var ue=f(H,"closeBefore"),se=f(H,"triples"),de=V.charAt(ne+1)==N,Oe=I.listSelections(),Re=ne%2==0,ie,Pe=0;Pe<Oe.length;Pe++){var j=Oe[Pe],Q=j.head,w,J=I.getRange(Q,u(Q.line,Q.ch+1));if(Re&&!j.empty())w="surround";else if((de||!Re)&&J==N)de&&$(I,Q)?w="both":se.indexOf(N)>=0&&I.getRange(Q,u(Q.line,Q.ch+3))==N+N+N?w="skipThree":w="skip";else if(de&&Q.ch>1&&se.indexOf(N)>=0&&I.getRange(u(Q.line,Q.ch-2),Q)==N+N){if(Q.ch>2&&/\bstring/.test(I.getTokenTypeAt(u(Q.line,Q.ch-2))))return r.Pass;w="addFour"}else if(de){var G=Q.ch==0?" ":I.getRange(u(Q.line,Q.ch-1),Q);if(!r.isWordChar(J)&&G!=N&&!r.isWordChar(G))w="both";else return r.Pass}else if(Re&&(J.length===0||/\s/.test(J)||ue.indexOf(J)>-1))w="both";else return r.Pass;if(!ie)ie=w;else if(ie!=w)return r.Pass}var A=ne%2?V.charAt(ne-1):N,M=ne%2?N:V.charAt(ne+1);I.operation(function(){if(ie=="skip")L(I,1);else if(ie=="skipThree")L(I,3);else if(ie=="surround"){for(var K=I.getSelections(),he=0;he<K.length;he++)K[he]=A+K[he]+M;I.replaceSelections(K,"around"),K=I.listSelections().slice();for(var he=0;he<K.length;he++)K[he]=W(K[he]);I.setSelections(K)}else ie=="both"?(I.replaceSelection(A+M,null),I.triggerElectric(A+M),L(I,-1)):ie=="addFour"&&(I.replaceSelection(A+A+A+A,"before"),L(I,1))})}function D(I,N){var H=I.getRange(u(N.line,N.ch-1),u(N.line,N.ch+1));return H.length==2?H:null}function $(I,N){var H=I.getTokenAt(u(N.line,N.ch+1));return/\bstring/.test(H.type)&&H.start==N.ch&&(N.ch==0||!/\bstring/.test(I.getTokenTypeAt(N)))}})}(),function(l,n){(function(r){r(jt())})(function(r){var o=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),u=r.Pos,f={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function p(L){return L&&L.bracketRegex||/[(){}[\]]/}function y(L,W,z){var D=L.getLineHandle(W.line),$=W.ch-1,I=z&&z.afterCursor;I==null&&(I=/(^| )cm-fat-cursor($| )/.test(L.getWrapperElement().className));var N=p(z),H=!I&&$>=0&&N.test(D.text.charAt($))&&f[D.text.charAt($)]||N.test(D.text.charAt($+1))&&f[D.text.charAt(++$)];if(!H)return null;var V=H.charAt(1)==">"?1:-1;if(z&&z.strict&&V>0!=($==W.ch))return null;var ne=L.getTokenTypeAt(u(W.line,$+1)),ue=m(L,u(W.line,$+(V>0?1:0)),V,ne,z);return ue==null?null:{from:u(W.line,$),to:ue&&ue.pos,match:ue&&ue.ch==H.charAt(0),forward:V>0}}function m(L,W,z,D,$){for(var I=$&&$.maxScanLineLength||1e4,N=$&&$.maxScanLines||1e3,H=[],V=p($),ne=z>0?Math.min(W.line+N,L.lastLine()+1):Math.max(L.firstLine()-1,W.line-N),ue=W.line;ue!=ne;ue+=z){var se=L.getLine(ue);if(se){var de=z>0?0:se.length-1,Oe=z>0?se.length:-1;if(!(se.length>I))for(ue==W.line&&(de=W.ch-(z<0?1:0));de!=Oe;de+=z){var Re=se.charAt(de);if(V.test(Re)&&(D===void 0||(L.getTokenTypeAt(u(ue,de+1))||"")==(D||""))){var ie=f[Re];if(ie&&ie.charAt(1)==">"==z>0)H.push(Re);else if(H.length)H.pop();else return{pos:u(ue,de),ch:Re}}}}}return ue-z==(z>0?L.lastLine():L.firstLine())?!1:null}function k(L,W,z){for(var D=L.state.matchBrackets.maxHighlightLineLength||1e3,$=z&&z.highlightNonMatching,I=[],N=L.listSelections(),H=0;H<N.length;H++){var V=N[H].empty()&&y(L,N[H].head,z);if(V&&(V.match||$!==!1)&&L.getLine(V.from.line).length<=D){var ne=V.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";I.push(L.markText(V.from,u(V.from.line,V.from.ch+1),{className:ne})),V.to&&L.getLine(V.to.line).length<=D&&I.push(L.markText(V.to,u(V.to.line,V.to.ch+1),{className:ne}))}}if(I.length){o&&L.state.focused&&L.focus();var ue=function(){L.operation(function(){for(var se=0;se<I.length;se++)I[se].clear()})};if(W)setTimeout(ue,800);else return ue}}function S(L){L.operation(function(){L.state.matchBrackets.currentlyHighlighted&&(L.state.matchBrackets.currentlyHighlighted(),L.state.matchBrackets.currentlyHighlighted=null),L.state.matchBrackets.currentlyHighlighted=k(L,!1,L.state.matchBrackets)})}function R(L){L.state.matchBrackets&&L.state.matchBrackets.currentlyHighlighted&&(L.state.matchBrackets.currentlyHighlighted(),L.state.matchBrackets.currentlyHighlighted=null)}r.defineOption("matchBrackets",!1,function(L,W,z){z&&z!=r.Init&&(L.off("cursorActivity",S),L.off("focus",S),L.off("blur",R),R(L)),W&&(L.state.matchBrackets=typeof W=="object"?W:{},L.on("cursorActivity",S),L.on("focus",S),L.on("blur",R))}),r.defineExtension("matchBrackets",function(){k(this,!0)}),r.defineExtension("findMatchingBracket",function(L,W,z){return(z||typeof W=="boolean")&&(z?(z.strict=W,W=z):W=W?{strict:!0}:null),y(this,L,W)}),r.defineExtension("scanForBracket",function(L,W,z,D){return m(this,L,W,z,D)})})}();var Zc={exports:{}};(function(l,n){(function(r){r(jt())})(function(r){function o(y,m,k,S){if(k&&k.call){var R=k;k=null}else var R=p(y,k,"rangeFinder");typeof m=="number"&&(m=r.Pos(m,0));var L=p(y,k,"minFoldSize");function W(I){var N=R(y,m);if(!N||N.to.line-N.from.line<L)return null;if(S==="fold")return N;for(var H=y.findMarksAt(N.from),V=0;V<H.length;++V)if(H[V].__isFold){if(!I)return null;N.cleared=!0,H[V].clear()}return N}var z=W(!0);if(p(y,k,"scanUp"))for(;!z&&m.line>y.firstLine();)m=r.Pos(m.line-1,0),z=W(!1);if(!(!z||z.cleared||S==="unfold")){var D=u(y,k,z);r.on(D,"mousedown",function(I){$.clear(),r.e_preventDefault(I)});var $=y.markText(z.from,z.to,{replacedWith:D,clearOnEnter:p(y,k,"clearOnEnter"),__isFold:!0});$.on("clear",function(I,N){r.signal(y,"unfold",y,I,N)}),r.signal(y,"fold",y,z.from,z.to)}}function u(y,m,k){var S=p(y,m,"widget");if(typeof S=="function"&&(S=S(k.from,k.to)),typeof S=="string"){var R=document.createTextNode(S);S=document.createElement("span"),S.appendChild(R),S.className="CodeMirror-foldmarker"}else S&&(S=S.cloneNode(!0));return S}r.newFoldFunction=function(y,m){return function(k,S){o(k,S,{rangeFinder:y,widget:m})}},r.defineExtension("foldCode",function(y,m,k){o(this,y,m,k)}),r.defineExtension("isFolded",function(y){for(var m=this.findMarksAt(y),k=0;k<m.length;++k)if(m[k].__isFold)return!0}),r.commands.toggleFold=function(y){y.foldCode(y.getCursor())},r.commands.fold=function(y){y.foldCode(y.getCursor(),null,"fold")},r.commands.unfold=function(y){y.foldCode(y.getCursor(),{scanUp:!1},"unfold")},r.commands.foldAll=function(y){y.operation(function(){for(var m=y.firstLine(),k=y.lastLine();m<=k;m++)y.foldCode(r.Pos(m,0),{scanUp:!1},"fold")})},r.commands.unfoldAll=function(y){y.operation(function(){for(var m=y.firstLine(),k=y.lastLine();m<=k;m++)y.foldCode(r.Pos(m,0),{scanUp:!1},"unfold")})},r.registerHelper("fold","combine",function(){var y=Array.prototype.slice.call(arguments,0);return function(m,k){for(var S=0;S<y.length;++S){var R=y[S](m,k);if(R)return R}}}),r.registerHelper("fold","auto",function(y,m){for(var k=y.getHelpers(m,"fold"),S=0;S<k.length;S++){var R=k[S](y,m);if(R)return R}});var f={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};r.defineOption("foldOptions",null);function p(y,m,k){if(m&&m[k]!==void 0)return m[k];var S=y.options.foldOptions;return S&&S[k]!==void 0?S[k]:f[k]}r.defineExtension("foldOption",function(y,m){return p(this,y,m)})})})();var ef=Zc.exports;(function(l,n){(function(r){r(jt(),ef)})(function(r){r.defineOption("foldGutter",!1,function($,I,N){N&&N!=r.Init&&($.clearGutter($.state.foldGutter.options.gutter),$.state.foldGutter=null,$.off("gutterClick",R),$.off("changes",W),$.off("viewportChange",z),$.off("fold",D),$.off("unfold",D),$.off("swapDoc",W),$.off("optionChange",L)),I&&($.state.foldGutter=new u(f(I)),S($),$.on("gutterClick",R),$.on("changes",W),$.on("viewportChange",z),$.on("fold",D),$.on("unfold",D),$.on("swapDoc",W),$.on("optionChange",L))});var o=r.Pos;function u($){this.options=$,this.from=this.to=0}function f($){return $===!0&&($={}),$.gutter==null&&($.gutter="CodeMirror-foldgutter"),$.indicatorOpen==null&&($.indicatorOpen="CodeMirror-foldgutter-open"),$.indicatorFolded==null&&($.indicatorFolded="CodeMirror-foldgutter-folded"),$}function p($,I){for(var N=$.findMarks(o(I,0),o(I+1,0)),H=0;H<N.length;++H)if(N[H].__isFold){var V=N[H].find(-1);if(V&&V.line===I)return N[H]}}function y($){if(typeof $=="string"){var I=document.createElement("div");return I.className=$+" CodeMirror-guttermarker-subtle",I}else return $.cloneNode(!0)}function m($,I,N){var H=$.state.foldGutter.options,V=I-1,ne=$.foldOption(H,"minFoldSize"),ue=$.foldOption(H,"rangeFinder"),se=typeof H.indicatorFolded=="string"&&k(H.indicatorFolded),de=typeof H.indicatorOpen=="string"&&k(H.indicatorOpen);$.eachLine(I,N,function(Oe){++V;var Re=null,ie=Oe.gutterMarkers;if(ie&&(ie=ie[H.gutter]),p($,V)){if(se&&ie&&se.test(ie.className))return;Re=y(H.indicatorFolded)}else{var Pe=o(V,0),j=ue&&ue($,Pe);if(j&&j.to.line-j.from.line>=ne){if(de&&ie&&de.test(ie.className))return;Re=y(H.indicatorOpen)}}!Re&&!ie||$.setGutterMarker(Oe,H.gutter,Re)})}function k($){return new RegExp("(^|\\s)"+$+"(?:$|\\s)\\s*")}function S($){var I=$.getViewport(),N=$.state.foldGutter;N&&($.operation(function(){m($,I.from,I.to)}),N.from=I.from,N.to=I.to)}function R($,I,N){var H=$.state.foldGutter;if(H){var V=H.options;if(N==V.gutter){var ne=p($,I);ne?ne.clear():$.foldCode(o(I,0),V)}}}function L($,I){I=="mode"&&W($)}function W($){var I=$.state.foldGutter;if(I){var N=I.options;I.from=I.to=0,clearTimeout(I.changeUpdate),I.changeUpdate=setTimeout(function(){S($)},N.foldOnChangeTimeSpan||600)}}function z($){var I=$.state.foldGutter;if(I){var N=I.options;clearTimeout(I.changeUpdate),I.changeUpdate=setTimeout(function(){var H=$.getViewport();I.from==I.to||H.from-I.to>20||I.from-H.to>20?S($):$.operation(function(){H.from<I.from&&(m($,H.from,I.from),I.from=H.from),H.to>I.to&&(m($,I.to,H.to),I.to=H.to)})},N.updateViewportTimeSpan||400)}}function D($,I){var N=$.state.foldGutter;if(N){var H=I.line;H>=N.from&&H<N.to&&m($,H,H+1)}}})})(),function(l,n){(function(r){r(jt())})(function(r){function o(u){return function(f,p){var y=p.line,m=f.getLine(y);function k(D){for(var $,I=p.ch,N=0;;){var H=I<=0?-1:m.lastIndexOf(D[0],I-1);if(H==-1){if(N==1)break;N=1,I=m.length;continue}if(N==1&&H<p.ch)break;if($=f.getTokenTypeAt(r.Pos(y,H+1)),!/^(comment|string)/.test($))return{ch:H+1,tokenType:$,pair:D};I=H-1}}function S(D){var $=1,I=f.lastLine(),N,H=D.ch,V;e:for(var ne=y;ne<=I;++ne)for(var ue=f.getLine(ne),se=ne==y?H:0;;){var de=ue.indexOf(D.pair[0],se),Oe=ue.indexOf(D.pair[1],se);if(de<0&&(de=ue.length),Oe<0&&(Oe=ue.length),se=Math.min(de,Oe),se==ue.length)break;if(f.getTokenTypeAt(r.Pos(ne,se+1))==D.tokenType){if(se==de)++$;else if(!--$){N=ne,V=se;break e}}++se}return N==null||y==N?null:{from:r.Pos(y,H),to:r.Pos(N,V)}}for(var R=[],L=0;L<u.length;L++){var W=k(u[L]);W&&R.push(W)}R.sort(function(D,$){return D.ch-$.ch});for(var L=0;L<R.length;L++){var z=S(R[L]);if(z)return z}return null}}r.registerHelper("fold","brace",o([["{","}"],["[","]"]])),r.registerHelper("fold","brace-paren",o([["{","}"],["[","]"],["(",")"]])),r.registerHelper("fold","import",function(u,f){function p(L){if(L<u.firstLine()||L>u.lastLine())return null;var W=u.getTokenAt(r.Pos(L,1));if(/\S/.test(W.string)||(W=u.getTokenAt(r.Pos(L,W.end+1))),W.type!="keyword"||W.string!="import")return null;for(var z=L,D=Math.min(u.lastLine(),L+10);z<=D;++z){var $=u.getLine(z),I=$.indexOf(";");if(I!=-1)return{startCh:W.end,end:r.Pos(z,I)}}}var y=f.line,m=p(y),k;if(!m||p(y-1)||(k=p(y-2))&&k.end.line==y-1)return null;for(var S=m.end;;){var R=p(S.line+1);if(R==null)break;S=R.end}return{from:u.clipPos(r.Pos(y,m.startCh+1)),to:S}}),r.registerHelper("fold","include",function(u,f){function p(R){if(R<u.firstLine()||R>u.lastLine())return null;var L=u.getTokenAt(r.Pos(R,1));if(/\S/.test(L.string)||(L=u.getTokenAt(r.Pos(R,L.end+1))),L.type=="meta"&&L.string.slice(0,8)=="#include")return L.start+8}var y=f.line,m=p(y);if(m==null||p(y-1)!=null)return null;for(var k=y;;){var S=p(k+1);if(S==null)break;++k}return{from:r.Pos(y,m+1),to:u.clipPos(r.Pos(k))}})})}(),function(l,n){(function(r){r(jt())})(function(r){function o(u,f){var p=u.getLine(f),y=p.search(/\S/);return y==-1||/\bcomment\b/.test(u.getTokenTypeAt(r.Pos(f,y+1)))?-1:r.countColumn(p,null,u.getOption("tabSize"))}r.registerHelper("fold","indent",function(u,f){var p=o(u,f.line);if(!(p<0)){for(var y=null,m=f.line+1,k=u.lastLine();m<=k;++m){var S=o(u,m);if(S!=-1)if(S>p)y=m;else break}if(y)return{from:r.Pos(f.line,u.getLine(f.line).length),to:r.Pos(y,u.getLine(y).length)}}})})}(),function(l,n){(function(r){r(jt())})(function(r){r.defineOption("autoRefresh",!1,function(f,p){f.state.autoRefresh&&(u(f,f.state.autoRefresh),f.state.autoRefresh=null),p&&f.display.wrapper.offsetHeight==0&&o(f,f.state.autoRefresh={delay:p.delay||250})});function o(f,p){function y(){f.display.wrapper.offsetHeight?(u(f,p),f.display.lastWrapHeight!=f.display.wrapper.clientHeight&&f.refresh()):p.timeout=setTimeout(y,p.delay)}p.timeout=setTimeout(y,p.delay),p.hurry=function(){clearTimeout(p.timeout),p.timeout=setTimeout(y,50)},r.on(window,"mouseup",p.hurry),r.on(window,"keyup",p.hurry)}function u(f,p){clearTimeout(p.timeout),r.off(window,"mouseup",p.hurry),r.off(window,"keyup",p.hurry)}})}();const po=it.defineStore("trace",{state:()=>({traces:[],currentTrace:null}),getters:{getTraces:l=>l.traces,getCurrentTrace:l=>l.currentTrace},actions:{setTraces(l){this.traces=l},setCurrentTrace(l){this.currentTrace=l}}}),go=()=>{var l;return typeof window<"u"&&((l=window.GF_LOCAL_CONFIG)!=null&&l.TRACE_API_BASE_URL)?window.GF_LOCAL_CONFIG.TRACE_API_BASE_URL:"/tracing"},zi=l=>{if(!l||typeof l!="string")return"";const n=go(),r=typeof window<"u"&&n.startsWith("/")?window.location.origin:"";return`${n.startsWith("http")?n:r+n}/v1/file/download?url=${encodeURIComponent(l)}`},qt=Jt.create({baseURL:go(),timeout:36e5}),kt={getExperiments(){return qt.post("/experiments/search").then(l=>l.data)},getDictList(){return qt.get("/v1/dict/list").then(l=>l.data)},getSetting(){return qt.get("/setting").then(l=>l.data)},getTraceList(l,n,r,o,u,f,p,y,m){const k={};return l&&(k.query=l),n&&(k.startTime=n),r&&(k.endTime=r),o&&(k.pageNum=o),u&&(k.pageSize=u),f&&(k.experimentId=f),p&&(k.status=p),y&&(k.traceType=y),m&&(k.sortBy=m),qt.get("/v1/trace",{params:k}).then(S=>S.data)},getTraceDetail(l){return qt.get(`/v1/trace/${l}`).then(n=>n.data)},getTraceSpans(l,n={}){const{query:r="",has_events:o,page_num:u=1,page_size:f=100,span_type:p}=n,y={query:r||"",page_num:u,page_size:f};return o&&(y.has_events=1),p&&(y.span_type=p),qt.post(`/v1/trace/${l}/spans`,y).then(m=>m.data)},getSpanContent(l,n){return qt.get(`/v1/trace/${l}/span/${n}/content`).then(r=>r.data)},removeTraces(l){return!Array.isArray(l)||l.length===0?Promise.resolve():qt.post("/v1/trace/removeTraces",l).then(n=>n.data)},exportTraces(l){return!Array.isArray(l)||l.length===0?Promise.reject(new Error("traceIds is required")):qt.post("/v1/trace/exportTraces",l,{headers:{"Content-Type":"application/json"}}).then(n=>n.data)},importTraces(l){if(!l)return Promise.reject(new Error("file is required"));const n=new FormData;return n.append("file",l),qt.post("/v1/trace/importTraces",n).then(r=>r.data)},deleteTraces(l,n,r,o,u){const f={};return l&&(f.query=l),n&&(f.startTime=n),r&&(f.endTime=r),o&&(f.experimentId=o),u&&(f.status=u),qt.delete("/v1/trace",{params:f}).then(p=>p.data)},debugTrace(l,n={}){return qt.post("/debug",l,{headers:n}).then(r=>r.data)},getPromptTokens(l){return qt.post("/v1/trace/getPromptTokens",l).then(n=>n.data)}};function tf(l){const n=document.createElement("textarea");n.value=l,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",n.style.top="0",document.body.appendChild(n),n.select();try{const r=document.execCommand("copy");return document.body.removeChild(n),r}catch{return document.body.removeChild(n),!1}}function Bi(l,n){if(!l){n.$message.warning(n.$t("debug.copyEmpty"));return}const r=String(l);tf(r)?n.$message.success(n.$t("debug.copySuccess")):n.$message.error(n.$t("debug.copyFailed"))}function mo(l){if(!l)return"-";const n=l/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`}function vo(l){if(!l)return"-";const n=l/1e6,r=new Date(n),o=r.getFullYear(),u=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0"),p=String(r.getHours()).padStart(2,"0"),y=String(r.getMinutes()).padStart(2,"0"),m=String(r.getSeconds()).padStart(2,"0");return`${o}/${u}/${f} ${p}:${y}:${m}`}function nf(l,n,r="-"){return!l||!n?"-":`${vo(l)} ${r} ${vo(n)}`}function yo(l){const n={SERVER:"primary",CHAT_MODEL:"success",LLM:"success",CLIENT:"",INTERNAL:"info",EMBEDDING:"",CHAIN:"warning",AGENT:"danger",TOOL:"info",JOB:"warning",FUNCTION:"info"};return n[l]!==void 0?n[l]:"info"}function bo(l){return{CLIENT:"rgb(141 252 245)",EMBEDDING:"rgb(248 246 130)"}[l]||void 0}function xo(l){return l.status_description?l.status_description:""}function wo(l,n,r){if(!n||!r||n===r)return{width:"100%"};const o=r-n,u=l.start_time_unix_nano-n,f=l.duration_ns,p=u/o*100,y=f/o*100;return{left:`${p}%`,width:`${y}%`}}var ko={exports:{}};(function(l,n){(function(r,o){l.exports=o(jt())})(fo,function(r){return function(o){function u(p){if(f[p])return f[p].exports;var y=f[p]={i:p,l:!1,exports:{}};return o[p].call(y.exports,y,y.exports,u),y.l=!0,y.exports}var f={};return u.m=o,u.c=f,u.i=function(p){return p},u.d=function(p,y,m){u.o(p,y)||Object.defineProperty(p,y,{configurable:!1,enumerable:!0,get:m})},u.n=function(p){var y=p&&p.__esModule?function(){return p.default}:function(){return p};return u.d(y,"a",y),y},u.o=function(p,y){return Object.prototype.hasOwnProperty.call(p,y)},u.p="/",u(u.s=3)}([function(o,u){o.exports=r},function(o,u,f){Object.defineProperty(u,"__esModule",{value:!0});var p=f(0),y=function(k){return k&&k.__esModule?k:{default:k}}(p),m=window.CodeMirror||y.default;typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(k,S){if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var R=Object(k),L=1;L<arguments.length;L++){var W=arguments[L];if(W!=null)for(var z in W)Object.prototype.hasOwnProperty.call(W,z)&&(R[z]=W[z])}return R},writable:!0,configurable:!0}),u.default={name:"codemirror",data:function(){return{content:"",codemirror:null,cminstance:null}},props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:"codemirror"},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},events:{type:Array,default:function(){return[]}},globalOptions:{type:Object,default:function(){return{}}},globalEvents:{type:Array,default:function(){return[]}}},watch:{options:{deep:!0,handler:function(k){for(var S in k)this.cminstance.setOption(S,k[S])}},merge:function(){this.$nextTick(this.switchMerge)},code:function(k){this.handerCodeChange(k)},value:function(k){this.handerCodeChange(k)}},methods:{initialize:function(){var k=this,S=Object.assign({},this.globalOptions,this.options);this.merge?(this.codemirror=m.MergeView(this.$refs.mergeview,S),this.cminstance=this.codemirror.edit):(this.codemirror=m.fromTextArea(this.$refs.textarea,S),this.cminstance=this.codemirror,this.cminstance.setValue(this.code||this.value||this.content)),this.cminstance.on("change",function(L){k.content=L.getValue(),k.$emit&&k.$emit("input",k.content)});var R={};["scroll","changes","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"].concat(this.events).concat(this.globalEvents).filter(function(L){return!R[L]&&(R[L]=!0)}).forEach(function(L){k.cminstance.on(L,function(){for(var W=arguments.length,z=Array(W),D=0;D<W;D++)z[D]=arguments[D];k.$emit.apply(k,[L].concat(z));var $=L.replace(/([A-Z])/g,"-$1").toLowerCase();$!==L&&k.$emit.apply(k,[$].concat(z))})}),this.$emit("ready",this.codemirror),this.unseenLineMarkers(),this.refresh()},refresh:function(){var k=this;this.$nextTick(function(){k.cminstance.refresh()})},destroy:function(){var k=this.cminstance.doc.cm.getWrapperElement();k&&k.remove&&k.remove()},handerCodeChange:function(k){if(k!==this.cminstance.getValue()){var S=this.cminstance.getScrollInfo();this.cminstance.setValue(k),this.content=k,this.cminstance.scrollTo(S.left,S.top)}this.unseenLineMarkers()},unseenLineMarkers:function(){var k=this;this.unseenLines!==void 0&&this.marker!==void 0&&this.unseenLines.forEach(function(S){var R=k.cminstance.lineInfo(S);k.cminstance.setGutterMarker(S,"breakpoints",R.gutterMarkers?null:k.marker())})},switchMerge:function(){var k=this.cminstance.doc.history,S=this.cminstance.doc.cleanGeneration;this.options.value=this.cminstance.getValue(),this.destroy(),this.initialize(),this.cminstance.doc.history=k,this.cminstance.doc.cleanGeneration=S}},mounted:function(){this.initialize()},beforeDestroy:function(){this.destroy()}}},function(o,u,f){Object.defineProperty(u,"__esModule",{value:!0});var p=f(1),y=f.n(p);for(var m in p)["default","default"].indexOf(m)<0&&function(L){f.d(u,L,function(){return p[L]})}(m);var k=f(5),S=f(4),R=S(y.a,k.a,!1,null,null,null);u.default=R.exports},function(o,u,f){function p(z){return z&&z.__esModule?z:{default:z}}Object.defineProperty(u,"__esModule",{value:!0}),u.install=u.codemirror=u.CodeMirror=void 0;var y=f(0),m=p(y),k=f(2),S=p(k),R=window.CodeMirror||m.default,L=function(z,D){D&&(D.options&&(S.default.props.globalOptions.default=function(){return D.options}),D.events&&(S.default.props.globalEvents.default=function(){return D.events})),z.component(S.default.name,S.default)},W={CodeMirror:R,codemirror:S.default,install:L};u.default=W,u.CodeMirror=R,u.codemirror=S.default,u.install=L},function(o,u){o.exports=function(f,p,y,m,k,S){var R,L=f=f||{},W=typeof f.default;W!=="object"&&W!=="function"||(R=f,L=f.default);var z=typeof L=="function"?L.options:L;p&&(z.render=p.render,z.staticRenderFns=p.staticRenderFns,z._compiled=!0),y&&(z.functional=!0),k&&(z._scopeId=k);var D;if(S?(D=function(N){N=N||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,N||typeof __VUE_SSR_CONTEXT__>"u"||(N=__VUE_SSR_CONTEXT__),m&&m.call(this,N),N&&N._registeredComponents&&N._registeredComponents.add(S)},z._ssrRegister=D):m&&(D=m),D){var $=z.functional,I=$?z.render:z.beforeCreate;$?(z._injectStyles=D,z.render=function(N,H){return D.call(H),I(N,H)}):z.beforeCreate=I?[].concat(I,D):[D]}return{esModule:R,exports:L,options:z}}},function(o,u,f){var p=function(){var k=this,S=k.$createElement,R=k._self._c||S;return R("div",{staticClass:"vue-codemirror",class:{merge:k.merge}},[k.merge?R("div",{ref:"mergeview"}):R("textarea",{ref:"textarea",attrs:{name:k.name,placeholder:k.placeholder}})])},y=[],m={render:p,staticRenderFns:y};u.a=m}])})})(ko);var za=ko.exports;function Ba(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Vn=Ba();function So(l){Vn=l}const Co=/[&<>"']/,rf=new RegExp(Co.source,"g"),To=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,af=new RegExp(To.source,"g"),sf={"&":"&","<":"<",">":">",'"':""","'":"'"},_o=l=>sf[l];function Ut(l,n){if(n){if(Co.test(l))return l.replace(rf,_o)}else if(To.test(l))return l.replace(af,_o);return l}const of=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function lf(l){return l.replace(of,(n,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const uf=/(^|[^\[])\^/g;function je(l,n){let r=typeof l=="string"?l:l.source;n=n||"";const o={replace:(u,f)=>{let p=typeof f=="string"?f:f.source;return p=p.replace(uf,"$1"),r=r.replace(u,p),o},getRegex:()=>new RegExp(r,n)};return o}function Lo(l){try{l=encodeURI(l).replace(/%25/g,"%")}catch{return null}return l}const Xr={exec:()=>null};function Eo(l,n){const r=l.replace(/\|/g,(f,p,y)=>{let m=!1,k=p;for(;--k>=0&&y[k]==="\\";)m=!m;return m?"|":" |"}),o=r.split(/ \|/);let u=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),n)if(o.length>n)o.splice(n);else for(;o.length<n;)o.push("");for(;u<o.length;u++)o[u]=o[u].trim().replace(/\\\|/g,"|");return o}function Hi(l,n,r){const o=l.length;if(o===0)return"";let u=0;for(;u<o&&l.charAt(o-u-1)===n;)u++;return l.slice(0,o-u)}function cf(l,n){if(l.indexOf(n[1])===-1)return-1;let r=0;for(let o=0;o<l.length;o++)if(l[o]==="\\")o++;else if(l[o]===n[0])r++;else if(l[o]===n[1]&&(r--,r<0))return o;return-1}function Io(l,n,r,o){const u=n.href,f=n.title?Ut(n.title):null,p=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){o.state.inLink=!0;const y={type:"link",raw:r,href:u,title:f,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,y}return{type:"image",raw:r,href:u,title:f,text:Ut(p)}}function ff(l,n){const r=l.match(/^(\s+)(?:```)/);if(r===null)return n;const o=r[1];return n.split(`
|
|
26
26
|
`).map(u=>{const f=u.match(/^\s+/);if(f===null)return u;const[p]=f;return p.length>=o.length?u.slice(o.length):u}).join(`
|
|
27
27
|
`)}class Wi{constructor(n){Je(this,"options");Je(this,"rules");Je(this,"lexer");this.options=n||Vn}space(n){const r=this.rules.block.newline.exec(n);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(n){const r=this.rules.block.code.exec(n);if(r){const o=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Hi(o,`
|
|
28
28
|
`)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const o=r[0],u=ff(o,r[3]||"");return{type:"code",raw:o,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:u}}}heading(n){const r=this.rules.block.heading.exec(n);if(r){let o=r[2].trim();if(/#$/.test(o)){const u=Hi(o,"#");(this.options.pedantic||!u||/ $/.test(u))&&(o=u.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(n){const r=this.rules.block.hr.exec(n);if(r)return{type:"hr",raw:r[0]}}blockquote(n){const r=this.rules.block.blockquote.exec(n);if(r){const o=Hi(r[0].replace(/^ *>[ \t]?/gm,""),`
|
|
29
|
-
`),u=this.lexer.state.top;this.lexer.state.top=!0;const f=this.lexer.blockTokens(o);return this.lexer.state.top=u,{type:"blockquote",raw:r[0],tokens:f,text:o}}}list(n){let r=this.rules.block.list.exec(n);if(r){let o=r[1].trim();const u=o.length>1,f={type:"list",raw:"",ordered:u,start:u?+o.slice(0,-1):"",loose:!1,items:[]};o=u?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=u?o:"[*+-]");const p=new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`);let y="",m="",k=!1;for(;n;){let S=!1;if(!(r=p.exec(n))||this.rules.block.hr.test(n))break;y=r[0],n=n.substring(y.length);let
|
|
29
|
+
`),u=this.lexer.state.top;this.lexer.state.top=!0;const f=this.lexer.blockTokens(o);return this.lexer.state.top=u,{type:"blockquote",raw:r[0],tokens:f,text:o}}}list(n){let r=this.rules.block.list.exec(n);if(r){let o=r[1].trim();const u=o.length>1,f={type:"list",raw:"",ordered:u,start:u?+o.slice(0,-1):"",loose:!1,items:[]};o=u?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=u?o:"[*+-]");const p=new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`);let y="",m="",k=!1;for(;n;){let S=!1;if(!(r=p.exec(n))||this.rules.block.hr.test(n))break;y=r[0],n=n.substring(y.length);let R=r[2].split(`
|
|
30
30
|
`,1)[0].replace(/^\t+/,I=>" ".repeat(3*I.length)),L=n.split(`
|
|
31
|
-
`,1)[0],W=0;this.options.pedantic?(W=2,m=
|
|
31
|
+
`,1)[0],W=0;this.options.pedantic?(W=2,m=R.trimStart()):(W=r[2].search(/[^ ]/),W=W>4?1:W,m=R.slice(W),W+=r[1].length);let z=!1;if(!R&&/^ *$/.test(L)&&(y+=L+`
|
|
32
32
|
`,n=n.substring(L.length+1),S=!0),!S){const I=new RegExp(`^ {0,${Math.min(3,W-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),N=new RegExp(`^ {0,${Math.min(3,W-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),H=new RegExp(`^ {0,${Math.min(3,W-1)}}(?:\`\`\`|~~~)`),V=new RegExp(`^ {0,${Math.min(3,W-1)}}#`);for(;n;){const ne=n.split(`
|
|
33
33
|
`,1)[0];if(L=ne,this.options.pedantic&&(L=L.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),H.test(L)||V.test(L)||I.test(L)||N.test(n))break;if(L.search(/[^ ]/)>=W||!L.trim())m+=`
|
|
34
|
-
`+L.slice(W);else{if(z||
|
|
34
|
+
`+L.slice(W);else{if(z||R.search(/[^ ]/)>=4||H.test(R)||V.test(R)||N.test(R))break;m+=`
|
|
35
35
|
`+L}!z&&!L.trim()&&(z=!0),y+=ne+`
|
|
36
|
-
`,n=n.substring(ne.length+1),
|
|
36
|
+
`,n=n.substring(ne.length+1),R=L.slice(W)}}f.loose||(k?f.loose=!0:/\n *\n *$/.test(y)&&(k=!0));let D=null,$;this.options.gfm&&(D=/^\[[ xX]\] /.exec(m),D&&($=D[0]!=="[ ] ",m=m.replace(/^\[[ xX]\] +/,""))),f.items.push({type:"list_item",raw:y,task:!!D,checked:$,loose:!1,text:m,tokens:[]}),f.raw+=y}f.items[f.items.length-1].raw=y.trimEnd(),f.items[f.items.length-1].text=m.trimEnd(),f.raw=f.raw.trimEnd();for(let S=0;S<f.items.length;S++)if(this.lexer.state.top=!1,f.items[S].tokens=this.lexer.blockTokens(f.items[S].text,[]),!f.loose){const R=f.items[S].tokens.filter(W=>W.type==="space"),L=R.length>0&&R.some(W=>/\n.*\n/.test(W.raw));f.loose=L}if(f.loose)for(let S=0;S<f.items.length;S++)f.items[S].loose=!0;return f}}html(n){const r=this.rules.block.html.exec(n);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(n){const r=this.rules.block.def.exec(n);if(r){const o=r[1].toLowerCase().replace(/\s+/g," "),u=r[2]?r[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",f=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:o,raw:r[0],href:u,title:f}}}table(n){const r=this.rules.block.table.exec(n);if(!r||!/[:|]/.test(r[2]))return;const o=Eo(r[1]),u=r[2].replace(/^\||\| *$/g,"").split("|"),f=r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(`
|
|
37
37
|
`):[],p={type:"table",raw:r[0],header:[],align:[],rows:[]};if(o.length===u.length){for(const y of u)/^ *-+: *$/.test(y)?p.align.push("right"):/^ *:-+: *$/.test(y)?p.align.push("center"):/^ *:-+ *$/.test(y)?p.align.push("left"):p.align.push(null);for(const y of o)p.header.push({text:y,tokens:this.lexer.inline(y)});for(const y of f)p.rows.push(Eo(y,p.header.length).map(m=>({text:m,tokens:this.lexer.inline(m)})));return p}}lheading(n){const r=this.rules.block.lheading.exec(n);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(n){const r=this.rules.block.paragraph.exec(n);if(r){const o=r[1].charAt(r[1].length-1)===`
|
|
38
|
-
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:o,tokens:this.lexer.inline(o)}}}text(n){const r=this.rules.block.text.exec(n);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(n){const r=this.rules.inline.escape.exec(n);if(r)return{type:"escape",raw:r[0],text:
|
|
39
|
-
]`).replace("lheading",Do).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
38
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:o,tokens:this.lexer.inline(o)}}}text(n){const r=this.rules.block.text.exec(n);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(n){const r=this.rules.inline.escape.exec(n);if(r)return{type:"escape",raw:r[0],text:Ut(r[1])}}tag(n){const r=this.rules.inline.tag.exec(n);if(r)return!this.lexer.state.inLink&&/^<a /i.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(n){const r=this.rules.inline.link.exec(n);if(r){const o=r[2].trim();if(!this.options.pedantic&&/^</.test(o)){if(!/>$/.test(o))return;const p=Hi(o.slice(0,-1),"\\");if((o.length-p.length)%2===0)return}else{const p=cf(r[2],"()");if(p>-1){const m=(r[0].indexOf("!")===0?5:4)+r[1].length+p;r[2]=r[2].substring(0,p),r[0]=r[0].substring(0,m).trim(),r[3]=""}}let u=r[2],f="";if(this.options.pedantic){const p=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(u);p&&(u=p[1],f=p[3])}else f=r[3]?r[3].slice(1,-1):"";return u=u.trim(),/^</.test(u)&&(this.options.pedantic&&!/>$/.test(o)?u=u.slice(1):u=u.slice(1,-1)),Io(r,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:f&&f.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer)}}reflink(n,r){let o;if((o=this.rules.inline.reflink.exec(n))||(o=this.rules.inline.nolink.exec(n))){const u=(o[2]||o[1]).replace(/\s+/g," "),f=r[u.toLowerCase()];if(!f){const p=o[0].charAt(0);return{type:"text",raw:p,text:p}}return Io(o,f,o[0],this.lexer)}}emStrong(n,r,o=""){let u=this.rules.inline.emStrongLDelim.exec(n);if(!u||u[3]&&o.match(/[\p{L}\p{N}]/u))return;if(!(u[1]||u[2]||"")||!o||this.rules.inline.punctuation.exec(o)){const p=[...u[0]].length-1;let y,m,k=p,S=0;const R=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(R.lastIndex=0,r=r.slice(-1*n.length+p);(u=R.exec(r))!=null;){if(y=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!y)continue;if(m=[...y].length,u[3]||u[4]){k+=m;continue}else if((u[5]||u[6])&&p%3&&!((p+m)%3)){S+=m;continue}if(k-=m,k>0)continue;m=Math.min(m,m+k+S);const L=[...u[0]][0].length,W=n.slice(0,p+u.index+L+m);if(Math.min(p,m)%2){const D=W.slice(1,-1);return{type:"em",raw:W,text:D,tokens:this.lexer.inlineTokens(D)}}const z=W.slice(2,-2);return{type:"strong",raw:W,text:z,tokens:this.lexer.inlineTokens(z)}}}}codespan(n){const r=this.rules.inline.code.exec(n);if(r){let o=r[2].replace(/\n/g," ");const u=/[^ ]/.test(o),f=/^ /.test(o)&&/ $/.test(o);return u&&f&&(o=o.substring(1,o.length-1)),o=Ut(o,!0),{type:"codespan",raw:r[0],text:o}}}br(n){const r=this.rules.inline.br.exec(n);if(r)return{type:"br",raw:r[0]}}del(n){const r=this.rules.inline.del.exec(n);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(n){const r=this.rules.inline.autolink.exec(n);if(r){let o,u;return r[2]==="@"?(o=Ut(r[1]),u="mailto:"+o):(o=Ut(r[1]),u=o),{type:"link",raw:r[0],text:o,href:u,tokens:[{type:"text",raw:o,text:o}]}}}url(n){var o;let r;if(r=this.rules.inline.url.exec(n)){let u,f;if(r[2]==="@")u=Ut(r[0]),f="mailto:"+u;else{let p;do p=r[0],r[0]=((o=this.rules.inline._backpedal.exec(r[0]))==null?void 0:o[0])??"";while(p!==r[0]);u=Ut(r[0]),r[1]==="www."?f="http://"+r[0]:f=r[0]}return{type:"link",raw:r[0],text:u,href:f,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(n){const r=this.rules.inline.text.exec(n);if(r){let o;return this.lexer.state.inRawBlock?o=r[0]:o=Ut(r[0]),{type:"text",raw:r[0],text:o}}}}const df=/^(?: *(?:\n|$))+/,hf=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,pf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ao=/(?:[*+-]|\d{1,9}[.)])/,Do=je(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ao).getRegex(),Ha=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mf=/^[^\n]+/,Wa=/(?!\s*\])(?:\\.|[^\[\]\\])+/,vf=je(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Wa).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yf=je(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ao).getRegex(),ji="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ja=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,bf=je("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",ja).replace("tag",ji).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Oo=je(Ha).replace("hr",Yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ji).getRegex(),qa={blockquote:je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Oo).getRegex(),code:hf,def:vf,fences:pf,heading:gf,hr:Yr,html:bf,lheading:Do,list:yf,newline:df,paragraph:Oo,table:Xr,text:mf},No=je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ji).getRegex(),xf={...qa,table:No,paragraph:je(Ha).replace("hr",Yr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",No).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ji).getRegex()},wf={...qa,html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ja).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:je(Ha).replace("hr",Yr).replace("heading",` *#{1,6} *[^
|
|
39
|
+
]`).replace("lheading",Do).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Fo=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ro=/^( {2,}|\\)\n(?!\s*$)/,Sf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jr="\\p{P}$+<=>`^|~",Cf=je(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Jr).getRegex(),Tf=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,_f=je(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Jr).getRegex(),Lf=je("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Jr).getRegex(),Ef=je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Jr).getRegex(),If=je(/\\([punct])/,"gu").replace(/punct/g,Jr).getRegex(),Af=je(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Df=je(ja).replace("(?:-->|$)","-->").getRegex(),Of=je("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Df).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Nf=je(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",qi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Mo=je(/^!?\[(label)\]\[(ref)\]/).replace("label",qi).replace("ref",Wa).getRegex(),$o=je(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wa).getRegex(),Ff=je("reflink|nolink(?!\\()","g").replace("reflink",Mo).replace("nolink",$o).getRegex(),Ua={_backpedal:Xr,anyPunctuation:If,autolink:Af,blockSkip:Tf,br:Ro,code:kf,del:Xr,emStrongLDelim:_f,emStrongRDelimAst:Lf,emStrongRDelimUnd:Ef,escape:Fo,link:Nf,nolink:$o,punctuation:Cf,reflink:Mo,reflinkSearch:Ff,tag:Of,text:Sf,url:Xr},Rf={...Ua,link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",qi).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qi).getRegex()},Ga={...Ua,escape:je(Fo).replace("])","~|])").getRegex(),url:je(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Mf={...Ga,br:je(Ro).replace("{2,}","*").getRegex(),text:je(Ga.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ui={normal:qa,gfm:xf,pedantic:wf},Qr={normal:Ua,gfm:Ga,breaks:Mf,pedantic:Rf};class gn{constructor(n){Je(this,"tokens");Je(this,"options");Je(this,"state");Je(this,"tokenizer");Je(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Vn,this.options.tokenizer=this.options.tokenizer||new Wi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:Ui.normal,inline:Qr.normal};this.options.pedantic?(r.block=Ui.pedantic,r.inline=Qr.pedantic):this.options.gfm&&(r.block=Ui.gfm,this.options.breaks?r.inline=Qr.breaks:r.inline=Qr.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ui,inline:Qr}}static lex(n,r){return new gn(r).lex(n)}static lexInline(n,r){return new gn(r).inlineTokens(n)}lex(n){n=n.replace(/\r\n|\r/g,`
|
|
40
40
|
`),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[]){this.options.pedantic?n=n.replace(/\t/g," ").replace(/^ +$/gm,""):n=n.replace(/^( *)(\t+)/gm,(y,m,k)=>m+" ".repeat(k.length));let o,u,f,p;for(;n;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(y=>(o=y.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))){if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length),o.raw.length===1&&r.length>0?r[r.length-1].raw+=`
|
|
41
41
|
`:r.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length),u=r[r.length-1],u&&(u.type==="paragraph"||u.type==="text")?(u.raw+=`
|
|
42
42
|
`+o.raw,u.text+=`
|
|
@@ -46,9 +46,9 @@ b`.split(/\n/).length!=3?function(e){for(var t=0,a=[],i=e.length;t<=i;){var s=e.
|
|
|
46
46
|
`+o.raw,u.text+=`
|
|
47
47
|
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=u.text):r.push(o),p=f.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length),u=r[r.length-1],u&&u.type==="text"?(u.raw+=`
|
|
48
48
|
`+o.raw,u.text+=`
|
|
49
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=u.text):r.push(o);continue}if(n){const y="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let o,u,f,p=n,y,m,k;if(this.tokens.links){const S=Object.keys(this.tokens.links);if(S.length>0)for(;(y=this.tokenizer.rules.inline.reflinkSearch.exec(p))!=null;)S.includes(y[0].slice(y[0].lastIndexOf("[")+1,-1))&&(p=p.slice(0,y.index)+"["+"a".repeat(y[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(y=this.tokenizer.rules.inline.blockSkip.exec(p))!=null;)p=p.slice(0,y.index)+"["+"a".repeat(y[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(y=this.tokenizer.rules.inline.anyPunctuation.exec(p))!=null;)p=p.slice(0,y.index)+"++"+p.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;n;)if(m||(k=""),m=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(S=>(o=S.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))){if(o=this.tokenizer.escape(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(n)){n=n.substring(o.raw.length),u=r[r.length-1],u&&o.type==="text"&&u.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(o=this.tokenizer.link(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(o.raw.length),u=r[r.length-1],u&&o.type==="text"&&u.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(n,p,k)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(n)){n=n.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(n))){n=n.substring(o.raw.length),r.push(o);continue}if(f=n,this.options.extensions&&this.options.extensions.startInline){let S=1/0;const
|
|
50
|
-
`,u?'<pre><code class="language-'+
|
|
51
|
-
`:"<pre><code>"+(o?n:
|
|
49
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=u.text):r.push(o);continue}if(n){const y="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let o,u,f,p=n,y,m,k;if(this.tokens.links){const S=Object.keys(this.tokens.links);if(S.length>0)for(;(y=this.tokenizer.rules.inline.reflinkSearch.exec(p))!=null;)S.includes(y[0].slice(y[0].lastIndexOf("[")+1,-1))&&(p=p.slice(0,y.index)+"["+"a".repeat(y[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(y=this.tokenizer.rules.inline.blockSkip.exec(p))!=null;)p=p.slice(0,y.index)+"["+"a".repeat(y[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(y=this.tokenizer.rules.inline.anyPunctuation.exec(p))!=null;)p=p.slice(0,y.index)+"++"+p.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;n;)if(m||(k=""),m=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(S=>(o=S.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))){if(o=this.tokenizer.escape(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(n)){n=n.substring(o.raw.length),u=r[r.length-1],u&&o.type==="text"&&u.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(o=this.tokenizer.link(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(o.raw.length),u=r[r.length-1],u&&o.type==="text"&&u.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(n,p,k)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(n)){n=n.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(n))){n=n.substring(o.raw.length),r.push(o);continue}if(f=n,this.options.extensions&&this.options.extensions.startInline){let S=1/0;const R=n.slice(1);let L;this.options.extensions.startInline.forEach(W=>{L=W.call({lexer:this},R),typeof L=="number"&&L>=0&&(S=Math.min(S,L))}),S<1/0&&S>=0&&(f=n.substring(0,S+1))}if(o=this.tokenizer.inlineText(f)){n=n.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(k=o.raw.slice(-1)),m=!0,u=r[r.length-1],u&&u.type==="text"?(u.raw+=o.raw,u.text+=o.text):r.push(o);continue}if(n){const S="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return r}}class Gi{constructor(n){Je(this,"options");this.options=n||Vn}code(n,r,o){var f;const u=(f=(r||"").match(/^\S*/))==null?void 0:f[0];return n=n.replace(/\n$/,"")+`
|
|
50
|
+
`,u?'<pre><code class="language-'+Ut(u)+'">'+(o?n:Ut(n,!0))+`</code></pre>
|
|
51
|
+
`:"<pre><code>"+(o?n:Ut(n,!0))+`</code></pre>
|
|
52
52
|
`}blockquote(n){return`<blockquote>
|
|
53
53
|
${n}</blockquote>
|
|
54
54
|
`}html(n,r){return n}heading(n,r,o){return`<h${r}>${n}</h${r}>
|
|
@@ -64,9 +64,9 @@ ${n}</blockquote>
|
|
|
64
64
|
`}tablerow(n){return`<tr>
|
|
65
65
|
${n}</tr>
|
|
66
66
|
`}tablecell(n,r){const o=r.header?"th":"td";return(r.align?`<${o} align="${r.align}">`:`<${o}>`)+n+`</${o}>
|
|
67
|
-
`}strong(n){return`<strong>${n}</strong>`}em(n){return`<em>${n}</em>`}codespan(n){return`<code>${n}</code>`}br(){return"<br>"}del(n){return`<del>${n}</del>`}link(n,r,o){const u=Lo(n);if(u===null)return o;n=u;let f='<a href="'+n+'"';return r&&(f+=' title="'+r+'"'),f+=">"+o+"</a>",f}image(n,r,o){const u=Lo(n);if(u===null)return o;n=u;let f=`<img src="${n}" alt="${o}"`;return r&&(f+=` title="${r}"`),f+=">",f}text(n){return n}}class Ka{strong(n){return n}em(n){return n}codespan(n){return n}del(n){return n}html(n){return n}text(n){return n}link(n,r,o){return""+o}image(n,r,o){return""+o}br(){return""}}class mn{constructor(n){Je(this,"options");Je(this,"renderer");Je(this,"textRenderer");this.options=n||Vn,this.options.renderer=this.options.renderer||new Gi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ka}static parse(n,r){return new mn(r).parse(n)}static parseInline(n,r){return new mn(r).parseInline(n)}parse(n,r=!0){let o="";for(let u=0;u<n.length;u++){const f=n[u];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]){const p=f,y=this.options.extensions.renderers[p.type].call({parser:this},p);if(y!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)){o+=y||"";continue}}switch(f.type){case"space":continue;case"hr":{o+=this.renderer.hr();continue}case"heading":{const p=f;o+=this.renderer.heading(this.parseInline(p.tokens),p.depth,lf(this.parseInline(p.tokens,this.textRenderer)));continue}case"code":{const p=f;o+=this.renderer.code(p.text,p.lang,!!p.escaped);continue}case"table":{const p=f;let y="",m="";for(let S=0;S<p.header.length;S++)m+=this.renderer.tablecell(this.parseInline(p.header[S].tokens),{header:!0,align:p.align[S]});y+=this.renderer.tablerow(m);let k="";for(let S=0;S<p.rows.length;S++){const
|
|
68
|
-
`+(p.tokens?this.parseInline(p.tokens):p.text);o+=r?this.renderer.paragraph(y):y;continue}default:{const p='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return o}parseInline(n,r){r=r||this.renderer;let o="";for(let u=0;u<n.length;u++){const f=n[u];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]){const p=this.options.extensions.renderers[f.type].call({parser:this},f);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){o+=p||"";continue}}switch(f.type){case"escape":{const p=f;o+=r.text(p.text);break}case"html":{const p=f;o+=r.html(p.text);break}case"link":{const p=f;o+=r.link(p.href,p.title,this.parseInline(p.tokens,r));break}case"image":{const p=f;o+=r.image(p.href,p.title,p.text);break}case"strong":{const p=f;o+=r.strong(this.parseInline(p.tokens,r));break}case"em":{const p=f;o+=r.em(this.parseInline(p.tokens,r));break}case"codespan":{const p=f;o+=r.codespan(p.text);break}case"br":{o+=r.br();break}case"del":{const p=f;o+=r.del(this.parseInline(p.tokens,r));break}case"text":{const p=f;o+=r.text(p.text);break}default:{const p='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return o}}class Zr{constructor(n){Je(this,"options");this.options=n||Vn}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}}Je(Zr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class $f{constructor(...n){Yc(this,Qn);Je(this,"defaults",Ba());Je(this,"options",this.setOptions);Je(this,"parse",$a(this,Qn,co).call(this,gn.lex,mn.parse));Je(this,"parseInline",$a(this,Qn,co).call(this,gn.lexInline,mn.parseInline));Je(this,"Parser",mn);Je(this,"Renderer",Gi);Je(this,"TextRenderer",Ka);Je(this,"Lexer",gn);Je(this,"Tokenizer",Wi);Je(this,"Hooks",Zr);this.use(...n)}walkTokens(n,r){var u,f;let o=[];for(const p of n)switch(o=o.concat(r.call(this,p)),p.type){case"table":{const y=p;for(const m of y.header)o=o.concat(this.walkTokens(m.tokens,r));for(const m of y.rows)for(const k of m)o=o.concat(this.walkTokens(k.tokens,r));break}case"list":{const y=p;o=o.concat(this.walkTokens(y.items,r));break}default:{const y=p;(f=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&f[y.type]?this.defaults.extensions.childTokens[y.type].forEach(m=>{const k=y[m].flat(1/0);o=o.concat(this.walkTokens(k,r))}):y.tokens&&(o=o.concat(this.walkTokens(y.tokens,r)))}}return o}use(...n){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(o=>{const u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){const p=r.renderers[f.name];p?r.renderers[f.name]=function(...y){let m=f.renderer.apply(this,y);return m===!1&&(m=p.apply(this,y)),m}:r.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=r[f.level];p?p.unshift(f.tokenizer):r[f.level]=[f.tokenizer],f.start&&(f.level==="block"?r.startBlock?r.startBlock.push(f.start):r.startBlock=[f.start]:f.level==="inline"&&(r.startInline?r.startInline.push(f.start):r.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(r.childTokens[f.name]=f.childTokens)}),u.extensions=r),o.renderer){const f=this.defaults.renderer||new Gi(this.defaults);for(const p in o.renderer){if(!(p in f))throw new Error(`renderer '${p}' does not exist`);if(p==="options")continue;const y=p,m=o.renderer[y],k=f[y];f[y]=(...S)=>{let
|
|
69
|
-
Please report this to https://github.com/markedjs/marked.`,n){const u="<p>An error occurred:</p><pre>"+qt(o.message+"",!0)+"</pre>";return r?Promise.resolve(u):u}if(r)return Promise.reject(o);throw o}};const Xn=new $f;function Se(l,n){return Xn.parse(l,n)}Se.options=Se.setOptions=function(l){return Xn.setOptions(l),Se.defaults=Xn.defaults,So(Se.defaults),Se},Se.getDefaults=Ba,Se.defaults=Vn,Se.use=function(...l){return Xn.use(...l),Se.defaults=Xn.defaults,So(Se.defaults),Se},Se.walkTokens=function(l,n){return Xn.walkTokens(l,n)},Se.parseInline=Xn.parseInline,Se.Parser=mn,Se.parser=mn.parse,Se.Renderer=Gi,Se.TextRenderer=Ka,Se.Lexer=gn,Se.lexer=gn.lex,Se.Tokenizer=Wi,Se.Hooks=Zr,Se.parse=Se,Se.options,Se.setOptions,Se.use,Se.walkTokens,Se.parseInline,mn.parse,gn.lex;function vn(l,n,r,o,u,f,p,y){var m=typeof l=="function"?l.options:l;return n&&(m.render=n,m.staticRenderFns=r,m._compiled=!0),f&&(m._scopeId="data-v-"+f),{exports:l,options:m}}const Pf={name:"TimelineHeader",props:{timeRange:{type:String,default:"-"},allExpanded:{type:Boolean,default:!1},viewMode:{type:String,default:"list"}},methods:{handleToggleExpand(){this.$emit("toggle-expand")},handleToggleView(){this.$emit("toggle-view")}}};var zf=function(){var n=this,r=n._self._c;return r("div",{staticClass:"timeline-header"},[r("div",{staticClass:"time-scale"},[r("span",{staticClass:"time-range"},[n._v(n._s(n.timeRange))])]),r("div",{staticClass:"header-actions"},[n.viewMode==="tree"?r("el-tooltip",{attrs:{content:n.allExpanded?"合上所有节点":"展开所有节点",placement:"top"}},[r("i",{staticClass:"action-icon",class:n.allExpanded?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:n.handleToggleExpand}})]):n._e(),r("el-tooltip",{attrs:{content:n.viewMode==="list"?"切换到树形视图":"切换到列表视图",placement:"top"}},[r("i",{staticClass:"action-icon",class:n.viewMode==="list"?"el-icon-menu":"el-icon-s-operation",on:{click:n.handleToggleView}})])],1)])},Bf=[],Hf=vn(Pf,zf,Bf,!1,null,"a6b357e5");const Wf=Hf.exports,jf={name:"TimelineBar",props:{barStyle:{type:Object,required:!0},statusDescription:{type:String,default:""},selected:{type:Boolean,default:!1},error:{type:Boolean,default:!1},hasEvents:{type:Boolean,default:!1}}};var Uf=function(){var n=this,r=n._self._c;return r("el-tooltip",{attrs:{content:n.statusDescription,disabled:!n.statusDescription,placement:"top","popper-class":"span-status-tooltip"}},[r("div",{staticClass:"timeline-bar-wrapper"},[r("div",{staticClass:"timeline-bar",class:{selected:n.selected,error:n.error,"has-events":n.hasEvents},style:n.barStyle})])])},qf=[],Gf=vn(jf,Uf,qf,!1,null,"52995efa");const Po=Gf.exports,Kf={name:"SpanTreeNode",components:{TimelineBar:Po},props:{node:{type:Object,required:!0},selected:{type:Boolean,default:!1},selectedSpanId:{type:String,default:null},expandedNodes:{type:Set,required:!0},depth:{type:Number,default:0},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0},spanTypeList:{type:Array,default:()=>[]}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},isRootNode(){return this.depth===0},isExpanded(){return this.isRootNode?!0:this.expandedNodes.has(this.node.span_id)},shouldShowChildren(){return this.isRootNode?!0:this.isExpanded},duration(){return mo(this.node.duration_ns)},typeLabel(){const l=this.node.type;if(l==null||l==="")return"-";const n=this.spanTypeList.find(r=>r.value===l);return n?n.label:l},typeColor(){return yo(this.node.type)},typeCustomColor(){return bo(this.node.type)},statusDescription(){return xo(this.node)},barStyle(){return wo(this.node,this.traceStartTime,this.traceEndTime)},error(){return this.node.status==="ERROR"},hasEvents(){return this.node.has_events===!0},isChild(){return this.depth>0}},methods:{handleClick(){this.$emit("node-click",this.node)},handleToggleExpand(){this.isRootNode||this.$emit("toggle-expand",this.node)}}};var Vf=function(){var n=this,r=n._self._c;return r("div",[r("div",{staticClass:"timeline-node",class:{selected:n.selected,error:n.error,"child-node":n.isChild},on:{click:n.handleClick}},[r("div",{staticClass:"node-row"},[r("div",{staticClass:"node-info"},[n.hasChildren&&!n.isRootNode?r("i",{staticClass:"expand-icon",class:n.isExpanded?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:function(o){return o.stopPropagation(),n.handleToggleExpand.apply(null,arguments)}}}):n._e(),r("el-tag",{staticClass:"type-tag",attrs:{type:n.typeColor,color:n.typeCustomColor,size:"mini"}},[n._v(" "+n._s(n.typeLabel)+" ")]),r("el-tooltip",{attrs:{content:n.node.name,placement:"top","open-delay":300}},[r("span",{staticClass:"node-name"},[n._v(n._s(n.node.name))])])],1),r("div",{staticClass:"node-duration"},[n._v(" "+n._s(n.duration)+" ")])]),r("TimelineBar",{attrs:{"bar-style":n.barStyle,"status-description":n.statusDescription,selected:n.selected,error:n.error,"has-events":n.hasEvents}})],1),n.shouldShowChildren&&n.hasChildren?r("div",{staticClass:"children-nodes"},n._l(n.node.children,function(o){return r("SpanTreeNode",{key:o.span_id,attrs:{node:o,selected:o.span_id===n.selectedSpanId,"selected-span-id":n.selectedSpanId,"expanded-nodes":n.expandedNodes,depth:n.depth+1,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.spanTypeList},on:{"node-click":function(u){return n.$emit("node-click",u)},"toggle-expand":function(u){return n.$emit("toggle-expand",u)}}})}),1):n._e()])},Xf=[],Yf=vn(Kf,Vf,Xf,!1,null,"3dcb687d");const Jf=Yf.exports,Qf={name:"SpanListNode",components:{TimelineBar:Po},props:{node:{type:Object,required:!0},selected:{type:Boolean,default:!1},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0},spanTypeList:{type:Array,default:()=>[]}},computed:{duration(){return mo(this.node.duration_ns)},typeLabel(){const l=this.node.type;if(l==null||l==="")return"-";const n=this.spanTypeList.find(r=>r.value===l);return n?n.label:l},typeColor(){return yo(this.node.type)},typeCustomColor(){return bo(this.node.type)},statusDescription(){return xo(this.node)},barStyle(){return wo(this.node,this.traceStartTime,this.traceEndTime)},error(){return this.node.status==="ERROR"},hasEvents(){return this.node.has_events===!0}},methods:{handleClick(){this.$emit("node-click",this.node)}}};var Zf=function(){var n=this,r=n._self._c;return r("div",{staticClass:"timeline-node",class:{selected:n.selected,error:n.error},on:{click:n.handleClick}},[r("div",{staticClass:"node-row"},[r("div",{staticClass:"node-info"},[r("el-tag",{staticClass:"type-tag",attrs:{type:n.typeColor,color:n.typeCustomColor,size:"mini"}},[n._v(" "+n._s(n.typeLabel)+" ")]),r("el-tooltip",{attrs:{content:n.node.name,placement:"top","open-delay":300}},[r("span",{staticClass:"node-name"},[n._v(n._s(n.node.name))])])],1),r("div",{staticClass:"node-duration"},[n._v(" "+n._s(n.duration)+" ")])]),r("TimelineBar",{attrs:{"bar-style":n.barStyle,"status-description":n.statusDescription,selected:n.selected,error:n.error,"has-events":n.hasEvents}})],1)},ed=[],td=vn(Qf,Zf,ed,!1,null,"97dce313");const nd=td.exports,rd={name:"TraceSpanTree",components:{TimelineHeader:Wf,SpanTreeNode:Jf,SpanListNode:nd},props:{spans:{type:Array,default:()=>[]},selectedSpanId:{type:String,default:null},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0},spanTypeList:{type:Array,default:()=>[]}},data(){return{expandedNodes:new Set,treeData:[],allExpanded:!1,viewMode:"list"}},computed:{flatListData(){const l=[],n=r=>{r.forEach(o=>{l.push(o),o.children&&o.children.length>0&&n(o.children)})};return n(this.treeData),l},timeRange(){const l=this.$t?this.$t("trace.to"):"-";return nf(this.traceStartTime,this.traceEndTime,l)}},watch:{spans:{immediate:!0,handler(){this.buildTree()}}},methods:{buildTree(){if(!this.spans||this.spans.length===0){this.treeData=[];return}const l=new Map,n=[];this.spans.forEach(r=>{l.set(r.span_id,{...r,children:[]})}),this.spans.forEach(r=>{const o=l.get(r.span_id);if(r.parent_span_id){const u=l.get(r.parent_span_id);u?u.children.push(o):n.push(o)}else n.push(o)}),n.forEach(r=>{this.sortChildren(r)}),this.treeData=n,this.expandAllNodes()},expandAllNodes(){const l=new Set,n=r=>{r.forEach(o=>{o.children&&o.children.length>0&&o.children.forEach(u=>{this.hasChildren(u)&&l.add(u.span_id),u.children&&u.children.length>0&&n([u])})})};n(this.treeData),this.expandedNodes=l,this.allExpanded=!0,this.$forceUpdate()},collapseAllNodes(){const l=new Set;this.expandedNodes=l,this.allExpanded=!1,this.$forceUpdate()},toggleAllExpand(){this.allExpanded?this.collapseAllNodes():this.expandAllNodes()},toggleViewMode(){this.viewMode=this.viewMode==="list"?"tree":"list"},sortChildren(l){l.children&&l.children.length>0&&(l.children.sort((n,r)=>n.start_time_unix_nano-r.start_time_unix_nano),l.children.forEach(n=>this.sortChildren(n)))},handleNodeClick(l){this.$emit("span-select",l)},hasChildren(l){return l.children&&l.children.length>0},toggleExpand(l){if(this.treeData.some(o=>o.span_id===l.span_id))return;const r=new Set(this.expandedNodes);r.has(l.span_id)?r.delete(l.span_id):r.add(l.span_id),this.expandedNodes=r,this.updateAllExpandedState(),this.$forceUpdate()},updateAllExpandedState(){const l=(r,o=!1)=>{for(const u of r)if(this.hasChildren(u)&&(!o&&!this.expandedNodes.has(u.span_id)||u.children&&u.children.length>0&&!l(u.children,!1)))return!1;return!0};if(!this.treeData.some(r=>r.children&&r.children.some(o=>this.hasChildren(o)))){this.allExpanded=!1;return}this.allExpanded=l(this.treeData,!0)}}};var id=function(){var n=this,r=n._self._c;return r("div",{staticClass:"span-tree-container"},[n.treeData.length===0?r("div",{staticClass:"empty-state"},[r("el-empty",{attrs:{description:"暂无 Span 数据"}})],1):r("div",{staticClass:"timeline-wrapper"},[r("TimelineHeader",{attrs:{"time-range":n.timeRange,"all-expanded":n.allExpanded,"view-mode":n.viewMode},on:{"toggle-expand":n.toggleAllExpand,"toggle-view":n.toggleViewMode}}),r("div",{ref:"timelineContent",staticClass:"timeline-content"},[n.viewMode==="tree"?n._l(n.treeData,function(o){return r("SpanTreeNode",{key:o.span_id,attrs:{node:o,selected:n.selectedSpanId===o.span_id,"selected-span-id":n.selectedSpanId,"expanded-nodes":n.expandedNodes,depth:0,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.spanTypeList},on:{"node-click":n.handleNodeClick,"toggle-expand":n.toggleExpand}})}):n._l(n.flatListData,function(o){return r("SpanListNode",{key:o.span_id,attrs:{node:o,selected:n.selectedSpanId===o.span_id,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.spanTypeList},on:{"node-click":n.handleNodeClick}})})],2)],1)])},ad=[],sd=vn(rd,id,ad,!1,null,"0cf980e1");const Va=sd.exports;function od(){return window.pdfjsLib}const ld={name:"FilePdfViewer",props:{element:{type:Object,required:!0}},data(){return{currentPage:1,totalPages:0,loading:!1,error:null,pdfDoc:null,renderTask:null}},computed:{formatPageIndicator(){return this.$t("trace.pdfPageIndicator",{page:this.currentPage,total:this.totalPages||1})}},watch:{"element.downloadUrl":{handler(){this.currentPage=1,this.totalPages=0,this.error=null,this.pdfDoc=null,this.loadPdf()}},currentPage(){this.renderCurrentPage()}},mounted(){this.loadPdf()},beforeDestroy(){this.cancelRender(),this.pdfDoc&&(this.pdfDoc.destroy(),this.pdfDoc=null)},methods:{async loadPdf(){var n;const l=(n=this.element)==null?void 0:n.downloadUrl;if(!l){this.error="No PDF URL";return}this.loading=!0,this.error=null,this.cancelRender(),this.pdfDoc&&(this.pdfDoc.destroy(),this.pdfDoc=null);try{const r=od();if(!r){this.error="PDF.js not loaded";return}if(!r.GlobalWorkerOptions.workerSrc){const u="/";r.GlobalWorkerOptions.workerSrc=u.replace(/\/$/,"")+"/pdfjs/js/pdf.worker.js"}const o=r.getDocument({url:l});this.pdfDoc=await o.promise,this.totalPages=this.pdfDoc.numPages,this.loading=!1,await this.$nextTick(),await this.renderCurrentPage()}catch(r){this.error=(r==null?void 0:r.message)||"Failed to load PDF"}finally{this.loading=!1}},cancelRender(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null)},async renderCurrentPage(){if(!(!this.pdfDoc||!this.$refs.canvasRef)){this.cancelRender();try{const l=await this.pdfDoc.getPage(this.currentPage),n=this.$refs.canvasRef,r=n.getContext("2d"),u=1.5*(window.devicePixelRatio||1),f=l.getViewport({scale:u});n.height=f.height,n.width=f.width,n.style.width=`${f.width/u}px`,n.style.height=`${f.height/u}px`,this.renderTask=l.render({canvasContext:r,viewport:f}),await this.renderTask.promise}catch(l){(l==null?void 0:l.name)!=="RenderingCancelledException"&&(this.error=(l==null?void 0:l.message)||"Failed to render page")}finally{this.renderTask=null}}},prevPage(){this.currentPage>1&&this.currentPage--},nextPage(){this.currentPage<this.totalPages&&this.currentPage++},downloadFile(){var o,u,f;const l=(o=this.element)==null?void 0:o.downloadUrl;if(!l)return;const n=((u=this.element)==null?void 0:u.name)||((f=this.element)==null?void 0:f.label)||"file.pdf",r=document.createElement("a");r.href=l,r.download=n,r.rel="noopener",r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r)}}};var ud=function(){var o;var n=this,r=n._self._c;return r("div",{staticClass:"file-pdf-content"},[n.element.label?r("div",{staticClass:"image-label"},[n._v(n._s(n.element.label))]):n._e(),r("div",{staticClass:"file-pdf-toolbar"},[r("el-button",{attrs:{size:"mini",disabled:n.currentPage<=1},on:{click:n.prevPage}},[n._v(n._s(n.$t("trace.pdfPrevPage")))]),r("span",{staticClass:"file-pdf-page-indicator"},[n._v(n._s(n.formatPageIndicator))]),r("el-button",{attrs:{size:"mini",disabled:n.totalPages>0&&n.currentPage>=n.totalPages},on:{click:n.nextPage}},[n._v(n._s(n.$t("trace.pdfNextPage")))]),r("el-button",{attrs:{size:"mini",type:"primary",disabled:!((o=n.element)!=null&&o.downloadUrl)},on:{click:n.downloadFile}},[n._v(n._s(n.$t("trace.pdfDownload")))])],1),r("div",{staticClass:"file-pdf-viewer"},[n.loading?r("div",{staticClass:"file-pdf-loading"},[n._v(n._s(n.$t("trace.pdfLoading")))]):n.error?r("div",{staticClass:"file-pdf-error"},[n._v(n._s(n.error))]):r("canvas",{ref:"canvasRef",staticClass:"file-pdf-canvas"})])])},cd=[],fd=vn(ld,ud,cd,!1,null,"c9463f15");const Xa=fd.exports;/*!
|
|
67
|
+
`}strong(n){return`<strong>${n}</strong>`}em(n){return`<em>${n}</em>`}codespan(n){return`<code>${n}</code>`}br(){return"<br>"}del(n){return`<del>${n}</del>`}link(n,r,o){const u=Lo(n);if(u===null)return o;n=u;let f='<a href="'+n+'"';return r&&(f+=' title="'+r+'"'),f+=">"+o+"</a>",f}image(n,r,o){const u=Lo(n);if(u===null)return o;n=u;let f=`<img src="${n}" alt="${o}"`;return r&&(f+=` title="${r}"`),f+=">",f}text(n){return n}}class Ka{strong(n){return n}em(n){return n}codespan(n){return n}del(n){return n}html(n){return n}text(n){return n}link(n,r,o){return""+o}image(n,r,o){return""+o}br(){return""}}class mn{constructor(n){Je(this,"options");Je(this,"renderer");Je(this,"textRenderer");this.options=n||Vn,this.options.renderer=this.options.renderer||new Gi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ka}static parse(n,r){return new mn(r).parse(n)}static parseInline(n,r){return new mn(r).parseInline(n)}parse(n,r=!0){let o="";for(let u=0;u<n.length;u++){const f=n[u];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]){const p=f,y=this.options.extensions.renderers[p.type].call({parser:this},p);if(y!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)){o+=y||"";continue}}switch(f.type){case"space":continue;case"hr":{o+=this.renderer.hr();continue}case"heading":{const p=f;o+=this.renderer.heading(this.parseInline(p.tokens),p.depth,lf(this.parseInline(p.tokens,this.textRenderer)));continue}case"code":{const p=f;o+=this.renderer.code(p.text,p.lang,!!p.escaped);continue}case"table":{const p=f;let y="",m="";for(let S=0;S<p.header.length;S++)m+=this.renderer.tablecell(this.parseInline(p.header[S].tokens),{header:!0,align:p.align[S]});y+=this.renderer.tablerow(m);let k="";for(let S=0;S<p.rows.length;S++){const R=p.rows[S];m="";for(let L=0;L<R.length;L++)m+=this.renderer.tablecell(this.parseInline(R[L].tokens),{header:!1,align:p.align[L]});k+=this.renderer.tablerow(m)}o+=this.renderer.table(y,k);continue}case"blockquote":{const p=f,y=this.parse(p.tokens);o+=this.renderer.blockquote(y);continue}case"list":{const p=f,y=p.ordered,m=p.start,k=p.loose;let S="";for(let R=0;R<p.items.length;R++){const L=p.items[R],W=L.checked,z=L.task;let D="";if(L.task){const $=this.renderer.checkbox(!!W);k?L.tokens.length>0&&L.tokens[0].type==="paragraph"?(L.tokens[0].text=$+" "+L.tokens[0].text,L.tokens[0].tokens&&L.tokens[0].tokens.length>0&&L.tokens[0].tokens[0].type==="text"&&(L.tokens[0].tokens[0].text=$+" "+L.tokens[0].tokens[0].text)):L.tokens.unshift({type:"text",text:$+" "}):D+=$+" "}D+=this.parse(L.tokens,k),S+=this.renderer.listitem(D,z,!!W)}o+=this.renderer.list(S,y,m);continue}case"html":{const p=f;o+=this.renderer.html(p.text,p.block);continue}case"paragraph":{const p=f;o+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{let p=f,y=p.tokens?this.parseInline(p.tokens):p.text;for(;u+1<n.length&&n[u+1].type==="text";)p=n[++u],y+=`
|
|
68
|
+
`+(p.tokens?this.parseInline(p.tokens):p.text);o+=r?this.renderer.paragraph(y):y;continue}default:{const p='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return o}parseInline(n,r){r=r||this.renderer;let o="";for(let u=0;u<n.length;u++){const f=n[u];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]){const p=this.options.extensions.renderers[f.type].call({parser:this},f);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){o+=p||"";continue}}switch(f.type){case"escape":{const p=f;o+=r.text(p.text);break}case"html":{const p=f;o+=r.html(p.text);break}case"link":{const p=f;o+=r.link(p.href,p.title,this.parseInline(p.tokens,r));break}case"image":{const p=f;o+=r.image(p.href,p.title,p.text);break}case"strong":{const p=f;o+=r.strong(this.parseInline(p.tokens,r));break}case"em":{const p=f;o+=r.em(this.parseInline(p.tokens,r));break}case"codespan":{const p=f;o+=r.codespan(p.text);break}case"br":{o+=r.br();break}case"del":{const p=f;o+=r.del(this.parseInline(p.tokens,r));break}case"text":{const p=f;o+=r.text(p.text);break}default:{const p='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return o}}class Zr{constructor(n){Je(this,"options");this.options=n||Vn}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}}Je(Zr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class $f{constructor(...n){Yc(this,Qn);Je(this,"defaults",Ba());Je(this,"options",this.setOptions);Je(this,"parse",$a(this,Qn,co).call(this,gn.lex,mn.parse));Je(this,"parseInline",$a(this,Qn,co).call(this,gn.lexInline,mn.parseInline));Je(this,"Parser",mn);Je(this,"Renderer",Gi);Je(this,"TextRenderer",Ka);Je(this,"Lexer",gn);Je(this,"Tokenizer",Wi);Je(this,"Hooks",Zr);this.use(...n)}walkTokens(n,r){var u,f;let o=[];for(const p of n)switch(o=o.concat(r.call(this,p)),p.type){case"table":{const y=p;for(const m of y.header)o=o.concat(this.walkTokens(m.tokens,r));for(const m of y.rows)for(const k of m)o=o.concat(this.walkTokens(k.tokens,r));break}case"list":{const y=p;o=o.concat(this.walkTokens(y.items,r));break}default:{const y=p;(f=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&f[y.type]?this.defaults.extensions.childTokens[y.type].forEach(m=>{const k=y[m].flat(1/0);o=o.concat(this.walkTokens(k,r))}):y.tokens&&(o=o.concat(this.walkTokens(y.tokens,r)))}}return o}use(...n){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(o=>{const u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){const p=r.renderers[f.name];p?r.renderers[f.name]=function(...y){let m=f.renderer.apply(this,y);return m===!1&&(m=p.apply(this,y)),m}:r.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=r[f.level];p?p.unshift(f.tokenizer):r[f.level]=[f.tokenizer],f.start&&(f.level==="block"?r.startBlock?r.startBlock.push(f.start):r.startBlock=[f.start]:f.level==="inline"&&(r.startInline?r.startInline.push(f.start):r.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(r.childTokens[f.name]=f.childTokens)}),u.extensions=r),o.renderer){const f=this.defaults.renderer||new Gi(this.defaults);for(const p in o.renderer){if(!(p in f))throw new Error(`renderer '${p}' does not exist`);if(p==="options")continue;const y=p,m=o.renderer[y],k=f[y];f[y]=(...S)=>{let R=m.apply(f,S);return R===!1&&(R=k.apply(f,S)),R||""}}u.renderer=f}if(o.tokenizer){const f=this.defaults.tokenizer||new Wi(this.defaults);for(const p in o.tokenizer){if(!(p in f))throw new Error(`tokenizer '${p}' does not exist`);if(["options","rules","lexer"].includes(p))continue;const y=p,m=o.tokenizer[y],k=f[y];f[y]=(...S)=>{let R=m.apply(f,S);return R===!1&&(R=k.apply(f,S)),R}}u.tokenizer=f}if(o.hooks){const f=this.defaults.hooks||new Zr;for(const p in o.hooks){if(!(p in f))throw new Error(`hook '${p}' does not exist`);if(p==="options")continue;const y=p,m=o.hooks[y],k=f[y];Zr.passThroughHooks.has(p)?f[y]=S=>{if(this.defaults.async)return Promise.resolve(m.call(f,S)).then(L=>k.call(f,L));const R=m.call(f,S);return k.call(f,R)}:f[y]=(...S)=>{let R=m.apply(f,S);return R===!1&&(R=k.apply(f,S)),R}}u.hooks=f}if(o.walkTokens){const f=this.defaults.walkTokens,p=o.walkTokens;u.walkTokens=function(y){let m=[];return m.push(p.call(this,y)),f&&(m=m.concat(f.call(this,y))),m}}this.defaults={...this.defaults,...u}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return gn.lex(n,r??this.defaults)}parser(n,r){return mn.parse(n,r??this.defaults)}}Qn=new WeakSet,co=function(n,r){return(o,u)=>{const f={...u},p={...this.defaults,...f};this.defaults.async===!0&&f.async===!1&&(p.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),p.async=!0);const y=$a(this,Qn,Jc).call(this,!!p.silent,!!p.async);if(typeof o>"u"||o===null)return y(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return y(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(p.hooks&&(p.hooks.options=p),p.async)return Promise.resolve(p.hooks?p.hooks.preprocess(o):o).then(m=>n(m,p)).then(m=>p.hooks?p.hooks.processAllTokens(m):m).then(m=>p.walkTokens?Promise.all(this.walkTokens(m,p.walkTokens)).then(()=>m):m).then(m=>r(m,p)).then(m=>p.hooks?p.hooks.postprocess(m):m).catch(y);try{p.hooks&&(o=p.hooks.preprocess(o));let m=n(o,p);p.hooks&&(m=p.hooks.processAllTokens(m)),p.walkTokens&&this.walkTokens(m,p.walkTokens);let k=r(m,p);return p.hooks&&(k=p.hooks.postprocess(k)),k}catch(m){return y(m)}}},Jc=function(n,r){return o=>{if(o.message+=`
|
|
69
|
+
Please report this to https://github.com/markedjs/marked.`,n){const u="<p>An error occurred:</p><pre>"+Ut(o.message+"",!0)+"</pre>";return r?Promise.resolve(u):u}if(r)return Promise.reject(o);throw o}};const Xn=new $f;function Se(l,n){return Xn.parse(l,n)}Se.options=Se.setOptions=function(l){return Xn.setOptions(l),Se.defaults=Xn.defaults,So(Se.defaults),Se},Se.getDefaults=Ba,Se.defaults=Vn,Se.use=function(...l){return Xn.use(...l),Se.defaults=Xn.defaults,So(Se.defaults),Se},Se.walkTokens=function(l,n){return Xn.walkTokens(l,n)},Se.parseInline=Xn.parseInline,Se.Parser=mn,Se.parser=mn.parse,Se.Renderer=Gi,Se.TextRenderer=Ka,Se.Lexer=gn,Se.lexer=gn.lex,Se.Tokenizer=Wi,Se.Hooks=Zr,Se.parse=Se,Se.options,Se.setOptions,Se.use,Se.walkTokens,Se.parseInline,mn.parse,gn.lex;function vn(l,n,r,o,u,f,p,y){var m=typeof l=="function"?l.options:l;return n&&(m.render=n,m.staticRenderFns=r,m._compiled=!0),f&&(m._scopeId="data-v-"+f),{exports:l,options:m}}const Pf={name:"TimelineHeader",props:{timeRange:{type:String,default:"-"},allExpanded:{type:Boolean,default:!1},viewMode:{type:String,default:"list"}},methods:{handleToggleExpand(){this.$emit("toggle-expand")},handleToggleView(){this.$emit("toggle-view")}}};var zf=function(){var n=this,r=n._self._c;return r("div",{staticClass:"timeline-header"},[r("div",{staticClass:"time-scale"},[r("span",{staticClass:"time-range"},[n._v(n._s(n.timeRange))])]),r("div",{staticClass:"header-actions"},[n.viewMode==="tree"?r("el-tooltip",{attrs:{content:n.allExpanded?"合上所有节点":"展开所有节点",placement:"top"}},[r("i",{staticClass:"action-icon",class:n.allExpanded?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:n.handleToggleExpand}})]):n._e(),r("el-tooltip",{attrs:{content:n.viewMode==="list"?"切换到树形视图":"切换到列表视图",placement:"top"}},[r("i",{staticClass:"action-icon",class:n.viewMode==="list"?"el-icon-menu":"el-icon-s-operation",on:{click:n.handleToggleView}})])],1)])},Bf=[],Hf=vn(Pf,zf,Bf,!1,null,"a6b357e5");const Wf=Hf.exports,jf={name:"TimelineBar",props:{barStyle:{type:Object,required:!0},statusDescription:{type:String,default:""},selected:{type:Boolean,default:!1},error:{type:Boolean,default:!1},hasEvents:{type:[Boolean,Number],default:!1}}};var qf=function(){var n=this,r=n._self._c;return r("el-tooltip",{attrs:{content:n.statusDescription,disabled:!n.statusDescription,placement:"top","popper-class":"span-status-tooltip"}},[r("div",{staticClass:"timeline-bar-wrapper"},[r("div",{staticClass:"timeline-bar",class:{selected:n.selected,error:n.error,"has-events":n.hasEvents},style:n.barStyle})])])},Uf=[],Gf=vn(jf,qf,Uf,!1,null,"00a350c8");const Po=Gf.exports,Kf={name:"SpanTreeNode",components:{TimelineBar:Po},props:{node:{type:Object,required:!0},selected:{type:Boolean,default:!1},selectedSpanId:{type:String,default:null},expandedNodes:{type:Set,required:!0},depth:{type:Number,default:0},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0},spanTypeList:{type:Array,default:()=>[]}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},isRootNode(){return this.depth===0},isExpanded(){return this.isRootNode?!0:this.expandedNodes.has(this.node.span_id)},shouldShowChildren(){return this.isRootNode?!0:this.isExpanded},duration(){return mo(this.node.duration_ns)},typeLabel(){const l=this.node.type;if(l==null||l==="")return"-";const n=this.spanTypeList.find(r=>r.value===l);return n?n.label:l},typeColor(){return yo(this.node.type)},typeCustomColor(){return bo(this.node.type)},statusDescription(){return xo(this.node)},barStyle(){return wo(this.node,this.traceStartTime,this.traceEndTime)},error(){return this.node.status==="ERROR"},hasEvents(){return!!this.node.has_events},isChild(){return this.depth>0}},methods:{handleClick(){this.$emit("node-click",this.node)},handleToggleExpand(){this.isRootNode||this.$emit("toggle-expand",this.node)}}};var Vf=function(){var n=this,r=n._self._c;return r("div",[r("div",{staticClass:"timeline-node",class:{selected:n.selected,error:n.error,"child-node":n.isChild},on:{click:n.handleClick}},[r("div",{staticClass:"node-row"},[r("div",{staticClass:"node-info"},[n.hasChildren&&!n.isRootNode?r("i",{staticClass:"expand-icon",class:n.isExpanded?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:function(o){return o.stopPropagation(),n.handleToggleExpand.apply(null,arguments)}}}):n._e(),r("el-tag",{staticClass:"type-tag",attrs:{type:n.typeColor,color:n.typeCustomColor,size:"mini"}},[n._v(" "+n._s(n.typeLabel)+" ")]),r("el-tooltip",{attrs:{content:n.node.name,placement:"top","open-delay":300}},[r("span",{staticClass:"node-name"},[n._v(n._s(n.node.name))])])],1),r("div",{staticClass:"node-duration"},[n._v(" "+n._s(n.duration)+" ")])]),r("TimelineBar",{attrs:{"bar-style":n.barStyle,"status-description":n.statusDescription,selected:n.selected,error:n.error,"has-events":n.hasEvents}})],1),n.shouldShowChildren&&n.hasChildren?r("div",{staticClass:"children-nodes"},n._l(n.node.children,function(o){return r("SpanTreeNode",{key:o.span_id,attrs:{node:o,selected:o.span_id===n.selectedSpanId,"selected-span-id":n.selectedSpanId,"expanded-nodes":n.expandedNodes,depth:n.depth+1,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.spanTypeList},on:{"node-click":function(u){return n.$emit("node-click",u)},"toggle-expand":function(u){return n.$emit("toggle-expand",u)}}})}),1):n._e()])},Xf=[],Yf=vn(Kf,Vf,Xf,!1,null,"d10c241e");const Jf=Yf.exports,Qf={name:"SpanListNode",components:{TimelineBar:Po},props:{node:{type:Object,required:!0},selected:{type:Boolean,default:!1},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0},spanTypeList:{type:Array,default:()=>[]}},computed:{duration(){return mo(this.node.duration_ns)},typeLabel(){const l=this.node.type;if(l==null||l==="")return"-";const n=this.spanTypeList.find(r=>r.value===l);return n?n.label:l},typeColor(){return yo(this.node.type)},typeCustomColor(){return bo(this.node.type)},statusDescription(){return xo(this.node)},barStyle(){return wo(this.node,this.traceStartTime,this.traceEndTime)},error(){return this.node.status==="ERROR"},hasEvents(){return!!this.node.has_events}},methods:{handleClick(){this.$emit("node-click",this.node)}}};var Zf=function(){var n=this,r=n._self._c;return r("div",{staticClass:"timeline-node",class:{selected:n.selected,error:n.error},on:{click:n.handleClick}},[r("div",{staticClass:"node-row"},[r("div",{staticClass:"node-info"},[r("el-tag",{staticClass:"type-tag",attrs:{type:n.typeColor,color:n.typeCustomColor,size:"mini"}},[n._v(" "+n._s(n.typeLabel)+" ")]),r("el-tooltip",{attrs:{content:n.node.name,placement:"top","open-delay":300}},[r("span",{staticClass:"node-name"},[n._v(n._s(n.node.name))])])],1),r("div",{staticClass:"node-duration"},[n._v(" "+n._s(n.duration)+" ")])]),r("TimelineBar",{attrs:{"bar-style":n.barStyle,"status-description":n.statusDescription,selected:n.selected,error:n.error,"has-events":n.hasEvents}})],1)},ed=[],td=vn(Qf,Zf,ed,!1,null,"111b6031");const nd=td.exports,rd={name:"TraceSpanTree",components:{TimelineHeader:Wf,SpanTreeNode:Jf,SpanListNode:nd},props:{spans:{type:Array,default:()=>[]},selectedSpanId:{type:String,default:null},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0},spanTypeList:{type:Array,default:()=>[]}},data(){return{expandedNodes:new Set,treeData:[],allExpanded:!1,viewMode:"list"}},computed:{flatListData(){const l=[],n=r=>{r.forEach(o=>{l.push(o),o.children&&o.children.length>0&&n(o.children)})};return n(this.treeData),l},timeRange(){const l=this.$t?this.$t("trace.to"):"-";return nf(this.traceStartTime,this.traceEndTime,l)}},watch:{spans:{immediate:!0,handler(){this.buildTree()}}},methods:{buildTree(){if(!this.spans||this.spans.length===0){this.treeData=[];return}const l=new Map,n=[];this.spans.forEach(r=>{l.set(r.span_id,{...r,children:[]})}),this.spans.forEach(r=>{const o=l.get(r.span_id);if(r.parent_span_id){const u=l.get(r.parent_span_id);u?u.children.push(o):n.push(o)}else n.push(o)}),n.forEach(r=>{this.sortChildren(r)}),this.treeData=n,this.expandAllNodes()},expandAllNodes(){const l=new Set,n=r=>{r.forEach(o=>{o.children&&o.children.length>0&&o.children.forEach(u=>{this.hasChildren(u)&&l.add(u.span_id),u.children&&u.children.length>0&&n([u])})})};n(this.treeData),this.expandedNodes=l,this.allExpanded=!0,this.$forceUpdate()},collapseAllNodes(){const l=new Set;this.expandedNodes=l,this.allExpanded=!1,this.$forceUpdate()},toggleAllExpand(){this.allExpanded?this.collapseAllNodes():this.expandAllNodes()},toggleViewMode(){this.viewMode=this.viewMode==="list"?"tree":"list"},sortChildren(l){l.children&&l.children.length>0&&(l.children.sort((n,r)=>n.start_time_unix_nano-r.start_time_unix_nano),l.children.forEach(n=>this.sortChildren(n)))},handleNodeClick(l){this.$emit("span-select",l)},hasChildren(l){return l.children&&l.children.length>0},toggleExpand(l){if(this.treeData.some(o=>o.span_id===l.span_id))return;const r=new Set(this.expandedNodes);r.has(l.span_id)?r.delete(l.span_id):r.add(l.span_id),this.expandedNodes=r,this.updateAllExpandedState(),this.$forceUpdate()},updateAllExpandedState(){const l=(r,o=!1)=>{for(const u of r)if(this.hasChildren(u)&&(!o&&!this.expandedNodes.has(u.span_id)||u.children&&u.children.length>0&&!l(u.children,!1)))return!1;return!0};if(!this.treeData.some(r=>r.children&&r.children.some(o=>this.hasChildren(o)))){this.allExpanded=!1;return}this.allExpanded=l(this.treeData,!0)}}};var id=function(){var n=this,r=n._self._c;return r("div",{staticClass:"span-tree-container"},[n.treeData.length===0?r("div",{staticClass:"empty-state"},[r("el-empty",{attrs:{description:"暂无 Span 数据"}})],1):r("div",{staticClass:"timeline-wrapper"},[r("TimelineHeader",{attrs:{"time-range":n.timeRange,"all-expanded":n.allExpanded,"view-mode":n.viewMode},on:{"toggle-expand":n.toggleAllExpand,"toggle-view":n.toggleViewMode}}),r("div",{ref:"timelineContent",staticClass:"timeline-content"},[n.viewMode==="tree"?n._l(n.treeData,function(o){return r("SpanTreeNode",{key:o.span_id,attrs:{node:o,selected:n.selectedSpanId===o.span_id,"selected-span-id":n.selectedSpanId,"expanded-nodes":n.expandedNodes,depth:0,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.spanTypeList},on:{"node-click":n.handleNodeClick,"toggle-expand":n.toggleExpand}})}):n._l(n.flatListData,function(o){return r("SpanListNode",{key:o.span_id,attrs:{node:o,selected:n.selectedSpanId===o.span_id,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.spanTypeList},on:{"node-click":n.handleNodeClick}})})],2)],1)])},ad=[],sd=vn(rd,id,ad,!1,null,"0cf980e1");const Va=sd.exports;function od(){return window.pdfjsLib}const ld={name:"FilePdfViewer",props:{element:{type:Object,required:!0}},data(){return{currentPage:1,totalPages:0,loading:!1,error:null,pdfDoc:null,renderTask:null,pdfScale:1.5,scaleMin:.5,scaleMax:3}},computed:{formatPageIndicator(){return this.$t("trace.pdfPageIndicator",{page:this.currentPage,total:this.totalPages||1})}},watch:{"element.downloadUrl":{handler(){this.currentPage=1,this.totalPages=0,this.error=null,this.pdfDoc=null,this.loadPdf()}},currentPage(){this.renderCurrentPage()},pdfScale(){this.renderCurrentPage()}},mounted(){this.loadPdf()},beforeDestroy(){this.cancelRender(),this.pdfDoc&&(this.pdfDoc.destroy(),this.pdfDoc=null)},methods:{async loadPdf(){var n,r;const l=(n=this.element)==null?void 0:n.downloadUrl;if(!l){this.error="No PDF URL";return}this.loading=!0,this.error=null,this.cancelRender(),this.pdfDoc&&(this.pdfDoc.destroy(),this.pdfDoc=null);try{const o=od();if(!o){this.error="PDF.js not loaded";return}!o.GlobalWorkerOptions.workerSrc&&((r=window.GF_LOCAL_CONFIG)!=null&&r.WORKER_SRC)&&(o.GlobalWorkerOptions.workerSrc=window.GF_LOCAL_CONFIG.WORKER_SRC);const u=o.getDocument({url:l});this.pdfDoc=await u.promise,this.totalPages=this.pdfDoc.numPages,this.loading=!1,await this.$nextTick(),await this.renderCurrentPage()}catch(o){this.error=(o==null?void 0:o.message)||"Failed to load PDF"}finally{this.loading=!1}},cancelRender(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null)},async renderCurrentPage(){if(!(!this.pdfDoc||!this.$refs.canvasRef)){this.cancelRender();try{const l=await this.pdfDoc.getPage(this.currentPage),n=this.$refs.canvasRef,r=n.getContext("2d"),o=window.devicePixelRatio||1,u=this.pdfScale*o,f=l.getViewport({scale:u});n.height=f.height,n.width=f.width,n.style.width=`${f.width/o}px`,n.style.height=`${f.height/o}px`,this.renderTask=l.render({canvasContext:r,viewport:f}),await this.renderTask.promise}catch(l){(l==null?void 0:l.name)!=="RenderingCancelledException"&&(this.error=(l==null?void 0:l.message)||"Failed to render page")}finally{this.renderTask=null}}},prevPage(){this.currentPage>1&&this.currentPage--},nextPage(){this.currentPage<this.totalPages&&this.currentPage++},zoomIn(){this.pdfScale<this.scaleMax&&(this.pdfScale=Math.min(this.scaleMax,Math.round((this.pdfScale+.25)*100)/100))},zoomOut(){this.pdfScale>this.scaleMin&&(this.pdfScale=Math.max(this.scaleMin,Math.round((this.pdfScale-.25)*100)/100))},downloadFile(){var o,u,f;const l=(o=this.element)==null?void 0:o.downloadUrl;if(!l)return;const n=((u=this.element)==null?void 0:u.name)||((f=this.element)==null?void 0:f.label)||"file.pdf",r=document.createElement("a");r.href=l,r.download=n,r.rel="noopener",r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r)}}};var ud=function(){var o;var n=this,r=n._self._c;return r("div",{staticClass:"file-pdf-content"},[n.element.label?r("div",{staticClass:"image-label"},[n._v(n._s(n.element.label))]):n._e(),r("div",{staticClass:"file-pdf-toolbar"},[r("el-button",{attrs:{size:"mini",disabled:n.currentPage<=1},on:{click:n.prevPage}},[n._v(n._s(n.$t("trace.pdfPrevPage")))]),r("span",{staticClass:"file-pdf-page-indicator"},[n._v(n._s(n.formatPageIndicator))]),r("el-button",{attrs:{size:"mini",disabled:n.totalPages>0&&n.currentPage>=n.totalPages},on:{click:n.nextPage}},[n._v(n._s(n.$t("trace.pdfNextPage")))]),r("div",{staticClass:"file-pdf-zoom"},[r("span",{staticClass:"file-pdf-zoom-btn",class:{disabled:n.pdfScale<=n.scaleMin},on:{click:n.zoomOut}},[r("i",{staticClass:"el-icon-minus"})]),r("span",{staticClass:"file-pdf-zoom-btn",class:{disabled:n.pdfScale>=n.scaleMax},on:{click:n.zoomIn}},[r("i",{staticClass:"el-icon-plus"})])]),r("el-button",{attrs:{size:"mini",type:"primary",disabled:!((o=n.element)!=null&&o.downloadUrl)},on:{click:n.downloadFile}},[n._v(n._s(n.$t("trace.pdfDownload")))])],1),r("div",{staticClass:"file-pdf-viewer"},[n.loading?r("div",{staticClass:"file-pdf-loading"},[n._v(n._s(n.$t("trace.pdfLoading")))]):n.error?r("div",{staticClass:"file-pdf-error"},[n._v(n._s(n.error))]):r("canvas",{ref:"canvasRef",staticClass:"file-pdf-canvas"})])])},cd=[],fd=vn(ld,ud,cd,!1,null,"fbe9d6b8");const Xa=fd.exports;/*!
|
|
70
70
|
* Viewer.js v1.11.7
|
|
71
71
|
* https://fengyuanchen.github.io/viewerjs
|
|
72
72
|
*
|
|
@@ -74,17 +74,17 @@ Please report this to https://github.com/markedjs/marked.`,n){const u="<p>An err
|
|
|
74
74
|
* Released under the MIT license
|
|
75
75
|
*
|
|
76
76
|
* Date: 2024-11-24T04:32:19.116Z
|
|
77
|
-
*/function dd(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function zo(l,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,Ho(o.key),o)}}function hd(l,n,r){return n&&zo(l.prototype,n),r&&zo(l,r),Object.defineProperty(l,"prototype",{writable:!1}),l}function pd(l,n,r){return(n=Ho(n))in l?Object.defineProperty(l,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):l[n]=r,l}function Bo(l,n){var r=Object.keys(l);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(l);n&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(l,u).enumerable})),r.push.apply(r,o)}return r}function Ya(l){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Bo(Object(r),!0).forEach(function(o){pd(l,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(r)):Bo(Object(r)).forEach(function(o){Object.defineProperty(l,o,Object.getOwnPropertyDescriptor(r,o))})}return l}function gd(l,n){if(typeof l!="object"||!l)return l;var r=l[Symbol.toPrimitive];if(r!==void 0){var o=r.call(l,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(l)}function Ho(l){var n=gd(l,"string");return typeof n=="symbol"?n:n+""}function Ja(l){"@babel/helpers - typeof";return Ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ja(l)}var Wo={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},md='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',Ki=typeof window<"u"&&typeof window.document<"u",Sn=Ki?window:{},dr=Ki&&Sn.document.documentElement?"ontouchstart"in Sn.document.documentElement:!1,Qa=Ki?"PointerEvent"in Sn:!1,Ne="viewer",Vi="move",jo="switch",ei="zoom",Xi="".concat(Ne,"-active"),vd="".concat(Ne,"-close"),Yi="".concat(Ne,"-fade"),Za="".concat(Ne,"-fixed"),yd="".concat(Ne,"-fullscreen"),Uo="".concat(Ne,"-fullscreen-exit"),Yn="".concat(Ne,"-hide"),bd="".concat(Ne,"-hide-md-down"),xd="".concat(Ne,"-hide-sm-down"),wd="".concat(Ne,"-hide-xs-down"),Qt="".concat(Ne,"-in"),ti="".concat(Ne,"-invisible"),hr="".concat(Ne,"-loading"),kd="".concat(Ne,"-move"),qo="".concat(Ne,"-open"),pr="".concat(Ne,"-show"),at="".concat(Ne,"-transition"),gr="click",es="dblclick",Go="dragstart",Ko="focusin",Vo="keydown",Zt="load",Jn="error",Sd=dr?"touchend touchcancel":"mouseup",Cd=dr?"touchmove":"mousemove",Td=dr?"touchstart":"mousedown",Xo=Qa?"pointerdown":Td,Yo=Qa?"pointermove":Cd,Jo=Qa?"pointerup pointercancel":Sd,Qo="resize",rn="transitionend",Zo="wheel",el="ready",tl="show",nl="shown",rl="hide",il="hidden",al="view",ni="viewed",sl="move",ol="moved",ll="rotate",ul="rotated",cl="scale",fl="scaled",dl="zoom",hl="zoomed",pl="play",gl="stop",Ji="".concat(Ne,"Action"),ts=/\s\s*/,Qi=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ri(l){return typeof l=="string"}var _d=Number.isNaN||Sn.isNaN;function Ze(l){return typeof l=="number"&&!_d(l)}function mr(l){return typeof l>"u"}function vr(l){return Ja(l)==="object"&&l!==null}var Ld=Object.prototype.hasOwnProperty;function yr(l){if(!vr(l))return!1;try{var n=l.constructor,r=n.prototype;return n&&r&&Ld.call(r,"isPrototypeOf")}catch{return!1}}function qe(l){return typeof l=="function"}function Ve(l,n){if(l&&qe(n))if(Array.isArray(l)||Ze(l.length)){var r=l.length,o;for(o=0;o<r&&n.call(l,l[o],o,l)!==!1;o+=1);}else vr(l)&&Object.keys(l).forEach(function(u){n.call(l,l[u],u,l)});return l}var Gt=Object.assign||function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),u=1;u<r;u++)o[u-1]=arguments[u];return vr(n)&&o.length>0&&o.forEach(function(f){vr(f)&&Object.keys(f).forEach(function(p){n[p]=f[p]})}),n},Ed=/^(?:width|height|left|top|marginLeft|marginTop)$/;function an(l,n){var r=l.style;Ve(n,function(o,u){Ed.test(u)&&Ze(o)&&(o+="px"),r[u]=o})}function Id(l){return ri(l)?l.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"):l}function br(l,n){return!l||!n?!1:l.classList?l.classList.contains(n):l.className.indexOf(n)>-1}function Te(l,n){if(!(!l||!n)){if(Ze(l.length)){Ve(l,function(o){Te(o,n)});return}if(l.classList){l.classList.add(n);return}var r=l.className.trim();r?r.indexOf(n)<0&&(l.className="".concat(r," ").concat(n)):l.className=n}}function He(l,n){if(!(!l||!n)){if(Ze(l.length)){Ve(l,function(r){He(r,n)});return}if(l.classList){l.classList.remove(n);return}l.className.indexOf(n)>=0&&(l.className=l.className.replace(n,""))}}function ii(l,n,r){if(n){if(Ze(l.length)){Ve(l,function(o){ii(o,n,r)});return}r?Te(l,n):He(l,n)}}var Ad=/([a-z\d])([A-Z])/g;function ns(l){return l.replace(Ad,"$1-$2").toLowerCase()}function xr(l,n){return vr(l[n])?l[n]:l.dataset?l.dataset[n]:l.getAttribute("data-".concat(ns(n)))}function rs(l,n,r){vr(r)?l[n]=r:l.dataset?l.dataset[n]=r:l.setAttribute("data-".concat(ns(n)),r)}var ml=function(){var l=!1;if(Ki){var n=!1,r=function(){},o=Object.defineProperty({},"once",{get:function(){return l=!0,n},set:function(f){n=f}});Sn.addEventListener("test",r,o),Sn.removeEventListener("test",r,o)}return l}();function Ge(l,n,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=r;n.trim().split(ts).forEach(function(f){if(!ml){var p=l.listeners;p&&p[f]&&p[f][r]&&(u=p[f][r],delete p[f][r],Object.keys(p[f]).length===0&&delete p[f],Object.keys(p).length===0&&delete l.listeners)}l.removeEventListener(f,u,o)})}function Ee(l,n,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=r;n.trim().split(ts).forEach(function(f){if(o.once&&!ml){var p=l.listeners,y=p===void 0?{}:p;u=function(){delete y[f][r],l.removeEventListener(f,u,o);for(var k=arguments.length,S=new Array(k),F=0;F<k;F++)S[F]=arguments[F];r.apply(l,S)},y[f]||(y[f]={}),y[f][r]&&l.removeEventListener(f,y[f][r],o),y[f][r]=u,l.listeners=y}l.addEventListener(f,u,o)})}function ot(l,n,r,o){var u;return qe(Event)&&qe(CustomEvent)?u=new CustomEvent(n,Ya({bubbles:!0,cancelable:!0,detail:r},o)):(u=document.createEvent("CustomEvent"),u.initCustomEvent(n,!0,!0,r)),l.dispatchEvent(u)}function Dd(l){var n=l.getBoundingClientRect();return{left:n.left+(window.pageXOffset-document.documentElement.clientLeft),top:n.top+(window.pageYOffset-document.documentElement.clientTop)}}function Zi(l){var n=l.rotate,r=l.scaleX,o=l.scaleY,u=l.translateX,f=l.translateY,p=[];Ze(u)&&u!==0&&p.push("translateX(".concat(u,"px)")),Ze(f)&&f!==0&&p.push("translateY(".concat(f,"px)")),Ze(n)&&n!==0&&p.push("rotate(".concat(n,"deg)")),Ze(r)&&r!==1&&p.push("scaleX(".concat(r,")")),Ze(o)&&o!==1&&p.push("scaleY(".concat(o,")"));var y=p.length?p.join(" "):"none";return{WebkitTransform:y,msTransform:y,transform:y}}function Od(l){return ri(l)?decodeURIComponent(l.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var is=Sn.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(Sn.navigator.userAgent);function vl(l,n,r){var o=document.createElement("img");if(l.naturalWidth&&!is)return r(l.naturalWidth,l.naturalHeight),o;var u=document.body||document.documentElement;return o.onload=function(){r(o.width,o.height),is||u.removeChild(o)},Ve(n.inheritedAttributes,function(f){var p=l.getAttribute(f);p!==null&&o.setAttribute(f,p)}),o.src=l.src,is||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",u.appendChild(o)),o}function ea(l){switch(l){case 2:return wd;case 3:return xd;case 4:return bd;default:return""}}function Nd(l){var n=Ya({},l),r=[];return Ve(l,function(o,u){delete n[u],Ve(n,function(f){var p=Math.abs(o.startX-f.startX),y=Math.abs(o.startY-f.startY),m=Math.abs(o.endX-f.endX),k=Math.abs(o.endY-f.endY),S=Math.sqrt(p*p+y*y),F=Math.sqrt(m*m+k*k),L=(F-S)/S;r.push(L)})}),r.sort(function(o,u){return Math.abs(o)<Math.abs(u)}),r[0]}function ta(l,n){var r=l.pageX,o=l.pageY,u={endX:r,endY:o};return n?u:Ya({timeStamp:Date.now(),startX:r,startY:o},u)}function Rd(l){var n=0,r=0,o=0;return Ve(l,function(u){var f=u.startX,p=u.startY;n+=f,r+=p,o+=1}),n/=o,r/=o,{pageX:n,pageY:r}}var Fd={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var n=this.element.ownerDocument,r=n.body||n.documentElement;this.body=r,this.scrollbarWidth=window.innerWidth-n.documentElement.clientWidth,this.initialBodyPaddingRight=r.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(r).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var n=this.options,r=this.parent,o;n.inline&&(o={width:Math.max(r.offsetWidth,n.minWidth),height:Math.max(r.offsetHeight,n.minHeight)},this.parentData=o),(this.fulled||!o)&&(o=this.containerData),this.viewerData=Gt({},o)},renderViewer:function(){this.options.inline&&!this.fulled&&an(this.viewer,this.viewerData)},initList:function(){var n=this,r=this.element,o=this.options,u=this.list,f=[];u.innerHTML="",Ve(this.images,function(p,y){var m=p.src,k=p.alt||Od(m),S=n.getImageURL(p);if(m||S){var F=document.createElement("li"),L=document.createElement("img");Ve(o.inheritedAttributes,function(W){var z=p.getAttribute(W);z!==null&&L.setAttribute(W,z)}),o.navbar&&(L.src=m||S),L.alt=k,L.setAttribute("data-original-url",S||m),F.setAttribute("data-index",y),F.setAttribute("data-viewer-action","view"),F.setAttribute("role","button"),o.keyboard&&F.setAttribute("tabindex",0),F.appendChild(L),u.appendChild(F),f.push(F)}}),this.items=f,Ve(f,function(p){var y=p.firstElementChild,m,k;rs(y,"filled",!0),o.loading&&Te(p,hr),Ee(y,Zt,m=function(F){Ge(y,Jn,k),o.loading&&He(p,hr),n.loadImage(F)},{once:!0}),Ee(y,Jn,k=function(){Ge(y,Zt,m),o.loading&&He(p,hr)},{once:!0})}),o.transition&&Ee(r,ni,function(){Te(u,at)},{once:!0})},renderList:function(){var n=this.index,r=this.items[n];if(r){var o=r.nextElementSibling,u=parseInt(window.getComputedStyle(o||r).marginLeft,10),f=r.offsetWidth,p=f+u;an(this.list,Gt({width:p*this.length-u},Zi({translateX:(this.viewerData.width-f)/2-p*n})))}},resetList:function(){var n=this.list;n.innerHTML="",He(n,at),an(n,Zi({translateX:0}))},initImage:function(n){var r=this,o=this.options,u=this.image,f=this.viewerData,p=this.footer.offsetHeight,y=f.width,m=Math.max(f.height-p,p),k=this.imageData||{},S;this.imageInitializing={abort:function(){S.onload=null}},S=vl(u,o,function(F,L){var W=F/L,z=Math.max(0,Math.min(1,o.initialCoverage)),D=y,$=m;r.imageInitializing=!1,m*W>y?$=y/W:D=m*W,z=Ze(z)?z:.9,D=Math.min(D*z,F),$=Math.min($*z,L);var I=(y-D)/2,N=(m-$)/2,H={left:I,top:N,x:I,y:N,width:D,height:$,oldRatio:1,ratio:D/F,aspectRatio:W,naturalWidth:F,naturalHeight:L},V=Gt({},H);o.rotatable&&(H.rotate=k.rotate||0,V.rotate=0),o.scalable&&(H.scaleX=k.scaleX||1,H.scaleY=k.scaleY||1,V.scaleX=1,V.scaleY=1),r.imageData=H,r.initialImageData=V,n&&n()})},renderImage:function(n){var r=this,o=this.image,u=this.imageData;if(an(o,Gt({width:u.width,height:u.height,marginLeft:u.x,marginTop:u.y},Zi(u))),n)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&br(o,at)){var f=function(){r.imageRendering=!1,n()};this.imageRendering={abort:function(){Ge(o,rn,f)}},Ee(o,rn,f,{once:!0})}else n()},resetImage:function(){var n=this.image;n&&(this.viewing&&this.viewing.abort(),n.parentNode.removeChild(n),this.image=null,this.title.innerHTML="")}},Md={bind:function(){var n=this.options,r=this.viewer,o=this.canvas,u=this.element.ownerDocument;Ee(r,gr,this.onClick=this.click.bind(this)),Ee(r,Go,this.onDragStart=this.dragstart.bind(this)),Ee(o,Xo,this.onPointerDown=this.pointerdown.bind(this)),Ee(u,Yo,this.onPointerMove=this.pointermove.bind(this)),Ee(u,Jo,this.onPointerUp=this.pointerup.bind(this)),Ee(u,Vo,this.onKeyDown=this.keydown.bind(this)),Ee(window,Qo,this.onResize=this.resize.bind(this)),n.zoomable&&n.zoomOnWheel&&Ee(r,Zo,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),n.toggleOnDblclick&&Ee(o,es,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var n=this.options,r=this.viewer,o=this.canvas,u=this.element.ownerDocument;Ge(r,gr,this.onClick),Ge(r,Go,this.onDragStart),Ge(o,Xo,this.onPointerDown),Ge(u,Yo,this.onPointerMove),Ge(u,Jo,this.onPointerUp),Ge(u,Vo,this.onKeyDown),Ge(window,Qo,this.onResize),n.zoomable&&n.zoomOnWheel&&Ge(r,Zo,this.onWheel,{passive:!1,capture:!0}),n.toggleOnDblclick&&Ge(o,es,this.onDblclick)}},$d={click:function(n){var r=this.options,o=this.imageData,u=n.target,f=xr(u,Ji);switch(!f&&u.localName==="img"&&u.parentElement.localName==="li"&&(u=u.parentElement,f=xr(u,Ji)),dr&&n.isTrusted&&u===this.canvas&&clearTimeout(this.clickCanvasTimeout),f){case"mix":this.played?this.stop():r.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(xr(u,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(r.loop);break;case"play":this.play(r.fullscreen);break;case"next":this.next(r.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-o.scaleX||-1);break;case"flip-vertical":this.scaleY(-o.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(n){n.preventDefault(),this.viewed&&n.target===this.image&&(dr&&n.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(n.isTrusted?n:n.detail&&n.detail.originalEvent))},load:function(){var n=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var r=this.element,o=this.options,u=this.image,f=this.index,p=this.viewerData;He(u,ti),o.loading&&He(this.canvas,hr),u.style.cssText="height:0;"+"margin-left:".concat(p.width/2,"px;")+"margin-top:".concat(p.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){ii(u,kd,o.movable),ii(u,at,o.transition),n.renderImage(function(){n.viewed=!0,n.viewing=!1,qe(o.viewed)&&Ee(r,ni,o.viewed,{once:!0}),ot(r,ni,{originalImage:n.images[f],index:f,image:u},{cancelable:!1})})})},loadImage:function(n){var r=n.target,o=r.parentNode,u=o.offsetWidth||30,f=o.offsetHeight||50,p=!!xr(r,"filled");vl(r,this.options,function(y,m){var k=y/m,S=u,F=f;f*k>u?p?S=f*k:F=u/k:p?F=u/k:S=f*k,an(r,Gt({width:S,height:F},Zi({translateX:(u-S)/2,translateY:(f-F)/2})))})},keydown:function(n){var r=this.options;if(r.keyboard){var o=n.keyCode||n.which||n.charCode;switch(o){case 13:this.viewer.contains(n.target)&&this.click(n);break}if(this.fulled)switch(o){case 27:this.played?this.stop():r.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(r.loop);break;case 38:n.preventDefault(),this.zoom(r.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(r.loop);break;case 40:n.preventDefault(),this.zoom(-r.zoomRatio,!0);break;case 48:case 49:n.ctrlKey&&(n.preventDefault(),this.toggle());break}}},dragstart:function(n){n.target.localName==="img"&&n.preventDefault()},pointerdown:function(n){var r=this.options,o=this.pointers,u=n.buttons,f=n.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||(n.type==="mousedown"||n.type==="pointerdown"&&n.pointerType==="mouse")&&(Ze(u)&&u!==1||Ze(f)&&f!==0||n.ctrlKey))){n.preventDefault(),n.changedTouches?Ve(n.changedTouches,function(y){o[y.identifier]=ta(y)}):o[n.pointerId||0]=ta(n);var p=r.movable?Vi:!1;r.zoomOnTouch&&r.zoomable&&Object.keys(o).length>1?p=ei:r.slideOnTouch&&(n.pointerType==="touch"||n.type==="touchstart")&&this.isSwitchable()&&(p=jo),r.transition&&(p===Vi||p===ei)&&He(this.image,at),this.action=p}},pointermove:function(n){var r=this.pointers,o=this.action;!this.viewed||!o||(n.preventDefault(),n.changedTouches?Ve(n.changedTouches,function(u){Gt(r[u.identifier]||{},ta(u,!0))}):Gt(r[n.pointerId||0]||{},ta(n,!0)),this.change(n))},pointerup:function(n){var r=this,o=this.options,u=this.action,f=this.pointers,p;n.changedTouches?Ve(n.changedTouches,function(y){p=f[y.identifier],delete f[y.identifier]}):(p=f[n.pointerId||0],delete f[n.pointerId||0]),u&&(n.preventDefault(),o.transition&&(u===Vi||u===ei)&&Te(this.image,at),this.action=!1,dr&&u!==ei&&p&&Date.now()-p.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),o.toggleOnDblclick&&this.viewed&&n.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){ot(r.image,es,{originalEvent:n})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){r.imageClicked=!1},500)):(this.imageClicked=!1,o.backdrop&&o.backdrop!=="static"&&n.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){ot(r.canvas,gr,{originalEvent:n})},50)))))},resize:function(){var n=this;if(!(!this.isShown||this.hiding)&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)){this.stop();return}Ve(this.player.getElementsByTagName("img"),function(r){Ee(r,Zt,n.loadImage.bind(n),{once:!0}),ot(r,Zt)})}},wheel:function(n){var r=this;if(this.viewed&&(n.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50);var o=Number(this.options.zoomRatio)||.1,u=1;n.deltaY?u=n.deltaY>0?1:-1:n.wheelDelta?u=-n.wheelDelta/120:n.detail&&(u=n.detail>0?1:-1),this.zoom(-u*o,!0,null,n)}}},Pd={show:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.element,o=this.options;if(o.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(n),this;if(qe(o.show)&&Ee(r,tl,o.show,{once:!0}),ot(r,tl)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var u=this.viewer;if(He(u,Yn),u.setAttribute("role","dialog"),u.setAttribute("aria-labelledby",this.title.id),u.setAttribute("aria-modal",!0),u.removeAttribute("aria-hidden"),o.transition&&!n){var f=this.shown.bind(this);this.transitioning={abort:function(){Ge(u,rn,f),He(u,Qt)}},Te(u,at),u.initialOffsetWidth=u.offsetWidth,Ee(u,rn,f,{once:!0}),Te(u,Qt)}else Te(u,Qt),this.shown();return this},hide:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.element,u=this.options;if(u.inline||this.hiding||!(this.isShown||this.showing))return this;if(qe(u.hide)&&Ee(o,rl,u.hide,{once:!0}),ot(o,rl)===!1)return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var f=this.viewer,p=this.image,y=function(){He(f,Qt),n.hidden()};if(u.transition&&!r){var m=function(F){F&&F.target===f&&(Ge(f,rn,m),n.hidden())},k=function(){br(f,at)?(Ee(f,rn,m),He(f,Qt)):y()};this.transitioning={abort:function(){n.viewed&&br(p,at)?Ge(p,rn,k):br(f,at)&&Ge(f,rn,m)}},this.viewed&&br(p,at)?(Ee(p,rn,k,{once:!0}),this.zoomTo(0,!1,null,null,!0)):k()}else y();return this},view:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(r=Number(r)||0,this.hiding||this.played||r<0||r>=this.length||this.viewed&&r===this.index)return this;if(!this.isShown)return this.index=r,this.show();this.viewing&&this.viewing.abort();var o=this.element,u=this.options,f=this.title,p=this.canvas,y=this.items[r],m=y.querySelector("img"),k=xr(m,"originalUrl"),S=m.getAttribute("alt"),F=document.createElement("img");if(Ve(u.inheritedAttributes,function($){var I=m.getAttribute($);I!==null&&F.setAttribute($,I)}),F.src=k,F.alt=S,qe(u.view)&&Ee(o,al,u.view,{once:!0}),ot(o,al,{originalImage:this.images[r],index:r,image:F})===!1||!this.isShown||this.hiding||this.played)return this;var L=this.items[this.index];L&&(He(L,Xi),L.removeAttribute("aria-selected")),Te(y,Xi),y.setAttribute("aria-selected",!0),u.focus&&y.focus(),this.image=F,this.viewed=!1,this.index=r,this.imageData={},Te(F,ti),u.loading&&Te(p,hr),p.innerHTML="",p.appendChild(F),this.renderList(),f.innerHTML="";var W=function(){var I=n.imageData,N=Array.isArray(u.title)?u.title[1]:u.title;f.innerHTML=Id(qe(N)?N.call(n,F,I):"".concat(S," (").concat(I.naturalWidth," × ").concat(I.naturalHeight,")"))},z,D;return Ee(o,ni,W,{once:!0}),this.viewing={abort:function(){Ge(o,ni,W),F.complete?n.imageRendering?n.imageRendering.abort():n.imageInitializing&&n.imageInitializing.abort():(F.src="",Ge(F,Zt,z),n.timeout&&clearTimeout(n.timeout))}},F.complete?this.load():(Ee(F,Zt,z=function(){Ge(F,Jn,D),n.load()},{once:!0}),Ee(F,Jn,D=function(){Ge(F,Zt,z),n.timeout&&(clearTimeout(n.timeout),n.timeout=!1),He(F,ti),u.loading&&He(n.canvas,hr)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){He(F,ti),n.timeout=!1},1e3)),this},prev:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.index-1;return r<0&&(r=n?this.length-1:0),this.view(r),this},next:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.length-1,o=this.index+1;return o>r&&(o=n?0:r),this.view(o),this},move:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,o=this.imageData;return this.moveTo(mr(n)?n:o.x+Number(n),mr(r)?r:o.y+Number(r)),this},moveTo:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,f=this.element,p=this.options,y=this.imageData;if(n=Number(n),o=Number(o),this.viewed&&!this.played&&p.movable){var m=y.x,k=y.y,S=!1;if(Ze(n)?S=!0:n=m,Ze(o)?S=!0:o=k,S){if(qe(p.move)&&Ee(f,sl,p.move,{once:!0}),ot(f,sl,{x:n,y:o,oldX:m,oldY:k,originalEvent:u})===!1)return this;y.x=n,y.y=o,y.left=n,y.top=o,this.moving=!0,this.renderImage(function(){r.moving=!1,qe(p.moved)&&Ee(f,ol,p.moved,{once:!0}),ot(f,ol,{x:n,y:o,oldX:m,oldY:k,originalEvent:u},{cancelable:!1})})}}return this},rotate:function(n){return this.rotateTo((this.imageData.rotate||0)+Number(n)),this},rotateTo:function(n){var r=this,o=this.element,u=this.options,f=this.imageData;if(n=Number(n),Ze(n)&&this.viewed&&!this.played&&u.rotatable){var p=f.rotate;if(qe(u.rotate)&&Ee(o,ll,u.rotate,{once:!0}),ot(o,ll,{degree:n,oldDegree:p})===!1)return this;f.rotate=n,this.rotating=!0,this.renderImage(function(){r.rotating=!1,qe(u.rotated)&&Ee(o,ul,u.rotated,{once:!0}),ot(o,ul,{degree:n,oldDegree:p},{cancelable:!1})})}return this},scaleX:function(n){return this.scale(n,this.imageData.scaleY),this},scaleY:function(n){return this.scale(this.imageData.scaleX,n),this},scale:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,u=this.element,f=this.options,p=this.imageData;if(n=Number(n),o=Number(o),this.viewed&&!this.played&&f.scalable){var y=p.scaleX,m=p.scaleY,k=!1;if(Ze(n)?k=!0:n=y,Ze(o)?k=!0:o=m,k){if(qe(f.scale)&&Ee(u,cl,f.scale,{once:!0}),ot(u,cl,{scaleX:n,scaleY:o,oldScaleX:y,oldScaleY:m})===!1)return this;p.scaleX=n,p.scaleY=o,this.scaling=!0,this.renderImage(function(){r.scaling=!1,qe(f.scaled)&&Ee(u,fl,f.scaled,{once:!0}),ot(u,fl,{scaleX:n,scaleY:o,oldScaleX:y,oldScaleY:m},{cancelable:!1})})}}return this},zoom:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,f=this.imageData;return n=Number(n),n<0?n=1/(1-n):n=1+n,this.zoomTo(f.width*n/f.naturalWidth,r,o,u),this},zoomTo:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,y=this.element,m=this.options,k=this.pointers,S=this.imageData,F=S.x,L=S.y,W=S.width,z=S.height,D=S.naturalWidth,$=S.naturalHeight;if(n=Math.max(0,n),Ze(n)&&this.viewed&&!this.played&&(p||m.zoomable)){if(!p){var I=Math.max(.01,m.minZoomRatio),N=Math.min(100,m.maxZoomRatio);n=Math.min(Math.max(n,I),N)}if(f)switch(f.type){case"wheel":m.zoomRatio>=.055&&n>.95&&n<1.05&&(n=1);break;case"pointermove":case"touchmove":case"mousemove":n>.99&&n<1.01&&(n=1);break}var H=D*n,V=$*n,ne=H-W,ue=V-z,se=S.ratio;if(qe(m.zoom)&&Ee(y,dl,m.zoom,{once:!0}),ot(y,dl,{ratio:n,oldRatio:se,originalEvent:f})===!1)return this;if(this.zooming=!0,f){var de=Dd(this.viewer),Oe=k&&Object.keys(k).length>0?Rd(k):{pageX:f.pageX,pageY:f.pageY};S.x-=ne*((Oe.pageX-de.left-F)/W),S.y-=ue*((Oe.pageY-de.top-L)/z)}else yr(u)&&Ze(u.x)&&Ze(u.y)?(S.x-=ne*((u.x-F)/W),S.y-=ue*((u.y-L)/z)):(S.x-=ne/2,S.y-=ue/2);S.left=S.x,S.top=S.y,S.width=H,S.height=V,S.oldRatio=se,S.ratio=n,this.renderImage(function(){r.zooming=!1,qe(m.zoomed)&&Ee(y,hl,m.zoomed,{once:!0}),ot(y,hl,{ratio:n,oldRatio:se,originalEvent:f},{cancelable:!1})}),o&&this.tooltip()}return this},play:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var o=this.element,u=this.options;if(qe(u.play)&&Ee(o,pl,u.play,{once:!0}),ot(o,pl)===!1)return this;var f=this.player,p=this.loadImage.bind(this),y=[],m=0,k=0;if(this.played=!0,this.onLoadWhenPlay=p,r&&this.requestFullscreen(r),Te(f,pr),Ve(this.items,function(L,W){var z=L.querySelector("img"),D=document.createElement("img");D.src=xr(z,"originalUrl"),D.alt=z.getAttribute("alt"),D.referrerPolicy=z.referrerPolicy,m+=1,Te(D,Yi),ii(D,at,u.transition),br(L,Xi)&&(Te(D,Qt),k=W),y.push(D),Ee(D,Zt,p,{once:!0}),f.appendChild(D)}),Ze(u.interval)&&u.interval>0){var S=function(){clearTimeout(n.playing.timeout),He(y[k],Qt),k-=1,k=k>=0?k:m-1,Te(y[k],Qt),n.playing.timeout=setTimeout(S,u.interval)},F=function(){clearTimeout(n.playing.timeout),He(y[k],Qt),k+=1,k=k<m?k:0,Te(y[k],Qt),n.playing.timeout=setTimeout(F,u.interval)};m>1&&(this.playing={prev:S,next:F,timeout:setTimeout(F,u.interval)})}return this},stop:function(){var n=this;if(!this.played)return this;var r=this.element,o=this.options;if(qe(o.stop)&&Ee(r,gl,o.stop,{once:!0}),ot(r,gl)===!1)return this;var u=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Ve(u.getElementsByTagName("img"),function(f){Ge(f,Zt,n.onLoadWhenPlay)}),He(u,pr),u.innerHTML="",this.exitFullscreen(),this},full:function(){var n=this,r=this.options,o=this.viewer,u=this.image,f=this.list;return!this.isShown||this.played||this.fulled||!r.inline?this:(this.fulled=!0,this.open(),Te(this.button,Uo),r.transition&&(He(f,at),this.viewed&&He(u,at)),Te(o,Za),o.setAttribute("role","dialog"),o.setAttribute("aria-labelledby",this.title.id),o.setAttribute("aria-modal",!0),o.removeAttribute("style"),an(o,{zIndex:r.zIndex}),r.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=Gt({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage(function(){r.transition&&setTimeout(function(){Te(u,at),Te(f,at)},0)})}),this)},exit:function(){var n=this,r=this.options,o=this.viewer,u=this.image,f=this.list;return!this.isShown||this.played||!this.fulled||!r.inline?this:(this.fulled=!1,this.close(),He(this.button,Uo),r.transition&&(He(f,at),this.viewed&&He(u,at)),r.focus&&this.clearEnforceFocus(),o.removeAttribute("role"),o.removeAttribute("aria-labelledby"),o.removeAttribute("aria-modal"),He(o,Za),an(o,{zIndex:r.zIndexInline}),this.viewerData=Gt({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage(function(){r.transition&&setTimeout(function(){Te(u,at),Te(f,at)},0)})}),this)},tooltip:function(){var n=this,r=this.options,o=this.tooltipBox,u=this.imageData;return!this.viewed||this.played||!r.tooltip?this:(o.textContent="".concat(Math.round(u.ratio*100),"%"),this.tooltipping?clearTimeout(this.tooltipping):r.transition?(this.fading&&ot(o,rn),Te(o,pr),Te(o,Yi),Te(o,at),o.removeAttribute("aria-hidden"),o.initialOffsetWidth=o.offsetWidth,Te(o,Qt)):(Te(o,pr),o.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){r.transition?(Ee(o,rn,function(){He(o,pr),He(o,Yi),He(o,at),o.setAttribute("aria-hidden",!0),n.fading=!1},{once:!0}),He(o,Qt),n.fading=!0):(He(o,pr),o.setAttribute("aria-hidden",!0)),n.tooltipping=!1},1e3),this)},toggle:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,null,n):this.zoomTo(1,!0,null,n),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=Gt({},this.initialImageData),this.renderImage()),this},update:function(){var n=this,r=this.element,o=this.options,u=this.isImg;if(u&&!r.parentNode)return this.destroy();var f=[];if(Ve(u?[r]:r.querySelectorAll("img"),function(k){qe(o.filter)?o.filter.call(n,k)&&f.push(k):n.getImageURL(k)&&f.push(k)}),!f.length)return this;if(this.images=f,this.length=f.length,this.ready){var p=[];if(Ve(this.items,function(k,S){var F=k.querySelector("img"),L=f[S];L&&F?(L.src!==F.src||L.alt!==F.alt)&&p.push(S):p.push(S)}),an(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var y=p.indexOf(this.index);if(y>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-y,this.length-1),0));else{var m=this.items[this.index];Te(m,Xi),m.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var n=this.element,r=this.options;return n[Ne]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),r.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):r.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),r.inline||Ge(n,gr,this.onStart),n[Ne]=void 0,this):this}},zd={getImageURL:function(n){var r=this.options.url;return ri(r)?r=n.getAttribute(r):qe(r)?r=r.call(this,n):r="",r},enforceFocus:function(){var n=this;this.clearEnforceFocus(),Ee(document,Ko,this.onFocusin=function(r){var o=n.viewer,u=r.target;if(!(u===document||u===o||o.contains(u))){for(;u;){if(u.getAttribute("tabindex")!==null||u.getAttribute("aria-modal")==="true")return;u=u.parentElement}o.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Ge(document,Ko,this.onFocusin),this.onFocusin=null)},open:function(){var n=this.body;Te(n,qo),this.scrollbarWidth>0&&(n.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var n=this.body;He(n,qo),this.scrollbarWidth>0&&(n.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var n=this.element,r=this.options,o=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,r.focus&&(o.focus(),this.enforceFocus()),qe(r.shown)&&Ee(n,nl,r.shown,{once:!0}),ot(n,nl)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var n=this.element,r=this.options,o=this.viewer;r.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),Te(o,Yn),o.removeAttribute("role"),o.removeAttribute("aria-labelledby"),o.removeAttribute("aria-modal"),o.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(qe(r.hidden)&&Ee(n,il,r.hidden,{once:!0}),ot(n,il,null,{cancelable:!1}))},requestFullscreen:function(n){var r=this.element.ownerDocument;if(this.fulled&&!(r.fullscreenElement||r.webkitFullscreenElement||r.mozFullScreenElement||r.msFullscreenElement)){var o=r.documentElement;o.requestFullscreen?yr(n)?o.requestFullscreen(n):o.requestFullscreen():o.webkitRequestFullscreen?o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):o.mozRequestFullScreen?o.mozRequestFullScreen():o.msRequestFullscreen&&o.msRequestFullscreen()}},exitFullscreen:function(){var n=this.element.ownerDocument;this.fulled&&(n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement)&&(n.exitFullscreen?n.exitFullscreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.msExitFullscreen&&n.msExitFullscreen())},change:function(n){var r=this.options,o=this.pointers,u=o[Object.keys(o)[0]];if(u){var f=u.endX-u.startX,p=u.endY-u.startY;switch(this.action){case Vi:(f!==0||p!==0)&&(this.pointerMoved=!0,this.move(f,p,n));break;case ei:this.zoom(Nd(o),!1,null,n);break;case jo:{this.action="switched";var y=Math.abs(f);y>1&&y>Math.abs(p)&&(this.pointers={},f>1?this.prev(r.loop):f<-1&&this.next(r.loop));break}}Ve(o,function(m){m.startX=m.endX,m.startY=m.endY})}},isSwitchable:function(){var n=this.imageData,r=this.viewerData;return this.length>1&&n.x>=0&&n.y>=0&&n.width<=r.width&&n.height<=r.height}},Bd=Sn.Viewer,Hd=function(l){return function(){return l+=1,l}}(-1),yl=function(){function l(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(dd(this,l),!n||n.nodeType!==1)throw new Error("The first argument is required and must be an element.");this.element=n,this.options=Gt({},Wo,yr(r)&&r),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Hd(),this.init()}return hd(l,[{key:"init",value:function(){var r=this,o=this.element,u=this.options;if(!o[Ne]){o[Ne]=this,u.focus&&!u.keyboard&&(u.focus=!1);var f=o.localName==="img",p=[];if(Ve(f?[o]:o.querySelectorAll("img"),function(k){qe(u.filter)?u.filter.call(r,k)&&p.push(k):r.getImageURL(k)&&p.push(k)}),this.isImg=f,this.length=p.length,this.images=p,this.initBody(),mr(document.createElement(Ne).style.transition)&&(u.transition=!1),u.inline){var y=0,m=function(){if(y+=1,y===r.length){var S;r.initializing=!1,r.delaying={abort:function(){clearTimeout(S)}},S=setTimeout(function(){r.delaying=!1,r.build()},0)}};this.initializing={abort:function(){Ve(p,function(S){S.complete||(Ge(S,Zt,m),Ge(S,Jn,m))})}},Ve(p,function(k){if(k.complete)m();else{var S,F;Ee(k,Zt,S=function(){Ge(k,Jn,F),m()},{once:!0}),Ee(k,Jn,F=function(){Ge(k,Zt,S),m()},{once:!0})}})}else Ee(o,gr,this.onStart=function(k){var S=k.target;S.localName==="img"&&(!qe(u.filter)||u.filter.call(r,S))&&r.view(r.images.indexOf(S))})}}},{key:"build",value:function(){if(!this.ready){var r=this.element,o=this.options,u=r.parentNode,f=document.createElement("div");f.innerHTML=md;var p=f.querySelector(".".concat(Ne,"-container")),y=p.querySelector(".".concat(Ne,"-title")),m=p.querySelector(".".concat(Ne,"-toolbar")),k=p.querySelector(".".concat(Ne,"-navbar")),S=p.querySelector(".".concat(Ne,"-button")),F=p.querySelector(".".concat(Ne,"-canvas"));if(this.parent=u,this.viewer=p,this.title=y,this.toolbar=m,this.navbar=k,this.button=S,this.canvas=F,this.footer=p.querySelector(".".concat(Ne,"-footer")),this.tooltipBox=p.querySelector(".".concat(Ne,"-tooltip")),this.player=p.querySelector(".".concat(Ne,"-player")),this.list=p.querySelector(".".concat(Ne,"-list")),p.id="".concat(Ne).concat(this.id),y.id="".concat(Ne,"Title").concat(this.id),Te(y,o.title?ea(Array.isArray(o.title)?o.title[0]:o.title):Yn),Te(k,o.navbar?ea(o.navbar):Yn),ii(S,Yn,!o.button),o.keyboard&&S.setAttribute("tabindex",0),o.backdrop&&(Te(p,"".concat(Ne,"-backdrop")),!o.inline&&o.backdrop!=="static"&&rs(F,Ji,"hide")),ri(o.className)&&o.className&&o.className.split(ts).forEach(function(H){Te(p,H)}),o.toolbar){var L=document.createElement("ul"),W=yr(o.toolbar),z=Qi.slice(0,3),D=Qi.slice(7,9),$=Qi.slice(9);W||Te(m,ea(o.toolbar)),Ve(W?o.toolbar:Qi,function(H,V){var ne=W&&yr(H),ue=W?ns(V):H,se=ne&&!mr(H.show)?H.show:H;if(!(!se||!o.zoomable&&z.indexOf(ue)!==-1||!o.rotatable&&D.indexOf(ue)!==-1||!o.scalable&&$.indexOf(ue)!==-1)){var de=ne&&!mr(H.size)?H.size:H,Oe=ne&&!mr(H.click)?H.click:H,Fe=document.createElement("li");o.keyboard&&Fe.setAttribute("tabindex",0),Fe.setAttribute("role","button"),Te(Fe,"".concat(Ne,"-").concat(ue)),qe(Oe)||rs(Fe,Ji,ue),Ze(se)&&Te(Fe,ea(se)),["small","large"].indexOf(de)!==-1?Te(Fe,"".concat(Ne,"-").concat(de)):ue==="play"&&Te(Fe,"".concat(Ne,"-large")),qe(Oe)&&Ee(Fe,gr,Oe),L.appendChild(Fe)}}),m.appendChild(L)}else Te(m,Yn);if(!o.rotatable){var I=m.querySelectorAll('li[class*="rotate"]');Te(I,ti),Ve(I,function(H){m.appendChild(H)})}if(o.inline)Te(S,yd),an(p,{zIndex:o.zIndexInline}),window.getComputedStyle(u).position==="static"&&an(u,{position:"relative"}),u.insertBefore(p,r.nextSibling);else{Te(S,vd),Te(p,Za),Te(p,Yi),Te(p,Yn),an(p,{zIndex:o.zIndex});var N=o.container;ri(N)&&(N=r.ownerDocument.querySelector(N)),N||(N=this.body),N.appendChild(p)}if(o.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,qe(o.ready)&&Ee(r,el,o.ready,{once:!0}),ot(r,el)===!1){this.ready=!1;return}this.ready&&o.inline&&this.view(this.index)}}}],[{key:"noConflict",value:function(){return window.Viewer=Bd,l}},{key:"setDefaults",value:function(r){Gt(Wo,yr(r)&&r)}}])}();Gt(yl.prototype,Fd,Md,$d,Pd,zd);var Wd=typeof global=="object"&&global&&global.Object===Object&&global,bl=Wd,jd=typeof self=="object"&&self&&self.Object===Object&&self,Ud=bl||jd||Function("return this")(),as=Ud,qd=as.Symbol,na=qd,xl=Object.prototype,Gd=xl.hasOwnProperty,Kd=xl.toString,ai=na?na.toStringTag:void 0;function Vd(l){var n=Gd.call(l,ai),r=l[ai];try{l[ai]=void 0;var o=!0}catch{}var u=Kd.call(l);return o&&(n?l[ai]=r:delete l[ai]),u}var Xd=Object.prototype,Yd=Xd.toString;function Jd(l){return Yd.call(l)}var Qd="[object Null]",Zd="[object Undefined]",wl=na?na.toStringTag:void 0;function ss(l){return l==null?l===void 0?Zd:Qd:wl&&wl in Object(l)?Vd(l):Jd(l)}function os(l){return l!=null&&typeof l=="object"}var eh=Array.isArray,th=eh;function ls(l){var n=typeof l;return l!=null&&(n=="object"||n=="function")}function kl(l){return l}var nh="[object AsyncFunction]",rh="[object Function]",ih="[object GeneratorFunction]",ah="[object Proxy]";function Sl(l){if(!ls(l))return!1;var n=ss(l);return n==rh||n==ih||n==nh||n==ah}var sh=as["__core-js_shared__"],us=sh,Cl=function(){var l=/[^.]+$/.exec(us&&us.keys&&us.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}();function oh(l){return!!Cl&&Cl in l}var lh=Function.prototype,uh=lh.toString;function ch(l){if(l!=null){try{return uh.call(l)}catch{}try{return l+""}catch{}}return""}var fh=/[\\^$.*+?()[\]{}|]/g,dh=/^\[object .+?Constructor\]$/,hh=Function.prototype,ph=Object.prototype,gh=hh.toString,mh=ph.hasOwnProperty,vh=RegExp("^"+gh.call(mh).replace(fh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yh(l){if(!ls(l)||oh(l))return!1;var n=Sl(l)?vh:dh;return n.test(ch(l))}function bh(l,n){return l==null?void 0:l[n]}function xh(l,n){var r=bh(l,n);return yh(r)?r:void 0}function wh(l,n,r){switch(r.length){case 0:return l.call(n);case 1:return l.call(n,r[0]);case 2:return l.call(n,r[0],r[1]);case 3:return l.call(n,r[0],r[1],r[2])}return l.apply(n,r)}var kh=800,Sh=16,Ch=Date.now;function Th(l){var n=0,r=0;return function(){var o=Ch(),u=Sh-(o-r);if(r=o,u>0){if(++n>=kh)return arguments[0]}else n=0;return l.apply(void 0,arguments)}}function _h(l){return function(){return l}}var Lh=function(){try{var l=xh(Object,"defineProperty");return l({},"",{}),l}catch{}}(),ra=Lh,Eh=ra?function(l,n){return ra(l,"toString",{configurable:!0,enumerable:!1,value:_h(n),writable:!0})}:kl,Ih=Eh,Ah=Th(Ih),Dh=Ah,Oh=9007199254740991,Nh=/^(?:0|[1-9]\d*)$/;function Tl(l,n){var r=typeof l;return n=n??Oh,!!n&&(r=="number"||r!="symbol"&&Nh.test(l))&&l>-1&&l%1==0&&l<n}function _l(l,n,r){n=="__proto__"&&ra?ra(l,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):l[n]=r}function Ll(l,n){return l===n||l!==l&&n!==n}var Rh=Object.prototype,Fh=Rh.hasOwnProperty;function El(l,n,r){var o=l[n];(!(Fh.call(l,n)&&Ll(o,r))||r===void 0&&!(n in l))&&_l(l,n,r)}function Mh(l,n,r,o){var u=!r;r||(r={});for(var f=-1,p=n.length;++f<p;){var y=n[f],m=void 0;m===void 0&&(m=l[y]),u?_l(r,y,m):El(r,y,m)}return r}var Il=Math.max;function $h(l,n,r){return n=Il(n===void 0?l.length-1:n,0),function(){for(var o=arguments,u=-1,f=Il(o.length-n,0),p=Array(f);++u<f;)p[u]=o[n+u];u=-1;for(var y=Array(n+1);++u<n;)y[u]=o[u];return y[n]=r(p),wh(l,this,y)}}function Ph(l,n){return Dh($h(l,n,kl),l+"")}var zh=9007199254740991;function Al(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=zh}function cs(l){return l!=null&&Al(l.length)&&!Sl(l)}function Bh(l,n,r){if(!ls(r))return!1;var o=typeof n;return(o=="number"?cs(r)&&Tl(n,r.length):o=="string"&&n in r)?Ll(r[n],l):!1}function Hh(l){return Ph(function(n,r){var o=-1,u=r.length,f=u>1?r[u-1]:void 0,p=u>2?r[2]:void 0;for(f=l.length>3&&typeof f=="function"?(u--,f):void 0,p&&Bh(r[0],r[1],p)&&(f=u<3?void 0:f,u=1),n=Object(n);++o<u;){var y=r[o];y&&l(n,y,o,f)}return n})}var Wh=Object.prototype;function Dl(l){var n=l&&l.constructor,r=typeof n=="function"&&n.prototype||Wh;return l===r}function jh(l,n){for(var r=-1,o=Array(l);++r<l;)o[r]=n(r);return o}var Uh="[object Arguments]";function Ol(l){return os(l)&&ss(l)==Uh}var Nl=Object.prototype,qh=Nl.hasOwnProperty,Gh=Nl.propertyIsEnumerable,Kh=Ol(function(){return arguments}())?Ol:function(l){return os(l)&&qh.call(l,"callee")&&!Gh.call(l,"callee")},Vh=Kh;function Xh(){return!1}var Rl=typeof De=="object"&&De&&!De.nodeType&&De,Fl=Rl&&typeof module=="object"&&module&&!module.nodeType&&module,Yh=Fl&&Fl.exports===Rl,Ml=Yh?as.Buffer:void 0,Jh=Ml?Ml.isBuffer:void 0,Qh=Jh||Xh,Zh=Qh,ep="[object Arguments]",tp="[object Array]",np="[object Boolean]",rp="[object Date]",ip="[object Error]",ap="[object Function]",sp="[object Map]",op="[object Number]",lp="[object Object]",up="[object RegExp]",cp="[object Set]",fp="[object String]",dp="[object WeakMap]",hp="[object ArrayBuffer]",pp="[object DataView]",gp="[object Float32Array]",mp="[object Float64Array]",vp="[object Int8Array]",yp="[object Int16Array]",bp="[object Int32Array]",xp="[object Uint8Array]",wp="[object Uint8ClampedArray]",kp="[object Uint16Array]",Sp="[object Uint32Array]",Xe={};Xe[gp]=Xe[mp]=Xe[vp]=Xe[yp]=Xe[bp]=Xe[xp]=Xe[wp]=Xe[kp]=Xe[Sp]=!0,Xe[ep]=Xe[tp]=Xe[hp]=Xe[np]=Xe[pp]=Xe[rp]=Xe[ip]=Xe[ap]=Xe[sp]=Xe[op]=Xe[lp]=Xe[up]=Xe[cp]=Xe[fp]=Xe[dp]=!1;function Cp(l){return os(l)&&Al(l.length)&&!!Xe[ss(l)]}function Tp(l){return function(n){return l(n)}}var $l=typeof De=="object"&&De&&!De.nodeType&&De,si=$l&&typeof module=="object"&&module&&!module.nodeType&&module,_p=si&&si.exports===$l,fs=_p&&bl.process,Lp=function(){try{var l=si&&si.require&&si.require("util").types;return l||fs&&fs.binding&&fs.binding("util")}catch{}}(),Pl=Lp,zl=Pl&&Pl.isTypedArray,Ep=zl?Tp(zl):Cp,Ip=Ep,Ap=Object.prototype,Dp=Ap.hasOwnProperty;function Op(l,n){var r=th(l),o=!r&&Vh(l),u=!r&&!o&&Zh(l),f=!r&&!o&&!u&&Ip(l),p=r||o||u||f,y=p?jh(l.length,String):[],m=y.length;for(var k in l)Dp.call(l,k)&&!(p&&(k=="length"||u&&(k=="offset"||k=="parent")||f&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||Tl(k,m)))&&y.push(k);return y}function Np(l,n){return function(r){return l(n(r))}}var Rp=Np(Object.keys,Object),Fp=Rp,Mp=Object.prototype,$p=Mp.hasOwnProperty;function Pp(l){if(!Dl(l))return Fp(l);var n=[];for(var r in Object(l))$p.call(l,r)&&r!="constructor"&&n.push(r);return n}function zp(l){return cs(l)?Op(l):Pp(l)}var Bp=Object.prototype,Hp=Bp.hasOwnProperty,Wp=Hh(function(l,n){if(Dl(n)||cs(n)){Mh(n,zp(n),l);return}for(var r in n)Hp.call(n,r)&&El(l,r,n[r])}),jp=Wp;const Bl=({images:l=[],options:n={}}={})=>{n=jp(n,{inline:!1});const r=Qc.extend({render(p){return p("div",{style:{display:"none"},class:["__viewer-token"]},l.map(y=>p("img",{attrs:typeof y=="string"?{src:y}:y})))}}),o=new r;o.$mount(),document.body.appendChild(o.$el);const u=new yl(o.$el,n),f=u.destroy.bind(u);return u.destroy=function(){return f(),o.$destroy(),document.body.removeChild(o.$el),u},u.show(),o.$el.addEventListener("hidden",function(){this.viewer===u&&u.destroy()}),u};(function(l,n){(function(r){r(jt())})(function(r){function o(A,M,K,he,E,x){this.indented=A,this.column=M,this.type=K,this.info=he,this.align=E,this.prev=x}function u(A,M,K,he){var E=A.indented;return A.context&&A.context.type=="statement"&&K!="statement"&&(E=A.context.indented),A.context=new o(E,M,K,he,null,A.context)}function f(A){var M=A.context.type;return(M==")"||M=="]"||M=="}")&&(A.indented=A.context.indented),A.context=A.context.prev}function p(A,M,K){if(M.prevToken=="variable"||M.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(A.string.slice(0,K))||M.typeAtEndOfLine&&A.column()==A.indentation())return!0}function y(A){for(;;){if(!A||A.type=="top")return!0;if(A.type=="}"&&A.prev.info!="namespace")return!1;A=A.prev}}r.defineMode("clike",function(A,M){var K=A.indentUnit,he=M.statementIndentUnit||K,E=M.dontAlignCalls,x=M.keywords||{},oe=M.types||{},_e=M.builtin||{},Z=M.blockKeywords||{},fe=M.defKeywords||{},ke=M.atoms||{},Le=M.hooks||{},ct=M.multiLineStrings,we=M.indentStatements!==!1,Re=M.indentSwitch!==!1,Ke=M.namespaceSeparator,ft=M.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,Pt=M.numberStart||/[\d\.]/,dt=M.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,ht=M.isOperatorChar||/[+\-*&%=<>!?|\/]/,gt=M.isIdentifierChar||/[\w\$_\xa1-\uffff]/,Kt=M.isReservedIdentifier||!1,be,St;function Vt(ye,xe){var pe=ye.next();if(Le[pe]){var Me=Le[pe](ye,xe);if(Me!==!1)return Me}if(pe=='"'||pe=="'")return xe.tokenize=On(pe),xe.tokenize(ye,xe);if(Pt.test(pe)){if(ye.backUp(1),ye.match(dt))return"number";ye.next()}if(ft.test(pe))return be=pe,null;if(pe=="/"){if(ye.eat("*"))return xe.tokenize=Zn,Zn(ye,xe);if(ye.eat("/"))return ye.skipToEnd(),"comment"}if(ht.test(pe)){for(;!ye.match(/^\/[\/*]/,!1)&&ye.eat(ht););return"operator"}if(ye.eatWhile(gt),Ke)for(;ye.match(Ke);)ye.eatWhile(gt);var Ie=ye.current();return k(x,Ie)?(k(Z,Ie)&&(be="newstatement"),k(fe,Ie)&&(St=!0),"keyword"):k(oe,Ie)?"type":k(_e,Ie)||Kt&&Kt(Ie)?(k(Z,Ie)&&(be="newstatement"),"builtin"):k(ke,Ie)?"atom":"variable"}function On(ye){return function(xe,pe){for(var Me=!1,Ie,zt=!1;(Ie=xe.next())!=null;){if(Ie==ye&&!Me){zt=!0;break}Me=!Me&&Ie=="\\"}return(zt||!(Me||ct))&&(pe.tokenize=null),"string"}}function Zn(ye,xe){for(var pe=!1,Me;Me=ye.next();){if(Me=="/"&&pe){xe.tokenize=null;break}pe=Me=="*"}return"comment"}function wr(ye,xe){M.typeFirstDefinitions&&ye.eol()&&y(xe.context)&&(xe.typeAtEndOfLine=p(ye,xe,ye.pos))}return{startState:function(ye){return{tokenize:null,context:new o((ye||0)-K,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(ye,xe){var pe=xe.context;if(ye.sol()&&(pe.align==null&&(pe.align=!1),xe.indented=ye.indentation(),xe.startOfLine=!0),ye.eatSpace())return wr(ye,xe),null;be=St=null;var Me=(xe.tokenize||Vt)(ye,xe);if(Me=="comment"||Me=="meta")return Me;if(pe.align==null&&(pe.align=!0),be==";"||be==":"||be==","&&ye.match(/^\s*(?:\/\/.*)?$/,!1))for(;xe.context.type=="statement";)f(xe);else if(be=="{")u(xe,ye.column(),"}");else if(be=="[")u(xe,ye.column(),"]");else if(be=="(")u(xe,ye.column(),")");else if(be=="}"){for(;pe.type=="statement";)pe=f(xe);for(pe.type=="}"&&(pe=f(xe));pe.type=="statement";)pe=f(xe)}else be==pe.type?f(xe):we&&((pe.type=="}"||pe.type=="top")&&be!=";"||pe.type=="statement"&&be=="newstatement")&&u(xe,ye.column(),"statement",ye.current());if(Me=="variable"&&(xe.prevToken=="def"||M.typeFirstDefinitions&&p(ye,xe,ye.start)&&y(xe.context)&&ye.match(/^\s*\(/,!1))&&(Me="def"),Le.token){var Ie=Le.token(ye,xe,Me);Ie!==void 0&&(Me=Ie)}return Me=="def"&&M.styleDefs===!1&&(Me="variable"),xe.startOfLine=!1,xe.prevToken=St?"def":Me||be,wr(ye,xe),Me},indent:function(ye,xe){if(ye.tokenize!=Vt&&ye.tokenize!=null||ye.typeAtEndOfLine&&y(ye.context))return r.Pass;var pe=ye.context,Me=xe&&xe.charAt(0),Ie=Me==pe.type;if(pe.type=="statement"&&Me=="}"&&(pe=pe.prev),M.dontIndentStatements)for(;pe.type=="statement"&&M.dontIndentStatements.test(pe.info);)pe=pe.prev;if(Le.indent){var zt=Le.indent(ye,pe,xe,K);if(typeof zt=="number")return zt}var en=pe.prev&&pe.prev.info=="switch";if(M.allmanIndentation&&/[{(]/.test(Me)){for(;pe.type!="top"&&pe.type!="}";)pe=pe.prev;return pe.indented}return pe.type=="statement"?pe.indented+(Me=="{"?0:he):pe.align&&(!E||pe.type!=")")?pe.column+(Ie?0:1):pe.type==")"&&!Ie?pe.indented+he:pe.indented+(Ie?0:K)+(!Ie&&en&&!/^(?:case|default)\b/.test(xe)?K:0)},electricInput:Re?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function m(A){for(var M={},K=A.split(" "),he=0;he<K.length;++he)M[K[he]]=!0;return M}function k(A,M){return typeof A=="function"?A(M):A.propertyIsEnumerable(M)}var S="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",F="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",L="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",W="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",z=m("int long char short double float unsigned signed void bool"),D=m("SEL instancetype id Class Protocol BOOL");function $(A){return k(z,A)||/.+_t$/.test(A)}function I(A){return $(A)||k(D,A)}var N="case do else for if switch while struct enum union",H="struct enum union";function V(A,M){if(!M.startOfLine)return!1;for(var K,he=null;K=A.peek();){if(K=="\\"&&A.match(/^.$/)){he=V;break}else if(K=="/"&&A.match(/^\/[\/\*]/,!1))break;A.next()}return M.tokenize=he,"meta"}function ne(A,M){return M.prevToken=="type"?"type":!1}function ue(A){return!A||A.length<2||A[0]!="_"?!1:A[1]=="_"||A[1]!==A[1].toLowerCase()}function se(A){return A.eatWhile(/[\w\.']/),"number"}function de(A,M){if(A.backUp(1),A.match(/^(?:R|u8R|uR|UR|LR)/)){var K=A.match(/^"([^\s\\()]{0,16})\(/);return K?(M.cpp11RawStringDelim=K[1],M.tokenize=ie,ie(A,M)):!1}return A.match(/^(?:u8|u|U|L)/)?A.match(/^["']/,!1)?"string":!1:(A.next(),!1)}function Oe(A){var M=/(\w+)::~?(\w+)$/.exec(A);return M&&M[1]==M[2]}function Fe(A,M){for(var K;(K=A.next())!=null;)if(K=='"'&&!A.eat('"')){M.tokenize=null;break}return"string"}function ie(A,M){var K=M.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),he=A.match(new RegExp(".*?\\)"+K+'"'));return he?M.tokenize=null:A.skipToEnd(),"string"}function Pe(A,M){typeof A=="string"&&(A=[A]);var K=[];function he(x){if(x)for(var oe in x)x.hasOwnProperty(oe)&&K.push(oe)}he(M.keywords),he(M.types),he(M.builtin),he(M.atoms),K.length&&(M.helperType=A[0],r.registerHelper("hintWords",A[0],K));for(var E=0;E<A.length;++E)r.defineMIME(A[E],M)}Pe(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:m(S),types:$,blockKeywords:m(N),defKeywords:m(H),typeFirstDefinitions:!0,atoms:m("NULL true false"),isReservedIdentifier:ue,hooks:{"#":V,"*":ne},modeProps:{fold:["brace","include"]}}),Pe(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:m(S+" "+F),types:$,blockKeywords:m(N+" class try catch"),defKeywords:m(H+" class namespace"),typeFirstDefinitions:!0,atoms:m("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:ue,hooks:{"#":V,"*":ne,u:de,U:de,L:de,R:de,0:se,1:se,2:se,3:se,4:se,5:se,6:se,7:se,8:se,9:se,token:function(A,M,K){if(K=="variable"&&A.peek()=="("&&(M.prevToken==";"||M.prevToken==null||M.prevToken=="}")&&Oe(A.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Pe("text/x-java",{name:"clike",keywords:m("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:m("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:m("catch class do else finally for if switch try while"),defKeywords:m("class interface enum @interface"),typeFirstDefinitions:!0,atoms:m("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(A){return A.match("interface",!1)?!1:(A.eatWhile(/[\w\$_]/),"meta")},'"':function(A,M){return A.match(/""$/)?(M.tokenize=j,M.tokenize(A,M)):!1}},modeProps:{fold:["brace","import"]}}),Pe("text/x-csharp",{name:"clike",keywords:m("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:m("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:m("catch class do else finally for foreach if struct switch try while"),defKeywords:m("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:m("true false null"),hooks:{"@":function(A,M){return A.eat('"')?(M.tokenize=Fe,Fe(A,M)):(A.eatWhile(/[\w\$_]/),"meta")}}});function j(A,M){for(var K=!1;!A.eol();){if(!K&&A.match('"""')){M.tokenize=null;break}K=A.next()=="\\"&&!K}return"string"}function Q(A){return function(M,K){for(var he;he=M.next();)if(he=="*"&&M.eat("/"))if(A==1){K.tokenize=null;break}else return K.tokenize=Q(A-1),K.tokenize(M,K);else if(he=="/"&&M.eat("*"))return K.tokenize=Q(A+1),K.tokenize(M,K);return"comment"}}Pe("text/x-scala",{name:"clike",keywords:m("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:m("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:m("catch class enum do else finally for forSome if match switch try while"),defKeywords:m("class enum def object package trait type val var"),atoms:m("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(A){return A.eatWhile(/[\w\$_]/),"meta"},'"':function(A,M){return A.match('""')?(M.tokenize=j,M.tokenize(A,M)):!1},"'":function(A){return A.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(A.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(A,M){var K=M.context;return K.type=="}"&&K.align&&A.eat(">")?(M.context=new o(K.indented,K.column,K.type,K.info,null,K.prev),"operator"):!1},"/":function(A,M){return A.eat("*")?(M.tokenize=Q(1),M.tokenize(A,M)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function w(A){return function(M,K){for(var he=!1,E,x=!1;!M.eol();){if(!A&&!he&&M.match('"')){x=!0;break}if(A&&M.match('"""')){x=!0;break}E=M.next(),!he&&E=="$"&&M.match("{")&&M.skipTo("}"),he=!he&&E=="\\"&&!A}return(x||!A)&&(K.tokenize=null),"string"}}Pe("text/x-kotlin",{name:"clike",keywords:m("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:m("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:m("catch class do else finally for if where try while enum"),defKeywords:m("class val var object interface fun"),atoms:m("true false null this"),hooks:{"@":function(A){return A.eatWhile(/[\w\$_]/),"meta"},"*":function(A,M){return M.prevToken=="."?"variable":"operator"},'"':function(A,M){return M.tokenize=w(A.match('""')),M.tokenize(A,M)},"/":function(A,M){return A.eat("*")?(M.tokenize=Q(1),M.tokenize(A,M)):!1},indent:function(A,M,K,he){var E=K&&K.charAt(0);if((A.prevToken=="}"||A.prevToken==")")&&K=="")return A.indented;if(A.prevToken=="operator"&&K!="}"&&A.context.type!="}"||A.prevToken=="variable"&&E=="."||(A.prevToken=="}"||A.prevToken==")")&&E==".")return he*2+M.indented;if(M.align&&M.type=="}")return M.indented+(A.context.type==(K||"").charAt(0)?0:he)}},modeProps:{closeBrackets:{triples:'"'}}}),Pe(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:m("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:m("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:m("for while do if else struct"),builtin:m("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:m("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":V},modeProps:{fold:["brace","include"]}}),Pe("text/x-nesc",{name:"clike",keywords:m(S+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:$,blockKeywords:m(N),atoms:m("null true false"),hooks:{"#":V},modeProps:{fold:["brace","include"]}}),Pe("text/x-objectivec",{name:"clike",keywords:m(S+" "+L),types:I,builtin:m(W),blockKeywords:m(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:m(H+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:m("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ue,hooks:{"#":V,"*":ne},modeProps:{fold:["brace","include"]}}),Pe("text/x-objectivec++",{name:"clike",keywords:m(S+" "+L+" "+F),types:I,builtin:m(W),blockKeywords:m(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:m(H+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:m("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ue,hooks:{"#":V,"*":ne,u:de,U:de,L:de,R:de,0:se,1:se,2:se,3:se,4:se,5:se,6:se,7:se,8:se,9:se,token:function(A,M,K){if(K=="variable"&&A.peek()=="("&&(M.prevToken==";"||M.prevToken==null||M.prevToken=="}")&&Oe(A.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Pe("text/x-squirrel",{name:"clike",keywords:m("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:$,blockKeywords:m("case catch class else for foreach if switch try while"),defKeywords:m("function local class"),typeFirstDefinitions:!0,atoms:m("true false null"),hooks:{"#":V},modeProps:{fold:["brace","include"]}});var J=null;function G(A){return function(M,K){for(var he=!1,E,x=!1;!M.eol();){if(!he&&M.match('"')&&(A=="single"||M.match('""'))){x=!0;break}if(!he&&M.match("``")){J=G(A),x=!0;break}E=M.next(),he=A=="single"&&!he&&E=="\\"}return x&&(K.tokenize=null),"string"}}Pe("text/x-ceylon",{name:"clike",keywords:m("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(A){var M=A.charAt(0);return M===M.toUpperCase()&&M!==M.toLowerCase()},blockKeywords:m("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:m("class dynamic function interface module object package value"),builtin:m("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:m("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(A){return A.eatWhile(/[\w\$_]/),"meta"},'"':function(A,M){return M.tokenize=G(A.match('""')?"triple":"single"),M.tokenize(A,M)},"`":function(A,M){return!J||!A.match("`")?!1:(M.tokenize=J,J=null,M.tokenize(A,M))},"'":function(A){return A.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(A,M,K){if((K=="variable"||K=="type")&&M.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})(),Se.setOptions({breaks:!0});const Up={name:"OutputViewer",components:{codemirror:za.codemirror,FilePdfViewer:Xa},props:{value:{type:[Object,Array,String],default:null},showRawToggle:{type:Boolean,default:!1},isErrorResponse:{type:Boolean,default:!1},previewMarkdown:{type:String,default:""},fileOnly:{type:Boolean,default:!1},supportFileElements:{type:Boolean,default:!1},title:{type:String,default:""},contentKey:{type:[String,Number],default:0}},data(){return{showRaw:!1,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},viewerOptions:{inline:!1,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,zIndex:9999}}},computed:{errorMessage(){return this.getErrorMessage(this.value)},effectiveFileOnly(){return this.fileOnly?!0:!this.supportFileElements||!this.value||this.value.choices?!1:this.extractFileRefs(this.value).length>0||this.extractImageBase64Refs(this.value).length>0}},methods:{handleCopy(){const l=this.formatRawJson(this.value);this.$emit("copy",l)},copyChoiceContent(l){let n="";if(typeof l=="string")n=l;else if(Array.isArray(l)){const r=l.filter(o=>o&&o.type==="text"&&o.text).map(o=>o.text);n=r.length>0?r.join(`
|
|
78
|
-
`):this.formatRawJson(l)}else n=this.formatRawJson(l);this.$emit("copy",n)},formatRawJson(l){if(!l)return"";if(typeof l=="string")try{const n=JSON.parse(l);return JSON.stringify(n,null,2)}catch{return l}return JSON.stringify(l,null,2)},getErrorMessage(l){return!l||typeof l!="object"?String(l??""):l.error&&typeof l.error=="object"&&l.error.message?l.error.message:l.message?l.message:l._status!==void 0?`${l._status} ${l._statusText||""}`.trim():l._raw!==void 0?String(l._raw):JSON.stringify(l)},renderMarkdown(l){return l?Se(String(l)):""},getMessageRoleLabel(l){const n={system:"debug.systemRole",user:"debug.userRole",assistant:"debug.assistantRole"};return n[l]?this.$t(n[l]):l},handleImageClick(l){Bl({options:this.viewerOptions,images:[l]})},extractImagesFromObject(l,n=[],r=""){if(!(!l||typeof l!="object")){for(const[o,u]of Object.entries(l)){const f=r?`${r}.${o}`:o;typeof u=="string"&&u.trim()!==""?(u.startsWith("data:image/")||u.startsWith("/9j/")||u.startsWith("iVBOR")||u.startsWith("R0lGOD"))&&(n.push({path:f,value:u,label:o==="content"&&r?`${r.split(".").pop()}: ${o}`:o}),l[o]="[IMAGE_DATA]"):u&&typeof u=="object"&&!Array.isArray(u)?this.extractImagesFromObject(u,n,f):Array.isArray(u)&&u.forEach((p,y)=>{p&&typeof p=="object"&&this.extractImagesFromObject(p,n,`${f}[${y}]`)})}return n}},extractFileRefs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r.startsWith("__file__")&&o!=null?Array.isArray(o)?o.forEach(u=>{u!=null&&typeof u=="string"&&u.trim()!==""&&n.push(u.trim())}):typeof o=="string"&&o.trim()!==""&&n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractFileRefs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractFileRefs(u,n)});return n},extractImageBase64Refs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r==="image_base64"&&o!=null&&typeof o=="string"&&o.trim()!==""?n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractImageBase64Refs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractImageBase64Refs(u,n)});return n},getFileExtension(l){if(!l||typeof l!="string")return"";const n=l.lastIndexOf(".");return n>=0?l.slice(n+1).toLowerCase():""},buildFileElements(l,n="file"){if(!this.supportFileElements)return[];const r=["jpg","jpeg","png","gif","webp","bmp","svg"],o=[];return l.forEach((u,f)=>{const p=this.getFileExtension(u),y=zi(u),m=decodeURIComponent(u.split("/").pop()||u);r.includes(p)?o.push({type:"file-image",downloadUrl:y,key:`${n}-image-${f}`}):p==="pdf"?o.push({type:"file-pdf",downloadUrl:y,key:`${n}-pdf-${f}`}):o.push({type:"file-download",downloadUrl:y,filename:m,key:`${n}-download-${f}`})}),o},formatBase64Image(l){return l?l.startsWith("data:image")?l:l.startsWith("/9j/")?`data:image/jpeg;base64,${l}`:l.startsWith("iVBOR")?`data:image/png;base64,${l}`:l.startsWith("R0lGOD")?`data:image/gif;base64,${l}`:`data:image/jpeg;base64,${l}`:""},renderStructuredContent(l,n=!1){const r=[];if(!l)return r;if(this.supportFileElements){const o=this.extractFileRefs(l);o.length>0&&r.push(...this.buildFileElements(o,"file"))}if(l.data&&Array.isArray(l.data.result))l.data.result.forEach((o,u)=>{o.image_base64&&o.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(o.image_base64),key:`result-page-${u}`,label:o.page_num!==void 0?`Page ${o.page_num}`:`Result ${u}`}),o.seals&&Array.isArray(o.seals)&&o.seals.forEach((f,p)=>{f.image_base64&&f.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(f.image_base64),key:`result-seal-${u}-${p}`,label:`印章文字: ${f.value||""}`})})});else{const o=this.extractImageBase64Refs(l);o.length>0&&o.forEach((u,f)=>{r.push({type:"image",url:this.formatBase64Image(u),key:`base64-image-${f}`})})}if(n)return r;try{if(Array.isArray(l))l.forEach((o,u)=>{var f;o&&typeof o=="object"?o.type==="text"&&o.text?r.push({type:"markdown",content:Se(o.text),key:`text-${u}`}):o.type==="image_url"&&((f=o.image_url)!=null&&f.url)?r.push({type:"image",url:o.image_url.url,key:`image-${u}`}):o.image_base64&&o.image_base64.trim()!==""?r.push({type:"image",url:this.formatBase64Image(o.image_base64),key:`base64-image-${u}`}):r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(o,null,2)+"\n```"),key:`json-${u}`}):r.push({type:"markdown",content:Se(String(o)),key:`text-${u}`})});else if(typeof l=="string")r.push({type:"markdown",content:Se(l),key:"text-0"});else if(typeof l=="object")if(l.data&&Array.isArray(l.data.result)){const o=JSON.parse(JSON.stringify(l)),u=[];o.data&&o.data.result&&o.data.result.forEach((f,p)=>{f.image_base64&&f.image_base64.trim()!==""&&(u.push({type:"page",image_base64:f.image_base64,page_num:f.page_num,label:f.page_num!==void 0?`Page ${f.page_num}`:`Result ${p}`}),f.image_base64="[BASE64_IMAGE_DATA]"),f.seals&&Array.isArray(f.seals)&&f.seals.forEach((y,m)=>{y.image_base64&&y.image_base64.trim()!==""&&(u.push({type:"seal",image_base64:y.image_base64,page_num:f.page_num,seal_index:m,seal_value:y.value,label:`印章文字: ${y.value||""}`}),y.image_base64="[BASE64_IMAGE_DATA]")})}),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(o,null,2)+"\n```"),key:"json-0"}),u.forEach((f,p)=>{r.push({type:"image",url:this.formatBase64Image(f.image_base64),key:`result-image-${p}`,label:f.label})})}else{const o=JSON.parse(JSON.stringify(l)),u=[];this.extractImagesFromObject(o,u),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(o,null,2)+"\n```"),key:"json-0"}),u.forEach((f,p)=>{r.push({type:"image",url:this.formatBase64Image(f.value),key:`extracted-image-${p}`,label:f.label})})}else r.push({type:"markdown",content:Se(String(l)),key:"text-0"})}catch(o){console.error("Error rendering content:",o),r.push({type:"markdown",content:Se("Error rendering content"),key:"error-0"})}return r}}};var qp=function(){var n=this,r=n._self._c;return r("div",{staticClass:"output-viewer"},[n.title||n.$slots.title?r("div",{staticClass:"output-viewer-header"},[r("div",{staticClass:"output-viewer-title-row"},[r("span",{staticClass:"output-viewer-title"},[n._t("title",function(){return[n._v(n._s(n.title))]})],2),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:n.handleCopy}})],1)],1),n.showRawToggle?r("div",{staticClass:"output-viewer-actions"},[r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(o){n.showRaw=!n.showRaw}}},[n._v(n._s(n.showRaw?n.$t("debug.switchToMarkdown"):n.$t("debug.switchToRaw")))])],1):n._e()]):n._e(),n.showRaw?r("div",{staticClass:"output-viewer-raw"},[r("codemirror",{key:`output-raw-${n.contentKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.value),options:n.cmOptions}})],1):r("div",{staticClass:"output-viewer-readable"},[n.isErrorResponse?r("div",{staticClass:"structured-content"},[r("div",{staticClass:"content-element"},[r("div",{staticClass:"markdown-content"},[n._v(n._s(n.errorMessage))])])]):n.previewMarkdown?r("div",{staticClass:"structured-content preview-content"},[r("div",{staticClass:"content-element"},[r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(n.renderMarkdown(n.previewMarkdown))}})])]):n.effectiveFileOnly&&n.value?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.value,!0),function(o){return r("div",{key:o.key,staticClass:"content-element"},[o.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(o.content)}}):o.type==="image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.url,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.url)}}})]):o.type==="file-image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.downloadUrl,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.downloadUrl)}}})]):o.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:o}})],1):o.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:o.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(o.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):n.value&&n.value.choices?r("div",{staticClass:"outputs-section"},n._l(n.value.choices,function(o,u){return r("div",{key:u,staticClass:"choice-item"},[r("div",{staticClass:"choice-content"},[o.message?r("div",[r("div",{staticClass:"message-header"},[r("i",{staticClass:"el-icon-user message-icon"}),r("span",[n._v(n._s(n.getMessageRoleLabel(o.message.role)))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(f){return n.copyChoiceContent(o.message.content)}}})],1)],1),r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(o.message.content,!1),function(f){return r("div",{key:f.key,staticClass:"content-element"},[f.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(f.content)}}):f.type==="image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.url,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.url)}}})]):f.type==="file-image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.downloadUrl,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.downloadUrl)}}})]):f.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:f}})],1):f.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:f.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(f.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0)]):r("div",[r("div",{staticClass:"message-header"},[r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(f){return n.copyChoiceContent(o)}}})],1)],1),r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(o,!1),function(f){return r("div",{key:f.key,staticClass:"content-element"},[f.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(f.content)}}):f.type==="image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.url,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.url)}}})]):f.type==="file-image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.downloadUrl,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.downloadUrl)}}})]):f.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:f}})],1):f.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:f.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(f.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0)])])])}),0):n.value?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.value,!1),function(o){return r("div",{key:o.key,staticClass:"content-element"},[o.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(o.content)}}):o.type==="image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.url,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.url)}}})]):o.type==="file-image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.downloadUrl,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.downloadUrl)}}})]):o.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:o}})],1):o.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:o.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(o.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):n._e()])])},Gp=[],Kp=vn(Up,qp,Gp,!1,null,"a12c132d");const Hl=Kp.exports;var Wl={exports:{}},jl;function Vp(){return jl||(jl=1,function(l,n){(function(r){r(jt())})(function(r){var o={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},u={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};r.defineMode("xml",function(f,p){var y=f.indentUnit,m={},k=p.htmlMode?o:u;for(var S in k)m[S]=k[S];for(var S in p)m[S]=p[S];var F,L;function W(w,J){function G(K){return J.tokenize=K,K(w,J)}var A=w.next();if(A=="<")return w.eat("!")?w.eat("[")?w.match("CDATA[")?G($("atom","]]>")):null:w.match("--")?G($("comment","-->")):w.match("DOCTYPE",!0,!0)?(w.eatWhile(/[\w\._\-]/),G(I(1))):null:w.eat("?")?(w.eatWhile(/[\w\._\-]/),J.tokenize=$("meta","?>"),"meta"):(F=w.eat("/")?"closeTag":"openTag",J.tokenize=z,"tag bracket");if(A=="&"){var M;return w.eat("#")?w.eat("x")?M=w.eatWhile(/[a-fA-F\d]/)&&w.eat(";"):M=w.eatWhile(/[\d]/)&&w.eat(";"):M=w.eatWhile(/[\w\.\-:]/)&&w.eat(";"),M?"atom":"error"}else return w.eatWhile(/[^&<]/),null}W.isInText=!0;function z(w,J){var G=w.next();if(G==">"||G=="/"&&w.eat(">"))return J.tokenize=W,F=G==">"?"endTag":"selfcloseTag","tag bracket";if(G=="=")return F="equals",null;if(G=="<"){J.tokenize=W,J.state=ue,J.tagName=J.tagStart=null;var A=J.tokenize(w,J);return A?A+" tag error":"tag error"}else return/[\'\"]/.test(G)?(J.tokenize=D(G),J.stringStartCol=w.column(),J.tokenize(w,J)):(w.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(w){var J=function(G,A){for(;!G.eol();)if(G.next()==w){A.tokenize=z;break}return"string"};return J.isInAttribute=!0,J}function $(w,J){return function(G,A){for(;!G.eol();){if(G.match(J)){A.tokenize=W;break}G.next()}return w}}function I(w){return function(J,G){for(var A;(A=J.next())!=null;){if(A=="<")return G.tokenize=I(w+1),G.tokenize(J,G);if(A==">")if(w==1){G.tokenize=W;break}else return G.tokenize=I(w-1),G.tokenize(J,G)}return"meta"}}function N(w){return w&&w.toLowerCase()}function H(w,J,G){this.prev=w.context,this.tagName=J||"",this.indent=w.indented,this.startOfLine=G,(m.doNotIndent.hasOwnProperty(J)||w.context&&w.context.noIndent)&&(this.noIndent=!0)}function V(w){w.context&&(w.context=w.context.prev)}function ne(w,J){for(var G;;){if(!w.context||(G=w.context.tagName,!m.contextGrabbers.hasOwnProperty(N(G))||!m.contextGrabbers[N(G)].hasOwnProperty(N(J))))return;V(w)}}function ue(w,J,G){return w=="openTag"?(G.tagStart=J.column(),se):w=="closeTag"?de:ue}function se(w,J,G){return w=="word"?(G.tagName=J.current(),L="tag",ie):m.allowMissingTagName&&w=="endTag"?(L="tag bracket",ie(w,J,G)):(L="error",se)}function de(w,J,G){if(w=="word"){var A=J.current();return G.context&&G.context.tagName!=A&&m.implicitlyClosed.hasOwnProperty(N(G.context.tagName))&&V(G),G.context&&G.context.tagName==A||m.matchClosing===!1?(L="tag",Oe):(L="tag error",Fe)}else return m.allowMissingTagName&&w=="endTag"?(L="tag bracket",Oe(w,J,G)):(L="error",Fe)}function Oe(w,J,G){return w!="endTag"?(L="error",Oe):(V(G),ue)}function Fe(w,J,G){return L="error",Oe(w,J,G)}function ie(w,J,G){if(w=="word")return L="attribute",Pe;if(w=="endTag"||w=="selfcloseTag"){var A=G.tagName,M=G.tagStart;return G.tagName=G.tagStart=null,w=="selfcloseTag"||m.autoSelfClosers.hasOwnProperty(N(A))?ne(G,A):(ne(G,A),G.context=new H(G,A,M==G.indented)),ue}return L="error",ie}function Pe(w,J,G){return w=="equals"?j:(m.allowMissing||(L="error"),ie(w,J,G))}function j(w,J,G){return w=="string"?Q:w=="word"&&m.allowUnquoted?(L="string",ie):(L="error",ie(w,J,G))}function Q(w,J,G){return w=="string"?Q:ie(w,J,G)}return{startState:function(w){var J={tokenize:W,state:ue,indented:w||0,tagName:null,tagStart:null,context:null};return w!=null&&(J.baseIndent=w),J},token:function(w,J){if(!J.tagName&&w.sol()&&(J.indented=w.indentation()),w.eatSpace())return null;F=null;var G=J.tokenize(w,J);return(G||F)&&G!="comment"&&(L=null,J.state=J.state(F||G,w,J),L&&(G=L=="error"?G+" error":L)),G},indent:function(w,J,G){var A=w.context;if(w.tokenize.isInAttribute)return w.tagStart==w.indented?w.stringStartCol+1:w.indented+y;if(A&&A.noIndent)return r.Pass;if(w.tokenize!=z&&w.tokenize!=W)return G?G.match(/^(\s*)/)[0].length:0;if(w.tagName)return m.multilineTagIndentPastTag!==!1?w.tagStart+w.tagName.length+2:w.tagStart+y*(m.multilineTagIndentFactor||1);if(m.alignCDATA&&/<!\[CDATA\[/.test(J))return 0;var M=J&&/^<(\/)?([\w_:\.-]*)/.exec(J);if(M&&M[1])for(;A;)if(A.tagName==M[2]){A=A.prev;break}else if(m.implicitlyClosed.hasOwnProperty(N(A.tagName)))A=A.prev;else break;else if(M)for(;A;){var K=m.contextGrabbers[N(A.tagName)];if(K&&K.hasOwnProperty(N(M[2])))A=A.prev;else break}for(;A&&A.prev&&!A.startOfLine;)A=A.prev;return A?A.indent+y:w.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:m.htmlMode?"html":"xml",helperType:m.htmlMode?"html":"xml",skipAttribute:function(w){w.state==j&&(w.state=ie)},xmlCurrentTag:function(w){return w.tagName?{name:w.tagName,close:w.type=="closeTag"}:null},xmlCurrentContext:function(w){for(var J=[],G=w.context;G;G=G.prev)J.push(G.tagName);return J.reverse()}}}),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),Wl.exports}var Ul={exports:{}},ql;function Xp(){return ql||(ql=1,function(l,n){(function(r){r(jt())})(function(r){r.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var o=0;o<r.modeInfo.length;o++){var u=r.modeInfo[o];u.mimes&&(u.mime=u.mimes[0])}r.findModeByMIME=function(f){f=f.toLowerCase();for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.mime==f)return y;if(y.mimes){for(var m=0;m<y.mimes.length;m++)if(y.mimes[m]==f)return y}}if(/\+xml$/.test(f))return r.findModeByMIME("application/xml");if(/\+json$/.test(f))return r.findModeByMIME("application/json")},r.findModeByExtension=function(f){f=f.toLowerCase();for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.ext){for(var m=0;m<y.ext.length;m++)if(y.ext[m]==f)return y}}},r.findModeByFileName=function(f){for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.file&&y.file.test(f))return y}var m=f.lastIndexOf("."),k=m>-1&&f.substring(m+1,f.length);if(k)return r.findModeByExtension(k)},r.findModeByName=function(f){f=f.toLowerCase();for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.name.toLowerCase()==f)return y;if(y.alias){for(var m=0;m<y.alias.length;m++)if(y.alias[m].toLowerCase()==f)return y}}}})}()),Ul.exports}(function(l,n){(function(r){r(jt(),Vp(),Xp())})(function(r){r.defineMode("markdown",function(o,u){var f=r.getMode(o,"text/html"),p=f.name=="null";function y(E){if(r.findModeByName){var x=r.findModeByName(E);x&&(E=x.mime||x.mimes[0])}var oe=r.getMode(o,E);return oe.name=="null"?null:oe}u.highlightFormatting===void 0&&(u.highlightFormatting=!1),u.maxBlockquoteDepth===void 0&&(u.maxBlockquoteDepth=0),u.taskLists===void 0&&(u.taskLists=!1),u.strikethrough===void 0&&(u.strikethrough=!1),u.emoji===void 0&&(u.emoji=!1),u.fencedCodeBlockHighlighting===void 0&&(u.fencedCodeBlockHighlighting=!0),u.fencedCodeBlockDefaultMode===void 0&&(u.fencedCodeBlockDefaultMode="text/plain"),u.xml===void 0&&(u.xml=!0),u.tokenTypeOverrides===void 0&&(u.tokenTypeOverrides={});var m={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var k in m)m.hasOwnProperty(k)&&u.tokenTypeOverrides[k]&&(m[k]=u.tokenTypeOverrides[k]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,F=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,L=/^\[(x| )\](?=\s)/i,W=u.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,z=/^ {0,3}(?:\={1,}|-{2,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,$=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,I=/^\s*\[[^\]]+?\]:.*$/,N=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,H=" ";function V(E,x,oe){return x.f=x.inline=oe,oe(E,x)}function ne(E,x,oe){return x.f=x.block=oe,oe(E,x)}function ue(E){return!E||!/\S/.test(E.string)}function se(E){if(E.linkTitle=!1,E.linkHref=!1,E.linkText=!1,E.em=!1,E.strong=!1,E.strikethrough=!1,E.quote=0,E.indentedCode=!1,E.f==Oe){var x=p;if(!x){var oe=r.innerMode(f,E.htmlState);x=oe.mode.name=="xml"&&oe.state.tagStart===null&&!oe.state.context&&oe.state.tokenize.isInText}x&&(E.f=j,E.block=de,E.htmlState=null)}return E.trailingSpace=0,E.trailingSpaceNewLine=!1,E.prevLine=E.thisLine,E.thisLine={stream:null},null}function de(E,x){var oe=E.column()===x.indentation,_e=ue(x.prevLine.stream),Z=x.indentedCode,fe=x.prevLine.hr,ke=x.list!==!1,Le=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var ct=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,ke)){for(x.list=null;ct<x.listStack[x.listStack.length-1];)x.listStack.pop(),x.listStack.length?x.indentation=x.listStack[x.listStack.length-1]:x.list=!1;x.list!==!1&&(x.indentationDiff=ct-x.listStack[x.listStack.length-1])}var we=!_e&&!fe&&!x.prevLine.header&&(!ke||!Z)&&!x.prevLine.fencedCodeEnd,Re=(x.list===!1||fe||_e)&&x.indentation<=Le&&E.match(S),Ke=null;if(x.indentationDiff>=4&&(Z||x.prevLine.fencedCodeEnd||x.prevLine.header||_e))return E.skipToEnd(),x.indentedCode=!0,m.code;if(E.eatSpace())return null;if(oe&&x.indentation<=Le&&(Ke=E.match(W))&&Ke[1].length<=6)return x.quote=0,x.header=Ke[1].length,x.thisLine.header=!0,u.highlightFormatting&&(x.formatting="header"),x.f=x.inline,ie(x);if(x.indentation<=Le&&E.eat(">"))return x.quote=oe?1:x.quote+1,u.highlightFormatting&&(x.formatting="quote"),E.eatSpace(),ie(x);if(!Re&&!x.setext&&oe&&x.indentation<=Le&&(Ke=E.match(F))){var ft=Ke[1]?"ol":"ul";return x.indentation=ct+E.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,u.taskLists&&E.match(L,!1)&&(x.taskList=!0),x.f=x.inline,u.highlightFormatting&&(x.formatting=["list","list-"+ft]),ie(x)}else{if(oe&&x.indentation<=Le&&(Ke=E.match($,!0)))return x.quote=0,x.fencedEndRE=new RegExp(Ke[1]+"+ *$"),x.localMode=u.fencedCodeBlockHighlighting&&y(Ke[2]||u.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=r.startState(x.localMode)),x.f=x.block=Fe,u.highlightFormatting&&(x.formatting="code-block"),x.code=-1,ie(x);if(x.setext||(!we||!ke)&&!x.quote&&x.list===!1&&!x.code&&!Re&&!I.test(E.string)&&(Ke=E.lookAhead(1))&&(Ke=Ke.match(z)))return x.setext?(x.header=x.setext,x.setext=0,E.skipToEnd(),u.highlightFormatting&&(x.formatting="header")):(x.header=Ke[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,ie(x);if(Re)return E.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,m.hr;if(E.peek()==="[")return V(E,x,A)}return V(E,x,x.inline)}function Oe(E,x){var oe=f.token(E,x.htmlState);if(!p){var _e=r.innerMode(f,x.htmlState);(_e.mode.name=="xml"&&_e.state.tagStart===null&&!_e.state.context&&_e.state.tokenize.isInText||x.md_inside&&E.current().indexOf(">")>-1)&&(x.f=j,x.block=de,x.htmlState=null)}return oe}function Fe(E,x){var oe=x.listStack[x.listStack.length-1]||0,_e=x.indentation<oe,Z=oe+3;if(x.fencedEndRE&&x.indentation<=Z&&(_e||E.match(x.fencedEndRE))){u.highlightFormatting&&(x.formatting="code-block");var fe;return _e||(fe=ie(x)),x.localMode=x.localState=null,x.block=de,x.f=j,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,_e?ne(E,x,x.block):fe}else return x.localMode?x.localMode.token(E,x.localState):(E.skipToEnd(),m.code)}function ie(E){var x=[];if(E.formatting){x.push(m.formatting),typeof E.formatting=="string"&&(E.formatting=[E.formatting]);for(var oe=0;oe<E.formatting.length;oe++)x.push(m.formatting+"-"+E.formatting[oe]),E.formatting[oe]==="header"&&x.push(m.formatting+"-"+E.formatting[oe]+"-"+E.header),E.formatting[oe]==="quote"&&(!u.maxBlockquoteDepth||u.maxBlockquoteDepth>=E.quote?x.push(m.formatting+"-"+E.formatting[oe]+"-"+E.quote):x.push("error"))}if(E.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(E.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(E.linkHref?x.push(m.linkHref,"url"):(E.strong&&x.push(m.strong),E.em&&x.push(m.em),E.strikethrough&&x.push(m.strikethrough),E.emoji&&x.push(m.emoji),E.linkText&&x.push(m.linkText),E.code&&x.push(m.code),E.image&&x.push(m.image),E.imageAltText&&x.push(m.imageAltText,"link"),E.imageMarker&&x.push(m.imageMarker)),E.header&&x.push(m.header,m.header+"-"+E.header),E.quote&&(x.push(m.quote),!u.maxBlockquoteDepth||u.maxBlockquoteDepth>=E.quote?x.push(m.quote+"-"+E.quote):x.push(m.quote+"-"+u.maxBlockquoteDepth)),E.list!==!1){var _e=(E.listStack.length-1)%3;_e?_e===1?x.push(m.list2):x.push(m.list3):x.push(m.list1)}return E.trailingSpaceNewLine?x.push("trailing-space-new-line"):E.trailingSpace&&x.push("trailing-space-"+(E.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function Pe(E,x){if(E.match(D,!0))return ie(x)}function j(E,x){var oe=x.text(E,x);if(typeof oe<"u")return oe;if(x.list)return x.list=null,ie(x);if(x.taskList){var _e=E.match(L,!0)[1]===" ";return _e?x.taskOpen=!0:x.taskClosed=!0,u.highlightFormatting&&(x.formatting="task"),x.taskList=!1,ie(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&E.match(/^#+$/,!0))return u.highlightFormatting&&(x.formatting="header"),ie(x);var Z=E.next();if(x.linkTitle){x.linkTitle=!1;var fe=Z;Z==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ke="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(E.match(new RegExp(ke),!0))return m.linkHref}if(Z==="`"){var Le=x.formatting;u.highlightFormatting&&(x.formatting="code"),E.eatWhile("`");var ct=E.current().length;if(x.code==0&&(!x.quote||ct==1))return x.code=ct,ie(x);if(ct==x.code){var we=ie(x);return x.code=0,we}else return x.formatting=Le,ie(x)}else if(x.code)return ie(x);if(Z==="\\"&&(E.next(),u.highlightFormatting)){var Re=ie(x),Ke=m.formatting+"-escape";return Re?Re+" "+Ke:Ke}if(Z==="!"&&E.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,u.highlightFormatting&&(x.formatting="image"),ie(x);if(Z==="["&&x.imageMarker&&E.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,u.highlightFormatting&&(x.formatting="image"),ie(x);if(Z==="]"&&x.imageAltText){u.highlightFormatting&&(x.formatting="image");var Re=ie(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=w,Re}if(Z==="["&&!x.image)return x.linkText&&E.match(/^.*?\]/)||(x.linkText=!0,u.highlightFormatting&&(x.formatting="link")),ie(x);if(Z==="]"&&x.linkText){u.highlightFormatting&&(x.formatting="link");var Re=ie(x);return x.linkText=!1,x.inline=x.f=E.match(/\(.*?\)| ?\[.*?\]/,!1)?w:j,Re}if(Z==="<"&&E.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=Q,u.highlightFormatting&&(x.formatting="link");var Re=ie(x);return Re?Re+=" ":Re="",Re+m.linkInline}if(Z==="<"&&E.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=Q,u.highlightFormatting&&(x.formatting="link");var Re=ie(x);return Re?Re+=" ":Re="",Re+m.linkEmail}if(u.xml&&Z==="<"&&E.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ft=E.string.indexOf(">",E.pos);if(ft!=-1){var Pt=E.string.substring(E.start,ft);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Pt)&&(x.md_inside=!0)}return E.backUp(1),x.htmlState=r.startState(f),ne(E,x,Oe)}if(u.xml&&Z==="<"&&E.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(Z==="*"||Z==="_"){for(var dt=1,ht=E.pos==1?" ":E.string.charAt(E.pos-2);dt<3&&E.eat(Z);)dt++;var gt=E.peek()||" ",Kt=!/\s/.test(gt)&&(!N.test(gt)||/\s/.test(ht)||N.test(ht)),be=!/\s/.test(ht)&&(!N.test(ht)||/\s/.test(gt)||N.test(gt)),St=null,Vt=null;if(dt%2&&(!x.em&&Kt&&(Z==="*"||!be||N.test(ht))?St=!0:x.em==Z&&be&&(Z==="*"||!Kt||N.test(gt))&&(St=!1)),dt>1&&(!x.strong&&Kt&&(Z==="*"||!be||N.test(ht))?Vt=!0:x.strong==Z&&be&&(Z==="*"||!Kt||N.test(gt))&&(Vt=!1)),Vt!=null||St!=null){u.highlightFormatting&&(x.formatting=St==null?"strong":Vt==null?"em":"strong em"),St===!0&&(x.em=Z),Vt===!0&&(x.strong=Z);var we=ie(x);return St===!1&&(x.em=!1),Vt===!1&&(x.strong=!1),we}}else if(Z===" "&&(E.eat("*")||E.eat("_"))){if(E.peek()===" ")return ie(x);E.backUp(1)}if(u.strikethrough){if(Z==="~"&&E.eatWhile(Z)){if(x.strikethrough){u.highlightFormatting&&(x.formatting="strikethrough");var we=ie(x);return x.strikethrough=!1,we}else if(E.match(/^[^\s]/,!1))return x.strikethrough=!0,u.highlightFormatting&&(x.formatting="strikethrough"),ie(x)}else if(Z===" "&&E.match("~~",!0)){if(E.peek()===" ")return ie(x);E.backUp(2)}}if(u.emoji&&Z===":"&&E.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,u.highlightFormatting&&(x.formatting="emoji");var On=ie(x);return x.emoji=!1,On}return Z===" "&&(E.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),ie(x)}function Q(E,x){var oe=E.next();if(oe===">"){x.f=x.inline=j,u.highlightFormatting&&(x.formatting="link");var _e=ie(x);return _e?_e+=" ":_e="",_e+m.linkInline}return E.match(/^[^>]+/,!0),m.linkInline}function w(E,x){if(E.eatSpace())return null;var oe=E.next();return oe==="("||oe==="["?(x.f=x.inline=G(oe==="("?")":"]"),u.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,ie(x)):"error"}var J={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function G(E){return function(x,oe){var _e=x.next();if(_e===E){oe.f=oe.inline=j,u.highlightFormatting&&(oe.formatting="link-string");var Z=ie(oe);return oe.linkHref=!1,Z}return x.match(J[E]),oe.linkHref=!0,ie(oe)}}function A(E,x){return E.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=M,E.next(),u.highlightFormatting&&(x.formatting="link"),x.linkText=!0,ie(x)):V(E,x,j)}function M(E,x){if(E.match("]:",!0)){x.f=x.inline=K,u.highlightFormatting&&(x.formatting="link");var oe=ie(x);return x.linkText=!1,oe}return E.match(/^([^\]\\]|\\.)+/,!0),m.linkText}function K(E,x){return E.eatSpace()?null:(E.match(/^[^\s]+/,!0),E.peek()===void 0?x.linkTitle=!0:E.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),x.f=x.inline=j,m.linkHref+" url")}var he={startState:function(){return{f:de,prevLine:{stream:null},thisLine:{stream:null},block:de,htmlState:null,indentation:0,inline:j,text:Pe,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(E){return{f:E.f,prevLine:E.prevLine,thisLine:E.thisLine,block:E.block,htmlState:E.htmlState&&r.copyState(f,E.htmlState),indentation:E.indentation,localMode:E.localMode,localState:E.localMode?r.copyState(E.localMode,E.localState):null,inline:E.inline,text:E.text,formatting:!1,linkText:E.linkText,linkTitle:E.linkTitle,linkHref:E.linkHref,code:E.code,em:E.em,strong:E.strong,strikethrough:E.strikethrough,emoji:E.emoji,header:E.header,setext:E.setext,hr:E.hr,taskList:E.taskList,list:E.list,listStack:E.listStack.slice(0),quote:E.quote,indentedCode:E.indentedCode,trailingSpace:E.trailingSpace,trailingSpaceNewLine:E.trailingSpaceNewLine,md_inside:E.md_inside,fencedEndRE:E.fencedEndRE}},token:function(E,x){if(x.formatting=!1,E!=x.thisLine.stream){if(x.header=0,x.hr=!1,E.match(/^\s*$/,!0))return se(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:E},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=Oe)){var oe=E.match(/^\s*/,!0)[0].replace(/\t/g,H).length;if(x.indentation=oe,x.indentationDiff=null,oe>0)return null}}return x.f(E,x)},innerMode:function(E){return E.block==Oe?{state:E.htmlState,mode:f}:E.localState?{state:E.localState,mode:E.localMode}:{state:E,mode:he}},indent:function(E,x,oe){return E.block==Oe&&f.indent?f.indent(E.htmlState,x,oe):E.localState&&E.localMode.indent?E.localMode.indent(E.localState,x,oe):r.Pass},blankLine:se,getType:ie,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return he},"xml"),r.defineMIME("text/markdown","markdown"),r.defineMIME("text/x-markdown","markdown")})})();const Yp={name:"DebugTab",components:{codemirror:za.codemirror,FilePdfViewer:Xa,OutputViewer:Hl},props:{selectedSpan:{type:Object,required:!0},selectedSpanId:{type:String,required:!0}},data(){return{debugForm:{params:[],systemContent:"",userContent:""},debugSubmitting:!1,debugResponse:null,responsePreview:null,debugResponseIsError:!1,debugResponseKey:0,debugMarkdownKey:0,originalInputs:null,hasImageUrl:!1,submitImage:!0,sendFile:!0,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},cmOptionsMarkdown:{tabSize:2,mode:"markdown",theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!1,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},tokenCalculating:!1,promptTokensResult:null,tokenCounterEnabled:!1}},computed:{promptTokensTableData(){if(!this.promptTokensResult)return[];const l=this.promptTokensResult;return[{key:"debug.specialTokens",value:l.special_tokens||"0"},{key:"debug.systemTokens",value:l.system_tokens||"0"},{key:"debug.userTokens",value:l.user_tokens||"0"},{key:"debug.assistantTokens",value:l.assistant_tokens||"0"},{key:"debug.textTokens",value:l.text_tokens||"0"}].map(r=>({name:this.$t(r.key),value:r.value})).filter(r=>r.value!=="0"&&r.value!==0)},rawInputs(){var l,n,r;return(r=(n=(l=this.selectedSpan)==null?void 0:l.parsedContent)==null?void 0:n.attributes)==null?void 0:r["langsword.spanInputs"]},targetUrl(){var n,r;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.attributes;return l&&l["url.full"]?l["url.full"]:null},clientHasFileInput(){var n;let l=!1;return this.originalInputs&&Object.keys(this.originalInputs).forEach(r=>{r.startsWith("__file__")&&(l=!0)}),((n=this.selectedSpan)==null?void 0:n.type)==="CLIENT"&&l}},watch:{selectedSpanId:{immediate:!0,handler(l,n){l&&l!==n&&this.$nextTick(()=>{this.initDebugForm()})}},"selectedSpan.parsedContent":{deep:!0,handler(){this.selectedSpan&&this.selectedSpanId&&this.$nextTick(()=>{this.initDebugForm()})}}},mounted(){this.selectedSpan&&this.selectedSpanId&&this.$nextTick(()=>{this.initDebugForm()}),this.fetchTracingSetting()},methods:{getMessageRoleLabel(l){const n={system:"debug.systemRole",user:"debug.userRole",assistant:"debug.assistantRole"};return n[l]?this.$t(n[l]):l},copyContent(l){const n=l==="system"?this.debugForm.systemContent:this.debugForm.userContent;Bi(n,this)},handleOutputCopy(l){Bi(l,this)},initDebugForm(){var n,r;if(!this.selectedSpan)return;let l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.inputs;if(!l&&this.rawInputs)try{l=typeof this.rawInputs=="string"?JSON.parse(this.rawInputs):this.rawInputs}catch(o){console.error("Failed to parse rawInputs:",o);return}if(!l){console.warn("No inputs found for span:",this.selectedSpanId);return}if(this.originalInputs=JSON.parse(JSON.stringify(l)),this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="EMBEDDING"){this.debugForm.params=[],this.debugForm.systemContent="",this.debugForm.userContent="";let o=!1;this.originalInputs&&Object.keys(this.originalInputs).forEach(u=>{u.startsWith("__file__")&&(o=!0)}),this.sendFile=o,Object.keys(l).forEach(u=>{if(!u.startsWith("__file__")){const f=l[u];let p="";typeof f=="string"?p=f:typeof f=="boolean"||typeof f=="number"?p=String(f):p=JSON.stringify(f),this.debugForm.params.push({key:u,value:p})}})}else if(this.selectedSpan.type==="CHAT_MODEL")if(this.debugForm.params=[],this.hasImageUrl=!1,this.submitImage=!0,Object.keys(l).forEach(o=>{if(o!=="messages"){const u=l[o];let f="";typeof u=="string"?f=u:typeof u=="boolean"||typeof u=="number"?f=String(u):f=JSON.stringify(u),this.debugForm.params.push({key:o,value:f})}}),l.messages&&Array.isArray(l.messages)){const o=l.messages.find(f=>f.role==="system"),u=l.messages.find(f=>f.role==="user");if(o&&o.content?this.debugForm.systemContent=typeof o.content=="string"?o.content:"":this.debugForm.systemContent="",u&&u.content)if(Array.isArray(u.content)){const f=u.content.filter(y=>y.type==="text"&&y.text).map(y=>y.text);this.debugForm.userContent=f.join(`
|
|
79
|
-
`);const p=u.content.some(y=>y.type==="image_url");this.hasImageUrl=p}else typeof u.content=="string"?this.debugForm.userContent=u.content:this.debugForm.userContent="";else this.debugForm.userContent=""}else this.debugForm.systemContent="",this.debugForm.userContent="";this.debugResponse=null,this.debugResponseIsError=!1,this.promptTokensResult=null,this.$nextTick(()=>{this.$refs.systemContentEditor&&this.$refs.systemContentEditor.codemirror&&this.$refs.systemContentEditor.codemirror.setValue(this.debugForm.systemContent||""),this.$refs.userContentEditor&&this.$refs.userContentEditor.codemirror&&this.$refs.userContentEditor.codemirror.setValue(this.debugForm.userContent||"")})},addDebugParam(){this.debugForm.params.push({key:"",value:""})},removeDebugParam(l){this.debugForm.params.splice(l,1)},handleDebugParamChange(){},resetDebugForm(){this.initDebugForm()},parseParamValue(l){if(l==="true"||l==="false")return l==="true";if(l==="")return"";{const n=Number(l);return!isNaN(n)&&isFinite(n)?n:l}},buildRequestHeaders(l){const n={};let r=null;const o=Object.keys(l).find(u=>u.toLowerCase()==="x-target-url");return o?(r=l[o],delete l[o]):this.targetUrl&&(r=this.targetUrl),r&&(n["X-Target-Url"]=r),n},handleDebugResponse(l){console.log("debug response:",l),this.debugResponse=l.original_response?JSON.parse(l.original_response):l,this.responsePreview=l.response_preview,this.debugResponseIsError=!1,this.$nextTick(()=>{this.debugResponseKey++})},handleDebugError(l){if(console.error("Debug request failed:",l),l.response&&l.response.data!==void 0){const n=l.response.data;this.debugResponse=typeof n=="object"&&n!==null?n:{_raw:n},this.debugResponseIsError=!0,this.$nextTick(()=>{this.debugResponseKey++})}else l.response&&l.response.data===void 0&&(this.debugResponse={_status:l.response.status,_statusText:l.response.statusText},this.debugResponseIsError=!0,this.$nextTick(()=>{this.debugResponseKey++}))},async submitDebugRequest(l){const n=this.buildRequestHeaders(l),r=await kt.debugTrace(l,n);this.handleDebugResponse(r)},async submitDebugClient(){if(!(!this.selectedSpan||!this.originalInputs)){this.debugSubmitting=!0;try{const l={};this.sendFile&&this.originalInputs&&Object.keys(this.originalInputs).forEach(n=>{n.startsWith("__file__")&&this.originalInputs[n]&&(l[n]=this.originalInputs[n])}),this.debugForm.params.forEach(n=>{if(n.key&&n.key.trim()){const r=n.value?n.value.trim():"";l[n.key]=this.parseParamValue(r)}}),await this.submitDebugRequest(l)}catch(l){this.handleDebugError(l)}finally{this.debugSubmitting=!1}}},async submitDebugChatModel(){if(!(!this.selectedSpan||!this.originalInputs)){this.debugSubmitting=!0;try{const l=JSON.parse(JSON.stringify(this.originalInputs));if(this.debugForm.params.forEach(n=>{if(n.key&&n.key.trim()){const r=n.value?n.value.trim():"";l[n.key]=this.parseParamValue(r)}}),l.messages&&Array.isArray(l.messages)){const n=l.messages.find(o=>o.role==="system");n&&(n.content=this.debugForm.systemContent||"");const r=l.messages.find(o=>o.role==="user");if(r){const o=this.originalInputs.messages.find(f=>f.role==="user");if(o&&Array.isArray(o.content)){const f=[];this.submitImage&&Array.isArray(r.content)&&r.content.forEach(p=>{p.type==="image_url"&&f.push(p)}),this.debugForm.userContent&&this.debugForm.userContent.trim()&&f.push({type:"text",text:this.debugForm.userContent}),r.content=f.length>0?f:this.debugForm.userContent||""}else r.content=this.debugForm.userContent||""}}await this.submitDebugRequest(l)}catch(l){this.handleDebugError(l)}finally{this.debugSubmitting=!1}}},async fetchTracingSetting(){try{const l=await kt.getSetting();this.tokenCounterEnabled=(l==null?void 0:l.token_counter_enabled)==="true"}catch{this.tokenCounterEnabled=!1}},async calculatePromptTokens(){if(!this.selectedSpan||this.selectedSpan.type!=="CHAT_MODEL")return;const l=[];if(this.debugForm.systemContent&&this.debugForm.systemContent.trim()&&l.push({role:"system",content:this.debugForm.systemContent.trim()}),this.debugForm.userContent&&this.debugForm.userContent.trim()&&l.push({role:"user",content:this.debugForm.userContent.trim()}),l.length===0){this.$message.warning("请至少填写系统提示词或用户提示词");return}const n=this.debugForm.params.find(o=>o.key&&o.key.trim().toLowerCase()==="model"),r={messages:l};n&&n.value&&n.value.trim()&&(r.model=n.value.trim()),this.tokenCalculating=!0;try{const o=await kt.getPromptTokens(r);this.promptTokensResult=o}catch(o){console.error("Token calculation failed:",o);let u="未知错误";if(o.response&&o.response.data){const f=o.response.data;typeof f=="object"&&f!==null&&f.message?u=f.message:o.message&&(u=o.message)}else o.message&&(u=o.message);this.$message.error("Token计算失败: "+u)}finally{this.tokenCalculating=!1}}}};var Jp=function(){var n=this,r=n._self._c;return r("div",{staticClass:"debug-content"},[n.selectedSpan.type==="CLIENT"||n.selectedSpan.type==="EMBEDDING"?r("div",{staticClass:"debug-client-form"},[r("el-form",{attrs:{model:n.debugForm,"label-width":"60px",size:"small"}},[n._l(n.debugForm.params,function(o,u){return r("div",{key:u,staticClass:"debug-form-row"},[r("el-form-item",{attrs:{label:`${n.$t("debug.paramLabel")} ${u+1}`}},[r("el-row",{attrs:{gutter:10,type:"flex",align:"middle"}},[r("el-col",{attrs:{span:8}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramName")},on:{input:n.handleDebugParamChange},model:{value:o.key,callback:function(f){n.$set(o,"key",f)},expression:"item.key"}})],1),r("el-col",{attrs:{span:14}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramValue")},on:{input:n.handleDebugParamChange},model:{value:o.value,callback:function(f){n.$set(o,"value",f)},expression:"item.value"}})],1),r("el-col",{attrs:{span:2}},[r("el-button",{staticClass:"delete-param-btn",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(f){return n.removeDebugParam(u)}}})],1)],1)],1)],1)}),n.clientHasFileInput?r("el-form-item",[r("el-checkbox",{model:{value:n.sendFile,callback:function(o){n.sendFile=o},expression:"sendFile"}},[n._v(n._s(n.$t("debug.sendFile")))])],1):n._e(),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:n.addDebugParam}},[n._v(n._s(n.$t("debug.addParam")))]),r("el-button",{attrs:{type:"warning",icon:"el-icon-refresh",size:"small"},on:{click:n.resetDebugForm}},[n._v(n._s(n.$t("debug.reset")))]),r("el-button",{attrs:{type:"success",icon:"el-icon-check",size:"small",loading:n.debugSubmitting},on:{click:n.submitDebugClient}},[n._v(n._s(n.$t("debug.submit")))])],1)],2),n.debugResponse!==null?r("div",{staticClass:"debug-response"},[r("OutputViewer",{attrs:{value:n.debugResponse,"show-raw-toggle":!0,"is-error-response":n.debugResponseIsError,"preview-markdown":n.responsePreview,"support-file-elements":!0,title:n.$t("debug.responseResult"),"content-key":`${n.selectedSpanId}-${n.debugResponseKey}`},on:{copy:n.handleOutputCopy}})],1):n._e()],1):n._e(),n.selectedSpan.type==="CHAT_MODEL"?r("div",{staticClass:"debug-chat-model-form"},[r("el-form",{attrs:{model:n.debugForm,"label-width":"60px",size:"small"}},[r("el-form-item",{scopedSlots:n._u([{key:"label",fn:function(){return[r("span",[n._v(n._s(n.$t("debug.systemPrompt")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(o){return n.copyContent("system")}}})],1)]},proxy:!0}],null,!1,671448622)},[r("codemirror",{key:`debug-system-${n.selectedSpanId}-${n.debugMarkdownKey}`,ref:"systemContentEditor",staticClass:"code-editor-wrapper markdown-editor",attrs:{options:n.cmOptionsMarkdown},model:{value:n.debugForm.systemContent,callback:function(o){n.$set(n.debugForm,"systemContent",o)},expression:"debugForm.systemContent"}})],1),r("el-form-item",{scopedSlots:n._u([{key:"label",fn:function(){return[r("span",[n._v(n._s(n.$t("debug.userPrompt")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(o){return n.copyContent("user")}}})],1)]},proxy:!0}],null,!1,1846549358)},[r("codemirror",{key:`debug-user-${n.selectedSpanId}-${n.debugMarkdownKey}`,ref:"userContentEditor",staticClass:"code-editor-wrapper markdown-editor",attrs:{options:n.cmOptionsMarkdown},model:{value:n.debugForm.userContent,callback:function(o){n.$set(n.debugForm,"userContent",o)},expression:"debugForm.userContent"}})],1),n.selectedSpan.type==="CHAT_MODEL"&&n.hasImageUrl?r("el-form-item",{attrs:{label:n.$t("debug.submitImage")}},[r("el-switch",{attrs:{"active-text":n.$t("debug.yes"),"inactive-text":n.$t("debug.no")},model:{value:n.submitImage,callback:function(o){n.submitImage=o},expression:"submitImage"}})],1):n._e(),n._l(n.debugForm.params,function(o,u){return r("div",{key:u,staticClass:"debug-form-row"},[r("el-form-item",{attrs:{label:`${n.$t("debug.paramLabel")} ${u+1}`}},[r("el-row",{attrs:{gutter:10,type:"flex",align:"middle"}},[r("el-col",{attrs:{span:8}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramName")},on:{input:n.handleDebugParamChange},model:{value:o.key,callback:function(f){n.$set(o,"key",f)},expression:"item.key"}})],1),r("el-col",{attrs:{span:14}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramValue")},on:{input:n.handleDebugParamChange},model:{value:o.value,callback:function(f){n.$set(o,"value",f)},expression:"item.value"}})],1),r("el-col",{attrs:{span:2}},[r("el-button",{staticClass:"delete-param-btn",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(f){return n.removeDebugParam(u)}}})],1)],1)],1)],1)}),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:n.addDebugParam}},[n._v(n._s(n.$t("debug.addParam")))]),r("el-button",{attrs:{type:"warning",icon:"el-icon-refresh",size:"small"},on:{click:n.resetDebugForm}},[n._v(n._s(n.$t("debug.reset")))]),r("el-button",{attrs:{type:"success",icon:"el-icon-check",size:"small",loading:n.debugSubmitting},on:{click:n.submitDebugChatModel}},[n._v(n._s(n.$t("debug.submit")))]),n.tokenCounterEnabled?r("el-tooltip",{attrs:{content:n.$t("debug.calculateTokensTooltip"),placement:"top"}},[r("el-button",{attrs:{type:"info",icon:"el-icon-cpu",size:"small",loading:n.tokenCalculating},on:{click:n.calculatePromptTokens}},[n._v(n._s(n.$t("debug.calculateTokens")))])],1):n._e()],1)],2),n.promptTokensResult!==null?r("div",{staticClass:"token-result-section"},[r("div",{staticClass:"token-result-header"},[n._v(n._s(n.$t("debug.tokenResultTitle")))]),r("el-table",{attrs:{data:n.promptTokensTableData,size:"small",border:""}},[r("el-table-column",{attrs:{prop:"name",label:n.$t("debug.tokenType"),width:"140"}}),r("el-table-column",{attrs:{prop:"value",label:n.$t("debug.tokenCount")}})],1)],1):n._e(),n.debugResponse!==null?r("div",{staticClass:"debug-response"},[r("OutputViewer",{attrs:{value:n.debugResponse,"show-raw-toggle":!0,"is-error-response":n.debugResponseIsError,"support-file-elements":!0,title:n.$t("debug.responseResult"),"content-key":`${n.selectedSpanId}-${n.debugResponseKey}`},on:{copy:n.handleOutputCopy}})],1):n._e()],1):n._e()])},Qp=[],Zp=vn(Yp,Jp,Qp,!1,null,"8d08f36c");const eg=Zp.exports;Se.setOptions({breaks:!0});const tg={name:"TraceDetailDrawer",components:{TraceSpanTree:Va,DebugTab:eg,codemirror:za.codemirror,FilePdfViewer:Xa,OutputViewer:Hl},props:{visible:{type:Boolean,default:!1},currentTraceId:{type:String,default:null},traceInfo:{type:Object,default:()=>({})},spans:{type:Array,default:()=>[]},filteredSpans:{type:Array,default:()=>[]},selectedSpanId:{type:String,default:null},selectedSpan:{type:Object,default:null},loading:{type:Boolean,default:!1},spanHasNextPage:{type:Boolean,default:!1},spanLoadMoreLoading:{type:Boolean,default:!1},spanHasEvents:{type:Boolean,default:null},spanPageSize:{type:Number,default:100},traceStatusList:{type:Array,default:()=>[]},traceSpanTypeList:{type:Array,default:()=>[]},spanTypeFilter:{type:String,default:null}},data(){return{localVisible:this.visible,spanSearchQuery:"",activeTab:"io",activeCollapse:["inputs","outputs"],messageCollapse:[],rawIoCollapse:["rawInputs","rawOutputs"],rawInputsKey:0,rawOutputsKey:0,eventsCollapse:[],eventsKey:0,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},cmOptionsJava:{tabSize:4,mode:"text/x-java",theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:4,styleActiveLine:!0,autoRefresh:!0},viewerOptions:{inline:!1,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,keyboard:!0,zIndex:9999}}},computed:{drawerTitle(){let l=this.traceInfo.trace_name;return l||(l=this.traceInfo.trace_id),l?this.$t("trace.traceDetail")+": "+l:this.$t("trace.traceDetail")},traceStartTime(){return this.spans.length===0?0:Math.min(...this.spans.map(l=>l.start_time_unix_nano))},traceEndTime(){return this.spans.length===0?0:Math.max(...this.spans.map(l=>l.end_time_unix_nano))},hasInputs(){var n,r,o,u;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.request_preview;return l!=null&&String(l).trim()!==""?!0:((u=(o=this.selectedSpan)==null?void 0:o.parsedContent)==null?void 0:u.inputs)!==void 0},hasOutputs(){var n,r,o,u;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.response_preview;return l!=null&&String(l).trim()!==""?!0:((u=(o=this.selectedSpan)==null?void 0:o.parsedContent)==null?void 0:u.outputs)!==void 0},showIOTab(){var k,S,F,L,W,z,D,$,I,N;if(!this.selectedSpan)return!1;const l=(S=(k=this.selectedSpan)==null?void 0:k.parsedContent)==null?void 0:S.request_preview,n=(L=(F=this.selectedSpan)==null?void 0:F.parsedContent)==null?void 0:L.response_preview,r=l!=null&&String(l).trim()!=="",o=n!=null&&String(n).trim()!=="";if(r||o)return!0;if(!(this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="EMBEDDING"||this.selectedSpan.type==="CHAT_MODEL"))return!1;const f=(D=(z=(W=this.selectedSpan)==null?void 0:W.parsedContent)==null?void 0:z.attributes)==null?void 0:D["langsword.spanInputs"],p=(N=(I=($=this.selectedSpan)==null?void 0:$.parsedContent)==null?void 0:I.attributes)==null?void 0:N["langsword.spanOutputs"],y=f!=null&&f!=="",m=p!=null&&p!=="";return y||m},attributesData(){var n,r;if(!((r=(n=this.selectedSpan)==null?void 0:n.parsedContent)!=null&&r.attributes))return[];const l=["http.response.body.size","http.request.body.size","http.request.header.Content-Length","http.response.header.content-length","http.request.header.content-length","http.response.header.Content-Length"];return Object.entries(this.selectedSpan.parsedContent.attributes).filter(([o])=>!o.startsWith("langsword.span")).filter(([,o])=>!(o===0||o==="0"||o==null||o===""||typeof o=="string"&&o.trim()==="")).map(([o,u])=>{let f;return l.includes(o)?f=this.formatBytes(u):typeof u=="string"?f=u:f=JSON.stringify(u,null,2),{key:o,value:f}}).sort((o,u)=>o.key.localeCompare(u.key))},rawInputs(){var l,n,r;return(r=(n=(l=this.selectedSpan)==null?void 0:l.parsedContent)==null?void 0:n.attributes)==null?void 0:r["langsword.spanInputs"]},rawOutputs(){var l,n,r;return(r=(n=(l=this.selectedSpan)==null?void 0:l.parsedContent)==null?void 0:n.attributes)==null?void 0:r["langsword.spanOutputs"]},clientInputsFileOnly(){var n,r,o;if(((n=this.selectedSpan)==null?void 0:n.type)!=="CLIENT")return!1;const l=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.inputs;return l&&(this.extractFileRefs(l).length>0||this.extractImageBase64Refs(l).length>0)},clientOutputsFileOnly(){var n,r,o;if(((n=this.selectedSpan)==null?void 0:n.type)!=="CLIENT")return!1;const l=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.outputs;return l&&(this.extractFileRefs(l).length>0||this.extractImageBase64Refs(l).length>0)},hasEvents(){var n,r,o;if(((n=this.selectedSpan)==null?void 0:n.has_events)!==void 0)return this.selectedSpan.has_events===!0;const l=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.events;return l&&Array.isArray(l)&&l.length>0},spanEvents(){var n,r;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.events;return!l||!Array.isArray(l)?[]:l},showDebugTab(){var o,u,f;if(!this.selectedSpan||!(this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="EMBEDDING"||this.selectedSpan.type==="CHAT_MODEL"))return!1;const n=(f=(u=(o=this.selectedSpan)==null?void 0:o.parsedContent)==null?void 0:u.attributes)==null?void 0:f["langsword.spanInputs"];return n!=null&&n!==""}},watch:{visible(l){this.localVisible=l,l||(this.spanSearchQuery="")},localVisible(l){this.$emit("update:visible",l)},activeTab(l){l==="raw"&&this.$nextTick(()=>{this.rawInputsKey++,this.rawOutputsKey++}),l==="events"&&this.$nextTick(()=>{this.eventsKey++})},selectedSpan(){var o;if(!this.selectedSpan)return;const l=this.selectedSpan.has_events===!0||((o=this.selectedSpan.parsedContent)==null?void 0:o.events)&&Array.isArray(this.selectedSpan.parsedContent.events)&&this.selectedSpan.parsedContent.events.length>0,n=[];this.showIOTab&&n.push("io","raw"),this.showDebugTab&&n.push("debug"),n.push("attributes"),l&&n.push("events");let r="attributes";this.showIOTab&&(r="io"),n.includes(r)?this.activeTab=r:this.activeTab="attributes",this.$nextTick(()=>{this.updateCollapseStates(),this.activeTab==="raw"&&(this.rawInputsKey++,this.rawOutputsKey++),this.activeTab==="events"&&this.eventsKey++})}},methods:{renderMarkdown(l){return l?Se(String(l)):""},copyToClipboard(l){Bi(l,this)},copyMessageContent(l){let n="";if(typeof l=="string")n=l;else if(Array.isArray(l)){const r=l.filter(o=>o&&o.type==="text"&&o.text).map(o=>o.text);n=r.length>0?r.join(`
|
|
80
|
-
`):this.formatRawJson(l)}else n=this.formatRawJson(l);this.copyToClipboard(n)},formatBytes(l){const n=typeof l=="number"?l:Number(l);if(!Number.isFinite(n))return typeof l=="string"?l:JSON.stringify(l,null,2);const r=n<0?"-":"";let o=Math.abs(n);const u=["B","K","M","G","T","P","E"];if(o<1024)return`${r}${Math.round(o)}B`;let f=0;for(;o>=1024&&f<u.length-1;)o/=1024,f++;return`${r}${o.toFixed(2)}${u[f]}`},handleClose(l){this.$emit("close"),l&&typeof l=="function"&&l()},handleSpanSearch(){this.$emit("span-search",this.spanSearchQuery)},handleSpanTypeFilterChange(l){this.$emit("update:span-type-filter",l)},handleHasEventsChange(l){this.$emit("update:span-has-events",l?!0:null)},handleSpanSelect(l){this.$emit("span-select",l),this.$nextTick(()=>{this.updateCollapseStates()})},updateCollapseStates(){var r,o,u,f,p;this.activeCollapse=["inputs","outputs"],(u=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.inputs)!=null&&u.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((y,m)=>`message-${m}`):this.messageCollapse=[],this.rawIoCollapse=["rawInputs","rawOutputs"];const l=(p=(f=this.selectedSpan)==null?void 0:f.parsedContent)==null?void 0:p.events;l&&Array.isArray(l)&&l.length>0?this.eventsCollapse=l.map((y,m)=>`event-${m}`):this.eventsCollapse=[]},parseContentData(l){const n={attributes:l.attributes||{},events:l.events||[],status:l.status||{}};if(l.inputs&&(n.inputs=l.inputs),l.outputs&&(n.outputs=l.outputs),l.request_preview!=null&&l.request_preview!==""&&(n.request_preview=l.request_preview),l.response_preview!=null&&l.response_preview!==""&&(n.response_preview=l.response_preview),n.attributes){const r=n.attributes["langsword.spanInputs"],o=n.attributes["langsword.spanOutputs"];if(r)try{n.inputs=typeof r=="string"?JSON.parse(r):r}catch{try{const f=r.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.inputs=JSON.parse(f)}catch{n.inputs=r}}if(o)try{n.outputs=typeof o=="string"?JSON.parse(o):o}catch{try{const f=o.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.outputs=JSON.parse(f)}catch{n.outputs=o}}}return n},getStatusType(l){if(!l)return"info";const n=l.toUpperCase();return n==="OK"||n==="SUCCESS"?"success":n==="ERROR"||n==="FAILED"?"danger":n==="WARNING"||n==="WARN"?"warning":"info"},getStatusLabel(l){if(!l)return"-";const n=this.traceStatusList.find(r=>r.value===l);return n?n.label:l},getTraceSpanTypeLabel(l){if(l==null||l==="")return"-";const n=this.traceSpanTypeList.find(r=>r.value===l);return n?n.label:l},formatNanoDuration(l){if(!l)return"-";const n=l/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`},formatTimestamp(l){if(!l)return"-";const n=typeof l=="string"?parseInt(l,10):l,r=new Date(n);return isNaN(r.getTime())?"-":r.toLocaleString("zh-CN")},formatEventTimestamp(l){if(!l)return"-";const n=l/1e6,r=new Date(n);return isNaN(r.getTime())?"-":r.toLocaleString("zh-CN")},getEventAttributesData(l){return!l||!l.attributes?[]:Object.entries(l.attributes).map(([n,r])=>({key:n,value:typeof r=="string"?r:JSON.stringify(r,null,2)}))},getOtherEventAttributes(l){if(!l||!l.attributes)return[];const n=["exception.type","exception.message","exception.stacktrace"];return Object.entries(l.attributes).filter(([r])=>!n.includes(r)).map(([r,o])=>({key:r,value:typeof o=="string"?o:JSON.stringify(o,null,2)}))},formatRawJson(l){if(!l)return"";if(typeof l=="string")try{const n=JSON.parse(l);return JSON.stringify(n,null,2)}catch{return l}return JSON.stringify(l,null,2)},getMessageIcon(l){return{user:"el-icon-user",assistant:"el-icon-service",system:"el-icon-setting"}[l]||"el-icon-document"},getMessageRoleLabel(l){const n={system:"debug.systemRole",user:"debug.userRole",assistant:"debug.assistantRole"};return n[l]?this.$t(n[l]):l},extractImagesFromObject(l,n=[],r=""){if(!(!l||typeof l!="object")){for(const[o,u]of Object.entries(l)){const f=r?`${r}.${o}`:o;typeof u=="string"&&u.trim()!==""?(u.startsWith("data:image/")||u.startsWith("/9j/")||u.startsWith("iVBOR")||u.startsWith("R0lGOD"))&&(n.push({path:f,value:u,label:o==="content"&&r?`${r.split(".").pop()}: ${o}`:o}),l[o]="[IMAGE_DATA]"):u&&typeof u=="object"&&!Array.isArray(u)?this.extractImagesFromObject(u,n,f):Array.isArray(u)&&u.forEach((p,y)=>{p&&typeof p=="object"&&this.extractImagesFromObject(p,n,`${f}[${y}]`)})}return n}},extractFileRefs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r.startsWith("__file__")&&o!=null?Array.isArray(o)?o.forEach(u=>{u!=null&&typeof u=="string"&&u.trim()!==""&&n.push(u.trim())}):typeof o=="string"&&o.trim()!==""&&n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractFileRefs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractFileRefs(u,n)});return n},extractImageBase64Refs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r==="image_base64"&&o!=null&&typeof o=="string"&&o.trim()!==""?n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractImageBase64Refs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractImageBase64Refs(u,n)});return n},getFileExtension(l){if(!l||typeof l!="string")return"";const n=l.lastIndexOf(".");return n>=0?l.slice(n+1).toLowerCase():""},buildFileElements(l,n="file"){const r=["jpg","jpeg","png","gif","webp","bmp","svg"],o=[];return l.forEach((u,f)=>{const p=this.getFileExtension(u),y=zi(u),m=decodeURIComponent(u.split("/").pop()||u);r.includes(p)?o.push({type:"file-image",downloadUrl:y,key:`${n}-image-${f}`}):p==="pdf"?o.push({type:"file-pdf",downloadUrl:y,key:`${n}-pdf-${f}`}):o.push({type:"file-download",downloadUrl:y,filename:m,key:`${n}-download-${f}`})}),o},renderStructuredContent(l,n=!1){const r=[];if(!l)return r;const o=this.extractFileRefs(l);if(o.length>0&&r.push(...this.buildFileElements(o,"file")),l.data&&Array.isArray(l.data.result))l.data.result.forEach((u,f)=>{u.image_base64&&u.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(u.image_base64),key:`result-page-${f}`,label:u.page_num!==void 0?`Page ${u.page_num}`:`Result ${f}`}),u.seals&&Array.isArray(u.seals)&&u.seals.forEach((p,y)=>{p.image_base64&&p.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(p.image_base64),key:`result-seal-${f}-${y}`,label:`印章文字: ${p.value||y}`})})});else{const u=this.extractImageBase64Refs(l);u.length>0&&u.forEach((f,p)=>{r.push({type:"image",url:this.formatBase64Image(f),key:`base64-image-${p}`})})}if(n)return r;try{if(Array.isArray(l))l.forEach((u,f)=>{var p;u&&typeof u=="object"?u.type==="text"&&u.text?r.push({type:"markdown",content:Se(u.text),key:`text-${f}`}):u.type==="image_url"&&((p=u.image_url)!=null&&p.url)?r.push({type:"image",url:u.image_url.url,key:`image-${f}`}):u.image_base64&&u.image_base64.trim()!==""?r.push({type:"image",url:this.formatBase64Image(u.image_base64),key:`base64-image-${f}`}):r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(u,null,2)+"\n```"),key:`json-${f}`}):r.push({type:"markdown",content:Se(String(u)),key:`text-${f}`})});else if(typeof l=="string")r.push({type:"markdown",content:Se(l),key:"text-0"});else if(typeof l=="object")if(l.data&&Array.isArray(l.data.result)){const u=JSON.parse(JSON.stringify(l)),f=[];u.data&&u.data.result&&u.data.result.forEach((p,y)=>{p.image_base64&&p.image_base64.trim()!==""&&(f.push({type:"page",image_base64:p.image_base64,page_num:p.page_num,label:p.page_num!==void 0?`Page ${p.page_num}`:`Result ${y}`}),p.image_base64="[BASE64_IMAGE_DATA]"),p.seals&&Array.isArray(p.seals)&&p.seals.forEach((m,k)=>{m.image_base64&&m.image_base64.trim()!==""&&(f.push({type:"seal",image_base64:m.image_base64,page_num:p.page_num,seal_index:k,seal_value:m.value,label:`印章文字: ${m.value||k}`}),m.image_base64="[BASE64_IMAGE_DATA]")})}),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(u,null,2)+"\n```"),key:"json-0"}),f.forEach((p,y)=>{r.push({type:"image",url:this.formatBase64Image(p.image_base64),key:`result-image-${y}`,label:p.label})})}else{const u=JSON.parse(JSON.stringify(l)),f=[];this.extractImagesFromObject(u,f),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(u,null,2)+"\n```"),key:"json-0"}),f.forEach((p,y)=>{r.push({type:"image",url:this.formatBase64Image(p.value),key:`extracted-image-${y}`,label:p.label})})}else r.push({type:"markdown",content:Se(String(l)),key:"text-0"})}catch(u){console.error("Error rendering content:",u),r.push({type:"markdown",content:Se("Error rendering content"),key:"error-0"})}return r},formatBase64Image(l){return l?l.startsWith("data:image")?l:l.startsWith("/9j/")?`data:image/jpeg;base64,${l}`:l.startsWith("iVBOR")?`data:image/png;base64,${l}`:l.startsWith("R0lGOD")?`data:image/gif;base64,${l}`:`data:image/jpeg;base64,${l}`:""},handleImageClick(l){Bl({options:this.viewerOptions,images:[l]})}}};var ng=function(){var o,u,f,p,y,m,k,S,F,L,W,z;var n=this,r=n._self._c;return r("el-drawer",{attrs:{visible:n.localVisible,"with-header":!0,title:n.drawerTitle,size:"90%",direction:"rtl","before-close":n.handleClose},on:{"update:visible":function(D){n.localVisible=D}}},[n.currentTraceId?r("div",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}],staticClass:"trace-detail-content",attrs:{"element-loading-text":"加载中..."}},[r("div",{staticClass:"trace-info-section"},[r("el-descriptions",{attrs:{column:3,border:""}},[r("el-descriptions-item",{attrs:{label:n.$t("trace.traceId")}},[n._v(n._s(n.traceInfo.trace_id))]),r("el-descriptions-item",{attrs:{label:n.$t("trace.status")}},[r("el-tag",{attrs:{type:n.getStatusType(n.traceInfo.status),size:"mini"}},[n._v(" "+n._s(n.getStatusLabel(n.traceInfo.status))+" ")])],1),r("el-descriptions-item",{attrs:{label:n.$t("trace.executionTime")}},[n._v(" "+n._s(n.formatNanoDuration(n.traceInfo.execution_time_ms))+" ")]),r("el-descriptions-item",{attrs:{label:n.$t("trace.timeCreated")}},[n._v(" "+n._s(n.formatTimestamp(n.traceInfo.timestamp_ms))+" ")]),r("el-descriptions-item",{attrs:{label:n.$t("trace.timeEnded")}},[n._v(" "+n._s(n.formatTimestamp(n.traceInfo.end_time_ms))+" ")]),r("el-descriptions-item",{attrs:{label:n.$t("trace.experimentName")}},[n._v(n._s(n.traceInfo.experiment_name))]),r("el-descriptions-item",{attrs:{label:n.$t("trace.traceType")}},[r("el-tag",{attrs:{size:"mini",type:"info"}},[n._v(n._s(n.getTraceSpanTypeLabel(n.traceInfo.trace_type)))])],1),r("el-descriptions-item",{attrs:{label:n.$t("trace.traceName"),span:2}},[n._v(" "+n._s(n.traceInfo.trace_name||"-")+" ")])],1)],1),r("el-divider"),r("el-row",{attrs:{gutter:20}},[r("el-col",{staticClass:"span-tree-col",attrs:{span:8}},[r("el-card",[r("div",{staticClass:"span-search-header",attrs:{slot:"header"},slot:"header"},[r("el-input",{staticClass:"span-search-input",attrs:{placeholder:n.$t("span.searchTree"),"prefix-icon":"el-icon-search",size:"small",clearable:""},on:{input:n.handleSpanSearch},model:{value:n.spanSearchQuery,callback:function(D){n.spanSearchQuery=D},expression:"spanSearchQuery"}}),r("el-select",{staticClass:"span-type-select",attrs:{value:n.spanTypeFilter,size:"small",clearable:"",placeholder:n.$t("trace.traceType")},on:{input:n.handleSpanTypeFilterChange}},n._l(n.traceSpanTypeList,function(D){return r("el-option",{key:D.value,attrs:{label:D.label,value:D.value}})}),1),r("el-checkbox",{attrs:{value:n.spanHasEvents===!0,size:"small"},on:{change:n.handleHasEventsChange}},[n._v(" "+n._s(n.$t("span.hasEvents"))+" ")])],1),r("TraceSpanTree",{attrs:{spans:n.filteredSpans,"selected-span-id":n.selectedSpanId,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.traceSpanTypeList},on:{"span-select":n.handleSpanSelect}}),n.spanHasNextPage?r("div",{staticClass:"span-load-more"},[r("el-button",{attrs:{type:"primary",size:"mini",loading:n.spanLoadMoreLoading},on:{click:function(D){return n.$emit("span-load-more")}}},[n._v(" 加载更多 ")]),r("el-select",{staticClass:"span-page-size-select",attrs:{value:n.spanPageSize,size:"mini"},on:{input:function(D){return n.$emit("update:span-page-size",D)}}},[r("el-option",{attrs:{label:1e3,value:1e3}}),r("el-option",{attrs:{label:2e3,value:2e3}}),r("el-option",{attrs:{label:5e3,value:5e3}}),r("el-option",{attrs:{label:1e4,value:1e4}})],1)],1):n._e()],1)],1),r("el-col",{staticClass:"span-detail-col",attrs:{span:16}},[r("el-card",[n.selectedSpan?r("div",{staticClass:"span-detail-content"},[r("el-tabs",{key:`tabs-${n.selectedSpanId}`,model:{value:n.activeTab,callback:function(D){n.activeTab=D},expression:"activeTab"}},[n.showIOTab?r("el-tab-pane",{attrs:{label:`${n.$t("trace.inputs")} / ${n.$t("trace.outputs")}`,name:"io"}},[r("div",{staticClass:"io-content"},[n.hasInputs?r("div",{staticClass:"io-section"},[r("el-collapse",{model:{value:n.activeCollapse,callback:function(D){n.activeCollapse=D},expression:"activeCollapse"}},[r("el-collapse-item",{attrs:{name:"inputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.inputs")))]),(o=n.selectedSpan.parsedContent)!=null&&o.request_preview||!((f=(u=n.selectedSpan.parsedContent)==null?void 0:u.inputs)!=null&&f.messages)?r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){var $;D.stopPropagation(),n.copyToClipboard(($=n.selectedSpan.parsedContent)!=null&&$.request_preview?n.selectedSpan.parsedContent.request_preview:n.formatRawJson(n.selectedSpan.parsedContent.inputs))}}})],1):n._e()],1),(p=n.selectedSpan.parsedContent)!=null&&p.request_preview?r("div",{staticClass:"structured-content preview-content"},[r("div",{staticClass:"content-element"},[r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(n.renderMarkdown(n.selectedSpan.parsedContent.request_preview))}})])]):n.clientInputsFileOnly?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.selectedSpan.parsedContent.inputs,!0),function(D){return r("div",{key:D.key,staticClass:"content-element"},[D.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(D.content)}}):D.type==="image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.url,alt:"content image"},on:{click:function($){return n.handleImageClick(D.url)}}})]):D.type==="file-image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.downloadUrl,alt:"content image"},on:{click:function($){return n.handleImageClick(D.downloadUrl)}}})]):D.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:D}})],1):D.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:D.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(D.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):(m=(y=n.selectedSpan.parsedContent)==null?void 0:y.inputs)!=null&&m.messages?r("div",{staticClass:"messages-section"},n._l(n.selectedSpan.parsedContent.inputs.messages,function(D,$){return r("div",{key:$,staticClass:"message-item"},[r("el-collapse",{model:{value:n.messageCollapse,callback:function(I){n.messageCollapse=I},expression:"messageCollapse"}},[r("el-collapse-item",{attrs:{name:`message-${$}`}},[r("template",{slot:"title"},[r("i",{staticClass:"message-icon",class:n.getMessageIcon(D.role)}),r("span",{staticClass:"message-role"},[n._v(n._s(n.getMessageRoleLabel(D.role)))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(I){return I.stopPropagation(),n.copyMessageContent(D.content)}}})],1)],1),r("div",{staticClass:"message-content"},[r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(D.content),function(I){return r("div",{key:I.key,staticClass:"content-element"},[I.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(I.content)}}):I.type==="image"?r("div",{staticClass:"image-content"},[I.label?r("div",{staticClass:"image-label"},[n._v(n._s(I.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:I.url,alt:"content image"},on:{click:function(N){return n.handleImageClick(I.url)}}})]):I.type==="file-image"?r("div",{staticClass:"image-content"},[I.label?r("div",{staticClass:"image-label"},[n._v(n._s(I.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:I.downloadUrl,alt:"content image"},on:{click:function(N){return n.handleImageClick(I.downloadUrl)}}})]):I.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:I}})],1):I.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:I.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(I.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0)])],2)],1)],1)}),0):(k=n.selectedSpan.parsedContent)!=null&&k.inputs?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.selectedSpan.parsedContent.inputs),function(D){return r("div",{key:D.key,staticClass:"content-element"},[D.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(D.content)}}):D.type==="image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.url,alt:"content image"},on:{click:function($){return n.handleImageClick(D.url)}}})]):D.type==="file-image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.downloadUrl,alt:"content image"},on:{click:function($){return n.handleImageClick(D.downloadUrl)}}})]):D.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:D}})],1):D.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:D.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(D.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):r("div",{staticClass:"empty-content"},[r("el-empty",{attrs:{description:n.$t("trace.noInputs"),"image-size":80}})],1)],2)],1)],1):n._e(),n.hasOutputs?r("div",{staticClass:"io-section"},[r("el-collapse",{model:{value:n.activeCollapse,callback:function(D){n.activeCollapse=D},expression:"activeCollapse"}},[r("el-collapse-item",{attrs:{name:"outputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.outputs")))]),(S=n.selectedSpan.parsedContent)!=null&&S.response_preview||!((L=(F=n.selectedSpan.parsedContent)==null?void 0:F.outputs)!=null&&L.choices)?r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){var $;D.stopPropagation(),n.copyToClipboard(($=n.selectedSpan.parsedContent)!=null&&$.response_preview?n.selectedSpan.parsedContent.response_preview:n.formatRawJson(n.selectedSpan.parsedContent.outputs))}}})],1):n._e()],1),((W=n.selectedSpan.parsedContent)==null?void 0:W.outputs)!==void 0?r("OutputViewer",{attrs:{value:n.selectedSpan.parsedContent.outputs,"preview-markdown":(z=n.selectedSpan.parsedContent)==null?void 0:z.response_preview,"file-only":n.clientOutputsFileOnly,"support-file-elements":!0,"show-raw-toggle":!1,"content-key":n.selectedSpanId},on:{copy:n.copyToClipboard}}):r("div",{staticClass:"empty-content"},[r("el-empty",{attrs:{description:n.$t("trace.noOutputs"),"image-size":80}})],1)],2)],1)],1):n._e(),!n.hasInputs&&!n.hasOutputs?r("div",{staticClass:"empty-io"},[r("el-empty",{attrs:{description:n.$t("trace.noIoData")}})],1):n._e()])]):n._e(),r("el-tab-pane",{attrs:{label:n.$t("trace.attributes"),name:"attributes"}},[r("el-table",{staticClass:"attributes-table",attrs:{data:n.attributesData,border:"",stripe:""}},[r("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"250"},scopedSlots:n._u([{key:"default",fn:function(D){return[r("el-tooltip",{attrs:{content:D.row.key,placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[r("span",{staticClass:"attribute-key"},[n._v(n._s(D.row.key))])])]}}],null,!1,688878823)}),r("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")},scopedSlots:n._u([{key:"default",fn:function(D){return[r("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[r("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[n._v(n._s(D.row.value))]),r("div",{staticClass:"attribute-value"},[n._v(n._s(D.row.value))])])]}}],null,!1,4281519148)})],1)],1),n.showIOTab?r("el-tab-pane",{attrs:{label:n.$t("trace.rawInputsOutputs"),name:"raw"}},[n.activeTab==="raw"?r("div",{staticClass:"raw-io-content"},[n.rawInputs?r("div",{staticClass:"raw-io-section"},[r("el-collapse",{model:{value:n.rawIoCollapse,callback:function(D){n.rawIoCollapse=D},expression:"rawIoCollapse"}},[r("el-collapse-item",{attrs:{name:"rawInputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.rawInputs")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){D.stopPropagation(),n.copyToClipboard(n.formatRawJson(n.rawInputs))}}})],1)],1),r("codemirror",{key:`raw-inputs-${n.selectedSpanId}-${n.rawInputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.rawInputs),options:n.cmOptions}})],2)],1)],1):n._e(),n.rawOutputs?r("div",{staticClass:"raw-io-section"},[r("el-collapse",{model:{value:n.rawIoCollapse,callback:function(D){n.rawIoCollapse=D},expression:"rawIoCollapse"}},[r("el-collapse-item",{attrs:{name:"rawOutputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.rawOutputs")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){D.stopPropagation(),n.copyToClipboard(n.formatRawJson(n.rawOutputs))}}})],1)],1),r("codemirror",{key:`raw-outputs-${n.selectedSpanId}-${n.rawOutputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.rawOutputs),options:n.cmOptions}})],2)],1)],1):n._e(),!n.rawInputs&&!n.rawOutputs?r("div",{staticClass:"empty-raw-io"},[r("el-empty",{attrs:{description:n.$t("trace.noIoData")}})],1):n._e()]):n._e()]):n._e(),n.showDebugTab?r("el-tab-pane",{attrs:{label:"快速调试",name:"debug"}},[r("DebugTab",{directives:[{name:"show",rawName:"v-show",value:n.activeTab==="debug",expression:"activeTab === 'debug'"}],attrs:{"selected-span":n.selectedSpan,"selected-span-id":n.selectedSpanId}})],1):n._e(),n.hasEvents?r("el-tab-pane",{attrs:{label:n.$t("trace.events"),name:"events"}},[n.activeTab==="events"?r("div",{staticClass:"events-content"},[r("el-collapse",{model:{value:n.eventsCollapse,callback:function(D){n.eventsCollapse=D},expression:"eventsCollapse"}},n._l(n.spanEvents,function(D,$){return r("el-collapse-item",{key:`event-${$}`,attrs:{name:`event-${$}`}},[r("template",{slot:"title"},[r("div",{staticClass:"event-header"},[r("el-tag",{staticClass:"event-name-tag",attrs:{type:D.name==="exception"?"danger":"info",size:"mini"}},[n._v(" "+n._s(D.name)+" ")]),r("span",{staticClass:"event-time"},[n._v(n._s(n.formatEventTimestamp(D.timestamp)))])],1)]),r("div",{staticClass:"event-detail"},[D.name==="exception"?r("div",{staticClass:"exception-content"},[D.attributes["exception.type"]?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionType")))]),r("div",{staticClass:"field-value exception-type"},[n._v(n._s(D.attributes["exception.type"]))])]):n._e(),D.attributes["exception.message"]?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionMessage")))]),r("div",{staticClass:"field-value exception-message"},[n._v(n._s(D.attributes["exception.message"]))])]):n._e(),D.attributes["exception.stacktrace"]?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionStacktrace")))]),r("codemirror",{key:`stacktrace-${n.selectedSpanId}-${$}-${n.eventsKey}`,staticClass:"code-editor-wrapper stacktrace-editor",attrs:{value:D.attributes["exception.stacktrace"],options:n.cmOptionsJava}})],1):n._e(),n.getOtherEventAttributes(D).length>0?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.otherAttributes")))]),r("el-table",{attrs:{data:n.getOtherEventAttributes(D),border:"",stripe:"",size:"mini"}},[r("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"200"}}),r("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")}})],1)],1):n._e()]):r("div",{staticClass:"general-event-content"},[r("el-table",{attrs:{data:n.getEventAttributesData(D),border:"",stripe:"",size:"mini"}},[r("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"200"},scopedSlots:n._u([{key:"default",fn:function(I){return[r("el-tooltip",{attrs:{content:I.row.key,placement:"top","open-delay":500}},[r("span",{staticClass:"attribute-key"},[n._v(n._s(I.row.key))])])]}}],null,!0)}),r("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")},scopedSlots:n._u([{key:"default",fn:function(I){return[r("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[r("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[n._v(n._s(I.row.value))]),r("div",{staticClass:"attribute-value"},[n._v(n._s(I.row.value))])])]}}],null,!0)})],1)],1)])],2)}),1),n.spanEvents.length===0?r("div",{staticClass:"empty-events"},[r("el-empty",{attrs:{description:n.$t("trace.noEvents")}})],1):n._e()],1):n._e()]):n._e()],1)],1):r("el-empty",{attrs:{description:n.$t("trace.selectSpan")}})],1)],1)],1)],1):n._e()])},rg=[],ig=vn(tg,ng,rg,!1,null,"c4c8862b");const ag={name:"Trace",components:{TraceDetailDrawer:ig.exports},data(){return{traceList:[],filteredTraceList:[],searchQuery:"",dateRange:null,selectedStatus:null,selectedTraceType:null,sortProp:"timestamp_ms",sortOrder:"descending",traceStatusList:[],traceSpanTypeList:[],experimentList:[],selectedExperimentId:null,loading:!1,deleteLoading:!1,exportLoading:!1,importLoading:!1,showColumnDialog:!1,selectedColumns:["trace_id","timestamp_ms","end_time_ms","status","execution_time_ms","trace_type","trace_name","experiment_name"],visibleColumns:{trace_id:!0,timestamp_ms:!0,end_time_ms:!0,status:!0,execution_time_ms:!0,trace_type:!0,trace_name:!0,experiment_name:!0},drawerVisible:!1,currentTraceId:null,traceInfo:{},spans:[],filteredSpans:[],spanSearchQuery:"",selectedSpanTypeFilter:null,spanHasEvents:null,selectedSpanId:null,selectedSpan:null,activeTab:"io",drawerLoading:!1,spanPageNum:1,spanPageSize:1e3,spanHasNextPage:!1,spanLoadMoreLoading:!1,messageCollapse:[],eventsCollapse:[],pageNum:1,pageSize:10,total:0,autoRefreshEnabled:!1,autoRefreshInterval:10,autoRefreshTimer:null,selectedRows:[],pickerOptions:{shortcuts:[{text:"近7天",onClick(l){const n=new Date,r=new Date;r.setTime(r.getTime()-3600*1e3*24*7),l.$emit("pick",[r,n])}},{text:"近30天",onClick(l){const n=new Date,r=new Date;r.setTime(r.getTime()-3600*1e3*24*30),l.$emit("pick",[r,n])}},{text:"7天前",onClick(l){const n=new Date;n.setTime(n.getTime()-3600*1e3*24*7),n.setHours(23,59,59,999);const r=n.getTime();l.$emit("pick",[null,r])}},{text:"30天前",onClick(l){const n=new Date;n.setTime(n.getTime()-3600*1e3*24*30),n.setHours(23,59,59,999);const r=n.getTime();l.$emit("pick",[null,r])}}]}}},computed:{},watch:{autoRefreshEnabled(l){l?this.startAutoRefresh():this.stopAutoRefresh()},spanHasEvents(){this.currentTraceId&&this.handleSpanSearch(this.spanSearchQuery)},spanPageSize(){this.currentTraceId&&this.handleSpanSearch(this.spanSearchQuery)},selectedSpanTypeFilter(){this.currentTraceId&&this.handleSpanSearch(this.spanSearchQuery)}},mounted(){this.loadDictList(),this.loadExperiments(),this.loadTraceList()},beforeDestroy(){this.stopAutoRefresh()},methods:{async loadTraceList(){this.loading=!0;try{let l=null,n=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(l=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(n=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(n=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)));const r=this.sortProp&&this.sortOrder?this.sortOrder==="descending"?"-"+this.sortProp:this.sortProp:"",o=await kt.getTraceList(this.searchQuery,l,n,this.pageNum,this.pageSize,this.selectedExperimentId,this.selectedStatus,this.selectedTraceType,r),u=Array.isArray(o==null?void 0:o.list)?o.list:[];this.traceList=u,this.filteredTraceList=u,this.total=parseInt((o==null?void 0:o.total)||0,10)}catch(l){console.error("Failed to load trace list:",l),this.$message.error("加载 trace 列表失败"),this.traceList=[],this.filteredTraceList=[],this.total=0}finally{this.loading=!1}},refresh(){this.loadTraceList()},startAutoRefresh(){this.stopAutoRefresh();const l=this.autoRefreshInterval*1e3;this.autoRefreshTimer=setInterval(()=>{this.loadTraceList()},l)},stopAutoRefresh(){this.autoRefreshTimer&&(clearInterval(this.autoRefreshTimer),this.autoRefreshTimer=null)},handleAutoRefreshIntervalChange(){this.autoRefreshEnabled&&this.startAutoRefresh()},viewDetail(l){const n=l==null?void 0:l.trace_id;n&&(this.currentTraceId=n,this.traceInfo={...l},(l==null?void 0:l.status)==="WARN"&&(this.spanHasEvents=!0),this.drawerVisible=!0,this.loadTraceSpans(n))},async loadTraceSpans(l){var n,r,o;this.drawerLoading=!0,this.spanPageNum=1;try{const u=await kt.getTraceSpans(l,{query:this.spanSearchQuery||"",has_events:this.spanHasEvents===!0?!0:void 0,page_num:1,page_size:this.spanPageSize,span_type:this.selectedSpanTypeFilter||void 0}),f=Array.isArray(u==null?void 0:u.list)?u.list:[];if(this.spans=f,this.filteredSpans=f,this.spanHasNextPage=(u==null?void 0:u.has_next_page)===!0,this.spans.length>0){this.selectedSpanId=this.spans[0].span_id,this.selectedSpan=this.spans[0],await this.loadSpanContent(this.spans[0]);const p=this.spans[0].type==="CLIENT"||this.spans[0].type==="EMBEDDING"||this.spans[0].type==="CHAT_MODEL",y=this.selectedSpan.has_events===!0,m=[];p&&m.push("io","raw"),m.push("attributes"),y&&m.push("events");let k="attributes";p&&(k="io"),m.includes(k)?this.activeTab=k:this.activeTab="attributes",(r=(n=this.selectedSpan.parsedContent)==null?void 0:n.inputs)!=null&&r.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((F,L)=>`message-${L}`):this.messageCollapse=[];const S=(o=this.selectedSpan.parsedContent)==null?void 0:o.events;S&&Array.isArray(S)&&S.length>0?this.eventsCollapse=S.map((F,L)=>`event-${L}`):this.eventsCollapse=[]}}catch(u){console.error("Failed to load trace spans:",u),this.$message.error("加载 span 列表失败"),this.spans=[],this.filteredSpans=[],this.spanHasNextPage=!1}finally{this.drawerLoading=!1}},async handleSpanSearch(l){if(this.spanSearchQuery=l,!!this.currentTraceId){this.spanPageNum=1;try{const n=await kt.getTraceSpans(this.currentTraceId,{query:l||"",has_events:this.spanHasEvents===!0?!0:void 0,page_num:1,page_size:this.spanPageSize,span_type:this.selectedSpanTypeFilter||void 0}),r=Array.isArray(n==null?void 0:n.list)?n.list:[];this.spans=r,this.filteredSpans=r,this.spanHasNextPage=(n==null?void 0:n.has_next_page)===!0,this.spans.length>0&&!this.selectedSpanId&&(this.selectedSpanId=this.spans[0].span_id,this.selectedSpan=this.spans[0],await this.loadSpanContent(this.spans[0]))}catch(n){console.error("Failed to search spans:",n),this.spans=[],this.filteredSpans=[],this.spanHasNextPage=!1}}},async loadMoreSpans(){if(!(!this.currentTraceId||!this.spanHasNextPage||this.spanLoadMoreLoading)){this.spanLoadMoreLoading=!0;try{const l=this.spanPageNum+1,n=await kt.getTraceSpans(this.currentTraceId,{query:this.spanSearchQuery||"",has_events:this.spanHasEvents===!0?!0:void 0,page_num:l,page_size:this.spanPageSize,span_type:this.selectedSpanTypeFilter||void 0}),r=Array.isArray(n==null?void 0:n.list)?n.list:[];this.spans=this.spans.concat(r),this.filteredSpans=this.spans,this.spanPageNum=l,this.spanHasNextPage=(n==null?void 0:n.has_next_page)===!0}catch(l){console.error("Failed to load more spans:",l)}finally{this.spanLoadMoreLoading=!1}}},async handleSpanSelect(l){var p,y,m;this.selectedSpanId=l.span_id,this.selectedSpan=l,await this.loadSpanContent(l);const n=l.type==="CLIENT"||l.type==="EMBEDDING"||l.type==="CHAT_MODEL",r=l.has_events===!0,o=[];n&&o.push("io","raw"),o.push("attributes"),r&&o.push("events");let u="attributes";n&&(u="io"),this.$nextTick(()=>{o.includes(u)?this.activeTab=u:this.activeTab="attributes"}),(y=(p=this.selectedSpan.parsedContent)==null?void 0:p.inputs)!=null&&y.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((k,S)=>`message-${S}`):this.messageCollapse=[];const f=(m=this.selectedSpan.parsedContent)==null?void 0:m.events;f&&Array.isArray(f)&&f.length>0?this.eventsCollapse=f.map((k,S)=>`event-${S}`):this.eventsCollapse=[]},async loadSpanContent(l){if(!(!this.currentTraceId||!l.span_id||l.parsedContent))try{const n=await kt.getSpanContent(this.currentTraceId,l.span_id);if(n){const r=this.parseContentData(n);this.$set(l,"parsedContent",r)}}catch(n){console.error("Failed to load span content:",n)}},parseContentData(l){const n={attributes:l.attributes||{},events:l.events||[],status:l.status||{}};if(l.inputs&&(n.inputs=l.inputs),l.outputs&&(n.outputs=l.outputs),l.request_preview!=null&&l.request_preview!==""&&(n.request_preview=l.request_preview),l.response_preview!=null&&l.response_preview!==""&&(n.response_preview=l.response_preview),n.attributes){const r=n.attributes["langsword.spanInputs"],o=n.attributes["langsword.spanOutputs"];if(r)try{n.inputs=typeof r=="string"?JSON.parse(r):r}catch{try{const f=r.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.inputs=JSON.parse(f)}catch{n.inputs=r}}if(o)try{n.outputs=typeof o=="string"?JSON.parse(o):o}catch{try{const f=o.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.outputs=JSON.parse(f)}catch{n.outputs=o}}}return n},handleDrawerClose(){this.currentTraceId=null,this.traceInfo={},this.spans=[],this.filteredSpans=[],this.selectedSpanId=null,this.selectedSpan=null,this.spanSearchQuery="",this.selectedSpanTypeFilter=null,this.spanHasEvents=null,this.spanPageNum=1,this.spanHasNextPage=!1,this.spanLoadMoreLoading=!1,this.eventsCollapse=[],this.drawerLoading=!1},async loadExperiments(){try{const l=await kt.getExperiments();this.experimentList=Array.isArray(l)?l:[]}catch(l){console.error("Failed to load experiments:",l),this.experimentList=[]}},handleExperimentChange(){this.pageNum=1,this.loadTraceList()},handleSearch(){this.pageNum=1,this.loadTraceList()},handleSearchClear(){this.searchQuery="",this.pageNum=1,this.loadTraceList()},handleDateRangeChange(l){this.pageNum=1,l&&Array.isArray(l)?l.length===2&&(l[0]===null||l[0]===void 0)?this.dateRange=[null,l[1]]:this.dateRange=l:this.dateRange=l,this.loadTraceList()},handleSizeChange(l){this.pageSize=l,this.pageNum=1,this.loadTraceList()},handleCurrentChange(l){this.pageNum=l,this.loadTraceList()},async handleBatchDelete(){var p,y;const l=this.searchQuery&&this.searchQuery.trim(),n=this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2&&this.dateRange[1]!==null||this.dateRange.length===1&&this.dateRange[0]!==null),r=this.selectedExperimentId,o=this.selectedStatus;let u="",f="warning";if(!l&&!n&&!r&&!o)u=this.$t("trace.deleteAllWarning"),f="error";else{if(u=this.$t("trace.deleteConfirmMessage")+`
|
|
77
|
+
*/function dd(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function zo(l,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,Ho(o.key),o)}}function hd(l,n,r){return n&&zo(l.prototype,n),r&&zo(l,r),Object.defineProperty(l,"prototype",{writable:!1}),l}function pd(l,n,r){return(n=Ho(n))in l?Object.defineProperty(l,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):l[n]=r,l}function Bo(l,n){var r=Object.keys(l);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(l);n&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(l,u).enumerable})),r.push.apply(r,o)}return r}function Ya(l){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Bo(Object(r),!0).forEach(function(o){pd(l,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(r)):Bo(Object(r)).forEach(function(o){Object.defineProperty(l,o,Object.getOwnPropertyDescriptor(r,o))})}return l}function gd(l,n){if(typeof l!="object"||!l)return l;var r=l[Symbol.toPrimitive];if(r!==void 0){var o=r.call(l,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(l)}function Ho(l){var n=gd(l,"string");return typeof n=="symbol"?n:n+""}function Ja(l){"@babel/helpers - typeof";return Ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ja(l)}var Wo={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},md='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',Ki=typeof window<"u"&&typeof window.document<"u",Sn=Ki?window:{},dr=Ki&&Sn.document.documentElement?"ontouchstart"in Sn.document.documentElement:!1,Qa=Ki?"PointerEvent"in Sn:!1,Ne="viewer",Vi="move",jo="switch",ei="zoom",Xi="".concat(Ne,"-active"),vd="".concat(Ne,"-close"),Yi="".concat(Ne,"-fade"),Za="".concat(Ne,"-fixed"),yd="".concat(Ne,"-fullscreen"),qo="".concat(Ne,"-fullscreen-exit"),Yn="".concat(Ne,"-hide"),bd="".concat(Ne,"-hide-md-down"),xd="".concat(Ne,"-hide-sm-down"),wd="".concat(Ne,"-hide-xs-down"),Qt="".concat(Ne,"-in"),ti="".concat(Ne,"-invisible"),hr="".concat(Ne,"-loading"),kd="".concat(Ne,"-move"),Uo="".concat(Ne,"-open"),pr="".concat(Ne,"-show"),at="".concat(Ne,"-transition"),gr="click",es="dblclick",Go="dragstart",Ko="focusin",Vo="keydown",Zt="load",Jn="error",Sd=dr?"touchend touchcancel":"mouseup",Cd=dr?"touchmove":"mousemove",Td=dr?"touchstart":"mousedown",Xo=Qa?"pointerdown":Td,Yo=Qa?"pointermove":Cd,Jo=Qa?"pointerup pointercancel":Sd,Qo="resize",rn="transitionend",Zo="wheel",el="ready",tl="show",nl="shown",rl="hide",il="hidden",al="view",ni="viewed",sl="move",ol="moved",ll="rotate",ul="rotated",cl="scale",fl="scaled",dl="zoom",hl="zoomed",pl="play",gl="stop",Ji="".concat(Ne,"Action"),ts=/\s\s*/,Qi=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ri(l){return typeof l=="string"}var _d=Number.isNaN||Sn.isNaN;function Ze(l){return typeof l=="number"&&!_d(l)}function mr(l){return typeof l>"u"}function vr(l){return Ja(l)==="object"&&l!==null}var Ld=Object.prototype.hasOwnProperty;function yr(l){if(!vr(l))return!1;try{var n=l.constructor,r=n.prototype;return n&&r&&Ld.call(r,"isPrototypeOf")}catch{return!1}}function Ue(l){return typeof l=="function"}function Ve(l,n){if(l&&Ue(n))if(Array.isArray(l)||Ze(l.length)){var r=l.length,o;for(o=0;o<r&&n.call(l,l[o],o,l)!==!1;o+=1);}else vr(l)&&Object.keys(l).forEach(function(u){n.call(l,l[u],u,l)});return l}var Gt=Object.assign||function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),u=1;u<r;u++)o[u-1]=arguments[u];return vr(n)&&o.length>0&&o.forEach(function(f){vr(f)&&Object.keys(f).forEach(function(p){n[p]=f[p]})}),n},Ed=/^(?:width|height|left|top|marginLeft|marginTop)$/;function an(l,n){var r=l.style;Ve(n,function(o,u){Ed.test(u)&&Ze(o)&&(o+="px"),r[u]=o})}function Id(l){return ri(l)?l.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"):l}function br(l,n){return!l||!n?!1:l.classList?l.classList.contains(n):l.className.indexOf(n)>-1}function Te(l,n){if(!(!l||!n)){if(Ze(l.length)){Ve(l,function(o){Te(o,n)});return}if(l.classList){l.classList.add(n);return}var r=l.className.trim();r?r.indexOf(n)<0&&(l.className="".concat(r," ").concat(n)):l.className=n}}function He(l,n){if(!(!l||!n)){if(Ze(l.length)){Ve(l,function(r){He(r,n)});return}if(l.classList){l.classList.remove(n);return}l.className.indexOf(n)>=0&&(l.className=l.className.replace(n,""))}}function ii(l,n,r){if(n){if(Ze(l.length)){Ve(l,function(o){ii(o,n,r)});return}r?Te(l,n):He(l,n)}}var Ad=/([a-z\d])([A-Z])/g;function ns(l){return l.replace(Ad,"$1-$2").toLowerCase()}function xr(l,n){return vr(l[n])?l[n]:l.dataset?l.dataset[n]:l.getAttribute("data-".concat(ns(n)))}function rs(l,n,r){vr(r)?l[n]=r:l.dataset?l.dataset[n]=r:l.setAttribute("data-".concat(ns(n)),r)}var ml=function(){var l=!1;if(Ki){var n=!1,r=function(){},o=Object.defineProperty({},"once",{get:function(){return l=!0,n},set:function(f){n=f}});Sn.addEventListener("test",r,o),Sn.removeEventListener("test",r,o)}return l}();function Ge(l,n,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=r;n.trim().split(ts).forEach(function(f){if(!ml){var p=l.listeners;p&&p[f]&&p[f][r]&&(u=p[f][r],delete p[f][r],Object.keys(p[f]).length===0&&delete p[f],Object.keys(p).length===0&&delete l.listeners)}l.removeEventListener(f,u,o)})}function Ee(l,n,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=r;n.trim().split(ts).forEach(function(f){if(o.once&&!ml){var p=l.listeners,y=p===void 0?{}:p;u=function(){delete y[f][r],l.removeEventListener(f,u,o);for(var k=arguments.length,S=new Array(k),R=0;R<k;R++)S[R]=arguments[R];r.apply(l,S)},y[f]||(y[f]={}),y[f][r]&&l.removeEventListener(f,y[f][r],o),y[f][r]=u,l.listeners=y}l.addEventListener(f,u,o)})}function ot(l,n,r,o){var u;return Ue(Event)&&Ue(CustomEvent)?u=new CustomEvent(n,Ya({bubbles:!0,cancelable:!0,detail:r},o)):(u=document.createEvent("CustomEvent"),u.initCustomEvent(n,!0,!0,r)),l.dispatchEvent(u)}function Dd(l){var n=l.getBoundingClientRect();return{left:n.left+(window.pageXOffset-document.documentElement.clientLeft),top:n.top+(window.pageYOffset-document.documentElement.clientTop)}}function Zi(l){var n=l.rotate,r=l.scaleX,o=l.scaleY,u=l.translateX,f=l.translateY,p=[];Ze(u)&&u!==0&&p.push("translateX(".concat(u,"px)")),Ze(f)&&f!==0&&p.push("translateY(".concat(f,"px)")),Ze(n)&&n!==0&&p.push("rotate(".concat(n,"deg)")),Ze(r)&&r!==1&&p.push("scaleX(".concat(r,")")),Ze(o)&&o!==1&&p.push("scaleY(".concat(o,")"));var y=p.length?p.join(" "):"none";return{WebkitTransform:y,msTransform:y,transform:y}}function Od(l){return ri(l)?decodeURIComponent(l.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var is=Sn.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(Sn.navigator.userAgent);function vl(l,n,r){var o=document.createElement("img");if(l.naturalWidth&&!is)return r(l.naturalWidth,l.naturalHeight),o;var u=document.body||document.documentElement;return o.onload=function(){r(o.width,o.height),is||u.removeChild(o)},Ve(n.inheritedAttributes,function(f){var p=l.getAttribute(f);p!==null&&o.setAttribute(f,p)}),o.src=l.src,is||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",u.appendChild(o)),o}function ea(l){switch(l){case 2:return wd;case 3:return xd;case 4:return bd;default:return""}}function Nd(l){var n=Ya({},l),r=[];return Ve(l,function(o,u){delete n[u],Ve(n,function(f){var p=Math.abs(o.startX-f.startX),y=Math.abs(o.startY-f.startY),m=Math.abs(o.endX-f.endX),k=Math.abs(o.endY-f.endY),S=Math.sqrt(p*p+y*y),R=Math.sqrt(m*m+k*k),L=(R-S)/S;r.push(L)})}),r.sort(function(o,u){return Math.abs(o)<Math.abs(u)}),r[0]}function ta(l,n){var r=l.pageX,o=l.pageY,u={endX:r,endY:o};return n?u:Ya({timeStamp:Date.now(),startX:r,startY:o},u)}function Fd(l){var n=0,r=0,o=0;return Ve(l,function(u){var f=u.startX,p=u.startY;n+=f,r+=p,o+=1}),n/=o,r/=o,{pageX:n,pageY:r}}var Rd={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var n=this.element.ownerDocument,r=n.body||n.documentElement;this.body=r,this.scrollbarWidth=window.innerWidth-n.documentElement.clientWidth,this.initialBodyPaddingRight=r.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(r).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var n=this.options,r=this.parent,o;n.inline&&(o={width:Math.max(r.offsetWidth,n.minWidth),height:Math.max(r.offsetHeight,n.minHeight)},this.parentData=o),(this.fulled||!o)&&(o=this.containerData),this.viewerData=Gt({},o)},renderViewer:function(){this.options.inline&&!this.fulled&&an(this.viewer,this.viewerData)},initList:function(){var n=this,r=this.element,o=this.options,u=this.list,f=[];u.innerHTML="",Ve(this.images,function(p,y){var m=p.src,k=p.alt||Od(m),S=n.getImageURL(p);if(m||S){var R=document.createElement("li"),L=document.createElement("img");Ve(o.inheritedAttributes,function(W){var z=p.getAttribute(W);z!==null&&L.setAttribute(W,z)}),o.navbar&&(L.src=m||S),L.alt=k,L.setAttribute("data-original-url",S||m),R.setAttribute("data-index",y),R.setAttribute("data-viewer-action","view"),R.setAttribute("role","button"),o.keyboard&&R.setAttribute("tabindex",0),R.appendChild(L),u.appendChild(R),f.push(R)}}),this.items=f,Ve(f,function(p){var y=p.firstElementChild,m,k;rs(y,"filled",!0),o.loading&&Te(p,hr),Ee(y,Zt,m=function(R){Ge(y,Jn,k),o.loading&&He(p,hr),n.loadImage(R)},{once:!0}),Ee(y,Jn,k=function(){Ge(y,Zt,m),o.loading&&He(p,hr)},{once:!0})}),o.transition&&Ee(r,ni,function(){Te(u,at)},{once:!0})},renderList:function(){var n=this.index,r=this.items[n];if(r){var o=r.nextElementSibling,u=parseInt(window.getComputedStyle(o||r).marginLeft,10),f=r.offsetWidth,p=f+u;an(this.list,Gt({width:p*this.length-u},Zi({translateX:(this.viewerData.width-f)/2-p*n})))}},resetList:function(){var n=this.list;n.innerHTML="",He(n,at),an(n,Zi({translateX:0}))},initImage:function(n){var r=this,o=this.options,u=this.image,f=this.viewerData,p=this.footer.offsetHeight,y=f.width,m=Math.max(f.height-p,p),k=this.imageData||{},S;this.imageInitializing={abort:function(){S.onload=null}},S=vl(u,o,function(R,L){var W=R/L,z=Math.max(0,Math.min(1,o.initialCoverage)),D=y,$=m;r.imageInitializing=!1,m*W>y?$=y/W:D=m*W,z=Ze(z)?z:.9,D=Math.min(D*z,R),$=Math.min($*z,L);var I=(y-D)/2,N=(m-$)/2,H={left:I,top:N,x:I,y:N,width:D,height:$,oldRatio:1,ratio:D/R,aspectRatio:W,naturalWidth:R,naturalHeight:L},V=Gt({},H);o.rotatable&&(H.rotate=k.rotate||0,V.rotate=0),o.scalable&&(H.scaleX=k.scaleX||1,H.scaleY=k.scaleY||1,V.scaleX=1,V.scaleY=1),r.imageData=H,r.initialImageData=V,n&&n()})},renderImage:function(n){var r=this,o=this.image,u=this.imageData;if(an(o,Gt({width:u.width,height:u.height,marginLeft:u.x,marginTop:u.y},Zi(u))),n)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&br(o,at)){var f=function(){r.imageRendering=!1,n()};this.imageRendering={abort:function(){Ge(o,rn,f)}},Ee(o,rn,f,{once:!0})}else n()},resetImage:function(){var n=this.image;n&&(this.viewing&&this.viewing.abort(),n.parentNode.removeChild(n),this.image=null,this.title.innerHTML="")}},Md={bind:function(){var n=this.options,r=this.viewer,o=this.canvas,u=this.element.ownerDocument;Ee(r,gr,this.onClick=this.click.bind(this)),Ee(r,Go,this.onDragStart=this.dragstart.bind(this)),Ee(o,Xo,this.onPointerDown=this.pointerdown.bind(this)),Ee(u,Yo,this.onPointerMove=this.pointermove.bind(this)),Ee(u,Jo,this.onPointerUp=this.pointerup.bind(this)),Ee(u,Vo,this.onKeyDown=this.keydown.bind(this)),Ee(window,Qo,this.onResize=this.resize.bind(this)),n.zoomable&&n.zoomOnWheel&&Ee(r,Zo,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),n.toggleOnDblclick&&Ee(o,es,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var n=this.options,r=this.viewer,o=this.canvas,u=this.element.ownerDocument;Ge(r,gr,this.onClick),Ge(r,Go,this.onDragStart),Ge(o,Xo,this.onPointerDown),Ge(u,Yo,this.onPointerMove),Ge(u,Jo,this.onPointerUp),Ge(u,Vo,this.onKeyDown),Ge(window,Qo,this.onResize),n.zoomable&&n.zoomOnWheel&&Ge(r,Zo,this.onWheel,{passive:!1,capture:!0}),n.toggleOnDblclick&&Ge(o,es,this.onDblclick)}},$d={click:function(n){var r=this.options,o=this.imageData,u=n.target,f=xr(u,Ji);switch(!f&&u.localName==="img"&&u.parentElement.localName==="li"&&(u=u.parentElement,f=xr(u,Ji)),dr&&n.isTrusted&&u===this.canvas&&clearTimeout(this.clickCanvasTimeout),f){case"mix":this.played?this.stop():r.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(xr(u,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(r.loop);break;case"play":this.play(r.fullscreen);break;case"next":this.next(r.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-o.scaleX||-1);break;case"flip-vertical":this.scaleY(-o.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(n){n.preventDefault(),this.viewed&&n.target===this.image&&(dr&&n.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(n.isTrusted?n:n.detail&&n.detail.originalEvent))},load:function(){var n=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var r=this.element,o=this.options,u=this.image,f=this.index,p=this.viewerData;He(u,ti),o.loading&&He(this.canvas,hr),u.style.cssText="height:0;"+"margin-left:".concat(p.width/2,"px;")+"margin-top:".concat(p.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){ii(u,kd,o.movable),ii(u,at,o.transition),n.renderImage(function(){n.viewed=!0,n.viewing=!1,Ue(o.viewed)&&Ee(r,ni,o.viewed,{once:!0}),ot(r,ni,{originalImage:n.images[f],index:f,image:u},{cancelable:!1})})})},loadImage:function(n){var r=n.target,o=r.parentNode,u=o.offsetWidth||30,f=o.offsetHeight||50,p=!!xr(r,"filled");vl(r,this.options,function(y,m){var k=y/m,S=u,R=f;f*k>u?p?S=f*k:R=u/k:p?R=u/k:S=f*k,an(r,Gt({width:S,height:R},Zi({translateX:(u-S)/2,translateY:(f-R)/2})))})},keydown:function(n){var r=this.options;if(r.keyboard){var o=n.keyCode||n.which||n.charCode;switch(o){case 13:this.viewer.contains(n.target)&&this.click(n);break}if(this.fulled)switch(o){case 27:this.played?this.stop():r.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(r.loop);break;case 38:n.preventDefault(),this.zoom(r.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(r.loop);break;case 40:n.preventDefault(),this.zoom(-r.zoomRatio,!0);break;case 48:case 49:n.ctrlKey&&(n.preventDefault(),this.toggle());break}}},dragstart:function(n){n.target.localName==="img"&&n.preventDefault()},pointerdown:function(n){var r=this.options,o=this.pointers,u=n.buttons,f=n.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||(n.type==="mousedown"||n.type==="pointerdown"&&n.pointerType==="mouse")&&(Ze(u)&&u!==1||Ze(f)&&f!==0||n.ctrlKey))){n.preventDefault(),n.changedTouches?Ve(n.changedTouches,function(y){o[y.identifier]=ta(y)}):o[n.pointerId||0]=ta(n);var p=r.movable?Vi:!1;r.zoomOnTouch&&r.zoomable&&Object.keys(o).length>1?p=ei:r.slideOnTouch&&(n.pointerType==="touch"||n.type==="touchstart")&&this.isSwitchable()&&(p=jo),r.transition&&(p===Vi||p===ei)&&He(this.image,at),this.action=p}},pointermove:function(n){var r=this.pointers,o=this.action;!this.viewed||!o||(n.preventDefault(),n.changedTouches?Ve(n.changedTouches,function(u){Gt(r[u.identifier]||{},ta(u,!0))}):Gt(r[n.pointerId||0]||{},ta(n,!0)),this.change(n))},pointerup:function(n){var r=this,o=this.options,u=this.action,f=this.pointers,p;n.changedTouches?Ve(n.changedTouches,function(y){p=f[y.identifier],delete f[y.identifier]}):(p=f[n.pointerId||0],delete f[n.pointerId||0]),u&&(n.preventDefault(),o.transition&&(u===Vi||u===ei)&&Te(this.image,at),this.action=!1,dr&&u!==ei&&p&&Date.now()-p.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),o.toggleOnDblclick&&this.viewed&&n.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){ot(r.image,es,{originalEvent:n})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){r.imageClicked=!1},500)):(this.imageClicked=!1,o.backdrop&&o.backdrop!=="static"&&n.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){ot(r.canvas,gr,{originalEvent:n})},50)))))},resize:function(){var n=this;if(!(!this.isShown||this.hiding)&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)){this.stop();return}Ve(this.player.getElementsByTagName("img"),function(r){Ee(r,Zt,n.loadImage.bind(n),{once:!0}),ot(r,Zt)})}},wheel:function(n){var r=this;if(this.viewed&&(n.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50);var o=Number(this.options.zoomRatio)||.1,u=1;n.deltaY?u=n.deltaY>0?1:-1:n.wheelDelta?u=-n.wheelDelta/120:n.detail&&(u=n.detail>0?1:-1),this.zoom(-u*o,!0,null,n)}}},Pd={show:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.element,o=this.options;if(o.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(n),this;if(Ue(o.show)&&Ee(r,tl,o.show,{once:!0}),ot(r,tl)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var u=this.viewer;if(He(u,Yn),u.setAttribute("role","dialog"),u.setAttribute("aria-labelledby",this.title.id),u.setAttribute("aria-modal",!0),u.removeAttribute("aria-hidden"),o.transition&&!n){var f=this.shown.bind(this);this.transitioning={abort:function(){Ge(u,rn,f),He(u,Qt)}},Te(u,at),u.initialOffsetWidth=u.offsetWidth,Ee(u,rn,f,{once:!0}),Te(u,Qt)}else Te(u,Qt),this.shown();return this},hide:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.element,u=this.options;if(u.inline||this.hiding||!(this.isShown||this.showing))return this;if(Ue(u.hide)&&Ee(o,rl,u.hide,{once:!0}),ot(o,rl)===!1)return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var f=this.viewer,p=this.image,y=function(){He(f,Qt),n.hidden()};if(u.transition&&!r){var m=function(R){R&&R.target===f&&(Ge(f,rn,m),n.hidden())},k=function(){br(f,at)?(Ee(f,rn,m),He(f,Qt)):y()};this.transitioning={abort:function(){n.viewed&&br(p,at)?Ge(p,rn,k):br(f,at)&&Ge(f,rn,m)}},this.viewed&&br(p,at)?(Ee(p,rn,k,{once:!0}),this.zoomTo(0,!1,null,null,!0)):k()}else y();return this},view:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(r=Number(r)||0,this.hiding||this.played||r<0||r>=this.length||this.viewed&&r===this.index)return this;if(!this.isShown)return this.index=r,this.show();this.viewing&&this.viewing.abort();var o=this.element,u=this.options,f=this.title,p=this.canvas,y=this.items[r],m=y.querySelector("img"),k=xr(m,"originalUrl"),S=m.getAttribute("alt"),R=document.createElement("img");if(Ve(u.inheritedAttributes,function($){var I=m.getAttribute($);I!==null&&R.setAttribute($,I)}),R.src=k,R.alt=S,Ue(u.view)&&Ee(o,al,u.view,{once:!0}),ot(o,al,{originalImage:this.images[r],index:r,image:R})===!1||!this.isShown||this.hiding||this.played)return this;var L=this.items[this.index];L&&(He(L,Xi),L.removeAttribute("aria-selected")),Te(y,Xi),y.setAttribute("aria-selected",!0),u.focus&&y.focus(),this.image=R,this.viewed=!1,this.index=r,this.imageData={},Te(R,ti),u.loading&&Te(p,hr),p.innerHTML="",p.appendChild(R),this.renderList(),f.innerHTML="";var W=function(){var I=n.imageData,N=Array.isArray(u.title)?u.title[1]:u.title;f.innerHTML=Id(Ue(N)?N.call(n,R,I):"".concat(S," (").concat(I.naturalWidth," × ").concat(I.naturalHeight,")"))},z,D;return Ee(o,ni,W,{once:!0}),this.viewing={abort:function(){Ge(o,ni,W),R.complete?n.imageRendering?n.imageRendering.abort():n.imageInitializing&&n.imageInitializing.abort():(R.src="",Ge(R,Zt,z),n.timeout&&clearTimeout(n.timeout))}},R.complete?this.load():(Ee(R,Zt,z=function(){Ge(R,Jn,D),n.load()},{once:!0}),Ee(R,Jn,D=function(){Ge(R,Zt,z),n.timeout&&(clearTimeout(n.timeout),n.timeout=!1),He(R,ti),u.loading&&He(n.canvas,hr)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){He(R,ti),n.timeout=!1},1e3)),this},prev:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.index-1;return r<0&&(r=n?this.length-1:0),this.view(r),this},next:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.length-1,o=this.index+1;return o>r&&(o=n?0:r),this.view(o),this},move:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,o=this.imageData;return this.moveTo(mr(n)?n:o.x+Number(n),mr(r)?r:o.y+Number(r)),this},moveTo:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,f=this.element,p=this.options,y=this.imageData;if(n=Number(n),o=Number(o),this.viewed&&!this.played&&p.movable){var m=y.x,k=y.y,S=!1;if(Ze(n)?S=!0:n=m,Ze(o)?S=!0:o=k,S){if(Ue(p.move)&&Ee(f,sl,p.move,{once:!0}),ot(f,sl,{x:n,y:o,oldX:m,oldY:k,originalEvent:u})===!1)return this;y.x=n,y.y=o,y.left=n,y.top=o,this.moving=!0,this.renderImage(function(){r.moving=!1,Ue(p.moved)&&Ee(f,ol,p.moved,{once:!0}),ot(f,ol,{x:n,y:o,oldX:m,oldY:k,originalEvent:u},{cancelable:!1})})}}return this},rotate:function(n){return this.rotateTo((this.imageData.rotate||0)+Number(n)),this},rotateTo:function(n){var r=this,o=this.element,u=this.options,f=this.imageData;if(n=Number(n),Ze(n)&&this.viewed&&!this.played&&u.rotatable){var p=f.rotate;if(Ue(u.rotate)&&Ee(o,ll,u.rotate,{once:!0}),ot(o,ll,{degree:n,oldDegree:p})===!1)return this;f.rotate=n,this.rotating=!0,this.renderImage(function(){r.rotating=!1,Ue(u.rotated)&&Ee(o,ul,u.rotated,{once:!0}),ot(o,ul,{degree:n,oldDegree:p},{cancelable:!1})})}return this},scaleX:function(n){return this.scale(n,this.imageData.scaleY),this},scaleY:function(n){return this.scale(this.imageData.scaleX,n),this},scale:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,u=this.element,f=this.options,p=this.imageData;if(n=Number(n),o=Number(o),this.viewed&&!this.played&&f.scalable){var y=p.scaleX,m=p.scaleY,k=!1;if(Ze(n)?k=!0:n=y,Ze(o)?k=!0:o=m,k){if(Ue(f.scale)&&Ee(u,cl,f.scale,{once:!0}),ot(u,cl,{scaleX:n,scaleY:o,oldScaleX:y,oldScaleY:m})===!1)return this;p.scaleX=n,p.scaleY=o,this.scaling=!0,this.renderImage(function(){r.scaling=!1,Ue(f.scaled)&&Ee(u,fl,f.scaled,{once:!0}),ot(u,fl,{scaleX:n,scaleY:o,oldScaleX:y,oldScaleY:m},{cancelable:!1})})}}return this},zoom:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,f=this.imageData;return n=Number(n),n<0?n=1/(1-n):n=1+n,this.zoomTo(f.width*n/f.naturalWidth,r,o,u),this},zoomTo:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,y=this.element,m=this.options,k=this.pointers,S=this.imageData,R=S.x,L=S.y,W=S.width,z=S.height,D=S.naturalWidth,$=S.naturalHeight;if(n=Math.max(0,n),Ze(n)&&this.viewed&&!this.played&&(p||m.zoomable)){if(!p){var I=Math.max(.01,m.minZoomRatio),N=Math.min(100,m.maxZoomRatio);n=Math.min(Math.max(n,I),N)}if(f)switch(f.type){case"wheel":m.zoomRatio>=.055&&n>.95&&n<1.05&&(n=1);break;case"pointermove":case"touchmove":case"mousemove":n>.99&&n<1.01&&(n=1);break}var H=D*n,V=$*n,ne=H-W,ue=V-z,se=S.ratio;if(Ue(m.zoom)&&Ee(y,dl,m.zoom,{once:!0}),ot(y,dl,{ratio:n,oldRatio:se,originalEvent:f})===!1)return this;if(this.zooming=!0,f){var de=Dd(this.viewer),Oe=k&&Object.keys(k).length>0?Fd(k):{pageX:f.pageX,pageY:f.pageY};S.x-=ne*((Oe.pageX-de.left-R)/W),S.y-=ue*((Oe.pageY-de.top-L)/z)}else yr(u)&&Ze(u.x)&&Ze(u.y)?(S.x-=ne*((u.x-R)/W),S.y-=ue*((u.y-L)/z)):(S.x-=ne/2,S.y-=ue/2);S.left=S.x,S.top=S.y,S.width=H,S.height=V,S.oldRatio=se,S.ratio=n,this.renderImage(function(){r.zooming=!1,Ue(m.zoomed)&&Ee(y,hl,m.zoomed,{once:!0}),ot(y,hl,{ratio:n,oldRatio:se,originalEvent:f},{cancelable:!1})}),o&&this.tooltip()}return this},play:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var o=this.element,u=this.options;if(Ue(u.play)&&Ee(o,pl,u.play,{once:!0}),ot(o,pl)===!1)return this;var f=this.player,p=this.loadImage.bind(this),y=[],m=0,k=0;if(this.played=!0,this.onLoadWhenPlay=p,r&&this.requestFullscreen(r),Te(f,pr),Ve(this.items,function(L,W){var z=L.querySelector("img"),D=document.createElement("img");D.src=xr(z,"originalUrl"),D.alt=z.getAttribute("alt"),D.referrerPolicy=z.referrerPolicy,m+=1,Te(D,Yi),ii(D,at,u.transition),br(L,Xi)&&(Te(D,Qt),k=W),y.push(D),Ee(D,Zt,p,{once:!0}),f.appendChild(D)}),Ze(u.interval)&&u.interval>0){var S=function(){clearTimeout(n.playing.timeout),He(y[k],Qt),k-=1,k=k>=0?k:m-1,Te(y[k],Qt),n.playing.timeout=setTimeout(S,u.interval)},R=function(){clearTimeout(n.playing.timeout),He(y[k],Qt),k+=1,k=k<m?k:0,Te(y[k],Qt),n.playing.timeout=setTimeout(R,u.interval)};m>1&&(this.playing={prev:S,next:R,timeout:setTimeout(R,u.interval)})}return this},stop:function(){var n=this;if(!this.played)return this;var r=this.element,o=this.options;if(Ue(o.stop)&&Ee(r,gl,o.stop,{once:!0}),ot(r,gl)===!1)return this;var u=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Ve(u.getElementsByTagName("img"),function(f){Ge(f,Zt,n.onLoadWhenPlay)}),He(u,pr),u.innerHTML="",this.exitFullscreen(),this},full:function(){var n=this,r=this.options,o=this.viewer,u=this.image,f=this.list;return!this.isShown||this.played||this.fulled||!r.inline?this:(this.fulled=!0,this.open(),Te(this.button,qo),r.transition&&(He(f,at),this.viewed&&He(u,at)),Te(o,Za),o.setAttribute("role","dialog"),o.setAttribute("aria-labelledby",this.title.id),o.setAttribute("aria-modal",!0),o.removeAttribute("style"),an(o,{zIndex:r.zIndex}),r.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=Gt({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage(function(){r.transition&&setTimeout(function(){Te(u,at),Te(f,at)},0)})}),this)},exit:function(){var n=this,r=this.options,o=this.viewer,u=this.image,f=this.list;return!this.isShown||this.played||!this.fulled||!r.inline?this:(this.fulled=!1,this.close(),He(this.button,qo),r.transition&&(He(f,at),this.viewed&&He(u,at)),r.focus&&this.clearEnforceFocus(),o.removeAttribute("role"),o.removeAttribute("aria-labelledby"),o.removeAttribute("aria-modal"),He(o,Za),an(o,{zIndex:r.zIndexInline}),this.viewerData=Gt({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage(function(){r.transition&&setTimeout(function(){Te(u,at),Te(f,at)},0)})}),this)},tooltip:function(){var n=this,r=this.options,o=this.tooltipBox,u=this.imageData;return!this.viewed||this.played||!r.tooltip?this:(o.textContent="".concat(Math.round(u.ratio*100),"%"),this.tooltipping?clearTimeout(this.tooltipping):r.transition?(this.fading&&ot(o,rn),Te(o,pr),Te(o,Yi),Te(o,at),o.removeAttribute("aria-hidden"),o.initialOffsetWidth=o.offsetWidth,Te(o,Qt)):(Te(o,pr),o.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){r.transition?(Ee(o,rn,function(){He(o,pr),He(o,Yi),He(o,at),o.setAttribute("aria-hidden",!0),n.fading=!1},{once:!0}),He(o,Qt),n.fading=!0):(He(o,pr),o.setAttribute("aria-hidden",!0)),n.tooltipping=!1},1e3),this)},toggle:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,null,n):this.zoomTo(1,!0,null,n),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=Gt({},this.initialImageData),this.renderImage()),this},update:function(){var n=this,r=this.element,o=this.options,u=this.isImg;if(u&&!r.parentNode)return this.destroy();var f=[];if(Ve(u?[r]:r.querySelectorAll("img"),function(k){Ue(o.filter)?o.filter.call(n,k)&&f.push(k):n.getImageURL(k)&&f.push(k)}),!f.length)return this;if(this.images=f,this.length=f.length,this.ready){var p=[];if(Ve(this.items,function(k,S){var R=k.querySelector("img"),L=f[S];L&&R?(L.src!==R.src||L.alt!==R.alt)&&p.push(S):p.push(S)}),an(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var y=p.indexOf(this.index);if(y>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-y,this.length-1),0));else{var m=this.items[this.index];Te(m,Xi),m.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var n=this.element,r=this.options;return n[Ne]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),r.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):r.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),r.inline||Ge(n,gr,this.onStart),n[Ne]=void 0,this):this}},zd={getImageURL:function(n){var r=this.options.url;return ri(r)?r=n.getAttribute(r):Ue(r)?r=r.call(this,n):r="",r},enforceFocus:function(){var n=this;this.clearEnforceFocus(),Ee(document,Ko,this.onFocusin=function(r){var o=n.viewer,u=r.target;if(!(u===document||u===o||o.contains(u))){for(;u;){if(u.getAttribute("tabindex")!==null||u.getAttribute("aria-modal")==="true")return;u=u.parentElement}o.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Ge(document,Ko,this.onFocusin),this.onFocusin=null)},open:function(){var n=this.body;Te(n,Uo),this.scrollbarWidth>0&&(n.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var n=this.body;He(n,Uo),this.scrollbarWidth>0&&(n.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var n=this.element,r=this.options,o=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,r.focus&&(o.focus(),this.enforceFocus()),Ue(r.shown)&&Ee(n,nl,r.shown,{once:!0}),ot(n,nl)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var n=this.element,r=this.options,o=this.viewer;r.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),Te(o,Yn),o.removeAttribute("role"),o.removeAttribute("aria-labelledby"),o.removeAttribute("aria-modal"),o.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(Ue(r.hidden)&&Ee(n,il,r.hidden,{once:!0}),ot(n,il,null,{cancelable:!1}))},requestFullscreen:function(n){var r=this.element.ownerDocument;if(this.fulled&&!(r.fullscreenElement||r.webkitFullscreenElement||r.mozFullScreenElement||r.msFullscreenElement)){var o=r.documentElement;o.requestFullscreen?yr(n)?o.requestFullscreen(n):o.requestFullscreen():o.webkitRequestFullscreen?o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):o.mozRequestFullScreen?o.mozRequestFullScreen():o.msRequestFullscreen&&o.msRequestFullscreen()}},exitFullscreen:function(){var n=this.element.ownerDocument;this.fulled&&(n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement)&&(n.exitFullscreen?n.exitFullscreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.msExitFullscreen&&n.msExitFullscreen())},change:function(n){var r=this.options,o=this.pointers,u=o[Object.keys(o)[0]];if(u){var f=u.endX-u.startX,p=u.endY-u.startY;switch(this.action){case Vi:(f!==0||p!==0)&&(this.pointerMoved=!0,this.move(f,p,n));break;case ei:this.zoom(Nd(o),!1,null,n);break;case jo:{this.action="switched";var y=Math.abs(f);y>1&&y>Math.abs(p)&&(this.pointers={},f>1?this.prev(r.loop):f<-1&&this.next(r.loop));break}}Ve(o,function(m){m.startX=m.endX,m.startY=m.endY})}},isSwitchable:function(){var n=this.imageData,r=this.viewerData;return this.length>1&&n.x>=0&&n.y>=0&&n.width<=r.width&&n.height<=r.height}},Bd=Sn.Viewer,Hd=function(l){return function(){return l+=1,l}}(-1),yl=function(){function l(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(dd(this,l),!n||n.nodeType!==1)throw new Error("The first argument is required and must be an element.");this.element=n,this.options=Gt({},Wo,yr(r)&&r),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Hd(),this.init()}return hd(l,[{key:"init",value:function(){var r=this,o=this.element,u=this.options;if(!o[Ne]){o[Ne]=this,u.focus&&!u.keyboard&&(u.focus=!1);var f=o.localName==="img",p=[];if(Ve(f?[o]:o.querySelectorAll("img"),function(k){Ue(u.filter)?u.filter.call(r,k)&&p.push(k):r.getImageURL(k)&&p.push(k)}),this.isImg=f,this.length=p.length,this.images=p,this.initBody(),mr(document.createElement(Ne).style.transition)&&(u.transition=!1),u.inline){var y=0,m=function(){if(y+=1,y===r.length){var S;r.initializing=!1,r.delaying={abort:function(){clearTimeout(S)}},S=setTimeout(function(){r.delaying=!1,r.build()},0)}};this.initializing={abort:function(){Ve(p,function(S){S.complete||(Ge(S,Zt,m),Ge(S,Jn,m))})}},Ve(p,function(k){if(k.complete)m();else{var S,R;Ee(k,Zt,S=function(){Ge(k,Jn,R),m()},{once:!0}),Ee(k,Jn,R=function(){Ge(k,Zt,S),m()},{once:!0})}})}else Ee(o,gr,this.onStart=function(k){var S=k.target;S.localName==="img"&&(!Ue(u.filter)||u.filter.call(r,S))&&r.view(r.images.indexOf(S))})}}},{key:"build",value:function(){if(!this.ready){var r=this.element,o=this.options,u=r.parentNode,f=document.createElement("div");f.innerHTML=md;var p=f.querySelector(".".concat(Ne,"-container")),y=p.querySelector(".".concat(Ne,"-title")),m=p.querySelector(".".concat(Ne,"-toolbar")),k=p.querySelector(".".concat(Ne,"-navbar")),S=p.querySelector(".".concat(Ne,"-button")),R=p.querySelector(".".concat(Ne,"-canvas"));if(this.parent=u,this.viewer=p,this.title=y,this.toolbar=m,this.navbar=k,this.button=S,this.canvas=R,this.footer=p.querySelector(".".concat(Ne,"-footer")),this.tooltipBox=p.querySelector(".".concat(Ne,"-tooltip")),this.player=p.querySelector(".".concat(Ne,"-player")),this.list=p.querySelector(".".concat(Ne,"-list")),p.id="".concat(Ne).concat(this.id),y.id="".concat(Ne,"Title").concat(this.id),Te(y,o.title?ea(Array.isArray(o.title)?o.title[0]:o.title):Yn),Te(k,o.navbar?ea(o.navbar):Yn),ii(S,Yn,!o.button),o.keyboard&&S.setAttribute("tabindex",0),o.backdrop&&(Te(p,"".concat(Ne,"-backdrop")),!o.inline&&o.backdrop!=="static"&&rs(R,Ji,"hide")),ri(o.className)&&o.className&&o.className.split(ts).forEach(function(H){Te(p,H)}),o.toolbar){var L=document.createElement("ul"),W=yr(o.toolbar),z=Qi.slice(0,3),D=Qi.slice(7,9),$=Qi.slice(9);W||Te(m,ea(o.toolbar)),Ve(W?o.toolbar:Qi,function(H,V){var ne=W&&yr(H),ue=W?ns(V):H,se=ne&&!mr(H.show)?H.show:H;if(!(!se||!o.zoomable&&z.indexOf(ue)!==-1||!o.rotatable&&D.indexOf(ue)!==-1||!o.scalable&&$.indexOf(ue)!==-1)){var de=ne&&!mr(H.size)?H.size:H,Oe=ne&&!mr(H.click)?H.click:H,Re=document.createElement("li");o.keyboard&&Re.setAttribute("tabindex",0),Re.setAttribute("role","button"),Te(Re,"".concat(Ne,"-").concat(ue)),Ue(Oe)||rs(Re,Ji,ue),Ze(se)&&Te(Re,ea(se)),["small","large"].indexOf(de)!==-1?Te(Re,"".concat(Ne,"-").concat(de)):ue==="play"&&Te(Re,"".concat(Ne,"-large")),Ue(Oe)&&Ee(Re,gr,Oe),L.appendChild(Re)}}),m.appendChild(L)}else Te(m,Yn);if(!o.rotatable){var I=m.querySelectorAll('li[class*="rotate"]');Te(I,ti),Ve(I,function(H){m.appendChild(H)})}if(o.inline)Te(S,yd),an(p,{zIndex:o.zIndexInline}),window.getComputedStyle(u).position==="static"&&an(u,{position:"relative"}),u.insertBefore(p,r.nextSibling);else{Te(S,vd),Te(p,Za),Te(p,Yi),Te(p,Yn),an(p,{zIndex:o.zIndex});var N=o.container;ri(N)&&(N=r.ownerDocument.querySelector(N)),N||(N=this.body),N.appendChild(p)}if(o.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,Ue(o.ready)&&Ee(r,el,o.ready,{once:!0}),ot(r,el)===!1){this.ready=!1;return}this.ready&&o.inline&&this.view(this.index)}}}],[{key:"noConflict",value:function(){return window.Viewer=Bd,l}},{key:"setDefaults",value:function(r){Gt(Wo,yr(r)&&r)}}])}();Gt(yl.prototype,Rd,Md,$d,Pd,zd);var Wd=typeof global=="object"&&global&&global.Object===Object&&global,bl=Wd,jd=typeof self=="object"&&self&&self.Object===Object&&self,qd=bl||jd||Function("return this")(),as=qd,Ud=as.Symbol,na=Ud,xl=Object.prototype,Gd=xl.hasOwnProperty,Kd=xl.toString,ai=na?na.toStringTag:void 0;function Vd(l){var n=Gd.call(l,ai),r=l[ai];try{l[ai]=void 0;var o=!0}catch{}var u=Kd.call(l);return o&&(n?l[ai]=r:delete l[ai]),u}var Xd=Object.prototype,Yd=Xd.toString;function Jd(l){return Yd.call(l)}var Qd="[object Null]",Zd="[object Undefined]",wl=na?na.toStringTag:void 0;function ss(l){return l==null?l===void 0?Zd:Qd:wl&&wl in Object(l)?Vd(l):Jd(l)}function os(l){return l!=null&&typeof l=="object"}var eh=Array.isArray,th=eh;function ls(l){var n=typeof l;return l!=null&&(n=="object"||n=="function")}function kl(l){return l}var nh="[object AsyncFunction]",rh="[object Function]",ih="[object GeneratorFunction]",ah="[object Proxy]";function Sl(l){if(!ls(l))return!1;var n=ss(l);return n==rh||n==ih||n==nh||n==ah}var sh=as["__core-js_shared__"],us=sh,Cl=function(){var l=/[^.]+$/.exec(us&&us.keys&&us.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}();function oh(l){return!!Cl&&Cl in l}var lh=Function.prototype,uh=lh.toString;function ch(l){if(l!=null){try{return uh.call(l)}catch{}try{return l+""}catch{}}return""}var fh=/[\\^$.*+?()[\]{}|]/g,dh=/^\[object .+?Constructor\]$/,hh=Function.prototype,ph=Object.prototype,gh=hh.toString,mh=ph.hasOwnProperty,vh=RegExp("^"+gh.call(mh).replace(fh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yh(l){if(!ls(l)||oh(l))return!1;var n=Sl(l)?vh:dh;return n.test(ch(l))}function bh(l,n){return l==null?void 0:l[n]}function xh(l,n){var r=bh(l,n);return yh(r)?r:void 0}function wh(l,n,r){switch(r.length){case 0:return l.call(n);case 1:return l.call(n,r[0]);case 2:return l.call(n,r[0],r[1]);case 3:return l.call(n,r[0],r[1],r[2])}return l.apply(n,r)}var kh=800,Sh=16,Ch=Date.now;function Th(l){var n=0,r=0;return function(){var o=Ch(),u=Sh-(o-r);if(r=o,u>0){if(++n>=kh)return arguments[0]}else n=0;return l.apply(void 0,arguments)}}function _h(l){return function(){return l}}var Lh=function(){try{var l=xh(Object,"defineProperty");return l({},"",{}),l}catch{}}(),ra=Lh,Eh=ra?function(l,n){return ra(l,"toString",{configurable:!0,enumerable:!1,value:_h(n),writable:!0})}:kl,Ih=Eh,Ah=Th(Ih),Dh=Ah,Oh=9007199254740991,Nh=/^(?:0|[1-9]\d*)$/;function Tl(l,n){var r=typeof l;return n=n??Oh,!!n&&(r=="number"||r!="symbol"&&Nh.test(l))&&l>-1&&l%1==0&&l<n}function _l(l,n,r){n=="__proto__"&&ra?ra(l,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):l[n]=r}function Ll(l,n){return l===n||l!==l&&n!==n}var Fh=Object.prototype,Rh=Fh.hasOwnProperty;function El(l,n,r){var o=l[n];(!(Rh.call(l,n)&&Ll(o,r))||r===void 0&&!(n in l))&&_l(l,n,r)}function Mh(l,n,r,o){var u=!r;r||(r={});for(var f=-1,p=n.length;++f<p;){var y=n[f],m=void 0;m===void 0&&(m=l[y]),u?_l(r,y,m):El(r,y,m)}return r}var Il=Math.max;function $h(l,n,r){return n=Il(n===void 0?l.length-1:n,0),function(){for(var o=arguments,u=-1,f=Il(o.length-n,0),p=Array(f);++u<f;)p[u]=o[n+u];u=-1;for(var y=Array(n+1);++u<n;)y[u]=o[u];return y[n]=r(p),wh(l,this,y)}}function Ph(l,n){return Dh($h(l,n,kl),l+"")}var zh=9007199254740991;function Al(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=zh}function cs(l){return l!=null&&Al(l.length)&&!Sl(l)}function Bh(l,n,r){if(!ls(r))return!1;var o=typeof n;return(o=="number"?cs(r)&&Tl(n,r.length):o=="string"&&n in r)?Ll(r[n],l):!1}function Hh(l){return Ph(function(n,r){var o=-1,u=r.length,f=u>1?r[u-1]:void 0,p=u>2?r[2]:void 0;for(f=l.length>3&&typeof f=="function"?(u--,f):void 0,p&&Bh(r[0],r[1],p)&&(f=u<3?void 0:f,u=1),n=Object(n);++o<u;){var y=r[o];y&&l(n,y,o,f)}return n})}var Wh=Object.prototype;function Dl(l){var n=l&&l.constructor,r=typeof n=="function"&&n.prototype||Wh;return l===r}function jh(l,n){for(var r=-1,o=Array(l);++r<l;)o[r]=n(r);return o}var qh="[object Arguments]";function Ol(l){return os(l)&&ss(l)==qh}var Nl=Object.prototype,Uh=Nl.hasOwnProperty,Gh=Nl.propertyIsEnumerable,Kh=Ol(function(){return arguments}())?Ol:function(l){return os(l)&&Uh.call(l,"callee")&&!Gh.call(l,"callee")},Vh=Kh;function Xh(){return!1}var Fl=typeof De=="object"&&De&&!De.nodeType&&De,Rl=Fl&&typeof module=="object"&&module&&!module.nodeType&&module,Yh=Rl&&Rl.exports===Fl,Ml=Yh?as.Buffer:void 0,Jh=Ml?Ml.isBuffer:void 0,Qh=Jh||Xh,Zh=Qh,ep="[object Arguments]",tp="[object Array]",np="[object Boolean]",rp="[object Date]",ip="[object Error]",ap="[object Function]",sp="[object Map]",op="[object Number]",lp="[object Object]",up="[object RegExp]",cp="[object Set]",fp="[object String]",dp="[object WeakMap]",hp="[object ArrayBuffer]",pp="[object DataView]",gp="[object Float32Array]",mp="[object Float64Array]",vp="[object Int8Array]",yp="[object Int16Array]",bp="[object Int32Array]",xp="[object Uint8Array]",wp="[object Uint8ClampedArray]",kp="[object Uint16Array]",Sp="[object Uint32Array]",Xe={};Xe[gp]=Xe[mp]=Xe[vp]=Xe[yp]=Xe[bp]=Xe[xp]=Xe[wp]=Xe[kp]=Xe[Sp]=!0,Xe[ep]=Xe[tp]=Xe[hp]=Xe[np]=Xe[pp]=Xe[rp]=Xe[ip]=Xe[ap]=Xe[sp]=Xe[op]=Xe[lp]=Xe[up]=Xe[cp]=Xe[fp]=Xe[dp]=!1;function Cp(l){return os(l)&&Al(l.length)&&!!Xe[ss(l)]}function Tp(l){return function(n){return l(n)}}var $l=typeof De=="object"&&De&&!De.nodeType&&De,si=$l&&typeof module=="object"&&module&&!module.nodeType&&module,_p=si&&si.exports===$l,fs=_p&&bl.process,Lp=function(){try{var l=si&&si.require&&si.require("util").types;return l||fs&&fs.binding&&fs.binding("util")}catch{}}(),Pl=Lp,zl=Pl&&Pl.isTypedArray,Ep=zl?Tp(zl):Cp,Ip=Ep,Ap=Object.prototype,Dp=Ap.hasOwnProperty;function Op(l,n){var r=th(l),o=!r&&Vh(l),u=!r&&!o&&Zh(l),f=!r&&!o&&!u&&Ip(l),p=r||o||u||f,y=p?jh(l.length,String):[],m=y.length;for(var k in l)Dp.call(l,k)&&!(p&&(k=="length"||u&&(k=="offset"||k=="parent")||f&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||Tl(k,m)))&&y.push(k);return y}function Np(l,n){return function(r){return l(n(r))}}var Fp=Np(Object.keys,Object),Rp=Fp,Mp=Object.prototype,$p=Mp.hasOwnProperty;function Pp(l){if(!Dl(l))return Rp(l);var n=[];for(var r in Object(l))$p.call(l,r)&&r!="constructor"&&n.push(r);return n}function zp(l){return cs(l)?Op(l):Pp(l)}var Bp=Object.prototype,Hp=Bp.hasOwnProperty,Wp=Hh(function(l,n){if(Dl(n)||cs(n)){Mh(n,zp(n),l);return}for(var r in n)Hp.call(n,r)&&El(l,r,n[r])}),jp=Wp;const Bl=({images:l=[],options:n={}}={})=>{n=jp(n,{inline:!1});const r=Qc.extend({render(p){return p("div",{style:{display:"none"},class:["__viewer-token"]},l.map(y=>p("img",{attrs:typeof y=="string"?{src:y}:y})))}}),o=new r;o.$mount(),document.body.appendChild(o.$el);const u=new yl(o.$el,n),f=u.destroy.bind(u);return u.destroy=function(){return f(),o.$destroy(),document.body.removeChild(o.$el),u},u.show(),o.$el.addEventListener("hidden",function(){this.viewer===u&&u.destroy()}),u};(function(l,n){(function(r){r(jt())})(function(r){function o(A,M,K,he,E,x){this.indented=A,this.column=M,this.type=K,this.info=he,this.align=E,this.prev=x}function u(A,M,K,he){var E=A.indented;return A.context&&A.context.type=="statement"&&K!="statement"&&(E=A.context.indented),A.context=new o(E,M,K,he,null,A.context)}function f(A){var M=A.context.type;return(M==")"||M=="]"||M=="}")&&(A.indented=A.context.indented),A.context=A.context.prev}function p(A,M,K){if(M.prevToken=="variable"||M.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(A.string.slice(0,K))||M.typeAtEndOfLine&&A.column()==A.indentation())return!0}function y(A){for(;;){if(!A||A.type=="top")return!0;if(A.type=="}"&&A.prev.info!="namespace")return!1;A=A.prev}}r.defineMode("clike",function(A,M){var K=A.indentUnit,he=M.statementIndentUnit||K,E=M.dontAlignCalls,x=M.keywords||{},oe=M.types||{},_e=M.builtin||{},Z=M.blockKeywords||{},fe=M.defKeywords||{},ke=M.atoms||{},Le=M.hooks||{},ct=M.multiLineStrings,we=M.indentStatements!==!1,Fe=M.indentSwitch!==!1,Ke=M.namespaceSeparator,ft=M.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,Pt=M.numberStart||/[\d\.]/,dt=M.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,ht=M.isOperatorChar||/[+\-*&%=<>!?|\/]/,gt=M.isIdentifierChar||/[\w\$_\xa1-\uffff]/,Kt=M.isReservedIdentifier||!1,be,St;function Vt(ye,xe){var pe=ye.next();if(Le[pe]){var Me=Le[pe](ye,xe);if(Me!==!1)return Me}if(pe=='"'||pe=="'")return xe.tokenize=On(pe),xe.tokenize(ye,xe);if(Pt.test(pe)){if(ye.backUp(1),ye.match(dt))return"number";ye.next()}if(ft.test(pe))return be=pe,null;if(pe=="/"){if(ye.eat("*"))return xe.tokenize=Zn,Zn(ye,xe);if(ye.eat("/"))return ye.skipToEnd(),"comment"}if(ht.test(pe)){for(;!ye.match(/^\/[\/*]/,!1)&&ye.eat(ht););return"operator"}if(ye.eatWhile(gt),Ke)for(;ye.match(Ke);)ye.eatWhile(gt);var Ie=ye.current();return k(x,Ie)?(k(Z,Ie)&&(be="newstatement"),k(fe,Ie)&&(St=!0),"keyword"):k(oe,Ie)?"type":k(_e,Ie)||Kt&&Kt(Ie)?(k(Z,Ie)&&(be="newstatement"),"builtin"):k(ke,Ie)?"atom":"variable"}function On(ye){return function(xe,pe){for(var Me=!1,Ie,zt=!1;(Ie=xe.next())!=null;){if(Ie==ye&&!Me){zt=!0;break}Me=!Me&&Ie=="\\"}return(zt||!(Me||ct))&&(pe.tokenize=null),"string"}}function Zn(ye,xe){for(var pe=!1,Me;Me=ye.next();){if(Me=="/"&&pe){xe.tokenize=null;break}pe=Me=="*"}return"comment"}function wr(ye,xe){M.typeFirstDefinitions&&ye.eol()&&y(xe.context)&&(xe.typeAtEndOfLine=p(ye,xe,ye.pos))}return{startState:function(ye){return{tokenize:null,context:new o((ye||0)-K,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(ye,xe){var pe=xe.context;if(ye.sol()&&(pe.align==null&&(pe.align=!1),xe.indented=ye.indentation(),xe.startOfLine=!0),ye.eatSpace())return wr(ye,xe),null;be=St=null;var Me=(xe.tokenize||Vt)(ye,xe);if(Me=="comment"||Me=="meta")return Me;if(pe.align==null&&(pe.align=!0),be==";"||be==":"||be==","&&ye.match(/^\s*(?:\/\/.*)?$/,!1))for(;xe.context.type=="statement";)f(xe);else if(be=="{")u(xe,ye.column(),"}");else if(be=="[")u(xe,ye.column(),"]");else if(be=="(")u(xe,ye.column(),")");else if(be=="}"){for(;pe.type=="statement";)pe=f(xe);for(pe.type=="}"&&(pe=f(xe));pe.type=="statement";)pe=f(xe)}else be==pe.type?f(xe):we&&((pe.type=="}"||pe.type=="top")&&be!=";"||pe.type=="statement"&&be=="newstatement")&&u(xe,ye.column(),"statement",ye.current());if(Me=="variable"&&(xe.prevToken=="def"||M.typeFirstDefinitions&&p(ye,xe,ye.start)&&y(xe.context)&&ye.match(/^\s*\(/,!1))&&(Me="def"),Le.token){var Ie=Le.token(ye,xe,Me);Ie!==void 0&&(Me=Ie)}return Me=="def"&&M.styleDefs===!1&&(Me="variable"),xe.startOfLine=!1,xe.prevToken=St?"def":Me||be,wr(ye,xe),Me},indent:function(ye,xe){if(ye.tokenize!=Vt&&ye.tokenize!=null||ye.typeAtEndOfLine&&y(ye.context))return r.Pass;var pe=ye.context,Me=xe&&xe.charAt(0),Ie=Me==pe.type;if(pe.type=="statement"&&Me=="}"&&(pe=pe.prev),M.dontIndentStatements)for(;pe.type=="statement"&&M.dontIndentStatements.test(pe.info);)pe=pe.prev;if(Le.indent){var zt=Le.indent(ye,pe,xe,K);if(typeof zt=="number")return zt}var en=pe.prev&&pe.prev.info=="switch";if(M.allmanIndentation&&/[{(]/.test(Me)){for(;pe.type!="top"&&pe.type!="}";)pe=pe.prev;return pe.indented}return pe.type=="statement"?pe.indented+(Me=="{"?0:he):pe.align&&(!E||pe.type!=")")?pe.column+(Ie?0:1):pe.type==")"&&!Ie?pe.indented+he:pe.indented+(Ie?0:K)+(!Ie&&en&&!/^(?:case|default)\b/.test(xe)?K:0)},electricInput:Fe?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function m(A){for(var M={},K=A.split(" "),he=0;he<K.length;++he)M[K[he]]=!0;return M}function k(A,M){return typeof A=="function"?A(M):A.propertyIsEnumerable(M)}var S="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",R="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",L="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",W="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",z=m("int long char short double float unsigned signed void bool"),D=m("SEL instancetype id Class Protocol BOOL");function $(A){return k(z,A)||/.+_t$/.test(A)}function I(A){return $(A)||k(D,A)}var N="case do else for if switch while struct enum union",H="struct enum union";function V(A,M){if(!M.startOfLine)return!1;for(var K,he=null;K=A.peek();){if(K=="\\"&&A.match(/^.$/)){he=V;break}else if(K=="/"&&A.match(/^\/[\/\*]/,!1))break;A.next()}return M.tokenize=he,"meta"}function ne(A,M){return M.prevToken=="type"?"type":!1}function ue(A){return!A||A.length<2||A[0]!="_"?!1:A[1]=="_"||A[1]!==A[1].toLowerCase()}function se(A){return A.eatWhile(/[\w\.']/),"number"}function de(A,M){if(A.backUp(1),A.match(/^(?:R|u8R|uR|UR|LR)/)){var K=A.match(/^"([^\s\\()]{0,16})\(/);return K?(M.cpp11RawStringDelim=K[1],M.tokenize=ie,ie(A,M)):!1}return A.match(/^(?:u8|u|U|L)/)?A.match(/^["']/,!1)?"string":!1:(A.next(),!1)}function Oe(A){var M=/(\w+)::~?(\w+)$/.exec(A);return M&&M[1]==M[2]}function Re(A,M){for(var K;(K=A.next())!=null;)if(K=='"'&&!A.eat('"')){M.tokenize=null;break}return"string"}function ie(A,M){var K=M.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),he=A.match(new RegExp(".*?\\)"+K+'"'));return he?M.tokenize=null:A.skipToEnd(),"string"}function Pe(A,M){typeof A=="string"&&(A=[A]);var K=[];function he(x){if(x)for(var oe in x)x.hasOwnProperty(oe)&&K.push(oe)}he(M.keywords),he(M.types),he(M.builtin),he(M.atoms),K.length&&(M.helperType=A[0],r.registerHelper("hintWords",A[0],K));for(var E=0;E<A.length;++E)r.defineMIME(A[E],M)}Pe(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:m(S),types:$,blockKeywords:m(N),defKeywords:m(H),typeFirstDefinitions:!0,atoms:m("NULL true false"),isReservedIdentifier:ue,hooks:{"#":V,"*":ne},modeProps:{fold:["brace","include"]}}),Pe(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:m(S+" "+R),types:$,blockKeywords:m(N+" class try catch"),defKeywords:m(H+" class namespace"),typeFirstDefinitions:!0,atoms:m("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:ue,hooks:{"#":V,"*":ne,u:de,U:de,L:de,R:de,0:se,1:se,2:se,3:se,4:se,5:se,6:se,7:se,8:se,9:se,token:function(A,M,K){if(K=="variable"&&A.peek()=="("&&(M.prevToken==";"||M.prevToken==null||M.prevToken=="}")&&Oe(A.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Pe("text/x-java",{name:"clike",keywords:m("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:m("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:m("catch class do else finally for if switch try while"),defKeywords:m("class interface enum @interface"),typeFirstDefinitions:!0,atoms:m("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(A){return A.match("interface",!1)?!1:(A.eatWhile(/[\w\$_]/),"meta")},'"':function(A,M){return A.match(/""$/)?(M.tokenize=j,M.tokenize(A,M)):!1}},modeProps:{fold:["brace","import"]}}),Pe("text/x-csharp",{name:"clike",keywords:m("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:m("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:m("catch class do else finally for foreach if struct switch try while"),defKeywords:m("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:m("true false null"),hooks:{"@":function(A,M){return A.eat('"')?(M.tokenize=Re,Re(A,M)):(A.eatWhile(/[\w\$_]/),"meta")}}});function j(A,M){for(var K=!1;!A.eol();){if(!K&&A.match('"""')){M.tokenize=null;break}K=A.next()=="\\"&&!K}return"string"}function Q(A){return function(M,K){for(var he;he=M.next();)if(he=="*"&&M.eat("/"))if(A==1){K.tokenize=null;break}else return K.tokenize=Q(A-1),K.tokenize(M,K);else if(he=="/"&&M.eat("*"))return K.tokenize=Q(A+1),K.tokenize(M,K);return"comment"}}Pe("text/x-scala",{name:"clike",keywords:m("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:m("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:m("catch class enum do else finally for forSome if match switch try while"),defKeywords:m("class enum def object package trait type val var"),atoms:m("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(A){return A.eatWhile(/[\w\$_]/),"meta"},'"':function(A,M){return A.match('""')?(M.tokenize=j,M.tokenize(A,M)):!1},"'":function(A){return A.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(A.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(A,M){var K=M.context;return K.type=="}"&&K.align&&A.eat(">")?(M.context=new o(K.indented,K.column,K.type,K.info,null,K.prev),"operator"):!1},"/":function(A,M){return A.eat("*")?(M.tokenize=Q(1),M.tokenize(A,M)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function w(A){return function(M,K){for(var he=!1,E,x=!1;!M.eol();){if(!A&&!he&&M.match('"')){x=!0;break}if(A&&M.match('"""')){x=!0;break}E=M.next(),!he&&E=="$"&&M.match("{")&&M.skipTo("}"),he=!he&&E=="\\"&&!A}return(x||!A)&&(K.tokenize=null),"string"}}Pe("text/x-kotlin",{name:"clike",keywords:m("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:m("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:m("catch class do else finally for if where try while enum"),defKeywords:m("class val var object interface fun"),atoms:m("true false null this"),hooks:{"@":function(A){return A.eatWhile(/[\w\$_]/),"meta"},"*":function(A,M){return M.prevToken=="."?"variable":"operator"},'"':function(A,M){return M.tokenize=w(A.match('""')),M.tokenize(A,M)},"/":function(A,M){return A.eat("*")?(M.tokenize=Q(1),M.tokenize(A,M)):!1},indent:function(A,M,K,he){var E=K&&K.charAt(0);if((A.prevToken=="}"||A.prevToken==")")&&K=="")return A.indented;if(A.prevToken=="operator"&&K!="}"&&A.context.type!="}"||A.prevToken=="variable"&&E=="."||(A.prevToken=="}"||A.prevToken==")")&&E==".")return he*2+M.indented;if(M.align&&M.type=="}")return M.indented+(A.context.type==(K||"").charAt(0)?0:he)}},modeProps:{closeBrackets:{triples:'"'}}}),Pe(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:m("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:m("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:m("for while do if else struct"),builtin:m("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:m("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":V},modeProps:{fold:["brace","include"]}}),Pe("text/x-nesc",{name:"clike",keywords:m(S+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:$,blockKeywords:m(N),atoms:m("null true false"),hooks:{"#":V},modeProps:{fold:["brace","include"]}}),Pe("text/x-objectivec",{name:"clike",keywords:m(S+" "+L),types:I,builtin:m(W),blockKeywords:m(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:m(H+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:m("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ue,hooks:{"#":V,"*":ne},modeProps:{fold:["brace","include"]}}),Pe("text/x-objectivec++",{name:"clike",keywords:m(S+" "+L+" "+R),types:I,builtin:m(W),blockKeywords:m(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:m(H+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:m("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ue,hooks:{"#":V,"*":ne,u:de,U:de,L:de,R:de,0:se,1:se,2:se,3:se,4:se,5:se,6:se,7:se,8:se,9:se,token:function(A,M,K){if(K=="variable"&&A.peek()=="("&&(M.prevToken==";"||M.prevToken==null||M.prevToken=="}")&&Oe(A.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Pe("text/x-squirrel",{name:"clike",keywords:m("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:$,blockKeywords:m("case catch class else for foreach if switch try while"),defKeywords:m("function local class"),typeFirstDefinitions:!0,atoms:m("true false null"),hooks:{"#":V},modeProps:{fold:["brace","include"]}});var J=null;function G(A){return function(M,K){for(var he=!1,E,x=!1;!M.eol();){if(!he&&M.match('"')&&(A=="single"||M.match('""'))){x=!0;break}if(!he&&M.match("``")){J=G(A),x=!0;break}E=M.next(),he=A=="single"&&!he&&E=="\\"}return x&&(K.tokenize=null),"string"}}Pe("text/x-ceylon",{name:"clike",keywords:m("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(A){var M=A.charAt(0);return M===M.toUpperCase()&&M!==M.toLowerCase()},blockKeywords:m("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:m("class dynamic function interface module object package value"),builtin:m("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:m("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(A){return A.eatWhile(/[\w\$_]/),"meta"},'"':function(A,M){return M.tokenize=G(A.match('""')?"triple":"single"),M.tokenize(A,M)},"`":function(A,M){return!J||!A.match("`")?!1:(M.tokenize=J,J=null,M.tokenize(A,M))},"'":function(A){return A.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(A,M,K){if((K=="variable"||K=="type")&&M.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})(),Se.setOptions({breaks:!0});const qp={name:"OutputViewer",components:{codemirror:za.codemirror,FilePdfViewer:Xa},props:{value:{type:[Object,Array,String],default:null},showRawToggle:{type:Boolean,default:!1},isErrorResponse:{type:Boolean,default:!1},previewMarkdown:{type:String,default:""},fileOnly:{type:Boolean,default:!1},supportFileElements:{type:Boolean,default:!1},title:{type:String,default:""},contentKey:{type:[String,Number],default:0}},data(){return{showRaw:!1,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},viewerOptions:{inline:!1,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,zIndex:9999}}},computed:{errorMessage(){return this.getErrorMessage(this.value)},effectiveFileOnly(){return this.fileOnly?!0:!this.supportFileElements||!this.value||this.value.choices?!1:this.extractFileRefs(this.value).length>0||this.extractImageBase64Refs(this.value).length>0}},methods:{handleCopy(){const l=this.formatRawJson(this.value);this.$emit("copy",l)},copyChoiceContent(l){let n="";if(typeof l=="string")n=l;else if(Array.isArray(l)){const r=l.filter(o=>o&&o.type==="text"&&o.text).map(o=>o.text);n=r.length>0?r.join(`
|
|
78
|
+
`):this.formatRawJson(l)}else n=this.formatRawJson(l);this.$emit("copy",n)},formatRawJson(l){if(!l)return"";if(typeof l=="string")try{const n=JSON.parse(l);return JSON.stringify(n,null,2)}catch{return l}return JSON.stringify(l,null,2)},getErrorMessage(l){return!l||typeof l!="object"?String(l??""):l.error&&typeof l.error=="object"&&l.error.message?l.error.message:l.message?l.message:l._status!==void 0?`${l._status} ${l._statusText||""}`.trim():l._raw!==void 0?String(l._raw):JSON.stringify(l)},renderMarkdown(l){return l?Se(String(l)):""},getMessageRoleLabel(l){const n={system:"debug.systemRole",user:"debug.userRole",assistant:"debug.assistantRole"};return n[l]?this.$t(n[l]):l},handleImageClick(l){Bl({options:this.viewerOptions,images:[l]})},extractImagesFromObject(l,n=[],r=""){if(!(!l||typeof l!="object")){for(const[o,u]of Object.entries(l)){const f=r?`${r}.${o}`:o;typeof u=="string"&&u.trim()!==""?(u.startsWith("data:image/")||u.startsWith("/9j/")||u.startsWith("iVBOR")||u.startsWith("R0lGOD"))&&(n.push({path:f,value:u,label:o==="content"&&r?`${r.split(".").pop()}: ${o}`:o}),l[o]="[IMAGE_DATA]"):u&&typeof u=="object"&&!Array.isArray(u)?this.extractImagesFromObject(u,n,f):Array.isArray(u)&&u.forEach((p,y)=>{p&&typeof p=="object"&&this.extractImagesFromObject(p,n,`${f}[${y}]`)})}return n}},extractFileRefs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r.startsWith("__file__")&&o!=null?Array.isArray(o)?o.forEach(u=>{u!=null&&typeof u=="string"&&u.trim()!==""&&n.push(u.trim())}):typeof o=="string"&&o.trim()!==""&&n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractFileRefs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractFileRefs(u,n)});return n},extractImageBase64Refs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r==="image_base64"&&o!=null&&typeof o=="string"&&o.trim()!==""?n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractImageBase64Refs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractImageBase64Refs(u,n)});return n},getFileExtension(l){if(!l||typeof l!="string")return"";const n=l.lastIndexOf(".");return n>=0?l.slice(n+1).toLowerCase():""},buildFileElements(l,n="file"){if(!this.supportFileElements)return[];const r=["jpg","jpeg","png","gif","webp","bmp","svg"],o=[];return l.forEach((u,f)=>{const p=this.getFileExtension(u),y=zi(u),m=decodeURIComponent(u.split("/").pop()||u);r.includes(p)?o.push({type:"file-image",downloadUrl:y,key:`${n}-image-${f}`}):p==="pdf"?o.push({type:"file-pdf",downloadUrl:y,key:`${n}-pdf-${f}`}):o.push({type:"file-download",downloadUrl:y,filename:m,key:`${n}-download-${f}`})}),o},formatBase64Image(l){return l?l.startsWith("data:image")?l:l.startsWith("/9j/")?`data:image/jpeg;base64,${l}`:l.startsWith("iVBOR")?`data:image/png;base64,${l}`:l.startsWith("R0lGOD")?`data:image/gif;base64,${l}`:`data:image/jpeg;base64,${l}`:""},renderStructuredContent(l,n=!1){const r=[];if(!l)return r;if(this.supportFileElements){const o=this.extractFileRefs(l);o.length>0&&r.push(...this.buildFileElements(o,"file"))}if(l.data&&Array.isArray(l.data.result))l.data.result.forEach((o,u)=>{o.image_base64&&o.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(o.image_base64),key:`result-page-${u}`,label:o.page_num!==void 0?`Page ${o.page_num}`:`Result ${u}`}),o.seals&&Array.isArray(o.seals)&&o.seals.forEach((f,p)=>{f.image_base64&&f.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(f.image_base64),key:`result-seal-${u}-${p}`,label:`印章文字: ${f.value||""}`})})});else{const o=this.extractImageBase64Refs(l);o.length>0&&o.forEach((u,f)=>{r.push({type:"image",url:this.formatBase64Image(u),key:`base64-image-${f}`})})}if(n)return r;try{if(Array.isArray(l))l.forEach((o,u)=>{var f;o&&typeof o=="object"?o.type==="text"&&o.text?r.push({type:"markdown",content:Se(o.text),key:`text-${u}`}):o.type==="image_url"&&((f=o.image_url)!=null&&f.url)?r.push({type:"image",url:o.image_url.url,key:`image-${u}`}):o.image_base64&&o.image_base64.trim()!==""?r.push({type:"image",url:this.formatBase64Image(o.image_base64),key:`base64-image-${u}`}):r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(o,null,2)+"\n```"),key:`json-${u}`}):r.push({type:"markdown",content:Se(String(o)),key:`text-${u}`})});else if(typeof l=="string")r.push({type:"markdown",content:Se(l),key:"text-0"});else if(typeof l=="object")if(l.data&&Array.isArray(l.data.result)){const o=JSON.parse(JSON.stringify(l)),u=[];o.data&&o.data.result&&o.data.result.forEach((f,p)=>{f.image_base64&&f.image_base64.trim()!==""&&(u.push({type:"page",image_base64:f.image_base64,page_num:f.page_num,label:f.page_num!==void 0?`Page ${f.page_num}`:`Result ${p}`}),f.image_base64="[BASE64_IMAGE_DATA]"),f.seals&&Array.isArray(f.seals)&&f.seals.forEach((y,m)=>{y.image_base64&&y.image_base64.trim()!==""&&(u.push({type:"seal",image_base64:y.image_base64,page_num:f.page_num,seal_index:m,seal_value:y.value,label:`印章文字: ${y.value||""}`}),y.image_base64="[BASE64_IMAGE_DATA]")})}),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(o,null,2)+"\n```"),key:"json-0"}),u.forEach((f,p)=>{r.push({type:"image",url:this.formatBase64Image(f.image_base64),key:`result-image-${p}`,label:f.label})})}else{const o=JSON.parse(JSON.stringify(l)),u=[];this.extractImagesFromObject(o,u),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(o,null,2)+"\n```"),key:"json-0"}),u.forEach((f,p)=>{r.push({type:"image",url:this.formatBase64Image(f.value),key:`extracted-image-${p}`,label:f.label})})}else r.push({type:"markdown",content:Se(String(l)),key:"text-0"})}catch(o){console.error("Error rendering content:",o),r.push({type:"markdown",content:Se("Error rendering content"),key:"error-0"})}return r}}};var Up=function(){var n=this,r=n._self._c;return r("div",{staticClass:"output-viewer"},[n.title||n.$slots.title?r("div",{staticClass:"output-viewer-header"},[r("div",{staticClass:"output-viewer-title-row"},[r("span",{staticClass:"output-viewer-title"},[n._t("title",function(){return[n._v(n._s(n.title))]})],2),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:n.handleCopy}})],1)],1),n.showRawToggle?r("div",{staticClass:"output-viewer-actions"},[r("el-button",{attrs:{type:"text",size:"small"},on:{click:function(o){n.showRaw=!n.showRaw}}},[n._v(n._s(n.showRaw?n.$t("debug.switchToMarkdown"):n.$t("debug.switchToRaw")))])],1):n._e()]):n._e(),n.showRaw?r("div",{staticClass:"output-viewer-raw"},[r("codemirror",{key:`output-raw-${n.contentKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.value),options:n.cmOptions}})],1):r("div",{staticClass:"output-viewer-readable"},[n.isErrorResponse?r("div",{staticClass:"structured-content"},[r("div",{staticClass:"content-element"},[r("div",{staticClass:"markdown-content"},[n._v(n._s(n.errorMessage))])])]):n.previewMarkdown?r("div",{staticClass:"structured-content preview-content"},[r("div",{staticClass:"content-element"},[r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(n.renderMarkdown(n.previewMarkdown))}})])]):n.effectiveFileOnly&&n.value?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.value,!0),function(o){return r("div",{key:o.key,staticClass:"content-element"},[o.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(o.content)}}):o.type==="image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.url,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.url)}}})]):o.type==="file-image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.downloadUrl,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.downloadUrl)}}})]):o.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:o}})],1):o.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:o.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(o.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):n.value&&n.value.choices?r("div",{staticClass:"outputs-section"},n._l(n.value.choices,function(o,u){return r("div",{key:u,staticClass:"choice-item"},[r("div",{staticClass:"choice-content"},[o.message?r("div",[r("div",{staticClass:"message-header"},[r("i",{staticClass:"el-icon-user message-icon"}),r("span",[n._v(n._s(n.getMessageRoleLabel(o.message.role)))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(f){return n.copyChoiceContent(o.message.content)}}})],1)],1),r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(o.message.content,!1),function(f){return r("div",{key:f.key,staticClass:"content-element"},[f.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(f.content)}}):f.type==="image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.url,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.url)}}})]):f.type==="file-image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.downloadUrl,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.downloadUrl)}}})]):f.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:f}})],1):f.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:f.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(f.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0)]):r("div",[r("div",{staticClass:"message-header"},[r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(f){return n.copyChoiceContent(o)}}})],1)],1),r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(o,!1),function(f){return r("div",{key:f.key,staticClass:"content-element"},[f.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(f.content)}}):f.type==="image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.url,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.url)}}})]):f.type==="file-image"?r("div",{staticClass:"image-content"},[f.label?r("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:f.downloadUrl,alt:"content image"},on:{click:function(p){return n.handleImageClick(f.downloadUrl)}}})]):f.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:f}})],1):f.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:f.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(f.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0)])])])}),0):n.value?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.value,!1),function(o){return r("div",{key:o.key,staticClass:"content-element"},[o.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(o.content)}}):o.type==="image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.url,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.url)}}})]):o.type==="file-image"?r("div",{staticClass:"image-content"},[o.label?r("div",{staticClass:"image-label"},[n._v(n._s(o.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:o.downloadUrl,alt:"content image"},on:{click:function(u){return n.handleImageClick(o.downloadUrl)}}})]):o.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:o}})],1):o.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:o.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(o.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):n._e()])])},Gp=[],Kp=vn(qp,Up,Gp,!1,null,"a12c132d");const Hl=Kp.exports;var Wl={exports:{}},jl;function Vp(){return jl||(jl=1,function(l,n){(function(r){r(jt())})(function(r){var o={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},u={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};r.defineMode("xml",function(f,p){var y=f.indentUnit,m={},k=p.htmlMode?o:u;for(var S in k)m[S]=k[S];for(var S in p)m[S]=p[S];var R,L;function W(w,J){function G(K){return J.tokenize=K,K(w,J)}var A=w.next();if(A=="<")return w.eat("!")?w.eat("[")?w.match("CDATA[")?G($("atom","]]>")):null:w.match("--")?G($("comment","-->")):w.match("DOCTYPE",!0,!0)?(w.eatWhile(/[\w\._\-]/),G(I(1))):null:w.eat("?")?(w.eatWhile(/[\w\._\-]/),J.tokenize=$("meta","?>"),"meta"):(R=w.eat("/")?"closeTag":"openTag",J.tokenize=z,"tag bracket");if(A=="&"){var M;return w.eat("#")?w.eat("x")?M=w.eatWhile(/[a-fA-F\d]/)&&w.eat(";"):M=w.eatWhile(/[\d]/)&&w.eat(";"):M=w.eatWhile(/[\w\.\-:]/)&&w.eat(";"),M?"atom":"error"}else return w.eatWhile(/[^&<]/),null}W.isInText=!0;function z(w,J){var G=w.next();if(G==">"||G=="/"&&w.eat(">"))return J.tokenize=W,R=G==">"?"endTag":"selfcloseTag","tag bracket";if(G=="=")return R="equals",null;if(G=="<"){J.tokenize=W,J.state=ue,J.tagName=J.tagStart=null;var A=J.tokenize(w,J);return A?A+" tag error":"tag error"}else return/[\'\"]/.test(G)?(J.tokenize=D(G),J.stringStartCol=w.column(),J.tokenize(w,J)):(w.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(w){var J=function(G,A){for(;!G.eol();)if(G.next()==w){A.tokenize=z;break}return"string"};return J.isInAttribute=!0,J}function $(w,J){return function(G,A){for(;!G.eol();){if(G.match(J)){A.tokenize=W;break}G.next()}return w}}function I(w){return function(J,G){for(var A;(A=J.next())!=null;){if(A=="<")return G.tokenize=I(w+1),G.tokenize(J,G);if(A==">")if(w==1){G.tokenize=W;break}else return G.tokenize=I(w-1),G.tokenize(J,G)}return"meta"}}function N(w){return w&&w.toLowerCase()}function H(w,J,G){this.prev=w.context,this.tagName=J||"",this.indent=w.indented,this.startOfLine=G,(m.doNotIndent.hasOwnProperty(J)||w.context&&w.context.noIndent)&&(this.noIndent=!0)}function V(w){w.context&&(w.context=w.context.prev)}function ne(w,J){for(var G;;){if(!w.context||(G=w.context.tagName,!m.contextGrabbers.hasOwnProperty(N(G))||!m.contextGrabbers[N(G)].hasOwnProperty(N(J))))return;V(w)}}function ue(w,J,G){return w=="openTag"?(G.tagStart=J.column(),se):w=="closeTag"?de:ue}function se(w,J,G){return w=="word"?(G.tagName=J.current(),L="tag",ie):m.allowMissingTagName&&w=="endTag"?(L="tag bracket",ie(w,J,G)):(L="error",se)}function de(w,J,G){if(w=="word"){var A=J.current();return G.context&&G.context.tagName!=A&&m.implicitlyClosed.hasOwnProperty(N(G.context.tagName))&&V(G),G.context&&G.context.tagName==A||m.matchClosing===!1?(L="tag",Oe):(L="tag error",Re)}else return m.allowMissingTagName&&w=="endTag"?(L="tag bracket",Oe(w,J,G)):(L="error",Re)}function Oe(w,J,G){return w!="endTag"?(L="error",Oe):(V(G),ue)}function Re(w,J,G){return L="error",Oe(w,J,G)}function ie(w,J,G){if(w=="word")return L="attribute",Pe;if(w=="endTag"||w=="selfcloseTag"){var A=G.tagName,M=G.tagStart;return G.tagName=G.tagStart=null,w=="selfcloseTag"||m.autoSelfClosers.hasOwnProperty(N(A))?ne(G,A):(ne(G,A),G.context=new H(G,A,M==G.indented)),ue}return L="error",ie}function Pe(w,J,G){return w=="equals"?j:(m.allowMissing||(L="error"),ie(w,J,G))}function j(w,J,G){return w=="string"?Q:w=="word"&&m.allowUnquoted?(L="string",ie):(L="error",ie(w,J,G))}function Q(w,J,G){return w=="string"?Q:ie(w,J,G)}return{startState:function(w){var J={tokenize:W,state:ue,indented:w||0,tagName:null,tagStart:null,context:null};return w!=null&&(J.baseIndent=w),J},token:function(w,J){if(!J.tagName&&w.sol()&&(J.indented=w.indentation()),w.eatSpace())return null;R=null;var G=J.tokenize(w,J);return(G||R)&&G!="comment"&&(L=null,J.state=J.state(R||G,w,J),L&&(G=L=="error"?G+" error":L)),G},indent:function(w,J,G){var A=w.context;if(w.tokenize.isInAttribute)return w.tagStart==w.indented?w.stringStartCol+1:w.indented+y;if(A&&A.noIndent)return r.Pass;if(w.tokenize!=z&&w.tokenize!=W)return G?G.match(/^(\s*)/)[0].length:0;if(w.tagName)return m.multilineTagIndentPastTag!==!1?w.tagStart+w.tagName.length+2:w.tagStart+y*(m.multilineTagIndentFactor||1);if(m.alignCDATA&&/<!\[CDATA\[/.test(J))return 0;var M=J&&/^<(\/)?([\w_:\.-]*)/.exec(J);if(M&&M[1])for(;A;)if(A.tagName==M[2]){A=A.prev;break}else if(m.implicitlyClosed.hasOwnProperty(N(A.tagName)))A=A.prev;else break;else if(M)for(;A;){var K=m.contextGrabbers[N(A.tagName)];if(K&&K.hasOwnProperty(N(M[2])))A=A.prev;else break}for(;A&&A.prev&&!A.startOfLine;)A=A.prev;return A?A.indent+y:w.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:m.htmlMode?"html":"xml",helperType:m.htmlMode?"html":"xml",skipAttribute:function(w){w.state==j&&(w.state=ie)},xmlCurrentTag:function(w){return w.tagName?{name:w.tagName,close:w.type=="closeTag"}:null},xmlCurrentContext:function(w){for(var J=[],G=w.context;G;G=G.prev)J.push(G.tagName);return J.reverse()}}}),r.defineMIME("text/xml","xml"),r.defineMIME("application/xml","xml"),r.mimeModes.hasOwnProperty("text/html")||r.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),Wl.exports}var ql={exports:{}},Ul;function Xp(){return Ul||(Ul=1,function(l,n){(function(r){r(jt())})(function(r){r.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var o=0;o<r.modeInfo.length;o++){var u=r.modeInfo[o];u.mimes&&(u.mime=u.mimes[0])}r.findModeByMIME=function(f){f=f.toLowerCase();for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.mime==f)return y;if(y.mimes){for(var m=0;m<y.mimes.length;m++)if(y.mimes[m]==f)return y}}if(/\+xml$/.test(f))return r.findModeByMIME("application/xml");if(/\+json$/.test(f))return r.findModeByMIME("application/json")},r.findModeByExtension=function(f){f=f.toLowerCase();for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.ext){for(var m=0;m<y.ext.length;m++)if(y.ext[m]==f)return y}}},r.findModeByFileName=function(f){for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.file&&y.file.test(f))return y}var m=f.lastIndexOf("."),k=m>-1&&f.substring(m+1,f.length);if(k)return r.findModeByExtension(k)},r.findModeByName=function(f){f=f.toLowerCase();for(var p=0;p<r.modeInfo.length;p++){var y=r.modeInfo[p];if(y.name.toLowerCase()==f)return y;if(y.alias){for(var m=0;m<y.alias.length;m++)if(y.alias[m].toLowerCase()==f)return y}}}})}()),ql.exports}(function(l,n){(function(r){r(jt(),Vp(),Xp())})(function(r){r.defineMode("markdown",function(o,u){var f=r.getMode(o,"text/html"),p=f.name=="null";function y(E){if(r.findModeByName){var x=r.findModeByName(E);x&&(E=x.mime||x.mimes[0])}var oe=r.getMode(o,E);return oe.name=="null"?null:oe}u.highlightFormatting===void 0&&(u.highlightFormatting=!1),u.maxBlockquoteDepth===void 0&&(u.maxBlockquoteDepth=0),u.taskLists===void 0&&(u.taskLists=!1),u.strikethrough===void 0&&(u.strikethrough=!1),u.emoji===void 0&&(u.emoji=!1),u.fencedCodeBlockHighlighting===void 0&&(u.fencedCodeBlockHighlighting=!0),u.fencedCodeBlockDefaultMode===void 0&&(u.fencedCodeBlockDefaultMode="text/plain"),u.xml===void 0&&(u.xml=!0),u.tokenTypeOverrides===void 0&&(u.tokenTypeOverrides={});var m={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var k in m)m.hasOwnProperty(k)&&u.tokenTypeOverrides[k]&&(m[k]=u.tokenTypeOverrides[k]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,L=/^\[(x| )\](?=\s)/i,W=u.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,z=/^ {0,3}(?:\={1,}|-{2,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,$=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,I=/^\s*\[[^\]]+?\]:.*$/,N=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,H=" ";function V(E,x,oe){return x.f=x.inline=oe,oe(E,x)}function ne(E,x,oe){return x.f=x.block=oe,oe(E,x)}function ue(E){return!E||!/\S/.test(E.string)}function se(E){if(E.linkTitle=!1,E.linkHref=!1,E.linkText=!1,E.em=!1,E.strong=!1,E.strikethrough=!1,E.quote=0,E.indentedCode=!1,E.f==Oe){var x=p;if(!x){var oe=r.innerMode(f,E.htmlState);x=oe.mode.name=="xml"&&oe.state.tagStart===null&&!oe.state.context&&oe.state.tokenize.isInText}x&&(E.f=j,E.block=de,E.htmlState=null)}return E.trailingSpace=0,E.trailingSpaceNewLine=!1,E.prevLine=E.thisLine,E.thisLine={stream:null},null}function de(E,x){var oe=E.column()===x.indentation,_e=ue(x.prevLine.stream),Z=x.indentedCode,fe=x.prevLine.hr,ke=x.list!==!1,Le=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var ct=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,ke)){for(x.list=null;ct<x.listStack[x.listStack.length-1];)x.listStack.pop(),x.listStack.length?x.indentation=x.listStack[x.listStack.length-1]:x.list=!1;x.list!==!1&&(x.indentationDiff=ct-x.listStack[x.listStack.length-1])}var we=!_e&&!fe&&!x.prevLine.header&&(!ke||!Z)&&!x.prevLine.fencedCodeEnd,Fe=(x.list===!1||fe||_e)&&x.indentation<=Le&&E.match(S),Ke=null;if(x.indentationDiff>=4&&(Z||x.prevLine.fencedCodeEnd||x.prevLine.header||_e))return E.skipToEnd(),x.indentedCode=!0,m.code;if(E.eatSpace())return null;if(oe&&x.indentation<=Le&&(Ke=E.match(W))&&Ke[1].length<=6)return x.quote=0,x.header=Ke[1].length,x.thisLine.header=!0,u.highlightFormatting&&(x.formatting="header"),x.f=x.inline,ie(x);if(x.indentation<=Le&&E.eat(">"))return x.quote=oe?1:x.quote+1,u.highlightFormatting&&(x.formatting="quote"),E.eatSpace(),ie(x);if(!Fe&&!x.setext&&oe&&x.indentation<=Le&&(Ke=E.match(R))){var ft=Ke[1]?"ol":"ul";return x.indentation=ct+E.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,u.taskLists&&E.match(L,!1)&&(x.taskList=!0),x.f=x.inline,u.highlightFormatting&&(x.formatting=["list","list-"+ft]),ie(x)}else{if(oe&&x.indentation<=Le&&(Ke=E.match($,!0)))return x.quote=0,x.fencedEndRE=new RegExp(Ke[1]+"+ *$"),x.localMode=u.fencedCodeBlockHighlighting&&y(Ke[2]||u.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=r.startState(x.localMode)),x.f=x.block=Re,u.highlightFormatting&&(x.formatting="code-block"),x.code=-1,ie(x);if(x.setext||(!we||!ke)&&!x.quote&&x.list===!1&&!x.code&&!Fe&&!I.test(E.string)&&(Ke=E.lookAhead(1))&&(Ke=Ke.match(z)))return x.setext?(x.header=x.setext,x.setext=0,E.skipToEnd(),u.highlightFormatting&&(x.formatting="header")):(x.header=Ke[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,ie(x);if(Fe)return E.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,m.hr;if(E.peek()==="[")return V(E,x,A)}return V(E,x,x.inline)}function Oe(E,x){var oe=f.token(E,x.htmlState);if(!p){var _e=r.innerMode(f,x.htmlState);(_e.mode.name=="xml"&&_e.state.tagStart===null&&!_e.state.context&&_e.state.tokenize.isInText||x.md_inside&&E.current().indexOf(">")>-1)&&(x.f=j,x.block=de,x.htmlState=null)}return oe}function Re(E,x){var oe=x.listStack[x.listStack.length-1]||0,_e=x.indentation<oe,Z=oe+3;if(x.fencedEndRE&&x.indentation<=Z&&(_e||E.match(x.fencedEndRE))){u.highlightFormatting&&(x.formatting="code-block");var fe;return _e||(fe=ie(x)),x.localMode=x.localState=null,x.block=de,x.f=j,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,_e?ne(E,x,x.block):fe}else return x.localMode?x.localMode.token(E,x.localState):(E.skipToEnd(),m.code)}function ie(E){var x=[];if(E.formatting){x.push(m.formatting),typeof E.formatting=="string"&&(E.formatting=[E.formatting]);for(var oe=0;oe<E.formatting.length;oe++)x.push(m.formatting+"-"+E.formatting[oe]),E.formatting[oe]==="header"&&x.push(m.formatting+"-"+E.formatting[oe]+"-"+E.header),E.formatting[oe]==="quote"&&(!u.maxBlockquoteDepth||u.maxBlockquoteDepth>=E.quote?x.push(m.formatting+"-"+E.formatting[oe]+"-"+E.quote):x.push("error"))}if(E.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(E.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(E.linkHref?x.push(m.linkHref,"url"):(E.strong&&x.push(m.strong),E.em&&x.push(m.em),E.strikethrough&&x.push(m.strikethrough),E.emoji&&x.push(m.emoji),E.linkText&&x.push(m.linkText),E.code&&x.push(m.code),E.image&&x.push(m.image),E.imageAltText&&x.push(m.imageAltText,"link"),E.imageMarker&&x.push(m.imageMarker)),E.header&&x.push(m.header,m.header+"-"+E.header),E.quote&&(x.push(m.quote),!u.maxBlockquoteDepth||u.maxBlockquoteDepth>=E.quote?x.push(m.quote+"-"+E.quote):x.push(m.quote+"-"+u.maxBlockquoteDepth)),E.list!==!1){var _e=(E.listStack.length-1)%3;_e?_e===1?x.push(m.list2):x.push(m.list3):x.push(m.list1)}return E.trailingSpaceNewLine?x.push("trailing-space-new-line"):E.trailingSpace&&x.push("trailing-space-"+(E.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function Pe(E,x){if(E.match(D,!0))return ie(x)}function j(E,x){var oe=x.text(E,x);if(typeof oe<"u")return oe;if(x.list)return x.list=null,ie(x);if(x.taskList){var _e=E.match(L,!0)[1]===" ";return _e?x.taskOpen=!0:x.taskClosed=!0,u.highlightFormatting&&(x.formatting="task"),x.taskList=!1,ie(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&E.match(/^#+$/,!0))return u.highlightFormatting&&(x.formatting="header"),ie(x);var Z=E.next();if(x.linkTitle){x.linkTitle=!1;var fe=Z;Z==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ke="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(E.match(new RegExp(ke),!0))return m.linkHref}if(Z==="`"){var Le=x.formatting;u.highlightFormatting&&(x.formatting="code"),E.eatWhile("`");var ct=E.current().length;if(x.code==0&&(!x.quote||ct==1))return x.code=ct,ie(x);if(ct==x.code){var we=ie(x);return x.code=0,we}else return x.formatting=Le,ie(x)}else if(x.code)return ie(x);if(Z==="\\"&&(E.next(),u.highlightFormatting)){var Fe=ie(x),Ke=m.formatting+"-escape";return Fe?Fe+" "+Ke:Ke}if(Z==="!"&&E.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,u.highlightFormatting&&(x.formatting="image"),ie(x);if(Z==="["&&x.imageMarker&&E.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,u.highlightFormatting&&(x.formatting="image"),ie(x);if(Z==="]"&&x.imageAltText){u.highlightFormatting&&(x.formatting="image");var Fe=ie(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=w,Fe}if(Z==="["&&!x.image)return x.linkText&&E.match(/^.*?\]/)||(x.linkText=!0,u.highlightFormatting&&(x.formatting="link")),ie(x);if(Z==="]"&&x.linkText){u.highlightFormatting&&(x.formatting="link");var Fe=ie(x);return x.linkText=!1,x.inline=x.f=E.match(/\(.*?\)| ?\[.*?\]/,!1)?w:j,Fe}if(Z==="<"&&E.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=Q,u.highlightFormatting&&(x.formatting="link");var Fe=ie(x);return Fe?Fe+=" ":Fe="",Fe+m.linkInline}if(Z==="<"&&E.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=Q,u.highlightFormatting&&(x.formatting="link");var Fe=ie(x);return Fe?Fe+=" ":Fe="",Fe+m.linkEmail}if(u.xml&&Z==="<"&&E.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ft=E.string.indexOf(">",E.pos);if(ft!=-1){var Pt=E.string.substring(E.start,ft);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Pt)&&(x.md_inside=!0)}return E.backUp(1),x.htmlState=r.startState(f),ne(E,x,Oe)}if(u.xml&&Z==="<"&&E.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(Z==="*"||Z==="_"){for(var dt=1,ht=E.pos==1?" ":E.string.charAt(E.pos-2);dt<3&&E.eat(Z);)dt++;var gt=E.peek()||" ",Kt=!/\s/.test(gt)&&(!N.test(gt)||/\s/.test(ht)||N.test(ht)),be=!/\s/.test(ht)&&(!N.test(ht)||/\s/.test(gt)||N.test(gt)),St=null,Vt=null;if(dt%2&&(!x.em&&Kt&&(Z==="*"||!be||N.test(ht))?St=!0:x.em==Z&&be&&(Z==="*"||!Kt||N.test(gt))&&(St=!1)),dt>1&&(!x.strong&&Kt&&(Z==="*"||!be||N.test(ht))?Vt=!0:x.strong==Z&&be&&(Z==="*"||!Kt||N.test(gt))&&(Vt=!1)),Vt!=null||St!=null){u.highlightFormatting&&(x.formatting=St==null?"strong":Vt==null?"em":"strong em"),St===!0&&(x.em=Z),Vt===!0&&(x.strong=Z);var we=ie(x);return St===!1&&(x.em=!1),Vt===!1&&(x.strong=!1),we}}else if(Z===" "&&(E.eat("*")||E.eat("_"))){if(E.peek()===" ")return ie(x);E.backUp(1)}if(u.strikethrough){if(Z==="~"&&E.eatWhile(Z)){if(x.strikethrough){u.highlightFormatting&&(x.formatting="strikethrough");var we=ie(x);return x.strikethrough=!1,we}else if(E.match(/^[^\s]/,!1))return x.strikethrough=!0,u.highlightFormatting&&(x.formatting="strikethrough"),ie(x)}else if(Z===" "&&E.match("~~",!0)){if(E.peek()===" ")return ie(x);E.backUp(2)}}if(u.emoji&&Z===":"&&E.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,u.highlightFormatting&&(x.formatting="emoji");var On=ie(x);return x.emoji=!1,On}return Z===" "&&(E.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),ie(x)}function Q(E,x){var oe=E.next();if(oe===">"){x.f=x.inline=j,u.highlightFormatting&&(x.formatting="link");var _e=ie(x);return _e?_e+=" ":_e="",_e+m.linkInline}return E.match(/^[^>]+/,!0),m.linkInline}function w(E,x){if(E.eatSpace())return null;var oe=E.next();return oe==="("||oe==="["?(x.f=x.inline=G(oe==="("?")":"]"),u.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,ie(x)):"error"}var J={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function G(E){return function(x,oe){var _e=x.next();if(_e===E){oe.f=oe.inline=j,u.highlightFormatting&&(oe.formatting="link-string");var Z=ie(oe);return oe.linkHref=!1,Z}return x.match(J[E]),oe.linkHref=!0,ie(oe)}}function A(E,x){return E.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=M,E.next(),u.highlightFormatting&&(x.formatting="link"),x.linkText=!0,ie(x)):V(E,x,j)}function M(E,x){if(E.match("]:",!0)){x.f=x.inline=K,u.highlightFormatting&&(x.formatting="link");var oe=ie(x);return x.linkText=!1,oe}return E.match(/^([^\]\\]|\\.)+/,!0),m.linkText}function K(E,x){return E.eatSpace()?null:(E.match(/^[^\s]+/,!0),E.peek()===void 0?x.linkTitle=!0:E.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),x.f=x.inline=j,m.linkHref+" url")}var he={startState:function(){return{f:de,prevLine:{stream:null},thisLine:{stream:null},block:de,htmlState:null,indentation:0,inline:j,text:Pe,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(E){return{f:E.f,prevLine:E.prevLine,thisLine:E.thisLine,block:E.block,htmlState:E.htmlState&&r.copyState(f,E.htmlState),indentation:E.indentation,localMode:E.localMode,localState:E.localMode?r.copyState(E.localMode,E.localState):null,inline:E.inline,text:E.text,formatting:!1,linkText:E.linkText,linkTitle:E.linkTitle,linkHref:E.linkHref,code:E.code,em:E.em,strong:E.strong,strikethrough:E.strikethrough,emoji:E.emoji,header:E.header,setext:E.setext,hr:E.hr,taskList:E.taskList,list:E.list,listStack:E.listStack.slice(0),quote:E.quote,indentedCode:E.indentedCode,trailingSpace:E.trailingSpace,trailingSpaceNewLine:E.trailingSpaceNewLine,md_inside:E.md_inside,fencedEndRE:E.fencedEndRE}},token:function(E,x){if(x.formatting=!1,E!=x.thisLine.stream){if(x.header=0,x.hr=!1,E.match(/^\s*$/,!0))return se(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:E},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=Oe)){var oe=E.match(/^\s*/,!0)[0].replace(/\t/g,H).length;if(x.indentation=oe,x.indentationDiff=null,oe>0)return null}}return x.f(E,x)},innerMode:function(E){return E.block==Oe?{state:E.htmlState,mode:f}:E.localState?{state:E.localState,mode:E.localMode}:{state:E,mode:he}},indent:function(E,x,oe){return E.block==Oe&&f.indent?f.indent(E.htmlState,x,oe):E.localState&&E.localMode.indent?E.localMode.indent(E.localState,x,oe):r.Pass},blankLine:se,getType:ie,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return he},"xml"),r.defineMIME("text/markdown","markdown"),r.defineMIME("text/x-markdown","markdown")})})();const Yp={name:"DebugTab",components:{codemirror:za.codemirror,FilePdfViewer:Xa,OutputViewer:Hl},props:{selectedSpan:{type:Object,required:!0},selectedSpanId:{type:String,required:!0}},data(){return{debugForm:{params:[],systemContent:"",userContent:""},debugSubmitting:!1,debugResponse:null,responsePreview:null,debugResponseIsError:!1,debugResponseKey:0,debugMarkdownKey:0,originalInputs:null,hasImageUrl:!1,submitImage:!0,sendFile:!0,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},cmOptionsMarkdown:{tabSize:2,mode:"markdown",theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!1,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},tokenCalculating:!1,promptTokensResult:null,tokenCounterEnabled:!1}},computed:{promptTokensTableData(){if(!this.promptTokensResult)return[];const l=this.promptTokensResult;return[{key:"debug.specialTokens",value:l.special_tokens||"0"},{key:"debug.systemTokens",value:l.system_tokens||"0"},{key:"debug.userTokens",value:l.user_tokens||"0"},{key:"debug.assistantTokens",value:l.assistant_tokens||"0"},{key:"debug.textTokens",value:l.text_tokens||"0"}].map(r=>({name:this.$t(r.key),value:r.value})).filter(r=>r.value!=="0"&&r.value!==0)},rawInputs(){var l,n,r;return(r=(n=(l=this.selectedSpan)==null?void 0:l.parsedContent)==null?void 0:n.attributes)==null?void 0:r["langsword.spanInputs"]},targetUrl(){var n,r;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.attributes;return l&&l["url.full"]?l["url.full"]:null},clientHasFileInput(){var n;let l=!1;return this.originalInputs&&Object.keys(this.originalInputs).forEach(r=>{r.startsWith("__file__")&&(l=!0)}),((n=this.selectedSpan)==null?void 0:n.type)==="CLIENT"&&l}},watch:{selectedSpanId:{immediate:!0,handler(l,n){l&&l!==n&&this.$nextTick(()=>{this.initDebugForm()})}},"selectedSpan.parsedContent":{deep:!0,handler(){this.selectedSpan&&this.selectedSpanId&&this.$nextTick(()=>{this.initDebugForm()})}}},mounted(){this.selectedSpan&&this.selectedSpanId&&this.$nextTick(()=>{this.initDebugForm()}),this.fetchTracingSetting()},methods:{getMessageRoleLabel(l){const n={system:"debug.systemRole",user:"debug.userRole",assistant:"debug.assistantRole"};return n[l]?this.$t(n[l]):l},copyContent(l){const n=l==="system"?this.debugForm.systemContent:this.debugForm.userContent;Bi(n,this)},handleOutputCopy(l){Bi(l,this)},initDebugForm(){var n,r;if(!this.selectedSpan)return;let l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.inputs;if(!l&&this.rawInputs)try{l=typeof this.rawInputs=="string"?JSON.parse(this.rawInputs):this.rawInputs}catch(o){console.error("Failed to parse rawInputs:",o);return}if(!l){console.warn("No inputs found for span:",this.selectedSpanId);return}if(this.originalInputs=JSON.parse(JSON.stringify(l)),this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="EMBEDDING"){this.debugForm.params=[],this.debugForm.systemContent="",this.debugForm.userContent="";let o=!1;this.originalInputs&&Object.keys(this.originalInputs).forEach(u=>{u.startsWith("__file__")&&(o=!0)}),this.sendFile=o,Object.keys(l).forEach(u=>{if(!u.startsWith("__file__")){const f=l[u];let p="";typeof f=="string"?p=f:typeof f=="boolean"||typeof f=="number"?p=String(f):p=JSON.stringify(f),this.debugForm.params.push({key:u,value:p})}})}else if(this.selectedSpan.type==="CHAT_MODEL")if(this.debugForm.params=[],this.hasImageUrl=!1,this.submitImage=!0,Object.keys(l).forEach(o=>{if(o!=="messages"){const u=l[o];let f="";typeof u=="string"?f=u:typeof u=="boolean"||typeof u=="number"?f=String(u):f=JSON.stringify(u),this.debugForm.params.push({key:o,value:f})}}),l.messages&&Array.isArray(l.messages)){const o=l.messages.find(f=>f.role==="system"),u=l.messages.find(f=>f.role==="user");if(o&&o.content?this.debugForm.systemContent=typeof o.content=="string"?o.content:"":this.debugForm.systemContent="",u&&u.content)if(Array.isArray(u.content)){const f=u.content.filter(y=>y.type==="text"&&y.text).map(y=>y.text);this.debugForm.userContent=f.join(`
|
|
79
|
+
`);const p=u.content.some(y=>y.type==="image_url");this.hasImageUrl=p}else typeof u.content=="string"?this.debugForm.userContent=u.content:this.debugForm.userContent="";else this.debugForm.userContent=""}else this.debugForm.systemContent="",this.debugForm.userContent="";this.debugResponse=null,this.debugResponseIsError=!1,this.promptTokensResult=null,this.$nextTick(()=>{this.$refs.systemContentEditor&&this.$refs.systemContentEditor.codemirror&&this.$refs.systemContentEditor.codemirror.setValue(this.debugForm.systemContent||""),this.$refs.userContentEditor&&this.$refs.userContentEditor.codemirror&&this.$refs.userContentEditor.codemirror.setValue(this.debugForm.userContent||"")})},addDebugParam(){this.debugForm.params.push({key:"",value:""})},removeDebugParam(l){this.debugForm.params.splice(l,1)},handleDebugParamChange(){},resetDebugForm(){this.initDebugForm()},parseParamValue(l){if(l==="true"||l==="false")return l==="true";if(l==="")return"";{const n=Number(l);return!isNaN(n)&&isFinite(n)?n:l}},buildRequestHeaders(l){const n={};let r=null;const o=Object.keys(l).find(u=>u.toLowerCase()==="x-target-url");return o?(r=l[o],delete l[o]):this.targetUrl&&(r=this.targetUrl),r&&(n["X-Target-Url"]=r),n},handleDebugResponse(l){console.log("debug response:",l),this.debugResponse=l.original_response?JSON.parse(l.original_response):l,this.responsePreview=l.response_preview,this.debugResponseIsError=!1,this.$nextTick(()=>{this.debugResponseKey++})},handleDebugError(l){if(console.error("Debug request failed:",l),l.response&&l.response.data!==void 0){const n=l.response.data;this.debugResponse=typeof n=="object"&&n!==null?n:{_raw:n},this.debugResponseIsError=!0,this.$nextTick(()=>{this.debugResponseKey++})}else l.response&&l.response.data===void 0&&(this.debugResponse={_status:l.response.status,_statusText:l.response.statusText},this.debugResponseIsError=!0,this.$nextTick(()=>{this.debugResponseKey++}))},async submitDebugRequest(l){const n=this.buildRequestHeaders(l),r=await kt.debugTrace(l,n);this.handleDebugResponse(r)},async submitDebugClient(){if(!(!this.selectedSpan||!this.originalInputs)){this.debugSubmitting=!0;try{const l={};this.sendFile&&this.originalInputs&&Object.keys(this.originalInputs).forEach(n=>{n.startsWith("__file__")&&this.originalInputs[n]&&(l[n]=this.originalInputs[n])}),this.debugForm.params.forEach(n=>{if(n.key&&n.key.trim()){const r=n.value?n.value.trim():"";l[n.key]=this.parseParamValue(r)}}),await this.submitDebugRequest(l)}catch(l){this.handleDebugError(l)}finally{this.debugSubmitting=!1}}},async submitDebugChatModel(){if(!(!this.selectedSpan||!this.originalInputs)){this.debugSubmitting=!0;try{const l=JSON.parse(JSON.stringify(this.originalInputs));if(this.debugForm.params.forEach(n=>{if(n.key&&n.key.trim()){const r=n.value?n.value.trim():"";l[n.key]=this.parseParamValue(r)}}),l.messages&&Array.isArray(l.messages)){const n=l.messages.find(o=>o.role==="system");n&&(n.content=this.debugForm.systemContent||"");const r=l.messages.find(o=>o.role==="user");if(r){const o=this.originalInputs.messages.find(f=>f.role==="user");if(o&&Array.isArray(o.content)){const f=[];this.submitImage&&Array.isArray(r.content)&&r.content.forEach(p=>{p.type==="image_url"&&f.push(p)}),this.debugForm.userContent&&this.debugForm.userContent.trim()&&f.push({type:"text",text:this.debugForm.userContent}),r.content=f.length>0?f:this.debugForm.userContent||""}else r.content=this.debugForm.userContent||""}}await this.submitDebugRequest(l)}catch(l){this.handleDebugError(l)}finally{this.debugSubmitting=!1}}},async fetchTracingSetting(){try{const l=await kt.getSetting();this.tokenCounterEnabled=(l==null?void 0:l.token_counter_enabled)==="true"}catch{this.tokenCounterEnabled=!1}},async calculatePromptTokens(){if(!this.selectedSpan||this.selectedSpan.type!=="CHAT_MODEL")return;const l=[];if(this.debugForm.systemContent&&this.debugForm.systemContent.trim()&&l.push({role:"system",content:this.debugForm.systemContent.trim()}),this.debugForm.userContent&&this.debugForm.userContent.trim()&&l.push({role:"user",content:this.debugForm.userContent.trim()}),l.length===0){this.$message.warning("请至少填写系统提示词或用户提示词");return}const n=this.debugForm.params.find(o=>o.key&&o.key.trim().toLowerCase()==="model"),r={messages:l};n&&n.value&&n.value.trim()&&(r.model=n.value.trim()),this.tokenCalculating=!0;try{const o=await kt.getPromptTokens(r);this.promptTokensResult=o}catch(o){console.error("Token calculation failed:",o);let u="未知错误";if(o.response&&o.response.data){const f=o.response.data;typeof f=="object"&&f!==null&&f.message?u=f.message:o.message&&(u=o.message)}else o.message&&(u=o.message);this.$message.error("Token计算失败: "+u)}finally{this.tokenCalculating=!1}}}};var Jp=function(){var n=this,r=n._self._c;return r("div",{staticClass:"debug-content"},[n.selectedSpan.type==="CLIENT"||n.selectedSpan.type==="EMBEDDING"?r("div",{staticClass:"debug-client-form"},[r("el-form",{attrs:{model:n.debugForm,"label-width":"60px",size:"small"}},[n._l(n.debugForm.params,function(o,u){return r("div",{key:u,staticClass:"debug-form-row"},[r("el-form-item",{attrs:{label:`${n.$t("debug.paramLabel")} ${u+1}`}},[r("el-row",{attrs:{gutter:10,type:"flex",align:"middle"}},[r("el-col",{attrs:{span:8}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramName")},on:{input:n.handleDebugParamChange},model:{value:o.key,callback:function(f){n.$set(o,"key",f)},expression:"item.key"}})],1),r("el-col",{attrs:{span:14}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramValue")},on:{input:n.handleDebugParamChange},model:{value:o.value,callback:function(f){n.$set(o,"value",f)},expression:"item.value"}})],1),r("el-col",{attrs:{span:2}},[r("el-button",{staticClass:"delete-param-btn",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(f){return n.removeDebugParam(u)}}})],1)],1)],1)],1)}),n.clientHasFileInput?r("el-form-item",[r("el-checkbox",{model:{value:n.sendFile,callback:function(o){n.sendFile=o},expression:"sendFile"}},[n._v(n._s(n.$t("debug.sendFile")))])],1):n._e(),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:n.addDebugParam}},[n._v(n._s(n.$t("debug.addParam")))]),r("el-button",{attrs:{type:"warning",icon:"el-icon-refresh",size:"small"},on:{click:n.resetDebugForm}},[n._v(n._s(n.$t("debug.reset")))]),r("el-button",{attrs:{type:"success",icon:"el-icon-check",size:"small",loading:n.debugSubmitting},on:{click:n.submitDebugClient}},[n._v(n._s(n.$t("debug.submit")))])],1)],2),n.debugResponse!==null?r("div",{staticClass:"debug-response"},[r("OutputViewer",{attrs:{value:n.debugResponse,"show-raw-toggle":!0,"is-error-response":n.debugResponseIsError,"preview-markdown":n.responsePreview,"support-file-elements":!0,title:n.$t("debug.responseResult"),"content-key":`${n.selectedSpanId}-${n.debugResponseKey}`},on:{copy:n.handleOutputCopy}})],1):n._e()],1):n._e(),n.selectedSpan.type==="CHAT_MODEL"?r("div",{staticClass:"debug-chat-model-form"},[r("el-form",{attrs:{model:n.debugForm,"label-width":"60px",size:"small"}},[r("el-form-item",{scopedSlots:n._u([{key:"label",fn:function(){return[r("span",[n._v(n._s(n.$t("debug.systemPrompt")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(o){return n.copyContent("system")}}})],1)]},proxy:!0}],null,!1,671448622)},[r("codemirror",{key:`debug-system-${n.selectedSpanId}-${n.debugMarkdownKey}`,ref:"systemContentEditor",staticClass:"code-editor-wrapper markdown-editor",attrs:{options:n.cmOptionsMarkdown},model:{value:n.debugForm.systemContent,callback:function(o){n.$set(n.debugForm,"systemContent",o)},expression:"debugForm.systemContent"}})],1),r("el-form-item",{scopedSlots:n._u([{key:"label",fn:function(){return[r("span",[n._v(n._s(n.$t("debug.userPrompt")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},on:{click:function(o){return n.copyContent("user")}}})],1)]},proxy:!0}],null,!1,1846549358)},[r("codemirror",{key:`debug-user-${n.selectedSpanId}-${n.debugMarkdownKey}`,ref:"userContentEditor",staticClass:"code-editor-wrapper markdown-editor",attrs:{options:n.cmOptionsMarkdown},model:{value:n.debugForm.userContent,callback:function(o){n.$set(n.debugForm,"userContent",o)},expression:"debugForm.userContent"}})],1),n.selectedSpan.type==="CHAT_MODEL"&&n.hasImageUrl?r("el-form-item",{attrs:{label:n.$t("debug.submitImage")}},[r("el-switch",{attrs:{"active-text":n.$t("debug.yes"),"inactive-text":n.$t("debug.no")},model:{value:n.submitImage,callback:function(o){n.submitImage=o},expression:"submitImage"}})],1):n._e(),n._l(n.debugForm.params,function(o,u){return r("div",{key:u,staticClass:"debug-form-row"},[r("el-form-item",{attrs:{label:`${n.$t("debug.paramLabel")} ${u+1}`}},[r("el-row",{attrs:{gutter:10,type:"flex",align:"middle"}},[r("el-col",{attrs:{span:8}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramName")},on:{input:n.handleDebugParamChange},model:{value:o.key,callback:function(f){n.$set(o,"key",f)},expression:"item.key"}})],1),r("el-col",{attrs:{span:14}},[r("el-input",{attrs:{placeholder:n.$t("debug.paramValue")},on:{input:n.handleDebugParamChange},model:{value:o.value,callback:function(f){n.$set(o,"value",f)},expression:"item.value"}})],1),r("el-col",{attrs:{span:2}},[r("el-button",{staticClass:"delete-param-btn",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(f){return n.removeDebugParam(u)}}})],1)],1)],1)],1)}),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:n.addDebugParam}},[n._v(n._s(n.$t("debug.addParam")))]),r("el-button",{attrs:{type:"warning",icon:"el-icon-refresh",size:"small"},on:{click:n.resetDebugForm}},[n._v(n._s(n.$t("debug.reset")))]),r("el-button",{attrs:{type:"success",icon:"el-icon-check",size:"small",loading:n.debugSubmitting},on:{click:n.submitDebugChatModel}},[n._v(n._s(n.$t("debug.submit")))]),n.tokenCounterEnabled?r("el-tooltip",{attrs:{content:n.$t("debug.calculateTokensTooltip"),placement:"top"}},[r("el-button",{attrs:{type:"info",icon:"el-icon-cpu",size:"small",loading:n.tokenCalculating},on:{click:n.calculatePromptTokens}},[n._v(n._s(n.$t("debug.calculateTokens")))])],1):n._e()],1)],2),n.promptTokensResult!==null?r("div",{staticClass:"token-result-section"},[r("div",{staticClass:"token-result-header"},[n._v(n._s(n.$t("debug.tokenResultTitle")))]),r("el-table",{attrs:{data:n.promptTokensTableData,size:"small",border:""}},[r("el-table-column",{attrs:{prop:"name",label:n.$t("debug.tokenType"),width:"140"}}),r("el-table-column",{attrs:{prop:"value",label:n.$t("debug.tokenCount")}})],1)],1):n._e(),n.debugResponse!==null?r("div",{staticClass:"debug-response"},[r("OutputViewer",{attrs:{value:n.debugResponse,"show-raw-toggle":!0,"is-error-response":n.debugResponseIsError,"support-file-elements":!0,title:n.$t("debug.responseResult"),"content-key":`${n.selectedSpanId}-${n.debugResponseKey}`},on:{copy:n.handleOutputCopy}})],1):n._e()],1):n._e()])},Qp=[],Zp=vn(Yp,Jp,Qp,!1,null,"8d08f36c");const eg=Zp.exports;Se.setOptions({breaks:!0});const tg={name:"TraceDetailDrawer",components:{TraceSpanTree:Va,DebugTab:eg,codemirror:za.codemirror,FilePdfViewer:Xa,OutputViewer:Hl},props:{visible:{type:Boolean,default:!1},currentTraceId:{type:String,default:null},traceInfo:{type:Object,default:()=>({})},spans:{type:Array,default:()=>[]},filteredSpans:{type:Array,default:()=>[]},selectedSpanId:{type:String,default:null},selectedSpan:{type:Object,default:null},loading:{type:Boolean,default:!1},spanHasNextPage:{type:Boolean,default:!1},spanLoadMoreLoading:{type:Boolean,default:!1},spanHasEvents:{type:[Boolean,Number],default:null},spanPageSize:{type:Number,default:100},traceStatusList:{type:Array,default:()=>[]},traceSpanTypeList:{type:Array,default:()=>[]},spanTypeFilter:{type:String,default:null}},data(){return{localVisible:this.visible,spanSearchQuery:"",activeTab:"io",activeCollapse:["inputs","outputs"],messageCollapse:[],rawIoCollapse:["rawInputs","rawOutputs"],rawInputsKey:0,rawOutputsKey:0,eventsCollapse:[],eventsKey:0,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},cmOptionsJava:{tabSize:4,mode:"text/x-java",theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:4,styleActiveLine:!0,autoRefresh:!0},viewerOptions:{inline:!1,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,keyboard:!0,zIndex:9999}}},computed:{drawerTitle(){let l=this.traceInfo.trace_name;return l||(l=this.traceInfo.trace_id),l?this.$t("trace.traceDetail")+": "+l:this.$t("trace.traceDetail")},traceStartTime(){return this.spans.length===0?0:Math.min(...this.spans.map(l=>l.start_time_unix_nano))},traceEndTime(){return this.spans.length===0?0:Math.max(...this.spans.map(l=>l.end_time_unix_nano))},hasInputs(){var n,r,o,u;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.request_preview;return l!=null&&String(l).trim()!==""?!0:((u=(o=this.selectedSpan)==null?void 0:o.parsedContent)==null?void 0:u.inputs)!==void 0},hasOutputs(){var n,r,o,u;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.response_preview;return l!=null&&String(l).trim()!==""?!0:((u=(o=this.selectedSpan)==null?void 0:o.parsedContent)==null?void 0:u.outputs)!==void 0},showIOTab(){var k,S,R,L,W,z,D,$,I,N;if(!this.selectedSpan)return!1;const l=(S=(k=this.selectedSpan)==null?void 0:k.parsedContent)==null?void 0:S.request_preview,n=(L=(R=this.selectedSpan)==null?void 0:R.parsedContent)==null?void 0:L.response_preview,r=l!=null&&String(l).trim()!=="",o=n!=null&&String(n).trim()!=="";if(r||o)return!0;if(!(this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="EMBEDDING"||this.selectedSpan.type==="CHAT_MODEL"))return!1;const f=(D=(z=(W=this.selectedSpan)==null?void 0:W.parsedContent)==null?void 0:z.attributes)==null?void 0:D["langsword.spanInputs"],p=(N=(I=($=this.selectedSpan)==null?void 0:$.parsedContent)==null?void 0:I.attributes)==null?void 0:N["langsword.spanOutputs"],y=f!=null&&f!=="",m=p!=null&&p!=="";return y||m},attributesData(){var n,r;if(!((r=(n=this.selectedSpan)==null?void 0:n.parsedContent)!=null&&r.attributes))return[];const l=["http.response.body.size","http.request.body.size","http.request.header.Content-Length","http.response.header.content-length","http.request.header.content-length","http.response.header.Content-Length"];return Object.entries(this.selectedSpan.parsedContent.attributes).filter(([o])=>!o.startsWith("langsword.span")).filter(([,o])=>!(o===0||o==="0"||o==null||o===""||typeof o=="string"&&o.trim()==="")).map(([o,u])=>{let f;return l.includes(o)?f=this.formatBytes(u):typeof u=="string"?f=u:f=JSON.stringify(u,null,2),{key:o,value:f}}).sort((o,u)=>o.key.localeCompare(u.key))},rawInputs(){var l,n,r;return(r=(n=(l=this.selectedSpan)==null?void 0:l.parsedContent)==null?void 0:n.attributes)==null?void 0:r["langsword.spanInputs"]},rawOutputs(){var l,n,r;return(r=(n=(l=this.selectedSpan)==null?void 0:l.parsedContent)==null?void 0:n.attributes)==null?void 0:r["langsword.spanOutputs"]},clientInputsFileOnly(){var n,r,o;if(((n=this.selectedSpan)==null?void 0:n.type)!=="CLIENT")return!1;const l=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.inputs;return l&&(this.extractFileRefs(l).length>0||this.extractImageBase64Refs(l).length>0)},clientOutputsFileOnly(){var n,r,o;if(((n=this.selectedSpan)==null?void 0:n.type)!=="CLIENT")return!1;const l=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.outputs;return l&&(this.extractFileRefs(l).length>0||this.extractImageBase64Refs(l).length>0)},hasEvents(){var n,r,o;if(((n=this.selectedSpan)==null?void 0:n.has_events)!==void 0)return!!this.selectedSpan.has_events;const l=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.events;return l&&Array.isArray(l)&&l.length>0},spanEvents(){var n,r;const l=(r=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:r.events;return!l||!Array.isArray(l)?[]:l},showDebugTab(){var o,u,f;if(!this.selectedSpan||!(this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="EMBEDDING"||this.selectedSpan.type==="CHAT_MODEL"))return!1;const n=(f=(u=(o=this.selectedSpan)==null?void 0:o.parsedContent)==null?void 0:u.attributes)==null?void 0:f["langsword.spanInputs"];return n!=null&&n!==""}},watch:{visible(l){this.localVisible=l,l||(this.spanSearchQuery="")},localVisible(l){this.$emit("update:visible",l)},activeTab(l){l==="raw"&&this.$nextTick(()=>{this.rawInputsKey++,this.rawOutputsKey++}),l==="events"&&this.$nextTick(()=>{this.eventsKey++})},selectedSpan(){var o;if(!this.selectedSpan)return;const l=!!this.selectedSpan.has_events||((o=this.selectedSpan.parsedContent)==null?void 0:o.events)&&Array.isArray(this.selectedSpan.parsedContent.events)&&this.selectedSpan.parsedContent.events.length>0,n=[];this.showIOTab&&n.push("io","raw"),this.showDebugTab&&n.push("debug"),n.push("attributes"),l&&n.push("events");let r="attributes";this.showIOTab&&(r="io"),n.includes(r)?this.activeTab=r:this.activeTab="attributes",this.$nextTick(()=>{this.updateCollapseStates(),this.activeTab==="raw"&&(this.rawInputsKey++,this.rawOutputsKey++),this.activeTab==="events"&&this.eventsKey++})}},methods:{renderMarkdown(l){return l?Se(String(l)):""},copyToClipboard(l){Bi(l,this)},copyMessageContent(l){let n="";if(typeof l=="string")n=l;else if(Array.isArray(l)){const r=l.filter(o=>o&&o.type==="text"&&o.text).map(o=>o.text);n=r.length>0?r.join(`
|
|
80
|
+
`):this.formatRawJson(l)}else n=this.formatRawJson(l);this.copyToClipboard(n)},formatBytes(l){const n=typeof l=="number"?l:Number(l);if(!Number.isFinite(n))return typeof l=="string"?l:JSON.stringify(l,null,2);const r=n<0?"-":"";let o=Math.abs(n);const u=["B","K","M","G","T","P","E"];if(o<1024)return`${r}${Math.round(o)}B`;let f=0;for(;o>=1024&&f<u.length-1;)o/=1024,f++;return`${r}${o.toFixed(2)}${u[f]}`},handleClose(l){this.$emit("close"),l&&typeof l=="function"&&l()},handleSpanSearch(){this.$emit("span-search",this.spanSearchQuery)},handleSpanTypeFilterChange(l){this.$emit("update:span-type-filter",l)},handleHasEventsChange(l){this.$emit("update:span-has-events",l?1:null)},handleSpanSelect(l){this.$emit("span-select",l),this.$nextTick(()=>{this.updateCollapseStates()})},updateCollapseStates(){var r,o,u,f,p;this.activeCollapse=["inputs","outputs"],(u=(o=(r=this.selectedSpan)==null?void 0:r.parsedContent)==null?void 0:o.inputs)!=null&&u.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((y,m)=>`message-${m}`):this.messageCollapse=[],this.rawIoCollapse=["rawInputs","rawOutputs"];const l=(p=(f=this.selectedSpan)==null?void 0:f.parsedContent)==null?void 0:p.events;l&&Array.isArray(l)&&l.length>0?this.eventsCollapse=l.map((y,m)=>`event-${m}`):this.eventsCollapse=[]},parseContentData(l){const n={attributes:l.attributes||{},events:l.events||[],status:l.status||{}};if(l.inputs&&(n.inputs=l.inputs),l.outputs&&(n.outputs=l.outputs),l.request_preview!=null&&l.request_preview!==""&&(n.request_preview=l.request_preview),l.response_preview!=null&&l.response_preview!==""&&(n.response_preview=l.response_preview),n.attributes){const r=n.attributes["langsword.spanInputs"],o=n.attributes["langsword.spanOutputs"];if(r)try{n.inputs=typeof r=="string"?JSON.parse(r):r}catch{try{const f=r.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.inputs=JSON.parse(f)}catch{n.inputs=r}}if(o)try{n.outputs=typeof o=="string"?JSON.parse(o):o}catch{try{const f=o.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.outputs=JSON.parse(f)}catch{n.outputs=o}}}return n},getStatusType(l){if(!l)return"info";const n=l.toUpperCase();return n==="OK"||n==="SUCCESS"?"success":n==="ERROR"||n==="FAILED"?"danger":n==="WARNING"||n==="WARN"?"warning":"info"},getStatusLabel(l){if(!l)return"-";const n=this.traceStatusList.find(r=>r.value===l);return n?n.label:l},getTraceSpanTypeLabel(l){if(l==null||l==="")return"-";const n=this.traceSpanTypeList.find(r=>r.value===l);return n?n.label:l},formatNanoDuration(l){if(!l)return"-";const n=l/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`},formatTimestamp(l){if(!l)return"-";const n=typeof l=="string"?parseInt(l,10):l,r=new Date(n);return isNaN(r.getTime())?"-":r.toLocaleString("zh-CN")},formatEventTimestamp(l){if(!l)return"-";const n=l/1e6,r=new Date(n);return isNaN(r.getTime())?"-":r.toLocaleString("zh-CN")},getEventAttributesData(l){return!l||!l.attributes?[]:Object.entries(l.attributes).map(([n,r])=>({key:n,value:typeof r=="string"?r:JSON.stringify(r,null,2)}))},getOtherEventAttributes(l){if(!l||!l.attributes)return[];const n=["exception.type","exception.message","exception.stacktrace"];return Object.entries(l.attributes).filter(([r])=>!n.includes(r)).map(([r,o])=>({key:r,value:typeof o=="string"?o:JSON.stringify(o,null,2)}))},formatRawJson(l){if(!l)return"";if(typeof l=="string")try{const n=JSON.parse(l);return JSON.stringify(n,null,2)}catch{return l}return JSON.stringify(l,null,2)},getMessageIcon(l){return{user:"el-icon-user",assistant:"el-icon-service",system:"el-icon-setting"}[l]||"el-icon-document"},getMessageRoleLabel(l){const n={system:"debug.systemRole",user:"debug.userRole",assistant:"debug.assistantRole"};return n[l]?this.$t(n[l]):l},extractImagesFromObject(l,n=[],r=""){if(!(!l||typeof l!="object")){for(const[o,u]of Object.entries(l)){const f=r?`${r}.${o}`:o;typeof u=="string"&&u.trim()!==""?(u.startsWith("data:image/")||u.startsWith("/9j/")||u.startsWith("iVBOR")||u.startsWith("R0lGOD"))&&(n.push({path:f,value:u,label:o==="content"&&r?`${r.split(".").pop()}: ${o}`:o}),l[o]="[IMAGE_DATA]"):u&&typeof u=="object"&&!Array.isArray(u)?this.extractImagesFromObject(u,n,f):Array.isArray(u)&&u.forEach((p,y)=>{p&&typeof p=="object"&&this.extractImagesFromObject(p,n,`${f}[${y}]`)})}return n}},extractFileRefs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r.startsWith("__file__")&&o!=null?Array.isArray(o)?o.forEach(u=>{u!=null&&typeof u=="string"&&u.trim()!==""&&n.push(u.trim())}):typeof o=="string"&&o.trim()!==""&&n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractFileRefs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractFileRefs(u,n)});return n},extractImageBase64Refs(l,n=[]){if(!l||typeof l!="object")return n;for(const[r,o]of Object.entries(l))r==="image_base64"&&o!=null&&typeof o=="string"&&o.trim()!==""?n.push(o.trim()):o&&typeof o=="object"&&!Array.isArray(o)?this.extractImageBase64Refs(o,n):Array.isArray(o)&&o.forEach(u=>{u&&typeof u=="object"&&this.extractImageBase64Refs(u,n)});return n},getFileExtension(l){if(!l||typeof l!="string")return"";const n=l.lastIndexOf(".");return n>=0?l.slice(n+1).toLowerCase():""},buildFileElements(l,n="file"){const r=["jpg","jpeg","png","gif","webp","bmp","svg"],o=[];return l.forEach((u,f)=>{const p=this.getFileExtension(u),y=zi(u),m=decodeURIComponent(u.split("/").pop()||u);r.includes(p)?o.push({type:"file-image",downloadUrl:y,key:`${n}-image-${f}`}):p==="pdf"?o.push({type:"file-pdf",downloadUrl:y,key:`${n}-pdf-${f}`}):o.push({type:"file-download",downloadUrl:y,filename:m,key:`${n}-download-${f}`})}),o},renderStructuredContent(l,n=!1){const r=[];if(!l)return r;const o=this.extractFileRefs(l);if(o.length>0&&r.push(...this.buildFileElements(o,"file")),l.data&&Array.isArray(l.data.result))l.data.result.forEach((u,f)=>{u.image_base64&&u.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(u.image_base64),key:`result-page-${f}`,label:u.page_num!==void 0?`Page ${u.page_num}`:`Result ${f}`}),u.seals&&Array.isArray(u.seals)&&u.seals.forEach((p,y)=>{p.image_base64&&p.image_base64.trim()!==""&&r.push({type:"image",url:this.formatBase64Image(p.image_base64),key:`result-seal-${f}-${y}`,label:`印章文字: ${p.value||y}`})})});else{const u=this.extractImageBase64Refs(l);u.length>0&&u.forEach((f,p)=>{r.push({type:"image",url:this.formatBase64Image(f),key:`base64-image-${p}`})})}if(n)return r;try{if(Array.isArray(l))l.forEach((u,f)=>{var p;u&&typeof u=="object"?u.type==="text"&&u.text?r.push({type:"markdown",content:Se(u.text),key:`text-${f}`}):u.type==="image_url"&&((p=u.image_url)!=null&&p.url)?r.push({type:"image",url:u.image_url.url,key:`image-${f}`}):u.image_base64&&u.image_base64.trim()!==""?r.push({type:"image",url:this.formatBase64Image(u.image_base64),key:`base64-image-${f}`}):r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(u,null,2)+"\n```"),key:`json-${f}`}):r.push({type:"markdown",content:Se(String(u)),key:`text-${f}`})});else if(typeof l=="string")r.push({type:"markdown",content:Se(l),key:"text-0"});else if(typeof l=="object")if(l.data&&Array.isArray(l.data.result)){const u=JSON.parse(JSON.stringify(l)),f=[];u.data&&u.data.result&&u.data.result.forEach((p,y)=>{p.image_base64&&p.image_base64.trim()!==""&&(f.push({type:"page",image_base64:p.image_base64,page_num:p.page_num,label:p.page_num!==void 0?`Page ${p.page_num}`:`Result ${y}`}),p.image_base64="[BASE64_IMAGE_DATA]"),p.seals&&Array.isArray(p.seals)&&p.seals.forEach((m,k)=>{m.image_base64&&m.image_base64.trim()!==""&&(f.push({type:"seal",image_base64:m.image_base64,page_num:p.page_num,seal_index:k,seal_value:m.value,label:`印章文字: ${m.value||k}`}),m.image_base64="[BASE64_IMAGE_DATA]")})}),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(u,null,2)+"\n```"),key:"json-0"}),f.forEach((p,y)=>{r.push({type:"image",url:this.formatBase64Image(p.image_base64),key:`result-image-${y}`,label:p.label})})}else{const u=JSON.parse(JSON.stringify(l)),f=[];this.extractImagesFromObject(u,f),r.push({type:"markdown",content:Se("```json\n"+JSON.stringify(u,null,2)+"\n```"),key:"json-0"}),f.forEach((p,y)=>{r.push({type:"image",url:this.formatBase64Image(p.value),key:`extracted-image-${y}`,label:p.label})})}else r.push({type:"markdown",content:Se(String(l)),key:"text-0"})}catch(u){console.error("Error rendering content:",u),r.push({type:"markdown",content:Se("Error rendering content"),key:"error-0"})}return r},formatBase64Image(l){return l?l.startsWith("data:image")?l:l.startsWith("/9j/")?`data:image/jpeg;base64,${l}`:l.startsWith("iVBOR")?`data:image/png;base64,${l}`:l.startsWith("R0lGOD")?`data:image/gif;base64,${l}`:`data:image/jpeg;base64,${l}`:""},handleImageClick(l){Bl({options:this.viewerOptions,images:[l]})}}};var ng=function(){var o,u,f,p,y,m,k,S,R,L,W,z;var n=this,r=n._self._c;return r("el-drawer",{attrs:{visible:n.localVisible,"with-header":!0,title:n.drawerTitle,size:"90%",direction:"rtl","before-close":n.handleClose},on:{"update:visible":function(D){n.localVisible=D}}},[n.currentTraceId?r("div",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}],staticClass:"trace-detail-content",attrs:{"element-loading-text":"加载中..."}},[r("div",{staticClass:"trace-info-section"},[r("el-descriptions",{attrs:{column:3,border:""}},[r("el-descriptions-item",{attrs:{label:n.$t("trace.traceId")}},[n._v(n._s(n.traceInfo.trace_id))]),r("el-descriptions-item",{attrs:{label:n.$t("trace.status")}},[r("el-tag",{attrs:{type:n.getStatusType(n.traceInfo.status),size:"mini"}},[n._v(" "+n._s(n.getStatusLabel(n.traceInfo.status))+" ")])],1),r("el-descriptions-item",{attrs:{label:n.$t("trace.executionTime")}},[n._v(" "+n._s(n.formatNanoDuration(n.traceInfo.execution_time_ms))+" ")]),r("el-descriptions-item",{attrs:{label:n.$t("trace.timeCreated")}},[n._v(" "+n._s(n.formatTimestamp(n.traceInfo.timestamp_ms))+" ")]),r("el-descriptions-item",{attrs:{label:n.$t("trace.timeEnded")}},[n._v(" "+n._s(n.formatTimestamp(n.traceInfo.end_time_ms))+" ")]),r("el-descriptions-item",{attrs:{label:n.$t("trace.experimentName")}},[n._v(n._s(n.traceInfo.experiment_name))]),r("el-descriptions-item",{attrs:{label:n.$t("trace.traceType")}},[r("el-tag",{attrs:{size:"mini",type:"info"}},[n._v(n._s(n.getTraceSpanTypeLabel(n.traceInfo.trace_type)))])],1),r("el-descriptions-item",{attrs:{label:n.$t("trace.traceName"),span:2}},[n._v(" "+n._s(n.traceInfo.trace_name||"-")+" ")])],1)],1),r("el-divider"),r("el-row",{attrs:{gutter:20}},[r("el-col",{staticClass:"span-tree-col",attrs:{span:8}},[r("el-card",[r("div",{staticClass:"span-search-header",attrs:{slot:"header"},slot:"header"},[r("el-input",{staticClass:"span-search-input",attrs:{placeholder:n.$t("span.searchTree"),"prefix-icon":"el-icon-search",size:"small",clearable:""},on:{input:n.handleSpanSearch},model:{value:n.spanSearchQuery,callback:function(D){n.spanSearchQuery=D},expression:"spanSearchQuery"}}),r("el-select",{staticClass:"span-type-select",attrs:{value:n.spanTypeFilter,size:"small",clearable:"",placeholder:n.$t("trace.traceType")},on:{input:n.handleSpanTypeFilterChange}},n._l(n.traceSpanTypeList,function(D){return r("el-option",{key:D.value,attrs:{label:D.label,value:D.value}})}),1),r("el-checkbox",{attrs:{value:n.spanHasEvents,size:"small"},on:{change:n.handleHasEventsChange}},[n._v(" "+n._s(n.$t("span.hasEvents"))+" ")])],1),r("TraceSpanTree",{attrs:{spans:n.filteredSpans,"selected-span-id":n.selectedSpanId,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime,"span-type-list":n.traceSpanTypeList},on:{"span-select":n.handleSpanSelect}}),n.spanHasNextPage?r("div",{staticClass:"span-load-more"},[r("el-button",{attrs:{type:"primary",size:"mini",loading:n.spanLoadMoreLoading},on:{click:function(D){return n.$emit("span-load-more")}}},[n._v(" 加载更多 ")]),r("el-select",{staticClass:"span-page-size-select",attrs:{value:n.spanPageSize,size:"mini"},on:{input:function(D){return n.$emit("update:span-page-size",D)}}},[r("el-option",{attrs:{label:1e3,value:1e3}}),r("el-option",{attrs:{label:2e3,value:2e3}}),r("el-option",{attrs:{label:5e3,value:5e3}}),r("el-option",{attrs:{label:1e4,value:1e4}})],1)],1):n._e()],1)],1),r("el-col",{staticClass:"span-detail-col",attrs:{span:16}},[r("el-card",[n.selectedSpan?r("div",{staticClass:"span-detail-content"},[r("el-tabs",{key:`tabs-${n.selectedSpanId}`,model:{value:n.activeTab,callback:function(D){n.activeTab=D},expression:"activeTab"}},[n.showIOTab?r("el-tab-pane",{attrs:{label:`${n.$t("trace.inputs")} / ${n.$t("trace.outputs")}`,name:"io"}},[r("div",{staticClass:"io-content"},[n.hasInputs?r("div",{staticClass:"io-section"},[r("el-collapse",{model:{value:n.activeCollapse,callback:function(D){n.activeCollapse=D},expression:"activeCollapse"}},[r("el-collapse-item",{attrs:{name:"inputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.inputs")))]),(o=n.selectedSpan.parsedContent)!=null&&o.request_preview||!((f=(u=n.selectedSpan.parsedContent)==null?void 0:u.inputs)!=null&&f.messages)?r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){var $;D.stopPropagation(),n.copyToClipboard(($=n.selectedSpan.parsedContent)!=null&&$.request_preview?n.selectedSpan.parsedContent.request_preview:n.formatRawJson(n.selectedSpan.parsedContent.inputs))}}})],1):n._e()],1),(p=n.selectedSpan.parsedContent)!=null&&p.request_preview?r("div",{staticClass:"structured-content preview-content"},[r("div",{staticClass:"content-element"},[r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(n.renderMarkdown(n.selectedSpan.parsedContent.request_preview))}})])]):n.clientInputsFileOnly?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.selectedSpan.parsedContent.inputs,!0),function(D){return r("div",{key:D.key,staticClass:"content-element"},[D.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(D.content)}}):D.type==="image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.url,alt:"content image"},on:{click:function($){return n.handleImageClick(D.url)}}})]):D.type==="file-image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.downloadUrl,alt:"content image"},on:{click:function($){return n.handleImageClick(D.downloadUrl)}}})]):D.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:D}})],1):D.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:D.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(D.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):(m=(y=n.selectedSpan.parsedContent)==null?void 0:y.inputs)!=null&&m.messages?r("div",{staticClass:"messages-section"},n._l(n.selectedSpan.parsedContent.inputs.messages,function(D,$){return r("div",{key:$,staticClass:"message-item"},[r("el-collapse",{model:{value:n.messageCollapse,callback:function(I){n.messageCollapse=I},expression:"messageCollapse"}},[r("el-collapse-item",{attrs:{name:`message-${$}`}},[r("template",{slot:"title"},[r("i",{staticClass:"message-icon",class:n.getMessageIcon(D.role)}),r("span",{staticClass:"message-role"},[n._v(n._s(n.getMessageRoleLabel(D.role)))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(I){return I.stopPropagation(),n.copyMessageContent(D.content)}}})],1)],1),r("div",{staticClass:"message-content"},[r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(D.content),function(I){return r("div",{key:I.key,staticClass:"content-element"},[I.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(I.content)}}):I.type==="image"?r("div",{staticClass:"image-content"},[I.label?r("div",{staticClass:"image-label"},[n._v(n._s(I.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:I.url,alt:"content image"},on:{click:function(N){return n.handleImageClick(I.url)}}})]):I.type==="file-image"?r("div",{staticClass:"image-content"},[I.label?r("div",{staticClass:"image-label"},[n._v(n._s(I.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:I.downloadUrl,alt:"content image"},on:{click:function(N){return n.handleImageClick(I.downloadUrl)}}})]):I.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:I}})],1):I.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:I.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(I.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0)])],2)],1)],1)}),0):(k=n.selectedSpan.parsedContent)!=null&&k.inputs?r("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.selectedSpan.parsedContent.inputs),function(D){return r("div",{key:D.key,staticClass:"content-element"},[D.type==="markdown"?r("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(D.content)}}):D.type==="image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.url,alt:"content image"},on:{click:function($){return n.handleImageClick(D.url)}}})]):D.type==="file-image"?r("div",{staticClass:"image-content"},[D.label?r("div",{staticClass:"image-label"},[n._v(n._s(D.label))]):n._e(),r("img",{staticClass:"content-image",attrs:{src:D.downloadUrl,alt:"content image"},on:{click:function($){return n.handleImageClick(D.downloadUrl)}}})]):D.type==="file-pdf"?r("div",[r("FilePdfViewer",{attrs:{element:D}})],1):D.type==="file-download"?r("div",{staticClass:"file-download-content"},[r("a",{staticClass:"file-download-link",attrs:{href:D.downloadUrl,target:"_blank",rel:"noopener noreferrer"}},[n._v(n._s(D.filename))]),r("span",{staticClass:"file-download-hint"},[n._v(n._s(n.$t("trace.clickToDownload")))])]):n._e()])}),0):r("div",{staticClass:"empty-content"},[r("el-empty",{attrs:{description:n.$t("trace.noInputs"),"image-size":80}})],1)],2)],1)],1):n._e(),n.hasOutputs?r("div",{staticClass:"io-section"},[r("el-collapse",{model:{value:n.activeCollapse,callback:function(D){n.activeCollapse=D},expression:"activeCollapse"}},[r("el-collapse-item",{attrs:{name:"outputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.outputs")))]),(S=n.selectedSpan.parsedContent)!=null&&S.response_preview||!((L=(R=n.selectedSpan.parsedContent)==null?void 0:R.outputs)!=null&&L.choices)?r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){var $;D.stopPropagation(),n.copyToClipboard(($=n.selectedSpan.parsedContent)!=null&&$.response_preview?n.selectedSpan.parsedContent.response_preview:n.formatRawJson(n.selectedSpan.parsedContent.outputs))}}})],1):n._e()],1),((W=n.selectedSpan.parsedContent)==null?void 0:W.outputs)!==void 0?r("OutputViewer",{attrs:{value:n.selectedSpan.parsedContent.outputs,"preview-markdown":(z=n.selectedSpan.parsedContent)==null?void 0:z.response_preview,"file-only":n.clientOutputsFileOnly,"support-file-elements":!0,"show-raw-toggle":!1,"content-key":n.selectedSpanId},on:{copy:n.copyToClipboard}}):r("div",{staticClass:"empty-content"},[r("el-empty",{attrs:{description:n.$t("trace.noOutputs"),"image-size":80}})],1)],2)],1)],1):n._e(),!n.hasInputs&&!n.hasOutputs?r("div",{staticClass:"empty-io"},[r("el-empty",{attrs:{description:n.$t("trace.noIoData")}})],1):n._e()])]):n._e(),r("el-tab-pane",{attrs:{label:n.$t("trace.attributes"),name:"attributes"}},[r("el-table",{staticClass:"attributes-table",attrs:{data:n.attributesData,border:"",stripe:""}},[r("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"250"},scopedSlots:n._u([{key:"default",fn:function(D){return[r("el-tooltip",{attrs:{content:D.row.key,placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[r("span",{staticClass:"attribute-key"},[n._v(n._s(D.row.key))])])]}}],null,!1,688878823)}),r("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")},scopedSlots:n._u([{key:"default",fn:function(D){return[r("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[r("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[n._v(n._s(D.row.value))]),r("div",{staticClass:"attribute-value"},[n._v(n._s(D.row.value))])])]}}],null,!1,4281519148)})],1)],1),n.showIOTab?r("el-tab-pane",{attrs:{label:n.$t("trace.rawInputsOutputs"),name:"raw"}},[n.activeTab==="raw"?r("div",{staticClass:"raw-io-content"},[n.rawInputs?r("div",{staticClass:"raw-io-section"},[r("el-collapse",{model:{value:n.rawIoCollapse,callback:function(D){n.rawIoCollapse=D},expression:"rawIoCollapse"}},[r("el-collapse-item",{attrs:{name:"rawInputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.rawInputs")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){D.stopPropagation(),n.copyToClipboard(n.formatRawJson(n.rawInputs))}}})],1)],1),r("codemirror",{key:`raw-inputs-${n.selectedSpanId}-${n.rawInputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.rawInputs),options:n.cmOptions}})],2)],1)],1):n._e(),n.rawOutputs?r("div",{staticClass:"raw-io-section"},[r("el-collapse",{model:{value:n.rawIoCollapse,callback:function(D){n.rawIoCollapse=D},expression:"rawIoCollapse"}},[r("el-collapse-item",{attrs:{name:"rawOutputs"}},[r("template",{slot:"title"},[r("span",{staticClass:"collapse-title-text"},[n._v(n._s(n.$t("trace.rawOutputs")))]),r("el-tooltip",{attrs:{content:n.$t("debug.copyTooltip"),placement:"top"}},[r("el-button",{staticClass:"copy-btn-inline",attrs:{type:"text",icon:"el-icon-document-copy",size:"mini"},nativeOn:{click:function(D){D.stopPropagation(),n.copyToClipboard(n.formatRawJson(n.rawOutputs))}}})],1)],1),r("codemirror",{key:`raw-outputs-${n.selectedSpanId}-${n.rawOutputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.rawOutputs),options:n.cmOptions}})],2)],1)],1):n._e(),!n.rawInputs&&!n.rawOutputs?r("div",{staticClass:"empty-raw-io"},[r("el-empty",{attrs:{description:n.$t("trace.noIoData")}})],1):n._e()]):n._e()]):n._e(),n.showDebugTab?r("el-tab-pane",{attrs:{label:"快速调试",name:"debug"}},[r("DebugTab",{directives:[{name:"show",rawName:"v-show",value:n.activeTab==="debug",expression:"activeTab === 'debug'"}],attrs:{"selected-span":n.selectedSpan,"selected-span-id":n.selectedSpanId}})],1):n._e(),n.hasEvents?r("el-tab-pane",{attrs:{label:n.$t("trace.events"),name:"events"}},[n.activeTab==="events"?r("div",{staticClass:"events-content"},[r("el-collapse",{model:{value:n.eventsCollapse,callback:function(D){n.eventsCollapse=D},expression:"eventsCollapse"}},n._l(n.spanEvents,function(D,$){return r("el-collapse-item",{key:`event-${$}`,attrs:{name:`event-${$}`}},[r("template",{slot:"title"},[r("div",{staticClass:"event-header"},[r("el-tag",{staticClass:"event-name-tag",attrs:{type:D.name==="exception"?"danger":"info",size:"mini"}},[n._v(" "+n._s(D.name)+" ")]),r("span",{staticClass:"event-time"},[n._v(n._s(n.formatEventTimestamp(D.timestamp)))])],1)]),r("div",{staticClass:"event-detail"},[D.name==="exception"?r("div",{staticClass:"exception-content"},[D.attributes["exception.type"]?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionType")))]),r("div",{staticClass:"field-value exception-type"},[n._v(n._s(D.attributes["exception.type"]))])]):n._e(),D.attributes["exception.message"]?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionMessage")))]),r("div",{staticClass:"field-value exception-message"},[n._v(n._s(D.attributes["exception.message"]))])]):n._e(),D.attributes["exception.stacktrace"]?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionStacktrace")))]),r("codemirror",{key:`stacktrace-${n.selectedSpanId}-${$}-${n.eventsKey}`,staticClass:"code-editor-wrapper stacktrace-editor",attrs:{value:D.attributes["exception.stacktrace"],options:n.cmOptionsJava}})],1):n._e(),n.getOtherEventAttributes(D).length>0?r("div",{staticClass:"exception-field"},[r("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.otherAttributes")))]),r("el-table",{attrs:{data:n.getOtherEventAttributes(D),border:"",stripe:"",size:"mini"}},[r("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"200"}}),r("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")}})],1)],1):n._e()]):r("div",{staticClass:"general-event-content"},[r("el-table",{attrs:{data:n.getEventAttributesData(D),border:"",stripe:"",size:"mini"}},[r("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"200"},scopedSlots:n._u([{key:"default",fn:function(I){return[r("el-tooltip",{attrs:{content:I.row.key,placement:"top","open-delay":500}},[r("span",{staticClass:"attribute-key"},[n._v(n._s(I.row.key))])])]}}],null,!0)}),r("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")},scopedSlots:n._u([{key:"default",fn:function(I){return[r("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[r("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[n._v(n._s(I.row.value))]),r("div",{staticClass:"attribute-value"},[n._v(n._s(I.row.value))])])]}}],null,!0)})],1)],1)])],2)}),1),n.spanEvents.length===0?r("div",{staticClass:"empty-events"},[r("el-empty",{attrs:{description:n.$t("trace.noEvents")}})],1):n._e()],1):n._e()]):n._e()],1)],1):r("el-empty",{attrs:{description:n.$t("trace.selectSpan")}})],1)],1)],1)],1):n._e()])},rg=[],ig=vn(tg,ng,rg,!1,null,"dacb29d6");const ag={name:"Trace",components:{TraceDetailDrawer:ig.exports},data(){return{traceList:[],filteredTraceList:[],searchQuery:"",dateRange:null,selectedStatus:null,selectedTraceType:null,sortProp:"timestamp_ms",sortOrder:"descending",traceStatusList:[],traceSpanTypeList:[],experimentList:[],selectedExperimentId:null,loading:!1,deleteLoading:!1,exportLoading:!1,importLoading:!1,showColumnDialog:!1,selectedColumns:["trace_id","timestamp_ms","end_time_ms","status","execution_time_ms","trace_type","trace_name","experiment_name"],visibleColumns:{trace_id:!0,timestamp_ms:!0,end_time_ms:!0,status:!0,execution_time_ms:!0,trace_type:!0,trace_name:!0,experiment_name:!0},drawerVisible:!1,currentTraceId:null,traceInfo:{},spans:[],filteredSpans:[],spanSearchQuery:"",selectedSpanTypeFilter:null,spanHasEvents:null,selectedSpanId:null,selectedSpan:null,activeTab:"io",drawerLoading:!1,spanPageNum:1,spanPageSize:1e3,spanHasNextPage:!1,spanLoadMoreLoading:!1,messageCollapse:[],eventsCollapse:[],pageNum:1,pageSize:10,total:0,autoRefreshEnabled:!1,autoRefreshInterval:10,autoRefreshTimer:null,selectedRows:[],pickerOptions:{shortcuts:[{text:"近7天",onClick(l){const n=new Date,r=new Date;r.setTime(r.getTime()-3600*1e3*24*7),l.$emit("pick",[r,n])}},{text:"近30天",onClick(l){const n=new Date,r=new Date;r.setTime(r.getTime()-3600*1e3*24*30),l.$emit("pick",[r,n])}},{text:"7天前",onClick(l){const n=new Date;n.setTime(n.getTime()-3600*1e3*24*7),n.setHours(23,59,59,999);const r=n.getTime();l.$emit("pick",[null,r])}},{text:"30天前",onClick(l){const n=new Date;n.setTime(n.getTime()-3600*1e3*24*30),n.setHours(23,59,59,999);const r=n.getTime();l.$emit("pick",[null,r])}}]}}},computed:{},watch:{autoRefreshEnabled(l){l?this.startAutoRefresh():this.stopAutoRefresh()},spanHasEvents(){this.currentTraceId&&this.handleSpanSearch(this.spanSearchQuery)},spanPageSize(){this.currentTraceId&&this.handleSpanSearch(this.spanSearchQuery)},selectedSpanTypeFilter(){this.currentTraceId&&this.handleSpanSearch(this.spanSearchQuery)}},mounted(){this.loadDictList(),this.loadExperiments(),this.loadTraceList()},beforeDestroy(){this.stopAutoRefresh()},methods:{async loadTraceList(){this.loading=!0;try{let l=null,n=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(l=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(n=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(n=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)));const r=this.sortProp&&this.sortOrder?this.sortOrder==="descending"?"-"+this.sortProp:this.sortProp:"",o=await kt.getTraceList(this.searchQuery,l,n,this.pageNum,this.pageSize,this.selectedExperimentId,this.selectedStatus,this.selectedTraceType,r),u=Array.isArray(o==null?void 0:o.list)?o.list:[];this.traceList=u,this.filteredTraceList=u,this.total=parseInt((o==null?void 0:o.total)||0,10)}catch(l){console.error("Failed to load trace list:",l),this.$message.error("加载 trace 列表失败"),this.traceList=[],this.filteredTraceList=[],this.total=0}finally{this.loading=!1}},refresh(){this.loadTraceList()},startAutoRefresh(){this.stopAutoRefresh();const l=this.autoRefreshInterval*1e3;this.autoRefreshTimer=setInterval(()=>{this.loadTraceList()},l)},stopAutoRefresh(){this.autoRefreshTimer&&(clearInterval(this.autoRefreshTimer),this.autoRefreshTimer=null)},handleAutoRefreshIntervalChange(){this.autoRefreshEnabled&&this.startAutoRefresh()},viewDetail(l){const n=l==null?void 0:l.trace_id;n&&(this.currentTraceId=n,this.traceInfo={...l},(l==null?void 0:l.status)==="WARN"&&(this.spanHasEvents=1),this.drawerVisible=!0,this.loadTraceSpans(n))},async loadTraceSpans(l){var n,r,o;this.drawerLoading=!0,this.spanPageNum=1;try{const u=await kt.getTraceSpans(l,{query:this.spanSearchQuery||"",has_events:this.spanHasEvents,page_num:1,page_size:this.spanPageSize,span_type:this.selectedSpanTypeFilter||void 0}),f=Array.isArray(u==null?void 0:u.list)?u.list:[];if(this.spans=f,this.filteredSpans=f,this.spanHasNextPage=(u==null?void 0:u.has_next_page)===!0,this.spans.length>0){this.selectedSpanId=this.spans[0].span_id,this.selectedSpan=this.spans[0],await this.loadSpanContent(this.spans[0]);const p=this.spans[0].type==="CLIENT"||this.spans[0].type==="EMBEDDING"||this.spans[0].type==="CHAT_MODEL",y=!!this.selectedSpan.has_events,m=[];p&&m.push("io","raw"),m.push("attributes"),y&&m.push("events");let k="attributes";p&&(k="io"),m.includes(k)?this.activeTab=k:this.activeTab="attributes",(r=(n=this.selectedSpan.parsedContent)==null?void 0:n.inputs)!=null&&r.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((R,L)=>`message-${L}`):this.messageCollapse=[];const S=(o=this.selectedSpan.parsedContent)==null?void 0:o.events;S&&Array.isArray(S)&&S.length>0?this.eventsCollapse=S.map((R,L)=>`event-${L}`):this.eventsCollapse=[]}}catch(u){console.error("Failed to load trace spans:",u),this.$message.error("加载 span 列表失败"),this.spans=[],this.filteredSpans=[],this.spanHasNextPage=!1}finally{this.drawerLoading=!1}},async handleSpanSearch(l){if(this.spanSearchQuery=l,!!this.currentTraceId){this.spanPageNum=1;try{const n=await kt.getTraceSpans(this.currentTraceId,{query:l||"",has_events:this.spanHasEvents,page_num:1,page_size:this.spanPageSize,span_type:this.selectedSpanTypeFilter||void 0}),r=Array.isArray(n==null?void 0:n.list)?n.list:[];this.spans=r,this.filteredSpans=r,this.spanHasNextPage=(n==null?void 0:n.has_next_page)===!0,this.spans.length>0&&!this.selectedSpanId&&(this.selectedSpanId=this.spans[0].span_id,this.selectedSpan=this.spans[0],await this.loadSpanContent(this.spans[0]))}catch(n){console.error("Failed to search spans:",n),this.spans=[],this.filteredSpans=[],this.spanHasNextPage=!1}}},async loadMoreSpans(){if(!(!this.currentTraceId||!this.spanHasNextPage||this.spanLoadMoreLoading)){this.spanLoadMoreLoading=!0;try{const l=this.spanPageNum+1,n=await kt.getTraceSpans(this.currentTraceId,{query:this.spanSearchQuery||"",has_events:this.spanHasEvents,page_num:l,page_size:this.spanPageSize,span_type:this.selectedSpanTypeFilter||void 0}),r=Array.isArray(n==null?void 0:n.list)?n.list:[];this.spans=this.spans.concat(r),this.filteredSpans=this.spans,this.spanPageNum=l,this.spanHasNextPage=(n==null?void 0:n.has_next_page)===!0}catch(l){console.error("Failed to load more spans:",l)}finally{this.spanLoadMoreLoading=!1}}},async handleSpanSelect(l){var p,y,m;this.selectedSpanId=l.span_id,this.selectedSpan=l,await this.loadSpanContent(l);const n=l.type==="CLIENT"||l.type==="EMBEDDING"||l.type==="CHAT_MODEL",r=!!l.has_events,o=[];n&&o.push("io","raw"),o.push("attributes"),r&&o.push("events");let u="attributes";n&&(u="io"),this.$nextTick(()=>{o.includes(u)?this.activeTab=u:this.activeTab="attributes"}),(y=(p=this.selectedSpan.parsedContent)==null?void 0:p.inputs)!=null&&y.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((k,S)=>`message-${S}`):this.messageCollapse=[];const f=(m=this.selectedSpan.parsedContent)==null?void 0:m.events;f&&Array.isArray(f)&&f.length>0?this.eventsCollapse=f.map((k,S)=>`event-${S}`):this.eventsCollapse=[]},async loadSpanContent(l){if(!(!this.currentTraceId||!l.span_id||l.parsedContent))try{const n=await kt.getSpanContent(this.currentTraceId,l.span_id);if(n){const r=this.parseContentData(n);this.$set(l,"parsedContent",r)}}catch(n){console.error("Failed to load span content:",n)}},parseContentData(l){const n={attributes:l.attributes||{},events:l.events||[],status:l.status||{}};if(l.inputs&&(n.inputs=l.inputs),l.outputs&&(n.outputs=l.outputs),l.request_preview!=null&&l.request_preview!==""&&(n.request_preview=l.request_preview),l.response_preview!=null&&l.response_preview!==""&&(n.response_preview=l.response_preview),n.attributes){const r=n.attributes["langsword.spanInputs"],o=n.attributes["langsword.spanOutputs"];if(r)try{n.inputs=typeof r=="string"?JSON.parse(r):r}catch{try{const f=r.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.inputs=JSON.parse(f)}catch{n.inputs=r}}if(o)try{n.outputs=typeof o=="string"?JSON.parse(o):o}catch{try{const f=o.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.outputs=JSON.parse(f)}catch{n.outputs=o}}}return n},handleDrawerClose(){this.currentTraceId=null,this.traceInfo={},this.spans=[],this.filteredSpans=[],this.selectedSpanId=null,this.selectedSpan=null,this.spanSearchQuery="",this.selectedSpanTypeFilter=null,this.spanHasEvents=null,this.spanPageNum=1,this.spanHasNextPage=!1,this.spanLoadMoreLoading=!1,this.eventsCollapse=[],this.drawerLoading=!1},async loadExperiments(){try{const l=await kt.getExperiments();this.experimentList=Array.isArray(l)?l:[]}catch(l){console.error("Failed to load experiments:",l),this.experimentList=[]}},handleExperimentChange(){this.pageNum=1,this.loadTraceList()},handleSearch(){this.pageNum=1,this.loadTraceList()},handleSearchClear(){this.searchQuery="",this.pageNum=1,this.loadTraceList()},handleDateRangeChange(l){this.pageNum=1,l&&Array.isArray(l)?l.length===2&&(l[0]===null||l[0]===void 0)?this.dateRange=[null,l[1]]:this.dateRange=l:this.dateRange=l,this.loadTraceList()},handleSizeChange(l){this.pageSize=l,this.pageNum=1,this.loadTraceList()},handleCurrentChange(l){this.pageNum=l,this.loadTraceList()},async handleBatchDelete(){var p,y;const l=this.searchQuery&&this.searchQuery.trim(),n=this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2&&this.dateRange[1]!==null||this.dateRange.length===1&&this.dateRange[0]!==null),r=this.selectedExperimentId,o=this.selectedStatus;let u="",f="warning";if(!l&&!n&&!r&&!o)u=this.$t("trace.deleteAllWarning"),f="error";else{if(u=this.$t("trace.deleteConfirmMessage")+`
|
|
81
81
|
`,r){const m=this.experimentList.find(S=>S.experiment_id===this.selectedExperimentId),k=m?m.name:this.selectedExperimentId;u+=`${this.$t("trace.application")}: ${k}
|
|
82
82
|
`}if(l&&(u+=`${this.$t("trace.searchCondition")}: ${this.searchQuery}
|
|
83
83
|
`),o&&(u+=`${this.$t("trace.status")}: ${this.getStatusLabel(this.selectedStatus)}
|
|
84
84
|
`),n){const m=this.$i18n.locale==="zh-CN"?"zh-CN":"en-US";let k="";if(this.dateRange.length===2&&this.dateRange[1]!==null?k=new Date(this.dateRange[1]).toLocaleString(m):this.dateRange.length===1&&this.dateRange[0]!==null&&(k=new Date(this.dateRange[0]).toLocaleString(m)),this.dateRange.length===2&&this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""){const S=new Date(this.dateRange[0]).toLocaleString(m);u+=`${this.$t("trace.timeRange")}: ${S} ${this.$t("trace.to")} ${k}
|
|
85
85
|
`}else this.$i18n.locale==="zh-CN"?u+=`${this.$t("trace.timeRange")}: ${this.$t("trace.before")} ${k} 之前
|
|
86
86
|
`:u+=`${this.$t("trace.timeRange")}: ${this.$t("trace.before")} ${k}
|
|
87
|
-
`}u+=this.$t("trace.deleteConfirmFooter")}try{await this.$confirm(u,this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:f,dangerouslyUseHTMLString:!1}),this.deleteLoading=!0;let m=null,k=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(m=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(k=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(k=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10))),await kt.deleteTraces(l?this.searchQuery:null,m,k,this.selectedExperimentId,this.selectedStatus),this.$message.success(this.$t("trace.deleteSuccess")),await this.loadTraceList()}catch(m){if(m!=="cancel"){console.error("Failed to delete traces:",m);const k=((y=(p=m.response)==null?void 0:p.data)==null?void 0:y.message)||m.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${k}`)}}finally{this.deleteLoading=!1}},async loadDictList(){try{const l=await kt.getDictList();this.traceSpanTypeList=Array.isArray(l==null?void 0:l.trace_span_type)?l.trace_span_type:[],this.traceStatusList=Array.isArray(l==null?void 0:l.trace_span_status)?l.trace_span_status:[]}catch(l){console.error("Failed to load dict list:",l),this.traceSpanTypeList=[],this.traceStatusList=[]}},getTraceSpanTypeLabel(l){if(l==null||l==="")return"-";const n=this.traceSpanTypeList.find(r=>r.value===l);return n?n.label:l},handleStatusChange(){this.pageNum=1,this.loadTraceList()},handleTraceTypeChange(){this.pageNum=1,this.loadTraceList()},handleSortChange({column:l,prop:n,order:r}){this.sortProp=r?n:null,this.sortOrder=r||null,this.pageNum=1,this.loadTraceList()},getStatusLabel(l){if(!l)return"-";const n=this.traceStatusList.find(r=>r.value===l);return n?n.label:l},getStatusType(l){return{OK:"success",ERROR:"danger",IN_PROGRESS:"warning",WARN:"warning",UNSET:"info"}[l]||"info"},formatDateTime(l){if(!l)return"-";const n=typeof l=="string"?parseInt(l,10):l;if(isNaN(n))return"-";const r=new Date(n);if(isNaN(r.getTime()))return"-";const o=r.getFullYear(),u=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0"),p=String(r.getHours()).padStart(2,"0"),y=String(r.getMinutes()).padStart(2,"0"),m=String(r.getSeconds()).padStart(2,"0");return`${o}-${u}-${f} ${p}:${y}:${m}`},formatTimeAgo(l){if(!l)return"-";const n=typeof l=="string"?parseInt(l,10):l;if(isNaN(n))return"-";const o=Date.now()-n,u=this.$i18n.locale==="zh-CN",f=Math.floor(o/(1e3*60*60*24));if(f>0)return u?`${f} 天前`:`${f} days ago`;const p=Math.floor(o/(1e3*60*60));if(p>0)return u?`${p} 小时前`:`${p} hours ago`;const y=Math.floor(o/(1e3*60));return y>0?u?`${y} 分钟前`:`${y} minutes ago`:u?"刚刚":"Just now"},formatNanoDuration(l){if(!l)return"-";const n=l/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`},formatJson(l){return l?JSON.stringify(l,null,2):""},formatRawJson(l){if(!l)return"";if(typeof l=="string")try{const n=JSON.parse(l);return JSON.stringify(n,null,2)}catch{try{const r=l.replace(/\\"/g,'"').replace(/^"|"$/g,""),o=JSON.parse(r);return JSON.stringify(o,null,2)}catch{return l}}return JSON.stringify(l,null,2)},handleCodeMirrorReady(l){this.$nextTick(()=>{l&&l.refresh()})},formatMessageContent(l){return typeof l=="string"?l:JSON.stringify(l,null,2)},formatEventTime(l){if(l.time_unix_nano){const n=l.time_unix_nano/1e6;return new Date(n).toLocaleString("zh-CN")}return l.timestamp?new Date(l.timestamp).toLocaleString("zh-CN"):"-"},tableRowClassName({row:l,rowIndex:n}){return"trace-row"},getIndex(l){return(this.pageNum-1)*this.pageSize+l+1},handleSelectionChange(l){this.selectedRows=l||[]},async handleSingleDelete(l){var r,o;const n=l==null?void 0:l.trace_id;if(n)try{await this.$confirm(this.$t("trace.confirmRemoveOne"),this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:"warning"}),this.deleteLoading=!0,await kt.removeTraces([n]),this.$message.success(this.$t("trace.deleteSuccess")),this.currentTraceId===n&&(this.drawerVisible=!1,this.handleDrawerClose()),await this.loadTraceList(),this.clearSelection()}catch(u){if(u!=="cancel"){console.error("Failed to delete trace:",u);const f=((o=(r=u.response)==null?void 0:r.data)==null?void 0:o.message)||u.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${f}`)}}finally{this.deleteLoading=!1}},async handleDeleteSelected(){var o,u;if(this.selectedRows.length===0)return;const l=this.selectedRows.map(f=>f.trace_id).filter(Boolean);if(l.length===0)return;const n=l.length,r=this.$t("trace.confirmRemoveSelected").replace("{count}",String(n));try{await this.$confirm(r,this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:"warning"}),this.deleteLoading=!0,await kt.removeTraces(l),this.$message.success(this.$t("trace.deleteSuccess")),this.currentTraceId&&l.includes(this.currentTraceId)&&(this.drawerVisible=!1,this.handleDrawerClose()),await this.loadTraceList(),this.clearSelection()}catch(f){if(f!=="cancel"){console.error("Failed to delete traces:",f);const p=((u=(o=f.response)==null?void 0:o.data)==null?void 0:u.message)||f.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${p}`)}}finally{this.deleteLoading=!1}},copyTraceIdToClipboard(l){l&&Bi(l,this)},clearSelection(){this.$nextTick(()=>{this.$refs.traceTable&&this.$refs.traceTable.clearSelection(),this.selectedRows=[]})},async handleSingleExport(l){var r,o;const n=l==null?void 0:l.trace_id;if(n)try{this.exportLoading=!0;const u=await kt.exportTraces([n]),f=u==null?void 0:u.storage_key;if(f){const p=zi(f);p&&window.open(p,"_blank"),this.$message.success(this.$t("trace.exportSuccess"))}}catch(u){const f=((o=(r=u.response)==null?void 0:r.data)==null?void 0:o.message)||u.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.exportFailed")}: ${f}`)}finally{this.exportLoading=!1}},async handleBatchExport(){var n,r;if(this.selectedRows.length===0)return;const l=this.selectedRows.map(o=>o.trace_id).filter(Boolean);if(l.length!==0)try{this.exportLoading=!0;const o=await kt.exportTraces(l),u=o==null?void 0:o.storage_key;if(u){const f=zi(u);f&&window.open(f,"_blank"),this.$message.success(this.$t("trace.exportSuccess"))}}catch(o){const u=((r=(n=o.response)==null?void 0:n.data)==null?void 0:r.message)||o.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.exportFailed")}: ${u}`)}finally{this.exportLoading=!1}},async handleImportFileChange(l){var r,o,u;const n=(r=l.target.files)==null?void 0:r[0];if(n)try{this.importLoading=!0,await kt.importTraces(n),this.$message.success(this.$t("trace.importSuccess")),await this.loadTraceList()}catch(f){const p=((u=(o=f.response)==null?void 0:o.data)==null?void 0:u.message)||f.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.importFailed")}: ${p}`)}finally{this.importLoading=!1,this.$refs.importFileInput&&(this.$refs.importFileInput.value="")}},applyColumns(){const l={};this.selectedColumns.forEach(n=>{l[n]=!0}),Object.keys(this.visibleColumns).forEach(n=>{this.selectedColumns.includes(n)||(l[n]=!1)}),this.visibleColumns=l,this.showColumnDialog=!1}}};var sg=function(){var n=this,r=n._self._c;return r("div",{staticClass:"trace-list-container"},[r("el-card",[r("div",{staticClass:"trace-content-wrapper"},[r("div",{staticClass:"trace-toolbar"},[r("el-select",{staticClass:"toolbar-select",attrs:{placeholder:n.$t("trace.selectApplication"),clearable:"",size:"mini"},on:{change:n.handleExperimentChange},model:{value:n.selectedExperimentId,callback:function(o){n.selectedExperimentId=o},expression:"selectedExperimentId"}},n._l(n.experimentList,function(o){return r("el-option",{key:o.experiment_id,attrs:{label:o.name,value:o.experiment_id}})}),1),r("el-input",{staticClass:"toolbar-input",attrs:{placeholder:n.$t("trace.searchPlaceholder"),"prefix-icon":"el-icon-search",clearable:"",size:"mini"},on:{clear:n.handleSearchClear,input:n.handleSearch},model:{value:n.searchQuery,callback:function(o){n.searchQuery=o},expression:"searchQuery"}}),r("el-select",{staticClass:"toolbar-select",attrs:{placeholder:n.$t("trace.status"),clearable:"",size:"mini"},on:{change:n.handleStatusChange},model:{value:n.selectedStatus,callback:function(o){n.selectedStatus=o},expression:"selectedStatus"}},n._l(n.traceStatusList,function(o){return r("el-option",{key:o.value,attrs:{label:o.label,value:o.value}})}),1),r("el-select",{staticClass:"toolbar-select",attrs:{placeholder:n.$t("trace.traceType"),clearable:"",size:"mini"},on:{change:n.handleTraceTypeChange},model:{value:n.selectedTraceType,callback:function(o){n.selectedTraceType=o},expression:"selectedTraceType"}},n._l(n.traceSpanTypeList,function(o){return r("el-option",{key:o.value,attrs:{label:o.label,value:o.value}})}),1),r("el-date-picker",{staticClass:"toolbar-date-picker",attrs:{type:"datetimerange","range-separator":n.$t("trace.to"),"start-placeholder":n.$t("trace.startTime"),"end-placeholder":n.$t("trace.endTime"),"value-format":"timestamp",format:"yyyy-MM-dd HH:mm:ss",size:"mini","picker-options":n.pickerOptions,clearable:""},on:{change:n.handleDateRangeChange},model:{value:n.dateRange,callback:function(o){n.dateRange=o},expression:"dateRange"}}),r("el-button",{attrs:{type:"primary",icon:"el-icon-download",size:"mini",disabled:n.exportLoading||n.selectedRows.length===0},on:{click:n.handleBatchExport}},[n._v(" "+n._s(n.$t("trace.exportBatch"))+" ("+n._s(n.selectedRows.length)+") ")]),r("el-button",{attrs:{size:"mini",icon:"el-icon-upload2",loading:n.importLoading},on:{click:function(o){n.$refs.importFileInput&&n.$refs.importFileInput.click()}}},[n._v(" "+n._s(n.$t("trace.importBatch"))+" ")]),r("input",{ref:"importFileInput",staticStyle:{display:"none"},attrs:{type:"file",accept:".gz"},on:{change:n.handleImportFileChange}}),r("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"mini",disabled:n.deleteLoading||n.selectedRows.length===0},on:{click:n.handleDeleteSelected}},[n._v(" "+n._s(n.$t("trace.deleteSelected"))+" ("+n._s(n.selectedRows.length)+") ")]),r("el-checkbox",{staticClass:"toolbar-auto-refresh",attrs:{size:"mini"},model:{value:n.autoRefreshEnabled,callback:function(o){n.autoRefreshEnabled=o},expression:"autoRefreshEnabled"}},[n._v(" "+n._s(n.$t("trace.autoRefresh"))+" ")]),n.autoRefreshEnabled?r("el-select",{staticClass:"toolbar-interval-select",attrs:{size:"mini"},on:{change:n.handleAutoRefreshIntervalChange},model:{value:n.autoRefreshInterval,callback:function(o){n.autoRefreshInterval=o},expression:"autoRefreshInterval"}},[r("el-option",{attrs:{label:n.$t("trace.refreshInterval5s"),value:5}}),r("el-option",{attrs:{label:n.$t("trace.refreshInterval10s"),value:10}}),r("el-option",{attrs:{label:n.$t("trace.refreshInterval20s"),value:20}})],1):n._e(),r("el-tooltip",{attrs:{content:n.$t("common.refresh"),placement:"top"}},[r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini",circle:""},on:{click:n.refresh}})],1),r("el-button",{attrs:{icon:"el-icon-setting",size:"mini"},on:{click:function(o){n.showColumnDialog=!0}}},[n._v(" "+n._s(n.$t("common.columns"))+" ")])],1),r("div",{staticClass:"trace-table-wrapper"},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}],ref:"traceTable",staticStyle:{width:"100%"},attrs:{data:n.filteredTraceList,"default-sort":{prop:"timestamp_ms",order:"descending"},size:"mini",stripe:"","row-class-name":n.tableRowClassName},on:{"selection-change":n.handleSelectionChange,"sort-change":n.handleSortChange}},[r("el-table-column",{attrs:{type:"selection",width:"48","class-name":"selection-column"}}),r("el-table-column",{attrs:{type:"index",label:"#",width:"60",index:n.getIndex}}),n.visibleColumns.trace_id?r("el-table-column",{attrs:{prop:"trace_id",label:n.$t("trace.requestId"),width:"280"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-tooltip",{attrs:{placement:"top","popper-class":"trace-id-copy-tooltip"}},[r("template",{slot:"content"},[r("div",{staticClass:"trace-id-tooltip-content"},[r("span",{staticClass:"trace-id-tooltip-text"},[n._v(n._s(o.row.trace_id))]),r("el-button",{staticClass:"trace-id-copy-btn",attrs:{type:"text",size:"mini"},nativeOn:{click:function(u){return u.stopPropagation(),n.copyTraceIdToClipboard(o.row.trace_id)}}},[n._v(" "+n._s(n.$t("trace.copy"))+" ")])],1)]),r("el-link",{attrs:{type:"primary"},on:{click:function(u){return u.stopPropagation(),n.viewDetail(o.row)}}},[n._v(" "+n._s(o.row.trace_id)+" ")])],2)]}}],null,!1,2525458733)}):n._e(),n.visibleColumns.trace_name?r("el-table-column",{attrs:{prop:"trace_name",label:n.$t("trace.traceName"),"min-width":"300","show-overflow-tooltip":""},scopedSlots:n._u([{key:"default",fn:function(o){return[r("span",[n._v(n._s(o.row.trace_name||"-"))])]}}],null,!1,3633653970)}):n._e(),n.visibleColumns.experiment_name?r("el-table-column",{attrs:{prop:"experiment_name",label:n.$t("trace.experimentName"),width:"140","show-overflow-tooltip":""},scopedSlots:n._u([{key:"default",fn:function(o){return[r("span",[n._v(n._s(o.row.experiment_name||"-"))])]}}],null,!1,4093523474)}):n._e(),n.visibleColumns.trace_type?r("el-table-column",{attrs:{prop:"trace_type",label:n.$t("trace.traceType"),width:"120"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-tag",{attrs:{size:"mini",type:"info"}},[n._v(n._s(n.getTraceSpanTypeLabel(o.row.trace_type)))])]}}],null,!1,307785716)}):n._e(),n.visibleColumns.execution_time_ms?r("el-table-column",{attrs:{prop:"execution_time_ms",label:n.$t("trace.executionTime"),width:"120",sortable:"custom","sort-order":n.sortProp==="execution_time_ms"?n.sortOrder:null},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatNanoDuration(o.row.execution_time_ms))+" ")]}}],null,!1,1733254102)}):n._e(),n.visibleColumns.status?r("el-table-column",{attrs:{prop:"status",label:n.$t("trace.status"),width:"100"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-tag",{attrs:{type:n.getStatusType(o.row.status),size:"mini"}},[o.row.status==="OK"?r("i",{staticClass:"el-icon-success"}):n._e(),n._v(" "+n._s(n.getStatusLabel(o.row.status))+" ")])]}}],null,!1,4220190539)}):n._e(),n.visibleColumns.timestamp_ms?r("el-table-column",{attrs:{prop:"timestamp_ms",label:n.$t("trace.timeCreated"),width:"180",sortable:"custom","sort-order":n.sortProp==="timestamp_ms"?n.sortOrder:null},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatDateTime(o.row.timestamp_ms))+" ")]}}],null,!1,1082702673)}):n._e(),n.visibleColumns.end_time_ms?r("el-table-column",{attrs:{prop:"end_time_ms",label:n.$t("trace.timeEnded"),width:"180",sortable:"custom","sort-order":n.sortProp==="end_time_ms"?n.sortOrder:null},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatDateTime(o.row.end_time_ms))+" ")]}}],null,!1,2066523034)}):n._e(),r("el-table-column",{attrs:{label:n.$t("common.operation"),width:"200",fixed:"right"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(u){return u.stopPropagation(),n.viewDetail(o.row)}}},[n._v(" "+n._s(n.$t("common.viewDetail"))+" ")]),r("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(u){return u.stopPropagation(),n.handleSingleExport(o.row)}}},[n._v(" "+n._s(n.$t("trace.exportSingle"))+" ")]),r("el-button",{staticClass:"operation-delete",attrs:{type:"text",size:"mini"},on:{click:function(u){return u.stopPropagation(),n.handleSingleDelete(o.row)}}},[n._v(" "+n._s(n.$t("trace.delete"))+" ")])]}}])})],1)],1),r("div",{staticClass:"trace-pagination-wrapper"},[n.total>0?r("el-pagination",{staticClass:"trace-pagination",attrs:{"current-page":n.pageNum,"page-sizes":[10,20,50,100],"page-size":n.pageSize,size:"mini",layout:"total, prev, pager, next, sizes, jumper",total:n.total,background:""},on:{"size-change":n.handleSizeChange,"current-change":n.handleCurrentChange}}):n._e()],1)])]),r("el-dialog",{attrs:{title:n.$t("trace.selectColumns"),visible:n.showColumnDialog,width:"400px"},on:{"update:visible":function(o){n.showColumnDialog=o}}},[r("el-checkbox-group",{model:{value:n.selectedColumns,callback:function(o){n.selectedColumns=o},expression:"selectedColumns"}},[r("el-checkbox",{attrs:{label:"trace_id"}},[n._v(n._s(n.$t("trace.requestId")))]),r("el-checkbox",{attrs:{label:"timestamp_ms"}},[n._v(n._s(n.$t("trace.timeCreated")))]),r("el-checkbox",{attrs:{label:"end_time_ms"}},[n._v(n._s(n.$t("trace.timeEnded")))]),r("el-checkbox",{attrs:{label:"status"}},[n._v(n._s(n.$t("trace.status")))]),r("el-checkbox",{attrs:{label:"execution_time_ms"}},[n._v(n._s(n.$t("trace.executionTime")))]),r("el-checkbox",{attrs:{label:"trace_type"}},[n._v(n._s(n.$t("trace.traceType")))]),r("el-checkbox",{attrs:{label:"trace_name"}},[n._v(n._s(n.$t("trace.traceName")))]),r("el-checkbox",{attrs:{label:"experiment_name"}},[n._v(n._s(n.$t("trace.experimentName")))])],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{size:"mini"},on:{click:function(o){n.showColumnDialog=!1}}},[n._v(n._s(n.$t("common.cancel")))]),r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:n.applyColumns}},[n._v(n._s(n.$t("common.confirm")))])],1)],1),r("TraceDetailDrawer",{attrs:{visible:n.drawerVisible,"current-trace-id":n.currentTraceId,"trace-info":n.traceInfo,"trace-status-list":n.traceStatusList,"trace-span-type-list":n.traceSpanTypeList,spans:n.spans,"filtered-spans":n.filteredSpans,"selected-span-id":n.selectedSpanId,"selected-span":n.selectedSpan,loading:n.drawerLoading,"span-has-next-page":n.spanHasNextPage,"span-load-more-loading":n.spanLoadMoreLoading,"span-page-size":n.spanPageSize,"span-has-events":n.spanHasEvents,"span-type-filter":n.selectedSpanTypeFilter},on:{"update:visible":[function(o){n.drawerVisible=o},function(o){n.drawerVisible=o}],"update:spanPageSize":function(o){n.spanPageSize=o},"update:span-page-size":function(o){n.spanPageSize=o},"update:spanHasEvents":function(o){n.spanHasEvents=o},"update:span-has-events":function(o){n.spanHasEvents=o},"update:spanTypeFilter":function(o){n.selectedSpanTypeFilter=o},"update:span-type-filter":function(o){n.selectedSpanTypeFilter=o},close:n.handleDrawerClose,"span-search":n.handleSpanSearch,"span-select":n.handleSpanSelect,"span-load-more":n.loadMoreSpans}})],1)},og=[],lg=vn(ag,sg,og,!1,null,"63c9cc19");const ds=lg.exports,Gl={routes:[{path:"/trace",name:"trace",component:ds}],beforeEach:(l,n,r)=>{r()}},Kl={common:{home:"首页",todos:"待办事项",trace:"追踪",login:"登录",logout:"退出",user:"用户",search:"搜索",refresh:"刷新",columns:"列设置",confirm:"确定",cancel:"取消",operation:"操作",viewDetail:"查看详情",language:"语言"},span:{searchTree:"Span名称",hasEvents:"只显示有事件"},trace:{title:"追踪列表",searchPlaceholder:"追踪ID/追踪名称",requestId:"追踪ID",timeCreated:"创建时间",timeEnded:"结束时间",status:"状态",executionTime:"执行时长",traceType:"追踪类型",traceName:"追踪名称",traceDetail:"追踪详情",traceId:"追踪ID",clientRequestId:"客户端请求ID",experimentId:"应用ID",application:"应用",experimentName:"应用名称",selectApplication:"请选择应用",spanDetail:"Span 详情",inputs:"输入",outputs:"输出",attributes:"属性",rawInputsOutputs:"原始输入输出",rawInputs:"原始输入",rawOutputs:"原始输出",events:"事件",selectSpan:"请选择一个 Span 查看详情",noInputs:"暂无输入数据",noOutputs:"暂无输出数据",noIoData:"暂无输入输出数据",noEvents:"暂无事件数据",exceptionType:"异常类型",exceptionMessage:"异常消息",exceptionStacktrace:"异常堆栈",otherAttributes:"其他属性",key:"属性名",value:"属性值",selectColumns:"选择列",batchDelete:"批量删除",startTime:"开始时间",endTime:"结束时间",to:"至",confirmDelete:"确认删除",confirmDeleteButton:"确定删除",deleteAllWarning:`警告:您没有设置任何查询条件,这将删除所有 trace 数据!
|
|
87
|
+
`}u+=this.$t("trace.deleteConfirmFooter")}try{await this.$confirm(u,this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:f,dangerouslyUseHTMLString:!1}),this.deleteLoading=!0;let m=null,k=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(m=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(k=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(k=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10))),await kt.deleteTraces(l?this.searchQuery:null,m,k,this.selectedExperimentId,this.selectedStatus),this.$message.success(this.$t("trace.deleteSuccess")),await this.loadTraceList()}catch(m){if(m!=="cancel"){console.error("Failed to delete traces:",m);const k=((y=(p=m.response)==null?void 0:p.data)==null?void 0:y.message)||m.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${k}`)}}finally{this.deleteLoading=!1}},async loadDictList(){try{const l=await kt.getDictList();this.traceSpanTypeList=Array.isArray(l==null?void 0:l.trace_span_type)?l.trace_span_type:[],this.traceStatusList=Array.isArray(l==null?void 0:l.trace_span_status)?l.trace_span_status:[]}catch(l){console.error("Failed to load dict list:",l),this.traceSpanTypeList=[],this.traceStatusList=[]}},getTraceSpanTypeLabel(l){if(l==null||l==="")return"-";const n=this.traceSpanTypeList.find(r=>r.value===l);return n?n.label:l},handleStatusChange(){this.pageNum=1,this.loadTraceList()},handleTraceTypeChange(){this.pageNum=1,this.loadTraceList()},handleSortChange({column:l,prop:n,order:r}){this.sortProp=r?n:null,this.sortOrder=r||null,this.pageNum=1,this.loadTraceList()},getStatusLabel(l){if(!l)return"-";const n=this.traceStatusList.find(r=>r.value===l);return n?n.label:l},getStatusType(l){return{OK:"success",ERROR:"danger",IN_PROGRESS:"warning",WARN:"warning",UNSET:"info"}[l]||"info"},formatDateTime(l){if(!l)return"-";const n=typeof l=="string"?parseInt(l,10):l;if(isNaN(n))return"-";const r=new Date(n);if(isNaN(r.getTime()))return"-";const o=r.getFullYear(),u=String(r.getMonth()+1).padStart(2,"0"),f=String(r.getDate()).padStart(2,"0"),p=String(r.getHours()).padStart(2,"0"),y=String(r.getMinutes()).padStart(2,"0"),m=String(r.getSeconds()).padStart(2,"0");return`${o}-${u}-${f} ${p}:${y}:${m}`},formatTimeAgo(l){if(!l)return"-";const n=typeof l=="string"?parseInt(l,10):l;if(isNaN(n))return"-";const o=Date.now()-n,u=this.$i18n.locale==="zh-CN",f=Math.floor(o/(1e3*60*60*24));if(f>0)return u?`${f} 天前`:`${f} days ago`;const p=Math.floor(o/(1e3*60*60));if(p>0)return u?`${p} 小时前`:`${p} hours ago`;const y=Math.floor(o/(1e3*60));return y>0?u?`${y} 分钟前`:`${y} minutes ago`:u?"刚刚":"Just now"},formatNanoDuration(l){if(!l)return"-";const n=l/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`},formatJson(l){return l?JSON.stringify(l,null,2):""},formatRawJson(l){if(!l)return"";if(typeof l=="string")try{const n=JSON.parse(l);return JSON.stringify(n,null,2)}catch{try{const r=l.replace(/\\"/g,'"').replace(/^"|"$/g,""),o=JSON.parse(r);return JSON.stringify(o,null,2)}catch{return l}}return JSON.stringify(l,null,2)},handleCodeMirrorReady(l){this.$nextTick(()=>{l&&l.refresh()})},formatMessageContent(l){return typeof l=="string"?l:JSON.stringify(l,null,2)},formatEventTime(l){if(l.time_unix_nano){const n=l.time_unix_nano/1e6;return new Date(n).toLocaleString("zh-CN")}return l.timestamp?new Date(l.timestamp).toLocaleString("zh-CN"):"-"},tableRowClassName({row:l,rowIndex:n}){return"trace-row"},getIndex(l){return(this.pageNum-1)*this.pageSize+l+1},handleSelectionChange(l){this.selectedRows=l||[]},async handleSingleDelete(l){var r,o;const n=l==null?void 0:l.trace_id;if(n)try{await this.$confirm(this.$t("trace.confirmRemoveOne"),this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:"warning"}),this.deleteLoading=!0,await kt.removeTraces([n]),this.$message.success(this.$t("trace.deleteSuccess")),this.currentTraceId===n&&(this.drawerVisible=!1,this.handleDrawerClose()),await this.loadTraceList(),this.clearSelection()}catch(u){if(u!=="cancel"){console.error("Failed to delete trace:",u);const f=((o=(r=u.response)==null?void 0:r.data)==null?void 0:o.message)||u.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${f}`)}}finally{this.deleteLoading=!1}},async handleDeleteSelected(){var o,u;if(this.selectedRows.length===0)return;const l=this.selectedRows.map(f=>f.trace_id).filter(Boolean);if(l.length===0)return;const n=l.length,r=this.$t("trace.confirmRemoveSelected").replace("{count}",String(n));try{await this.$confirm(r,this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:"warning"}),this.deleteLoading=!0,await kt.removeTraces(l),this.$message.success(this.$t("trace.deleteSuccess")),this.currentTraceId&&l.includes(this.currentTraceId)&&(this.drawerVisible=!1,this.handleDrawerClose()),await this.loadTraceList(),this.clearSelection()}catch(f){if(f!=="cancel"){console.error("Failed to delete traces:",f);const p=((u=(o=f.response)==null?void 0:o.data)==null?void 0:u.message)||f.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${p}`)}}finally{this.deleteLoading=!1}},copyTraceIdToClipboard(l){l&&Bi(l,this)},clearSelection(){this.$nextTick(()=>{this.$refs.traceTable&&this.$refs.traceTable.clearSelection(),this.selectedRows=[]})},async handleSingleExport(l){var r,o;const n=l==null?void 0:l.trace_id;if(n)try{this.exportLoading=!0;const u=await kt.exportTraces([n]),f=u==null?void 0:u.storage_key;if(f){const p=zi(f);p&&window.open(p,"_blank"),this.$message.success(this.$t("trace.exportSuccess"))}}catch(u){const f=((o=(r=u.response)==null?void 0:r.data)==null?void 0:o.message)||u.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.exportFailed")}: ${f}`)}finally{this.exportLoading=!1}},async handleBatchExport(){var n,r;if(this.selectedRows.length===0)return;const l=this.selectedRows.map(o=>o.trace_id).filter(Boolean);if(l.length!==0)try{this.exportLoading=!0;const o=await kt.exportTraces(l),u=o==null?void 0:o.storage_key;if(u){const f=zi(u);f&&window.open(f,"_blank"),this.$message.success(this.$t("trace.exportSuccess"))}}catch(o){const u=((r=(n=o.response)==null?void 0:n.data)==null?void 0:r.message)||o.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.exportFailed")}: ${u}`)}finally{this.exportLoading=!1}},async handleImportFileChange(l){var r,o,u;const n=(r=l.target.files)==null?void 0:r[0];if(n)try{this.importLoading=!0,await kt.importTraces(n),this.$message.success(this.$t("trace.importSuccess")),await this.loadTraceList()}catch(f){const p=((u=(o=f.response)==null?void 0:o.data)==null?void 0:u.message)||f.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.importFailed")}: ${p}`)}finally{this.importLoading=!1,this.$refs.importFileInput&&(this.$refs.importFileInput.value="")}},applyColumns(){const l={};this.selectedColumns.forEach(n=>{l[n]=!0}),Object.keys(this.visibleColumns).forEach(n=>{this.selectedColumns.includes(n)||(l[n]=!1)}),this.visibleColumns=l,this.showColumnDialog=!1}}};var sg=function(){var n=this,r=n._self._c;return r("div",{staticClass:"trace-list-container"},[r("el-card",[r("div",{staticClass:"trace-content-wrapper"},[r("div",{staticClass:"trace-toolbar"},[r("el-select",{staticClass:"toolbar-select",attrs:{placeholder:n.$t("trace.selectApplication"),clearable:"",size:"mini"},on:{change:n.handleExperimentChange},model:{value:n.selectedExperimentId,callback:function(o){n.selectedExperimentId=o},expression:"selectedExperimentId"}},n._l(n.experimentList,function(o){return r("el-option",{key:o.experiment_id,attrs:{label:o.name,value:o.experiment_id}})}),1),r("el-input",{staticClass:"toolbar-input",attrs:{placeholder:n.$t("trace.searchPlaceholder"),"prefix-icon":"el-icon-search",clearable:"",size:"mini"},on:{clear:n.handleSearchClear,input:n.handleSearch},model:{value:n.searchQuery,callback:function(o){n.searchQuery=o},expression:"searchQuery"}}),r("el-select",{staticClass:"toolbar-select",attrs:{placeholder:n.$t("trace.status"),clearable:"",size:"mini"},on:{change:n.handleStatusChange},model:{value:n.selectedStatus,callback:function(o){n.selectedStatus=o},expression:"selectedStatus"}},n._l(n.traceStatusList,function(o){return r("el-option",{key:o.value,attrs:{label:o.label,value:o.value}})}),1),r("el-select",{staticClass:"toolbar-select",attrs:{placeholder:n.$t("trace.traceType"),clearable:"",size:"mini"},on:{change:n.handleTraceTypeChange},model:{value:n.selectedTraceType,callback:function(o){n.selectedTraceType=o},expression:"selectedTraceType"}},n._l(n.traceSpanTypeList,function(o){return r("el-option",{key:o.value,attrs:{label:o.label,value:o.value}})}),1),r("el-date-picker",{staticClass:"toolbar-date-picker",attrs:{type:"datetimerange","range-separator":n.$t("trace.to"),"start-placeholder":n.$t("trace.startTime"),"end-placeholder":n.$t("trace.endTime"),"value-format":"timestamp",format:"yyyy-MM-dd HH:mm:ss",size:"mini","picker-options":n.pickerOptions,clearable:""},on:{change:n.handleDateRangeChange},model:{value:n.dateRange,callback:function(o){n.dateRange=o},expression:"dateRange"}}),r("el-button",{attrs:{type:"primary",icon:"el-icon-download",size:"mini",disabled:n.exportLoading||n.selectedRows.length===0},on:{click:n.handleBatchExport}},[n._v(" "+n._s(n.$t("trace.exportBatch"))+" ("+n._s(n.selectedRows.length)+") ")]),r("el-button",{attrs:{size:"mini",icon:"el-icon-upload2",loading:n.importLoading},on:{click:function(o){n.$refs.importFileInput&&n.$refs.importFileInput.click()}}},[n._v(" "+n._s(n.$t("trace.importBatch"))+" ")]),r("input",{ref:"importFileInput",staticStyle:{display:"none"},attrs:{type:"file",accept:".gz"},on:{change:n.handleImportFileChange}}),r("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"mini",disabled:n.deleteLoading||n.selectedRows.length===0},on:{click:n.handleDeleteSelected}},[n._v(" "+n._s(n.$t("trace.deleteSelected"))+" ("+n._s(n.selectedRows.length)+") ")]),r("el-checkbox",{staticClass:"toolbar-auto-refresh",attrs:{size:"mini"},model:{value:n.autoRefreshEnabled,callback:function(o){n.autoRefreshEnabled=o},expression:"autoRefreshEnabled"}},[n._v(" "+n._s(n.$t("trace.autoRefresh"))+" ")]),n.autoRefreshEnabled?r("el-select",{staticClass:"toolbar-interval-select",attrs:{size:"mini"},on:{change:n.handleAutoRefreshIntervalChange},model:{value:n.autoRefreshInterval,callback:function(o){n.autoRefreshInterval=o},expression:"autoRefreshInterval"}},[r("el-option",{attrs:{label:n.$t("trace.refreshInterval5s"),value:5}}),r("el-option",{attrs:{label:n.$t("trace.refreshInterval10s"),value:10}}),r("el-option",{attrs:{label:n.$t("trace.refreshInterval20s"),value:20}})],1):n._e(),r("el-tooltip",{attrs:{content:n.$t("common.refresh"),placement:"top"}},[r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini",circle:""},on:{click:n.refresh}})],1),r("el-button",{attrs:{icon:"el-icon-setting",size:"mini"},on:{click:function(o){n.showColumnDialog=!0}}},[n._v(" "+n._s(n.$t("common.columns"))+" ")])],1),r("div",{staticClass:"trace-table-wrapper"},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}],ref:"traceTable",staticStyle:{width:"100%"},attrs:{data:n.filteredTraceList,"default-sort":{prop:"timestamp_ms",order:"descending"},size:"mini",stripe:"","row-class-name":n.tableRowClassName},on:{"selection-change":n.handleSelectionChange,"sort-change":n.handleSortChange}},[r("el-table-column",{attrs:{type:"selection",width:"48","class-name":"selection-column"}}),r("el-table-column",{attrs:{type:"index",label:"#",width:"60",index:n.getIndex}}),n.visibleColumns.trace_id?r("el-table-column",{attrs:{prop:"trace_id",label:n.$t("trace.requestId"),width:"280"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-tooltip",{attrs:{placement:"top","popper-class":"trace-id-copy-tooltip"}},[r("template",{slot:"content"},[r("div",{staticClass:"trace-id-tooltip-content"},[r("span",{staticClass:"trace-id-tooltip-text"},[n._v(n._s(o.row.trace_id))]),r("el-button",{staticClass:"trace-id-copy-btn",attrs:{type:"text",size:"mini"},nativeOn:{click:function(u){return u.stopPropagation(),n.copyTraceIdToClipboard(o.row.trace_id)}}},[n._v(" "+n._s(n.$t("trace.copy"))+" ")])],1)]),r("el-link",{attrs:{type:"primary"},on:{click:function(u){return u.stopPropagation(),n.viewDetail(o.row)}}},[n._v(" "+n._s(o.row.trace_id)+" ")])],2)]}}],null,!1,2525458733)}):n._e(),n.visibleColumns.trace_name?r("el-table-column",{attrs:{prop:"trace_name",label:n.$t("trace.traceName"),"min-width":"300","show-overflow-tooltip":""},scopedSlots:n._u([{key:"default",fn:function(o){return[r("span",[n._v(n._s(o.row.trace_name||"-"))])]}}],null,!1,3633653970)}):n._e(),n.visibleColumns.experiment_name?r("el-table-column",{attrs:{prop:"experiment_name",label:n.$t("trace.experimentName"),width:"140","show-overflow-tooltip":""},scopedSlots:n._u([{key:"default",fn:function(o){return[r("span",[n._v(n._s(o.row.experiment_name||"-"))])]}}],null,!1,4093523474)}):n._e(),n.visibleColumns.trace_type?r("el-table-column",{attrs:{prop:"trace_type",label:n.$t("trace.traceType"),width:"120"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-tag",{attrs:{size:"mini",type:"info"}},[n._v(n._s(n.getTraceSpanTypeLabel(o.row.trace_type)))])]}}],null,!1,307785716)}):n._e(),n.visibleColumns.execution_time_ms?r("el-table-column",{attrs:{prop:"execution_time_ms",label:n.$t("trace.executionTime"),width:"120",sortable:"custom","sort-order":n.sortProp==="execution_time_ms"?n.sortOrder:null},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatNanoDuration(o.row.execution_time_ms))+" ")]}}],null,!1,1733254102)}):n._e(),n.visibleColumns.status?r("el-table-column",{attrs:{prop:"status",label:n.$t("trace.status"),width:"100"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-tag",{attrs:{type:n.getStatusType(o.row.status),size:"mini"}},[o.row.status==="OK"?r("i",{staticClass:"el-icon-success"}):n._e(),n._v(" "+n._s(n.getStatusLabel(o.row.status))+" ")])]}}],null,!1,4220190539)}):n._e(),n.visibleColumns.timestamp_ms?r("el-table-column",{attrs:{prop:"timestamp_ms",label:n.$t("trace.timeCreated"),width:"180",sortable:"custom","sort-order":n.sortProp==="timestamp_ms"?n.sortOrder:null},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatDateTime(o.row.timestamp_ms))+" ")]}}],null,!1,1082702673)}):n._e(),n.visibleColumns.end_time_ms?r("el-table-column",{attrs:{prop:"end_time_ms",label:n.$t("trace.timeEnded"),width:"180",sortable:"custom","sort-order":n.sortProp==="end_time_ms"?n.sortOrder:null},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatDateTime(o.row.end_time_ms))+" ")]}}],null,!1,2066523034)}):n._e(),r("el-table-column",{attrs:{label:n.$t("common.operation"),width:"200",fixed:"right"},scopedSlots:n._u([{key:"default",fn:function(o){return[r("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(u){return u.stopPropagation(),n.viewDetail(o.row)}}},[n._v(" "+n._s(n.$t("common.viewDetail"))+" ")]),r("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(u){return u.stopPropagation(),n.handleSingleExport(o.row)}}},[n._v(" "+n._s(n.$t("trace.exportSingle"))+" ")]),r("el-button",{staticClass:"operation-delete",attrs:{type:"text",size:"mini"},on:{click:function(u){return u.stopPropagation(),n.handleSingleDelete(o.row)}}},[n._v(" "+n._s(n.$t("trace.delete"))+" ")])]}}])})],1)],1),r("div",{staticClass:"trace-pagination-wrapper"},[n.total>0?r("el-pagination",{staticClass:"trace-pagination",attrs:{"current-page":n.pageNum,"page-sizes":[10,20,50,100],"page-size":n.pageSize,size:"mini",layout:"total, prev, pager, next, sizes, jumper",total:n.total,background:""},on:{"size-change":n.handleSizeChange,"current-change":n.handleCurrentChange}}):n._e()],1)])]),r("el-dialog",{attrs:{title:n.$t("trace.selectColumns"),visible:n.showColumnDialog,width:"400px"},on:{"update:visible":function(o){n.showColumnDialog=o}}},[r("el-checkbox-group",{model:{value:n.selectedColumns,callback:function(o){n.selectedColumns=o},expression:"selectedColumns"}},[r("el-checkbox",{attrs:{label:"trace_id"}},[n._v(n._s(n.$t("trace.requestId")))]),r("el-checkbox",{attrs:{label:"timestamp_ms"}},[n._v(n._s(n.$t("trace.timeCreated")))]),r("el-checkbox",{attrs:{label:"end_time_ms"}},[n._v(n._s(n.$t("trace.timeEnded")))]),r("el-checkbox",{attrs:{label:"status"}},[n._v(n._s(n.$t("trace.status")))]),r("el-checkbox",{attrs:{label:"execution_time_ms"}},[n._v(n._s(n.$t("trace.executionTime")))]),r("el-checkbox",{attrs:{label:"trace_type"}},[n._v(n._s(n.$t("trace.traceType")))]),r("el-checkbox",{attrs:{label:"trace_name"}},[n._v(n._s(n.$t("trace.traceName")))]),r("el-checkbox",{attrs:{label:"experiment_name"}},[n._v(n._s(n.$t("trace.experimentName")))])],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{size:"mini"},on:{click:function(o){n.showColumnDialog=!1}}},[n._v(n._s(n.$t("common.cancel")))]),r("el-button",{attrs:{size:"mini",type:"primary"},on:{click:n.applyColumns}},[n._v(n._s(n.$t("common.confirm")))])],1)],1),r("TraceDetailDrawer",{attrs:{visible:n.drawerVisible,"current-trace-id":n.currentTraceId,"trace-info":n.traceInfo,"trace-status-list":n.traceStatusList,"trace-span-type-list":n.traceSpanTypeList,spans:n.spans,"filtered-spans":n.filteredSpans,"selected-span-id":n.selectedSpanId,"selected-span":n.selectedSpan,loading:n.drawerLoading,"span-has-next-page":n.spanHasNextPage,"span-load-more-loading":n.spanLoadMoreLoading,"span-page-size":n.spanPageSize,"span-has-events":n.spanHasEvents,"span-type-filter":n.selectedSpanTypeFilter},on:{"update:visible":[function(o){n.drawerVisible=o},function(o){n.drawerVisible=o}],"update:spanPageSize":function(o){n.spanPageSize=o},"update:span-page-size":function(o){n.spanPageSize=o},"update:spanHasEvents":function(o){n.spanHasEvents=o},"update:span-has-events":function(o){n.spanHasEvents=o},"update:spanTypeFilter":function(o){n.selectedSpanTypeFilter=o},"update:span-type-filter":function(o){n.selectedSpanTypeFilter=o},close:n.handleDrawerClose,"span-search":n.handleSpanSearch,"span-select":n.handleSpanSelect,"span-load-more":n.loadMoreSpans}})],1)},og=[],lg=vn(ag,sg,og,!1,null,"86ff51fc");const ds=lg.exports,Gl={routes:[{path:"/trace",name:"trace",component:ds}],beforeEach:(l,n,r)=>{r()}},Kl={common:{home:"首页",todos:"待办事项",trace:"追踪",login:"登录",logout:"退出",user:"用户",search:"搜索",refresh:"刷新",columns:"列设置",confirm:"确定",cancel:"取消",operation:"操作",viewDetail:"查看详情",language:"语言"},span:{searchTree:"Span名称",hasEvents:"只显示有事件"},trace:{title:"追踪列表",searchPlaceholder:"追踪ID/追踪名称",requestId:"追踪ID",timeCreated:"创建时间",timeEnded:"结束时间",status:"状态",executionTime:"执行时长",traceType:"追踪类型",traceName:"追踪名称",traceDetail:"追踪详情",traceId:"追踪ID",clientRequestId:"客户端请求ID",experimentId:"应用ID",application:"应用",experimentName:"应用名称",selectApplication:"请选择应用",spanDetail:"Span 详情",inputs:"输入",outputs:"输出",attributes:"属性",rawInputsOutputs:"原始输入输出",rawInputs:"原始输入",rawOutputs:"原始输出",events:"事件",selectSpan:"请选择一个 Span 查看详情",noInputs:"暂无输入数据",noOutputs:"暂无输出数据",noIoData:"暂无输入输出数据",noEvents:"暂无事件数据",exceptionType:"异常类型",exceptionMessage:"异常消息",exceptionStacktrace:"异常堆栈",otherAttributes:"其他属性",key:"属性名",value:"属性值",selectColumns:"选择列",batchDelete:"批量删除",startTime:"开始时间",endTime:"结束时间",to:"至",confirmDelete:"确认删除",confirmDeleteButton:"确定删除",deleteAllWarning:`警告:您没有设置任何查询条件,这将删除所有 trace 数据!
|
|
88
88
|
|
|
89
89
|
此操作不可恢复,请确认是否继续?`,deleteConfirmMessage:"确定要删除符合以下条件的 trace 吗?",searchCondition:"搜索条件",timeRange:"时间范围",before:"在",deleteConfirmFooter:`
|
|
90
90
|
此操作不可恢复,请确认是否继续?`,deleteSuccess:"删除成功",deleteFailed:"删除失败",delete:"删除",deleteSelected:"删除选中",confirmRemoveOne:"确定删除该条 trace?",confirmRemoveSelected:"确定删除选中的 {count} 条 trace?",unknownError:"未知错误",autoRefresh:"自动刷新",refreshInterval5s:"5秒",refreshInterval10s:"10秒",refreshInterval20s:"20秒",clickToDownload:"点击文件名下载",pdfLoading:"加载中...",pdfPrevPage:"上一页",pdfNextPage:"下一页",pdfPageIndicator:"第 {page} / {total} 页",pdfDownload:"下载",pdfFullscreen:"全屏",pdfExitFullscreen:"退出全屏",export:"导出",exportSingle:"导出",exportBatch:"批量导出",importBatch:"批量导入",exportSuccess:"导出成功",exportFailed:"导出失败",importSuccess:"导入成功",importFailed:"导入失败",copy:"复制"},debug:{paramLabel:"参数",systemPrompt:"系统提示词",userPrompt:"用户提示词",submitImage:"是否提交图片",addParam:"新增参数",sendFile:"发送文件",reset:"重置",submit:"提交",responseResult:"输出",switchToMarkdown:"切换为Markdown",switchToRaw:"切换为原始输出",paramName:"参数名",paramValue:"参数值",yes:"是",no:"否",calculateTokens:"Token计算",calculateTokensTooltip:"仅计算文本类型提示词的token",copyTooltip:"复制内容",copySuccess:"复制成功",copyFailed:"复制失败",copyEmpty:"内容为空",tokenResultTitle:"Token计算结果",tokenType:"类型",tokenCount:"数量",specialTokens:"特殊字符",systemTokens:"系统提示词",userTokens:"用户提示词",assistantTokens:"助手回答",textTokens:"总计",systemRole:"系统",userRole:"用户",assistantRole:"助手"}},Vl={common:{home:"Home",todos:"Todos",trace:"Trace",login:"Login",logout:"Logout",user:"User",search:"Search",refresh:"Refresh",columns:"Columns",confirm:"Confirm",cancel:"Cancel",operation:"Operation",viewDetail:"View Detail",language:"Language"},span:{searchTree:"Span Name",hasEvents:"Has events"},trace:{title:"Traces",searchPlaceholder:"Trace ID/Trace Name",requestId:"Trace ID",timeCreated:"Time created",timeEnded:"Time ended",status:"Status",executionTime:"Execution time",traceType:"Trace Type",traceName:"Trace Name",traceDetail:"Trace Detail",traceId:"Trace ID",clientRequestId:"Client Request ID",experimentId:"Application ID",application:"Application",experimentName:"Application Name",selectApplication:"Please select application",spanDetail:"Span Detail",inputs:"Inputs",outputs:"Outputs",attributes:"Attributes",rawInputsOutputs:"Raw Inputs/Outputs",rawInputs:"Raw Inputs",rawOutputs:"Raw Outputs",events:"Events",selectSpan:"Please select a Span to view details",noInputs:"No input data",noOutputs:"No output data",noIoData:"No input/output data",noEvents:"No event data",exceptionType:"Exception Type",exceptionMessage:"Exception Message",exceptionStacktrace:"Exception Stacktrace",otherAttributes:"Other Attributes",key:"Key",value:"Value",selectColumns:"Select Columns",batchDelete:"Batch Delete",startTime:"Start Time",endTime:"End Time",to:" to ",confirmDelete:"Confirm Delete",confirmDeleteButton:"Confirm Delete",deleteAllWarning:`Warning: You have not set any query conditions. This will delete all trace data!
|