(function(d,f){"function"===typeof define&&define.amd?define("orion/Deferred",f):"object"===typeof exports?module.exports=f():(d.orion=d.orion||{},d.orion.Deferred=f())})(this,function(){function d(){for(var c;c=l.shift();)c();b=!1}function f(k){l.push(k);b||(b=!0,c())}function m(b){return function(c){b(c)}}function h(){function b(){for(var a;a=q.shift();){var c=a.deferred,g="fulfilled"===e?"resolve":"reject";a=a[g];if("function"===typeof a)try{var k=a(n),d=k&&("object"===typeof k||"function"===typeof k)&&
k.then;if("function"===typeof d)if(k===c.promise)c.reject(new TypeError);else{var r=k.cancel;"function"===typeof r?c._parentCancel=r.bind(k):delete c._parentCancel;d.call(k,m(c.resolve),m(c.reject),m(c.progress))}else c.resolve(k)}catch(h){c.reject(h)}else c[g](n)}}function c(a){delete g._parentCancel;e="rejected";n=a;q.length&&f(b)}function d(a){function l(a){return function(b){(!e||"assumed"===e)&&a(b)}}delete g._parentCancel;try{var t=a&&("object"===typeof a||"function"===typeof a)&&a.then;if("function"===
typeof t)if(a===g)c(new TypeError);else{e="assumed";var m=a&&a.cancel;if("function"!==typeof m){var v=new h;a=v.promise;try{t(v.resolve,v.reject,v.progress)}catch(x){v.reject(x)}m=a.cancel;t=a.then}n=a;t.call(a,l(d),l(c));g._parentCancel=m.bind(a)}else e="fulfilled",n=a,q.length&&f(b)}catch(u){l(c)(u)}}function a(){var a=g._parentCancel;a?(delete g._parentCancel,a()):e||(a=Error("Cancel"),a.name="Cancel",c(a))}var n,e,q=[],g=this;this.resolve=function(a){e||d(a);return g};this.reject=function(a){e||
c(a);return g};this.progress=function(a){e||q.forEach(function(b){if(b.progress)try{b.progress(a)}catch(c){}});return g.promise};this.cancel=function(){g._parentCancel?setTimeout(a,0):a();return g};this.then=function(a,c,n){var d=new h;d._parentCancel=g.promise.cancel;q.push({resolve:a,reject:c,progress:n,deferred:d});("fulfilled"===e||"rejected"===e)&&f(b);return d.promise};this.promise={then:g.then,cancel:g.cancel}}var l=[],b=!1,c=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var b=
process.nextTick;return function(){b(d)}}if("function"===typeof MutationObserver){var c=document.createElement("div");(new MutationObserver(d)).observe(c,{attributes:!0});return function(){c.setAttribute("class","_tick")}}return function(){setTimeout(d,0)}}();h.all=function(b,c){function d(a,b){q||(e[a]=b,0===--n&&g.resolve(e))}function a(a,b){if(!q){if(c)try{d(a,c(b));return}catch(e){b=e}g.reject(b)}}var n=b.length,e=[],q=!1,g=new h;g.then(void 0,function(){q=!0;b.forEach(function(a){a.cancel&&a.cancel()})});
0===n?g.resolve(e):b.forEach(function(b,c){b.then(d.bind(void 0,c),a.bind(void 0,c))});return g.promise};h.when=function(b,c,d,a){var n;b&&"function"===typeof b.then||(n=new h,n.resolve(b),b=n.promise);return b.then(c,d,a)};return h});
(function(d,f){"function"===typeof define&&define.amd?define("orion/plugin",["orion/Deferred"],f):"object"===typeof exports?module.exports=f(require("orion/Deferred")):(d.orion=d.orion||{},d.orion.PluginProvider=f(d.orion.Deferred))})(this,function(d){function f(d,h){this.__objectId=d;this.__methods=h}return function(m){function h(a){q&&("undefined"===typeof ArrayBuffer&&(a=JSON.stringify(a)),q===self?q.postMessage(a):q.postMessage(a,"*"))}function l(){var a=[];Object.keys(x).forEach(function(b){var c=
x[b];a.push({serviceId:b,names:c.names,methods:c.methods,properties:c.properties})});return{headers:n||{},services:a}}function b(a,b){if(b&&b instanceof XMLHttpRequest){var c,e;try{c=b.status,e=b.statusText}catch(p){c=0,e=""}return{status:c||0,statusText:e}}return b}function c(a){var c=a?JSON.parse(JSON.stringify(a,b)):a;a instanceof Error&&(c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name);return c}function k(a){if(!q)return(new d).reject(Error("plugin not connected"));a.id=String(g++);
var b=new d;y[a.id]=b;b.then(null,function(b){e&&b instanceof Error&&"Cancel"===b.name&&u({requestId:a.id,method:"cancel",params:b.message?[b.message]:[]})});var c=Object.prototype.toString;a.params.forEach(function(e,p){if("[object Object]"===c.call(e)&&!(e instanceof f)){var s,g;for(s in e)"[object Function]"===c.call(e[s])&&(g=g||[],g.push(s));if(g){var d=B++;v[d]=e;s=function(){delete v[d]};b.then(s,s);a.params[p]=new f(d,g)}}});u(a);return b.promise}function r(a,b){a||0===a?u({id:a,result:null,
error:b}):console.log(b)}function w(a,b,e,g){g.forEach(function(p,a){if(p&&"undefined"!==typeof p.__objectId){var b={};p.__methods.forEach(function(a){b[a]=function(){return k({objectId:p.__objectId,method:a,params:Array.prototype.slice.call(arguments)})}});g[a]=b}});var p=void 0===typeof a?null:{id:a,result:null,error:null};try{var s=e.apply(b,g);p&&(s&&"function"===typeof s.then?(t[a]=s,s.then(function(b){delete t[a];p.result=b;u(p)},function(b){t[a]&&(delete t[a],p.error=c(b),u(p))},function(){u({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(p.result=s,u(p)))}catch(d){p&&(p.error=c(d),u(p))}}function a(a){if(!(a.source!==q&&"undefined"!==typeof window)){a="string"!==typeof a.data?a.data:JSON.parse(a.data);try{if(a.method){var b=a.method,c=a.params||[];if("serviceId"in a){var e=x[a.serviceId];e||r(a.id,"service not found");e=e.implementation;b in e?w(a.id,e,e[b],c):r(a.id,"method not found")}else if("objectId"in a){var p=v[a.objectId];p||r(a.id,"object not found");!b in
p?w(a.id,p,p[b],c):r(a.id,"method not found")}else if("requestId"in a){var s=t[a.requestId];s&&"cancel"===b&&s.cancel&&s.cancel.apply(s,c)}else if("responseId"in a){var g=y[a.responseId];g&&"progress"===b&&g.progress&&g.progress.apply(g,c)}else throw Error("Bad method: "+a.method);}else{var d=y[String(a.id)];delete y[String(a.id)];a.error?d.reject(a.error):d.resolve(a.result)}}catch(n){console.log("Plugin._messageHandler "+n)}}}var n=m,e=!1,q=null,g=0,B=0,z=0,t={},y={},v={},x={},u=h;this.updateHeaders=
function(a){if(e)throw Error("Cannot update headers. Plugin Provider is connected");n=a};this.registerServiceProvider=this.registerService=function(a,b,c){if(e)throw Error("Cannot register service. Plugin Provider is connected");"string"===typeof a?a=[a]:Array.isArray(a)||(a=[]);var g=null,p=[];for(g in b)"function"===typeof b[g]&&p.push(g);x[z++]={names:a,methods:p,implementation:b,properties:c||{},listeners:{}}};this.connect=function(b,c){if(!e){if("undefined"===typeof window)q=self;else if(window!==
window.parent)q=window.parent;else if(null!==window.opener)q=window.opener;else{c&&c("No valid plugin target");return}addEventListener("message",a,!1);var g={method:"plugin",params:[l()]};h(g);e=!0}b&&b()};this.disconnect=function(){e&&(removeEventListener("message",a),q=null,e=!1)}}});
define("orion/xhr",["orion/Deferred"],function(d){function f(d,h,l,b){var c="undefined"!==typeof l.response?l.response:l.responseText,k;try{k=l.status}catch(r){k=0}d={args:h,response:c,responseText:"string"===typeof c?c:null,status:k,url:d,xhr:l};"undefined"!==typeof b&&(d.error=b);return d}return function(m,h,l){l=l||{};var b=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,c=new d,k=l.headers||{},r=l.log||!1,w;"undefined"===typeof k["X-Requested-With"]&&(k["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof l.data&&("POST"===m||"PUT"===m))w=l.data;var a=!1,n=!1;c.promise.then(void 0,function(c){a=!0;!n&&c instanceof Error&&"Cancel"===c.name&&b.abort()});b.onabort=function(){n=!0;if(!a){var b=Error("Cancel");b.name="Cancel";c.reject(b)}};b.onload=function(){var a=f(h,l,b);200<=b.status&&400>b.status?c.resolve(a):(c.reject(a),r&&"undefined"!==typeof console&&console.log(Error(b.statusText)))};b.onerror=function(){var a=f(h,l,b);c.reject(a);r&&"undefined"!==typeof console&&console.log(Error(b.statusText))};
b.onprogress=function(a){a.xhr=b;c.progress(a)};try{b.open(m,h,!0);"string"===typeof l.responseType&&(b.responseType=l.responseType);if("number"===typeof l.timeout)if("number"===typeof b.timeout)b.timeout=l.timeout,b.addEventListener("timeout",function(a){c.reject(f(h,l,b,"Timeout exceeded"))});else{var e=setTimeout(function(){c.reject(f(h,l,b,"Timeout exceeded"))},l.timeout);c.promise.then(clearTimeout.bind(null,e),clearTimeout.bind(null,e))}Object.keys(k).forEach(function(a){b.setRequestHeader(a,
k[a])});b.send(w||null)}catch(q){c.reject(f(h,l,b,q))}return c.promise}});
define("orion/URITemplate",[],function(){function d(a){this._text=a}function f(a){return a.replace("%25","%")}function m(a,b){if("U"===b)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(w,f);if("U+R-,"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function h(a,b,c){for(var d=
[],g=0;g<a.length;g++)"undefined"!==typeof a[g]&&d.push(m(a[g],b));return d.join(c)}function l(a,b,c,d){for(var g=Object.keys(a),k=[],h=0;h<g.length;h++)"undefined"!==typeof a[g[h]]&&k.push(m(g[h],b)+c+m(a[g[h]],b));return k.join(d)}function b(a){if(0===a.length)throw Error("Invalid Expression: 0 length expression");(this._operator=k[a[0]])?a=a.substring(1):this._operator=k.NUL;for(var b=[],c=a.split(","),d=0;d<c.length;d++){var g=c[d].match(r);if(null===g)throw Error("Bad VarSpec: "+a);b.push({name:g[1],
explode:!!g[2],prefix:g[3]?parseInt(g[3],10):-1})}this._varSpecList=b}function c(a){for(var c=[],e=0,k=a.indexOf("{",e);-1!==k;){c.push(new d(a.substring(e,k)));e=a.indexOf("}",k+1);if(-1===e)throw Error("Invalid template: "+a);c.push(new b(a.substring(k+1,e)));e+=1;k=a.indexOf("{",e)}c.push(new d(a.substring(e)));this._templateComponents=c}var k={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},r=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,w=/%25[0-9A-F][0-9A-F]/g;d.prototype={expand:function(a){return encodeURI(this._text)}};
b.prototype={expand:function(a){for(var b=[],c=0;c<this._varSpecList.length;c++){var d=this._varSpecList[c],g=d.name,k=a[g],r=typeof k;if("undefined"!==r&&null!==k){var f=0===b.length?this._operator.first:this._operator.sep;if("string"===r)this._operator.named&&(f+=m(g,"U+R"),f+=0===k.length?this._operator.ifemp:"\x3d"),-1!==d.prefix&&d.prefix<k.length&&(k=k.substring(0,d.prefix)),f+=m(k,this._operator.allow);else if(Array.isArray(k)){if(0===k.length)continue;d.explode?f+=h(k,this._operator.allow,
this._operator.sep):(d=h(k,this._operator.allow,","),this._operator.named&&(f+=m(g,"U+R"),f+=0===d.length?this._operator.ifemp:"\x3d"),f+=d)}else if("object"===r){if(0===Object.keys(k).length)continue;d.explode?f+=l(k,this._operator.allow,"\x3d",this._operator.sep):(d=l(k,this._operator.allow,",",","),this._operator.named&&(f+=m(g,"U+R"),f+=0===d.length?this._operator.ifemp:"\x3d"),f+=d)}else throw Error("bad param type: "+g+" : "+r);b.push(f)}}return b.join("")}};c.prototype={expand:function(a){for(var b=
[],c=0;c<this._templateComponents.length;c++)b.push(this._templateComponents[c].expand(a));return b.join("")}};return c});
(function(){function d(a){if("string"!==typeof a)throw new TypeError;}function f(a){return a?a.split("\x26"):[]}function m(a){return 0===a.length?"":a.join("\x26")}function h(a){var b=/([^=]*)(?:=?)(.*)/.exec(a);a=b[1]?decodeURIComponent(b[1]):"";b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function l(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="\x3d"+encodeURIComponent(a[1]));return b}function b(a,b){var c="",d=[],k=0;return{next:function(){c!==a.query&&(c=a.query,d=f(c));if(k<d.length){var e=
h(d[k++]);switch(b){case "keys":return e[0];case "values":return e[1];case "keys+values":return[e[0],e[1]];default:throw new TypeError;}}throw C;}}}function c(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function k(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function r(a){var b=[];a.split("/").forEach(function(a){".."===a?b.pop():"."!==a&&b.push(a)});return b.join("/")}function w(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function a(a,b){if("string"!==
typeof a)throw new TypeError;a=w(a);var c=g.exec(a);if(!c)return null;var d={};d.scheme=c[1]||"";if(d.scheme&&!z.test(d.scheme))return null;var e=c[2];if(e&&(e=B.exec(e),d.userinfo=e[1],d.host=e[2],d.port=e[3],d.port&&!t.test(d.port)))return null;d.path=c[3];d.query=c[4];d.fragment=c[5];!d.scheme&&b&&(d.scheme=b.scheme,!d.host&&b.host&&(d.userinfo=b.userinfo,d.host=b.host,d.port=b.port,d.pathRelative=!0));d.pathRelative&&(d.path?"/"!==d.path[0]&&(c=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",d.path=c+d.path):
d.path=b.path);d.scheme&&(d.scheme=d.scheme.toLowerCase());d.port&&(d.port=k(d.port));d.host&&d.path&&(d.path=r(d.path));return d}function n(b,d){var e;if(d){d=d.href||d;e=a(d);if(!e||!e.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:e})}e=a(b,e);if(!e)throw new SyntaxError;Object.defineProperty(this,"_input",{value:b,writable:!0});Object.defineProperty(this,"_url",{value:e,writable:!0});var k=new c(this);Object.defineProperty(this,"query",{get:function(){return this._url?
k:null},enumerable:!0})}try{var e;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(e=new window.URL("http://www.w3.org?q")).protocol&&e.query)return}catch(q){}var g=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,B=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,z=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,t=/^\d*$/,y=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,v=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,x=/^([^?#\s]*)$/,u=/^([^\s]*)$/,D=/^\S*$/,A=/([^:]*):?(.*)/,C="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),E={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(c.prototype,{get:{value:function(a){d(a);var b;f(this._url.query).some(function(c){c=h(c);if(c[0]===a)return b=c[1],!0});return b},enumerable:!0},set:{value:function(a,b){d(a);d(b);var c=f(this._url.query);c.some(function(d,e){var k=h(d);if(k[0]===a)return k[1]=b,c[e]=l(k),!0})||c.push(l([a,b]));this._url.query=m(c)},enumerable:!0},has:{value:function(a){d(a);
return f(this._url.query).some(function(b){if(h(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){d(a);var b=f(this._url.query),c=b.filter(function(b){return h(b)[0]!==a});return c.length!==b.length?(this._url.query=m(c),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,c){if("function"!==typeof a)throw new TypeError;var d=b(this._url,"keys+values");try{for(;;){var e=d.next();a.call(c,e[1],e[0],this)}}catch(k){if(k!==C)throw k;
}},enumerable:!0},keys:{value:function(){return b(this._url,"keys")},enumerable:!0},values:{value:function(){return b(this._url,"values")},enumerable:!0},items:{value:function(){return b(this._url,"keys+values")}},size:{get:function(){return f(this._url.query).length},enumerable:!0},getAll:{value:function(a){d(a);var b=[];f(this._url.query).forEach(function(c){c=h(c);c[0]===a&&b.push(c[1])});return b},enumerable:!0},append:{value:function(a,b){d(a);d(b);var c=f(this._url.query);c.push(l([a,b]));this._url.query=
m(c)},enumerable:!0}});Object.defineProperties(n.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(b){d(b);this._input=b;this._url=a(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){d(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||z.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){d(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){d(a);if(this._url){var b=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){d(a);if(this._url){var b=[A.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){d(a);if(this._url&&(a=v.exec(a)))this._url.host=a[1],this._url.port=k(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){d(a);this._url&&y.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===E[this.protocol]&&(a="");return a},set:function(a){d(a);this._url&&t.exec(a)&&(this._url.port=k(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){d(a);
this._url&&x.exec(a)&&(this._url.host&&a&&"/"!==a[0]&&(a="/"+a),this._url.path=a?r(a):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){d(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),u.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){d(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),D.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((e=window.URL||window.webkitURL)&&e.createObjectURL)Object.defineProperty(n,"createObjectURL",{value:e.createObjectURL.bind(e),enumerable:!1}),Object.defineProperty(n,"revokeObjectURL",{value:e.revokeObjectURL.bind(e),enumerable:!1});window.URL=n})();define("orion/URL-shim",[],function(){});
define("plugins/filePlugin/GerritFileImpl",["orion/Deferred","orion/xhr","orion/URITemplate","orion/URL-shim"],function(d,f,m){function h(b,c){this._listTemplate=new m(b+"/list{/project,ref,path:0}{+path}");this._contentTemplate=new m(b+"/contents{/project,ref,path:0}{+path}");this._repoURL=this._listTemplate.expand({project:c})}var l=/.*\/(?:contents|list)\/([^\/]*)(?:\/([^\/]*)(?:\/(.*))?)?/;h.prototype={_getParents:function(b){var c=(new URL(b)).pathname.match(l);b=c[1]?decodeURIComponent(c[1]):
c[1];var d=c[2]?decodeURIComponent(c[2]):c[2],f=c[3]?decodeURIComponent(c[3]):c[3];if(!d)return null;c=[];if(!f)return c;f=f.split("/");f.pop();var h=this._listTemplate.expand({project:b,ref:d});c.push({Name:d.split("/").pop(),Location:h,ChildrenLocation:h});for(var a="",n=0;n<f.length;++n){var e=f[n],a=a+e,h=this._listTemplate.expand({project:b,ref:d,path:a});c.push({Name:e,Location:h,ChildrenLocation:h});a+="/"}return c.reverse()},fetchChildren:function(b){var c=this;return f("GET",b,{headers:this._headers,
timeout:15E3}).then(function(b){return JSON.parse(b.response).map(function(b){var d="file"===b.type?c._contentTemplate:c._listTemplate,a=b.name.split("/").pop(),d=d.expand(b),a={Attributes:{Archive:!1,Hidden:!1,ReadOnly:!0,SymLink:!1},Location:d,Name:a,Length:b.size,LocalTimeStamp:0,Directory:!1};"file"!==b.type&&(a.Directory=!0,a.ChildrenLocation=d);return a})})},loadWorkspaces:function(){return this.loadWorkspace(this._repoURL)},loadWorkspace:function(b){var c=this,d=(new URL(b)).pathname.match(l),
f=d[2]?decodeURIComponent(d[2]):d[2],h=d[3]?decodeURIComponent(d[3]):d[3];return this.fetchChildren(b).then(function(a){a={Attributes:{Archive:!1,Hidden:!1,ReadOnly:!0,SymLink:!1},Location:b,Name:null,Length:0,LocalTimeStamp:0,Directory:!0,ChildrenLocation:b,Children:a};f?h?(a.Name=h.split("/").pop(),a.Parents=c._getParents(b)):(a.Name=f,a.Parents=[]):(a.Name="repo_root",a.Location=b,a.ChildrenLocation=b);return a})},createProject:function(b,c,d,f){throw"Not supported";},createFolder:function(b,c){throw"Not supported";
},createFile:function(b,c){throw"Not supported";},deleteFile:function(b){throw"Not supported";},moveFile:function(b,c,d){throw"Not supported";},copyFile:function(b,c,d){throw"Not supported";},read:function(b,c){if(c){var d=this,h=(new URL(b)).pathname.match(l),m=h[2]?decodeURIComponent(h[2]):h[2],h=h[3]?decodeURIComponent(h[3]):h[3];if(!m||!h)return{Attributes:{Archive:!1,Hidden:!1,ReadOnly:!0,SymLink:!1},Name:m||"",Location:b,Length:0,LocalTimeStamp:0,Parents:this._getParents(b),Directory:!0,ChildrenLocation:b};
m=this._getParents(b);return this.fetchChildren(m[0].Location).then(function(a){var c;a.some(function(a){if(a.Location===b)return c=a,c.Parents=d._getParents(b),!0});return c})}return f("GET",b,{timeout:15E3}).then(function(a){return a.responseText})},write:function(b,c,d){throw"Not supported";},remoteImport:function(b,c){throw"Not supported";},remoteExport:function(b,c){throw"Not supported";},readBlob:function(b){return f("GET",b,{responseType:"arraybuffer",timeout:15E3}).then(function(b){return b.response})},
writeBlob:function(b,c,d){throw"Not supported";}};return h.prototype.constructor=h});
define("built-GerritFilePlugin.js",["orion/plugin","orion/Deferred","plugins/filePlugin/GerritFileImpl","orion/URL-shim"],function(d,f,m){d=new d({name:"Gerrit File Plugin",version:"1.0",description:"Gerrit File Plugin"});var h=new URL(window.location.href);f=h.query.get("project");h=new URL("../..",h);h.search="";m=new m(h.href,f);d.registerService("orion.core.file",m,{Name:"Gerrit File contents",top:m._repoURL,pattern:h.href.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")});d.connect()});
//@ sourceMappingURL=built-GerritFilePlugin.js.map