diff --git a/dist/assets/index-5fda80ff.js b/dist/assets/index-8c8accf7.js
similarity index 60%
rename from dist/assets/index-5fda80ff.js
rename to dist/assets/index-8c8accf7.js
index 86000a2..127142b 100644
--- a/dist/assets/index-5fda80ff.js
+++ b/dist/assets/index-8c8accf7.js
@@ -1,4 +1,4 @@
-var Rp=Object.defineProperty;var zp=(e,t,n)=>t in e?Rp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L=(e,t,n)=>(zp(e,typeof t!="symbol"?t+"":t,n),n),Ip=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ao=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var Ei=(e,t,n)=>(Ip(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Fp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sf={exports:{}},Ul={},Ef={exports:{}},D={};/**
+var Tp=Object.defineProperty;var Lp=(e,t,n)=>t in e?Tp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var T=(e,t,n)=>(Lp(e,typeof t!="symbol"?t+"":t,n),n),zp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var so=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var Ei=(e,t,n)=>(zp(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Ip(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xf={exports:{}},Ol={},Sf={exports:{}},D={};/**
* @license React
* react.production.min.js
*
@@ -6,7 +6,7 @@ var Rp=Object.defineProperty;var zp=(e,t,n)=>t in e?Rp(e,t,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var hi=Symbol.for("react.element"),Ap=Symbol.for("react.portal"),Zp=Symbol.for("react.fragment"),Pp=Symbol.for("react.strict_mode"),Dp=Symbol.for("react.profiler"),Op=Symbol.for("react.provider"),Up=Symbol.for("react.context"),jp=Symbol.for("react.forward_ref"),Gp=Symbol.for("react.suspense"),Vp=Symbol.for("react.memo"),Mp=Symbol.for("react.lazy"),du=Symbol.iterator;function Wp(e){return e===null||typeof e!="object"?null:(e=du&&e[du]||e["@@iterator"],typeof e=="function"?e:null)}var bf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cf=Object.assign,Nf={};function lr(e,t,n){this.props=e,this.context=t,this.refs=Nf,this.updater=n||bf}lr.prototype.isReactComponent={};lr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};lr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Tf(){}Tf.prototype=lr.prototype;function aa(e,t,n){this.props=e,this.context=t,this.refs=Nf,this.updater=n||bf}var ua=aa.prototype=new Tf;ua.constructor=aa;Cf(ua,lr.prototype);ua.isPureReactComponent=!0;var hu=Array.isArray,Lf=Object.prototype.hasOwnProperty,ca={current:null},Rf={key:!0,ref:!0,__self:!0,__source:!0};function zf(e,t,n){var r,i={},l=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(l=""+t.key),t)Lf.call(t,r)&&!Rf.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1t in e?Rp(e,t,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Kp=jl,Qp=Symbol.for("react.element"),Jp=Symbol.for("react.fragment"),qp=Object.prototype.hasOwnProperty,em=Kp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tm={key:!0,ref:!0,__self:!0,__source:!0};function If(e,t,n){var r,i={},l=null,o=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)qp.call(t,r)&&!tm.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Qp,type:e,key:l,ref:o,props:i,_owner:em.current}}Ul.Fragment=Jp;Ul.jsx=If;Ul.jsxs=If;Sf.exports=Ul;var _=Sf.exports,rs={},Ff={exports:{}},Pe={},Af={exports:{}},Zf={};/**
+ */var Yp=Ul,Kp=Symbol.for("react.element"),Qp=Symbol.for("react.fragment"),Jp=Object.prototype.hasOwnProperty,qp=Yp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,em={key:!0,ref:!0,__self:!0,__source:!0};function zf(e,t,n){var r,i={},l=null,o=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Jp.call(t,r)&&!em.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Kp,type:e,key:l,ref:o,props:i,_owner:qp.current}}Ol.Fragment=Qp;Ol.jsx=zf;Ol.jsxs=zf;xf.exports=Ol;var _=xf.exports,rs={},If={exports:{}},Pe={},Ff={exports:{}},Zf={};/**
* @license React
* scheduler.production.min.js
*
@@ -22,7 +22,7 @@ var Rp=Object.defineProperty;var zp=(e,t,n)=>t in e?Rp(e,t,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */(function(e){function t(z,Z){var P=z.length;z.push(Z);e:for(;0
>>1,le=z[q];if(0>>1;q >>1,le=z[q];if(0>>1;q An error occurred: An error occurred:>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ft;break;case Xc:for(;c<32;){if(s===0)break e;s--,a+=r[l++]<>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ft;break;case Xc:for(;c<32;){if(s===0)break e;s--,a+=r[l++]<
`:"'+(r?t:ze(t,!0))+`
`}blockquote(t){return`"+(r?t:ze(t,!0))+`
@@ -78,9 +78,9 @@ ${t}
`}tablerow(t){return`
${t}
`}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`${r}>
-`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}
`}br(){return"
"}del(t){return`${t}`}link(t,n,r){const i=uf(t);if(i===null)return r;t=i;let l='"+r+"",l}image(t,n,r){const i=uf(t);if(i===null)return r;t=i;let l=`",l}text(t){return t}}class cu{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class ot{constructor(t){L(this,"options");L(this,"renderer");L(this,"textRenderer");this.options=t||En,this.options.renderer=this.options.renderer||new Dl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new cu}static parse(t,n){return new ot(n).parse(t)}static parseInline(t,n){return new ot(n).parseInline(t)}parse(t,n=!0){let r="";for(let i=0;i"+ze(r.message+"",!0)+"
";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}};const _n=new dv;function V(e,t){return _n.parse(e,t)}V.options=V.setOptions=function(e){return _n.setOptions(e),V.defaults=_n.defaults,yp(V.defaults),V};V.getDefaults=uu;V.defaults=En;V.use=function(...e){return _n.use(...e),V.defaults=_n.defaults,yp(V.defaults),V};V.walkTokens=function(e,t){return _n.walkTokens(e,t)};V.parseInline=_n.parseInline;V.Parser=ot;V.parser=ot.parse;V.Renderer=Dl;V.TextRenderer=cu;V.Lexer=lt;V.lexer=lt.lex;V.Tokenizer=Pl;V.Hooks=jr;V.parse=V;V.options;V.setOptions;V.use;V.walkTokens;V.parseInline;ot.parse;lt.lex;const kp=Symbol("Comlink.proxy"),hv=Symbol("Comlink.endpoint"),pv=Symbol("Comlink.releaseProxy"),oa=Symbol("Comlink.thrown"),xp=e=>typeof e=="object"&&e!==null||typeof e=="function",mv={canHandle:e=>xp(e)&&e[kp],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Ep(e,t),[n,[n]]},deserialize(e){return e.start(),Cp(e)}},gv={canHandle:e=>xp(e)&&oa in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},Sp=new Map([["proxy",mv],["throw",gv]]);function Ep(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;const{id:i,type:l,path:o}=Object.assign({path:[]},r.data),s=(r.data.argumentList||[]).map(tn);let u;try{const a=o.slice(0,-1).reduce((g,f)=>g[f],e),c=o.reduce((g,f)=>g[f],e);switch(l){case"GET":u=c;break;case"SET":a[o.slice(-1)[0]]=tn(r.data.value),u=!0;break;case"APPLY":u=c.apply(a,s);break;case"CONSTRUCT":{const g=new c(...s);u=wv(g)}break;case"ENDPOINT":{const{port1:g,port2:f}=new MessageChannel;Ep(e,f),u=_v(g,[g])}break;case"RELEASE":u=void 0;break;default:return}}catch(a){u={value:a,[oa]:0}}Promise.resolve(u).catch(a=>({value:a,[oa]:0})).then(a=>{const[c,g]=fu(a);t.postMessage(Object.assign(Object.assign({},c),{id:i}),g),l==="RELEASE"&&(t.removeEventListener("message",n),bp(t))})}),t.start&&t.start()}function yv(e){return e.constructor.name==="MessagePort"}function bp(e){yv(e)&&e.close()}function Cp(e,t){return sa(e,[],t)}function $i(e){if(e)throw new Error("Proxy has been released and is not useable")}function sa(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(l,o){if($i(r),o===pv)return()=>Ln(e,{type:"RELEASE",path:t.map(s=>s.toString())}).then(()=>{bp(e),r=!0});if(o==="then"){if(t.length===0)return{then:()=>i};const s=Ln(e,{type:"GET",path:t.map(u=>u.toString())}).then(tn);return s.then.bind(s)}return sa(e,[...t,o])},set(l,o,s){$i(r);const[u,a]=fu(s);return Ln(e,{type:"SET",path:[...t,o].map(c=>c.toString()),value:u},a).then(tn)},apply(l,o,s){$i(r);const u=t[t.length-1];if(u===hv)return Ln(e,{type:"ENDPOINT"}).then(tn);if(u==="bind")return sa(e,t.slice(0,-1));const[a,c]=df(s);return Ln(e,{type:"APPLY",path:t.map(g=>g.toString()),argumentList:a},c).then(tn)},construct(l,o){$i(r);const[s,u]=df(o);return Ln(e,{type:"CONSTRUCT",path:t.map(a=>a.toString()),argumentList:s},u).then(tn)}});return i}function vv(e){return Array.prototype.concat.apply([],e)}function df(e){const t=e.map(fu);return[t.map(n=>n[0]),vv(t.map(n=>n[1]))]}const Np=new WeakMap;function _v(e,t){return Np.set(e,t),e}function wv(e){return Object.assign(e,{[kp]:!0})}function fu(e){for(const[t,n]of Sp)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},Np.get(e)||[]]}function tn(e){switch(e.type){case"HANDLER":return Sp.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Ln(e,t,n){return new Promise(r=>{const i=kv();e.addEventListener("message",function l(o){!o.data||!o.data.id||o.data.id!==i||(e.removeEventListener("message",l),r(o.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}function kv(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const Tp="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0ICQ9U3ltYm9sKCJDb21saW5rLnByb3h5IiksQT1TeW1ib2woIkNvbWxpbmsuZW5kcG9pbnQiKSxSPVN5bWJvbCgiQ29tbGluay5yZWxlYXNlUHJveHkiKSx5PVN5bWJvbCgiQ29tbGluay50aHJvd24iKSxfPWU9PnR5cGVvZiBlPT0ib2JqZWN0IiYmZSE9PW51bGx8fHR5cGVvZiBlPT0iZnVuY3Rpb24iLEw9e2NhbkhhbmRsZTplPT5fKGUpJiZlWyRdLHNlcmlhbGl6ZShlKXtjb25zdHtwb3J0MTpyLHBvcnQyOml9PW5ldyBNZXNzYWdlQ2hhbm5lbDtyZXR1cm4gdyhlLHIpLFtpLFtpXV19LGRlc2VyaWFsaXplKGUpe3JldHVybiBlLnN0YXJ0KCksQyhlKX19LE89e2NhbkhhbmRsZTplPT5fKGUpJiZ5IGluIGUsc2VyaWFsaXplKHt2YWx1ZTplfSl7bGV0IHI7cmV0dXJuIGUgaW5zdGFuY2VvZiBFcnJvcj9yPXtpc0Vycm9yOiEwLHZhbHVlOnttZXNzYWdlOmUubWVzc2FnZSxuYW1lOmUubmFtZSxzdGFj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W5hbHl6ZVBhdGgobykuZXhpc3RzfHwodC5fbG9nKGBNb3VudGluZyAke3N9IG9udG8gJHt0LmJhc2UudG9vbH0gZmlsZXN5c3RlbSBhdCAke299YCksZS5ta2RpcihvKSxlLm1vdW50KHQuYmFzZS5tb2R1bGUuUFJPWFlGUyx7cm9vdDpzLGZzOml9LG8pKX19LF9maWxlb3AoZSxyKXt0Ll9sb2coYFJ1bm5pbmcgJHtlfSAke3J9YCk7Y29uc3QgaT10LmZzLmFuYWx5emVQYXRoKHIpO2lmKCFpLmV4aXN0cylyZXR1cm4gdC5fbG9nKGBGaWxlICR7cn0gbm90IGZvdW5kLmApLCExO3N3aXRjaChlKXtjYXNlImNhdCI6cmV0dXJuIHQuZnMucmVhZEZpbGUocix7ZW5jb2Rpbmc6InV0ZjgifSk7Y2FzZSJscyI6cmV0dXJuIHQuZnMuaXNGaWxlKGkub2JqZWN0Lm1vZGUpP3QuZnMuc3RhdChyKTp0LmZzLnJlYWRkaXIocik7Y2FzZSJkb3dubG9hZCI6Y29uc3Qgcz1uZXcgQmxvYihbdGhpcy5jYXQocildKTtyZXR1cm4gVVJMLmNyZWF0ZU9iamVjdFVSTChzKX1yZXR1cm4hMX0sX2xvZyhlKXtpZighdC5jb25maWcuZGVidWcpcmV0dXJuO2xldCByPVsuLi5hcmd1bWVudHNdO3Iuc2hpZnQoKSxjb25zb2xlLmxvZyhgJWNbV2ViV29ya2VyXSVjICR7ZX1gLCJmb250LXdlaWdodDpib2xkIiwiIiwuLi5yKX19O3codCl9KSgpOwo=",hf=typeof window<"u"&&window.Blob&&new Blob([atob(Tp)],{type:"text/javascript;charset=utf-8"});function xv(){const e=hf&&(window.URL||window.webkitURL).createObjectURL(hf);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+Tp)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const Sv="https://biowasm.com/cdn/v3",Ev="https://stg.biowasm.com/cdn/v3",bv={urlCDN:Sv,urlCDNStg:Ev,dirShared:"/shared",dirMounted:"/mnt",dirData:"/data",printInterleaved:!0,callback:null,debug:!1,env:"prd"};class Cv{constructor(t,n={}){if(t==null)throw"Expecting array of tools as input to Aioli constructor.";return Array.isArray(t)||(t=[t]),n=Object.assign({},bv,n),t=t.map(this._parseTool),n.env==="stg"&&(n.urlCDN=n.urlCDNStg),this.tools=t,this.config=n,this.config.callback!=null&&(this.callback=this.config.callback),delete this.config.callback,this.init()}async init(){const t=new xv;this.callback&&(t.onmessage=r=>{r.data.type==="biowasm"&&this.callback(r.data.value)});const n=Cp(t);return n.tools=this.tools,n.config=this.config,await n.init(),n}_parseTool(t){if(typeof t!="string")return t;const n=t.split("/");if(n.length!=2&&n.length!=3)throw"Expecting 'ViralWasm-Consensus Offline
-`,He="/shared/data/",Lp="output-text",vf="data/NC_045512.2.fas",Bi=He+"ref.fas",_f="data/example.bam",Iv=He+"alignments.sam",wf=He+"alignments.bam",Fv=He+"primers.txt",Qo=He+"temp.fastq.gz",Jo=He+"temp-trimmed.fastq.gz",Av=He+"sequences.fastq.gz",qo=He+"trimmed-sequences.fastq.gz",wr=He+"reads.sam",Zv={minBaseQuality:20,minBaseQualityDefault:20,minDepth:10,minDepthDefault:10,minFreq:.5,minFreqDefault:.5,ambigSymbol:"N",ambigSymbolDefault:"N",primerOffset:0,primerOffsetDefault:0},es=He+"consensus.fa",ts=He+"positionCounts.tsv",ns=He+"insertionCounts.json",kf={fastpOpen:!1,preloadedRef:void 0,refFile:void 0,refFileValid:!0,alignmentFiles:void 0,alignmentFilesAreFASTQ:!1,alignmentFilesValid:!0,trimInput:!1,fastpCompressionLevel:9,fastpCompressionLevelValid:!0,trimFront1:0,trimFront1Valid:!0,trimTail1:0,trimTail1Valid:!0,trimPolyG:!1,trimPolyX:!1,primerFile:void 0,primerFileValid:!0,primerOffset:0,primerOffsetValid:!0,minBaseQuality:0,minBaseQualityValid:!0,minDepth:0,minDepthValid:!0,minFreq:0,minFreqValid:!0,ambigSymbol:"N",ambigSymbolValid:!0,genPosCounts:!1,genInsCounts:!1,...Zv},kr=e=>{if(e===void 0||e.length===0)return!1;for(const t of e){const n=t.name;if(!(n!==void 0&&(n.endsWith(".fastq")||n.endsWith(".fq")||n.endsWith(".fastq.gz")||n.endsWith(".fq.gz"))))return!1}return!0},Pv=e=>{if(e.byteLength<2)return!1;const t=new Uint8Array(e.slice(0,2));return t[0]===31&&t[1]===139},Rn=(e,t=0,n=Number.MAX_SAFE_INTEGER)=>e===""||e>=t&&e<=n&&e==parseInt(e),xf=()=>{const e=document.getElementById(Lp);e.value=""},te=e=>{const t=document.getElementById(Lp),n=new Date;t.value+=`${Dv(n)}: `+e+`
-`},Dv=e=>`${e.toLocaleTimeString().substring(0,7)}.${("00"+e.getMilliseconds()).slice(-3)}`;const Ov="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAG2wAABtsASmxeYsAAAWpSURBVFhHzZhPaB1VFMbfs2I1iERDSPL8szDgQnyJCGKti6QSEl0oiG40aYi7qpEQY2K7ESqFVl9TKlHBlSFNcWNAuklfEmy6sFaESni4KaQL/yUhqSZF2row8fvN3BnuTObNjHkP6Qcf99z77pz55sy9Z859mSrigPir4RsM3Ep4QrwhbhliM1YxbjNtLBoaGprEw+KYuNcM20DMna7pAHubwPX19b3imHhYbDLDsUgUKEG71ZwW3xf7xaLG9qm1scu0NgJjEsQ1RREf+DqtMXzHIk0EHxbtqN0tHpXIu9xuMiSEuUdFrvWAT3zHIo3Aa+JfrunjKbHPNVOBuVxjA5/4jkWiwJWVld/UTLq9AA4qionryKy1g24vgMna2lp8xyLVJhE+En9xTR8Pie+6ZuZv09rwxpjDXBv4wmcisqZ10NrayqJlXVxbWFgIPJ2i9ZaaT9yej6VsNptfXl6uk/2deJ8zmsn8IT69tbV1dWNjoyQ7HOl+Re9TYztYXV29X8094pX6+nr/gf0IShxOpsUfxQX1T4pc5OEL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ij50SGDh2Sqh/7JQ4/9hZNg/akDieEgHhA84JRW9I0SMt+UdJg9cVxXFFcVT2O+6QD5bOHoms2j8LvIKwOHLXcdfc9qkC3hhzwscHTovecohFokBFj9CzPsI4xtozdlkoSswhCYfRo+jafwxEIk0EWRfh9MPpa9w1U4G5XGMDn/iORRqBV0T/GCiwww8l5T8biiJzD4n233j4xHcsEgVKCDuK/1o+ENnFXRoLHA0FyqMwAmMSyTVdIj7w1a0xf7eWQ6pdnATtYmrJb0XvXEOV8ox2cXI9l4C0uzgWRsigSNqAg9UQl8lkMv8CU23b5mSxqCoAAAAASUVORK5CYII=";class Uv extends jl.Component{constructor(n){super(n);L(this,"preventNumberInputScrolling",()=>{const n=document.querySelectorAll("input[type=number]");for(const r of n)r.addEventListener("wheel",function(i){i.preventDefault()})});L(this,"fetchExampleFiles",async()=>{const n=await(await fetch(`/${vf}`)).text(),r=await(await fetch(`/${_f}`)).arrayBuffer();this.setState({exampleRefFile:n,exampleAlignmentFile:r})});L(this,"fetchRefGenomes",async()=>{const r=await(await fetch(`${window.location.origin}/${Tv}`)).json(),i=new Set;for(const l of r.tree)l.path.startsWith("ref_genomes/")&&i.add(l.path.split("/")[1]);this.setState({refGenomes:i})});L(this,"initRefGenomes",()=>{const n=setInterval(()=>{var r;if(((r=this.state.refGenomes)==null?void 0:r.size)>0){clearInterval(n);const i=[];for(const l of Object.entries(Rv)){const o=Object.entries(l[1]);for(const s of o){const u=s[0],a=s[1];i.push(_.jsx("option",{value:Lv[u],children:a},a))}}i.sort((l,o)=>l.key.localeCompare(o.key)),this.setState({preloadRefOptions:i})}},250)});L(this,"fetchOfflineInstructions",async()=>{const r=await(await fetch(`${window.location.origin}/${zv}`)).text(),i=V(r),l=i.slice(i.indexOf(yf)+yf.length);this.setState({offlineInstructions:l})});L(this,"addOfflineInstructionsListener",()=>{document.addEventListener("keydown",n=>{n.key==="Escape"&&this.hideOfflineInstructions()})});L(this,"uploadRefFile",n=>{this.setState({refFile:n.target.files[0],refFileValid:!0,inputChanged:!0})});L(this,"setPreloadedRef",n=>{this.setState({preloadedRef:n.target.value==="undefined"?void 0:n.target.value,inputChanged:!0,refFileValid:!0})});L(this,"uploadAlignmentFiles",n=>{const i=[...(this.state.alignmentFiles==="EXAMPLE_DATA"?[]:this.state.alignmentFiles)||[],...Array.from(n.target.files)];this.setState({alignmentFiles:i,alignmentFilesValid:this.validAlignmentFiles(i),inputChanged:!0,alignmentFilesAreFASTQ:kr(i)},()=>{i.length>1&&(document.getElementById("alignment-files").value=null)})});L(this,"validAlignmentFiles",n=>n===void 0||n.length===0?!1:n.length===1?!0:kr(n));L(this,"clearAlignmentFiles",()=>{this.setState({alignmentFiles:void 0,alignmentFilesValid:!0,inputChanged:!0,alignmentFilesAreFASTQ:!1}),document.getElementById("alignment-files").value=null});L(this,"deleteAlignmentFile",n=>{document.getElementById("alignment-files").value=null;const r=[...this.state.alignmentFiles];r.splice(n,1);const i=this.validAlignmentFiles(r),l=kr(r);this.setState({alignmentFiles:r,alignmentFilesValid:i,alignmentFilesAreFASTQ:l,inputChanged:!0})});L(this,"setTrimInput",n=>{this.setState({trimInput:n.target.checked,inputChanged:!0})});L(this,"setFastpCompressionLevel",n=>{let r=Rn(n.target.value,1,9);this.setState({fastpCompressionLevel:n.target.value,fastpCompressionLevelValid:r,inputChanged:!0})});L(this,"setTrimFront1",n=>{let r=Rn(n.target.value);this.setState({trimFront1:n.target.value,trimFront1Valid:r,inputChanged:!0})});L(this,"setTrimTail1",n=>{let r=Rn(n.target.value);this.setState({trimTail1:n.target.value,trimTail1Valid:r,inputChanged:!0})});L(this,"setTrimPolyG",n=>{this.setState({trimPolyG:n.target.checked,inputChanged:!0})});L(this,"setTrimPolyX",n=>{this.setState({trimPolyX:n.target.checked,inputChanged:!0})});L(this,"uploadPrimerFile",n=>{this.setState({primerFile:n.target.files[0],inputChanged:!0})});L(this,"setPrimerOffset",n=>{let r=Rn(n.target.value);this.setState({primerOffset:n.target.value,primerOffsetValid:r,inputChanged:!0})});L(this,"setMinBaseQuality",n=>{let r=Rn(n.target.value);this.setState({minBaseQuality:n.target.value,minBaseQualityValid:r,inputChanged:!0})});L(this,"setMinDepth",n=>{let r=Rn(n.target.value);this.setState({minDepth:n.target.value,minDepthValid:r,inputChanged:!0})});L(this,"setMinFreq",n=>{let r=!0;(n.target.value<0||n.target.value>1)&&(r=!1),this.setState({minFreq:n.target.value,minFreqValid:r,inputChanged:!0})});L(this,"setAmbigSymbol",n=>{let r=!0;n.target.value.length!==1&&(r=!1),this.setState({ambigSymbol:n.target.value,ambigSymbolValid:r,inputChanged:!0})});L(this,"setGenPosCounts",n=>{this.setState({genPosCounts:n.target.checked,inputChanged:!0})});L(this,"setGenInsCounts",n=>{this.setState({genInsCounts:n.target.checked,inputChanged:!0})});L(this,"toggleAdditionalArgs",(n=void 0)=>{this.setState(r=>({additionalArgsOpen:n===void 0?!r.additionalArgsOpen:n}))});L(this,"toggleFastpArguments",(n=void 0)=>{this.state.trimInput&&this.setState(r=>({fastpOpen:n===void 0?!r.fastpOpen:n}))});L(this,"toggleLoadExampleData",()=>{this.setState(n=>{var o,s;const r=n.refFile==="EXAMPLE_DATA"||n.alignmentFiles==="EXAMPLE_DATA"?(o=document.getElementById("reference-file"))==null?void 0:o.files[0]:"EXAMPLE_DATA",i=n.refFile==="EXAMPLE_DATA"||n.alignmentFiles==="EXAMPLE_DATA"?Array.from((s=document.getElementById("alignment-files"))==null?void 0:s.files):"EXAMPLE_DATA",l=i==="EXAMPLE_DATA"?!1:kr(Array.from(document.getElementById("alignment-files").files));return{refFile:r,alignmentFiles:i,alignmentFilesAreFASTQ:l,refFileValid:!0,alignmentFilesValid:!0,inputChanged:n.refFile!==r||n.alignmentFiles!==i}})});L(this,"toggleExpandContainer",n=>{this.setState(r=>({expandedContainer:r.expandedContainer===n?void 0:n}))});L(this,"promptResetInput",()=>{window.confirm("Are you sure you want to reset? All input data will be lost.")&&this.resetInput()});L(this,"resetInput",()=>{this.setState(Object.assign({},kf),()=>{const n={};for(const r of Object.keys(this.state))r.endsWith("Default")&&(n[r.slice(0,-7)]=this.state[r]);this.setState(n)}),document.getElementById("reference-file").value=null,document.getElementById("alignment-files").value=null,document.getElementById("primer-file").value=null});L(this,"validInput",()=>{let n=!0,r=!0,i=!0;return xf(),te("Validating input..."),!this.state.refFile&&!this.state.preloadedRef&&(r=!1),this.state.alignmentFiles!=="EXAMPLE_DATA"&&!this.validAlignmentFiles(this.state.alignmentFiles)&&(i=!1),n=r&&i&&this.state.primerOffsetValid&&this.state.minBaseQualityValid&&this.state.minDepthValid&&this.state.minFreqValid&&this.state.ambigSymbolValid&&this.state.trimFront1Valid&&this.state.trimTail1Valid&&this.state.fastpCompressionLevelValid,this.setState({refFileValid:r,alignmentFilesValid:i}),n});L(this,"runViralConsensus",async()=>{var m,y;if(!this.validInput()){alert("Invalid input. Please check your input and try again."),te("Invalid input. Please check your input and try again.");return}const n=performance.now();te("Starting job..."),this.setState({done:!1,timeElapsed:void 0,loading:!0,inputChanged:!1,consensusExists:!1,posCountsExists:!1,insCountsExists:!1,fastpOutputExists:!1,minimapOutputExists:!1});const r=this.state.CLI;if(r===void 0){setTimeout(()=>{this.runViralConsensus()},2e3);return}const i=Bi,l=(y=(m=this.state.alignmentFiles[0])==null?void 0:m.name)!=null&&y.endsWith(".bam")||this.state.alignmentFiles==="EXAMPLE_DATA"?wf:Iv,o=Fv;let s=`viral_consensus -i ${this.state.alignmentFilesAreFASTQ?wr:l} -r ${i} -o ${es}`;if(te("Deleting old files..."),await this.clearFiles(),te("Reading reference file..."),this.state.refFile==="EXAMPLE_DATA")await r.fs.writeFile(Bi,this.state.exampleRefFile);else if(this.state.refFile!==void 0)await r.fs.writeFile(Bi,await this.fileReaderReadFile(this.state.refFile));else{const k=await(await fetch(`/${Nv}${this.state.preloadedRef}/${this.state.preloadedRef}.fas`)).text();await r.fs.writeFile(Bi,k)}if(te("Reading input read file(s)..."),this.state.alignmentFiles==="EXAMPLE_DATA")await r.fs.writeFile(wf,new Uint8Array(this.state.exampleAlignmentFile));else{const k=await this.fileReaderReadFile(this.state.alignmentFiles[0],!0),C=this.state.alignmentFiles[0].name;if(C.endsWith(".bam")||C.endsWith(".sam"))te("Recognized alignment file as BAM/SAM, reading file..."),await r.fs.writeFile(l,new Uint8Array(k));else if(this.state.alignmentFilesAreFASTQ){te("Recognized alignment file(s) as FASTQ, reading file...");const w=this.state.trimInput?qo:Av;for(let I=0;I${t}
`}br(){return"
"}del(t){return`${t}`}link(t,n,r){const i=uf(t);if(i===null)return r;t=i;let l='"+r+"",l}image(t,n,r){const i=uf(t);if(i===null)return r;t=i;let l=`",l}text(t){return t}}class cu{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class ot{constructor(t){T(this,"options");T(this,"renderer");T(this,"textRenderer");this.options=t||En,this.options.renderer=this.options.renderer||new Pl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new cu}static parse(t,n){return new ot(n).parse(t)}static parseInline(t,n){return new ot(n).parseInline(t)}parse(t,n=!0){let r="";for(let i=0;i"+ze(r.message+"",!0)+"
";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}};const _n=new fv;function V(e,t){return _n.parse(e,t)}V.options=V.setOptions=function(e){return _n.setOptions(e),V.defaults=_n.defaults,gp(V.defaults),V};V.getDefaults=uu;V.defaults=En;V.use=function(...e){return _n.use(...e),V.defaults=_n.defaults,gp(V.defaults),V};V.walkTokens=function(e,t){return _n.walkTokens(e,t)};V.parseInline=_n.parseInline;V.Parser=ot;V.parser=ot.parse;V.Renderer=Pl;V.TextRenderer=cu;V.Lexer=lt;V.lexer=lt.lex;V.Tokenizer=Al;V.Hooks=Gr;V.parse=V;V.options;V.setOptions;V.use;V.walkTokens;V.parseInline;ot.parse;lt.lex;const wp=Symbol("Comlink.proxy"),dv=Symbol("Comlink.endpoint"),hv=Symbol("Comlink.releaseProxy"),oa=Symbol("Comlink.thrown"),kp=e=>typeof e=="object"&&e!==null||typeof e=="function",pv={canHandle:e=>kp(e)&&e[wp],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Sp(e,t),[n,[n]]},deserialize(e){return e.start(),bp(e)}},mv={canHandle:e=>kp(e)&&oa in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},xp=new Map([["proxy",pv],["throw",mv]]);function Sp(e,t=self){t.addEventListener("message",function n(r){if(!r||!r.data)return;const{id:i,type:l,path:o}=Object.assign({path:[]},r.data),s=(r.data.argumentList||[]).map(tn);let u;try{const a=o.slice(0,-1).reduce((g,f)=>g[f],e),c=o.reduce((g,f)=>g[f],e);switch(l){case"GET":u=c;break;case"SET":a[o.slice(-1)[0]]=tn(r.data.value),u=!0;break;case"APPLY":u=c.apply(a,s);break;case"CONSTRUCT":{const g=new c(...s);u=_v(g)}break;case"ENDPOINT":{const{port1:g,port2:f}=new MessageChannel;Sp(e,f),u=vv(g,[g])}break;case"RELEASE":u=void 0;break;default:return}}catch(a){u={value:a,[oa]:0}}Promise.resolve(u).catch(a=>({value:a,[oa]:0})).then(a=>{const[c,g]=fu(a);t.postMessage(Object.assign(Object.assign({},c),{id:i}),g),l==="RELEASE"&&(t.removeEventListener("message",n),Ep(t))})}),t.start&&t.start()}function gv(e){return e.constructor.name==="MessagePort"}function Ep(e){gv(e)&&e.close()}function bp(e,t){return sa(e,[],t)}function $i(e){if(e)throw new Error("Proxy has been released and is not useable")}function sa(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(l,o){if($i(r),o===hv)return()=>Tn(e,{type:"RELEASE",path:t.map(s=>s.toString())}).then(()=>{Ep(e),r=!0});if(o==="then"){if(t.length===0)return{then:()=>i};const s=Tn(e,{type:"GET",path:t.map(u=>u.toString())}).then(tn);return s.then.bind(s)}return sa(e,[...t,o])},set(l,o,s){$i(r);const[u,a]=fu(s);return Tn(e,{type:"SET",path:[...t,o].map(c=>c.toString()),value:u},a).then(tn)},apply(l,o,s){$i(r);const u=t[t.length-1];if(u===dv)return Tn(e,{type:"ENDPOINT"}).then(tn);if(u==="bind")return sa(e,t.slice(0,-1));const[a,c]=df(s);return Tn(e,{type:"APPLY",path:t.map(g=>g.toString()),argumentList:a},c).then(tn)},construct(l,o){$i(r);const[s,u]=df(o);return Tn(e,{type:"CONSTRUCT",path:t.map(a=>a.toString()),argumentList:s},u).then(tn)}});return i}function yv(e){return Array.prototype.concat.apply([],e)}function df(e){const t=e.map(fu);return[t.map(n=>n[0]),yv(t.map(n=>n[1]))]}const Cp=new WeakMap;function vv(e,t){return Cp.set(e,t),e}function _v(e){return Object.assign(e,{[wp]:!0})}function fu(e){for(const[t,n]of xp)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},Cp.get(e)||[]]}function tn(e){switch(e.type){case"HANDLER":return xp.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Tn(e,t,n){return new Promise(r=>{const i=wv();e.addEventListener("message",function l(o){!o.data||!o.data.id||o.data.id!==i||(e.removeEventListener("message",l),r(o.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}function wv(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const Np="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0ICQ9U3ltYm9sKCJDb21saW5rLnByb3h5IiksQT1TeW1ib2woIkNvbWxpbmsuZW5kcG9pbnQiKSxSPVN5bWJvbCgiQ29tbGluay5yZWxlYXNlUHJveHkiKSx5PVN5bWJvbCgiQ29tbGluay50aHJvd24iKSxfPWU9PnR5cGVvZiBlPT0ib2JqZWN0IiYmZSE9PW51bGx8fHR5cGVvZiBlPT0iZnVuY3Rpb24iLEw9e2NhbkhhbmR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d1bWVudHNdO3Iuc2hpZnQoKSxjb25zb2xlLmxvZyhgJWNbV2ViV29ya2VyXSVjICR7ZX1gLCJmb250LXdlaWdodDpib2xkIiwiIiwuLi5yKX19O3codCl9KSgpOwo=",hf=typeof window<"u"&&window.Blob&&new Blob([atob(Np)],{type:"text/javascript;charset=utf-8"});function kv(){const e=hf&&(window.URL||window.webkitURL).createObjectURL(hf);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+Np)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const xv="https://biowasm.com/cdn/v3",Sv="https://stg.biowasm.com/cdn/v3",Ev={urlCDN:xv,urlCDNStg:Sv,dirShared:"/shared",dirMounted:"/mnt",dirData:"/data",printInterleaved:!0,callback:null,debug:!1,env:"prd"};class bv{constructor(t,n={}){if(t==null)throw"Expecting array of tools as input to Aioli constructor.";return Array.isArray(t)||(t=[t]),n=Object.assign({},Ev,n),t=t.map(this._parseTool),n.env==="stg"&&(n.urlCDN=n.urlCDNStg),this.tools=t,this.config=n,this.config.callback!=null&&(this.callback=this.config.callback),delete this.config.callback,this.init()}async init(){const t=new kv;this.callback&&(t.onmessage=r=>{r.data.type==="biowasm"&&this.callback(r.data.value)});const n=bp(t);return n.tools=this.tools,n.config=this.config,await n.init(),n}_parseTool(t){if(typeof t!="string")return t;const n=t.split("/");if(n.length!=2&&n.length!=3)throw"Expecting 'ViralWasm-Consensus Offline
+`,He="/shared/data/",Rp="output-text",zv="NC_045512",Ko=He+"ref.fas",vf="data/example.bam",Iv=He+"alignments.sam",_f=He+"alignments.bam",Fv=He+"primers.txt",Qo=He+"temp.fastq.gz",Jo=He+"temp-trimmed.fastq.gz",Zv=He+"sequences.fastq.gz",qo=He+"trimmed-sequences.fastq.gz",wr=He+"reads.sam",Av={minBaseQuality:20,minBaseQualityDefault:20,minDepth:10,minDepthDefault:10,minFreq:.5,minFreqDefault:.5,ambigSymbol:"N",ambigSymbolDefault:"N",primerOffset:0,primerOffsetDefault:0},es=He+"consensus.fa",ts=He+"positionCounts.tsv",ns=He+"insertionCounts.json",wf={fastpOpen:!1,preloadedRef:void 0,refFile:void 0,refFileValid:!0,alignmentFiles:void 0,alignmentFilesAreFASTQ:!1,alignmentFilesValid:!0,trimInput:!1,fastpCompressionLevel:9,fastpCompressionLevelValid:!0,trimFront1:0,trimFront1Valid:!0,trimTail1:0,trimTail1Valid:!0,trimPolyG:!1,trimPolyX:!1,primerFile:void 0,primerFileValid:!0,primerOffset:0,primerOffsetValid:!0,minBaseQuality:0,minBaseQualityValid:!0,minDepth:0,minDepthValid:!0,minFreq:0,minFreqValid:!0,ambigSymbol:"N",ambigSymbolValid:!0,genPosCounts:!1,genInsCounts:!1,...Av},kr=e=>{if(e===void 0||e.length===0)return!1;for(const t of e){const n=t.name;if(!(n!==void 0&&(n.endsWith(".fastq")||n.endsWith(".fq")||n.endsWith(".fastq.gz")||n.endsWith(".fq.gz"))))return!1}return!0},Pv=e=>{if(e.byteLength<2)return!1;const t=new Uint8Array(e.slice(0,2));return t[0]===31&&t[1]===139},Ln=(e,t=0,n=Number.MAX_SAFE_INTEGER)=>e===""||e>=t&&e<=n&&e==parseInt(e),kf=()=>{const e=document.getElementById(Rp);e.value=""},te=e=>{const t=document.getElementById(Rp),n=new Date;t.value+=`${Dv(n)}: `+e+`
+`},Dv=e=>`${e.toLocaleTimeString().substring(0,7)}.${("00"+e.getMilliseconds()).slice(-3)}`;const Ov="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAG2wAABtsASmxeYsAAAWpSURBVFhHzZhPaB1VFMbfs2I1iERDSPL8szDgQnyJCGKti6QSEl0oiG40aYi7qpEQY2K7ESqFVl9TKlHBlSFNcWNAuklfEmy6sFaESni4KaQL/yUhqSZF2row8fvN3BnuTObNjHkP6Qcf99z77pz55sy9Z859mSrigPir4RsM3Ep4QrwhbhliM1YxbjNtLBo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z8SwOJAzbSWI8sG9uOc5PUDgSOsLlDgW6xkxfPryQMKm4q4U+LCLXhvc+4xEosUBydADa61cLUiZPqLXWxoeHqaeo2SiKpkqFAqxa3JycpIlQ2FA5Kb1CksS8JJs0syTYhhoQEuwHhSichJ/BL0ttkvcvMRRCVNsfiiyjljsPkZHR7PQdD0wh7lcc16C2yUSH/jiX4bwaRH4WnxnZtfybSS8VLVshoKEOac7iatRQ71oPzWOHlMUlySMb+uwM6rrhoaGzkoMPn8S7QKVt9He09PDGYdNQ2Q567B5iB6R6/Z2deBpJZKE6Rw7PWEeJDDy2Lm5uZnP5XLkMypxTwhrbE9jY+NVnfoij50SGDh2Sqh/7JQ4/9hZNg/akDieEgHhA84JRW9I0SMt+UdJg9cVxXFFcVT2O+6QD5bOHoms2j8LvIKwOHLXcdfc9qkC3hhzwscHTovecohFokBFj9CzPsI4xtozdlkoSswhCYfRo+jafwxEIk0EWRfh9MPpa9w1U4G5XGMDn/iORRqBV0T/GCiwww8l5T8biiJzD4n233j4xHcsEgVKCDuK/1o+ENnFXRoLHA0FyqMwAmMSyTVdIj7w1a0xf7eWQ6pdnATtYmrJb0XvXEOV8ox2cXI9l4C0uzgWRsigSNqAg9UQl8lkMv8CU23b5mSxqCoAAAAASUVORK5CYII=";class Uv extends Ul.Component{constructor(n){super(n);T(this,"preventNumberInputScrolling",()=>{const n=document.querySelectorAll("input[type=number]");for(const r of n)r.addEventListener("wheel",function(i){i.preventDefault()})});T(this,"fetchExampleFiles",async()=>{const n=await(await fetch(`/${vf}`)).arrayBuffer();this.setState({exampleAlignmentFile:n})});T(this,"fetchRefGenomes",async()=>{const r=await(await fetch(`${window.location.origin}/${Nv}`)).json(),i=new Set;for(const l of r.tree)l.path.startsWith("ref_genomes/")&&i.add(l.path.split("/")[1]);this.setState({refGenomes:i})});T(this,"initRefGenomes",()=>{const n=setInterval(()=>{var r;if(((r=this.state.refGenomes)==null?void 0:r.size)>0){clearInterval(n);const i=[];for(const l of Object.entries(Tv)){const o=Object.entries(l[1]);for(const s of o){const u=s[0],a=s[1];i.push(_.jsx("option",{value:Rv[u],children:a},a))}}i.sort((l,o)=>l.key.localeCompare(o.key)),this.setState({preloadRefOptions:i})}},250)});T(this,"fetchOfflineInstructions",async()=>{const r=await(await fetch(`${window.location.origin}/${Lv}`)).text(),i=V(r),l=i.slice(i.indexOf(yf)+yf.length);this.setState({offlineInstructions:l})});T(this,"addOfflineInstructionsListener",()=>{document.addEventListener("keydown",n=>{n.key==="Escape"&&this.hideOfflineInstructions()})});T(this,"uploadRefFile",n=>{this.setState({refFile:n.target.files[0],refFileValid:!0,inputChanged:!0})});T(this,"setPreloadedRef",n=>{this.setState({preloadedRef:n.target.value==="undefined"?void 0:n.target.value,inputChanged:!0,refFileValid:!0})});T(this,"uploadAlignmentFiles",n=>{const i=[...(this.state.alignmentFiles==="EXAMPLE_DATA"?[]:this.state.alignmentFiles)||[],...Array.from(n.target.files)];this.setState({alignmentFiles:i,alignmentFilesValid:this.validAlignmentFiles(i),inputChanged:!0,alignmentFilesAreFASTQ:kr(i)},()=>{i.length>1&&(document.getElementById("alignment-files").value=null)})});T(this,"validAlignmentFiles",n=>n===void 0||n.length===0?!1:n.length===1?!0:kr(n));T(this,"clearAlignmentFiles",()=>{this.setState({alignmentFiles:void 0,alignmentFilesValid:!0,inputChanged:!0,alignmentFilesAreFASTQ:!1}),document.getElementById("alignment-files").value=null});T(this,"deleteAlignmentFile",n=>{document.getElementById("alignment-files").value=null;const r=[...this.state.alignmentFiles];r.splice(n,1);const i=this.validAlignmentFiles(r),l=kr(r);this.setState({alignmentFiles:r,alignmentFilesValid:i,alignmentFilesAreFASTQ:l,inputChanged:!0})});T(this,"setTrimInput",n=>{this.setState({trimInput:n.target.checked,inputChanged:!0})});T(this,"setFastpCompressionLevel",n=>{let r=Ln(n.target.value,1,9);this.setState({fastpCompressionLevel:n.target.value,fastpCompressionLevelValid:r,inputChanged:!0})});T(this,"setTrimFront1",n=>{let r=Ln(n.target.value);this.setState({trimFront1:n.target.value,trimFront1Valid:r,inputChanged:!0})});T(this,"setTrimTail1",n=>{let r=Ln(n.target.value);this.setState({trimTail1:n.target.value,trimTail1Valid:r,inputChanged:!0})});T(this,"setTrimPolyG",n=>{this.setState({trimPolyG:n.target.checked,inputChanged:!0})});T(this,"setTrimPolyX",n=>{this.setState({trimPolyX:n.target.checked,inputChanged:!0})});T(this,"uploadPrimerFile",n=>{this.setState({primerFile:n.target.files[0],inputChanged:!0})});T(this,"setPrimerOffset",n=>{let r=Ln(n.target.value);this.setState({primerOffset:n.target.value,primerOffsetValid:r,inputChanged:!0})});T(this,"setMinBaseQuality",n=>{let r=Ln(n.target.value);this.setState({minBaseQuality:n.target.value,minBaseQualityValid:r,inputChanged:!0})});T(this,"setMinDepth",n=>{let r=Ln(n.target.value);this.setState({minDepth:n.target.value,minDepthValid:r,inputChanged:!0})});T(this,"setMinFreq",n=>{let r=!0;(n.target.value<0||n.target.value>1)&&(r=!1),this.setState({minFreq:n.target.value,minFreqValid:r,inputChanged:!0})});T(this,"setAmbigSymbol",n=>{let r=!0;n.target.value.length!==1&&(r=!1),this.setState({ambigSymbol:n.target.value,ambigSymbolValid:r,inputChanged:!0})});T(this,"setGenPosCounts",n=>{this.setState({genPosCounts:n.target.checked,inputChanged:!0})});T(this,"setGenInsCounts",n=>{this.setState({genInsCounts:n.target.checked,inputChanged:!0})});T(this,"toggleAdditionalArgs",(n=void 0)=>{this.setState(r=>({additionalArgsOpen:n===void 0?!r.additionalArgsOpen:n}))});T(this,"toggleFastpArguments",(n=void 0)=>{this.state.trimInput&&this.setState(r=>({fastpOpen:n===void 0?!r.fastpOpen:n}))});T(this,"toggleLoadExampleData",()=>{this.setState(n=>{var s,u;const r=n.alignmentFiles==="EXAMPLE_DATA"?this.state.preloadedRef:zv,i=n.alignmentFiles==="EXAMPLE_DATA"?(s=document.getElementById("reference-file"))==null?void 0:s.files[0]:void 0;i===void 0&&(document.getElementById("reference-file").value=null);const l=n.alignmentFiles==="EXAMPLE_DATA"?Array.from((u=document.getElementById("alignment-files"))==null?void 0:u.files):"EXAMPLE_DATA",o=l==="EXAMPLE_DATA"?!1:kr(Array.from(document.getElementById("alignment-files").files));return{preloadedRef:r,refFile:i,alignmentFiles:l,alignmentFilesAreFASTQ:o,refFileValid:!0,alignmentFilesValid:!0,inputChanged:n.refFile!==i||n.alignmentFiles!==l}})});T(this,"toggleExpandContainer",n=>{this.setState(r=>({expandedContainer:r.expandedContainer===n?void 0:n}))});T(this,"promptResetInput",()=>{window.confirm("Are you sure you want to reset? All input data will be lost.")&&this.resetInput()});T(this,"resetInput",()=>{this.setState(Object.assign({},wf),()=>{const n={};for(const r of Object.keys(this.state))r.endsWith("Default")&&(n[r.slice(0,-7)]=this.state[r]);this.setState(n)}),document.getElementById("reference-file").value=null,document.getElementById("alignment-files").value=null,document.getElementById("primer-file").value=null});T(this,"validInput",()=>{let n=!0,r=!0,i=!0;return kf(),te("Validating input..."),!this.state.refFile&&!this.state.preloadedRef&&(r=!1),this.state.alignmentFiles!=="EXAMPLE_DATA"&&!this.validAlignmentFiles(this.state.alignmentFiles)&&(i=!1),n=r&&i&&this.state.primerOffsetValid&&this.state.minBaseQualityValid&&this.state.minDepthValid&&this.state.minFreqValid&&this.state.ambigSymbolValid&&this.state.trimFront1Valid&&this.state.trimTail1Valid&&this.state.fastpCompressionLevelValid,this.setState({refFileValid:r,alignmentFilesValid:i}),n});T(this,"runViralConsensus",async()=>{var m,y;if(!this.validInput()){alert("Invalid input. Please check your input and try again."),te("Invalid input. Please check your input and try again.");return}const n=performance.now();te("Starting job..."),this.setState({done:!1,timeElapsed:void 0,loading:!0,inputChanged:!1,consensusExists:!1,posCountsExists:!1,insCountsExists:!1,fastpOutputExists:!1,minimapOutputExists:!1});const r=this.state.CLI;if(r===void 0){setTimeout(()=>{this.runViralConsensus()},2e3);return}const i=Ko,l=(y=(m=this.state.alignmentFiles[0])==null?void 0:m.name)!=null&&y.endsWith(".bam")||this.state.alignmentFiles==="EXAMPLE_DATA"?_f:Iv,o=Fv;let s=`viral_consensus -i ${this.state.alignmentFilesAreFASTQ?wr:l} -r ${i} -o ${es}`;if(te("Deleting old files..."),await this.clearFiles(),te("Reading reference file..."),this.state.refFile!==void 0)await r.fs.writeFile(Ko,await this.fileReaderReadFile(this.state.refFile));else{const k=await(await fetch(`/${Cv}${this.state.preloadedRef}/${this.state.preloadedRef}.fas`)).text();await r.fs.writeFile(Ko,k)}if(te("Reading input read file(s)..."),this.state.alignmentFiles==="EXAMPLE_DATA")await r.fs.writeFile(_f,new Uint8Array(this.state.exampleAlignmentFile));else{const k=await this.fileReaderReadFile(this.state.alignmentFiles[0],!0),C=this.state.alignmentFiles[0].name;if(C.endsWith(".bam")||C.endsWith(".sam"))te("Recognized alignment file as BAM/SAM, reading file..."),await r.fs.writeFile(l,new Uint8Array(k));else if(this.state.alignmentFilesAreFASTQ){te("Recognized alignment file(s) as FASTQ, reading file...");const w=this.state.trimInput?qo:Zv;for(let I=0;I