Please try again.
"),function(t,r){switch(r.status){case 404:return app.showNotFound(e,n);default:return i(t,r)}}},t=this.changedAttributes(),e=this.current(),(0===this.servers.length||"servers"===e)&&this.servers.fetch({reset:!0}).fail(i),this.has("server")&&("databases"!==e&&b.isEmpty(b.pick(t,h))||(this.server.id=this.get("server"),this.server.set(this.server.idAttribute,this.server.id),this.server.fetch({reset:!0}).fail(r("databases","Server Not Found")))),this.has("database")&&("collections"!==e&&b.isEmpty(b.pick(t,o))||(this.database.id=this.get("database"),this.database.set(this.database.idAttribute,this.database.id),this.database.fetch({reset:!0}).fail(r("collections","Database Not Found")))),b.isEmpty(b.pick(t||{},f))||this.search.fromString(this.get("search")||""),this.has("collection")&&"explain"!==e&&("documents"!==e&&b.isEmpty(b.pick(t,n))||(this.coll.id=this.get("collection"),this.coll.set(this.coll.idAttribute,this.coll.id),this.coll.fetch({reset:!0}).fail(r("documents","Collection Not Found")))),this.has("document")&&("document"!==e&&b.isEmpty(b.pick(t,s))||(this.document.id=this.get("document"),this.document.fetch({reset:!0}).fail(r("document","Document Not Found","But Im sure there are plenty of other nice documents out there…
")))),this.get("explain")?this.explain.fetch().fail(i):void 0},e}(p.Model),e.exports=m},{"../collections/servers":6,"../json":9,"../util":25,"../vendors":26,"./collection":11,"./database":12,"./document":13,"./explain":14,"./pagination":16,"./server":19}],19:[function(t,e){var n,r,o,i,s=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty,l=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};i=t("../vendors")._,r=t("./model"),n=t("../collections/databases"),o=function(t){function e(){return this.fetchDatabases=s(this.fetchDatabases,this),e.__super__.constructor.apply(this,arguments)}return l(e,t),e.prototype.dataEvents={"sync this":"fetchDatabases"},e.prototype.initialize=function(){return this.databases=new n([],{server:this}),e.__super__.initialize.apply(this,arguments)},e.prototype.fetchDatabases=function(){return this.databases.fetch({reset:!0})},e.prototype.editable=function(){return!!this.get("editable")},e.prototype.firstChildren=function(){return i.first(this.get("databases")||[],15)},e.prototype.error=function(){return this.get("error")},e}(r),e.exports=o},{"../collections/databases":4,"../vendors":26,"./model":15}],20:[function(){window.Modernizr=function(t,e,n){function r(t){y.cssText=t}function o(t,e){return typeof t===e}function i(t,e){return!!~(""+t).indexOf(e)}function s(t,e){for(var r in t){var o=t[r];if(!i(o,"-")&&y[o]!==n)return"pfx"==e?o:!0}return!1}function a(t,e,r){for(var i in t){var s=e[t[i]];if(s!==n)return r===!1?t[i]:o(s,"function")?s.bind(r||e):s}return!1}function l(t,e,n){var r=t.charAt(0).toUpperCase()+t.slice(1),i=(t+" "+w.join(r+" ")+r).split(" ");return o(e,"string")||o(e,"undefined")?s(i,e):(i=(t+" "+x.join(r+" ")+r).split(" "),a(i,e,n))}var u,c,p,d="2.6.2",f={},h=!0,m=e.documentElement,v="modernizr",g=e.createElement(v),y=g.style,b=({}.toString,"Webkit Moz O ms"),w=b.split(" "),x=b.toLowerCase().split(" "),_={},C=[],k=C.slice,S={}.hasOwnProperty;p=o(S,"undefined")||o(S.call,"undefined")?function(t,e){return e in t&&o(t.constructor.prototype[e],"undefined")}:function(t,e){return S.call(t,e)},Function.prototype.bind||(Function.prototype.bind=function(t){var e=this;if("function"!=typeof e)throw new TypeError;var n=k.call(arguments,1),r=function(){if(this instanceof r){var o=function(){};o.prototype=e.prototype;var i=new o,s=e.apply(i,n.concat(k.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(k.call(arguments)))};return r});for(var E in _)p(_,E)&&(c=E.toLowerCase(),f[c]=_[E](),C.push((f[c]?"":"no-")+c));return f.addTest=function(t,e){if("object"==typeof t)for(var r in t)p(t,r)&&f.addTest(r,t[r]);else{if(t=t.toLowerCase(),f[t]!==n)return f;e="function"==typeof e?e():e,"undefined"!=typeof h&&h&&(m.className+=" "+(e?"":"no-")+t),f[t]=e}return f},r(""),g=u=null,f._version=d,f._domPrefixes=x,f._cssomPrefixes=w,f.testProp=function(t){return s([t])},f.testAllProps=l,m.className=m.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(h?" js "+C.join(" "):""),f}(window,window.document)},{}],21:[function(t,e){var n,r,o,i,s,a,l={}.hasOwnProperty,u=function(t,e){function n(){this.constructor=t}for(var r in e)l.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};a=t("./vendors"),i=a._,n=a.Backbone,o=t("./util"),s=encodeURIComponent,r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return u(e,t),e.prototype.initialize=function(t){return this.app=t.app},e.prototype.routes={"":"index",servers:"redirectToIndex","servers/:server":"server","servers/:server/databases":"redirectToServer","servers/:server/databases/:db":"database","servers/:server/databases/:db/collections":"redirectToDatabase","servers/:server/databases/:db/collections/:coll":"collection","servers/:server/databases/:db/collections/:coll/documents":"collectionSearch","servers/:server/databases/:db/collections/:coll/explain":"explain","servers/:server/databases/:db/collections/:coll/documents/:docId":"document","*path":"notFound"},e.prototype.index=function(){return this.app.selection.select()},e.prototype.redirectToIndex=function(){return this.navigate("",!0)},e.prototype.server=function(t){return this.app.selection.select(t)},e.prototype.redirectToServer=function(t){return this.navigate("servers/"+s(t),!0)},e.prototype.database=function(t,e){return this.app.selection.select(t,e)},e.prototype.redirectToDatabase=function(t,e){return this.navigate("servers/"+s(t)+"/databases/"+s(e),!0)},e.prototype.collection=function(t,e,n){return this.app.selection.select(t,e,n)},e.prototype.redirectToCollection=function(t,e,n){return this.navigate("servers/"+s(t)+"/databases/"+s(e)+"/collections/"+s(n),!0)},e.prototype.collectionSearch=function(t,e,n){var r;return(r=window.location.search)?this.app.selection.select(t,e,n,null,{search:r}):this.redirectToCollection(t,e,n)},e.prototype.redirectToCollectionSearch=function(t,e,n,r){return r?this.navigate("servers/"+s(t)+"/databases/"+s(e)+"/collections/"+s(n)+"/documents?"+r,!0):redirectToCollection(t,e,n)},e.prototype.explain=function(t,e,n){var r;return r=window.location.search,this.app.selection.select(t,e,n,null,{search:r,explain:!0})},e.prototype.document=function(t,e,n,r){return this.app.selection.select(t,e,n,r)},e.prototype.redirectToDocument=function(t,e,n,r){return this.navigate("/servers/"+s(t)+"/databases/"+s(e)+"/collections/"+s(n)+"/documents/"+s(r),!0)},e.prototype.notFound=function(){return this.app.showNotFound()},e}(n.Router),e.exports=r},{"./util":25,"./vendors":26}],22:[function(t){"use strict";window.Genghis=t("./genghis")},{"./genghis":8}],23:[function(t,e){t("./../../vendor/codemirror/lib/codemirror.js"),t("./../../vendor/codemirror/addon/edit/matchbrackets"),t("./../../vendor/codemirror/addon/display/placeholder"),t("./../../vendor/codemirror/mode/javascript/javascript"),e.exports=window.CodeMirror},{"./../../vendor/codemirror/addon/display/placeholder":109,"./../../vendor/codemirror/addon/edit/matchbrackets":110,"./../../vendor/codemirror/lib/codemirror.js":111,"./../../vendor/codemirror/mode/javascript/javascript":112}],24:[function(t,e){"use strict";t("../modernizr");var n=window.Modernizr;n.addTest("cssmask",n.testAllProps("maskRepeat")),n.addTest("textoverflow",n.testAllProps("textOverflow")),n.addTest("filereader",!!(window.File&&window.FileList&&window.FileReader)),n.addTest("fileinput",function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0)|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|Pre\/1.2|Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var t=document.createElement("input");return t.type="file",!t.disabled}),e.exports=n},{"../modernizr":20}],25:[function(t,e){var n,r,o,i,s=[].slice;i=t("./vendors"),n=i.$,o=i._,r={route:function(t){return t.replace(window.app.baseUrl,"").replace(/^\//,"")},parseSearch:function(t){var e;return null==t&&(t=""),e={},t.length&&o.each(t.split("&"),function(t){var n,r,o;return o=t.split("="),r=o[0],n=2<=o.length?s.call(o,1):[],e[r]=decodeURIComponent(n.join("="))}),e},buildSearch:function(t){var e;return e=function(t){return encodeURIComponent(t).replace(/%(7B|7D|5B|5D|3A|24|2C)/g,decodeURIComponent)},o.map(t,function(t,n){return""+e(n)+"="+e(t)}).join("&")},humanizeSize:function(t){var e,n,o;return t===-0?"n/a":(o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],e=parseInt(Math.floor(Math.log(t)/Math.log(1024)),10),n=0===e?t/Math.pow(1024,e):(t/Math.pow(1024,e)).toFixed(1),n=r.round(n,2).toString().replace(/\.0+/,""),""+n+" "+o[e])},humanizeCount:function(t){var e;return null==t&&(t=0),e="",t>1e3&&(t=Math.floor(t/1e3),e=" k"),t>1e3&&(t=Math.floor(t/1e3),e=" M"),t>1e3?"...":""+t+e},round:function(t,e){var n;return null==e&&(e=0),0===+e?Math.round(t):(t=+t,n=-1*+e,o.isNaN(t)||!o.isNumber(n)||n%1!==0?0/0:(t=t.toString().split("e"),t=Math.round(+(t[0]+"e"+(t[1]?+t[1]-n:-n))),t=t.toString().split("e"),+(t[0]+"e"+(t[1]?+t[1]+n:n))))},escape:function(t){return t?String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,"""):void 0},toggleCollapser:function(t){var e,i,s,a,l,u,c,p;return e=n(t.currentTarget).blur().parent(),s=e.children(".v"),l=/^\s*(name|title)\s*/i,p="",e.children(".e").length||(s.hasClass("o")?(u="{",a="}",i=n(o.detect(s.find("> span.p > var"),function(t){return l.test(n(t).text())})).siblings("span.v"),0===i.length&&(i=n(o.detect(s.find("> span.p > span.v"),function(t){var e;return e=n(t),e.hasClass("n")||e.hasClass("b")||e.hasClass("q")&&e.text().length<64}))),(null!=i?i.length:void 0)&&(c=i.siblings("var").text(),p=(c?c+": ":"")+i.text())):(u="[",a="]",i=s.children(".v").first().filter(".call,.a,.re,.b,.z,.n,.q,.ar.empty,.o.empty"),(null!=i?i.length:void 0)&&(p=i.text())),""!==p&&(p=r.escape(""+p.slice(0,51)+" ")),e.append(''+u+""+p+"…"+a+"")),e.toggleClass("collapsed"),t.preventDefault()},base64Encode:function(t){var e,n,r,o,i,s;for(n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=t.length,s="",r=0;i>r;)e=[t.charCodeAt(r),t.charCodeAt(r+1),t.charCodeAt(r+2)],o=[e[0]>>2,(3&e[0])<<4|e[1]>>4,(15&e[1])<<2|e[2]>>6,63&e[2]],isNaN(e[1])&&(o[2]=64),isNaN(e[2])&&(o[3]=64),s+=n[o[0]]+n[o[1]]+n[o[2]]+n[o[3]],r+=3;return s},base64Decode:function(t){var e,n,r,o,i,s,a,l,u,c,p;for(e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=t.length,p="",t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),u=0;c>u;)i=e.indexOf(t.charAt(u++)),s=e.indexOf(t.charAt(u++)),a=e.indexOf(t.charAt(u++)),l=e.indexOf(t.charAt(u++)),n=i<<2|s>>4,r=(15&s)<<4|a>>2,o=(3&a)<<6|l,p+=String.fromCharCode(n),64!==a&&(p+=String.fromCharCode(r)),64!==l&&(p+=String.fromCharCode(o));return p},base64ToHex:function(t){var e,n,r,o,i;for(r=[],e=atob(t.replace(/[=\s]+$/,"")),i=e.length,o=0;i>o;)n=e.charCodeAt(o).toString(16),r.push(1===n.length?"0"+n:n),++o;return r.join("")},encodeDocumentId:function(t){return o.isUndefined(t)?void 0:o.isObject(t)&&"ObjectId"===t.$genghisType?t.$value:"~"+this.base64Encode(JSON.stringify(t))},decodeDocumentId:function(t){return o.isString(t)&&"~"===t[0]?this.base64Decode(t.substr(1)):t},download:function(){var t;return t=void 0,function(e){return t||(t=n("