//>>built
require({cache:{"dojo/node":function(){define(["./has"],function(a){var b;if(require.nodeRequire)b=require.nodeRequire("path");else throw Error("node plugin failed to load because it cannot find the original Node.js require");return{load:function(a,b,g){if(!b.nodeRequire)throw Error("Cannot find native require function");b=b.nodeRequire;var c=define,f;define=void 0;try{f=b(a)}finally{define=c}g(f)},normalize:function(a,e){if("."===a.charAt(0)){var g=require.toUrl(e(".")).replace("/",b.sep),c=a.split("/");
c.unshift(g);a=b.join.apply(b,c)}return a}}})},"main/remoteCaller":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/json"],function(a,b,d){return new (a([],{classes:{},call:function(a,g){for(var c={declaredClass:a,fName:g,args:[]},f=2;f<arguments.length;)c.args.push(arguments[f]),++f;var h=new b;require(["dojo/request/xhr"],function(a){a("/apicall",{data:d.stringify(c),method:"PUT",handleAs:"json",headers:{"Content-Type":"application/json"}}).then(function(c){h.resolve(c.result)},function(c){h.reject(c)})});
return h},add:function(a){this.classes[a.declaredClass]=a},serverCall:function(a){var b=[];a.args&&(b=a.args);var c=this.classes[a.declaredClass];return c[a.fName].apply(c,b)}}))({})})},"main/treeItems":function(){define("dojo/_base/declare main/_RemoteCall dojo/Deferred main/config!node-mirror dojo/_base/array sol/fileName sol/promise dojo/_base/lang main/nameTranslator main/serverOnly!server/files".split(" "),function(a,b,d,e,g,c,f,h,k,l){var m;return m=new (a("treeItems",[b],{remoteFunctions:{getRootDef:!0,
getChildrenDef:!0,getItemDef:!0},getRootDef:function(){return m.getItemDef("")},getItemDef:function(a){var b=new d,r={id:a,name:""===a?c.single(e.dir):c.single(a)};l.dirsDef(k.fileName(a)).then(function(c){r.hasChildren=!!c;b.resolve(r)});return b},getChildrenDef:function(c){var a=new d;l.dirsDef(e.dir+c).then(function(c){if(c){var b=[];f.allDone(g.map(c,function(c){return m.getItemDef(k.reduceName(c)).then(h.hitch(b,"push"))})).then(function(){a.resolve(b)},function(){})}else a.resolve()});return a}}))})},
"main/_RemoteCall":function(){define(["dojo/_base/declare","dojo/has","main/remoteCaller","dojo/_base/lang"],function(a,b,d,e){return a("_RemoteCall",[],{constructor:function(a){d.add(this)},remoteFunctions:{}})})},"main/config":function(){define("dojo/_base/declare dojo/_base/config dojo/_base/lang dojo/has ./config/load!node-mirror main/_RemoteCall dojo/Deferred".split(" "),function(a,b,d,e,g,c,f){var h;return h=new (a("Config",[c],{remoteFunctions:{loadClientConfig:!0,clientSetConfig:!0},clientConfig:{theme:!0},
saveable:{theme:!0},constructor:function(){d.mixin(this,g);this.config=g},set:function(c,a){try{this.config[c]=a,this.saveable[c]&&g.set(c,a),g[c]=a}catch(b){}},set2:function(c,a){try{this.config[c]=a,this.saveable[c]&&g.set(c,a),g[c]=a}catch(b){}},clientSetConfig:function(c,a){var b=new f;this.clientConfig[c]&&this.set2(c,a);b.resolve();return b},get:function(c){var a=new f;a.resolve(this.config[c]);return a},load:function(c,a,b){b(h)},loadClientConfig:function(){var c=new f,a={},b;for(b in this.clientConfig)a[b]=
g[b];c.resolve(a);return c}}))})},"main/config/load":function(){define(["dojo/_base/declare","dojo/_base/config","dojo/_base/lang","dojo/has"],function(a,b,d,e){return{load:function(a,c,f){var h=b.nodeMirrorNodeModule,k=h.getConfig();k.dir||(k.dir=h.getProcessDir());c(["dojo/node!runtime-configuration"],function(c){var b=c(a,{port:3E3,theme:"monokai"},function(c,a){c||(d.mixin(k,a),k.set=function(c,a){b.set(c,a);b.save("ini")},f(k))})})}}})},"sol/fileName":function(){define(["dojo/_base/declare",
"dojo/_base/array","dojo/_base/lang"],function(a,b,d,e){return new (a("File",[],{single:function(a){a=a.split("/");return a[a.length-1]},dir:function(a){a=a.split("/");for(var c="",b=0,b=0;b<a.length-1;++b)c+=a[b],c+="/";return c}}))})},"sol/promise":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/_base/array","dojo/promise/all","dojo/_base/lang"],function(a,b,d,e,g){return new (a("SolPromise",[],{_isPromise:function(a){return a&&"function"===typeof a.then},_parseParameter:function(a){var b,
d;a instanceof Array?d=a:a&&"object"===typeof a&&(b=a);if(b){d=[];for(var k in b)Object.hasOwnProperty.call(b,k)&&this._isPromise(b[k])&&d.push(b[k])}if(d)return d},allDone:function(a){ar=this._parseParameter(a);if(!ar||!ar.length)return(new b).resolve(a);var f=new b,h=ar.length,k=function(){0===--h&&f.resolve(a)};d.forEach(ar,function(a,c){a.then(k,k)});return f.promise}}))})},"dojo/promise/all":function(){define(["../_base/array","../Deferred","../when"],function(a,b,d){var e=a.some;return function(a){var c,
f;a instanceof Array?f=a:a&&"object"===typeof a&&(c=a);var h,k=[];if(c){f=[];for(var l in c)Object.hasOwnProperty.call(c,l)&&(k.push(l),f.push(c[l]));h={}}else f&&(h=[]);if(!f||!f.length)return(new b).resolve(h);var m=new b;m.promise.always(function(){h=k=null});var q=f.length;e(f,function(a,b){c||k.push(b);d(a,function(a){m.isFulfilled()||(h[k[b]]=a,0===--q&&m.resolve(h))},m.reject);return m.isFulfilled()});return m.promise}})},"main/nameTranslator":function(){define(["dojo/_base/declare","main/config",
"dojo/has"],function(a,b,d){var e=0,g,e=b.dir.length;if("win32"==process.platform||"win64"==process.platform)g=!0;return new (a("NameTranslator",[],{reduceName:function(a){return g?a.substr(e).replace("\\","/"):a.substr(e)},fileName:function(a){return g?b.dir+a.replace("/","\\"):b.dir+a}}))})},"main/serverOnly":function(){define(["dojo/has"],function(a){return{load:function(a,d,e){d([a],e)}}})},"server/files":function(){define("dojo/_base/declare dojo/Deferred dojo/node!fs dojo/_base/array dojo/promise/all dojo/_base/lang sol/promise dojo/node!mime-magic dojo/node!mime sol/string".split(" "),
function(a,b,d,e,g,c,f,h,k,l){var m={".pl":"application/promiseLand",".pegjs":"application/peg.js",".less":"text/x-less"},q={".pl":"application/promiseLand",".pegjs":"application/peg.js",".less":"text/x-less"},n;return n=new (a("File",[],{remoteFunctions:{},dirsDef:function(a){var c=new b;d.stat(a,function(b,t){b||!t.isDirectory()?c.resolve():d.readdir(a,function(b,d){if(b)c.resolve();else{var t=[];f.allDone(e.map(d,function(c){filename=a+"/"+c;return n.isDirDef(filename).then(function(a){t.push(a)})})).then(function(){c.resolve(t)})}})});
return c.promise},childrenDef:function(a){var c=new b;n.isDirDef(a).then(function(){d.readdir(a,function(b,d){b?c.resolve():c.resolve(e.map(d,function(c){return a+"/"+c}))})},function(){c.resolve()});return c.promise},isDirDef:function(a){var c=new b;d.stat(a,function(b,d){b||d.isDirectory()&&c.resolve(a);c.reject(a)});return c.promise},contentTypeDef:function(a){var c=new b;h(a,function(b,f){b?c.reject(b):d.stat(a,function(b,d){try{if(b)c.reject(b);else{var h=!1;!d.isDirectory()&&0===d.size&&(h=
!0);"inode/x-empty"==f&&(h=!0);var n;if("text/plain"==f||h){for(n in m)if(a.substr(a.length-n.length)==n){f=m[n];c.resolve(f);return}f=k.lookup(a)}else if(l.startsWith(f,"text/"))for(n in q)if(l.endsWith(a,n)){f=m[n];c.resolve(f);return}c.resolve(f)}}catch(e){}})});return c.promise},readTextDef:function(a){var c=new b;d.readFile(a,{encoding:"utf8"},function(a,b){"object"==typeof b?c.resolve(b.toString()):"string"==typeof b?c.resolve(b):c.resolve("file could not be read")});return c.promise},createFileDef:function(a){var c=
new b;d.open(a,"a",void 0,function(a,b){a?c.reject(a):b?d.close(b,function(){c.resolve()}):c.resolve()});return c.promise},createDirDef:function(a){var c=new b;d.mkdir(a,void 0,function(b){b?c.reject(b):c.resolve(a)});return c.promise},writeTextDef:function(a,c){var f=new b;d.writeFile(a,c,{encoding:"utf8"},function(a,c){f.resolve()});return f.promise}}))})},"sol/string":function(){define([],function(){return{endsWith:function(a,b){return a.substr(a.length-b.length)==b?!0:!1},startsWith:function(a,
b){return a.substr(0,b.length)==b?!0:!1},cutEnd:function(a,b){return a.substr(0,a.length-b)},cutStart:function(a,b){return a.substr(b)}}})},"main/contentIO":function(){define("dojo/_base/declare main/_RemoteCall dojo/Deferred dojo/_base/array sol/fileName sol/promise dojo/_base/lang main/nameTranslator main/modules main/serverOnly!server/files main/moduleLoader!server".split(" "),function(a,b,d,e,g,c,f,h,k,l,m){return new (a("ContentIO",[b],{remoteFunctions:{getContentDef:!0},getContentDef:function(a){var c=
new d,b=f.hitch(c,"reject"),k=h.fileName(a.id);l.contentTypeDef(k).then(function(f){a.contentType=f;m.findModulePs(a).then(function(f){try{f.getContentPs(a).then(function(b){c.resolve({content:b,par:a,moduleId:f.getModuleId()})},b)}catch(d){b()}},b)});return c}}))})},"main/modules":function(){define([],function(){return"modules/Binary modules/Directory modules/Text modules/Html modules/JavaScript modules/Less modules/Peg".split(" ")})},"main/moduleLoader":function(){define("main/modules dojo/_base/array dojo/Deferred dojo/_base/declare main/_RemoteCall dojo/_base/lang".split(" "),
function(a,b,d,e,g,c){moduleLoader=new (e([],{modules:[],namedModules:{},register:function(a,c){this.modules.push(a);this.namedModules[c]=a},getModule:function(a){return this.namedModules[a]},findModulePs:function(a){var b=new d,k=this.modules.length;if(a.force)try{var e=this.getModule(a.force);if(e)return b.resolve(e),b}catch(g){}var q;q=c.hitch(this,function(){if(k){--k;var c;try{c=this.modules[k],c.isCompetentPs(a).then(function(){b.resolve(c)},q)}catch(d){q()}}else b.reject()});q();return b}}));
return{load:function(c,d,k){d(a,function(){b.forEach(arguments,function(c,b){var d=a[b],f=new (e(d,[g,c],{buildRendering:function(){}}));f.ModuleClass=c;f.moduleId=d;moduleLoader.register(f,d)});k(moduleLoader)})}}})},"main/nodeControl":function(){define("dojo/_base/declare main/_RemoteCall dojo/Deferred main/config!node-mirror dojo/_base/array sol/promise dojo/_base/lang dojo/has".split(" "),function(a,b,d,e,g,c,f,h){return new (a("NodeControl",[b],{remoteFunctions:{restartDef:!0},restartDef:function(){var a=
new d;setTimeout(function(){e.restartableObj&&e.restartableObj.isRestartable&&e.restartableObj.restart()},10);a.resolve({});return a.promise}}))})},"sol/node/npm":function(){define(["dojo/node!npm","dojo/_base/declare","dojo/Deferred","dojo/_base/lang"],function(a,b,d,e){var g=new d;a.load(function(c){c?g.reject(c):g.resolve(a)});return{load:function(a){var b=new d;a.onLoad&&b.then(a.onLoad);a.onError&&b.then(void 0,a.onError);try{require(["dojo/node!"+a.name],function(a){b.resolve(a)})}catch(e){g.then(function(d){if(a.onInstall)a.onInstall(a);
d.commands.install([a.name],function(a,c){if(a)b.reject(a);else try{var d=process.cwd()+"/"+c[0][1];require(["dojo/node!"+d],function(a){b.resolve(a)})}catch(e){b.reject(e)}})})}return b}}})},"main/codemirror/subtypes":function(){define(["./meta","dojo/_base/array"],function(a,b){var d={};b.forEach(a,function(a){d[a.mime.split("/")[1]]=!0});return d})},"main/codemirror/meta":function(){(function(a,b){if("function"==typeof define)define(a,b);else{for(var d=[],e=0,e=0;e<a.length;++e)d.push(require(a[e]));
module.exports=b.apply(void 0,d)}})(["main/codemirror/fake"],function(a){a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl"},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk"},{name:"C",mime:"text/x-csrc",mode:"clike"},{name:"C++",mime:"text/x-c++src",mode:"clike"},{name:"Cobol",mime:"text/x-cobol",mode:"cobol"},{name:"Java",mime:"text/x-java",mode:"clike"},{name:"C#",mime:"text/x-csharp",mode:"clike"},{name:"Scala",mime:"text/x-scala",mode:"clike"},{name:"Clojure",mime:"text/x-clojure",mode:"clojure"},
{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript"},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp"},{name:"CSS",mime:"text/css",mode:"css"},{name:"D",mime:"text/x-d",mode:"d"},{name:"diff",mime:"text/x-diff",mode:"diff"},{name:"ECL",mime:"text/x-ecl",mode:"ecl"},{name:"Erlang",mime:"text/x-erlang",mode:"erlang"},{name:"Gas",mime:"text/x-gas",mode:"gas"},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm"},{name:"GO",mime:"text/x-go",mode:"go"},{name:"Groovy",
mime:"text/x-groovy",mode:"groovy"},{name:"Haskell",mime:"text/x-haskell",mode:"haskell"},{name:"Haxe",mime:"text/x-haxe",mode:"haxe"},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded"},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded"},{name:"JavaServer Pages",mime:"application/x-jsp",mode:"htmlembedded"},{name:"HTML",mime:"text/html",mode:"htmlmixed"},{name:"HTTP",mime:"message/http",mode:"http"},{name:"Jade",mime:"text/x-jade",mode:"jade"},{name:"JavaScript",
mime:"text/javascript",mode:"javascript"},{name:"JSON",mime:"application/x-json",mode:"javascript"},{name:"JSON",mime:"application/json",mode:"javascript"},{name:"TypeScript",mime:"application/typescript",mode:"javascript"},{name:"Jinja2",mime:"jinja2",mode:"jinja2"},{name:"LESS",mime:"text/x-less",mode:"less"},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript"},{name:"Lua",mime:"text/x-lua",mode:"lua"},{name:"Markdown (GitHub-flavour)",mime:"text/x-markdown",mode:"markdown"},{name:"mIRC",
mime:"text/mirc",mode:"mirc"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx"},{name:"NTriples",mime:"text/n-triples",mode:"ntriples"},{name:"OCaml",mime:"text/x-ocaml",mode:"ocaml"},{name:"Pascal",mime:"text/x-pascal",mode:"pascal"},{name:"Perl",mime:"text/x-perl",mode:"perl"},{name:"PHP",mime:"text/x-php",mode:"php"},{name:"PHP(HTML)",mime:"application/x-httpd-php",mode:"php"},{name:"Pig",mime:"text/x-pig",mode:"pig"},{name:"Plain Text",mime:"text/plain",mode:"null"},{name:"Properties files",
mime:"text/x-properties",mode:"clike"},{name:"Python",mime:"text/x-python",mode:"python"},{name:"Cython",mime:"text/x-cython",mode:"python"},{name:"R",mime:"text/x-rsrc",mode:"r"},{name:"reStructuredText",mime:"text/x-rst",mode:"rst"},{name:"Ruby",mime:"text/x-ruby",mode:"ruby"},{name:"Rust",mime:"text/x-rustsrc",mode:"rust"},{name:"Sass",mime:"text/x-sass",mode:"sass"},{name:"Scheme",mime:"text/x-scheme",mode:"scheme"},{name:"SCSS",mime:"text/x-scss",mode:"css"},{name:"Shell",mime:"text/x-sh",mode:"shell"},
{name:"Sieve",mime:"application/sieve",mode:"sieve"},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk"},{name:"Smarty",mime:"text/x-smarty",mode:"smarty"},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"SPARQL",mime:"application/x-sparql-query",mode:"sparql"},{name:"SQL",mime:"text/x-sql",mode:"sql"},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex"},{name:"Tcl",mime:"text/x-tcl",mode:"tcl"},
{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"VB.NET",mime:"text/x-vb",mode:"vb"},{name:"VBScript",mime:"text/vbscript",mode:"vbscript"},{name:"Velocity",mime:"text/velocity",mode:"velocity"},{name:"Verilog",mime:"text/x-verilog",mode:"verilog"},{name:"XML",mime:"application/xml",mode:"xml"},{name:"HTML",mime:"text/html",mode:"xml"},{name:"XQuery",mime:"application/xquery",mode:"xquery"},{name:"YAML",mime:"text/x-yaml",mode:"yaml"},
{name:"Z80",mime:"text/x-z80",mode:"z80"}];return a.modeInfo})},"modules/Text":function(){define("dojo/_base/declare modules/base/BorderContainer dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang main/serverOnly!server/files main/codemirror/subtypes sol/string main/clientOnly!sol/wgt/CodeMirror main/clientOnly!codemirror/theme/all main/clientOnly!dijit/form/Select main/config main/clientOnly!codemirror/mode/allModes main/clientOnly!codemirror/addon/dialog/dialog main/clientOnly!codemirror/addon/search/search main/clientOnly!codemirror/addon/search/searchcursor main/clientOnly!codemirror/addon/edit/matchbrackets".split(" "),
function(a,b,d,e,g,c,f,h,k,l,m,q,n,r){var u={"peg.js":!0,"x-empty":!0},p={"inode/x-empty":!0};return a([b],{"class":"content text",saveButton:!0,reloadButton:!0,downloadButton:!0,binaryModeButton:!0,isCompetentPs:function(a){var c=this.def(),b=!1;l.startsWith(a.contentType,"text/")&&(b=!0);if(!b&&l.startsWith(a.contentType,"application/")){var d=a.contentType.split("/")[1];if(k[d]||u[d])b=!0}b||p[a.contentType]&&(b=!0);b?c.resolve():c.reject();return c},getContentPs:function(a){var b=new d,c={},e=
this.def(),r=this.def();h.readTextDef(this.getFileName(a.id)).then(function(a){c.text=a;e.resolve(c)});h.contentTypeDef(this.getFileName(a.id)).then(function(a){c.contentType=a;r.resolve(c)});g.allDone([e,r]).then(f.hitch(b,"resolve",c));return b},saveContentPs:function(a,c){return h.writeTextDef(this.getFileName(a.id),c.text)},buildRendering:function(){var a=this.inherited(arguments);this.themeSelect=this.ownObj(new n({options:c.map(q,function(a){return{label:a,value:a}}),onChange:f.hitch(this,"changeTheme")}));
this.menu.addChild(this.themeSelect);this.mirror=this.ownObj(new m({region:"center",value:this.content.text,mode:this.par.contentType,lineNumbers:!0,theme:"twilight",matchBrackets:!0}));this.addChild(this.mirror);this.mirror.on("change",f.hitch(this,function(){this._started&&this.set("dirty",!0)}));r.get("theme").then(f.hitch(this,function(a){this.mirror.set("theme",a);this.themeSelect.set("value",a)}));return a},changeTheme:function(){this.mirror.set("theme",this.themeSelect.get("value"));r.set("theme",
this.themeSelect.get("value"))},_setContentAttr:function(a){this._set("content",a);this.mirror&&(this.mirror.set("value",this.content.text),this.mirror.set("mode",this.content.contentType))},_getContentAttr:function(){this.mirror&&(this.content.text=this.mirror.get("value"));return this.content}})})},"modules/base/BorderContainer":function(){define(["dojo/_base/declare","dojo/_base/lang","main/clientOrStub!dijit/layout/BorderContainer","main/clientOrStub!./WidgetMixin","modules/base/Base"],function(a,
b,d,e,g){return a([g,d,e],{"class":"content",gutters:!1,showMenu:!0,buildRendering:function(){return this.inherited(arguments)}})})},"main/clientOrStub":function(){define(["dojo/has","dojo/_base/declare"],function(a,b){var d=b([],{});return{load:function(a,b,c){c(d)}}})},"modules/base/Base":function(){define(["dojo/_base/declare","dojo/Deferred","main/_RemoteCall","main/nameTranslator","dojo/_base/lang"],function(a,b,d,e,g){d={getContentPs:!0,saveContentPs:!0};a=a([],{WidgetClass:void 0,remoteFunctions:d,
def:function(){return new b},isCompetentPs:function(a){a=this.def();a.reject();return a},getContentPs:function(a){a=this.def();a.reject();return a},saveContentPs:function(a,b){var d=this.def();d.reject();return d},getWidgetClassPs:function(a){a=this.def();a.resolve(this.WidgetClass||this.ModuleClass);return a},createWidgetPs:function(a){var b=this.def();this.getWidgetClassPs(a).then(g.hitch(this,function(d){if(d){var e={createWidgetPs:g.hitch(this,"createWidgetPs"),isCompetentPs:g.hitch(this,"isCompetentPs"),
getContentPs:g.hitch(this,"getContentPs"),saveContentPs:g.hitch(this,"saveContentPs"),moduleId:this.getModuleId()},l;for(l in this.remoteFunctions)e[l]=g.hitch(this,l);b.resolve(new d(g.mixin(e,a)))}else b.reject()}));return b},getFileName:function(a){return e.fileName(a)},getModuleId:function(){return this.moduleId}});a.remoteFunctions=d;return a})},"main/clientOnly":function(){define(["dojo/has"],function(a){return{load:function(a,d,e){e(void 0)}}})},"modules/Directory":function(){define("dojo/_base/declare modules/base/Base modules/base/BorderContainer dojo/Deferred dojo/has sol/promise dojo/_base/array main/nameTranslator main/serverOnly!server/files main/clientOnly!./directory/Grid main/clientOnly!./directory/NewDlg main/clientOnly!dijit/form/Button dojo/_base/lang".split(" "),
function(a,b,d,e,g,c,f,h,k,l,m,q,n){return a([d],{remoteFunctions:n.mixin({},b.remoteFunctions,{createFilePs:!0}),reloadButton:!0,downloadButton:!0,isCompetentPs:function(a){var b=this.def();"inode/directory"==a.contentType?b.resolve():b.reject();return b},getContentPs:function(a){var b=this.def();a=this.getFileName(a.id);k.childrenDef(a).then(function(a){var d={children:[]};c.allDone(f.map(a,function(a){var b={type:"file",id:h.reduceName(a)};d.children.push(b);return k.contentTypeDef(a).then(function(a){b.contentType=
a})})).then(function(){b.resolve(d)})});return b},createFilePs:function(a,b,c){var d=this.def(),f=function(a){d.reject()},e=a.id+"/"+b;if(!b||!b.length)d.reject();else return a=h.fileName(e),b=n.hitch(this,function(){try{require(["main/contentIO"],function(a){try{a.getContentDef({type:"file",id:e}).then(function(a){d.resolve(a)},function(a){})}catch(b){d.reject()}})}catch(a){d.reject()}}),c?k.createDirDef(a).then(b,f):k.createFileDef(a).then(b,f),d.promise},downloadbutton:!0,reloadbutton:!0,buildRendering:function(){var a=
this.inherited(arguments);this.newDirButton=this.ownObj(new q({label:"new Directory",showLabel:!0,onClick:n.hitch(this,"createNew",!0),region:"left"}));this.menu.addChild(this.newDirButton);this.newButton=this.ownObj(new q({label:"new File",showLabel:!0,onClick:n.hitch(this,"createNew",!1),region:"left"}));this.menu.addChild(this.newButton);this.grid=this.ownObj(new l({content:this.content,mainWgt:this}));this.addChild(this.grid);return a},_setContentAttr:function(a){this._set("content",a);this.grid.set("content",
a);this.grid.doRender()},createNew:function(a){a=new m({newDir:a,parent:this});a.startup();a.show()}})})},"modules/Binary":function(){define("dojo/_base/declare dojo/Deferred dojo/_base/lang sol/promise dojo/_base/array main/serverOnly!server/files sol/string modules/base/Base modules/base/BorderContainer main/serverOnly!dojo/node!fs main/clientOnly!./binary/HexGrid".split(" "),function(a,b,d,e,g,c,f,h,k,l,m){return a([k],{remoteFunctions:d.mixin({},h.remoteFunctions,{readLinesPs:!0}),"class":"content binary",
saveButton:!0,reloadButton:!0,downloadButton:!0,textModeButton:!0,buildRendering:function(){var a=this.inherited(arguments);this.hexGrid=this.ownObj(new m({fileId:this.par.id,region:"center",parent:this}));this.addChild(this.hexGrid);return a},isCompetentPs:function(a){var b=this.def();"inode/directory"==a.contentType?b.reject():b.resolve();return b},getContentPs:function(a){a=this.def();a.resolve({isBin:!0});return a},_getContentAttr:function(){return this.hexGrid.getSaveData()},savePs:function(){var a=
this.inherited(arguments);a.then(d.hitch(this.hexGrid,"resetEdited"));return a},saveContentPs:function(a,c){var d=new b,f=this.getFileName(a.id);l.open(f,"r+",function(a,b){if(a)d.reject();else{var f=0,e=0,g=[],k,h=function(){var c=g.length,h=16*e;f=e=0;if(!c)return k();var n=new Buffer(g);l.write(b,n,0,c,h,function(){a?d.reject():(g=[],k())})};k=function(){if(c.length){for(;c.length;){var a=c[0];if(a.lineNr!=f){if(g.length)return h();e=a.lineNr}c.shift();f=a.lineNr+1;g=g.concat(a.data);if(16!=a.data.length)return h()}h()}else l.close(b,
function(){d.resolve()})};k()}});return d},readLinesPs:function(a,c){var d=new b,f=this.getFileName(a);l.open(f,"r",function(a,b){if(a)d.reject();else{var f=c.count||1,e=16*f,g=c.start||0,g=16*g,h=new Buffer(e);l.read(b,h,0,e,g,function(a,e,g){if(a)d.reject();else{var h=[];for(a=0;a<f;++a){for(var k=16*a,m={lineNr:c.start+a,data:[]},p=0;16>p;++p)e&&(--e,m.data[p]=g[k+p]);h.push(m)}l.close(b,function(){d.resolve(h)})}})}});return d}})})},"modules/Less":function(){define("dojo/_base/declare modules/base/Base modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!./less/Tester main/clientOnly!dijit/form/Button main/serverOnly!dojo/node!less sol/fileName main/serverOnly!server/files main/clientOnly!sol/wgt/Iframe main/clientOnly!dojo/dom-style main/clientOnly!dojo/dom-construct main/clientOnly!dojo/dom-geometry".split(" "),
function(a,b,d,e,g,c,f,h,k,l,m,q,n,r,u,p,t,s){var w={less:!0,"x-less":!0},x={};return a([d],{remoteFunctions:h.mixin({},b.remoteFunctions,{testPs:!0}),"class":"content text less",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];w[d]&&(c=!0);c||x[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.testBtn=this.ownObj(new m({onClick:h.hitch(this,"test"),label:"test"}));this.menu.addChild(this.testBtn);
this.referenceBtn=this.ownObj(new m({onClick:h.hitch(this,"reference"),label:"Reference"}));this.menu.addChild(this.referenceBtn);return a},reference:function(){this.referenceFrame&&this.showingReference?(this.showingReference=!1,this._frameBox=s.getMarginBox(this.referenceFrame.domNode),this._frameBox2=s.getMarginBox(this.referenceFrame._splitterWidget.domNode),p.set(this.referenceFrame.domNode,"height","0px"),p.set(this.referenceFrame.domNode,"border","0px"),p.set(this.referenceFrame._splitterWidget.domNode,
"height","0px"),this.resize()):(this.showingReference=!0,this.referenceFrame?(s.setMarginBox(this.referenceFrame.domNode,{h:this._frameBox.h}),s.setMarginBox(this.referenceFrame._splitterWidget.domNode,{h:this._frameBox2.h}),this.resize()):(this.referenceFrame=this.ownObj(new u({"class":"referenceFrame",src:"http://lesscss.org/#reference",region:"top",splitter:!0})),this.addChild(this.referenceFrame)))},test:function(){this.tester||(this.tester=this.ownObj(new l({parent:this})),this.addChild(this.tester));
this.testPs(this.par,this.mirror.get("value")).then(h.hitch(this,function(a){this.tester.set("value",a)}))},testPs:function(a,b){var c=this.def();(new q.Parser({paths:[this.getFileName(n.dir(a.id))],filename:n.single(a.id)})).parse(b,function(a,b){a?c.resolve("error"):c.resolve(b.toCSS())});return c},saveContentPs:function(a,b){var d=this.inherited(arguments),f=this.def();try{var e=this.getFileName(a.id);k.endsWith(e,".less")&&(e=e.substr(0,e.length-5));e+=".css";this.testPs(a,b.text).then(function(a){r.writeTextDef(e,
a).then(function(){f.resolve()})})}catch(g){}return c.allDone([d,f])}})})},"modules/Html":function(){define("dojo/_base/declare modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!./html/Tester main/clientOnly!dijit/form/Button".split(" "),function(a,b,d,e,g,c,f,h,k,l){var m={html:!0},q={};return a([b],{"class":"content text html",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];m[d]&&(c=!0);c||q[a.contentType]&&
(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.testBtn=this.ownObj(new l({onClick:f.hitch(this,"test"),label:"test"}));this.menu.addChild(this.testBtn);return a},test:function(){this.tester||(this.tester=this.ownObj(new k({parent:this})),this.addChild(this.tester),this.mirror.on("change",f.hitch(this,function(){this.tester.codeChanged()})));this.tester.test()}})})},"modules/Peg":function(){define("dojo/_base/declare modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!./peg.js/Parser main/clientOnly!dijit/form/Button".split(" "),
function(a,b,d,e,g,c,f,h,k,l){var m={"peg.js":!0,pegjs:!0},q={};return a([b],{"class":"content text pegjs",isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];m[d]&&(c=!0);c||q[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.parseBtn=this.ownObj(new l({onClick:f.hitch(this,"parse"),label:"parse"}));this.menu.addChild(this.parseBtn);return a},parse:function(){this.parser||(this.parser=this.ownObj(new k({parent:this})),
this.addChild(this.parser),this.mirror.on("change",f.hitch(this,function(){this.parser.parserCodeChanged()})));this.parser.parse()}})})},"modules/JavaScript":function(){define("dojo/_base/declare modules/Text dojo/Deferred dojo/has sol/promise dojo/_base/array dojo/_base/lang sol/string main/clientOnly!dijit/form/Button main/clientOnly!dijit/form/ToggleButton".split(" "),function(a,b,d,e,g,c,f,h,k,l){var m={javascript:!0,javaScript:!0,JavaScript:!0,Javascript:!0},q={},n=!0;return a([b],{"class":"content text javascript",
isCompetentPs:function(a){var b=this.def(),c=!1,d=a.contentType.split("/")[1];m[d]&&(c=!0);c||q[a.contentType]&&(c=!0);c?b.resolve():b.reject();return b},buildRendering:function(){var a=this.inherited(arguments);this.jshintBtn=this.ownObj(new l({onChange:f.hitch(this,function(){n=this.jshintBtn.get("checked");this.mirror.set("jshint",n)}),label:"syntax check",checked:n}));this.menu.addChild(this.jshintBtn);this.mirror.set("jshint",n);return a}})})},"main/codemirror/fake":function(){define([],function(){return{}})}}});
define("server/server","dojo/node!express dojo/node!mime-magic dojo/node!socket.io dojo/node!http dojo/has dojo/node!fs dojo/node!session.socket.io dojo/node!connect dojo/Deferred".split(" "),function(a,b,d,e,g,c,f,h,k){require("main/remoteCaller main/treeItems server/files main/nameTranslator sol/fileName main/contentIO main/nodeControl dojo/node!easy-zip main/config sol/node/npm dojo/node!net".split(" "),function(b,g,q,n,r,u,p,t,s,w,x){EasyZip=t.EasyZip;p=a();t=e.createServer(p);s.username&&p.use(a.basicAuth(s.username,
s.password));g=a.cookieParser("my session secret");u=new h.middleware.session.MemoryStore;p.use(g);p.use(a.session({store:u,cookie:{path:"/",httpOnly:!0,maxAge:null}}));p.use(a.bodyParser());p.put("/apicall",function(a,c){try{b.serverCall(a.body).then(function(a){c.send({result:a})})}catch(d){c.close()}});p.put("/reconnect",function(a,b){b.setHeader("Content-Type","application/json");b.send({reconnected:!0})});p.get("/download",function(a,b){var d=n.fileName(a.query.id);q.contentTypeDef(d).then(function(a){if("inode/directory"==
a){var f=new EasyZip;f.zipFolder(d,function(){b.setHeader("Content-Disposition",'attachment; filename\x3d"'+r.single(d)+'.zip"');f.writeToResponse(b,r.single(d)+".zip");b.end()})}else b.setHeader("Content-Type",a),c.readFile(d,function(a,c){a?b.end():(b.setHeader("Content-Length",c.length),b.setHeader("Content-Disposition",'attachment; filename\x3d"'+r.single(d)+'"'),b.end(c))})})});p.use(a["static"](s["static"]));p.get("/",function(a,b){b.setHeader("Content-Type","text/html");c.readFile(s["static"]+
"/index.html",function(a,c){a?b.end(a):b.end(c)})});t.listen(s.port);p=d.listen(t);p.set("log level",0);sessionSockets=new f(p,u,g);var v;sessionSockets.on("connection",function(a,b,c){if(a)b&&b.emit("tryagain");else{var d={},f=0;b.on("openterminal",function(a,c){var e="terminal"+f;f++;c({termid:e});if("node"==a.mode)process.__defineGetter__("stderr",function(){return{write:function(a){b.emit(e,a)}}}),b.emit(e+"_meta",{event:"ready"}),b.emit(e,"welcome");else if("dbg"==a.mode){var g=new x.Socket;
g.connect(5858,function(a,b){});g.on("data",function(a){b.emit(e,a.toString())});b.emit(e+"_meta",{event:"ready"})}else{var h=new k;v?h.resolve(v):w.load({name:"pty.js",onInstall:function(){b.emit(e+"_meta",{event:"install"})},onError:function(a){b.emit(e+"_meta",{event:"installerror"});h.reject()},onLoad:function(a){h.resolve(a)}});h.then(function(a){v=a;d[e]="win32"==process.platform?v.fork("c:\\windows\\system32\\cmd.exe",[],{name:"xterm-color",cols:80,rows:30,cwd:process.env.HOME,env:process.env}):
v.spawn("bash",[],{name:"xterm-color",cols:80,rows:30,cwd:process.env.HOME,env:process.env});var c=d[e];c.on("title",function(a){});c.on("data",function(a){b.emit(e,a)});b.on(e,function(a){c.write(a)});b.on(e+"_resize",function(a){try{c.resize(a.x,a.y)}catch(b){}});b.emit(e+"_meta",{event:"ready"})})}})}})})});
//@ sourceMappingURL=server.js.map