ext-static_highlight-dd8e04be.js 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import{g as P}from"./index-3157015c.js";function D(m,b){for(var a=0;a<b.length;a++){const u=b[a];if(typeof u!="string"&&!Array.isArray(u)){for(const l in u)if(l!=="default"&&!(l in m)){const v=Object.getOwnPropertyDescriptor(u,l);v&&Object.defineProperty(m,l,v.get?v:{enumerable:!0,get:()=>u[l]})}}}return Object.freeze(Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}))}var T={exports:{}};(function(m,b){ace.define("ace/ext/static.css",["require","exports","module"],function(a,u,l){l.exports=`.ace_static_highlight {
  2. font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', 'Droid Sans Mono', monospace;
  3. font-size: 12px;
  4. white-space: pre-wrap
  5. }
  6. .ace_static_highlight .ace_gutter {
  7. width: 2em;
  8. text-align: right;
  9. padding: 0 3px 0 0;
  10. margin-right: 3px;
  11. contain: none;
  12. }
  13. .ace_static_highlight.ace_show_gutter .ace_line {
  14. padding-left: 2.6em;
  15. }
  16. .ace_static_highlight .ace_line { position: relative; }
  17. .ace_static_highlight .ace_gutter-cell {
  18. -moz-user-select: -moz-none;
  19. -khtml-user-select: none;
  20. -webkit-user-select: none;
  21. user-select: none;
  22. top: 0;
  23. bottom: 0;
  24. left: 0;
  25. position: absolute;
  26. }
  27. .ace_static_highlight .ace_gutter-cell:before {
  28. content: counter(ace_line, decimal);
  29. counter-increment: ace_line;
  30. }
  31. .ace_static_highlight {
  32. counter-reset: ace_line;
  33. }
  34. `}),ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/ext/static.css","ace/config","ace/lib/dom","ace/lib/lang"],function(a,u,l){var v=a("../edit_session").EditSession,E=a("../layer/text").Text,L=a("./static.css"),S=a("../config"),$=a("../lib/dom"),O=a("../lib/lang").escapeHTML,w=function(){function t(e){this.type=e,this.style={},this.textContent=""}return t.prototype.cloneNode=function(){return this},t.prototype.appendChild=function(e){this.textContent+=e.toString()},t.prototype.toString=function(){var e=[];if(this.type!="fragment"){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var r=[];for(var o in this.style)r.push(o,":",this.style[o]);r.length&&e.push(" style='",r.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push("</",this.type,">"),e.join("")},t}(),_={createTextNode:function(t,e){return O(t)},createElement:function(t){return new w(t)},createFragment:function(){return new w("fragment")}},N=function(){this.config={},this.dom=_};N.prototype=E.prototype;var x=function(t,e,r){var o=t.className.match(/lang-(\w+)/),d=e.mode||o&&"ace/mode/"+o[1];if(!d)return!1;var c=e.theme||"ace/theme/textmate",n="",g=[];if(t.firstElementChild)for(var h=0,s=0;s<t.childNodes.length;s++){var i=t.childNodes[s];i.nodeType==3?(h+=i.data.length,n+=i.data):g.push(h,i)}else n=t.textContent,e.trim&&(n=n.trim());x.render(n,d,c,e.firstLineNumber,!e.showGutter,function(f){$.importCssString(f.css,"ace_highlight"),t.innerHTML=f.html;for(var y=t.firstChild.firstChild,p=0;p<g.length;p+=2){var C=f.session.doc.indexToPosition(g[p]),z=g[p+1],M=y.children[C.row];M&&M.appendChild(z)}r&&r()})};x.render=function(t,e,r,o,d,c){var n=1,g=v.prototype.$modes;typeof r=="string"&&(n++,S.loadModule(["theme",r],function(i){r=i,--n||s()}));var h;e&&typeof e=="object"&&!e.getTokenizer&&(h=e,e=h.path),typeof e=="string"&&(n++,S.loadModule(["mode",e],function(i){(!g[e]||h)&&(g[e]=new i.Mode(h)),e=g[e],--n||s()}));function s(){var i=x.renderSync(t,e,r,o,d);return c?c(i):i}return--n||s()},x.renderSync=function(t,e,r,o,d){o=parseInt(o||1,10);var c=new v("");c.setUseWorker(!1),c.setMode(e);var n=new N;n.setSession(c),Object.keys(n.$tabStrings).forEach(function(p){if(typeof n.$tabStrings[p]=="string"){var C=_.createFragment();C.textContent=n.$tabStrings[p],n.$tabStrings[p]=C}}),c.setValue(t);var g=c.getLength(),h=_.createElement("div");h.className=r.cssClass;var s=_.createElement("div");s.className="ace_static_highlight"+(d?"":" ace_show_gutter"),s.style["counter-reset"]="ace_line "+(o-1);for(var i=0;i<g;i++){var f=_.createElement("div");if(f.className="ace_line",!d){var y=_.createElement("span");y.className="ace_gutter ace_gutter-cell",y.textContent="",f.appendChild(y)}n.$renderLine(f,i,!1),f.textContent+=`
  35. `,s.appendChild(f)}return h.appendChild(s),{css:L+r.cssText,html:h.toString(),session:c}},l.exports=x,l.exports.highlight=x}),function(){ace.require(["ace/ext/static_highlight"],function(a){m&&(m.exports=a)})}()})(T);var j=T.exports;const F=P(j),A=D({__proto__:null,default:F},[j]);export{A as e};