Language: JavaScript
Label: vulnerable
CWE: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Code:
(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresponse:",S,"\nresult:",l),this.spinner.stop(),e(l,n,z,C))}),B)}),B,mxUtils.bind(this,function(n){3>q++?t.clear()&&(this.spinner.stop(),p()):B(n)}))}),B);else{var A={message:mxResources.get("error")+" "+I.getStatus()};try{A=JSON.parse(I.getText()),A=A.error}catch(S){}B(A)}}),B)}),g)});p()};EditorUi.prototype.extractMermaidMindmap=function(c){for(0<c[1].indexOf("orientation")&&c.splice(1,1);1<c.length&&""==c[1];)c.splice(1,1);