mcanoglu/cwe-class-group huggingface dataset:
V+";"))}),mxUtils.bind(this,function(u){g.setSelectionCells(this.insertTextAt(V,H,S,!0))})):0<=mxUtils.indexOf(D.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(D.dataTransfer.getData("text/plain"),H,S,!0))}}D.stopPropagation();D.preventDefault()}),!1)}g.enableFlowAnimation=!0;this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var d=this.editor.graph;d.container.addEventListener("paste",
mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g))try{for(var k=g.clipboardData||g.originalEvent.clipboardData,l=!1,p=0;p<k.types.length;p++)if("text/"===k.types[p].substring(0,5)){l=!0;break}if(!l){var q=k.items;for(index in q){var x=q[index];if("file"===x.kind){if(d.isEditing())this.importFiles([x.getAsFile()],0,0,this.maxImageSize,function(A,B,I,O,t,z){d.insertImage(A,t,z)},function(){},function(A){return"image/"==A.type.substring(0,6)},function(A){for(var B=0;B<A.length;B++)A[B]()});else{var y=
this.editor.graph.getInsertPoint();this.importFiles([x.getAsFile()],y.x,y.y,this.maxImageSize);mxEvent.consume(g)}break}}}}catch(A){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function d(){window.setTimeout(function(){k.innerHTML="&nbsp;";k.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck",

// Vulnerability class: CWE-20
DrawioFile.prototype.mergeFile=function(b,f,l,d){var u=!0;try{this.stats.fileMerged++;var t=this.getShadowPages(),D=b.getShadowPages();if(null!=D&&0<D.length){var c=[this.ui.diffPages(null!=d?d:t,D)],e=this.ignorePatches(c);this.setShadowPages(D);if(e)EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",e);else{null!=this.sync&&this.sync.sendLocalChanges();this.backupPatch=this.isModified()?this.ui.diffPages(t,this.ui.pages):null;d={};e={};var g=this.ui.patchPages(t,c[0]),k=this.ui.getHashValueForPages(g,
d),m=this.ui.getHashValueForPages(D,e);EditorUi.debug("File.mergeFile",[this],"file",[b],"shadow",t,"pages",this.ui.pages,"patches",c,"backup",this.backupPatch,"checksum",k,"current",m,"valid",k==m,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified());if(null!=k&&k!=m){var q=this.compressReportData(this.getAnonymizedXmlForPages(D)),v=this.compressReportData(this.getAnonymizedXmlForPages(g)),x=this.ui.hashValue(b.getCurrentEtag()),A=this.ui.hashValue(this.getCurrentEtag());
this.checksumError(l,c,"Shadow Details: "+JSON.stringify(d)+"\nChecksum: "+k+"\nCurrent: "+m+"\nCurrent Details: "+JSON.stringify(e)+"\nFrom: "+x+"\nTo: "+A+"\n\nFile Data:\n"+q+"\nPatched Shadow:\n"+v,null,"mergeFile");return}if(null!=this.sync){var z=this.sync.patchRealtime(c,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null);null==z||mxUtils.isEmptyObject(z)||c.push(z)}this.patch(c,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw u=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=
this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=f&&f()}catch(n){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=l&&l(n);try{if(u)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,n);else{var L=this.getCurrentUser(),M=null!=L?L.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),M,n)}}catch(y){}}};

// Vulnerability class: CWE-20
function _typed(name, signatures) {
      var refs = new Refs();

      // parse signatures, expand them
      var _signatures = parseSignatures(signatures);
      if (_signatures.length == 0) {
        throw new Error('No signatures provided');
      }

      // filter all any type signatures
      var anys = filterAnyTypeSignatures(_signatures);

      // parse signatures into a node tree
      var node = parseTree(_signatures, [], anys);

      //var util = require('util');
      //console.log('ROOT');
      //console.log(util.inspect(node, { depth: null }));

      // generate code for the typed function
      var code = [];
      var _name = name || '';
      var _args = getArgs(maxParams(_signatures));
      code.push('function ' + _name + '(' + _args.join(', ') + ') {');
      code.push('  "use strict";');
      code.push('  var name = \'' + _name + '\';');
      code.push(node.toCode(refs, '  ', false));
      code.push('}');

      // generate body for the factory function
      var body = [
        refs.toCode(),
        'return ' + code.join('\n')
      ].join('\n');

      // evaluate the JavaScript code and attach function references
      var factory = (new Function(refs.name, 'createError', body));
      var fn = factory(refs, createError);

      //console.log('FN\n' + fn.toString()); // TODO: cleanup

      // attach the signatures with sub-functions to the constructed function
      fn.signatures = mapSignatures(_signatures);

      return fn;
    }

// Vulnerability class: CWE-20
('' + property.key.value),
                     computed: false,
                     value: self.recurse(property.value)
          });
        }
      });
      return function(scope, locals, assign, inputs) {
        var value = {};
        for (var i = 0; i < args.length; ++i) {
          if (args[i].computed) {
            value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs);
          } else {
            value[args[i].key] = args[i].value(scope, locals, assign, inputs);
          }
        }
        return context ? {value: value} : value;
      };
    case AST.ThisExpression:
      return function(scope) {
        return context ? {value: scope} : scope;
      };
    case AST.LocalsExpression:
      return function(scope, locals) {
        return context ? {value: locals} : locals;
      };
    case AST.NGValueParameter:
      return function(scope, locals, assign) {
        return context ? {value: assign} : assign;
      };
    }
  },

// Vulnerability class: CWE-74
preload: path.resolve(basePath, './build/preload.js')
        }
    };

    mainWindow = new BrowserWindow(options);
    windowState.manage(mainWindow);
    mainWindow.loadURL(indexURL);

    initPopupsConfigurationMain(mainWindow);
    setupAlwaysOnTopMain(mainWindow);
    setupPowerMonitorMain(mainWindow);
    setupScreenSharingMain(mainWindow, config.default.appName);

    mainWindow.webContents.on('new-window', (event, url, frameName) => {
        const target = getPopupTarget(url, frameName);

        if (!target || target === 'browser') {
            event.preventDefault();
            shell.openExternal(url);
        }
    });
    mainWindow.on('closed', () => {
        mainWindow = null;
    });
    mainWindow.once('ready-to-show', () => {
        mainWindow.show();
    });

    /**
     * This is for windows [win32]
     * so when someone tries to enter something like jitsi-meet://test
     *  while app is closed
     * it will trigger this event below
     */
    if (process.platform === 'win32') {
        handleProtocolCall(process.argv.pop());
    }
}

// Vulnerability class: CWE-345
c.style.width="300px";c.style.display="inline-flex";c.style.justifyContent="center";c.style.alignItems="center";c.style.position="absolute";var e=document.createElement("img");e.onload=function(){function B(){k.model.setStyle(v,x+u())}k=new Graph(g);k.autoExtend=!1;k.autoScroll=!1;k.setGridEnabled(!1);k.setEnabled(!0);k.setPanning(!1);k.setConnectable(!1);k.getRubberband().setEnabled(!1);k.graphHandler.allowLivePreview=!1;var F=k.createVertexHandler;k.createVertexHandler=function(){var I=F.apply(this,
arguments);I.livePreview=!1;return I};if(null!=l)try{if("inset"==l.substring(0,5)){var G=v.geometry,N=e.width,J=e.height,E=(300-N)/2,H=(300-J)/2,S=l.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),U=parseFloat(S[0]),Q=parseFloat(S[1]),W=parseFloat(S[2]),V=parseFloat(S[3]);isFinite(U)&&isFinite(Q)&&isFinite(W)&&isFinite(V)?(G.x=V/100*N+E,G.y=U/100*J+H,G.width=(100-Q)/100*N+E-G.x,G.height=(100-W)/100*J+H-G.y,"round"==S[4]?"50%"==S[5]?L.setAttribute("checked","checked"):(q=parseInt(S[5]),n.value=q,z.setAttribute("checked",

// Vulnerability class: CWE-20
function(aa){T--;N()}),!0,null,"data:"+Z+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(J[u].substring(0,Q)),R)}N()}else E(u)};Editor.prototype.loadFonts=function(u){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(E){this.resolvedFontCss=E;null!=u&&u()})):null!=u&&u()};Editor.prototype.createGoogleFontCache=function(){var u={},E;for(E in Graph.fontMapping)Graph.isCssFontUrl(E)&&(u[E]=Graph.fontMapping[E]);return u};Editor.prototype.embedExtFonts=

// Vulnerability class: CWE-20
addExtension({ zipFile }) {
    checkAuthentication(this)
    const regex = /^data:.+\/(.+);base64,(.*)$/
    const matches = zipFile.match(regex)
    const data = matches[2]
    let zip
    if (data) {
      zip = new AdmZip(Buffer.from(data, 'base64'))
    } else {
      return new Meteor.Error('Invalid extension upload.')
    }
    const newExtension = {}
    for (const zipEntry of zip.getEntries()) {
      if (zipEntry.entryName === 'extension.json') {
        const extensionDetails = JSON.parse(zipEntry.getData().toString('utf-8'))
        extensionDetails.userId = this.userId
        extensionDetails.isActive = true
        Object.assign(newExtension, extensionDetails)
      }
      if (zipEntry.entryName === 'client.js') {
        newExtension.client = zipEntry.getData().toString('utf-8')
      }
      if (zipEntry.entryName === 'server.js') {
        newExtension.server = zipEntry.getData().toString('utf-8')
      }
    }
    if (!Extensions.findOne({ name: newExtension.name })) {
      Extensions.insert(newExtension)
      return 'notifications.success'
    }
    return new Meteor.Error('Extension has been added before.')
  },

// Vulnerability class: CWE-285
if(0<x.length){var A=parseFloat(x[0].getAttribute("width")),z=parseFloat(x[0].getAttribute("height"));if(isNaN(A)||isNaN(z))try{var L=x[0].getAttribute("viewBox").split(/\s+/);A=parseFloat(L[2]);z=parseFloat(L[3])}catch(M){A=A||100,z=z||100}g(m.convertDataUri(Editor.createSvgDataUri(v)),A,z)}else k({message:mxResources.get("invalidInput")})}catch(M){k(M)}})}catch(v){k(v)}};"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?q():(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",

// Vulnerability class: CWE-20
const get = async (req, res) => {
  logger.debug('URL file import handler running', null, req.id)
  const { debug } = req.companion.options
  if (!validateURL(req.body.url, debug)) {
    logger.debug('Invalid request body detected. Exiting url import handler.', null, req.id)
    res.status(400).json({ error: 'Invalid request body' })
    return
  }

  async function getSize () {
    const { size } = await getURLMeta(req.body.url, !debug)
    return size
  }

  async function download () {
    return downloadURL(req.body.url, !debug, req.id)
  }

  function onUnhandledError (err) {
    logger.error(err, 'controller.url.error', req.id)
    // @todo send more meaningful error message and status code to client if possible
    res.status(err.status || 500).json({ message: 'failed to fetch URL metadata' })
  }

  startDownUpload({ req, res, getSize, download, onUnhandledError })
}

// Vulnerability class: CWE-863
(z=2);return z};var I=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return I.apply(this,arguments).grow(-this.getSelectionBorderInset())};var V=null,Q=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==V&&(V=mxCellRenderer.defaultShapes.tableLine);var z=Q.apply(this,arguments);if(this.graph.isTable(this.state.cell)){var L=function(Ta,za,wa){for(var Ea=[],Da=0;Da<Ta.length;Da++){var La=

// Vulnerability class: CWE-20
0==T?ba():R()}else this.stoppingCustomActions=this.executingCustomActions=!1,R(),null!=E&&E()});ba()}};Graph.prototype.doUpdateCustomLinksForCell=function(u,E){var J=this.getLinkForCell(E);null!=J&&"data:action/json,"==J.substring(0,17)&&this.setLinkForCell(E,this.updateCustomLink(u,J));if(this.isHtmlLabel(E)){var T=document.createElement("div");T.innerHTML=this.sanitizeHtml(this.getLabel(E));for(var N=T.getElementsByTagName("a"),Q=!1,R=0;R<N.length;R++)J=N[R].getAttribute("href"),null!=J&&"data:action/json,"==
J.substring(0,17)&&(N[R].setAttribute("href",this.updateCustomLink(u,J)),Q=!0);Q&&this.labelChanged(E,T.innerHTML)}};Graph.prototype.updateCustomLink=function(u,E){if("data:action/json,"==E.substring(0,17))try{var J=JSON.parse(E.substring(17));null!=J.actions&&(this.updateCustomLinkActions(u,J.actions),E="data:action/json,"+JSON.stringify(J))}catch(T){}return E};Graph.prototype.updateCustomLinkActions=function(u,E){for(var J=0;J<E.length;J++){var T=E[J],N;for(N in T)this.updateCustomLinkAction(u,

// Vulnerability class: CWE-20
this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1),null!=this.menus.findReplaceWindow&&this.menus.findReplaceWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(e,g,k,m){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));
if(null==e||0==e.length)e=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,e,{}));this.mode=App.MODE_EMBED;this.setFileData(e);if(m)try{var q=this.editor.graph;q.setGridEnabled(!1);q.pageVisible=!1;var v=q.model.cells,x;for(x in v){var A=v[x];null!=A&&null!=A.style&&(A.style+=";sketch=1;"+(-1==A.style.indexOf("fontFamily=")||-1<A.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":
""))}}catch(z){console.log(z)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=k?k:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?

// Vulnerability class: CWE-20
"geTempDlgCreateBtn geTempDlgBtnDisabled")}function z(ha,da){if(null!=J){var ca=function(pa){qa.isExternal?g(qa,function(na){la(na,pa)},ia):qa.url?mxUtils.get(TEMPLATE_PATH+"/"+qa.url,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?la(na.getText(),pa):ia()})):la(b.emptyDiagramXml,pa)},la=function(pa,na){y||b.hideDialog(!0);e(pa,na,qa,da)},ia=function(){A(mxResources.get("cannotLoad"));ma()},ma=function(){J=qa;za.className="geTempDlgCreateBtn";da&&(Ga.className="geTempDlgOpenBtn")},
qa=J;J=null;"boolean"!==typeof da&&(da=qa.isExternal&&p);1==ha?k(qa.url,qa):da?(Ga.className="geTempDlgOpenBtn geTempDlgBtnDisabled geTempDlgBtnBusy",ca()):(za.className="geTempDlgCreateBtn geTempDlgBtnDisabled geTempDlgBtnBusy",ha=null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"),ha=new FilenameDialog(b,b.defaultFilename+".drawio",mxResources.get("ok"),ca,ha,function(pa){var na=null!=pa&&0<pa.length;return na&&y?(ca(pa),!1):
na},null,null,null,ma,x?null:[]),b.showDialog(ha.container,350,80,!0,!0),ha.init())}}function L(ha){za.innerHTML=mxUtils.htmlEntities(mxResources.get(Z||ha?"create":"copy"));ha=ha?"none":"";p&&(Ga.style.display=ha);for(var da=M.querySelectorAll(".geTempDlgLinkToDiagram"),ca=0;ca<da.length;ca++)da[ca].style.display=ha}function C(ha,da,ca,la,ia){ia||(aa.innerHTML="",t(),R=ha,Y=la);var ma=null;if(ca){ma=document.createElement("table");ma.className="geTempDlgDiagramsListGrid";var qa=document.createElement("tr"),

// Vulnerability class: CWE-20
action:"size_"+file.size})}catch(m){}};EditorUi.prototype.isResampleImageSize=function(c,e){e=null!=e?e:this.resampleThreshold;return c>e};EditorUi.prototype.resizeImage=function(c,e,g,k,m,q,v){m=null!=m?m:this.maxImageSize;var x=Math.max(1,c.width),A=Math.max(1,c.height);if(k&&this.isResampleImageSize(null!=v?v:e.length,q))try{var z=Math.max(x/m,A/m);if(1<z){var L=Math.round(x/z),M=Math.round(A/z),n=document.createElement("canvas");n.width=L;n.height=M;n.getContext("2d").drawImage(c,0,0,L,M);var y=
n.toDataURL();if(y.length<e.length){var K=document.createElement("canvas");K.width=L;K.height=M;var B=K.toDataURL();y!==B&&(e=y,x=L,A=M)}}}catch(F){}g(e,x,A)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,e,g){try{var k=new Image;k.onload=function(){k.width=0<k.width?k.width:120;k.height=0<k.height?k.height:120;e(k)};null!=g&&(k.onerror=g);k.src=c}catch(m){if(null!=g)g(m);else throw m;}};EditorUi.prototype.getDefaultSketchMode=

// Vulnerability class: CWE-20
mxUtils.convertPoint(m.container,mxEvent.getClientX(E),mxEvent.getClientY(E));mxEvent.consume(E);E=m.view.scale;var S=m.view.translate;m.setSelectionCell(t((H.x-3*E)/E-S.x,(H.y-3*E)/E-S.y))}};u=new mxKeyHandler(m);u.bindKey(46,D);u.bindKey(8,D);m.getRubberband().isForceRubberbandEvent=function(E){return 0==E.evt.button&&(null==E.getCell()||E.getCell()==q)};m.panningHandler.isForcePanningEvent=function(E){return 2==E.evt.button};var v=m.isCellSelectable;m.isCellSelectable=function(E){return E==q?!1:
v.apply(this,arguments)};m.getLinkForCell=function(){return null};var x=m.view.getState(q);k=m.getAllConnectionConstraints(x);for(var A=0;null!=k&&A<k.length;A++){var z=m.getConnectionPoint(x,k[A]);t(z.x-3,z.y-3)}m.fit(8);m.center();A=mxUtils.button("",function(){m.zoomIn()});A.className="geSprite geSprite-zoomin";A.setAttribute("title",mxResources.get("zoomIn"));A.style.position="relative";A.style.outline="none";A.style.border="none";A.style.margin="2px";A.style.cursor="pointer";A.style.top=mxClient.IS_FF?

// Vulnerability class: CWE-20
v=q.getChildren(q.root);for(k=0;k<v.length;k++){var x=v[k];q.setVisible(x,e[x.id]||!1)}}catch(A){}};EditorUi.prototype.getBaseFilename=function(c){var e=this.getCurrentFile();e=null!=e&&null!=e.getTitle()?e.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(e)||/(\.html)$/i.test(e)||/(\.svg)$/i.test(e)||/(\.png)$/i.test(e))e=e.substring(0,e.lastIndexOf("."));/(\.drawio)$/i.test(e)&&(e=e.substring(0,e.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&
0<this.currentPage.getName().length&&(e=e+"-"+this.currentPage.getName());return e};EditorUi.prototype.downloadFile=function(c,e,g,k,m,q,v,x,A,z,L,M){try{k=null!=k?k:this.editor.graph.isSelectionEmpty();var n=this.getBaseFilename("remoteSvg"==c?!1:!m),y=n+("xml"==c||"pdf"==c&&L?".drawio":"")+"."+c;if("xml"==c){var K=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,k,m,null,null,null,e);this.saveData(y,c,K,"text/xml")}else if("html"==c)K=this.getHtml2(this.getFileData(!0),this.editor.graph,

// Vulnerability class: CWE-20
"url("+mxWindow.prototype.normalizeImage+")";aa.style.backgroundPosition="top center";aa.style.backgroundRepeat="no-repeat";aa.setAttribute("title","Minimize");var va=!1,ja=mxUtils.bind(this,function(){N.innerHTML="";if(!va){var da=function(ia,ma,qa){ia=D("",ia.funct,null,ma,ia,qa);ia.style.width="40px";ia.style.opacity="0.7";return ca(ia,null,"pointer")},ca=function(ia,ma,qa){null!=ma&&ia.setAttribute("title",ma);ia.style.cursor=null!=qa?qa:"default";ia.style.margin="2px 0px";N.appendChild(ia);mxUtils.br(N);
return ia};ca(F.sidebar.createVertexTemplate("text;strokeColor=none;fillColor=none;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;",60,30,"Text",mxResources.get("text"),!0,!1,null,!0,!0),mxResources.get("text")+" ("+Editor.ctrlKey+"+Shift+X)");ca(F.sidebar.createVertexTemplate("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",

// Vulnerability class: CWE-20
Math.min(Y,Math.max(parseInt(aa.value),parseInt(fa.value))));fa.value=Math.max(1,Math.min(Y,Math.min(parseInt(aa.value),parseInt(fa.value))))}function T(ya){function wa(Ja,Oa,Pa){var Qa=Ja.useCssTransforms,Ya=Ja.currentTranslate,Ma=Ja.currentScale,Ta=Ja.view.translate,Ua=Ja.view.scale;Ja.useCssTransforms&&(Ja.useCssTransforms=!1,Ja.currentTranslate=new mxPoint(0,0),Ja.currentScale=1,Ja.view.translate=new mxPoint(0,0),Ja.view.scale=1);var Za=Ja.getGraphBounds(),Wa=0,bb=0,Va=oa.get(),ab=1/Ja.pageScale,
$a=ra.checked;if($a){ab=parseInt(ta.value);var hb=parseInt(ka.value);ab=Math.min(Va.height*hb/(Za.height/Ja.view.scale),Va.width*ab/(Za.width/Ja.view.scale))}else ab=parseInt(Ha.value)/(100*Ja.pageScale),isNaN(ab)&&(ua=1/Ja.pageScale,Ha.value="100 %");Va=mxRectangle.fromRectangle(Va);Va.width=Math.ceil(Va.width*ua);Va.height=Math.ceil(Va.height*ua);ab*=ua;!$a&&Ja.pageVisible?(Za=Ja.getPageLayout(),Wa-=Za.x*Va.width,bb-=Za.y*Va.height):$a=!0;if(null==Oa){Oa=PrintDialog.createPrintPreview(Ja,ab,Va,

// Vulnerability class: CWE-20
["exportPdf"],z):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(t,["exportPdf"],z);mxClient.IS_IE||"undefined"===typeof VsdxExport&&c.isOffline()||this.addMenuItems(t,["exportVsdx"],z);this.addMenuItems(t,["-","exportHtml","exportXml","exportUrl"],z);c.isOffline()||(t.addSeparator(z),this.addMenuItem(t,"export",z).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(t,z){function L(G){G.pickFile(function(P){c.spinner.spin(document.body,
mxResources.get("loading"))&&G.getFile(P,function(K){var F="data:image/"==K.getData().substring(0,11)?D(K.getTitle()):"text/xml";/\.svg$/i.test(K.getTitle())&&!c.editor.isDataSvg(K.getData())&&(K.setData(Editor.createSvgDataUri(K.getData())),F="image/svg+xml");C(K.getData(),F,K.getTitle())},function(K){c.handleError(K,null!=K?mxResources.get("errorLoadingFile"):null)},G==c.drive)},!0)}var C=mxUtils.bind(this,function(G,P,K){var F=m.view,H=m.getGraphBounds(),S=m.snap(Math.ceil(Math.max(0,H.x/F.scale-

// Vulnerability class: CWE-20
--S){this.spinner.stop();if(null!=x)x(U);else{var p=[];J.getModel().beginUpdate();try{for(V=0;V<U.length;V++){var C=U[V]();null!=C&&(p=p.concat(C))}}finally{J.getModel().endUpdate()}}q(p)}}),W=0;W<H;W++)mxUtils.bind(this,function(V){var X=c[V];if(null!=X){var p=new FileReader;p.onload=mxUtils.bind(this,function(C){if(null==v||v(X))if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var I=Graph.clipSvgDataUri(C.target.result),T=I.indexOf(",");T=decodeURIComponent(escape(atob(I.substring(T+

// Vulnerability class: CWE-20
"default")},ma.addListener("stateChanged",ca),H.addListener("enabledChanged",ca),ca());return oa}function G(ca,ba,ja){ja=document.createElement("div");ja.className="geMenuItem";ja.style.display="inline-block";ja.style.verticalAlign="top";ja.style.marginRight="6px";ja.style.padding="0 4px 0 4px";ja.style.height="30px";ja.style.position="relative";ja.style.top="0px";"1"==urlParams.sketch&&(ja.style.boxShadow="none");for(var ia=0;ia<ca.length;ia++)null!=ca[ia]&&("1"==urlParams.sketch&&(ca[ia].style.padding=
"10px 8px",ca[ia].style.width="30px"),ca[ia].style.margin="0px",ca[ia].style.boxShadow="none",ja.appendChild(ca[ia]));null!=ba&&mxUtils.setOpacity(ja,ba);null!=E.statusContainer&&"1"!=urlParams.sketch?S.insertBefore(ja,E.statusContainer):S.appendChild(ja);return ja}function N(){if("1"==urlParams.sketch)"1"!=urlParams.embedInline&&(O.style.left=58>P.offsetTop-P.offsetHeight/2?"70px":"10px");else{for(var ca=S.firstChild;null!=ca;){var ba=ca.nextSibling;"geMenuItem"!=ca.className&&"geItem"!=ca.className||

// Vulnerability class: CWE-20
TagCreationContainer.prototype._resizeTag = function(textfield) {
    var that = this;    

    x2.DEBUG && console.log ('_resizeTag');
    $(textfield).each(function() {
        that.textsize.html(encodeURIComponent($(this).val()));
        x2.DEBUG && console.log ('that.textsize.width = ' + that.textsize.width ());
        $(this).css('width', (that.textsize.width() + 10) + 'px');
    });

    return $(textfield);
};

// Vulnerability class: CWE-20
"&from="+q;break}q=y.background;"png"!=e&&"pdf"!=e&&"svg"!=e||!m?m||null!=q&&q!=mxConstants.NONE||(q="#ffffff"):q=mxConstants.NONE;m={globalVars:y.getExportVariables()};A&&(m.grid={size:y.gridSize,steps:y.view.gridSteps,color:y.view.gridColor});Graph.translateDiagram&&(m.diagramLanguage=Graph.diagramLanguage);return new mxXmlRequest(EXPORT_URL,"format="+e+B+F+"&bg="+(null!=q?q:mxConstants.NONE)+"&base64="+k+"&embedXml="+z+"&xml="+encodeURIComponent(g)+(null!=c?"&filename="+encodeURIComponent(c):"")+
"&extras="+encodeURIComponent(JSON.stringify(m))+(null!=v?"&scale="+v:"")+(null!=x?"&border="+x:"")+(M&&isFinite(M)?"&w="+M:"")+(n&&isFinite(n)?"&h="+n:""))};EditorUi.prototype.setMode=function(c,e){this.mode=c};EditorUi.prototype.loadDescriptor=function(c,e,g){var k=window.location.hash,m=mxUtils.bind(this,function(q){var v=null!=c.data?c.data:"";null!=q&&0<q.length&&(0<v.length&&(v+="\n"),v+=q);q=new LocalFile(this,"csv"!=c.format&&0<v.length?v:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):

// Vulnerability class: CWE-20
(ua.appendChild(Z),ua.appendChild(ea),da.appendChild(ua));return{div:da,refresh:aa}};Graph.prototype.getCustomFonts=function(){var p=this.extFonts;p=null!=p?p.slice():[];for(var C in Graph.customFontElements){var I=Graph.customFontElements[C];p.push({name:I.name,url:I.url})}return p};Graph.prototype.setFont=function(p,C){Graph.addFont(p,C);document.execCommand("fontname",!1,p);if(null!=C){var I=this.cellEditor.textarea.getElementsByTagName("font");C=Graph.getFontUrl(p,C);for(var T=0;T<I.length;T++)I[T].getAttribute("face")==
p&&I[T].getAttribute("data-font-src")!=C&&I[T].setAttribute("data-font-src",C)}};var n=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return n.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var p=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=p)for(var C in p)this.globalVars[C]=

// Vulnerability class: CWE-20
Array.prototype.push.apply(N.shape.customProperties,Editor.commonEdgeProperties)),T(N.shape.customProperties));u=u.getAttribute("customProperties");if(null!=u)try{T(JSON.parse(u))}catch(Q){}}};var x=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var u=this.editorUi.getSelectionState();"image"!=u.style.shape&&!u.containsLabel&&0<u.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));x.apply(this,arguments);if(Editor.enableCustomProperties){for(var E=
{},J=u.vertices,T=u.edges,N=0;N<J.length;N++)this.findCommonProperties(J[N],E,0==N);for(N=0;N<T.length;N++)this.findCommonProperties(T[N],E,0==J.length&&0==N);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(E).length&&this.container.appendChild(this.addProperties(this.createPanel(),E,u))}};var y=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(u){this.addActions(u,["copyStyle","pasteStyle"]);return y.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=

// Vulnerability class: CWE-20
S==mxConstants.DIRECTION_WEST?-1:1,0<=H&&H<=Q.length-1&&x.setSelectionCell(Q[H].cell)))))}var v=this,x=v.editor.graph,A=x.getModel(),z=v.menus.createPopupMenu;v.menus.createPopupMenu=function(H,S,U){z.apply(this,arguments);if(1==x.getSelectionCount()){S=x.getSelectionCell();var Q=x.getOutgoingTreeEdges(S);H.addSeparator();0<Q.length&&(d(x.getSelectionCell())&&this.addMenuItems(H,["selectChildren"],null,U),this.addMenuItems(H,["selectDescendants"],null,U));d(x.getSelectionCell())?(H.addSeparator(),
0<x.getIncomingTreeEdges(S).length&&this.addMenuItems(H,["selectSiblings","selectParent"],null,U)):0<x.model.getEdgeCount(S)&&this.addMenuItems(H,["selectConnections"],null,U)}};v.actions.addAction("selectChildren",function(){if(x.isEnabled()&&1==x.getSelectionCount()){var H=x.getSelectionCell();H=x.getOutgoingTreeEdges(H);if(null!=H){for(var S=[],U=0;U<H.length;U++)S.push(x.model.getTerminal(H[U],!1));x.setSelectionCells(S)}}},null,null,"Alt+Shift+X");v.actions.addAction("selectSiblings",function(){if(x.isEnabled()&&

// Vulnerability class: CWE-20
Y+");\n");N()}))):J.push(this.cachedGoogleFonts[Y]+"\n"):J.push('@font-face {font-family: "'+R+'";src: url("'+Y+'")}\n')})(E[Q].name,E[Q].url);N()}else u()};Editor.prototype.addMathCss=function(u){u=u.getElementsByTagName("defs");if(null!=u&&0<u.length)for(var E=document.getElementsByTagName("style"),J=0;J<E.length;J++){var T=mxUtils.getTextContent(E[J]);0>T.indexOf("mxPageSelector")&&0<T.indexOf("MathJax")&&u[0].appendChild(E[J].cloneNode(!0))}};Editor.prototype.addFontCss=function(u,E){E=null!=
E?E:this.absoluteCssFonts(this.fontCss);if(null!=E){var J=u.getElementsByTagName("defs"),T=u.ownerDocument;0==J.length?(J=null!=T.createElementNS?T.createElementNS(mxConstants.NS_SVG,"defs"):T.createElement("defs"),null!=u.firstChild?u.insertBefore(J,u.firstChild):u.appendChild(J)):J=J[0];u=null!=T.createElementNS?T.createElementNS(mxConstants.NS_SVG,"style"):T.createElement("style");u.setAttribute("type","text/css");mxUtils.setTextContent(u,E);J.appendChild(u)}};Editor.prototype.isExportToCanvas=

// Vulnerability class: CWE-20
DotObject.prototype._fill = function (a, obj, v, mod) {
  var k = a.shift()

  if (a.length > 0) {
    obj[k] = obj[k] ||
      (this.useArray && isIndex(a[0]) ? [] : {})

    if (!isArrayOrObject(obj[k])) {
      if (this.override) {
        obj[k] = {}
      } else {
        if (!(isArrayOrObject(v) && isEmptyObject(v))) {
          throw new Error(
            'Trying to redefine `' + k + '` which is a ' + typeof obj[k]
          )
        }

        return
      }
    }

    this._fill(a, obj[k], v, mod)
  } else {
    if (!this.override &&
      isArrayOrObject(obj[k]) && !isEmptyObject(obj[k])) {
      if (!(isArrayOrObject(v) && isEmptyObject(v))) {
        throw new Error("Trying to redefine non-empty obj['" + k + "']")
      }

      return
    }

    obj[k] = _process(v, mod)
  }
}

// Vulnerability class: CWE-74
null,this.container)}));q.appendChild(m);m.className="geBtn gePrimaryBtn";b.editor.cancelFirst||q.appendChild(g);if(null!=l)for(d=0;d<l.length;d++)(function(x,y,A){x=mxUtils.button(x,function(B){y(B)});null!=A&&x.setAttribute("title",A);x.className="geBtn";q.appendChild(x)})(l[d][0],l[d][1],l[d][2]);p.appendChild(q);this.cancelBtn=g;this.okButton=m;this.container=p},TemplatesDialog=function(b,e,f,c,m,n,v,d,g,k,l,p,q,x,y){function A(ha){Fa.innerHTML=mxUtils.htmlEntities(ha);Fa.style.display="block";
setTimeout(function(){Fa.style.display="none"},4E3)}function B(){null!=X&&(X.style.fontWeight="normal",X.style.textDecoration="none",u=X,X=null)}function I(ha,da,ca,la,ia,ma,qa){if(-1<ha.className.indexOf("geTempDlgRadioBtnActive"))return!1;ha.className+=" geTempDlgRadioBtnActive";M.querySelector(".geTempDlgRadioBtn[data-id="+la+"]").className="geTempDlgRadioBtn "+(qa?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");M.querySelector("."+da).src="/images/"+ca+"-sel.svg";M.querySelector("."+ia).src=

// Vulnerability class: CWE-20
n.toDataURL();if(y.length<e.length){var K=document.createElement("canvas");K.width=L;K.height=M;var B=K.toDataURL();y!==B&&(e=y,x=L,A=M)}}}catch(F){}g(e,x,A)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,e,g){try{var k=new Image;k.onload=function(){k.width=0<k.width?k.width:120;k.height=0<k.height?k.height:120;e(k)};null!=g&&(k.onerror=g);k.src=c}catch(m){if(null!=g)g(m);else throw m;}};EditorUi.prototype.getDefaultSketchMode=

// Vulnerability class: CWE-20
for(ja=ma=0;ja<oa.length;ja++)if(0<oa[ja].length){na=ca[oa[ja]];var Ga={};Ja=[];if(null!=na)for(qa=0;qa<na.length;qa++)ia=na[qa],0==ma==(null==ba[ia.url])&&(Ga[ia.url]=!0,Ja.push(ia));ba=Ga;ma++}0==Ja.length?ua.innerHTML=mxResources.get("noResultsFor",[fa]):B(Ja,!0)}}function H(fa){if(da!=fa||P!=ha)z(),Aa.scrollTop=0,aa.innerHTML="",ua.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults"))+' "'+mxUtils.htmlEntities(fa)+'"',wa=null,Z?E(fa):c&&(fa?(Ea.spin(aa),V=!1,W=!0,c(fa,ra,function(){A(mxResources.get("searchFailed"));
ra([])},P?null:t)):J(P)),da=fa,ha=P}function S(fa){null!=wa&&clearTimeout(wa);13==fa.keyCode?H(Oa.value):wa=setTimeout(function(){H(Oa.value)},1E3)}var U='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" '+(c?"":'style="display: none"')+' placeholder="'+mxResources.get("search")+'"></div><div class="geTemplatesList" style="display: none"><div class="geTempDlgBack">&lt; '+mxResources.get("back")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+

// Vulnerability class: CWE-20
this.getInsertPoint=function(){return null!=E?this.getPointForEvent(E):J.apply(this,arguments)};var T=this.layoutManager.getLayout;this.layoutManager.getLayout=function(N){var Q=this.graph.getCellStyle(N);if(null!=Q&&"rack"==Q.childLayout){var R=new mxStackLayout(this.graph,!1);R.gridSize=null!=Q.rackUnitSize?parseFloat(Q.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;R.marginLeft=Q.marginLeft||0;R.marginRight=Q.marginRight||0;R.marginTop=Q.marginTop||0;R.marginBottom=

// Vulnerability class: CWE-20
function printDirect(parameters){
	var data = parameters
		, printer
		, docname
		, type
		, success
		, error;
	
	if(arguments.length==1){
		//TODO: check parameters type
		//if (typeof parameters )
		data = parameters.data;
		printer = parameters.printer;
		docname = parameters.docname;
		type = parameters.type;
		success = parameters.success;
		error = parameters.error;
	}else{
		printer = arguments[1];
		type = arguments[2];
		docname = arguments[3];
		success = arguments[4];
		error = arguments[5];
	}
	
	if(!success){
		success = function(){};
	}
	
	if(!error){
		error = function(err){
			throw err;
		};
	}
	
	if(!type){
		type = "RAW";
	}
	
	if(!docname){
		docname = "node print job";
	}
	
	//TODO: check parameters type
	if(process.platform=="win32"){// call C++ binding
		if(!printer_helper.printDirect){
			error("Not supported, try to compile this package with MSC");
			return;
		}
		try{
			var res = printer_helper.printDirect(data, printer, docname, type, success, error);
			if(res===true){
				success();
			}else{
				error(Error("Something wrong"));
			}
		}catch (e){
			error(e);
		}
    }else if (!printer_helper.printDirect){// should be POSIX
        var temp_file_name = path.join(os.tmpDir(),"printing");
        fs.writeFileSync(temp_file_name, data);
        child_process.exec('lpr -P'+printer+' -oraw -r'+' '+temp_file_name, function(err, stdout, stderr){
            if (err !== null) {
                error('ERROR: ' + err);
                return;
            }
            if (stderr) {
                error('STD ERROR: ' + stderr);
                return;
            }
            success();
        });
    }else{
		error("Not supported");
	}
}

// Vulnerability class: CWE-77
Editor.createRoughCanvas=function(u){var E=rough.canvas({getContext:function(){return u}});E.draw=function(J){var T=J.sets||[];J=J.options||this.getDefaultOptions();for(var N=0;N<T.length;N++){var Q=T[N];switch(Q.type){case "path":null!=J.stroke&&this._drawToContext(u,Q,J);break;case "fillPath":this._drawToContext(u,Q,J);break;case "fillSketch":this.fillSketch(u,Q,J)}}};E.fillSketch=function(J,T,N){var Q=u.state.strokeColor,R=u.state.strokeWidth,Y=u.state.strokeAlpha,ba=u.state.dashed,ea=N.fillWeight;
0>ea&&(ea=N.strokeWidth/2);u.setStrokeAlpha(u.state.fillAlpha);u.setStrokeColor(N.fill||"");u.setStrokeWidth(ea);u.setDashed(!1);this._drawToContext(J,T,N);u.setDashed(ba);u.setStrokeWidth(R);u.setStrokeColor(Q);u.setStrokeAlpha(Y)};E._drawToContext=function(J,T,N){J.begin();for(var Q=0;Q<T.ops.length;Q++){var R=T.ops[Q],Y=R.data;switch(R.op){case "move":J.moveTo(Y[0],Y[1]);break;case "bcurveTo":J.curveTo(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]);break;case "lineTo":J.lineTo(Y[0],Y[1])}}J.end();"fillPath"===

// Vulnerability class: CWE-20
value: function __cast(field) {
      var isColumns = Array.isArray(this.options.columns); // Dont loose time calling cast if the field wont be part of the final record

      if (isColumns === true && this.options.columns.length <= this.state.record.length) {
        return [undefined, undefined];
      }

      var context = {
        column: isColumns === true ? this.options.columns[this.state.record.length].name : this.state.record.length,
        empty_lines: this.info.empty_lines,
        header: this.options.columns === true,
        index: this.state.record.length,
        invalid_field_length: this.info.invalid_field_length,
        quoting: this.state.wasQuoting,
        lines: this.info.lines,
        records: this.info.records
      };

      if (this.state.castField !== null) {
        try {
          return [undefined, this.state.castField.call(null, field, context)];
        } catch (err) {
          return [err];
        }
      }

      if (this.__isInt(field) === true) {
        return [undefined, parseInt(field)];
      } else if (this.__isFloat(field)) {
        return [undefined, parseFloat(field)];
      } else if (this.options.cast_date !== false) {
        return [undefined, this.options.cast_date.call(null, field, context)];
      }

      return [undefined, field];
    }

// Vulnerability class: CWE-400
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(B&&b.hideDialog(),O=!y.model.contains(A),!B||O||I!=q){I=Graph.compress(I);y.getModel().beginUpdate();try{if(O){var t=b.editor.graph.getFreeInsertPoint();A.geometry.x=t.x;A.geometry.y=t.y;y.addCell(A)}y.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+I+")",[A])}catch(z){throw z;}finally{y.getModel().endUpdate()}O&&(y.setSelectionCell(A),y.scrollCellToVisible(A))}};f=mxUtils.button(mxResources.get("preview"),function(){x(l,
p,!1)});f.className="geBtn";g.appendChild(f);f=mxUtils.button(mxResources.get("apply"),function(){x(b.editor.graph,e,!0)});f.className="geBtn gePrimaryBtn";g.appendChild(f);b.editor.cancelFirst||g.appendChild(m);d.appendChild(g);v.appendChild(d);n.appendChild(v);this.container=n},CustomDialog=function(b,e,f,c,m,n,v,d,g,k,l){var p=document.createElement("div");p.appendChild(e);var q=document.createElement("div");q.style.marginTop="30px";q.style.textAlign="center";null!=v&&q.appendChild(v);b.isOffline()||

// Vulnerability class: CWE-20
d.addHours=function(a,c){return d.addMinutes(a,60*c)};d.addMinutes=function(a,c){return d.addSeconds(a,60*c)};d.addSeconds=function(a,c){return d.addMilliseconds(a,1E3*c)};d.addMilliseconds=function(a,c){return new Date(a.getTime()+c)};d.subtract=function(a,c){var b=a.getTime()-c.getTime();return{toMilliseconds:function(){return b},toSeconds:function(){return b/1E3},toMinutes:function(){return b/6E4},toHours:function(){return b/36E5},toDays:function(){return b/864E5}}};d.isLeapYear=function(a){return!(a%
4)&&!!(a%100)||!(a%400)};d.isSameDay=function(a,c){return a.toDateString()===c.toDateString()};d.locale=function(a,c){c?u(a,{res:v,formatter:w,parser:x},c):"function"===typeof a?m=a(d):a&&(q&&!q.date&&console.warn("This method of changing the locale is deprecated. See documentation for details."),m=a);return m};d.extend=function(a){var c=a.extender||{},b;for(b in c)d[b]||(d[b]=c[b]);(a.formatter||a.parser||a.res)&&u(m,t[m],a)};d.plugin=function(a,c){"function"===typeof a?d.extend(r[a(d)]):(r[a]=r[a]||

// Vulnerability class: CWE-400
export default function URLJS(url, baseURL, parseQuery) {
    if (url != undefined) {
        let _url = parseUrl.call(URLJS, url, undefined, parseQuery);
        if (_url !== false) return _url;
        if (baseURL) {
            _url = baseURL instanceof URLJS ? baseURL : parseUrl.call(URLJS, baseURL);
            if (_url === false) return;
            url = String(url);
            if (url.slice(0, 2) == '//') {
                return parseUrl.call(URLJS, _url.protocol + url, undefined, parseQuery);
            }
            let _path;
            if (url.slice(0, 1) == '/') {
                _path = url;
            }
            else {
                _path = _url.pathname.split('/');
                _path[_path.length - 1] = url;
                _path = _path.join('/');
            }
            return parseUrl.call(URLJS, _url.origin + _path, undefined, parseQuery);
        }
        throw new SyntaxError(`Failed to construct 'URL': Invalid URL`);
    }
}

// Vulnerability class: CWE-20
mxEvent.consume(H))}}catch(Q){v.handleError(Q)}mxEvent.isConsumed(H)||B.apply(this,arguments)};var F=x.connectVertex;x.connectVertex=function(H,S,U,Q,W,V,X){var p=x.getIncomingTreeEdges(H);if(d(H)){var C=c(H),I=C==mxConstants.DIRECTION_EAST||C==mxConstants.DIRECTION_WEST,T=S==mxConstants.DIRECTION_EAST||S==mxConstants.DIRECTION_WEST;return C==S||0==p.length?k(H,S):I==T?g(H):e(H,S!=mxConstants.DIRECTION_NORTH&&S!=mxConstants.DIRECTION_WEST)}return F.apply(this,arguments)};x.getSubtree=function(H){var S=

// Vulnerability class: CWE-20
e(L)}),null,null,k,null,q.shadowVisible,null,q,m,null,null,null,"diagram",null)}catch(L){null!=e&&e(L)}};EditorUi.prototype.getEmbeddedSvg=function(c,e,g,k,m,q,v,x,A,z,L,M,n){x=null!=x?x:!0;L=null!=L?L:0;v=null!=A?A:e.background;v==mxConstants.NONE&&(v=null);q=e.getSvg(v,z,L,null,null,q,null,null,null,e.shadowVisible||M,null,n,"diagram");(e.shadowVisible||M)&&e.addSvgShadow(q,null,null,0==L);null!=c&&q.setAttribute("content",c);null!=g&&q.setAttribute("resource",g);var y=mxUtils.bind(this,function(K){K=
(k?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(K);null!=m&&m(K);return K});e.mathEnabled&&this.editor.addMathCss(q);if(null!=m)this.embedFonts(q,mxUtils.bind(this,function(K){x?this.editor.convertImages(K,mxUtils.bind(this,function(B){y(B)})):y(K)}));else return y(q)};EditorUi.prototype.embedFonts=function(c,e){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),

// Vulnerability class: CWE-20
u.appendChild(E));return u}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.recentCustomFonts={};Graph.isGoogleFontUrl=function(u){return u.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS};Graph.isCssFontUrl=function(u){return Graph.isGoogleFontUrl(u)};Graph.createFontElement=function(u,
E){var J=Graph.fontMapping[E];null==J&&Graph.isCssFontUrl(E)?(u=document.createElement("link"),u.setAttribute("rel","stylesheet"),u.setAttribute("type","text/css"),u.setAttribute("charset","UTF-8"),u.setAttribute("href",E)):(null==J&&(J='@font-face {\nfont-family: "'+u+'";\nsrc: url("'+E+'");\n}'),u=document.createElement("style"),mxUtils.write(u,J));return u};Graph.addFont=function(u,E,J){if(null!=u&&0<u.length&&null!=E&&0<E.length){var T=u.toLowerCase();if("helvetica"!=T&&"arial"!=u&&"sans-serif"!=

// Vulnerability class: CWE-20
"geTempDlgCreateBtn geTempDlgBtnDisabled")}function y(fa,ca){if(null!=I){var ba=function(oa){qa.isExternal?e(qa,function(na){ja(na,oa)},ia):qa.url?mxUtils.get(TEMPLATE_PATH+"/"+qa.url,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?ja(na.getText(),oa):ia()})):ja(b.emptyDiagramXml,oa)},ja=function(oa,na){x||b.hideDialog(!0);f(oa,na,qa,ca)},ia=function(){A(mxResources.get("cannotLoad"));ma()},ma=function(){I=qa;Ba.className="geTempDlgCreateBtn";ca&&(Ka.className="geTempDlgOpenBtn")},
qa=I;I=null;"boolean"!==typeof ca&&(ca=qa.isExternal&&m);1==fa?g(qa.url,qa):ca?(Ka.className="geTempDlgOpenBtn geTempDlgBtnDisabled geTempDlgBtnBusy",ba()):(Ba.className="geTempDlgCreateBtn geTempDlgBtnDisabled geTempDlgBtnBusy",fa=null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"),fa=new FilenameDialog(b,b.defaultFilename+".drawio",mxResources.get("ok"),ba,fa,function(oa){var na=null!=oa&&0<oa.length;return na&&x?(ba(oa),!1):
na},null,null,null,ma,v?null:[]),b.showDialog(fa.container,350,80,!0,!0),fa.init())}}function K(fa){Ba.innerHTML=mxUtils.htmlEntities(mxResources.get(Z||fa?"create":"copy"));fa=fa?"none":"";m&&(Ka.style.display=fa);for(var ca=Q.querySelectorAll(".geTempDlgLinkToDiagram"),ba=0;ba<ca.length;ba++)ca[ba].style.display=fa}function B(fa,ca,ba,ja,ia){ia||(aa.innerHTML="",n(),R=fa,Y=ja);var ma=null;if(ba){ma=document.createElement("table");ma.className="geTempDlgDiagramsListGrid";var qa=document.createElement("tr"),

// Vulnerability class: CWE-20
arguments)):T=PROXY_URL+"?url="+encodeURIComponent(T)}return T};return u};Editor.createSvgDataUri=function(u){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(u)))};Editor.prototype.convertImageToDataUri=function(u,E){try{var J=!0,T=window.setTimeout(mxUtils.bind(this,function(){J=!1;E(Editor.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(u))mxUtils.get(u,mxUtils.bind(this,function(Q){window.clearTimeout(T);J&&E(Editor.createSvgDataUri(Q.getText()))}),function(){window.clearTimeout(T);

// Vulnerability class: CWE-20
function getStringValue(name) {
  // Property names must be strings. This means that non-string objects cannot be used
  // as keys in an object. Any non-string object, including a number, is typecasted
  // into a string via the toString method.
  // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names
  //
  // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it
  // to a string. It's not always possible. If `name` is an object and its `toString` method is
  // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:
  //
  // TypeError: Cannot convert object to primitive value
  //
  // For performance reasons, we don't catch this error here and allow it to propagate up the call
  // stack. Note that you'll get the same error in JavaScript if you try to access a property using
  // such a 'broken' object as a key.
  return name + '';
}

// Vulnerability class: CWE-74
mxClient.IS_IOS?(M.style.padding="0px 10px 20px 10px",M.style.top="6px"):mxClient.IS_FF&&(n.style.paddingTop="0px",n.style.marginTop="-2px");if(null!=A)for(m=0;m<A.length;m++)mxUtils.br(n),mxUtils.write(n,A[m]);if(null!=x&&null==b[x]){y.style.visibility="hidden";mxUtils.setOpacity(n,10);var K=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:Editor.isDarkMode()?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});K.spin(M);var B=window.setTimeout(function(){null==
b[x]&&(K.stop(),M.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(F,G){null!=b[x]&&G.getProperty("client")==b[x]&&(window.clearTimeout(B),mxUtils.setOpacity(n,100),y.style.visibility="",K.stop(),L(),"drive"==x&&null!=g.parentNode&&g.parentNode.removeChild(g))}))}else L();e.appendChild(M)}l=null!=l?l:2;var u=document.createElement("div");u.style.textAlign="center";u.style.whiteSpace="nowrap";u.style.paddingTop="0px";u.style.paddingBottom="20px";var t=document.createElement("div");

// Vulnerability class: CWE-20
mxEvent.consume(H))}}catch(M){x.handleError(M)}mxEvent.isConsumed(H)||C.apply(this,arguments)};var D=y.connectVertex;y.connectVertex=function(H,S,V,M,W,U,X){var u=y.getIncomingTreeEdges(H);if(c(H)){var E=d(H),J=E==mxConstants.DIRECTION_EAST||E==mxConstants.DIRECTION_WEST,T=S==mxConstants.DIRECTION_EAST||S==mxConstants.DIRECTION_WEST;return E==S||0==u.length?l(H,S):J==T?k(H):g(H,S!=mxConstants.DIRECTION_NORTH&&S!=mxConstants.DIRECTION_WEST)}return D.apply(this,arguments)};y.getSubtree=function(H){var S=

// Vulnerability class: CWE-20