zky_mandate/resource/public/doc/webjars/js/EditorDebugShow-babc8553.js

6 lines
17 KiB
JavaScript

import{_ as B,V as F,aG as L,aH as S,o as T,j as y,l as C,J as M,r as I}from"./doc-19de6184.js";import"./ext-language_tools-95de2ac7.js";var O={exports:{}};(function(x,m){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(r,v,k){var h=r("../lib/oop"),f=r("./text_highlight_rules").TextHighlightRules,c=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};h.inherits(c,f),v.JsonHighlightRules=c}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(r,v,k){var h=r("../range").Range,f=function(){};(function(){this.checkOutdent=function(c,g){return/^\s+$/.test(c)?/^\s*\}/.test(g):!1},this.autoOutdent=function(c,g){var u=c.getLine(g),l=u.match(/^(\s*\})/);if(!l)return 0;var i=l[1].length,o=c.findMatchingBracket({row:g,column:i});if(!o||o.row==g)return 0;var t=this.$getIndent(c.getLine(o.row));c.replace(new h(g,0,g,i-1),t)},this.$getIndent=function(c){return c.match(/^\s*/)[0]}}).call(f.prototype),v.MatchingBraceOutdent=f}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(r,v,k){var h=r("../../lib/oop"),f=r("../../range").Range,c=r("./fold_mode").FoldMode,g=v.FoldMode=function(u){u&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+u.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+u.end)))};h.inherits(g,c),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(u,l,i){var o=u.getLine(i);if(this.singleLineBlockCommentRe.test(o)&&!this.startRegionRe.test(o)&&!this.tripleStarBlockCommentRe.test(o))return"";var t=this._getFoldWidgetBase(u,l,i);return!t&&this.startRegionRe.test(o)?"start":t},this.getFoldWidgetRange=function(u,l,i,o){var t=u.getLine(i);if(this.startRegionRe.test(t))return this.getCommentRegionBlock(u,t,i);var a=t.match(this.foldingStartMarker);if(a){var e=a.index;if(a[1])return this.openingBracketBlock(u,a[1],i,e);var n=u.getCommentFoldRange(i,e+a[0].length,1);return n&&!n.isMultiLine()&&(o?n=this.getSectionRange(u,i):l!="all"&&(n=null)),n}if(l!=="markbegin"){var a=t.match(this.foldingStopMarker);if(a){var e=a.index+a[0].length;return a[1]?this.closingBracketBlock(u,a[1],i,e):u.getCommentFoldRange(i,e,-1)}}},this.getSectionRange=function(u,l){var i=u.getLine(l),o=i.search(/\S/),t=l,e=i.length;l=l+1;for(var n=l,a=u.getLength();++l<a;){i=u.getLine(l);var s=i.search(/\S/);if(s!==-1){if(o>s)break;var d=this.getFoldWidgetRange(u,"all",l);if(d){if(d.start.row<=t)break;if(d.isMultiLine())l=d.end.row;else if(o==s)break}n=l}}return new f(t,e,n,u.getLine(n).length)},this.getCommentRegionBlock=function(u,l,i){for(var o=l.search(/\s*$/),t=u.getLength(),e=i,n=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;++i<t;){l=u.getLine(i);var s=n.exec(l);if(!!s&&(s[1]?a--:a++,!a))break}var d=i;if(d>e)return new f(e,o,d,l.length)}}.call(g.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],function(r,v,k){var h=r("../lib/oop"),f=r("./text").Mode,c=r("./json_highlight_rules").JsonHighlightRules,g=r("./matching_brace_outdent").MatchingBraceOutdent,u=r("./behaviour/cstyle").CstyleBehaviour,l=r("./folding/cstyle").FoldMode,i=r("../worker/worker_client").WorkerClient,o=function(){this.HighlightRules=c,this.$outdent=new g,this.$behaviour=new u,this.foldingRules=new l};h.inherits(o,f),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(t,e,n){var a=this.$getIndent(e);if(t=="start"){var s=e.match(/^.*[\{\(\[]\s*$/);s&&(a+=n)}return a},this.checkOutdent=function(t,e,n){return this.$outdent.checkOutdent(e,n)},this.autoOutdent=function(t,e,n){this.$outdent.autoOutdent(e,n)},this.createWorker=function(t){var e=new i(["ace"],"ace/mode/json_worker","JsonWorker");return e.attachToDocument(t.getDocument()),e.on("annotate",function(n){t.setAnnotations(n.data)}),e.on("terminate",function(){t.clearAnnotations()}),e},this.$id="ace/mode/json"}.call(o.prototype),v.Mode=o}),function(){ace.require(["ace/mode/json"],function(r){x&&(x.exports=r)})}()})(O);var E={exports:{}};(function(x,m){ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(r,v,k){var h=r("../lib/oop"),f=r("./text_highlight_rules").TextHighlightRules,c=function(g){var u="[_:a-zA-Z\xC0-\uFFFF][-_:.a-zA-Z0-9\xC0-\uFFFF]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+u+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"</"},{token:"text.tag-open.xml",regex:"<"},{include:"reference"},{defaultToken:"text.xml"}],processing_instruction:[{token:"entity.other.attribute-name.decl-attribute-name.xml",regex:u},{token:"keyword.operator.decl-attribute-equals.xml",regex:"="},{include:"whitespace"},{include:"string"},{token:"punctuation.xml-decl.xml",regex:"\\?>",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+u+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(</))((?:"+u+":)?"+u+")",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:u},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===c&&this.normalizeRules()};(function(){this.embedTagRules=function(g,u,l){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+l+".tag-name.xml"],regex:"(<)("+l+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:u+"start"}]}),this.$rules[l+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(i,o,t){return t.splice(0),this.token}}],this.embedRules(g,u,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+l+".tag-name.xml"],regex:"(</)("+l+"(?=\\s|>|$))",next:l+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(f.prototype),h.inherits(c,f),v.XmlHighlightRules=c}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(r,v,k){var h=r("../../lib/oop"),f=r("../behaviour").Behaviour,c=r("../../token_iterator").TokenIterator;r("../../lib/lang");function g(l,i){return l&&l.type.lastIndexOf(i+".xml")>-1}var u=function(){this.add("string_dquotes","insertion",function(l,i,o,t,e){if(e=='"'||e=="'"){var n=e,a=t.doc.getTextRange(o.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&o.getWrapBehavioursEnabled())return{text:n+a+n,selection:!1};var s=o.getCursorPosition(),d=t.doc.getLine(s.row),b=d.substring(s.column,s.column+1),w=new c(t,s.row,s.column),p=w.getCurrentToken();if(b==n&&(g(p,"attribute-value")||g(p,"string")))return{text:"",selection:[1,1]};if(p||(p=w.stepBackward()),!p)return;for(;g(p,"tag-whitespace")||g(p,"whitespace");)p=w.stepBackward();var _=!b||b.match(/\s/);if(g(p,"attribute-equals")&&(_||b==">")||g(p,"decl-attribute-equals")&&(_||b=="?"))return{text:n+n,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(l,i,o,t,e){var n=t.doc.getTextRange(e);if(!e.isMultiLine()&&(n=='"'||n=="'")){var a=t.doc.getLine(e.start.row),s=a.substring(e.start.column+1,e.start.column+2);if(s==n)return e.end.column++,e}}),this.add("autoclosing","insertion",function(l,i,o,t,e){if(e==">"){var n=o.getSelectionRange().start,a=new c(t,n.row,n.column),s=a.getCurrentToken()||a.stepBackward();if(!s||!(g(s,"tag-name")||g(s,"tag-whitespace")||g(s,"attribute-name")||g(s,"attribute-equals")||g(s,"attribute-value"))||g(s,"reference.attribute-value"))return;if(g(s,"attribute-value")){var d=a.getCurrentTokenColumn()+s.value.length;if(n.column<d)return;if(n.column==d){var b=a.stepForward();if(b&&g(b,"attribute-value"))return;a.stepBackward()}}if(/^\s*>/.test(t.getLine(n.row).slice(n.column)))return;for(;!g(s,"tag-name");)if(s=a.stepBackward(),s.value=="<"){s=a.stepForward();break}var w=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn();if(g(a.stepBackward(),"end-tag-open"))return;var _=s.value;return w==n.row&&(_=_.substring(0,n.column-p)),this.voidElements.hasOwnProperty(_.toLowerCase())?void 0:{text:"></"+_+">",selection:[1,1]}}}),this.add("autoindent","insertion",function(l,i,o,t,e){if(e==`
`){var n=o.getCursorPosition(),a=t.getLine(n.row),s=new c(t,n.row,n.column),d=s.getCurrentToken();if(d&&d.type.indexOf("tag-close")!==-1){if(d.value=="/>")return;for(;d&&d.type.indexOf("tag-name")===-1;)d=s.stepBackward();if(!d)return;var b=d.value,w=s.getCurrentTokenRow();if(d=s.stepBackward(),!d||d.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[b]){var p=t.getTokenAt(n.row,n.column+1),a=t.getLine(w),_=this.$getIndent(a),R=_+t.getTabString();return p&&p.value==="</"?{text:`
`+R+`
`+_,selection:[1,R.length,1,R.length]}:{text:`
`+R}}}}})};h.inherits(u,f),v.XmlBehaviour=u}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(r,v,k){var h=r("../../lib/oop"),f=r("../../range").Range,c=r("./fold_mode").FoldMode,g=v.FoldMode=function(i,o){c.call(this),this.voidElements=i||{},this.optionalEndTags=h.mixin({},this.voidElements),o&&h.mixin(this.optionalEndTags,o)};h.inherits(g,c);var u=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};function l(i,o){return i.type.lastIndexOf(o+".xml")>-1}(function(){this.getFoldWidget=function(i,o,t){var e=this._getFirstTagInLine(i,t);return e?e.closing||!e.tagName&&e.selfClosing?o==="markbeginend"?"end":"":!e.tagName||e.selfClosing||this.voidElements.hasOwnProperty(e.tagName.toLowerCase())||this._findEndTagInLine(i,t,e.tagName,e.end.column)?"":"start":this.getCommentFoldWidget(i,t)},this.getCommentFoldWidget=function(i,o){return/comment/.test(i.getState(o))&&/<!-/.test(i.getLine(o))?"start":""},this._getFirstTagInLine=function(i,o){for(var t=i.getTokens(o),e=new u,n=0;n<t.length;n++){var a=t[n];if(l(a,"tag-open")){if(e.end.column=e.start.column+a.value.length,e.closing=l(a,"end-tag-open"),a=t[++n],!a)return null;for(e.tagName=a.value,e.end.column+=a.value.length,n++;n<t.length;n++)if(a=t[n],e.end.column+=a.value.length,l(a,"tag-close")){e.selfClosing=a.value=="/>";break}return e}else if(l(a,"tag-close"))return e.selfClosing=a.value=="/>",e;e.start.column+=a.value.length}return null},this._findEndTagInLine=function(i,o,t,e){for(var n=i.getTokens(o),a=0,s=0;s<n.length;s++){var d=n[s];if(a+=d.value.length,!(a<e)&&l(d,"end-tag-open")&&(d=n[s+1],d&&d.value==t))return!0}return!1},this.getFoldWidgetRange=function(i,o,t){var e=i.getMatchingTags({row:t,column:0});return e?new f(e.openTag.end.row,e.openTag.end.column,e.closeTag.start.row,e.closeTag.start.column):this.getCommentFoldWidget(i,t)&&i.getCommentFoldRange(t,i.getLine(t).length)}}).call(g.prototype)}),ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"],function(r,v,k){var h=r("../lib/oop"),f=r("../lib/lang"),c=r("./text").Mode,g=r("./xml_highlight_rules").XmlHighlightRules,u=r("./behaviour/xml").XmlBehaviour,l=r("./folding/xml").FoldMode,i=r("../worker/worker_client").WorkerClient,o=function(){this.HighlightRules=g,this.$behaviour=new u,this.foldingRules=new l};h.inherits(o,c),function(){this.voidElements=f.arrayToMap([]),this.blockComment={start:"<!--",end:"-->"},this.createWorker=function(t){var e=new i(["ace"],"ace/mode/xml_worker","Worker");return e.attachToDocument(t.getDocument()),e.on("error",function(n){t.setAnnotations(n.data)}),e.on("terminate",function(){t.clearAnnotations()}),e},this.$id="ace/mode/xml"}.call(o.prototype),v.Mode=o}),function(){ace.require(["ace/mode/xml"],function(r){x&&(x.exports=r)})}()})(E);var W={exports:{}};(function(x,m){(function(){ace.require(["ace/mode/text"],function(r){x&&(x.exports=r)})})()})(W);const H={name:"EditorShow",components:{editor:F},props:{value:{type:String,required:!0,default:""},mode:{type:String,required:!0,default:"json"},debugResponse:{type:Boolean,default:!1}},emits:["update:value","debugEditorChange","showDescription"],setup(x){const m=L(x.value);return S(()=>x.value,()=>{m.value=x.value}),{valueText:m}},data(){return{editor:null,editorHeight:200,debugOptions:{readOnly:!1,autoScrollEditorIntoView:!0,displayIndentGuides:!1,fixedWidthGutter:!0},commonOptions:{readOnly:!1}}},methods:{resetEditorHeight(){var x=this;setTimeout(()=>{var m=x.editor.session.getLength();m==1&&(m=15),m<15&&(x.debugResponse?m=30:m=15),m>20&&(x.debugResponse||(m=20));var r=m*16;r>2e3&&(r=2e3),x.editorHeight=r},10)},change(){this.$emit("update:value",this.valueText),this.debugResponse||this.resetEditorHeight()},editorInit(x){var m=this;this.editor=x,this.debugResponse?(this.editor.getSession().setUseWrapMode(!0),this.editor.setOptions(this.debugOptions),this.mode=="text"&&this.editor.getSession().setUseWrapMode(!0)):this.editor.setOptions(this.commonOptions),this.resetEditorHeight(),this.editor.renderer.on("afterRender",function(){var r=m.editor.session.getLength();m.$emit("showDescription",r)})}}},A={key:0},$={key:1};function X(x,m,r,v,k,h){const f=I("editor");return T(),y("div",null,[r.debugResponse?(T(),y("div",A,[C(f,{class:"knife4j-debug-ace-editor",onInput:h.change,options:k.debugOptions,value:v.valueText,"onUpdate:value":m[0]||(m[0]=c=>v.valueText=c),onInit:h.editorInit,lang:r.mode,theme:"eclipse",width:"100%",style:M({height:k.editorHeight+"px"})},null,8,["onInput","options","value","onInit","lang","style"])])):(T(),y("div",$,[C(f,{value:v.valueText,"onUpdate:value":m[1]||(m[1]=c=>v.valueText=c),onInit:h.editorInit,onInput:h.change,lang:r.mode,theme:"eclipse",width:"100%",style:M({height:k.editorHeight+"px"})},null,8,["value","onInit","onInput","lang","style"])]))])}const z=B(H,[["render",X]]);export{z as default};