/*! For license information please see vault.a5a1c49ab66115f4fbb2.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.swh=t():(e.swh=e.swh||{},e.swh.vault=t())}(self,(function(){return function(){var __webpack_modules__={87757:function(e,t,n){e.exports=n(35666)},80706:function(e,t,n){"use strict";n.d(t,{YQ:function(){return u},dg:function(){return f},es:function(){return h},JO:function(){return v},vE:function(){return g}});var r=n(15861),o=n(87757),a=n.n(o),i=n(83999),c=n(59537),s={position:"fixed",left:"1rem",bottom:"1rem","z-index":"100000"};function u(e,t){return l.apply(this,arguments)}function l(){return(l=(0,r.Z)(a().mark((function e(t,n){var r,o,i,u;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="directory"===t?Urls.api_1_vault_cook_flat(n):Urls.api_1_vault_cook_git_bare(n),e.next=3,fetch(r);case 3:return o=e.sent,e.next=6,o.json();case 6:"NotFoundExc"===(i=e.sent).exception||"failed"===i.status?(swh.vault.removeCookingTaskInfo([n]),$("#vault-cook-"+t+"-modal").modal("show")):"done"===i.status?$("#vault-fetch-"+t+"-modal").modal("show"):((u=$((0,c.EM)("danger","Archive cooking service is currently experiencing issues.
Please try again later.",!0))).css(s),$("body").append(u));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t){return d.apply(this,arguments)}function d(){return(d=(0,r.Z)(a().mark((function e(t,n){var r,o,i,u,l,p;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=swh.webapp.getSwhIdsContext(),n.origin=r[t].context.origin,n.path=r[t].context.path,n.browse_url=r[t].swhid_with_context_url,n.browse_url||(n.browse_url=r[t].swhid_url),(o=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks")))||(o=[]),void 0!==o.find((function(e){return e.bundle_type===n.bundle_type&&e.swhid===n.swhid}))){e.next=31;break}return i="flat"===n.bundle_type?Urls.api_1_vault_cook_flat(n.swhid):Urls.api_1_vault_cook_git_bare(n.swhid),n.email&&(i+="?email="+encodeURIComponent(n.email)),e.prev=10,e.next=13,(0,c.e_)(i);case 13:u=e.sent,(0,c.ry)(u),o.push(n),localStorage.setItem("swh-vault-cooking-tasks",JSON.stringify(o)),$("#vault-cook-directory-modal").modal("hide"),$("#vault-cook-revision-modal").modal("hide"),(l=$((0,c.EM)("success",'Archive cooking request successfully submitted.
Go to the Downloads page to get the download link once it is ready.',!0))).css(s),$("body").append(l),e.next=31;break;case 24:e.prev=24,e.t0=e.catch(10),$("#vault-cook-directory-modal").modal("hide"),$("#vault-cook-revision-modal").modal("hide"),(p=$((0,c.EM)("danger","Archive cooking request submission failed.",!0))).css(s),$("body").append(p);case 31:case"end":return e.stop()}}),e,null,[[10,24]])})))).apply(this,arguments)}function f(e){var t=$("#swh-vault-directory-email").val().trim();!t||i.G(t)?p("directory",{bundle_type:"flat",swhid:e,email:t,status:"new"}):$("#invalid-email-modal").modal("show")}function h(e){return _.apply(this,arguments)}function _(){return(_=(0,r.Z)(a().mark((function e(t){var n,r,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $("#vault-fetch-directory-modal").modal("hide"),n=Urls.api_1_vault_cook_flat(t),e.next=4,fetch(n);case 4:return r=e.sent,e.next=7,r.json();case 7:o=e.sent,swh.vault.fetchCookedObject(o.fetch_url);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){var t=$("#swh-vault-revision-email").val().trim();!t||i.G(t)?p("revision",{bundle_type:"git_bare",swhid:e,email:t,status:"new"}):$("#invalid-email-modal").modal("show")}function g(e){return w.apply(this,arguments)}function w(){return(w=(0,r.Z)(a().mark((function e(t){var n,r,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $("#vault-fetch-directory-modal").modal("hide"),n=Urls.api_1_vault_cook_git_bare(t),e.next=4,fetch(n);case 4:return r=e.sent,e.next=7,r.json();case 7:o=e.sent,swh.vault.fetchCookedObject(o.fetch_url);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},69636:function(e,t,n){"use strict";n.d(t,{H6:function(){return h},rh:function(){return v},xF:function(){return k},LY:function(){return m}});var r,o,a=n(15861),i=n(87757),c=n.n(i),s=n(59537),u=n(83943),l=n.n(u),p='
\n
\n
\n
;',d=5e3;function f(e,t){"new"===t.status?e.css("background-color","rgba(128, 128, 128, 0.5)"):"pending"===t.status?e.css("background-color","rgba(0, 0, 255, 0.5)"):"done"===t.status?e.css("background-color","#5cb85c"):"failed"===t.status&&(e.css("background-color","rgba(255, 0, 0, 0.5)"),e.css("background-image","none"));var n,r,o=(t.progress_message||t.status).split("\n",2);n=o[0],r=o.slice(1),e.text(n),r.length&&e.prop("title",r[0]),"new"===t.status||"pending"===t.status?e.addClass("progress-bar-animated"):e.removeClass("progress-bar-striped")}function h(e){return _.apply(this,arguments)}function _(){return(_=(0,a.Z)(c().mark((function e(t){var n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null,e.next=3,fetch(t);case 3:if(!e.sent.ok){e.next=8;break}$("#vault-fetch-iframe").attr("src",t),e.next=18;break;case 8:n=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks")),r=0;case 10:if(!(rDownload':O[0].innerHTML=""):((T=y.browse_url)||(T=Urls.browse_swhid(y.swhid)),j=$.parseHTML(p)[0],f($(j).find(".progress-bar"),y),g.prepend(l()({browseUrl:T,cookingTask:y,progressBar:j,Urls:Urls,swh:swh})));localStorage.setItem("swh-vault-cooking-tasks",JSON.stringify(t)),r=setTimeout(w,d),e.next=55;break;case 52:e.prev=52,e.t0=e.catch(37),console.log("Error when fetching vault cooking tasks:",e.t0);case 55:case"end":return e.stop()}}),e,null,[[37,52]])})))).apply(this,arguments)}function k(e){var t=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks"));t&&(t=$.grep(t,(function(t){return-1===$.inArray(t.swhid,e)})),localStorage.setItem("swh-vault-cooking-tasks",JSON.stringify(t)))}function m(){$("#vault-tasks-toggle-selection").change((function(e){$(".vault-task-toggle-selection").prop("checked",e.currentTarget.checked)})),$("#vault-remove-tasks").click((function(){clearTimeout(r);var e=[];$(".swh-vault-table tbody tr").each((function(t,n){if($(n).find(".vault-task-toggle-selection").prop("checked")){var r=$(n).find(".vault-object-info").data("swhid");e.push(r),$(n).remove()}})),k(e),$("#vault-tasks-toggle-selection").prop("checked",!1),r=setTimeout(w,d)})),w(),window.onfocus=function(){clearTimeout(r),w()}}},59537:function(e,t,n){"use strict";n.d(t,{ry:function(){return o},un:function(){return a},e_:function(){return i},EM:function(){return c}});n(87757);var r=n(31955);function o(e){if(!e.ok)throw e;return e}function a(e){for(var t=0;t'+t+r+""}},83943:function(module){module.exports=function anonymous(locals,escapeFn,include,rethrow){escapeFn=escapeFn||function(e){return null==e?"":String(e).replace(_MATCH_HTML,encode_char)};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>'"]/g;function encode_char(e){return _ENCODE_HTML_RULES[e]||e}var __output="";function __append(e){null!=e&&(__output+=e)}with(locals||{})__append("\n\n"),cookingTask.swhid.match(/^swh:1:dir:.*/)?(__append('\n \n')):(__append('\n \n')),__append('\n \n
\n \n \n
\n '),cookingTask.origin?(__append('\n \n \n '),__append(escapeFn(decodeURIComponent(cookingTask.origin))),__append("\n \n \n ")):__append('\n unknown\n '),__append('\n \n \n '),__append(escapeFn(cookingTask.bundle_type)),__append('\n \n \n id: '),__append(escapeFn(cookingTask.swhid)),__append("\n "),cookingTask.path&&(__append("\n
path: "),__append(escapeFn(cookingTask.path)),__append("\n ")),__append("\n \n "),__append(progressBar.outerHTML),__append('\n \n '),"done"===cookingTask.status&&(__append('\n \n ')),__append("\n \n \n");return __output}},83999:function(e,t){"use strict";var n=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;t.G=function(e){if(!e)return!1;if(e.length>254)return!1;if(!n.test(e))return!1;var t=e.split("@");return!(t[0].length>64)&&!t[1].split(".").some((function(e){return e.length>63}))}},35666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),i=new L(r||[]);return a._invoke=function(e,t,n){var r=p;return function(o,a){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw a;return E()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=j(i,n);if(c){if(c===_)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var s=l(e,t,n);if("normal"===s.type){if(r=n.done?h:d,s.arg===_)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p="suspendedStart",d="suspendedYield",f="executing",h="completed",_={};function v(){}function g(){}function w(){}var b={};b[a]=function(){return this};var k=Object.getPrototypeOf,m=k&&k(k(S([])));m&&m!==n&&r.call(m,a)&&(b=m);var y=w.prototype=v.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(o,a,i,c){var s=l(e[o],e,a);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(p).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(s.arg)}var o;this._invoke=function(e,r){function a(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(a,a):a()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return _;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,_;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,_):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,_)}function $(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach($,this),this.reset(!0)}function S(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),_}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},15861:function(e,t,n){"use strict";function r(e,t,n,r,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function c(e){r(i,o,a,c,s,"next",e)}function s(e){r(i,o,a,c,s,"throw",e)}c(void 0)}))}}n.d(t,{Z:function(){return o}})},31955:function(e,t){"use strict";function n(e){for(var t=1;t