auspice
Version:
Web app for visualizing pathogen evolution
2 lines • 497 kB
JavaScript
/*! For license information please see auspice.chunk.mainComponent.bundle.51590690731d0f5f90fe.js.LICENSE.txt */
(self.webpackChunkauspice=self.webpackChunkauspice||[]).push([[29],{75941(e,t,n){"use strict";n.d(t,{A:()=>f});var r=n(40378),o=n.n(r),i=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function a(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(o()[n[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("--\x3e");return{type:"comment",comment:-1!==r?e.slice(4,r):""}}for(var a=new RegExp(i),l=null;null!==(l=a.exec(e));)if(l[0].trim())if(l[1]){var s=l[1].trim(),c=[s,""];s.indexOf("=")>-1&&(c=s.split("=")),t.attrs[c[0]]=c[1],a.lastIndex--}else l[2]&&(t.attrs[l[2]]=l[3].trim().substring(1,l[3].length-1));return t}var l=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,s=/^\s*$/,c=Object.create(null);function u(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(u,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var p={parse:function(e,t){t||(t={}),t.components||(t.components=c);var n,r=[],o=[],i=-1,u=!1;if(0!==e.indexOf("<")){var p=e.indexOf("<");r.push({type:"text",content:-1===p?e:e.substring(0,p)})}return e.replace(l,function(l,c){if(u){if(l!=="</"+n.name+">")return;u=!1}var p,f="/"!==l.charAt(1),d=l.startsWith("\x3c!--"),h=c+l.length,m=e.charAt(h);if(d){var y=a(l);return i<0?(r.push(y),r):((p=o[i]).children.push(y),r)}if(f&&(i++,"tag"===(n=a(l)).type&&t.components[n.name]&&(n.type="component",u=!0),n.voidElement||u||!m||"<"===m||n.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),0===i&&r.push(n),(p=o[i-1])&&p.children.push(n),o[i]=n),(!f||n.voidElement)&&(i>-1&&(n.voidElement||n.name===l.slice(2,-1))&&(i--,n=-1===i?r:o[i]),!u&&"<"!==m&&m)){p=-1===i?r:o[i].children;var v=e.indexOf("<",h),g=e.slice(h,-1===v?void 0:v);s.test(g)&&(g=" "),(v>-1&&i+p.length>=0||" "!==g)&&p.push({type:"text",content:g})}}),r},stringify:function(e){return e.reduce(function(e,t){return e+u("",t)},"")}};const f=p},67016(e,t){var n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}n=function e(){"use strict";var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:{},n=!t.document&&!!t.postMessage,r=n&&/blob:/i.test((t.location||{}).protocol),i={},a=0,l={parse:function(n,r){var o=(r=r||{}).dynamicTyping||!1;if(x(o)&&(r.dynamicTypingFunction=o,o={}),r.dynamicTyping=o,r.transform=!!x(r.transform)&&r.transform,r.worker&&l.WORKERS_SUPPORTED){var s=function(){if(!l.WORKERS_SUPPORTED)return!1;var n,r,o=(n=t.URL||t.webkitURL||null,r=e.toString(),l.BLOB_URL||(l.BLOB_URL=n.createObjectURL(new Blob(["(",r,")();"],{type:"text/javascript"})))),s=new t.Worker(o);return s.onmessage=v,s.id=a++,i[s.id]=s}();return s.userStep=r.step,s.userChunk=r.chunk,s.userComplete=r.complete,s.userError=r.error,r.step=x(r.step),r.chunk=x(r.chunk),r.complete=x(r.complete),r.error=x(r.error),delete r.worker,void s.postMessage({input:n,config:r,workerId:s.id})}var c=null;return l.NODE_STREAM_INPUT,"string"==typeof n?c=r.download?new u(r):new f(r):!0===n.readable&&x(n.read)&&x(n.on)?c=new d(r):(t.File&&n instanceof File||n instanceof Object)&&(c=new p(r)),c.stream(n)},unparse:function(e,t){var n=!1,r=!0,i=",",a="\r\n",s='"',c=s+s,u=!1,p=null,f=!1;!function(){if("object"==o(t)){if("string"!=typeof t.delimiter||l.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(i=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(u=t.skipEmptyLines),"string"==typeof t.newline&&(a=t.newline),"string"==typeof t.quoteChar&&(s=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");p=t.columns}void 0!==t.escapeChar&&(c=t.escapeChar+s),"boolean"==typeof t.escapeFormulae&&(f=t.escapeFormulae)}}();var d=new RegExp(m(s),"g");if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return h(null,e,u);if("object"==o(e[0]))return h(p||Object.keys(e[0]),e,u)}else if("object"==o(e))return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==o(e.data[0])?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==o(e.data[0])||(e.data=[e.data])),h(e.fields||[],e.data||[],u);throw new Error("Unable to serialize unrecognized input");function h(e,t,n){var o="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var l=Array.isArray(e)&&0<e.length,s=!Array.isArray(t[0]);if(l&&r){for(var c=0;c<e.length;c++)0<c&&(o+=i),o+=y(e[c],c);0<t.length&&(o+=a)}for(var u=0;u<t.length;u++){var p=l?e.length:t[u].length,f=!1,d=l?0===Object.keys(t[u]).length:0===t[u].length;if(n&&!l&&(f="greedy"===n?""===t[u].join("").trim():1===t[u].length&&0===t[u][0].length),"greedy"===n&&l){for(var h=[],m=0;m<p;m++){var v=s?e[m]:m;h.push(t[u][v])}f=""===h.join("").trim()}if(!f){for(var g=0;g<p;g++){0<g&&!d&&(o+=i);var b=l&&s?e[g]:g;o+=y(t[u][b],g)}u<t.length-1&&(!n||0<p&&!d)&&(o+=a)}}return o}function y(e,t){if(null==e)return"";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);!0===f&&"string"==typeof e&&null!==e.match(/^[=+\-@].*$/)&&(e="'"+e);var r=e.toString().replace(d,c),o="boolean"==typeof n&&n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||function(e,t){for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1}(r,l.BAD_DELIMITERS)||-1<r.indexOf(i)||" "===r.charAt(0)||" "===r.charAt(r.length-1);return o?s+r+s:r}}};if(l.RECORD_SEP=String.fromCharCode(30),l.UNIT_SEP=String.fromCharCode(31),l.BYTE_ORDER_MARK="\ufeff",l.BAD_DELIMITERS=["\r","\n",'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!n&&!!t.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=y,l.ParserHandle=h,l.NetworkStreamer=u,l.FileStreamer=p,l.StringStreamer=f,l.ReadableStreamStreamer=d,t.jQuery){var s=t.jQuery;s.fn.parse=function(e){var n=e.config||{},r=[];return this.each(function(e){if("INPUT"!==s(this).prop("tagName").toUpperCase()||"file"!==s(this).attr("type").toLowerCase()||!t.FileReader||!this.files||0===this.files.length)return!0;for(var o=0;o<this.files.length;o++)r.push({file:this.files[o],inputElem:this,instanceConfig:s.extend({},n)})}),i(),this;function i(){if(0!==r.length){var t,n,i,c=r[0];if(x(e.before)){var u=e.before(c.file,c.inputElem);if("object"==o(u)){if("abort"===u.action)return t=c.file,n=c.inputElem,i=u.reason,void(x(e.error)&&e.error({name:"AbortError"},t,n,i));if("skip"===u.action)return void a();"object"==o(u.config)&&(c.instanceConfig=s.extend(c.instanceConfig,u.config))}else if("skip"===u)return void a()}var p=c.instanceConfig.complete;c.instanceConfig.complete=function(e){x(p)&&p(e,c.file,c.inputElem),a()},l.parse(c.file,c.instanceConfig)}else x(e.complete)&&e.complete()}function a(){r.splice(0,1),i()}}}function c(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=w(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new h(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){if(this.isFirstChunk&&x(this._config.beforeFirstChunk)){var o=this._config.beforeFirstChunk(e);void 0!==o&&(e=o)}this.isFirstChunk=!1,this._halted=!1;var i=this._partialLine+e;this._partialLine="";var a=this._handle.parse(i,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var s=a.meta.cursor;this._finished||(this._partialLine=i.substring(s-this._baseIndex),this._baseIndex=s),a&&a.data&&(this._rowCount+=a.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)t.postMessage({results:a,workerId:l.WORKER_ID,finished:c});else if(x(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!c||!x(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),c||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){x(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:l.WORKER_ID,error:e,finished:!1})}}function u(e){var t;(e=e||{}).chunkSize||(e.chunkSize=l.RemoteChunkSize),c.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=S(this._chunkLoaded,this),t.onerror=S(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var o=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+o)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function p(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=l.LocalChunkSize),c.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=S(this._chunkLoaded,this),t.onerror=S(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var o=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,o)}var i=t.readAsText(e,this._config.encoding);r||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function f(e){var t;c.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,n=this._config.chunkSize;return n?(e=t.substring(0,n),t=t.substring(n)):(e=t,t=""),this._finished=!t,this.parseChunk(e)}}}function d(e){c.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){c.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){c.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=S(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=S(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=S(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=S(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function h(e){var t,n,r,o=Math.pow(2,53),i=-o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,s=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,c=this,u=0,p=0,f=!1,d=!1,h=[],v={data:[],errors:[],meta:{}};if(x(e.step)){var g=e.step;e.step=function(t){if(v=t,E())S();else{if(S(),0===v.data.length)return;u+=t.data.length,e.preview&&u>e.preview?n.abort():(v.data=v.data[0],g(v,c))}}}function b(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function S(){if(v&&r&&(C("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines)for(var t=0;t<v.data.length;t++)b(v.data[t])&&v.data.splice(t--,1);return E()&&function(){if(v)if(Array.isArray(v.data[0])){for(var t=0;E()&&t<v.data.length;t++)v.data[t].forEach(n);v.data.splice(0,1)}else v.data.forEach(n);function n(t,n){x(e.transformHeader)&&(t=e.transformHeader(t,n)),h.push(t)}}(),function(){if(!v||!e.header&&!e.dynamicTyping&&!e.transform)return v;function t(t,n){var r,o=e.header?{}:[];for(r=0;r<t.length;r++){var i=r,a=t[r];e.header&&(i=r>=h.length?"__parsed_extra":h[r]),e.transform&&(a=e.transform(a,i)),a=O(i,a),"__parsed_extra"===i?(o[i]=o[i]||[],o[i].push(a)):o[i]=a}return e.header&&(r>h.length?C("FieldMismatch","TooManyFields","Too many fields: expected "+h.length+" fields but parsed "+r,p+n):r<h.length&&C("FieldMismatch","TooFewFields","Too few fields: expected "+h.length+" fields but parsed "+r,p+n)),o}var n=1;return!v.data.length||Array.isArray(v.data[0])?(v.data=v.data.map(t),n=v.data.length):v.data=t(v.data,0),e.header&&v.meta&&(v.meta.fields=h),p+=n,v}()}function E(){return e.header&&0===h.length}function O(t,n){return r=t,e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(function(e){if(a.test(e)){var t=parseFloat(e);if(i<t&&t<o)return!0}return!1}(n)?parseFloat(n):s.test(n)?new Date(n):""===n?null:n):n;var r}function C(e,t,n,r){var o={type:e,code:t,message:n};void 0!==r&&(o.row=r),v.errors.push(o)}this.parse=function(o,i,a){var s=e.quoteChar||'"';if(e.newline||(e.newline=function(e,t){e=e.substring(0,1048576);var n=new RegExp(m(t)+"([^]*?)"+m(t),"gm"),r=(e=e.replace(n,"")).split("\r"),o=e.split("\n"),i=1<o.length&&o[0].length<r[0].length;if(1===r.length||i)return"\n";for(var a=0,l=0;l<r.length;l++)"\n"===r[l][0]&&a++;return a>=r.length/2?"\r\n":"\r"}(o,s)),r=!1,e.delimiter)x(e.delimiter)&&(e.delimiter=e.delimiter(o),v.meta.delimiter=e.delimiter);else{var c=function(t,n,r,o,i){var a,s,c,u;i=i||[",","\t","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var p=0;p<i.length;p++){var f=i[p],d=0,h=0,m=0;c=void 0;for(var v=new y({comments:o,delimiter:f,newline:n,preview:10}).parse(t),g=0;g<v.data.length;g++)if(r&&b(v.data[g]))m++;else{var w=v.data[g].length;h+=w,void 0!==c?0<w&&(d+=Math.abs(w-c),c=w):c=w}0<v.data.length&&(h/=v.data.length-m),(void 0===s||d<=s)&&(void 0===u||u<h)&&1.99<h&&(s=d,a=f,u=h)}return{successful:!!(e.delimiter=a),bestDelimiter:a}}(o,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess);c.successful?e.delimiter=c.bestDelimiter:(r=!0,e.delimiter=l.DefaultDelimiter),v.meta.delimiter=e.delimiter}var u=w(e);return e.preview&&e.header&&u.preview++,t=o,n=new y(u),v=n.parse(t,i,a),S(),f?{meta:{paused:!0}}:v||{meta:{paused:!1}}},this.paused=function(){return f},this.pause=function(){f=!0,n.abort(),t=x(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){c.streamer._halted?(f=!1,c.streamer.parseChunk(t,!0)):setTimeout(c.resume,3)},this.aborted=function(){return d},this.abort=function(){d=!0,n.abort(),v.meta.aborted=!0,x(e.complete)&&e.complete(v),t=""}}function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(e){var t,n=(e=e||{}).delimiter,r=e.newline,o=e.comments,i=e.step,a=e.preview,s=e.fastMode,c=t=void 0===e.quoteChar?'"':e.quoteChar;if(void 0!==e.escapeChar&&(c=e.escapeChar),("string"!=typeof n||-1<l.BAD_DELIMITERS.indexOf(n))&&(n=","),o===n)throw new Error("Comment character same as delimiter");!0===o?o="#":("string"!=typeof o||-1<l.BAD_DELIMITERS.indexOf(o))&&(o=!1),"\n"!==r&&"\r"!==r&&"\r\n"!==r&&(r="\n");var u=0,p=!1;this.parse=function(e,l,f){if("string"!=typeof e)throw new Error("Input must be a string");var d=e.length,h=n.length,y=r.length,v=o.length,g=x(i),b=[],w=[],S=[],E=u=0;if(!e)return D();if(s||!1!==s&&-1===e.indexOf(t)){for(var O=e.split(r),C=0;C<O.length;C++){if(S=O[C],u+=S.length,C!==O.length-1)u+=r.length;else if(f)return D();if(!o||S.substring(0,v)!==o){if(g){if(b=[],I(S.split(n)),L(),p)return D()}else I(S.split(n));if(a&&a<=C)return b=b.slice(0,a),D(!0)}}return D()}for(var T=e.indexOf(n,u),_=e.indexOf(r,u),k=new RegExp(m(c)+m(t),"g"),j=e.indexOf(t,u);;)if(e[u]!==t)if(o&&0===S.length&&e.substring(u,u+v)===o){if(-1===_)return D();u=_+y,_=e.indexOf(r,u),T=e.indexOf(n,u)}else if(-1!==T&&(T<_||-1===_))S.push(e.substring(u,T)),u=T+h,T=e.indexOf(n,u);else{if(-1===_)break;if(S.push(e.substring(u,_)),N(_+y),g&&(L(),p))return D();if(a&&b.length>=a)return D(!0)}else for(j=u,u++;;){if(-1===(j=e.indexOf(t,j+1)))return f||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:u}),R();if(j===d-1)return R(e.substring(u,j).replace(k,t));if(t!==c||e[j+1]!==c){if(t===c||0===j||e[j-1]!==c){-1!==T&&T<j+1&&(T=e.indexOf(n,j+1)),-1!==_&&_<j+1&&(_=e.indexOf(r,j+1));var P=M(-1===_?T:Math.min(T,_));if(e[j+1+P]===n){S.push(e.substring(u,j).replace(k,t)),e[u=j+1+P+h]!==t&&(j=e.indexOf(t,u)),T=e.indexOf(n,u),_=e.indexOf(r,u);break}var A=M(_);if(e.substring(j+1+A,j+1+A+y)===r){if(S.push(e.substring(u,j).replace(k,t)),N(j+1+A+y),T=e.indexOf(n,u),j=e.indexOf(t,u),g&&(L(),p))return D();if(a&&b.length>=a)return D(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:u}),j++}}else j++}return R();function I(e){b.push(e),E=u}function M(t){var n=0;if(-1!==t){var r=e.substring(j+1,t);r&&""===r.trim()&&(n=r.length)}return n}function R(t){return f||(void 0===t&&(t=e.substring(u)),S.push(t),u=d,I(S),g&&L()),D()}function N(t){u=t,I(S),S=[],_=e.indexOf(r,u)}function D(e){return{data:b,errors:w,meta:{delimiter:n,linebreak:r,aborted:p,truncated:!!e,cursor:E+(l||0)}}}function L(){i(D()),b=[],w=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return u}}function v(e){var t=e.data,n=i[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var o={abort:function(){r=!0,g(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:b,resume:b};if(x(n.userStep)){for(var a=0;a<t.results.data.length&&(n.userStep({data:t.results.data[a],errors:t.results.errors,meta:t.results.meta},o),!r);a++);delete t.results}else x(n.userChunk)&&(n.userChunk(t.results,o,t.file),delete t.results)}t.finished&&!r&&g(t.workerId,t.results)}function g(e,t){var n=i[e];x(n.userComplete)&&n.userComplete(t),n.terminate(),delete i[e]}function b(){throw new Error("Not implemented.")}function w(e){if("object"!=o(e)||null===e)return e;var t=Array.isArray(e)?[]:{};for(var n in e)t[n]=w(e[n]);return t}function S(e,t){return function(){e.apply(t,arguments)}}function x(e){return"function"==typeof e}return r&&(t.onmessage=function(e){var n=e.data;if(void 0===l.WORKER_ID&&n&&(l.WORKER_ID=n.workerId),"string"==typeof n.input)t.postMessage({workerId:l.WORKER_ID,results:l.parse(n.input,n.config),finished:!0});else if(t.File&&n.input instanceof File||n.input instanceof Object){var r=l.parse(n.input,n.config);r&&t.postMessage({workerId:l.WORKER_ID,results:r,finished:!0})}}),(u.prototype=Object.create(c.prototype)).constructor=u,(p.prototype=Object.create(c.prototype)).constructor=p,(f.prototype=Object.create(f.prototype)).constructor=f,(d.prototype=Object.create(c.prototype)).constructor=d,l},void 0===(r=n.apply(t,[]))||(e.exports=r)},75805(e,t,n){var r,o,i,a;function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}e=n.nmd(e),a=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==l(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){e.exports=n(2)()},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(3);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(0),a=n.n(i),s=function(e){return 0!==e};function c(e){return(c="function"==typeof Symbol&&"symbol"==l(Symbol.iterator)?function(e){return l(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":l(e)})(e)}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(r,e);var t,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var o=d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,n)}}(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),h(f(t=n.call(this,e)),"continueOpenCollapsible",function(){var e=f(t).innerRef;t.setState({height:e.scrollHeight,transition:"height ".concat(t.props.transitionTime,"ms ").concat(t.props.easing),isClosed:!1,hasBeenOpened:!0,inTransition:s(e.scrollHeight),shouldOpenOnNextCycle:!1})}),h(f(t),"handleTriggerClick",function(e){t.props.triggerDisabled||t.state.inTransition||(e.preventDefault(),t.props.handleTriggerClick?t.props.handleTriggerClick(t.props.accordionPosition):!0===t.state.isClosed?(t.openCollapsible(),t.props.onOpening(),t.props.onTriggerOpening()):(t.closeCollapsible(),t.props.onClosing(),t.props.onTriggerClosing()))}),h(f(t),"handleTransitionEnd",function(e){e.target===t.innerRef&&(t.state.isClosed?(t.setState({inTransition:!1}),t.props.onClose()):(t.setState({height:"auto",overflow:t.props.overflowWhenOpen,inTransition:!1}),t.props.onOpen()))}),h(f(t),"setInnerRef",function(e){return t.innerRef=e}),t.timeout=void 0,t.contentId="collapsible-content-".concat(Date.now()),t.triggerId=e.triggerElementProps.id||"collapsible-trigger-".concat(Date.now()),e.open?t.state={isClosed:!1,shouldSwitchAutoOnNextCycle:!1,height:"auto",transition:"none",hasBeenOpened:!0,overflow:e.overflowWhenOpen,inTransition:!1}:t.state={isClosed:!0,shouldSwitchAutoOnNextCycle:!1,height:0,transition:"height ".concat(e.transitionTime,"ms ").concat(e.easing),hasBeenOpened:!1,overflow:"hidden",inTransition:!1},t}return(t=[{key:"componentDidUpdate",value:function(e,t){var n=this;this.state.shouldOpenOnNextCycle&&this.continueOpenCollapsible(),"auto"!==t.height&&0!==t.height||!0!==this.state.shouldSwitchAutoOnNextCycle||(window.clearTimeout(this.timeout),this.timeout=window.setTimeout(function(){n.setState({height:0,overflow:"hidden",isClosed:!0,shouldSwitchAutoOnNextCycle:!1})},50)),e.open!==this.props.open&&(!0===this.props.open?(this.openCollapsible(),this.props.onOpening()):(this.closeCollapsible(),this.props.onClosing()))}},{key:"componentWillUnmount",value:function(){window.clearTimeout(this.timeout)}},{key:"closeCollapsible",value:function(){var e=this.innerRef;this.setState({shouldSwitchAutoOnNextCycle:!0,height:e.scrollHeight,transition:"height ".concat(this.props.transitionCloseTime?this.props.transitionCloseTime:this.props.transitionTime,"ms ").concat(this.props.easing),inTransition:s(e.scrollHeight)})}},{key:"openCollapsible",value:function(){this.setState({inTransition:s(this.innerRef.scrollHeight),shouldOpenOnNextCycle:!0})}},{key:"renderNonClickableTriggerElement",value:function(){return this.props.triggerSibling&&"string"==typeof this.props.triggerSibling?o.a.createElement("span",{className:"".concat(this.props.classParentString,"__trigger-sibling")},this.props.triggerSibling):this.props.triggerSibling&&"function"==typeof this.props.triggerSibling?this.props.triggerSibling():this.props.triggerSibling?o.a.createElement(this.props.triggerSibling,null):null}},{key:"render",value:function(){var e=this,t={height:this.state.height,WebkitTransition:this.state.transition,msTransition:this.state.transition,transition:this.state.transition,overflow:this.state.overflow},n=this.state.isClosed?"is-closed":"is-open",r=this.props.triggerDisabled?"is-disabled":"",i=!1===this.state.isClosed&&void 0!==this.props.triggerWhenOpen?this.props.triggerWhenOpen:this.props.trigger,a=this.props.contentContainerTagName,l=this.props.triggerTagName,s=this.props.lazyRender&&!this.state.hasBeenOpened&&this.state.isClosed&&!this.state.inTransition?null:this.props.children,c=this.props,p=c.classParentString,f=c.contentOuterClassName,d=c.contentInnerClassName,h="".concat(p,"__trigger ").concat(n," ").concat(r," ").concat(this.state.isClosed?this.props.triggerClassName:this.props.triggerOpenedClassName),m="".concat(p," ").concat(this.state.isClosed?this.props.className:this.props.openedClassName),y="".concat(p,"__contentOuter ").concat(f),v="".concat(p,"__contentInner ").concat(d);return o.a.createElement(a,u({className:m.trim()},this.props.containerElementProps),o.a.createElement(l,u({id:this.triggerId,className:h.trim(),onClick:this.handleTriggerClick,style:this.props.triggerStyle&&this.props.triggerStyle,onKeyPress:function(t){var n=t.key;(" "===n&&"button"!==e.props.triggerTagName.toLowerCase()||"Enter"===n)&&e.handleTriggerClick(t)},tabIndex:this.props.tabIndex&&this.props.tabIndex,"aria-expanded":!this.state.isClosed,"aria-disabled":this.props.triggerDisabled,"aria-controls":this.contentId,role:"button"},this.props.triggerElementProps),i),this.renderNonClickableTriggerElement(),o.a.createElement("div",{id:this.contentId,className:y.trim(),style:t,onTransitionEnd:this.handleTransitionEnd,ref:this.setInnerRef,hidden:this.props.contentHiddenWhenClosed&&this.state.isClosed&&!this.state.inTransition,role:"region","aria-labelledby":this.triggerId},o.a.createElement("div",{className:v.trim()},s)))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(r.Component);m.propTypes={transitionTime:a.a.number,transitionCloseTime:a.a.number,triggerTagName:a.a.string,easing:a.a.string,open:a.a.bool,containerElementProps:a.a.object,triggerElementProps:a.a.object,classParentString:a.a.string,className:a.a.string,openedClassName:a.a.string,triggerStyle:a.a.object,triggerClassName:a.a.string,triggerOpenedClassName:a.a.string,contentOuterClassName:a.a.string,contentInnerClassName:a.a.string,accordionPosition:a.a.oneOfType([a.a.string,a.a.number]),handleTriggerClick:a.a.func,onOpen:a.a.func,onClose:a.a.func,onOpening:a.a.func,onClosing:a.a.func,onTriggerOpening:a.a.func,onTriggerClosing:a.a.func,trigger:a.a.oneOfType([a.a.string,a.a.element]),triggerWhenOpen:a.a.oneOfType([a.a.string,a.a.element]),triggerDisabled:a.a.bool,lazyRender:a.a.bool,overflowWhenOpen:a.a.oneOf(["hidden","visible","auto","scroll","inherit","initial","unset"]),contentHiddenWhenClosed:a.a.bool,triggerSibling:a.a.oneOfType([a.a.element,a.a.func]),tabIndex:a.a.number,contentContainerTagName:a.a.string,children:a.a.oneOfType([a.a.string,a.a.element])},m.defaultProps={transitionTime:400,transitionCloseTime:null,triggerTagName:"span",easing:"linear",open:!1,classParentString:"Collapsible",triggerDisabled:!1,lazyRender:!1,overflowWhenOpen:"hidden",contentHiddenWhenClosed:!1,openedClassName:"",triggerStyle:null,triggerClassName:"",triggerOpenedClassName:"",contentOuterClassName:"",contentInnerClassName:"",className:"",triggerSibling:null,onOpen:function(){},onClose:function(){},onOpening:function(){},onClosing:function(){},onTriggerOpening:function(){},onTriggerClosing:function(){},tabIndex:null,contentContainerTagName:"div",triggerElementProps:{}},t.default=m}])},"object"==l(t)&&"object"==l(e)?e.exports=a(n(78281)):(o=[n(78281)],void 0===(i="function"==typeof(r=a)?r.apply(t,o):r)||(e.exports=i))},40378(e){e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},8791(e,t,n){"use strict";n.d(t,{Ay:()=>E,DC:()=>_,gd:()=>O});var r=n(78281),o=n(49633),i=n(98807),a=n(28355),l=n(51914),s=n.n(l),c=n(41930),u=n(51924),p=n(60516),f=n(5300);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){w(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w(e,t,n){return(t=function(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){return e.map(function(e,t){return b(b({},e),{},{id:t})})}function x(e){return e.map(function(e){return delete e.id,e})}function E(e){var t=e.dismissModal,n=(0,i.B)().t,a=(0,o.wA)(),l=(0,o.d4)(function(e){return e.metadata});if(!l.loaded)throw new Error("[INTERNAL ERROR] metadata state not loaded");var c=l.legendPlacements,d=m((0,r.useState)(S(l.maintainers||[])),2),h=d[0],y=d[1],v=m((0,r.useState)(S(l.dataProvenance||[])),2),g=v[0],b=v[1],w=(0,r.useRef)(null);return(0,r.useEffect)(function(){return s().bind("enter",function(){var e;null===(e=w.current)||void 0===e||e.requestSubmit()}),s().bind("escape",function(){t()}),function(){s().unbind("enter"),s().unbind("escape")}},[t]),r.createElement(f.EJ,{ref:w,onSubmit:function(e){e.preventDefault();var n=Object.fromEntries(Object.keys(c).map(function(t){return[t,(n=e.target["".concat(t,"Legend")].value,r=m(n.split(" "),2),o=r[0],i=r[1],function(e){switch(e){case"top":case"bottom":return;default:throw new Error("Invalid vertical string ".concat(e))}}(o),function(e){switch(e){case"left":case"right":return;default:throw new Error("Invalid horizontal string ".concat(e))}}(i),{vertical:o,horizontal:i})];var n,r,o,i}));a((0,u.D)({edited:!0,title:e.currentTarget.datasetTitle.value,updated:e.currentTarget.updated.value,buildUrl:e.currentTarget.buildUrl.value,buildAvatar:e.currentTarget.avatarUrl.value.trim()||void 0,warning:e.currentTarget.warning.value.trim()||void 0,description:e.currentTarget.description.value,maintainers:x(h),dataProvenance:x(g),legendPlacements:n},!0,!1)),t()}},r.createElement("div",{className:"row"},r.createElement("div",{className:"col-sm-6"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col-lg-6"},r.createElement("label",null,n("Dataset title"),":",r.createElement("br",null),r.createElement("input",{name:"datasetTitle",type:"text",defaultValue:l.title||""}))),r.createElement("div",{className:"col-lg-6"},r.createElement("label",null,n("Date updated"),":",r.createElement("br",null),r.createElement("input",{name:"updated",type:"date",defaultValue:l.updated||""})))),r.createElement("div",{className:"row"},r.createElement("div",{className:"col-lg-6"},r.createElement("label",null,n("Build URL"),":",r.createElement("br",null),r.createElement("input",{name:"buildUrl",type:"url",defaultValue:l.buildUrl||""}))),r.createElement("div",{className:"col-lg-6"},r.createElement("label",null,n("Avatar URL"),":",r.createElement("br",null),r.createElement("input",{name:"avatarUrl",type:"url",defaultValue:l.buildAvatar||""})))),r.createElement(C,{name:"maintainers",data:h,setData:y}),r.createElement(C,{name:"data provenances",data:g,setData:b})),r.createElement("div",{className:"col-sm-6"},r.createElement("label",null,n("Warning"),":",r.createElement("br",null),r.createElement("textarea",{name:"warning",defaultValue:l.warning||""})),r.createElement("label",null,n("Description"),":",r.createElement("br",null),r.createElement("textarea",{rows:10,name:"description",defaultValue:l.description||""})),r.createElement(T,{defaultPlacements:l.legendPlacements}))),r.createElement(p.A,{justifyContent:"center"},r.createElement("button",{type:"submit",style:{margin:10}},n("Apply changes")),r.createElement("button",{type:"button",style:{margin:10},onClick:t},n("Discard changes"))))}var O={container:function(e){return e.backgroundColor="rgba(0, 0, 0, .30)",e},panel:function(e,t){return e.width=t.width-100,e.maxWidth=e.width,e.height=t.height-200,e.maxHeight=e.height,e.padding="2em",e.color="#1f2328",e.backgroundColor="#ffffff",e}};function C(e){var t=e.name,n=e.data,o=e.setData,l=(0,i.B)().t,s=(0,r.useRef)(n.length);function c(e){o(h(n).map(function(t){return t.id===e.id?e:t}))}return r.createElement(r.Fragment,null,r.createElement("div",{className:"row"},r.createElement("div",{className:"col-xs-12 underlined"},l(t),":")),n.map(function(e){return r.createElement(p.A,{key:e.id},r.createElement("div",{className:"col-xs-6"},r.createElement("label",null,l("Name"),":",r.createElement("br",null),r.createElement("input",{required:!0,type:"text",value:e.name,onChange:function(t){return c(b(b({},e),{},{name:t.currentTarget.value}))}}))),r.createElement("div",{className:"col-xs-5"},r.createElement("label",null,l("URL"),":",r.createElement("br",null),r.createElement("input",{type:"url",value:e.url,onChange:function(t){return c(b(b({},e),{},{url:t.currentTarget.value}))}}))),r.createElement("div",{className:"col-xs-1"},r.createElement("button",{type:"button",onClick:function(){return t=e.id,void o(h(n).filter(function(e){return e.id!==t}));var t}},r.createElement(a.RCe,null))))}),r.createElement(p.A,null,r.createElement("button",{type:"button",onClick:function(){var e={id:s.current,name:"",url:""};s.current++,o([].concat(h(n),[e]))}},l("Add ".concat(t)))))}function T(e){var t=e.defaultPlacements,n=(0,i.B)().t,o=["top left","top right","bottom left","bottom right"],a=Object.fromEntries(Object.entries(t).map(function(e){var t,n=m(e,2);return[n[0],(t=n[1],"".concat(t.vertical," ").concat(t.horizontal))]}));return r.createElement(r.Fragment,null,r.createElement("div",{className:"underlined"},n("Legend placement")),r.createElement(p.A,{justifyContent:"space-around"},Object.keys(a).map(function(e){return r.createElement("div",{key:e},n("".concat(e," panel")),o.map(function(t){return r.createElement(p.A,{key:t,justifyContent:"flex-start",alignContent:"center",style:{margin:"0.25em 1em"}},r.createElement("input",{id:"".concat(e,"-").concat(t),name:"".concat(e,"Legend"),type:"radio",value:t,defaultChecked:a[e]===t}),r.createElement("label",{htmlFor:"".concat(e,"-").concat(t)},n(t)))}))})))}function _(){return!(!(0,c.Q)("enableDatasetEditor")||!(0,c.u)("enableDatasetEditor"))}},5300(e,t,n){"use strict";n.d(t,{EJ:()=>i,qF:()=>a});var r=n(77313),o=r.Ay.form.withConfig({displayName:"styles__Form",componentId:"sc-10gz0g0-0"})(["height:100%;width:100%;display:flex;flex-direction:column;justify-content:space-evenly;align-items:stretch;*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}button{display:inline-flex;justify-content:center;align-items:center;padding:0.3em;}"]),i=(0,r.Ay)(o).withConfig({displayName:"styles__DatasetEditorForm",componentId:"sc-10gz0g0-1"})(["input:not([type=radio]){margin-bottom:1em;width:100%;}input[type=radio]{margin-right:0.2em;}textarea{margin-bottom:1em;width:100%;resize:vertical;min-height:1.5em;max-height:50em;}.underlined{margin-bottom:1em;text-decoration:underline;}.radio{width:100%;display:inline-flex;align-items:center;margin:0.25em 1em;}"]),a=(0,r.Ay)(o).withConfig({displayName:"styles__ColorByEditorForm",componentId:"sc-10gz0g0-2"})(['input[type="color"]{width:25px;height:25px;margin-right:1em;padding:0;border:3px solid;}input[type="color"]::-moz-color-swatch{border:none;}input[type="color"]::-webkit-color-swatch-wrapper{padding:0;border-radius:0;}input[type="color"]::-webkit-color-swatch{border:none;}'])},22796(e,t,n){"use strict";n.d(t,{P:()=>w,u:()=>g});var r=n(78281),o=n(49633),i=n(98807),a=n(77313),l=n(98598),s=n(40952),c=n(4124),u=n(69138),p=n(85053),f=n(93681),d=(0,a.SL)(l.bg),h=(0,a.SL)(l.wC),m=(0,a.SL)(l.W8),y=(0,a.SL)(l.jG),v=25,g=function(e){var t,n,a,l,c=e.relevantPublications,g=(0,o.d4)(function(e){return e}),S=(0,o.wA)(),x=(0,i.B)().t,E=g.metadata.mainTreeNumTips,O=(0,f.gY)(g.tree.nodes,g.tree.visibility),C=O!==E,T=w(),_="num_date"===g.controls.distanceMeasure,k=(null===(t=g.entropy)||void 0===t?void 0:t.selectedCds)===s.Sc?"nucleotide":"codon";return r.createElement(r.Fragment,null,r.createElement("div",{style:{fontWeight:500,marginTop:"0px",marginBottom:"20px"}},"Downloaded data represents the currently displayed view. By zooming the tree, changing the branch-length metric, applying filters etc, the downloaded data will change accordingly.",r.createElement("p",null),"NOTE: We do not support downloads of multiple subtrees, which are usually created with the date range filter or genotype filters. Downloading multiple subtrees will result in an empty Newick tree!",r.createElement("p",null),C?"Currently ".concat(O,"/").concat(E," tips are displayed and will be downloaded."):"Currently the entire dataset (".concat(E," tips) will be downloaded.")),g.metadata.sharing.dataset_json&&r.createElement(b,{name:"Auspice (Nextstrain) JSON",description:"The main Auspice dataset JSON with the current view as the display default.",icon:r.createElement(y,{width:v,selected:!0}),onClick:function(){return u.hO(S,g,T)}}),g.metadata.sharing.trees&&r.createElement(r.Fragment,null,r.createElement(b,{name:"".concat(_?"TimeTree":"Tree"," (Newick)"),description:"Phylogenetic tree in Newick format with branch lengths in units of ".concat(_?"years":"divergence","."),icon:r.createElement(d,{width:v,selected:!0}),onClick:function(){return u.D4({isNewick:!0,dispatch:S,filePrefix:T,tree:g.tree,temporal:_})}}),r.createElement(b,{name:"".concat(_?"TimeTree":"Tree"," (Nexus)"),description:"Phylogeny in Nexus format with branch lengths in units of ".concat(_?"years":"divergence",". Colorings are included as annotations."),icon:r.createElement(d,{width:v,selected:!0}),onClick:function(){return u.D4({dispatch:S,filePrefix:T,tree:g.tree,colorings:g.metadata.colorings,colorBy:g.controls.colorBy,temporal:_})}})),g.metadata.sharing.gisaid_acknowledgments&&r.createElement(b,{name:"Acknowledgments (TSV)",description:"Per-sample acknowledgments (n = ".concat(O,")."),icon:r.createElement(m,{width:v,selected:!0}),onClick:function(){return u.AS(S,T,g.tree.nodes,g.tree.visibility)}}),g.metadata.sharing.metadata_tsv&&r.createElement(b,{name:"Metadata (TSV)",description:"Per-sample metadata (n = ".concat(O,")."),icon:r.createElement(m,{width:v,selected:!0}),onClick:function(){return u.tO(S,T,g.tree.nodes,g.tree.visibility)}}),g.metadata.sharing.authors&&u.Gh(g.tree)&&r.createElement(b,{name:"Author Metadata (TSV)",description:"Metadata for ".concat(O," samples grouped by their ").concat((n=g.tree.nodes,a=g.tree.visibility,l=new Set(n.filter(function(e,t){return a[t]===s.uU&&e.shell.inView}).map(function(e){return(0,p.tg)(e)}).filter(function(e){return e&&e.value}).map(function(e){return e.value})),l.size)," authors."),icon:r.createElement(m,{width:v,selected:!0}),onClick:function(){return u.Rj(S,T,g.tree)}}),g.metadata.sharing.entropy&&g.entropy.loaded&&r.createElement(b,{name:"Genetic diversity data (TSV)",description:"The data behind the diversity panel showing ".concat(g.entropy.showCounts?"a count of changes across the tree":"normalised shannon entropy"," per ").concat(k,"."),icon:r.createElement(m,{width:v,selected:!0}),onClick:function(){return u.xz(S,T,g.entropy)}}),g.metadata.sharing.screenshot&&r.createElement(b,{name:"Screenshot (SVG)",description:"Screenshot of the current nextstrain display in SVG format; CC-BY licensed.",icon:r.createElement(h,{width:v,selected:!0}),onClick:function(){return u.t4(S,x,g.metadata,g.tree.nodes,g.tree.visibility,w(),g.controls.panelsToDisplay,g.controls.panelLayout.panelLayout,c)}}))};function b(e){var t=e.name,n=e.description,o=e.icon,i=e.onClick,a=Object.assign({},c.u0,{backgroundColor:"rgba(0,0,0,0)",paddingLeft:"10px",color:"white",minWidth:"300px",textAlign:"left"});return r.createElement("div",{key:t,onClick:i,style:{cursor:"pointer"}},o,r.createElement("button",{style:a,name:t},t),r.createElement("div",{style:{display:"inline-block",height:"30px",verticalAlign:"top",paddingTop:"6px"}},r.createElement("label",{style:{fontStyle:"italic",fontSize:"14px",color:"lightgray"},htmlFor:t},n)))}function w(){return"nextstrain_"+window.location.pathname.replace(/^\//,"").replace(/:/g,"-").replace(/\//g,"_")}},57900(e,t,n){"use strict";n.d(t,{A:()=>w,M:()=>g});var r,o=n(78281),i=n(49633),a=n(69646),l=n(4124),s=n(17904),c=n(43153),u=n(22796);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!=p(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==p(t)?t:t+""}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function m(e){var t=y();return function(){var n,r=v(e);if(t){var o=v(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}var g={nextstrain:{author:"Hadfield et al",title:"Nextstrain: real-time tracking of pathogen evolution",year:"2018",journal:"Bioinformatics",href:"https://doi.org/10.1093/bioinformatics/bty407"},treetime:{author:"Sagulenko et al",title:"TreeTime: Maximum-likelihood phylodynamic analysis",journal:"Virus Evolution",year:"2017",href:"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5758920/"},titers:{author:"Neher et al",titleJournalYear:"Prediction, dynamics, and visualization of antigenic phenotypes of seasonal influenza viruses",journal:"PNAS",year:"2016",href:"http://www.pnas.org/content/113/12/E1701.abstract"}},b=(0,i.Ng)(function(e){return{colorBy:e.controls.colorBy,metadata:e.metadata,nodes:e.tree.nodes,visibility:e.tree.visibility}})(r=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(i,e);var t,n,r=m(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.apply(this,arguments)}return t=i,n=[{key:"getRelevantPublications",value:function(){var e=[g.nextstrain,g.treetime];return-1!==["cTiter","rb","ep","ne"].indexOf(this.props.colorBy)&&e.push(g.titers),e}},{key:"formatPublications",value:function(e){return o.createElement("span",null,o.createElement("ul",null,e.map(function(e){return o.createElement("li",{key:e.href},o.createElement("a",{href:e.href,target:"_blank",rel:"noreferrer noopener"},e.author,", ",e.title,", ",o.createElement("i",null,e.journal)," (",e.year,")"))})))}},{key:"render",value:function(){var e=this.props,t=e.t,n=e.metadata,r=this.getRelevantPublications();return o.createElement(o.Fragment,null,o.createElement(