Language: JavaScript
Label: safe
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.prototype.isResampleImageSize=function(d,g){g=null!=g?g:this.resampleThreshold;return d>g};EditorUi.prototype.resizeImage=function(d,g,n,t,u,v,B){u=null!=u?u:this.maxImageSize;var H=Math.max(1,d.width),L=Math.max(1,d.height);if(t&&this.isResampleImageSize(null!=B?B:g.length,v))try{var G=Math.max(H/u,L/u);if(1<G){var T=Math.round(H/G),p=Math.round(L/G),q=document.createElement("canvas");q.width=T;q.height=p;q.getContext("2d").drawImage(d,0,0,T,p);var C=q.toDataURL();if(C.length<g.length){var J=
document.createElement("canvas");J.width=T;J.height=p;var F=J.toDataURL();C!==F&&(g=C,H=T,L=p)}}}catch(O){}n(g,H,L)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,g,n){try{var t=new Image;t.onload=function(){t.width=0<t.width?t.width:120;t.height=0<t.height?t.height:120;g(t)};null!=n&&(t.onerror=n);t.src=d}catch(u){if(null!=n)n(u);else throw u;}};EditorUi.prototype.getDefaultSketchMode=function(){var d="1"==