From 6e6a7802e8361f631c153b95c0c8b30fbbfc9cc1 Mon Sep 17 00:00:00 2001 From: joshmoore Date: Tue, 8 Oct 2024 11:50:56 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ome/ome2?= =?UTF-8?q?024-ngff-challenge@deacc058d7981f8ccc00a80664846b5a7c08281b=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/index-BTYz6GCV.js | 22 ---------------------- assets/index-Bmc_C3DB.js | 22 ++++++++++++++++++++++ index.html | 4 ++-- 3 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 assets/index-BTYz6GCV.js create mode 100644 assets/index-Bmc_C3DB.js diff --git a/assets/index-BTYz6GCV.js b/assets/index-BTYz6GCV.js deleted file mode 100644 index 508fa8e..0000000 --- a/assets/index-BTYz6GCV.js +++ /dev/null @@ -1,22 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/blosc-E49GQuAK.js","assets/chunk-INHXZS53-D3tQiqtZ.js","assets/gzip-CF-9a_hd.js","assets/browser-B-ZyVB-j.js","assets/lz4-BIGKWw27.js","assets/zlib-CBiqHlio.js","assets/zstd-IvP746pw.js"])))=>i.map(i=>d[i]); -var Hr=Object.defineProperty;var Sn=t=>{throw TypeError(t)};var Kr=(t,e,n)=>e in t?Hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ee=(t,e,n)=>Kr(t,typeof e!="symbol"?e+"":e,n),xt=(t,e,n)=>e.has(t)||Sn("Cannot "+n);var H=(t,e,n)=>(xt(t,e,"read from private field"),n?n.call(t):e.get(t)),Ae=(t,e,n)=>e.has(t)?Sn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),me=(t,e,n,r)=>(xt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),en=(t,e,n)=>(xt(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function be(){}const Cr=t=>t;function Rr(t){return t()}function Ln(){return Object.create(null)}function Ge(t){t.forEach(Rr)}function pn(t){return typeof t=="function"}function Ye(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Ut;function In(t,e){return t===e?!0:(Ut||(Ut=document.createElement("a")),Ut.href=e,t===Ut.href)}function Vr(t){return Object.keys(t).length===0}function Gr(t,...e){if(t==null){for(const r of e)r(void 0);return be}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Yr(t){let e;return Gr(t,n=>e=n)(),e}const Tr=typeof window<"u";let Qr=Tr?()=>window.performance.now():()=>Date.now(),mn=Tr?t=>requestAnimationFrame(t):be;const ut=new Set;function Or(t){ut.forEach(e=>{e.c(t)||(ut.delete(e),e.f())}),ut.size!==0&&mn(Or)}function Xr(t){let e;return ut.size===0&&mn(Or),{promise:new Promise(n=>{ut.add(e={c:t,f:n})}),abort(){ut.delete(e)}}}function g(t,e){t.appendChild(e)}function Sr(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Zr(t){const e=N("style");return e.textContent="/* empty */",xr(Sr(t),e),e.sheet}function xr(t,e){return g(t.head||t,e),e.sheet}function J(t,e,n){t.insertBefore(e,n||null)}function j(t){t.parentNode&&t.parentNode.removeChild(t)}function N(t){return document.createElement(t)}function X(t){return document.createTextNode(t)}function q(){return X(" ")}function bt(){return X("")}function tt(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function Lr(t){return function(e){return e.preventDefault(),t.call(this,e)}}function C(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function ei(t){return Array.from(t.childNodes)}function fe(t,e){e=""+e,t.data!==e&&(t.data=e)}function Qe(t,e,n,r){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,"")}function Dt(t,e,n){t.classList.toggle(e,!!n)}function ti(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}const Wt=new Map;let qt=0;function ni(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function ri(t,e){const n={stylesheet:Zr(e),rules:{}};return Wt.set(t,n),n}function Fn(t,e,n,r,i,s,o,u=0){const l=16.666/r;let c=`{ -`;for(let k=0;k<=1;k+=l){const b=e+(n-e)*s(k);c+=k*100+`%{${o(b,1-b)}} -`}const h=c+`100% {${o(n,1-n)}} -}`,p=`__svelte_${ni(h)}_${u}`,d=Sr(t),{stylesheet:y,rules:A}=Wt.get(d)||ri(d,t);A[p]||(A[p]=!0,y.insertRule(`@keyframes ${p} ${h}`,y.cssRules.length));const M=t.style.animation||"";return t.style.animation=`${M?`${M}, `:""}${p} ${r}ms linear ${i}ms 1 both`,qt+=1,p}function ii(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),i=n.length-r.length;i&&(t.style.animation=r.join(", "),qt-=i,qt||si())}function si(){mn(()=>{qt||(Wt.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&j(e)}),Wt.clear())})}let vt;function wt(t){vt=t}function oi(){if(!vt)throw new Error("Function called outside component initialization");return vt}function li(t){oi().$$.on_mount.push(t)}const at=[],sn=[];let ft=[];const Mn=[],ai=Promise.resolve();let on=!1;function ui(){on||(on=!0,ai.then(Ir))}function nt(t){ft.push(t)}const tn=new Set;let ot=0;function Ir(){if(ot!==0)return;const t=vt;do{try{for(;ott.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),ft=e}let pt;function hi(){return pt||(pt=Promise.resolve(),pt.then(()=>{pt=null})),pt}function nn(t,e,n){t.dispatchEvent(ti(`${e?"intro":"outro"}${n}`))}const zt=new Set;let qe;function Je(){qe={r:0,c:[],p:qe}}function He(){qe.r||Ge(qe.c),qe=qe.p}function P(t,e){t&&t.i&&(zt.delete(t),t.i(e))}function G(t,e,n,r){if(t&&t.o){if(zt.has(t))return;zt.add(t),qe.c.push(()=>{zt.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const di={duration:0};function Jt(t,e,n,r){let s=e(t,n,{direction:"both"}),o=r?0:1,u=null,l=null,c=null,h;function p(){c&&ii(t,c)}function d(A,M){const k=A.b-o;return M*=Math.abs(k),{a:o,b:A.b,d:k,duration:M,start:A.start,end:A.start+M,group:A.group}}function y(A){const{delay:M=0,duration:k=300,easing:b=Cr,tick:w=be,css:E}=s||di,V={start:Qr()+M,b:A};A||(V.group=qe,qe.r+=1),"inert"in t&&(A?h!==void 0&&(t.inert=h):(h=t.inert,t.inert=!0)),u||l?l=V:(E&&(p(),c=Fn(t,o,A,k,M,b,E)),A&&w(0,1),u=d(V,k),nt(()=>nn(t,A,"start")),Xr(U=>{if(l&&U>l.start&&(u=d(l,k),l=null,nn(t,u.b,"start"),E&&(p(),c=Fn(t,o,u.b,u.duration,0,b,s.css))),u){if(U>=u.end)w(o=u.b,1-o),nn(t,u.b,"end"),l||(u.b?p():--u.group.r||Ge(u.group.c)),u=null;else if(U>=u.start){const B=U-u.start;o=u.a+u.d*b(B/u.duration),w(o,1-o)}}return!!(u||l)}))}return{run(A){pn(s)?hi().then(()=>{s=s({direction:A?"in":"out"}),y(A)}):y(A)},end(){p(),u=l=null}}}function Ht(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Fr(t,e){G(t,1,1,()=>{e.delete(t.key)})}function Mr(t,e,n,r,i,s,o,u,l,c,h,p){let d=t.length,y=s.length,A=d;const M={};for(;A--;)M[t[A].key]=A;const k=[],b=new Map,w=new Map,E=[];for(A=y;A--;){const S=p(i,s,A),f=n(S);let a=o.get(f);a?E.push(()=>a.p(S,e)):(a=c(f,S),a.c()),b.set(f,k[A]=a),f in M&&w.set(f,Math.abs(A-M[f]))}const V=new Set,U=new Set;function B(S){P(S,1),S.m(u,h),o.set(S.key,S),h=S.first,y--}for(;d&&y;){const S=k[y-1],f=t[d-1],a=S.key,_=f.key;S===f?(h=S.first,d--,y--):b.has(_)?!o.has(a)||V.has(a)?B(S):U.has(_)?d--:w.get(a)>w.get(_)?(U.add(a),B(S)):(V.add(_),d--):(l(f,o),d--)}for(;d--;){const S=t[d];b.has(S.key)||l(S,o)}for(;y;)B(k[y-1]);return Ge(E),k}function ke(t){t&&t.c()}function ye(t,e,n){const{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),nt(()=>{const s=t.$$.on_mount.map(Rr).filter(pn);t.$$.on_destroy?t.$$.on_destroy.push(...s):Ge(s),t.$$.on_mount=[]}),i.forEach(nt)}function we(t,e){const n=t.$$;n.fragment!==null&&(ci(n.after_update),Ge(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function _i(t,e){t.$$.dirty[0]===-1&&(at.push(t),ui(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const A=y.length?y[0]:d;return c.ctx&&i(c.ctx[p],c.ctx[p]=A)&&(!c.skip_bound&&c.bound[p]&&c.bound[p](A),h&&_i(t,p)),d}):[],c.update(),h=!0,Ge(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){const p=ei(e.target);c.fragment&&c.fragment.l(p),p.forEach(j)}else c.fragment&&c.fragment.c();e.intro&&P(t.$$.fragment),ye(t,e.target,e.anchor),Ir()}wt(l)}class st{constructor(){ee(this,"$$");ee(this,"$$set")}$destroy(){we(this,1),this.$destroy=be}$on(e,n){if(!pn(n))return be;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!Vr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const pi="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(pi);const lt=[];function mi(t,e=be){let n;const r=new Set;function i(u){if(Ye(t,u)&&(t=u,n)){const l=!lt.length;for(const c of r)c[1](),lt.push(c,t);if(l){for(let c=0;c{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:s,subscribe:o}}var gi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nr={exports:{}};/* @license -Papa Parse -v5.4.1 -https://github.com/mholt/PapaParse -License: MIT -*/(function(t,e){(function(n,r){t.exports=r()})(gi,function n(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},i=!r.document&&!!r.postMessage,s=r.IS_PAPA_WORKER||!1,o={},u=0,l={parse:function(f,a){var _=(a=a||{}).dynamicTyping||!1;if(S(_)&&(a.dynamicTypingFunction=_,_={}),a.dynamicTyping=_,a.transform=!!S(a.transform)&&a.transform,a.worker&&l.WORKERS_SUPPORTED){var R=function(){if(!l.WORKERS_SUPPORTED)return!1;var L=(W=r.URL||r.webkitURL||null,z=n.toString(),l.BLOB_URL||(l.BLOB_URL=W.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",z,")();"],{type:"text/javascript"})))),O=new r.Worker(L),W,z;return O.onmessage=w,O.id=u++,o[O.id]=O}();return R.userStep=a.step,R.userChunk=a.chunk,R.userComplete=a.complete,R.userError=a.error,a.step=S(a.step),a.chunk=S(a.chunk),a.complete=S(a.complete),a.error=S(a.error),delete a.worker,void R.postMessage({input:f,config:a,workerId:R.id})}var T=null;return l.NODE_STREAM_INPUT,typeof f=="string"?(f=function(L){return L.charCodeAt(0)===65279?L.slice(1):L}(f),T=a.download?new p(a):new y(a)):f.readable===!0&&S(f.read)&&S(f.on)?T=new A(a):(r.File&&f instanceof File||f instanceof Object)&&(T=new d(a)),T.stream(f)},unparse:function(f,a){var _=!1,R=!0,T=",",L=`\r -`,O='"',W=O+O,z=!1,v=null,K=!1;(function(){if(typeof a=="object"){if(typeof a.delimiter!="string"||l.BAD_DELIMITERS.filter(function(F){return a.delimiter.indexOf(F)!==-1}).length||(T=a.delimiter),(typeof a.quotes=="boolean"||typeof a.quotes=="function"||Array.isArray(a.quotes))&&(_=a.quotes),typeof a.skipEmptyLines!="boolean"&&typeof a.skipEmptyLines!="string"||(z=a.skipEmptyLines),typeof a.newline=="string"&&(L=a.newline),typeof a.quoteChar=="string"&&(O=a.quoteChar),typeof a.header=="boolean"&&(R=a.header),Array.isArray(a.columns)){if(a.columns.length===0)throw new Error("Option columns is empty");v=a.columns}a.escapeChar!==void 0&&(W=a.escapeChar+O),(typeof a.escapeFormulae=="boolean"||a.escapeFormulae instanceof RegExp)&&(K=a.escapeFormulae instanceof RegExp?a.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var I=new RegExp(k(O),"g");if(typeof f=="string"&&(f=JSON.parse(f)),Array.isArray(f)){if(!f.length||Array.isArray(f[0]))return Me(null,f,z);if(typeof f[0]=="object")return Me(v||Object.keys(f[0]),f,z)}else if(typeof f=="object")return typeof f.data=="string"&&(f.data=JSON.parse(f.data)),Array.isArray(f.data)&&(f.fields||(f.fields=f.meta&&f.meta.fields||v),f.fields||(f.fields=Array.isArray(f.data[0])?f.fields:typeof f.data[0]=="object"?Object.keys(f.data[0]):[]),Array.isArray(f.data[0])||typeof f.data[0]=="object"||(f.data=[f.data])),Me(f.fields||[],f.data||[],z);throw new Error("Unable to serialize unrecognized input");function Me(F,Z,_e){var re="";typeof F=="string"&&(F=JSON.parse(F)),typeof Z=="string"&&(Z=JSON.parse(Z));var ge=Array.isArray(F)&&0=this._config.preview;if(s)r.postMessage({results:L,workerId:l.WORKER_ID,finished:W});else if(S(this._config.chunk)&&!_){if(this._config.chunk(L,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);L=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(L.data),this._completeResults.errors=this._completeResults.errors.concat(L.errors),this._completeResults.meta=L.meta),this._completed||!W||!S(this._config.complete)||L&&L.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),W||L&&L.meta.paused||this._nextChunk(),L}this._halted=!0},this._sendError=function(a){S(this._config.error)?this._config.error(a):s&&this._config.error&&r.postMessage({workerId:l.WORKER_ID,error:a,finished:!1})}}function p(f){var a;(f=f||{}).chunkSize||(f.chunkSize=l.RemoteChunkSize),h.call(this,f),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(_){this._input=_,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(a=new XMLHttpRequest,this._config.withCredentials&&(a.withCredentials=this._config.withCredentials),i||(a.onload=B(this._chunkLoaded,this),a.onerror=B(this._chunkError,this)),a.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var _=this._config.downloadRequestHeaders;for(var R in _)a.setRequestHeader(R,_[R])}if(this._config.chunkSize){var T=this._start+this._config.chunkSize-1;a.setRequestHeader("Range","bytes="+this._start+"-"+T)}try{a.send(this._config.downloadRequestBody)}catch(L){this._chunkError(L.message)}i&&a.status===0&&this._chunkError()}},this._chunkLoaded=function(){a.readyState===4&&(a.status<200||400<=a.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:a.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(_){var R=_.getResponseHeader("Content-Range");return R===null?-1:parseInt(R.substring(R.lastIndexOf("/")+1))}(a),this.parseChunk(a.responseText)))},this._chunkError=function(_){var R=a.statusText||_;this._sendError(new Error(R))}}function d(f){var a,_;(f=f||{}).chunkSize||(f.chunkSize=l.LocalChunkSize),h.call(this,f);var R=typeof FileReader<"u";this.stream=function(T){this._input=T,_=T.slice||T.webkitSlice||T.mozSlice,R?((a=new FileReader).onload=B(this._chunkLoaded,this),a.onerror=B(this._chunkError,this)):a=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(T.target.result)},this._chunkError=function(){this._sendError(a.error)}}function y(f){var a;h.call(this,f=f||{}),this.stream=function(_){return a=_,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var _,R=this._config.chunkSize;return R?(_=a.substring(0,R),a=a.substring(R)):(_=a,a=""),this._finished=!a,this.parseChunk(_)}}}function A(f){h.call(this,f=f||{});var a=[],_=!0,R=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(T){this._input=T,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){R&&a.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),a.length?this.parseChunk(a.shift()):_=!0},this._streamData=B(function(T){try{a.push(typeof T=="string"?T:T.toString(this._config.encoding)),_&&(_=!1,this._checkIsFinished(),this.parseChunk(a.shift()))}catch(L){this._streamError(L)}},this),this._streamError=B(function(T){this._streamCleanUp(),this._sendError(T)},this),this._streamEnd=B(function(){this._streamCleanUp(),R=!0,this._streamData("")},this),this._streamCleanUp=B(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function M(f){var a,_,R,T=Math.pow(2,53),L=-T,O=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,W=/^((\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)))$/,z=this,v=0,K=0,I=!1,Me=!1,ce=[],F={data:[],errors:[],meta:{}};if(S(f.step)){var Z=f.step;f.step=function($){if(F=$,ge())re();else{if(re(),F.data.length===0)return;v+=$.data.length,f.preview&&v>f.preview?_.abort():(F.data=F.data[0],Z(F,z))}}}function _e($){return f.skipEmptyLines==="greedy"?$.join("").trim()==="":$.length===1&&$[0].length===0}function re(){return F&&R&&(he("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),R=!1),f.skipEmptyLines&&(F.data=F.data.filter(function($){return!_e($)})),ge()&&function(){if(!F)return;function $(se,ue){S(f.transformHeader)&&(se=f.transformHeader(se,ue)),ce.push(se)}if(Array.isArray(F.data[0])){for(var Y=0;ge()&&Y=ce.length?"__parsed_extra":ce[Q]),f.transform&&(ne=f.transform(ne,le)),ne=oe(le,ne),le==="__parsed_extra"?(ve[le]=ve[le]||[],ve[le].push(ne)):ve[le]=ne}return f.header&&(Q>ce.length?he("FieldMismatch","TooManyFields","Too many fields: expected "+ce.length+" fields but parsed "+Q,K+ue):Q=Se.length/2?`\r -`:"\r"}($,ue)),R=!1,f.delimiter)S(f.delimiter)&&(f.delimiter=f.delimiter($),F.meta.delimiter=f.delimiter);else{var Q=function(le,ne,Re,Se,Le){var $e,Ie,ie,ae;Le=Le||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ze=0;ze=O)return Ce(!0)}else for(x=v,v++;;){if((x=I.indexOf(a,x+1))===-1)return ce||he.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:oe.length,index:v}),Ee();if(x===F-1)return Ee(I.substring(v,x).replace(ze,a));if(a!==z||I[x+1]!==z){if(a===z||x===0||I[x-1]!==z){ie!==-1&&ie=O)return Ce(!0);break}he.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:oe.length,index:v}),x++}}else x++}return Ee();function pe(te){oe.push(te),Y=v}function De(te){var Te=0;if(te!==-1){var de=I.substring(x+1,te);de&&de.trim()===""&&(Te=de.length)}return Te}function Ee(te){return ce||(te===void 0&&(te=I.substring(v)),$.push(te),v=F,pe($),ge&&Fe()),Ce()}function Be(te){v=te,pe($),$=[],ae=I.indexOf(R,v)}function Ce(te){return{data:oe,errors:he,meta:{delimiter:_,linebreak:R,aborted:K,truncated:!!te,cursor:Y+(Me||0)}}}function Fe(){L(Ce()),oe=[],he=[]}},this.abort=function(){K=!0},this.getCharIndex=function(){return v}}function w(f){var a=f.data,_=o[a.workerId],R=!1;if(a.error)_.userError(a.error,a.file);else if(a.results&&a.results.data){var T={abort:function(){R=!0,E(a.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:V,resume:V};if(S(_.userStep)){for(var L=0;L1&&(s=o,i.data.shift());let u=i.data.map(p=>{let d={...n};for(let y=0;y{var d;return!((d=p.url)!=null&&d.endsWith(".csv"))}),c={};if(l.forEach(p=>{if(c[p.url]){console.warn("Removing duplicate URL:",p.url);return}c[p.url]=p}),l=Object.values(c),r){let p=l.length,d=l.reduce((y,A)=>y+parseInt(A.written)||0,0);l=l.slice(0,r).map(y=>({...y,csv_row_count:p,written:d}))}e.addRows(l),u.filter(p=>{var d;return(d=p.url)==null?void 0:d.includes(".csv")}).forEach(p=>{let d=p.url;p.url=void 0,p.csv=d,gn(d,e,p,1)})}})}async function Ur(t){return await fetch(t).then(e=>e.json())}async function vi(t){let e=t.replace("NCBI:txid","");return(await Ur(`https://rest.ensembl.org/taxonomy/id/${e}?content-type=application/json`)).name||t}async function ki(t){const e=t.replace("obo:","");return(await Ur(`https://www.ebi.ac.uk/ols4/api/ontologies/fbbi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252F${e}`)).label}function Kt(t){if(!t)return"";const e=2;return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(e)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(e)+" MB":t<1024*1024*1024*1024?(t/(1024*1024*1024)).toFixed(e)+" GB":t<1024*1024*1024*1024*1024?(t/(1024*1024*1024*1024)).toFixed(e)+" TB":(t/(1024*1024*1024*1024*1024)).toFixed(e)+" PB"}function Nn(t,e){return Array.from({length:e-t},(n,r)=>r+t)}function Ei(t,e,n){const r=t[0].shape,i=r[0],s=r[1],o=i*s;e||(e=t.map(Dr));const u=new Uint8ClampedArray(4*i*s).fill(0);let l=0;for(let c=0;ci?s:[]);for(const[i,s]of r.entries())n[s]=Un[i]}return n.map(Br)}function Br(t){t.startsWith("#")&&(t=t.slice(1));const e=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[e,n,r]}const Bt=5;async function ln(t){var r;let e=await fetch(`${t}/zarr.json`).then(i=>{if(console.log("loadMultiscales response",i.status),i.status===404)throw new Error(`${t}/zarr.json not found`);return i.json()}).catch(i=>(console.log(`----> Failed to load ${t}/zarr.json`,i),[void 0,t]));const n=(r=e==null?void 0:e.attributes)==null?void 0:r.ome;if(!n)return[void 0,t];if(n.multiscales)return[n.multiscales,t];if(n.plate){let i=n.plate.wells[0],s=`${t}/${i.path}/0`,[o,u]=await ln(s);return[o,u,n.plate]}else if(n["bioformats2raw.layout"]){let i=`${t}/0`;return await ln(i)}}class Ti{constructor(){this.store=mi([])}addRows(e){this.store.update(n=>{n.push(...e);async function r(i){for(let s=0;sthis.loadNgffMetadata(i[u].url));await Promise.all(o)}}return r.bind(this)(e),n})}populateRow(e,n){this.store.update(r=>(r=r.map(i=>(i.url===e&&(i={...i,...n},console.log("populateRow",n,i)),i)),r))}async loadNgffMetadata(e){var d;const[n,r,i]=await ln(e);let s=[],o=0,u=0,l=!1,c=!0,h={multiscales:n},p=r;if(i&&(o=i.wells.length,u=i.field_count||1),n){const y=(d=n[0])==null?void 0:d.datasets[0],A=y==null?void 0:y.path;if(A){const M=await fetch(`${r}/${A}/zarr.json`).then(k=>k.json()).catch(k=>{console.log(`----> Failed to parse ${r}/${A}/zarr.json`,k)});s=M==null?void 0:M.shape}}else console.log("No multiscales found"),l=!0,s=[0];this.populateRow(e,{image_attrs:h,image_url:p,shape:s,well_count:o,field_count:u,load_failed:l,loaded:c})}async loadRocrateJson(e){await fetch(`${e}/ro-crate-metadata.json`).then(n=>{if(console.log("loadMultiscales response",n.status),n.status===404)throw new Error(`${e}/ro-crate-metadata.json not found`);return n.json()}).then(n=>{var u,l;let r=n["@graph"].find(c=>c["@type"]==="biosample"),i=(u=r==null?void 0:r.organism_classification)==null?void 0:u["@id"],s=n["@graph"].find(c=>c["@type"]==="image_acquisition"),o=(l=s==null?void 0:s.fbbi_id)==null?void 0:l["@id"];this.populateRow(e,{organism_id:i,fbbi_id:o,rocrate_loaded:!0})}).catch(n=>{console.log("Failed to load ro-crate-metadata.json",n)})}async loadRocrateJsonAllRows(){let e=Yr(this.store);for(let n=0;nthis.loadRocrateJson(e[i].url));await Promise.all(r)}}compareRows(e,n){let r=e[this.sortColumn],i=n[this.sortColumn];r===void 0&&(r=""),i===void 0&&(i="");let s=0;return typeof r=="number"?s=r-i:s=r.localeCompare(i),this.sortAscending?s:-s}sortTable(e,n=!0){this.sortColumn=e,this.sortAscending=n,this.store.update(r=>(r.sort((i,s)=>this.compareRows(i,s)),r))}emptyTable(){this.store.set([])}subscribe(e){return this.store.subscribe(e)}}const Xe=new Ti;function Oi(t){const e=t-1;return e*e*e+1}function Dn(t,{delay:e=0,duration:n=400,easing:r=Cr}={}){const i=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:r,css:s=>`opacity: ${s*i}`}}function Bn(t,{delay:e=0,duration:n=400,easing:r=Oi,start:i=0,opacity:s=0}={}){const o=getComputedStyle(t),u=+o.opacity,l=o.transform==="none"?"":o.transform,c=1-i,h=u*(1-s);return{delay:e,duration:n,easing:r,css:(p,d)=>` - transform: ${l} scale(${1-c*d}); - opacity: ${u-h*d} - `}}function zn(t){let e,n,r,i,s;return{c(){e=N("h2"),n=X(t[1]),r=X(" zarrs in "),i=X(t[0]),s=X(" collections")},m(o,u){J(o,e,u),g(e,n),g(e,r),g(e,i),g(e,s)},p(o,u){u&2&&fe(n,o[1]),u&1&&fe(i,o[0])},d(o){o&&j(e)}}}function Si(t){let e,n=t[1]>0&&zn(t);return{c(){n&&n.c(),e=bt()},m(r,i){n&&n.m(r,i),J(r,e,i)},p(r,[i]){r[1]>0?n?n.p(r,i):(n=zn(r),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:be,o:be,d(r){r&&j(e),n&&n.d(r)}}}function Li(t,e,n){let r,i,{tableRows:s=[]}=e;return t.$$set=o=>{"tableRows"in o&&n(2,s=o.tableRows)},t.$$.update=()=>{t.$$.dirty&4&&n(1,r=s.reduce((o,u)=>o+(u.csv_row_count||0),0)),t.$$.dirty&4&&n(0,i=s.reduce((o,u)=>o+(u.csv_row_count?1:0),0))},[i,r,s]}class Ii extends st{constructor(e){super(),it(this,e,Li,Si,Ye,{tableRows:2})}}class Mt extends Error{constructor(e,n={}){super(`Node not found: ${e}`,n),this.name="NodeNotFoundError"}}class yn extends Error{constructor(e){super(`Missing key: ${e}`),this.name="KeyError"}}const Fi="modulepreload",Mi=function(t){return"/"+t},Pn={},mt=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.all(n.map(u=>{if(u=Mi(u),u in Pn)return;Pn[u]=!0;const l=u.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${c}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":Fi,l||(h.as="script"),h.crossOrigin="",h.href=u,o&&h.setAttribute("nonce",o),document.head.appendChild(h),l)return new Promise((p,d)=>{h.addEventListener("load",p),h.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${u}`)))})}))}return i.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var Ue;class zr{constructor(e,n,r){Ae(this,Ue);typeof e=="number"?me(this,Ue,new Uint8Array(e)):e instanceof ArrayBuffer?me(this,Ue,new Uint8Array(e,n,r)):me(this,Ue,new Uint8Array(Array.from(e,i=>i?1:0)))}get BYTES_PER_ELEMENT(){return 1}get byteOffset(){return H(this,Ue).byteOffset}get byteLength(){return H(this,Ue).byteLength}get buffer(){return H(this,Ue).buffer}get length(){return H(this,Ue).length}get(e){let n=H(this,Ue)[e];return typeof n=="number"?n!==0:n}set(e,n){H(this,Ue)[e]=n?1:0}fill(e){H(this,Ue).fill(e?1:0)}*[Symbol.iterator](){for(let e=0;e=0;r--)n[r]=i,i*=t[r];return n}function Bi(t){const e=t.length,n=globalThis.Array(e);for(let r=0,i=1;r["c",...r].join(n)}if(t==="v2"){const n=(e==null?void 0:e.separator)??".";return r=>r.join(n)||"0"}throw new Error(`Unknown chunk key encoding: ${t}`)}function an(t){var n;const e=t.find(r=>r.name==="transpose");return((n=e==null?void 0:e.configuration)==null?void 0:n.order)==="F"?"F":"C"}const Pi=/^([<|>])(.*)$/;function ji(t){if(t==="|O")return{data_type:"v2:object"};let e=t.match(Pi);if(!e)throw new Error(`Invalid dtype: ${t}`);let[,n,r]=e,i={b1:"bool",i1:"int8",u1:"uint8",i2:"int16",u2:"uint16",i4:"int32",u4:"uint32",i8:"int64",u8:"uint64",f4:"float32",f8:"float64"}[r]??(r.startsWith("S")||r.startsWith("U")?`v2:${r}`:void 0);if(!i)throw new Error(`Unsupported or unknown dtype: ${t}`);return n==="|"?{data_type:i}:{data_type:i,endian:n==="<"?"little":"big"}}function Wi(t,e={}){let n=[],r=ji(t.dtype);t.order==="F"&&n.push({name:"transpose",configuration:{order:"F"}}),"endian"in r&&r.endian==="big"&&n.push({name:"bytes",configuration:{endian:"big"}});for(let{id:i,...s}of t.filters??[])n.push({name:i,configuration:s});if(t.compressor){let{id:i,...s}=t.compressor;n.push({name:i,configuration:s})}return{zarr_format:3,node_type:"array",shape:t.shape,data_type:r.data_type,chunk_grid:{name:"regular",configuration:{chunk_shape:t.chunks}},chunk_key_encoding:{name:"v2",configuration:{separator:t.dimension_separator??"."}},codecs:n,fill_value:t.fill_value,attributes:e}}function qi(t,e={}){return{zarr_format:3,node_type:"group",attributes:e}}function Ji(t,e){if(e!=="number"&&e!=="bigint"&&e!=="boolean"&&e!=="object"&&e!=="string")return t===e;let n=t==="bool";if(e==="boolean")return n;let r=t.startsWith("v2:U")||t.startsWith("v2:S");if(e==="string")return r;let i=t==="int64"||t==="uint64";if(e==="bigint")return i;let s=t==="v2:object";return e==="object"?s:!r&&!i&&!n&&!s}function Hi(t){return(t==null?void 0:t.name)==="sharding_indexed"}function jr(t){return(t.data_type==="uint64"||t.data_type==="int64")&&t.fill_value!=null?BigInt(t.fill_value):t.fill_value}const Wn=Ki();function Ki(){const t=new Uint32Array([305419896]);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)[0]!==18}function qn(t){return"BYTES_PER_ELEMENT"in t?t.BYTES_PER_ELEMENT:4}var Et,Ke,At,$t,ht;const Cn=class Cn{constructor(e,n){ee(this,"kind","array_to_bytes");Ae(this,Et);Ae(this,Ke);Ae(this,At);Ae(this,$t);Ae(this,ht);me(this,ht,e==null?void 0:e.endian),me(this,Ke,Pr(n.data_type)),me(this,$t,n.shape),me(this,Et,rt(n.shape,an(n.codecs)));const r=new(H(this,Ke))(0);me(this,At,r.BYTES_PER_ELEMENT)}static fromConfig(e,n){return new Cn(e,n)}encode(e){let n=new Uint8Array(e.data.buffer);return Wn&&H(this,ht)==="big"&&jn(n,qn(H(this,Ke))),n}decode(e){return Wn&&H(this,ht)==="big"&&jn(e,qn(H(this,Ke))),{data:new(H(this,Ke))(e.buffer,e.byteOffset,e.byteLength/H(this,At)),shape:H(this,$t),stride:H(this,Et)}}};Et=new WeakMap,Ke=new WeakMap,At=new WeakMap,$t=new WeakMap,ht=new WeakMap;let Vt=Cn;class bn{constructor(){ee(this,"kind","bytes_to_bytes")}static fromConfig(){return new bn}encode(e){throw new Error("Not implemented")}decode(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength-4)}}function Vi(t,e){if(Number.isNaN(e))throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");if(e===Number.POSITIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");if(e===Number.NEGATIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");return e}function Gi(t,e){return e instanceof Object&&!Array.isArray(e)?Object.keys(e).sort().reduce((n,r)=>(n[r]=e[r],n),{}):e}var Ct,Rt;const Rn=class Rn{constructor(e={}){ee(this,"configuration");ee(this,"kind","array_to_bytes");Ae(this,Ct);Ae(this,Rt);this.configuration=e;const{encoding:n="utf-8",skipkeys:r=!1,ensure_ascii:i=!0,check_circular:s=!0,allow_nan:o=!0,sort_keys:u=!0,indent:l,strict:c=!0}=e;let h=e.separators;h||(l?h=[", ",": "]:h=[",",":"]),me(this,Ct,{encoding:n,skipkeys:r,ensure_ascii:i,check_circular:s,allow_nan:o,indent:l,separators:h,sort_keys:u}),me(this,Rt,{strict:c})}static fromConfig(e){return new Rn(e)}encode(e){const{indent:n,encoding:r,ensure_ascii:i,check_circular:s,allow_nan:o,sort_keys:u}=H(this,Ct);if(r!=="utf-8")throw new Error("JsonCodec does not yet support non-utf-8 encoding.");const l=[];if(!s)throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");o||l.push(Vi),u&&l.push(Gi);const c=Array.from(e.data);c.push("|O"),c.push(e.shape);let h;l.length&&(h=(d,y)=>{let A=y;for(let M of l)A=M(d,A);return A});let p=JSON.stringify(c,h,n);return i&&(p=p.replace(/[\u007F-\uFFFF]/g,d=>{const y=`0000${d.charCodeAt(0).toString(16)}`;return`\\u${y.substring(y.length-4)}`})),new TextEncoder().encode(p)}decode(e){const{strict:n}=H(this,Rt);if(!n)throw new Error("JsonCodec does not yet support non-strict decoding.");const r=Nt(e),i=r.pop();if(r.pop(),!i)throw new Error("0D not implemented for JsonCodec.");const s=rt(i,"C");return{data:r,shape:i,stride:s}}};Ct=new WeakMap,Rt=new WeakMap;let un=Rn;function Jn(t){return t instanceof zr||t instanceof wn||t instanceof kt?new Proxy(t,{get(n,r){return n.get(Number(r))},set(n,r,i){return n.set(Number(r),i),!0}}):t}function Yi(t,e){let n;return t.data instanceof wn||t.data instanceof kt?n=new t.constructor(t.data.length,t.data.chars):n=new t.constructor(t.data.length),{data:n,shape:t.shape,stride:rt(t.shape,e)}}function Qi(t,e){let n=Yi(t,e),r=t.shape.length,i=t.data.length,s=Array(r).fill(0),o=Jn(t.data),u=Jn(n.data);for(let l=0;ln===e[r])?"C":"F"}class vn{constructor(e){ee(this,"configuration");ee(this,"kind","array_to_array");this.configuration=e}static fromConfig(e){return new vn(e)}encode(e){var n,r;return Xi(e)===((n=this.configuration)==null?void 0:n.order)?e:Qi(e,((r=this.configuration)==null?void 0:r.order)??"C")}decode(e){return e}}var Tt,Ot;const Tn=class Tn{constructor(e){ee(this,"kind","array_to_bytes");Ae(this,Tt);Ae(this,Ot);me(this,Tt,e),me(this,Ot,rt(e,"C"))}static fromConfig(e,n){return new Tn(n.shape)}encode(e){throw new Error("Method not implemented.")}decode(e){let n=new TextDecoder,r=new DataView(e.buffer),i=Array(r.getUint32(0,!0)),s=4;for(let o=0;omt(()=>import("./blosc-E49GQuAK.js"),__vite__mapDeps([0,1])).then(t=>t.default)).set("gzip",()=>mt(()=>import("./gzip-CF-9a_hd.js"),__vite__mapDeps([2,3])).then(t=>t.default)).set("lz4",()=>mt(()=>import("./lz4-BIGKWw27.js"),__vite__mapDeps([4,1])).then(t=>t.default)).set("zlib",()=>mt(()=>import("./zlib-CBiqHlio.js"),__vite__mapDeps([5,3])).then(t=>t.default)).set("zstd",()=>mt(()=>import("./zstd-IvP746pw.js"),__vite__mapDeps([6,1])).then(t=>t.default)).set("transpose",()=>vn).set("bytes",()=>Vt).set("crc32c",()=>bn).set("vlen-utf8",()=>fn).set("json2",()=>un)}const xi=Zi();function cn(t){let e;return{async encode(n){e||(e=await Hn(t));for(const i of e.array_to_array)n=await i.encode(n);let r=await e.array_to_bytes.encode(n);for(const i of e.bytes_to_bytes)r=await i.encode(r);return r},async decode(n){e||(e=await Hn(t));for(let i=e.bytes_to_bytes.length-1;i>=0;i--)n=await e.bytes_to_bytes[i].decode(n);let r=await e.array_to_bytes.decode(n);for(let i=e.array_to_array.length-1;i>=0;i--)r=await e.array_to_array[i].decode(r);return r}}}async function Hn(t){let e=t.codecs.map(async s=>{var u;let o=await((u=xi.get(s.name))==null?void 0:u());if(!o)throw new Error(`Unknown codec: ${s.name}`);return{Codec:o,meta:s}}),n=[],r,i=[];for await(let{Codec:s,meta:o}of e){let u=s.fromConfig(o.configuration,t);switch(u.kind){case"array_to_array":n.push(u);break;case"array_to_bytes":r=u;break;default:i.push(u)}}if(!r){if(!es(t))throw new Error(`Cannot encode ${t.data_type} to bytes without a codec`);r=Vt.fromConfig({endian:"little"},t)}return{array_to_array:n,array_to_bytes:r,bytes_to_bytes:i}}function es(t){return t.data_type!=="v2:object"}const Kn=18446744073709551615n;function ts(t,e,n,r){if(t.store.getRange===void 0)throw new Error("Store does not support range requests");let i=t.store.getRange.bind(t.store),s=e.map((l,c)=>l/r.chunk_shape[c]),o=cn({data_type:"uint64",shape:[...s,2],codecs:r.index_codecs}),u={};return async l=>{let c=l.map((w,E)=>Math.floor(w/s[E])),h=t.resolve(n(c)).path,p;if(h in u)p=u[h];else{let w=4,E=16*s.reduce((U,B)=>U*B,1),V=await i(h,{suffixLength:E+w});p=u[h]=V?await o.decode(V):null}if(p===null)return;let{data:d,shape:y,stride:A}=p,M=l.map((w,E)=>w%y[E]).reduce((w,E,V)=>w+E*A[V],0),k=d[M],b=d[M+1];if(!(k===Kn&&b===Kn))return i(h,{offset:Number(k),length:Number(b)})}}class dt{constructor(e,n="/"){ee(this,"store");ee(this,"path");this.store=e,this.path=n}resolve(e){let n=new URL(`file://${this.path.endsWith("/")?this.path:`${this.path}/`}`);return new dt(this.store,new URL(e,n).pathname)}}var St;class kn extends dt{constructor(n,r,i){super(n,r);ee(this,"kind","group");Ae(this,St);me(this,St,i)}get attrs(){return H(this,St).attributes}}St=new WeakMap;const yt=Symbol("zarrita.context");function ns(t){return t[yt]}function rs(t,e){let{configuration:n}=e.codecs.find(Hi)??{},r={encode_chunk_key:zi(e.chunk_key_encoding),TypedArray:Pr(e.data_type),fill_value:e.fill_value};if(n){let s=an(n.codecs);return{...r,kind:"sharded",chunk_shape:n.chunk_shape,codec:cn({data_type:e.data_type,shape:n.chunk_shape,codecs:n.codecs}),get_strides(o,u){return rt(o,u??s)},get_chunk_bytes:ts(t,e.chunk_grid.configuration.chunk_shape,r.encode_chunk_key,n)}}let i=an(e.codecs);return{...r,kind:"regular",chunk_shape:e.chunk_grid.configuration.chunk_shape,codec:cn({data_type:e.data_type,shape:e.chunk_grid.configuration.chunk_shape,codecs:e.codecs}),get_strides(s,o){return rt(s,o??i)},async get_chunk_bytes(s,o){let u=r.encode_chunk_key(s),l=t.resolve(u).path;return t.store.get(l,o)}}}var Er,Ar,xe,$r;let Gt=($r=class extends(Ar=dt,Er=yt,Ar){constructor(n,r,i){super(n,r);ee(this,"kind","array");Ae(this,xe);ee(this,Er);me(this,xe,{...i,fill_value:jr(i)}),this[yt]=rs(this,i)}get attrs(){return H(this,xe).attributes}get shape(){return H(this,xe).shape}get chunks(){return this[yt].chunk_shape}get dtype(){return H(this,xe).data_type}async getChunk(n,r){let i=this[yt],s=await i.get_chunk_bytes(n,r);if(!s){let o=i.chunk_shape.reduce((l,c)=>l*c,1),u=new i.TypedArray(o);return u.fill(i.fill_value),{data:u,shape:i.chunk_shape,stride:i.get_strides(i.chunk_shape)}}return i.codec.decode(s)}is(n){return Ji(this.dtype,n)}},xe=new WeakMap,$r),Qt=is();function is(){let t=new WeakMap;function e(n){let r=t.get(n)??{v2:0,v3:0};return t.set(n,r),r}return{increment(n,r){e(n)[r]+=1},version_max(n){let r=e(n);return r.v3>r.v2?"v3":"v2"}}}async function ss(t){let e=await t.store.get(t.resolve(".zattrs").path);return e?Nt(e):{}}async function os(t,e={}){let n="store"in t?t:new dt(t),r={};return(e.attrs??!0)&&(r=await ss(n)),e.kind==="array"?Vn(n,r):e.kind==="group"?Gn(n,r):Vn(n,r).catch(i=>{if(i instanceof Mt)return Gn(n,r);throw i})}async function Vn(t,e){let{path:n}=t.resolve(".zarray"),r=await t.store.get(n);if(!r)throw new Mt("v2 array",{cause:new yn(n)});return Qt.increment(t.store,"v2"),new Gt(t.store,t.path,Wi(Nt(r),e))}async function Gn(t,e){let{path:n}=t.resolve(".zgroup"),r=await t.store.get(n);if(!r)throw new Mt("v2 group",{cause:new yn(n)});return Qt.increment(t.store,"v2"),new kn(t.store,t.path,qi(Nt(r),e))}async function ls(t){let{store:e,path:n}=t.resolve("zarr.json"),r=await t.store.get(n);if(!r)throw new Mt("v3 array or group",{cause:new yn(n)});let i=Nt(r);return i.node_type==="array"&&(i.fill_value=jr(i)),i.node_type==="array"?new Gt(e,t.path,i):new kn(e,t.path,i)}async function as(t,e={}){let n="store"in t?t:new dt(t),r=await ls(n);if(Qt.increment(n.store,"v3"),e.kind===void 0||e.kind==="array"&&r instanceof Gt||e.kind==="group"&&r instanceof kn)return r;let i=r instanceof Gt?"array":"group";throw new Error(`Expected node of kind ${e.kind}, found ${i}.`)}async function Ze(t,e={}){let n="store"in t?t.store:t,r=Qt.version_max(n),i=r==="v2"?Ze.v2:Ze.v3,s=r==="v2"?Ze.v3:Ze.v2;return i(t,e).catch(o=>{if(o instanceof Mt)return s(t,e);throw o})}Ze.v2=os;Ze.v3=as;function*us(t,e,n=1){e===void 0&&(e=t,t=0);for(let r=t;rr[Symbol.iterator]()),n=e.map(r=>r.next());if(n.some(r=>r.done))throw new Error("Input contains an empty iterator.");for(let r=0;;){if(n[r].done){if(e[r]=t[r][Symbol.iterator](),n[r]=e[r].next(),++r>=e.length)return}else yield n.map(({value:i})=>i),r=0;n[r]=e[r].next()}}function cs({start:t,stop:e,step:n},r){if(n===0)throw new Error("slice step cannot be zero");n=n??1;const i=n<0,[s,o]=i?[-1,r-1]:[0,r];return t===null?t=i?o:s:t<0?(t+=r,to&&(t=o),e===null?e=i?s:o:e<0?(e+=r,eo&&(e=o),[t,e,n]}function hn(t,e,n=null){return e===void 0&&(e=t,t=null),{start:t,stop:e,step:n}}function hs(){const t=[];return{add:e=>t.push(e()),onIdle:()=>Promise.all(t)}}class En extends Error{constructor(e){super(e),this.name="IndexError"}}function ds(t,e){throw new En(`too many indicies for array; expected ${e.length}, got ${t.length}`)}function _s(t){throw new En(`index out of bounds for dimension with length ${t}`)}function ps(){throw new En("only slices with step >= 1 are supported")}function ms(t,e){t.length>e.length&&ds(t,e)}function gs(t,e){return t=Math.trunc(t),t<0&&(t=e+t),(t>=e||t<0)&&_s(e),t}class ys{constructor({dim_sel:e,dim_len:n,dim_chunk_len:r}){ee(this,"dim_sel");ee(this,"dim_len");ee(this,"dim_chunk_len");ee(this,"nitems");e=gs(e,n),this.dim_sel=e,this.dim_len=n,this.dim_chunk_len=r,this.nitems=1}*[Symbol.iterator](){const e=Math.floor(this.dim_sel/this.dim_chunk_len),n=e*this.dim_chunk_len,r=this.dim_sel-n;yield{dim_chunk_ix:e,dim_chunk_sel:r}}}class Yn{constructor({dim_sel:e,dim_len:n,dim_chunk_len:r}){ee(this,"start");ee(this,"stop");ee(this,"step");ee(this,"dim_len");ee(this,"dim_chunk_len");ee(this,"nitems");ee(this,"nchunks");const[i,s,o]=cs(e,n);this.start=i,this.stop=s,this.step=o,this.step<1&&ps(),this.dim_len=n,this.dim_chunk_len=r,this.nitems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.nchunks=Math.ceil(this.dim_len/this.dim_chunk_len)}*[Symbol.iterator](){const e=Math.floor(this.start/this.dim_chunk_len),n=Math.ceil(this.stop/this.dim_chunk_len);for(const r of us(e,n)){const i=r*this.dim_chunk_len,s=Math.min(this.dim_len,(r+1)*this.dim_chunk_len),o=s-i;let u=0,l=0;if(this.starts?o:this.stop-i,h=[l,c,this.step],p=Math.ceil((c-l)/this.step),d=[u,u+p,1];yield{dim_chunk_ix:r,dim_chunk_sel:h,dim_out_sel:d}}}}function ws(t,e){let n=[];return t===null?n=e.map(r=>hn(null)):Array.isArray(t)&&(n=t.map(r=>r??hn(null))),ms(n,e),n}class bs{constructor({selection:e,shape:n,chunk_shape:r}){ee(this,"dim_indexers");ee(this,"shape");this.dim_indexers=ws(e,n).map((i,s)=>new(typeof i=="number"?ys:Yn)({dim_sel:i,dim_len:n[s],dim_chunk_len:r[s]})),this.shape=this.dim_indexers.filter(i=>i instanceof Yn).map(i=>i.nitems)}*[Symbol.iterator](){for(const e of fs(...this.dim_indexers)){const n=e.map(i=>i.dim_chunk_ix),r=e.map(i=>"dim_out_sel"in i?{from:i.dim_chunk_sel,to:i.dim_out_sel}:{from:i.dim_chunk_sel,to:null});yield{chunk_coords:n,mapping:r}}}}function vs(t,e){return"get"in t?t.get(e):t[e]}async function ks(t,e,n,r){var l;let i=ns(t),s=new bs({selection:e,shape:t.shape,chunk_shape:t.chunks}),o=r.prepare(new i.TypedArray(s.shape.reduce((c,h)=>c*h,1)),s.shape,i.get_strides(s.shape,n.order)),u=((l=n.create_queue)==null?void 0:l.call(n))??hs();for(const{chunk_coords:c,mapping:h}of s)u.add(async()=>{let{data:p,shape:d,stride:y}=await t.getChunk(c,n.opts),A=r.prepare(p,d,y);r.set_from_chunk(o,A,h)});return await u.onIdle(),s.shape.length===0?vs(o.data,0):o}function An(t,e=0,n){let r=n??t.length-e;return{length:r,subarray(i,s=r){return An(t,e+i,s-i)},set(i,s=0){for(let o=0;oO.path),y=i.multiscales[0].axes.map(O=>O.name),A=d.at(-1);const M=new Os(r+"/"+A),k=await Ze(M,{kind:"array"});let b=y.indexOf("c"),w=k.shape;if(w.at(-1)*w.at(-2)>s*s){console.log("Lowest resolution too large for Thumbnail: ",w,r);return}let E=w.length;k.chunks;let V=w[b],U,B;(L=i==null?void 0:i.omero)!=null&&L.channels?(U=i.omero.channels.map(O=>O.active),B=i.omero.channels.map(O=>Br(O.color))):(U=Ci(V),B=Ri(V,U)),B=B.filter((O,W)=>U[W]);let f=U.reduce((O,W,z)=>(W&&O.push(z),O),[]).map(O=>{let W=w.map((z,v)=>v==b?O:v>=E-2?hn(0,z):y[v]=="z"||y[v]=="t"?parseInt(z/2+""):0);return Cs(k,W)}),a=await Promise.all(f),_=a.map(O=>Dr(O)),R=Ei(a,_,B);n(2,l=w.at(-1)),n(3,c=w.at(-2));let T=l/Zn;c>l&&(T=c/Zn),n(1,u=l/T),setTimeout(()=>{o.getContext("2d").putImageData(new ImageData(R,l,c),0,0)},100)}li(()=>{h()});function p(d){sn[d?"unshift":"push"](()=>{o=d,n(0,o)})}return t.$$set=d=>{"source"in d&&n(4,r=d.source),"attrs"in d&&n(5,i=d.attrs),"max_size"in d&&n(6,s=d.max_size)},[o,u,l,c,r,i,s,p]}class Jr extends st{constructor(e){super(),it(this,e,Ls,Ss,Ye,{source:4,attrs:5,max_size:6})}}function xn(t,e,n){const r=t.slice();return r[9]=e[n],r}function er(t){let e,n,r,i=t[4](t[9].source),s,o,u=t[9].csv_row_count+"",l,c,h=t[9].well_count?"plates":"images",p,d,y,A=or(t[9])+"",M,k,b,w,E,V,U=t[9].image_attrs&&tr(t),B=i&&nr(t),S=t[9].source&&rr(t);function f(){return t[5](t[9])}return{c(){e=N("a"),n=N("div"),U&&U.c(),r=q(),B&&B.c(),s=q(),S&&S.c(),o=q(),l=X(u),c=q(),p=X(h),d=q(),y=N("div"),M=X(A),k=q(),C(y,"class","hoverInfo svelte-c69c1m"),C(n,"class","item svelte-c69c1m"),C(e,"href",b=window.location.origin+"?csv="+t[9].csv)},m(a,_){J(a,e,_),g(e,n),U&&U.m(n,null),g(n,r),B&&B.m(n,null),g(n,s),S&&S.m(n,null),g(n,o),g(n,l),g(n,c),g(n,p),g(n,d),g(n,y),g(y,M),g(e,k),w=!0,E||(V=tt(e,"click",Lr(f)),E=!0)},p(a,_){t=a,t[9].image_attrs?U?(U.p(t,_),_&2&&P(U,1)):(U=tr(t),U.c(),P(U,1),U.m(n,r)):U&&(Je(),G(U,1,1,()=>{U=null}),He()),_&2&&(i=t[4](t[9].source)),i?B?B.p(t,_):(B=nr(t),B.c(),B.m(n,s)):B&&(B.d(1),B=null),t[9].source?S?S.p(t,_):(S=rr(t),S.c(),S.m(n,o)):S&&(S.d(1),S=null),(!w||_&2)&&u!==(u=t[9].csv_row_count+"")&&fe(l,u),(!w||_&2)&&h!==(h=t[9].well_count?"plates":"images")&&fe(p,h),(!w||_&2)&&A!==(A=or(t[9])+"")&&fe(M,A),(!w||_&2&&b!==(b=window.location.origin+"?csv="+t[9].csv))&&C(e,"href",b)},i(a){w||(P(U),w=!0)},o(a){G(U),w=!1},d(a){a&&j(e),U&&U.d(),B&&B.d(),S&&S.d(),E=!1,V()}}}function tr(t){let e,n;return e=new Jr({props:{attrs:t[9].image_attrs,source:t[9].image_url,max_size:t[2]}}),{c(){ke(e.$$.fragment)},m(r,i){ye(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.attrs=r[9].image_attrs),i&2&&(s.source=r[9].image_url),i&4&&(s.max_size=r[2]),e.$set(s)},i(r){n||(P(e.$$.fragment,r),n=!0)},o(r){G(e.$$.fragment,r),n=!1},d(r){we(e,r)}}}function nr(t){let e,n,r;return{c(){e=N("img"),C(e,"alt",n="Icon from "+t[9].source),C(e,"class","source_icon svelte-c69c1m"),In(e.src,r=t[4](t[9].source))||C(e,"src",r)},m(i,s){J(i,e,s)},p(i,s){s&2&&n!==(n="Icon from "+i[9].source)&&C(e,"alt",n),s&2&&!In(e.src,r=i[4](i[9].source))&&C(e,"src",r)},d(i){i&&j(e)}}}function rr(t){let e,n=t[9].source+"",r,i;return{c(){e=N("span"),r=X(n),i=X(":"),C(e,"class","source svelte-c69c1m")},m(s,o){J(s,e,o),g(e,r),g(e,i)},p(s,o){o&2&&n!==(n=s[9].source+"")&&fe(r,n)},d(s){s&&j(e)}}}function ir(t,e){let n,r,i,s=e[9].csv_row_count&&e[9].csv&&er(e);return{key:t,first:null,c(){n=bt(),s&&s.c(),r=bt(),this.first=n},m(o,u){J(o,n,u),s&&s.m(o,u),J(o,r,u),i=!0},p(o,u){e=o,e[9].csv_row_count&&e[9].csv?s?(s.p(e,u),u&2&&P(s,1)):(s=er(e),s.c(),P(s,1),s.m(r.parentNode,r)):s&&(Je(),G(s,1,1,()=>{s=null}),He())},i(o){i||(P(s),i=!0)},o(o){G(s),i=!1},d(o){o&&(j(n),j(r)),s&&s.d(o)}}}function sr(t){let e,n,r,i,s,o,u;return{c(){e=N("p"),n=N("a"),r=X("< Show all samples"),C(n,"class","home svelte-c69c1m"),C(n,"title","Show ALL samples"),C(n,"href",window.location.origin+"?csv="+et),C(e,"class","svelte-c69c1m")},m(l,c){J(l,e,c),g(e,n),g(n,r),s=!0,o||(u=tt(n,"click",Lr(t[6])),o=!0)},p:be,i(l){s||(l&&nt(()=>{s&&(i||(i=Jt(e,Bn,{duration:500,delay:0,opacity:.5,start:.5},!0)),i.run(1))}),s=!0)},o(l){l&&(i||(i=Jt(e,Bn,{duration:500,delay:0,opacity:.5,start:.5},!1)),i.run(0)),s=!1},d(l){l&&j(e),l&&i&&i.end(),o=!1,u()}}}function Is(t){let e,n,r,i=[],s=new Map,o,u,l,c,h,p,d,y;e=new Ii({props:{tableRows:t[1]}});let A=Ht(t[1]);const M=b=>b[9].url;for(let b=0;b{k=null}),He())},i(b){if(!y){P(e.$$.fragment,b);for(let w=0;w{n(1,i=d),d.length<100?n(2,s=2048):n(2,s=512)});function l(d){console.log("handleThumbClick",d,et),d!==et&&u(),Xe.emptyTable(),n(0,r=d),gn(r,Xe)}function c(d){if(d==="IDR")return"/idr-mark.svg";let y=o[d];return y?`https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=${y}&size=24`:null}const h=d=>l(d.csv),p=()=>l(et);return t.$$set=d=>{"csvUrl"in d&&n(0,r=d.csvUrl)},[r,i,s,l,c,h,p]}class Ms extends st{constructor(e){super(),it(this,e,Fs,Is,Ye,{csvUrl:0})}}function lr(t){let e,n,r=`${t[2]}px`,i=`${t[3]}px`,s,o,u;return{c(){e=N("div"),C(e,"class","pixel svelte-4hpgyt"),Qe(e,"left",r),Qe(e,"top",i)},m(l,c){J(l,e,c),s=!0,o||(u=[tt(e,"introend",t[6]),tt(e,"outroend",t[5])],o=!0)},p(l,c){c&4&&r!==(r=`${l[2]}px`)&&Qe(e,"left",r),c&8&&i!==(i=`${l[3]}px`)&&Qe(e,"top",i)},i(l){s||(l&&nt(()=>{s&&(n||(n=Jt(e,Dn,{duration:5e3},!0)),n.run(1))}),s=!0)},o(l){l&&(n||(n=Jt(e,Dn,{duration:5e3},!1)),n.run(0)),s=!1},d(l){l&&j(e),l&&n&&n.end(),o=!1,Ge(u)}}}function Ns(t){let e,n,r;nt(t[7]);let i=t[4]&&lr(t);return{c(){i&&i.c(),e=bt()},m(s,o){i&&i.m(s,o),J(s,e,o),n||(r=tt(window,"resize",t[7]),n=!0)},p(s,[o]){s[4]?i?(i.p(s,o),o&16&&P(i,1)):(i=lr(s),i.c(),P(i,1),i.m(e.parentNode,e)):i&&(Je(),G(i,1,1,()=>{i=null}),He())},i(s){P(i)},o(s){G(i)},d(s){s&&j(e),i&&i.d(s),n=!1,r()}}}function gt(t){return Math.floor(Math.random()*t)}function Us(t,e,n){let r=0,i=0,s=0,o=0,u=!1,l=gt(5e3);function c(){n(2,s=gt(r/20)*20),n(3,o=gt(i/20)*20),n(4,u=!0)}function h(){l=2e3+gt(5e3),setTimeout(()=>{n(4,u=!1)},l)}setTimeout(c,gt(1e4));function p(){n(0,r=window.innerWidth),n(1,i=window.innerHeight)}return[r,i,s,o,u,c,h,p]}class je extends st{constructor(e){super(),it(this,e,Us,Ns,Ye,{})}}function Ds(t){let e,n,r,i,s,o,u,l;return{c(){e=N("button"),n=X(t[1]),r=q(),i=N("span"),i.textContent="^",s=q(),o=N("span"),o.textContent="^",C(i,"class","acc svelte-g3ba97"),Dt(i,"strong",t[3]==t[0]&&t[4]),C(o,"class","dec svelte-g3ba97"),Dt(o,"strong",t[3]==t[0]&&!t[4]),C(e,"class","svelte-g3ba97")},m(c,h){J(c,e,h),g(e,n),g(e,r),g(e,i),g(e,s),g(e,o),u||(l=tt(e,"click",t[5]),u=!0)},p(c,[h]){h&2&&fe(n,c[1]),h&25&&Dt(i,"strong",c[3]==c[0]&&c[4]),h&25&&Dt(o,"strong",c[3]==c[0]&&!c[4])},i:be,o:be,d(c){c&&j(e),u=!1,l()}}}function Bs(t,e,n){let{col_name:r}=e,{col_label:i}=e,{handleSort:s}=e,{sortedBy:o}=e,{sortAscending:u}=e;const l=()=>s(r);return t.$$set=c=>{"col_name"in c&&n(0,r=c.col_name),"col_label"in c&&n(1,i=c.col_label),"handleSort"in c&&n(2,s=c.handleSort),"sortedBy"in c&&n(3,o=c.sortedBy),"sortAscending"in c&&n(4,u=c.sortAscending)},[r,i,s,o,u,l]}class Yt extends st{constructor(e){super(),it(this,e,Bs,Ds,Ye,{col_name:0,col_label:1,handleSort:2,sortedBy:3,sortAscending:4})}}function zs(t){let e;return{c(){e=N("nav"),e.innerHTML='OME Logo

2024 NGFF Challenge

',C(e,"class","svelte-1v9ay5y")},m(n,r){J(n,e,r)},p:be,i:be,o:be,d(n){n&&j(e)}}}class Ps extends st{constructor(e){super(),it(this,e,null,zs,Ye,{})}}function ar(t,e,n){const r=t.slice();return r[16]=e[n],r}function js(t){let e=Object.keys(t[3]).length+"",n;return{c(){n=X(e)},m(r,i){J(r,n,i)},p(r,i){i&8&&e!==(e=Object.keys(r[3]).length+"")&&fe(n,e)},d(r){r&&j(n)}}}function Ws(t){let e,n,r;return{c(){e=N("button"),e.textContent="Load Ro-Crate metadata",C(e,"class","loadrocrate svelte-53dfht")},m(i,s){J(i,e,s),n||(r=tt(e,"click",t[9]),n=!0)},p:be,d(i){i&&j(e),n=!1,r()}}}function ur(t){let e,n,r;return n=new Yt({props:{col_label:"Source",col_name:"source",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}}),{c(){e=N("th"),ke(n.$$.fragment),C(e,"class","svelte-53dfht")},m(i,s){J(i,e,s),ye(n,e,null),r=!0},p(i,s){const o={};s&16&&(o.sortedBy=i[4]),s&32&&(o.sortAscending=i[5]),n.$set(o)},i(i){r||(P(n.$$.fragment,i),r=!0)},o(i){G(n.$$.fragment,i),r=!1},d(i){i&&j(e),we(n)}}}function fr(t){let e;return{c(){e=N("th"),e.textContent="Data Origin",C(e,"class","svelte-53dfht")},m(n,r){J(n,e,r)},d(n){n&&j(e)}}}function cr(t){let e,n,r,i,s;return n=new Yt({props:{col_label:"Wells",col_name:"well_count",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}}),{c(){e=N("th"),ke(n.$$.fragment),r=q(),i=N("th"),i.textContent="Images",C(e,"class","svelte-53dfht"),C(i,"class","svelte-53dfht")},m(o,u){J(o,e,u),ye(n,e,null),J(o,r,u),J(o,i,u),s=!0},p(o,u){const l={};u&16&&(l.sortedBy=o[4]),u&32&&(l.sortAscending=o[5]),n.$set(l)},i(o){s||(P(n.$$.fragment,o),s=!0)},o(o){G(n.$$.fragment,o),s=!1},d(o){o&&(j(e),j(r),j(i)),we(n)}}}function hr(t){let e,n;return e=new Jr({props:{attrs:t[16].image_attrs,source:t[16].image_url}}),{c(){ke(e.$$.fragment)},m(r,i){ye(e,r,i),n=!0},p(r,i){const s={};i&1&&(s.attrs=r[16].image_attrs),i&1&&(s.source=r[16].image_url),e.$set(s)},i(r){n||(P(e.$$.fragment,r),n=!0)},o(r){G(e.$$.fragment,r),n=!1},d(r){we(e,r)}}}function qs(t){let e,n=br(t[16].url)+"",r,i;return{c(){e=N("a"),r=X(n),C(e,"href",i="https://deploy-preview-36--ome-ngff-validator.netlify.app/?source="+t[16].url),C(e,"target","_blank")},m(s,o){J(s,e,o),g(e,r)},p(s,o){o&1&&n!==(n=br(s[16].url)+"")&&fe(r,n),o&1&&i!==(i="https://deploy-preview-36--ome-ngff-validator.netlify.app/?source="+s[16].url)&&C(e,"href",i)},d(s){s&&j(e)}}}function Js(t){let e,n=t[16].csv.split("/").pop()+"",r,i,s=t[16].csv_row_count+"",o,u,l;return{c(){e=N("a"),r=X(n),i=X(" ("),o=X(s),u=X(")"),C(e,"href",l=window.location.origin+"?csv="+t[16].csv),C(e,"target","_blank")},m(c,h){J(c,e,h),g(e,r),g(e,i),g(e,o),g(e,u)},p(c,h){h&1&&n!==(n=c[16].csv.split("/").pop()+"")&&fe(r,n),h&1&&s!==(s=c[16].csv_row_count+"")&&fe(o,s),h&1&&l!==(l=window.location.origin+"?csv="+c[16].csv)&&C(e,"href",l)},d(c){c&&j(e)}}}function dr(t){let e,n=(t[16].source||"")+"",r;return{c(){e=N("td"),r=X(n),C(e,"class","svelte-53dfht")},m(i,s){J(i,e,s),g(e,r)},p(i,s){s&1&&n!==(n=(i[16].source||"")+"")&&fe(r,n)},d(i){i&&j(e)}}}function _r(t){let e,n=t[16].origin&&pr(t);return{c(){e=N("td"),n&&n.c(),C(e,"class","svelte-53dfht")},m(r,i){J(r,e,i),n&&n.m(e,null)},p(r,i){r[16].origin?n?n.p(r,i):(n=pr(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&j(e),n&&n.d()}}}function pr(t){let e,n,r=t[16].origin.slice(-10)+"",i,s;return{c(){e=N("a"),n=X("..."),i=X(r),C(e,"href",s=t[16].origin),C(e,"target","_blank")},m(o,u){J(o,e,u),g(e,n),g(e,i)},p(o,u){u&1&&r!==(r=o[16].origin.slice(-10)+"")&&fe(i,r),u&1&&s!==(s=o[16].origin)&&C(e,"href",s)},d(o){o&&j(e)}}}function mr(t){let e,n=(t[16].well_count||"")+"",r,i,s,o=(t[16].well_count?t[16].well_count*t[16].field_count:"")+"",u;return{c(){e=N("td"),r=X(n),i=q(),s=N("td"),u=X(o),C(e,"class","svelte-53dfht"),C(s,"class","svelte-53dfht")},m(l,c){J(l,e,c),g(e,r),J(l,i,c),J(l,s,c),g(s,u)},p(l,c){c&1&&n!==(n=(l[16].well_count||"")+"")&&fe(r,n),c&1&&o!==(o=(l[16].well_count?l[16].well_count*l[16].field_count:"")+"")&&fe(u,o)},d(l){l&&(j(e),j(i),j(s))}}}function gr(t){let e=(t[3][t[16].organism_id]||t[10](t[16].organism_id))+"",n;return{c(){n=X(e)},m(r,i){J(r,n,i)},p(r,i){i&9&&e!==(e=(r[3][r[16].organism_id]||r[10](r[16].organism_id))+"")&&fe(n,e)},d(r){r&&j(n)}}}function yr(t){let e=(t[3][t[16].fbbi_id]||t[11](t[16].fbbi_id))+"",n;return{c(){n=X(e)},m(r,i){J(r,n,i)},p(r,i){i&9&&e!==(e=(r[3][r[16].fbbi_id]||r[11](r[16].fbbi_id))+"")&&fe(n,e)},d(r){r&&j(n)}}}function wr(t,e){let n,r,i,s,o,u,l,c,h=(e[16].load_failed?"x":e[16].shape||"")+"",p,d,y,A=Kt(e[16].written)+"",M,k,b,w,E,V,U,B,S,f,a=e[16].image_attrs&&hr(e);function _(K,I){return K[16].csv_row_count&&K[16].csv?Js:qs}let R=_(e),T=R(e),L=e[2]&&dr(e),O=e[8]&&_r(e),W=e[7]&&mr(e),z=e[16].organism_id&&gr(e),v=e[16].fbbi_id&&yr(e);return{key:t,first:null,c(){n=N("tr"),r=N("td"),a&&a.c(),i=q(),s=N("td"),T.c(),o=q(),L&&L.c(),u=q(),O&&O.c(),l=q(),c=N("td"),p=X(h),d=q(),y=N("td"),M=X(A),k=q(),W&&W.c(),b=q(),w=N("td"),z&&z.c(),V=q(),U=N("td"),v&&v.c(),S=q(),C(r,"class","svelte-53dfht"),C(s,"class","svelte-53dfht"),C(c,"class","svelte-53dfht"),C(y,"class","svelte-53dfht"),C(w,"title",E=e[16].organism_id||""),C(w,"class","svelte-53dfht"),C(U,"title",B=e[16].fbbi_id||""),C(U,"class","svelte-53dfht"),this.first=n},m(K,I){J(K,n,I),g(n,r),a&&a.m(r,null),g(n,i),g(n,s),T.m(s,null),g(n,o),L&&L.m(n,null),g(n,u),O&&O.m(n,null),g(n,l),g(n,c),g(c,p),g(n,d),g(n,y),g(y,M),g(n,k),W&&W.m(n,null),g(n,b),g(n,w),z&&z.m(w,null),g(n,V),g(n,U),v&&v.m(U,null),g(n,S),f=!0},p(K,I){e=K,e[16].image_attrs?a?(a.p(e,I),I&1&&P(a,1)):(a=hr(e),a.c(),P(a,1),a.m(r,null)):a&&(Je(),G(a,1,1,()=>{a=null}),He()),R===(R=_(e))&&T?T.p(e,I):(T.d(1),T=R(e),T&&(T.c(),T.m(s,null))),e[2]?L?L.p(e,I):(L=dr(e),L.c(),L.m(n,u)):L&&(L.d(1),L=null),e[8]?O?O.p(e,I):(O=_r(e),O.c(),O.m(n,l)):O&&(O.d(1),O=null),(!f||I&1)&&h!==(h=(e[16].load_failed?"x":e[16].shape||"")+"")&&fe(p,h),(!f||I&1)&&A!==(A=Kt(e[16].written)+"")&&fe(M,A),e[7]?W?W.p(e,I):(W=mr(e),W.c(),W.m(n,b)):W&&(W.d(1),W=null),e[16].organism_id?z?z.p(e,I):(z=gr(e),z.c(),z.m(w,null)):z&&(z.d(1),z=null),(!f||I&1&&E!==(E=e[16].organism_id||""))&&C(w,"title",E),e[16].fbbi_id?v?v.p(e,I):(v=yr(e),v.c(),v.m(U,null)):v&&(v.d(1),v=null),(!f||I&1&&B!==(B=e[16].fbbi_id||""))&&C(U,"title",B)},i(K){f||(P(a),f=!0)},o(K){G(a),f=!1},d(K){K&&j(n),a&&a.d(),T.d(),L&&L.d(),O&&O.d(),W&&W.d(),z&&z.d(),v&&v.d()}}}function Hs(t){let e,n,r,i,s,o,u,l,c,h,p,d,y,A,M,k,b,w,E,V,U,B,S,f,a,_=t[0].length+"",R,T,L,O=t[0].reduce(vr,0)+"",W,z,v,K=Kt(t[0].reduce(t[13],0))+"",I,Me,ce,F,Z,_e,re,ge,oe,he,$,Y,se,ue,Q,ve,le,ne,Re,Se,Le,$e,Ie,ie,ae,ze,x,We,Ne,pe=[],De=new Map,Ee;e=new je({}),n=new je({}),r=new je({}),i=new je({}),s=new je({}),u=new je({}),l=new je({}),c=new je({}),h=new je({}),p=new je({}),y=new Ps({}),w=new Ms({props:{csvUrl:t[1]}});function Be(m,D){return m[6]?Ws:js}let Ce=Be(t),Fe=Ce(t);Q=new Yt({props:{col_label:"Url",col_name:"url",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}});let te=t[2]&&ur(t),Te=t[8]&&fr();$e=new Yt({props:{col_label:"Data size",col_name:"written",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}});let de=t[7]&&cr(t),_t=Ht(t[0]);const On=m=>m[16].url;for(let m=0;m<_t.length;m+=1){let D=ar(t,_t,m),Pe=On(D);De.set(Pe,pe[m]=wr(Pe,D))}return{c(){ke(e.$$.fragment),ke(n.$$.fragment),ke(r.$$.fragment),ke(i.$$.fragment),ke(s.$$.fragment),o=q(),ke(u.$$.fragment),ke(l.$$.fragment),ke(c.$$.fragment),ke(h.$$.fragment),ke(p.$$.fragment),d=q(),ke(y.$$.fragment),A=q(),M=N("main"),k=N("h1"),k.textContent="OME 2024 NGFF Challenge",b=q(),ke(w.$$.fragment),E=q(),V=N("div"),U=N("table"),B=N("tr"),B.innerHTML='Zarr Samples (URLs) Images Bytes written Organisms',S=q(),f=N("tr"),a=N("td"),R=X(_),T=q(),L=N("td"),W=X(O),z=q(),v=N("td"),I=X(K),Me=q(),ce=N("td"),Fe.c(),F=q(),Z=N("progress"),ge=q(),oe=N("table"),he=N("thead"),$=N("tr"),Y=N("th"),Y.textContent="Thumb",se=q(),ue=N("th"),ke(Q.$$.fragment),ve=q(),te&&te.c(),le=q(),Te&&Te.c(),ne=q(),Re=N("th"),Re.textContent="Shape",Se=q(),Le=N("th"),ke($e.$$.fragment),Ie=q(),de&&de.c(),ie=q(),ae=N("th"),ae.textContent="Organism",ze=q(),x=N("th"),x.textContent="Imaging",We=q(),Ne=N("tbody");for(let m=0;m{te=null}),He()),m[8]?Te||(Te=fr(),Te.c(),Te.m($,ne)):Te&&(Te.d(1),Te=null);const Zt={};D&16&&(Zt.sortedBy=m[4]),D&32&&(Zt.sortAscending=m[5]),$e.$set(Zt),m[7]?de?(de.p(m,D),D&128&&P(de,1)):(de=cr(m),de.c(),P(de,1),de.m($,ie)):de&&(Je(),G(de,1,1,()=>{de=null}),He()),D&3469&&(_t=Ht(m[0]),Je(),pe=Mr(pe,D,On,1,m,_t,De,Ne,Fr,wr,null,ar),He())},i(m){if(!Ee){P(e.$$.fragment,m),P(n.$$.fragment,m),P(r.$$.fragment,m),P(i.$$.fragment,m),P(s.$$.fragment,m),P(u.$$.fragment,m),P(l.$$.fragment,m),P(c.$$.fragment,m),P(h.$$.fragment,m),P(p.$$.fragment,m),P(y.$$.fragment,m),P(w.$$.fragment,m),P(Q.$$.fragment,m),P(te),P($e.$$.fragment,m),P(de);for(let D=0;D<_t.length;D+=1)P(pe[D]);Ee=!0}},o(m){G(e.$$.fragment,m),G(n.$$.fragment,m),G(r.$$.fragment,m),G(i.$$.fragment,m),G(s.$$.fragment,m),G(u.$$.fragment,m),G(l.$$.fragment,m),G(c.$$.fragment,m),G(h.$$.fragment,m),G(p.$$.fragment,m),G(y.$$.fragment,m),G(w.$$.fragment,m),G(Q.$$.fragment,m),G(te),G($e.$$.fragment,m),G(de);for(let D=0;D50&&(e=e.slice(0,20)+"..."+e.slice(-20)),e}const vr=(t,e)=>t+(e.well_count?e.well_count*e.field_count:1),kr=t=>t.loaded;function Ks(t,e,n){let r,i,s,u=new URLSearchParams(window.location.search).get("csv");try{new URL(u)}catch{console.error("Invalid csv URL",u),u=et}let l=[],c=!1,h={},p={};Xe.subscribe(E=>{n(0,l=E)}),u&&gn(u,Xe);function d(){Xe.loadRocrateJsonAllRows()}function y(E){return console.log("loadOrganism",E),E?h[E]?h[E]:(n(3,h[E]=E,h),vi(E).then(V=>{n(3,h={...h,[E]:V})}),E):""}function A(E){return E?p[E]?p[E]:(p[E]=E,ki(E).then(V=>{p={...p,[E]:V}}),E):""}let M="",k=!0;function b(E){console.log("handleSort",E,"sortedBy",M),M===E?n(5,k=!k):n(5,k=!0),n(4,M=E),Xe.sortTable(E,k)}const w=(E,V)=>E+parseInt(V.written)||0;return t.$$.update=()=>{t.$$.dirty&1&&n(2,c=l.some(E=>E.source)),t.$$.dirty&1&&n(8,r=l.some(E=>E.origin)),t.$$.dirty&1&&n(7,i=l.some(E=>E.well_count)),t.$$.dirty&1&&n(6,s=!l.some(E=>E.rocrate_loaded))},[l,u,c,h,M,k,s,i,r,d,y,A,b,w]}class Vs extends st{constructor(e){super(),it(this,e,Ks,Hs,Ye,{})}}new Vs({target:document.getElementById("app")}); diff --git a/assets/index-Bmc_C3DB.js b/assets/index-Bmc_C3DB.js new file mode 100644 index 0000000..1145738 --- /dev/null +++ b/assets/index-Bmc_C3DB.js @@ -0,0 +1,22 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/blosc-E49GQuAK.js","assets/chunk-INHXZS53-D3tQiqtZ.js","assets/gzip-CF-9a_hd.js","assets/browser-B-ZyVB-j.js","assets/lz4-BIGKWw27.js","assets/zlib-CBiqHlio.js","assets/zstd-IvP746pw.js"])))=>i.map(i=>d[i]); +var Hr=Object.defineProperty;var Sn=t=>{throw TypeError(t)};var Kr=(t,e,n)=>e in t?Hr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ee=(t,e,n)=>Kr(t,typeof e!="symbol"?e+"":e,n),xt=(t,e,n)=>e.has(t)||Sn("Cannot "+n);var H=(t,e,n)=>(xt(t,e,"read from private field"),n?n.call(t):e.get(t)),Ae=(t,e,n)=>e.has(t)?Sn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),me=(t,e,n,r)=>(xt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),en=(t,e,n)=>(xt(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function be(){}const Cr=t=>t;function Rr(t){return t()}function Ln(){return Object.create(null)}function Ge(t){t.forEach(Rr)}function pn(t){return typeof t=="function"}function Ye(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Ut;function In(t,e){return t===e?!0:(Ut||(Ut=document.createElement("a")),Ut.href=e,t===Ut.href)}function Vr(t){return Object.keys(t).length===0}function Gr(t,...e){if(t==null){for(const r of e)r(void 0);return be}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Yr(t){let e;return Gr(t,n=>e=n)(),e}const Tr=typeof window<"u";let Qr=Tr?()=>window.performance.now():()=>Date.now(),mn=Tr?t=>requestAnimationFrame(t):be;const ut=new Set;function Or(t){ut.forEach(e=>{e.c(t)||(ut.delete(e),e.f())}),ut.size!==0&&mn(Or)}function Xr(t){let e;return ut.size===0&&mn(Or),{promise:new Promise(n=>{ut.add(e={c:t,f:n})}),abort(){ut.delete(e)}}}function g(t,e){t.appendChild(e)}function Sr(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Zr(t){const e=N("style");return e.textContent="/* empty */",xr(Sr(t),e),e.sheet}function xr(t,e){return g(t.head||t,e),e.sheet}function J(t,e,n){t.insertBefore(e,n||null)}function j(t){t.parentNode&&t.parentNode.removeChild(t)}function N(t){return document.createElement(t)}function X(t){return document.createTextNode(t)}function q(){return X(" ")}function bt(){return X("")}function tt(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function Lr(t){return function(e){return e.preventDefault(),t.call(this,e)}}function C(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function ei(t){return Array.from(t.childNodes)}function fe(t,e){e=""+e,t.data!==e&&(t.data=e)}function Qe(t,e,n,r){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,"")}function Dt(t,e,n){t.classList.toggle(e,!!n)}function ti(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}const Wt=new Map;let qt=0;function ni(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function ri(t,e){const n={stylesheet:Zr(e),rules:{}};return Wt.set(t,n),n}function Fn(t,e,n,r,i,s,o,u=0){const l=16.666/r;let c=`{ +`;for(let k=0;k<=1;k+=l){const b=e+(n-e)*s(k);c+=k*100+`%{${o(b,1-b)}} +`}const h=c+`100% {${o(n,1-n)}} +}`,p=`__svelte_${ni(h)}_${u}`,d=Sr(t),{stylesheet:y,rules:A}=Wt.get(d)||ri(d,t);A[p]||(A[p]=!0,y.insertRule(`@keyframes ${p} ${h}`,y.cssRules.length));const M=t.style.animation||"";return t.style.animation=`${M?`${M}, `:""}${p} ${r}ms linear ${i}ms 1 both`,qt+=1,p}function ii(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),i=n.length-r.length;i&&(t.style.animation=r.join(", "),qt-=i,qt||si())}function si(){mn(()=>{qt||(Wt.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&j(e)}),Wt.clear())})}let vt;function wt(t){vt=t}function oi(){if(!vt)throw new Error("Function called outside component initialization");return vt}function li(t){oi().$$.on_mount.push(t)}const at=[],sn=[];let ft=[];const Mn=[],ai=Promise.resolve();let on=!1;function ui(){on||(on=!0,ai.then(Ir))}function nt(t){ft.push(t)}const tn=new Set;let ot=0;function Ir(){if(ot!==0)return;const t=vt;do{try{for(;ott.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),ft=e}let pt;function hi(){return pt||(pt=Promise.resolve(),pt.then(()=>{pt=null})),pt}function nn(t,e,n){t.dispatchEvent(ti(`${e?"intro":"outro"}${n}`))}const zt=new Set;let qe;function Je(){qe={r:0,c:[],p:qe}}function He(){qe.r||Ge(qe.c),qe=qe.p}function P(t,e){t&&t.i&&(zt.delete(t),t.i(e))}function G(t,e,n,r){if(t&&t.o){if(zt.has(t))return;zt.add(t),qe.c.push(()=>{zt.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const di={duration:0};function Jt(t,e,n,r){let s=e(t,n,{direction:"both"}),o=r?0:1,u=null,l=null,c=null,h;function p(){c&&ii(t,c)}function d(A,M){const k=A.b-o;return M*=Math.abs(k),{a:o,b:A.b,d:k,duration:M,start:A.start,end:A.start+M,group:A.group}}function y(A){const{delay:M=0,duration:k=300,easing:b=Cr,tick:w=be,css:E}=s||di,V={start:Qr()+M,b:A};A||(V.group=qe,qe.r+=1),"inert"in t&&(A?h!==void 0&&(t.inert=h):(h=t.inert,t.inert=!0)),u||l?l=V:(E&&(p(),c=Fn(t,o,A,k,M,b,E)),A&&w(0,1),u=d(V,k),nt(()=>nn(t,A,"start")),Xr(U=>{if(l&&U>l.start&&(u=d(l,k),l=null,nn(t,u.b,"start"),E&&(p(),c=Fn(t,o,u.b,u.duration,0,b,s.css))),u){if(U>=u.end)w(o=u.b,1-o),nn(t,u.b,"end"),l||(u.b?p():--u.group.r||Ge(u.group.c)),u=null;else if(U>=u.start){const B=U-u.start;o=u.a+u.d*b(B/u.duration),w(o,1-o)}}return!!(u||l)}))}return{run(A){pn(s)?hi().then(()=>{s=s({direction:A?"in":"out"}),y(A)}):y(A)},end(){p(),u=l=null}}}function Ht(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Fr(t,e){G(t,1,1,()=>{e.delete(t.key)})}function Mr(t,e,n,r,i,s,o,u,l,c,h,p){let d=t.length,y=s.length,A=d;const M={};for(;A--;)M[t[A].key]=A;const k=[],b=new Map,w=new Map,E=[];for(A=y;A--;){const S=p(i,s,A),f=n(S);let a=o.get(f);a?E.push(()=>a.p(S,e)):(a=c(f,S),a.c()),b.set(f,k[A]=a),f in M&&w.set(f,Math.abs(A-M[f]))}const V=new Set,U=new Set;function B(S){P(S,1),S.m(u,h),o.set(S.key,S),h=S.first,y--}for(;d&&y;){const S=k[y-1],f=t[d-1],a=S.key,_=f.key;S===f?(h=S.first,d--,y--):b.has(_)?!o.has(a)||V.has(a)?B(S):U.has(_)?d--:w.get(a)>w.get(_)?(U.add(a),B(S)):(V.add(_),d--):(l(f,o),d--)}for(;d--;){const S=t[d];b.has(S.key)||l(S,o)}for(;y;)B(k[y-1]);return Ge(E),k}function ke(t){t&&t.c()}function ye(t,e,n){const{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),nt(()=>{const s=t.$$.on_mount.map(Rr).filter(pn);t.$$.on_destroy?t.$$.on_destroy.push(...s):Ge(s),t.$$.on_mount=[]}),i.forEach(nt)}function we(t,e){const n=t.$$;n.fragment!==null&&(ci(n.after_update),Ge(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function _i(t,e){t.$$.dirty[0]===-1&&(at.push(t),ui(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const A=y.length?y[0]:d;return c.ctx&&i(c.ctx[p],c.ctx[p]=A)&&(!c.skip_bound&&c.bound[p]&&c.bound[p](A),h&&_i(t,p)),d}):[],c.update(),h=!0,Ge(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){const p=ei(e.target);c.fragment&&c.fragment.l(p),p.forEach(j)}else c.fragment&&c.fragment.c();e.intro&&P(t.$$.fragment),ye(t,e.target,e.anchor),Ir()}wt(l)}class st{constructor(){ee(this,"$$");ee(this,"$$set")}$destroy(){we(this,1),this.$destroy=be}$on(e,n){if(!pn(n))return be;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!Vr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const pi="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(pi);const lt=[];function mi(t,e=be){let n;const r=new Set;function i(u){if(Ye(t,u)&&(t=u,n)){const l=!lt.length;for(const c of r)c[1](),lt.push(c,t);if(l){for(let c=0;c{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:s,subscribe:o}}var gi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nr={exports:{}};/* @license +Papa Parse +v5.4.1 +https://github.com/mholt/PapaParse +License: MIT +*/(function(t,e){(function(n,r){t.exports=r()})(gi,function n(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},i=!r.document&&!!r.postMessage,s=r.IS_PAPA_WORKER||!1,o={},u=0,l={parse:function(f,a){var _=(a=a||{}).dynamicTyping||!1;if(S(_)&&(a.dynamicTypingFunction=_,_={}),a.dynamicTyping=_,a.transform=!!S(a.transform)&&a.transform,a.worker&&l.WORKERS_SUPPORTED){var R=function(){if(!l.WORKERS_SUPPORTED)return!1;var L=(W=r.URL||r.webkitURL||null,z=n.toString(),l.BLOB_URL||(l.BLOB_URL=W.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",z,")();"],{type:"text/javascript"})))),O=new r.Worker(L),W,z;return O.onmessage=w,O.id=u++,o[O.id]=O}();return R.userStep=a.step,R.userChunk=a.chunk,R.userComplete=a.complete,R.userError=a.error,a.step=S(a.step),a.chunk=S(a.chunk),a.complete=S(a.complete),a.error=S(a.error),delete a.worker,void R.postMessage({input:f,config:a,workerId:R.id})}var T=null;return l.NODE_STREAM_INPUT,typeof f=="string"?(f=function(L){return L.charCodeAt(0)===65279?L.slice(1):L}(f),T=a.download?new p(a):new y(a)):f.readable===!0&&S(f.read)&&S(f.on)?T=new A(a):(r.File&&f instanceof File||f instanceof Object)&&(T=new d(a)),T.stream(f)},unparse:function(f,a){var _=!1,R=!0,T=",",L=`\r +`,O='"',W=O+O,z=!1,v=null,K=!1;(function(){if(typeof a=="object"){if(typeof a.delimiter!="string"||l.BAD_DELIMITERS.filter(function(F){return a.delimiter.indexOf(F)!==-1}).length||(T=a.delimiter),(typeof a.quotes=="boolean"||typeof a.quotes=="function"||Array.isArray(a.quotes))&&(_=a.quotes),typeof a.skipEmptyLines!="boolean"&&typeof a.skipEmptyLines!="string"||(z=a.skipEmptyLines),typeof a.newline=="string"&&(L=a.newline),typeof a.quoteChar=="string"&&(O=a.quoteChar),typeof a.header=="boolean"&&(R=a.header),Array.isArray(a.columns)){if(a.columns.length===0)throw new Error("Option columns is empty");v=a.columns}a.escapeChar!==void 0&&(W=a.escapeChar+O),(typeof a.escapeFormulae=="boolean"||a.escapeFormulae instanceof RegExp)&&(K=a.escapeFormulae instanceof RegExp?a.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var I=new RegExp(k(O),"g");if(typeof f=="string"&&(f=JSON.parse(f)),Array.isArray(f)){if(!f.length||Array.isArray(f[0]))return Me(null,f,z);if(typeof f[0]=="object")return Me(v||Object.keys(f[0]),f,z)}else if(typeof f=="object")return typeof f.data=="string"&&(f.data=JSON.parse(f.data)),Array.isArray(f.data)&&(f.fields||(f.fields=f.meta&&f.meta.fields||v),f.fields||(f.fields=Array.isArray(f.data[0])?f.fields:typeof f.data[0]=="object"?Object.keys(f.data[0]):[]),Array.isArray(f.data[0])||typeof f.data[0]=="object"||(f.data=[f.data])),Me(f.fields||[],f.data||[],z);throw new Error("Unable to serialize unrecognized input");function Me(F,Z,_e){var re="";typeof F=="string"&&(F=JSON.parse(F)),typeof Z=="string"&&(Z=JSON.parse(Z));var ge=Array.isArray(F)&&0=this._config.preview;if(s)r.postMessage({results:L,workerId:l.WORKER_ID,finished:W});else if(S(this._config.chunk)&&!_){if(this._config.chunk(L,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);L=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(L.data),this._completeResults.errors=this._completeResults.errors.concat(L.errors),this._completeResults.meta=L.meta),this._completed||!W||!S(this._config.complete)||L&&L.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),W||L&&L.meta.paused||this._nextChunk(),L}this._halted=!0},this._sendError=function(a){S(this._config.error)?this._config.error(a):s&&this._config.error&&r.postMessage({workerId:l.WORKER_ID,error:a,finished:!1})}}function p(f){var a;(f=f||{}).chunkSize||(f.chunkSize=l.RemoteChunkSize),h.call(this,f),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(_){this._input=_,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(a=new XMLHttpRequest,this._config.withCredentials&&(a.withCredentials=this._config.withCredentials),i||(a.onload=B(this._chunkLoaded,this),a.onerror=B(this._chunkError,this)),a.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var _=this._config.downloadRequestHeaders;for(var R in _)a.setRequestHeader(R,_[R])}if(this._config.chunkSize){var T=this._start+this._config.chunkSize-1;a.setRequestHeader("Range","bytes="+this._start+"-"+T)}try{a.send(this._config.downloadRequestBody)}catch(L){this._chunkError(L.message)}i&&a.status===0&&this._chunkError()}},this._chunkLoaded=function(){a.readyState===4&&(a.status<200||400<=a.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:a.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(_){var R=_.getResponseHeader("Content-Range");return R===null?-1:parseInt(R.substring(R.lastIndexOf("/")+1))}(a),this.parseChunk(a.responseText)))},this._chunkError=function(_){var R=a.statusText||_;this._sendError(new Error(R))}}function d(f){var a,_;(f=f||{}).chunkSize||(f.chunkSize=l.LocalChunkSize),h.call(this,f);var R=typeof FileReader<"u";this.stream=function(T){this._input=T,_=T.slice||T.webkitSlice||T.mozSlice,R?((a=new FileReader).onload=B(this._chunkLoaded,this),a.onerror=B(this._chunkError,this)):a=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(T.target.result)},this._chunkError=function(){this._sendError(a.error)}}function y(f){var a;h.call(this,f=f||{}),this.stream=function(_){return a=_,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var _,R=this._config.chunkSize;return R?(_=a.substring(0,R),a=a.substring(R)):(_=a,a=""),this._finished=!a,this.parseChunk(_)}}}function A(f){h.call(this,f=f||{});var a=[],_=!0,R=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(T){this._input=T,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){R&&a.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),a.length?this.parseChunk(a.shift()):_=!0},this._streamData=B(function(T){try{a.push(typeof T=="string"?T:T.toString(this._config.encoding)),_&&(_=!1,this._checkIsFinished(),this.parseChunk(a.shift()))}catch(L){this._streamError(L)}},this),this._streamError=B(function(T){this._streamCleanUp(),this._sendError(T)},this),this._streamEnd=B(function(){this._streamCleanUp(),R=!0,this._streamData("")},this),this._streamCleanUp=B(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function M(f){var a,_,R,T=Math.pow(2,53),L=-T,O=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,W=/^((\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)))$/,z=this,v=0,K=0,I=!1,Me=!1,ce=[],F={data:[],errors:[],meta:{}};if(S(f.step)){var Z=f.step;f.step=function($){if(F=$,ge())re();else{if(re(),F.data.length===0)return;v+=$.data.length,f.preview&&v>f.preview?_.abort():(F.data=F.data[0],Z(F,z))}}}function _e($){return f.skipEmptyLines==="greedy"?$.join("").trim()==="":$.length===1&&$[0].length===0}function re(){return F&&R&&(he("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),R=!1),f.skipEmptyLines&&(F.data=F.data.filter(function($){return!_e($)})),ge()&&function(){if(!F)return;function $(se,ue){S(f.transformHeader)&&(se=f.transformHeader(se,ue)),ce.push(se)}if(Array.isArray(F.data[0])){for(var Y=0;ge()&&Y=ce.length?"__parsed_extra":ce[Q]),f.transform&&(ne=f.transform(ne,le)),ne=oe(le,ne),le==="__parsed_extra"?(ve[le]=ve[le]||[],ve[le].push(ne)):ve[le]=ne}return f.header&&(Q>ce.length?he("FieldMismatch","TooManyFields","Too many fields: expected "+ce.length+" fields but parsed "+Q,K+ue):Q=Se.length/2?`\r +`:"\r"}($,ue)),R=!1,f.delimiter)S(f.delimiter)&&(f.delimiter=f.delimiter($),F.meta.delimiter=f.delimiter);else{var Q=function(le,ne,Re,Se,Le){var $e,Ie,ie,ae;Le=Le||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ze=0;ze=O)return Ce(!0)}else for(x=v,v++;;){if((x=I.indexOf(a,x+1))===-1)return ce||he.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:oe.length,index:v}),Ee();if(x===F-1)return Ee(I.substring(v,x).replace(ze,a));if(a!==z||I[x+1]!==z){if(a===z||x===0||I[x-1]!==z){ie!==-1&&ie=O)return Ce(!0);break}he.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:oe.length,index:v}),x++}}else x++}return Ee();function pe(te){oe.push(te),Y=v}function De(te){var Te=0;if(te!==-1){var de=I.substring(x+1,te);de&&de.trim()===""&&(Te=de.length)}return Te}function Ee(te){return ce||(te===void 0&&(te=I.substring(v)),$.push(te),v=F,pe($),ge&&Fe()),Ce()}function Be(te){v=te,pe($),$=[],ae=I.indexOf(R,v)}function Ce(te){return{data:oe,errors:he,meta:{delimiter:_,linebreak:R,aborted:K,truncated:!!te,cursor:Y+(Me||0)}}}function Fe(){L(Ce()),oe=[],he=[]}},this.abort=function(){K=!0},this.getCharIndex=function(){return v}}function w(f){var a=f.data,_=o[a.workerId],R=!1;if(a.error)_.userError(a.error,a.file);else if(a.results&&a.results.data){var T={abort:function(){R=!0,E(a.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:V,resume:V};if(S(_.userStep)){for(var L=0;L1&&(s=o,i.data.shift());let u=i.data.map(p=>{let d={...n};for(let y=0;y{var d;return!((d=p.url)!=null&&d.endsWith(".csv"))}),c={};if(l.forEach(p=>{if(c[p.url]){console.warn("Removing duplicate URL:",p.url);return}c[p.url]=p}),l=Object.values(c),r){let p=l.length,d=l.reduce((y,A)=>y+parseInt(A.written)||0,0);l=l.slice(0,r).map(y=>({...y,csv_row_count:p,written:d}))}e.addRows(l),u.filter(p=>{var d;return(d=p.url)==null?void 0:d.includes(".csv")}).forEach(p=>{let d=p.url;p.url=void 0,p.csv=d,gn(d,e,p,1)})}})}async function Ur(t){return await fetch(t).then(e=>e.json())}async function vi(t){let e=t.replace("NCBI:txid","");return(await Ur(`https://rest.ensembl.org/taxonomy/id/${e}?content-type=application/json`)).name||t}async function ki(t){const e=t.replace("obo:","");return(await Ur(`https://www.ebi.ac.uk/ols4/api/ontologies/fbbi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252F${e}`)).label}function Kt(t){if(!t)return"";const e=2;return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(e)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(e)+" MB":t<1024*1024*1024*1024?(t/(1024*1024*1024)).toFixed(e)+" GB":t<1024*1024*1024*1024*1024?(t/(1024*1024*1024*1024)).toFixed(e)+" TB":(t/(1024*1024*1024*1024*1024)).toFixed(e)+" PB"}function Nn(t,e){return Array.from({length:e-t},(n,r)=>r+t)}function Ei(t,e,n){const r=t[0].shape,i=r[0],s=r[1],o=i*s;e||(e=t.map(Dr));const u=new Uint8ClampedArray(4*i*s).fill(0);let l=0;for(let c=0;ci?s:[]);for(const[i,s]of r.entries())n[s]=Un[i]}return n.map(Br)}function Br(t){t.startsWith("#")&&(t=t.slice(1));const e=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[e,n,r]}const Bt=5;async function ln(t){var r;let e=await fetch(`${t}/zarr.json`).then(i=>{if(console.log("loadMultiscales response",i.status),i.status===404)throw new Error(`${t}/zarr.json not found`);return i.json()}).catch(i=>(console.log(`----> Failed to load ${t}/zarr.json`,i),[void 0,t]));const n=(r=e==null?void 0:e.attributes)==null?void 0:r.ome;if(!n)return[void 0,t];if(n.multiscales)return[n.multiscales,t];if(n.plate){let i=n.plate.wells[0],s=`${t}/${i.path}/0`,[o,u]=await ln(s);return[o,u,n.plate]}else if(n["bioformats2raw.layout"]){let i=`${t}/0`;return await ln(i)}}class Ti{constructor(){this.store=mi([])}addRows(e){this.store.update(n=>{n.push(...e);async function r(i){for(let s=0;sthis.loadNgffMetadata(i[u].url));await Promise.all(o)}}return r.bind(this)(e),n})}populateRow(e,n){this.store.update(r=>(r=r.map(i=>(i.url===e&&(i={...i,...n},console.log("populateRow",n,i)),i)),r))}async loadNgffMetadata(e){var d;const[n,r,i]=await ln(e);let s=[],o=0,u=0,l=!1,c=!0,h={multiscales:n},p=r;if(i&&(o=i.wells.length,u=i.field_count||1),n){const y=(d=n[0])==null?void 0:d.datasets[0],A=y==null?void 0:y.path;if(A){const M=await fetch(`${r}/${A}/zarr.json`).then(k=>k.json()).catch(k=>{console.log(`----> Failed to parse ${r}/${A}/zarr.json`,k)});s=M==null?void 0:M.shape}}else console.log("No multiscales found"),l=!0,s=[0];this.populateRow(e,{image_attrs:h,image_url:p,shape:s,well_count:o,field_count:u,load_failed:l,loaded:c})}async loadRocrateJson(e){await fetch(`${e}/ro-crate-metadata.json`).then(n=>{if(console.log("loadMultiscales response",n.status),n.status===404)throw new Error(`${e}/ro-crate-metadata.json not found`);return n.json()}).then(n=>{var u,l;let r=n["@graph"].find(c=>c["@type"]==="biosample"),i=(u=r==null?void 0:r.organism_classification)==null?void 0:u["@id"],s=n["@graph"].find(c=>c["@type"]==="image_acquisition"),o=(l=s==null?void 0:s.fbbi_id)==null?void 0:l["@id"];this.populateRow(e,{organism_id:i,fbbi_id:o,rocrate_loaded:!0})}).catch(n=>{console.log("Failed to load ro-crate-metadata.json",n)})}async loadRocrateJsonAllRows(){let e=Yr(this.store);for(let n=0;nthis.loadRocrateJson(e[i].url));await Promise.all(r)}}compareRows(e,n){let r=e[this.sortColumn],i=n[this.sortColumn];r===void 0&&(r=""),i===void 0&&(i="");let s=0;return typeof r=="number"?s=r-i:s=r.localeCompare(i),this.sortAscending?s:-s}sortTable(e,n=!0){this.sortColumn=e,this.sortAscending=n,this.store.update(r=>(r.sort((i,s)=>this.compareRows(i,s)),r))}emptyTable(){this.store.set([])}subscribe(e){return this.store.subscribe(e)}}const Xe=new Ti;function Oi(t){const e=t-1;return e*e*e+1}function Dn(t,{delay:e=0,duration:n=400,easing:r=Cr}={}){const i=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:r,css:s=>`opacity: ${s*i}`}}function Bn(t,{delay:e=0,duration:n=400,easing:r=Oi,start:i=0,opacity:s=0}={}){const o=getComputedStyle(t),u=+o.opacity,l=o.transform==="none"?"":o.transform,c=1-i,h=u*(1-s);return{delay:e,duration:n,easing:r,css:(p,d)=>` + transform: ${l} scale(${1-c*d}); + opacity: ${u-h*d} + `}}function zn(t){let e,n,r,i,s;return{c(){e=N("h2"),n=X(t[1]),r=X(" zarrs in "),i=X(t[0]),s=X(" collections")},m(o,u){J(o,e,u),g(e,n),g(e,r),g(e,i),g(e,s)},p(o,u){u&2&&fe(n,o[1]),u&1&&fe(i,o[0])},d(o){o&&j(e)}}}function Si(t){let e,n=t[1]>0&&zn(t);return{c(){n&&n.c(),e=bt()},m(r,i){n&&n.m(r,i),J(r,e,i)},p(r,[i]){r[1]>0?n?n.p(r,i):(n=zn(r),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:be,o:be,d(r){r&&j(e),n&&n.d(r)}}}function Li(t,e,n){let r,i,{tableRows:s=[]}=e;return t.$$set=o=>{"tableRows"in o&&n(2,s=o.tableRows)},t.$$.update=()=>{t.$$.dirty&4&&n(1,r=s.reduce((o,u)=>o+(u.csv_row_count||0),0)),t.$$.dirty&4&&n(0,i=s.reduce((o,u)=>o+(u.csv_row_count?1:0),0))},[i,r,s]}class Ii extends st{constructor(e){super(),it(this,e,Li,Si,Ye,{tableRows:2})}}class Mt extends Error{constructor(e,n={}){super(`Node not found: ${e}`,n),this.name="NodeNotFoundError"}}class yn extends Error{constructor(e){super(`Missing key: ${e}`),this.name="KeyError"}}const Fi="modulepreload",Mi=function(t){return"https://ome.github.io/ome2024-ngff-challenge/"+t},Pn={},mt=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.all(n.map(u=>{if(u=Mi(u),u in Pn)return;Pn[u]=!0;const l=u.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${c}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":Fi,l||(h.as="script"),h.crossOrigin="",h.href=u,o&&h.setAttribute("nonce",o),document.head.appendChild(h),l)return new Promise((p,d)=>{h.addEventListener("load",p),h.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${u}`)))})}))}return i.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var Ue;class zr{constructor(e,n,r){Ae(this,Ue);typeof e=="number"?me(this,Ue,new Uint8Array(e)):e instanceof ArrayBuffer?me(this,Ue,new Uint8Array(e,n,r)):me(this,Ue,new Uint8Array(Array.from(e,i=>i?1:0)))}get BYTES_PER_ELEMENT(){return 1}get byteOffset(){return H(this,Ue).byteOffset}get byteLength(){return H(this,Ue).byteLength}get buffer(){return H(this,Ue).buffer}get length(){return H(this,Ue).length}get(e){let n=H(this,Ue)[e];return typeof n=="number"?n!==0:n}set(e,n){H(this,Ue)[e]=n?1:0}fill(e){H(this,Ue).fill(e?1:0)}*[Symbol.iterator](){for(let e=0;e=0;r--)n[r]=i,i*=t[r];return n}function Bi(t){const e=t.length,n=globalThis.Array(e);for(let r=0,i=1;r["c",...r].join(n)}if(t==="v2"){const n=(e==null?void 0:e.separator)??".";return r=>r.join(n)||"0"}throw new Error(`Unknown chunk key encoding: ${t}`)}function an(t){var n;const e=t.find(r=>r.name==="transpose");return((n=e==null?void 0:e.configuration)==null?void 0:n.order)==="F"?"F":"C"}const Pi=/^([<|>])(.*)$/;function ji(t){if(t==="|O")return{data_type:"v2:object"};let e=t.match(Pi);if(!e)throw new Error(`Invalid dtype: ${t}`);let[,n,r]=e,i={b1:"bool",i1:"int8",u1:"uint8",i2:"int16",u2:"uint16",i4:"int32",u4:"uint32",i8:"int64",u8:"uint64",f4:"float32",f8:"float64"}[r]??(r.startsWith("S")||r.startsWith("U")?`v2:${r}`:void 0);if(!i)throw new Error(`Unsupported or unknown dtype: ${t}`);return n==="|"?{data_type:i}:{data_type:i,endian:n==="<"?"little":"big"}}function Wi(t,e={}){let n=[],r=ji(t.dtype);t.order==="F"&&n.push({name:"transpose",configuration:{order:"F"}}),"endian"in r&&r.endian==="big"&&n.push({name:"bytes",configuration:{endian:"big"}});for(let{id:i,...s}of t.filters??[])n.push({name:i,configuration:s});if(t.compressor){let{id:i,...s}=t.compressor;n.push({name:i,configuration:s})}return{zarr_format:3,node_type:"array",shape:t.shape,data_type:r.data_type,chunk_grid:{name:"regular",configuration:{chunk_shape:t.chunks}},chunk_key_encoding:{name:"v2",configuration:{separator:t.dimension_separator??"."}},codecs:n,fill_value:t.fill_value,attributes:e}}function qi(t,e={}){return{zarr_format:3,node_type:"group",attributes:e}}function Ji(t,e){if(e!=="number"&&e!=="bigint"&&e!=="boolean"&&e!=="object"&&e!=="string")return t===e;let n=t==="bool";if(e==="boolean")return n;let r=t.startsWith("v2:U")||t.startsWith("v2:S");if(e==="string")return r;let i=t==="int64"||t==="uint64";if(e==="bigint")return i;let s=t==="v2:object";return e==="object"?s:!r&&!i&&!n&&!s}function Hi(t){return(t==null?void 0:t.name)==="sharding_indexed"}function jr(t){return(t.data_type==="uint64"||t.data_type==="int64")&&t.fill_value!=null?BigInt(t.fill_value):t.fill_value}const Wn=Ki();function Ki(){const t=new Uint32Array([305419896]);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)[0]!==18}function qn(t){return"BYTES_PER_ELEMENT"in t?t.BYTES_PER_ELEMENT:4}var Et,Ke,At,$t,ht;const Cn=class Cn{constructor(e,n){ee(this,"kind","array_to_bytes");Ae(this,Et);Ae(this,Ke);Ae(this,At);Ae(this,$t);Ae(this,ht);me(this,ht,e==null?void 0:e.endian),me(this,Ke,Pr(n.data_type)),me(this,$t,n.shape),me(this,Et,rt(n.shape,an(n.codecs)));const r=new(H(this,Ke))(0);me(this,At,r.BYTES_PER_ELEMENT)}static fromConfig(e,n){return new Cn(e,n)}encode(e){let n=new Uint8Array(e.data.buffer);return Wn&&H(this,ht)==="big"&&jn(n,qn(H(this,Ke))),n}decode(e){return Wn&&H(this,ht)==="big"&&jn(e,qn(H(this,Ke))),{data:new(H(this,Ke))(e.buffer,e.byteOffset,e.byteLength/H(this,At)),shape:H(this,$t),stride:H(this,Et)}}};Et=new WeakMap,Ke=new WeakMap,At=new WeakMap,$t=new WeakMap,ht=new WeakMap;let Vt=Cn;class bn{constructor(){ee(this,"kind","bytes_to_bytes")}static fromConfig(){return new bn}encode(e){throw new Error("Not implemented")}decode(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength-4)}}function Vi(t,e){if(Number.isNaN(e))throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");if(e===Number.POSITIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");if(e===Number.NEGATIVE_INFINITY)throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");return e}function Gi(t,e){return e instanceof Object&&!Array.isArray(e)?Object.keys(e).sort().reduce((n,r)=>(n[r]=e[r],n),{}):e}var Ct,Rt;const Rn=class Rn{constructor(e={}){ee(this,"configuration");ee(this,"kind","array_to_bytes");Ae(this,Ct);Ae(this,Rt);this.configuration=e;const{encoding:n="utf-8",skipkeys:r=!1,ensure_ascii:i=!0,check_circular:s=!0,allow_nan:o=!0,sort_keys:u=!0,indent:l,strict:c=!0}=e;let h=e.separators;h||(l?h=[", ",": "]:h=[",",":"]),me(this,Ct,{encoding:n,skipkeys:r,ensure_ascii:i,check_circular:s,allow_nan:o,indent:l,separators:h,sort_keys:u}),me(this,Rt,{strict:c})}static fromConfig(e){return new Rn(e)}encode(e){const{indent:n,encoding:r,ensure_ascii:i,check_circular:s,allow_nan:o,sort_keys:u}=H(this,Ct);if(r!=="utf-8")throw new Error("JsonCodec does not yet support non-utf-8 encoding.");const l=[];if(!s)throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");o||l.push(Vi),u&&l.push(Gi);const c=Array.from(e.data);c.push("|O"),c.push(e.shape);let h;l.length&&(h=(d,y)=>{let A=y;for(let M of l)A=M(d,A);return A});let p=JSON.stringify(c,h,n);return i&&(p=p.replace(/[\u007F-\uFFFF]/g,d=>{const y=`0000${d.charCodeAt(0).toString(16)}`;return`\\u${y.substring(y.length-4)}`})),new TextEncoder().encode(p)}decode(e){const{strict:n}=H(this,Rt);if(!n)throw new Error("JsonCodec does not yet support non-strict decoding.");const r=Nt(e),i=r.pop();if(r.pop(),!i)throw new Error("0D not implemented for JsonCodec.");const s=rt(i,"C");return{data:r,shape:i,stride:s}}};Ct=new WeakMap,Rt=new WeakMap;let un=Rn;function Jn(t){return t instanceof zr||t instanceof wn||t instanceof kt?new Proxy(t,{get(n,r){return n.get(Number(r))},set(n,r,i){return n.set(Number(r),i),!0}}):t}function Yi(t,e){let n;return t.data instanceof wn||t.data instanceof kt?n=new t.constructor(t.data.length,t.data.chars):n=new t.constructor(t.data.length),{data:n,shape:t.shape,stride:rt(t.shape,e)}}function Qi(t,e){let n=Yi(t,e),r=t.shape.length,i=t.data.length,s=Array(r).fill(0),o=Jn(t.data),u=Jn(n.data);for(let l=0;ln===e[r])?"C":"F"}class vn{constructor(e){ee(this,"configuration");ee(this,"kind","array_to_array");this.configuration=e}static fromConfig(e){return new vn(e)}encode(e){var n,r;return Xi(e)===((n=this.configuration)==null?void 0:n.order)?e:Qi(e,((r=this.configuration)==null?void 0:r.order)??"C")}decode(e){return e}}var Tt,Ot;const Tn=class Tn{constructor(e){ee(this,"kind","array_to_bytes");Ae(this,Tt);Ae(this,Ot);me(this,Tt,e),me(this,Ot,rt(e,"C"))}static fromConfig(e,n){return new Tn(n.shape)}encode(e){throw new Error("Method not implemented.")}decode(e){let n=new TextDecoder,r=new DataView(e.buffer),i=Array(r.getUint32(0,!0)),s=4;for(let o=0;omt(()=>import("./blosc-E49GQuAK.js"),__vite__mapDeps([0,1])).then(t=>t.default)).set("gzip",()=>mt(()=>import("./gzip-CF-9a_hd.js"),__vite__mapDeps([2,3])).then(t=>t.default)).set("lz4",()=>mt(()=>import("./lz4-BIGKWw27.js"),__vite__mapDeps([4,1])).then(t=>t.default)).set("zlib",()=>mt(()=>import("./zlib-CBiqHlio.js"),__vite__mapDeps([5,3])).then(t=>t.default)).set("zstd",()=>mt(()=>import("./zstd-IvP746pw.js"),__vite__mapDeps([6,1])).then(t=>t.default)).set("transpose",()=>vn).set("bytes",()=>Vt).set("crc32c",()=>bn).set("vlen-utf8",()=>fn).set("json2",()=>un)}const xi=Zi();function cn(t){let e;return{async encode(n){e||(e=await Hn(t));for(const i of e.array_to_array)n=await i.encode(n);let r=await e.array_to_bytes.encode(n);for(const i of e.bytes_to_bytes)r=await i.encode(r);return r},async decode(n){e||(e=await Hn(t));for(let i=e.bytes_to_bytes.length-1;i>=0;i--)n=await e.bytes_to_bytes[i].decode(n);let r=await e.array_to_bytes.decode(n);for(let i=e.array_to_array.length-1;i>=0;i--)r=await e.array_to_array[i].decode(r);return r}}}async function Hn(t){let e=t.codecs.map(async s=>{var u;let o=await((u=xi.get(s.name))==null?void 0:u());if(!o)throw new Error(`Unknown codec: ${s.name}`);return{Codec:o,meta:s}}),n=[],r,i=[];for await(let{Codec:s,meta:o}of e){let u=s.fromConfig(o.configuration,t);switch(u.kind){case"array_to_array":n.push(u);break;case"array_to_bytes":r=u;break;default:i.push(u)}}if(!r){if(!es(t))throw new Error(`Cannot encode ${t.data_type} to bytes without a codec`);r=Vt.fromConfig({endian:"little"},t)}return{array_to_array:n,array_to_bytes:r,bytes_to_bytes:i}}function es(t){return t.data_type!=="v2:object"}const Kn=18446744073709551615n;function ts(t,e,n,r){if(t.store.getRange===void 0)throw new Error("Store does not support range requests");let i=t.store.getRange.bind(t.store),s=e.map((l,c)=>l/r.chunk_shape[c]),o=cn({data_type:"uint64",shape:[...s,2],codecs:r.index_codecs}),u={};return async l=>{let c=l.map((w,E)=>Math.floor(w/s[E])),h=t.resolve(n(c)).path,p;if(h in u)p=u[h];else{let w=4,E=16*s.reduce((U,B)=>U*B,1),V=await i(h,{suffixLength:E+w});p=u[h]=V?await o.decode(V):null}if(p===null)return;let{data:d,shape:y,stride:A}=p,M=l.map((w,E)=>w%y[E]).reduce((w,E,V)=>w+E*A[V],0),k=d[M],b=d[M+1];if(!(k===Kn&&b===Kn))return i(h,{offset:Number(k),length:Number(b)})}}class dt{constructor(e,n="/"){ee(this,"store");ee(this,"path");this.store=e,this.path=n}resolve(e){let n=new URL(`file://${this.path.endsWith("/")?this.path:`${this.path}/`}`);return new dt(this.store,new URL(e,n).pathname)}}var St;class kn extends dt{constructor(n,r,i){super(n,r);ee(this,"kind","group");Ae(this,St);me(this,St,i)}get attrs(){return H(this,St).attributes}}St=new WeakMap;const yt=Symbol("zarrita.context");function ns(t){return t[yt]}function rs(t,e){let{configuration:n}=e.codecs.find(Hi)??{},r={encode_chunk_key:zi(e.chunk_key_encoding),TypedArray:Pr(e.data_type),fill_value:e.fill_value};if(n){let s=an(n.codecs);return{...r,kind:"sharded",chunk_shape:n.chunk_shape,codec:cn({data_type:e.data_type,shape:n.chunk_shape,codecs:n.codecs}),get_strides(o,u){return rt(o,u??s)},get_chunk_bytes:ts(t,e.chunk_grid.configuration.chunk_shape,r.encode_chunk_key,n)}}let i=an(e.codecs);return{...r,kind:"regular",chunk_shape:e.chunk_grid.configuration.chunk_shape,codec:cn({data_type:e.data_type,shape:e.chunk_grid.configuration.chunk_shape,codecs:e.codecs}),get_strides(s,o){return rt(s,o??i)},async get_chunk_bytes(s,o){let u=r.encode_chunk_key(s),l=t.resolve(u).path;return t.store.get(l,o)}}}var Er,Ar,xe,$r;let Gt=($r=class extends(Ar=dt,Er=yt,Ar){constructor(n,r,i){super(n,r);ee(this,"kind","array");Ae(this,xe);ee(this,Er);me(this,xe,{...i,fill_value:jr(i)}),this[yt]=rs(this,i)}get attrs(){return H(this,xe).attributes}get shape(){return H(this,xe).shape}get chunks(){return this[yt].chunk_shape}get dtype(){return H(this,xe).data_type}async getChunk(n,r){let i=this[yt],s=await i.get_chunk_bytes(n,r);if(!s){let o=i.chunk_shape.reduce((l,c)=>l*c,1),u=new i.TypedArray(o);return u.fill(i.fill_value),{data:u,shape:i.chunk_shape,stride:i.get_strides(i.chunk_shape)}}return i.codec.decode(s)}is(n){return Ji(this.dtype,n)}},xe=new WeakMap,$r),Qt=is();function is(){let t=new WeakMap;function e(n){let r=t.get(n)??{v2:0,v3:0};return t.set(n,r),r}return{increment(n,r){e(n)[r]+=1},version_max(n){let r=e(n);return r.v3>r.v2?"v3":"v2"}}}async function ss(t){let e=await t.store.get(t.resolve(".zattrs").path);return e?Nt(e):{}}async function os(t,e={}){let n="store"in t?t:new dt(t),r={};return(e.attrs??!0)&&(r=await ss(n)),e.kind==="array"?Vn(n,r):e.kind==="group"?Gn(n,r):Vn(n,r).catch(i=>{if(i instanceof Mt)return Gn(n,r);throw i})}async function Vn(t,e){let{path:n}=t.resolve(".zarray"),r=await t.store.get(n);if(!r)throw new Mt("v2 array",{cause:new yn(n)});return Qt.increment(t.store,"v2"),new Gt(t.store,t.path,Wi(Nt(r),e))}async function Gn(t,e){let{path:n}=t.resolve(".zgroup"),r=await t.store.get(n);if(!r)throw new Mt("v2 group",{cause:new yn(n)});return Qt.increment(t.store,"v2"),new kn(t.store,t.path,qi(Nt(r),e))}async function ls(t){let{store:e,path:n}=t.resolve("zarr.json"),r=await t.store.get(n);if(!r)throw new Mt("v3 array or group",{cause:new yn(n)});let i=Nt(r);return i.node_type==="array"&&(i.fill_value=jr(i)),i.node_type==="array"?new Gt(e,t.path,i):new kn(e,t.path,i)}async function as(t,e={}){let n="store"in t?t:new dt(t),r=await ls(n);if(Qt.increment(n.store,"v3"),e.kind===void 0||e.kind==="array"&&r instanceof Gt||e.kind==="group"&&r instanceof kn)return r;let i=r instanceof Gt?"array":"group";throw new Error(`Expected node of kind ${e.kind}, found ${i}.`)}async function Ze(t,e={}){let n="store"in t?t.store:t,r=Qt.version_max(n),i=r==="v2"?Ze.v2:Ze.v3,s=r==="v2"?Ze.v3:Ze.v2;return i(t,e).catch(o=>{if(o instanceof Mt)return s(t,e);throw o})}Ze.v2=os;Ze.v3=as;function*us(t,e,n=1){e===void 0&&(e=t,t=0);for(let r=t;rr[Symbol.iterator]()),n=e.map(r=>r.next());if(n.some(r=>r.done))throw new Error("Input contains an empty iterator.");for(let r=0;;){if(n[r].done){if(e[r]=t[r][Symbol.iterator](),n[r]=e[r].next(),++r>=e.length)return}else yield n.map(({value:i})=>i),r=0;n[r]=e[r].next()}}function cs({start:t,stop:e,step:n},r){if(n===0)throw new Error("slice step cannot be zero");n=n??1;const i=n<0,[s,o]=i?[-1,r-1]:[0,r];return t===null?t=i?o:s:t<0?(t+=r,to&&(t=o),e===null?e=i?s:o:e<0?(e+=r,eo&&(e=o),[t,e,n]}function hn(t,e,n=null){return e===void 0&&(e=t,t=null),{start:t,stop:e,step:n}}function hs(){const t=[];return{add:e=>t.push(e()),onIdle:()=>Promise.all(t)}}class En extends Error{constructor(e){super(e),this.name="IndexError"}}function ds(t,e){throw new En(`too many indicies for array; expected ${e.length}, got ${t.length}`)}function _s(t){throw new En(`index out of bounds for dimension with length ${t}`)}function ps(){throw new En("only slices with step >= 1 are supported")}function ms(t,e){t.length>e.length&&ds(t,e)}function gs(t,e){return t=Math.trunc(t),t<0&&(t=e+t),(t>=e||t<0)&&_s(e),t}class ys{constructor({dim_sel:e,dim_len:n,dim_chunk_len:r}){ee(this,"dim_sel");ee(this,"dim_len");ee(this,"dim_chunk_len");ee(this,"nitems");e=gs(e,n),this.dim_sel=e,this.dim_len=n,this.dim_chunk_len=r,this.nitems=1}*[Symbol.iterator](){const e=Math.floor(this.dim_sel/this.dim_chunk_len),n=e*this.dim_chunk_len,r=this.dim_sel-n;yield{dim_chunk_ix:e,dim_chunk_sel:r}}}class Yn{constructor({dim_sel:e,dim_len:n,dim_chunk_len:r}){ee(this,"start");ee(this,"stop");ee(this,"step");ee(this,"dim_len");ee(this,"dim_chunk_len");ee(this,"nitems");ee(this,"nchunks");const[i,s,o]=cs(e,n);this.start=i,this.stop=s,this.step=o,this.step<1&&ps(),this.dim_len=n,this.dim_chunk_len=r,this.nitems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.nchunks=Math.ceil(this.dim_len/this.dim_chunk_len)}*[Symbol.iterator](){const e=Math.floor(this.start/this.dim_chunk_len),n=Math.ceil(this.stop/this.dim_chunk_len);for(const r of us(e,n)){const i=r*this.dim_chunk_len,s=Math.min(this.dim_len,(r+1)*this.dim_chunk_len),o=s-i;let u=0,l=0;if(this.starts?o:this.stop-i,h=[l,c,this.step],p=Math.ceil((c-l)/this.step),d=[u,u+p,1];yield{dim_chunk_ix:r,dim_chunk_sel:h,dim_out_sel:d}}}}function ws(t,e){let n=[];return t===null?n=e.map(r=>hn(null)):Array.isArray(t)&&(n=t.map(r=>r??hn(null))),ms(n,e),n}class bs{constructor({selection:e,shape:n,chunk_shape:r}){ee(this,"dim_indexers");ee(this,"shape");this.dim_indexers=ws(e,n).map((i,s)=>new(typeof i=="number"?ys:Yn)({dim_sel:i,dim_len:n[s],dim_chunk_len:r[s]})),this.shape=this.dim_indexers.filter(i=>i instanceof Yn).map(i=>i.nitems)}*[Symbol.iterator](){for(const e of fs(...this.dim_indexers)){const n=e.map(i=>i.dim_chunk_ix),r=e.map(i=>"dim_out_sel"in i?{from:i.dim_chunk_sel,to:i.dim_out_sel}:{from:i.dim_chunk_sel,to:null});yield{chunk_coords:n,mapping:r}}}}function vs(t,e){return"get"in t?t.get(e):t[e]}async function ks(t,e,n,r){var l;let i=ns(t),s=new bs({selection:e,shape:t.shape,chunk_shape:t.chunks}),o=r.prepare(new i.TypedArray(s.shape.reduce((c,h)=>c*h,1)),s.shape,i.get_strides(s.shape,n.order)),u=((l=n.create_queue)==null?void 0:l.call(n))??hs();for(const{chunk_coords:c,mapping:h}of s)u.add(async()=>{let{data:p,shape:d,stride:y}=await t.getChunk(c,n.opts),A=r.prepare(p,d,y);r.set_from_chunk(o,A,h)});return await u.onIdle(),s.shape.length===0?vs(o.data,0):o}function An(t,e=0,n){let r=n??t.length-e;return{length:r,subarray(i,s=r){return An(t,e+i,s-i)},set(i,s=0){for(let o=0;oO.path),y=i.multiscales[0].axes.map(O=>O.name),A=d.at(-1);const M=new Os(r+"/"+A),k=await Ze(M,{kind:"array"});let b=y.indexOf("c"),w=k.shape;if(w.at(-1)*w.at(-2)>s*s){console.log("Lowest resolution too large for Thumbnail: ",w,r);return}let E=w.length;k.chunks;let V=w[b],U,B;(L=i==null?void 0:i.omero)!=null&&L.channels?(U=i.omero.channels.map(O=>O.active),B=i.omero.channels.map(O=>Br(O.color))):(U=Ci(V),B=Ri(V,U)),B=B.filter((O,W)=>U[W]);let f=U.reduce((O,W,z)=>(W&&O.push(z),O),[]).map(O=>{let W=w.map((z,v)=>v==b?O:v>=E-2?hn(0,z):y[v]=="z"||y[v]=="t"?parseInt(z/2+""):0);return Cs(k,W)}),a=await Promise.all(f),_=a.map(O=>Dr(O)),R=Ei(a,_,B);n(2,l=w.at(-1)),n(3,c=w.at(-2));let T=l/Zn;c>l&&(T=c/Zn),n(1,u=l/T),setTimeout(()=>{o.getContext("2d").putImageData(new ImageData(R,l,c),0,0)},100)}li(()=>{h()});function p(d){sn[d?"unshift":"push"](()=>{o=d,n(0,o)})}return t.$$set=d=>{"source"in d&&n(4,r=d.source),"attrs"in d&&n(5,i=d.attrs),"max_size"in d&&n(6,s=d.max_size)},[o,u,l,c,r,i,s,p]}class Jr extends st{constructor(e){super(),it(this,e,Ls,Ss,Ye,{source:4,attrs:5,max_size:6})}}function xn(t,e,n){const r=t.slice();return r[9]=e[n],r}function er(t){let e,n,r,i=t[4](t[9].source),s,o,u=t[9].csv_row_count+"",l,c,h=t[9].well_count?"plates":"images",p,d,y,A=or(t[9])+"",M,k,b,w,E,V,U=t[9].image_attrs&&tr(t),B=i&&nr(t),S=t[9].source&&rr(t);function f(){return t[5](t[9])}return{c(){e=N("a"),n=N("div"),U&&U.c(),r=q(),B&&B.c(),s=q(),S&&S.c(),o=q(),l=X(u),c=q(),p=X(h),d=q(),y=N("div"),M=X(A),k=q(),C(y,"class","hoverInfo svelte-c69c1m"),C(n,"class","item svelte-c69c1m"),C(e,"href",b=window.location.origin+"?csv="+t[9].csv)},m(a,_){J(a,e,_),g(e,n),U&&U.m(n,null),g(n,r),B&&B.m(n,null),g(n,s),S&&S.m(n,null),g(n,o),g(n,l),g(n,c),g(n,p),g(n,d),g(n,y),g(y,M),g(e,k),w=!0,E||(V=tt(e,"click",Lr(f)),E=!0)},p(a,_){t=a,t[9].image_attrs?U?(U.p(t,_),_&2&&P(U,1)):(U=tr(t),U.c(),P(U,1),U.m(n,r)):U&&(Je(),G(U,1,1,()=>{U=null}),He()),_&2&&(i=t[4](t[9].source)),i?B?B.p(t,_):(B=nr(t),B.c(),B.m(n,s)):B&&(B.d(1),B=null),t[9].source?S?S.p(t,_):(S=rr(t),S.c(),S.m(n,o)):S&&(S.d(1),S=null),(!w||_&2)&&u!==(u=t[9].csv_row_count+"")&&fe(l,u),(!w||_&2)&&h!==(h=t[9].well_count?"plates":"images")&&fe(p,h),(!w||_&2)&&A!==(A=or(t[9])+"")&&fe(M,A),(!w||_&2&&b!==(b=window.location.origin+"?csv="+t[9].csv))&&C(e,"href",b)},i(a){w||(P(U),w=!0)},o(a){G(U),w=!1},d(a){a&&j(e),U&&U.d(),B&&B.d(),S&&S.d(),E=!1,V()}}}function tr(t){let e,n;return e=new Jr({props:{attrs:t[9].image_attrs,source:t[9].image_url,max_size:t[2]}}),{c(){ke(e.$$.fragment)},m(r,i){ye(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.attrs=r[9].image_attrs),i&2&&(s.source=r[9].image_url),i&4&&(s.max_size=r[2]),e.$set(s)},i(r){n||(P(e.$$.fragment,r),n=!0)},o(r){G(e.$$.fragment,r),n=!1},d(r){we(e,r)}}}function nr(t){let e,n,r;return{c(){e=N("img"),C(e,"alt",n="Icon from "+t[9].source),C(e,"class","source_icon svelte-c69c1m"),In(e.src,r=t[4](t[9].source))||C(e,"src",r)},m(i,s){J(i,e,s)},p(i,s){s&2&&n!==(n="Icon from "+i[9].source)&&C(e,"alt",n),s&2&&!In(e.src,r=i[4](i[9].source))&&C(e,"src",r)},d(i){i&&j(e)}}}function rr(t){let e,n=t[9].source+"",r,i;return{c(){e=N("span"),r=X(n),i=X(":"),C(e,"class","source svelte-c69c1m")},m(s,o){J(s,e,o),g(e,r),g(e,i)},p(s,o){o&2&&n!==(n=s[9].source+"")&&fe(r,n)},d(s){s&&j(e)}}}function ir(t,e){let n,r,i,s=e[9].csv_row_count&&e[9].csv&&er(e);return{key:t,first:null,c(){n=bt(),s&&s.c(),r=bt(),this.first=n},m(o,u){J(o,n,u),s&&s.m(o,u),J(o,r,u),i=!0},p(o,u){e=o,e[9].csv_row_count&&e[9].csv?s?(s.p(e,u),u&2&&P(s,1)):(s=er(e),s.c(),P(s,1),s.m(r.parentNode,r)):s&&(Je(),G(s,1,1,()=>{s=null}),He())},i(o){i||(P(s),i=!0)},o(o){G(s),i=!1},d(o){o&&(j(n),j(r)),s&&s.d(o)}}}function sr(t){let e,n,r,i,s,o,u;return{c(){e=N("p"),n=N("a"),r=X("< Show all samples"),C(n,"class","home svelte-c69c1m"),C(n,"title","Show ALL samples"),C(n,"href",window.location.origin+"?csv="+et),C(e,"class","svelte-c69c1m")},m(l,c){J(l,e,c),g(e,n),g(n,r),s=!0,o||(u=tt(n,"click",Lr(t[6])),o=!0)},p:be,i(l){s||(l&&nt(()=>{s&&(i||(i=Jt(e,Bn,{duration:500,delay:0,opacity:.5,start:.5},!0)),i.run(1))}),s=!0)},o(l){l&&(i||(i=Jt(e,Bn,{duration:500,delay:0,opacity:.5,start:.5},!1)),i.run(0)),s=!1},d(l){l&&j(e),l&&i&&i.end(),o=!1,u()}}}function Is(t){let e,n,r,i=[],s=new Map,o,u,l,c,h,p,d,y;e=new Ii({props:{tableRows:t[1]}});let A=Ht(t[1]);const M=b=>b[9].url;for(let b=0;b{k=null}),He())},i(b){if(!y){P(e.$$.fragment,b);for(let w=0;w{n(1,i=d),d.length<100?n(2,s=2048):n(2,s=512)});function l(d){console.log("handleThumbClick",d,et),d!==et&&u(),Xe.emptyTable(),n(0,r=d),gn(r,Xe)}function c(d){if(d==="IDR")return"/idr-mark.svg";let y=o[d];return y?`https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=${y}&size=24`:null}const h=d=>l(d.csv),p=()=>l(et);return t.$$set=d=>{"csvUrl"in d&&n(0,r=d.csvUrl)},[r,i,s,l,c,h,p]}class Ms extends st{constructor(e){super(),it(this,e,Fs,Is,Ye,{csvUrl:0})}}function lr(t){let e,n,r=`${t[2]}px`,i=`${t[3]}px`,s,o,u;return{c(){e=N("div"),C(e,"class","pixel svelte-4hpgyt"),Qe(e,"left",r),Qe(e,"top",i)},m(l,c){J(l,e,c),s=!0,o||(u=[tt(e,"introend",t[6]),tt(e,"outroend",t[5])],o=!0)},p(l,c){c&4&&r!==(r=`${l[2]}px`)&&Qe(e,"left",r),c&8&&i!==(i=`${l[3]}px`)&&Qe(e,"top",i)},i(l){s||(l&&nt(()=>{s&&(n||(n=Jt(e,Dn,{duration:5e3},!0)),n.run(1))}),s=!0)},o(l){l&&(n||(n=Jt(e,Dn,{duration:5e3},!1)),n.run(0)),s=!1},d(l){l&&j(e),l&&n&&n.end(),o=!1,Ge(u)}}}function Ns(t){let e,n,r;nt(t[7]);let i=t[4]&&lr(t);return{c(){i&&i.c(),e=bt()},m(s,o){i&&i.m(s,o),J(s,e,o),n||(r=tt(window,"resize",t[7]),n=!0)},p(s,[o]){s[4]?i?(i.p(s,o),o&16&&P(i,1)):(i=lr(s),i.c(),P(i,1),i.m(e.parentNode,e)):i&&(Je(),G(i,1,1,()=>{i=null}),He())},i(s){P(i)},o(s){G(i)},d(s){s&&j(e),i&&i.d(s),n=!1,r()}}}function gt(t){return Math.floor(Math.random()*t)}function Us(t,e,n){let r=0,i=0,s=0,o=0,u=!1,l=gt(5e3);function c(){n(2,s=gt(r/20)*20),n(3,o=gt(i/20)*20),n(4,u=!0)}function h(){l=2e3+gt(5e3),setTimeout(()=>{n(4,u=!1)},l)}setTimeout(c,gt(1e4));function p(){n(0,r=window.innerWidth),n(1,i=window.innerHeight)}return[r,i,s,o,u,c,h,p]}class je extends st{constructor(e){super(),it(this,e,Us,Ns,Ye,{})}}function Ds(t){let e,n,r,i,s,o,u,l;return{c(){e=N("button"),n=X(t[1]),r=q(),i=N("span"),i.textContent="^",s=q(),o=N("span"),o.textContent="^",C(i,"class","acc svelte-g3ba97"),Dt(i,"strong",t[3]==t[0]&&t[4]),C(o,"class","dec svelte-g3ba97"),Dt(o,"strong",t[3]==t[0]&&!t[4]),C(e,"class","svelte-g3ba97")},m(c,h){J(c,e,h),g(e,n),g(e,r),g(e,i),g(e,s),g(e,o),u||(l=tt(e,"click",t[5]),u=!0)},p(c,[h]){h&2&&fe(n,c[1]),h&25&&Dt(i,"strong",c[3]==c[0]&&c[4]),h&25&&Dt(o,"strong",c[3]==c[0]&&!c[4])},i:be,o:be,d(c){c&&j(e),u=!1,l()}}}function Bs(t,e,n){let{col_name:r}=e,{col_label:i}=e,{handleSort:s}=e,{sortedBy:o}=e,{sortAscending:u}=e;const l=()=>s(r);return t.$$set=c=>{"col_name"in c&&n(0,r=c.col_name),"col_label"in c&&n(1,i=c.col_label),"handleSort"in c&&n(2,s=c.handleSort),"sortedBy"in c&&n(3,o=c.sortedBy),"sortAscending"in c&&n(4,u=c.sortAscending)},[r,i,s,o,u,l]}class Yt extends st{constructor(e){super(),it(this,e,Bs,Ds,Ye,{col_name:0,col_label:1,handleSort:2,sortedBy:3,sortAscending:4})}}function zs(t){let e;return{c(){e=N("nav"),e.innerHTML='OME Logo

2024 NGFF Challenge

',C(e,"class","svelte-1v9ay5y")},m(n,r){J(n,e,r)},p:be,i:be,o:be,d(n){n&&j(e)}}}class Ps extends st{constructor(e){super(),it(this,e,null,zs,Ye,{})}}function ar(t,e,n){const r=t.slice();return r[16]=e[n],r}function js(t){let e=Object.keys(t[3]).length+"",n;return{c(){n=X(e)},m(r,i){J(r,n,i)},p(r,i){i&8&&e!==(e=Object.keys(r[3]).length+"")&&fe(n,e)},d(r){r&&j(n)}}}function Ws(t){let e,n,r;return{c(){e=N("button"),e.textContent="Load Ro-Crate metadata",C(e,"class","loadrocrate svelte-53dfht")},m(i,s){J(i,e,s),n||(r=tt(e,"click",t[9]),n=!0)},p:be,d(i){i&&j(e),n=!1,r()}}}function ur(t){let e,n,r;return n=new Yt({props:{col_label:"Source",col_name:"source",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}}),{c(){e=N("th"),ke(n.$$.fragment),C(e,"class","svelte-53dfht")},m(i,s){J(i,e,s),ye(n,e,null),r=!0},p(i,s){const o={};s&16&&(o.sortedBy=i[4]),s&32&&(o.sortAscending=i[5]),n.$set(o)},i(i){r||(P(n.$$.fragment,i),r=!0)},o(i){G(n.$$.fragment,i),r=!1},d(i){i&&j(e),we(n)}}}function fr(t){let e;return{c(){e=N("th"),e.textContent="Data Origin",C(e,"class","svelte-53dfht")},m(n,r){J(n,e,r)},d(n){n&&j(e)}}}function cr(t){let e,n,r,i,s;return n=new Yt({props:{col_label:"Wells",col_name:"well_count",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}}),{c(){e=N("th"),ke(n.$$.fragment),r=q(),i=N("th"),i.textContent="Images",C(e,"class","svelte-53dfht"),C(i,"class","svelte-53dfht")},m(o,u){J(o,e,u),ye(n,e,null),J(o,r,u),J(o,i,u),s=!0},p(o,u){const l={};u&16&&(l.sortedBy=o[4]),u&32&&(l.sortAscending=o[5]),n.$set(l)},i(o){s||(P(n.$$.fragment,o),s=!0)},o(o){G(n.$$.fragment,o),s=!1},d(o){o&&(j(e),j(r),j(i)),we(n)}}}function hr(t){let e,n;return e=new Jr({props:{attrs:t[16].image_attrs,source:t[16].image_url}}),{c(){ke(e.$$.fragment)},m(r,i){ye(e,r,i),n=!0},p(r,i){const s={};i&1&&(s.attrs=r[16].image_attrs),i&1&&(s.source=r[16].image_url),e.$set(s)},i(r){n||(P(e.$$.fragment,r),n=!0)},o(r){G(e.$$.fragment,r),n=!1},d(r){we(e,r)}}}function qs(t){let e,n=br(t[16].url)+"",r,i;return{c(){e=N("a"),r=X(n),C(e,"href",i="https://deploy-preview-36--ome-ngff-validator.netlify.app/?source="+t[16].url),C(e,"target","_blank")},m(s,o){J(s,e,o),g(e,r)},p(s,o){o&1&&n!==(n=br(s[16].url)+"")&&fe(r,n),o&1&&i!==(i="https://deploy-preview-36--ome-ngff-validator.netlify.app/?source="+s[16].url)&&C(e,"href",i)},d(s){s&&j(e)}}}function Js(t){let e,n=t[16].csv.split("/").pop()+"",r,i,s=t[16].csv_row_count+"",o,u,l;return{c(){e=N("a"),r=X(n),i=X(" ("),o=X(s),u=X(")"),C(e,"href",l=window.location.origin+"?csv="+t[16].csv),C(e,"target","_blank")},m(c,h){J(c,e,h),g(e,r),g(e,i),g(e,o),g(e,u)},p(c,h){h&1&&n!==(n=c[16].csv.split("/").pop()+"")&&fe(r,n),h&1&&s!==(s=c[16].csv_row_count+"")&&fe(o,s),h&1&&l!==(l=window.location.origin+"?csv="+c[16].csv)&&C(e,"href",l)},d(c){c&&j(e)}}}function dr(t){let e,n=(t[16].source||"")+"",r;return{c(){e=N("td"),r=X(n),C(e,"class","svelte-53dfht")},m(i,s){J(i,e,s),g(e,r)},p(i,s){s&1&&n!==(n=(i[16].source||"")+"")&&fe(r,n)},d(i){i&&j(e)}}}function _r(t){let e,n=t[16].origin&&pr(t);return{c(){e=N("td"),n&&n.c(),C(e,"class","svelte-53dfht")},m(r,i){J(r,e,i),n&&n.m(e,null)},p(r,i){r[16].origin?n?n.p(r,i):(n=pr(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&j(e),n&&n.d()}}}function pr(t){let e,n,r=t[16].origin.slice(-10)+"",i,s;return{c(){e=N("a"),n=X("..."),i=X(r),C(e,"href",s=t[16].origin),C(e,"target","_blank")},m(o,u){J(o,e,u),g(e,n),g(e,i)},p(o,u){u&1&&r!==(r=o[16].origin.slice(-10)+"")&&fe(i,r),u&1&&s!==(s=o[16].origin)&&C(e,"href",s)},d(o){o&&j(e)}}}function mr(t){let e,n=(t[16].well_count||"")+"",r,i,s,o=(t[16].well_count?t[16].well_count*t[16].field_count:"")+"",u;return{c(){e=N("td"),r=X(n),i=q(),s=N("td"),u=X(o),C(e,"class","svelte-53dfht"),C(s,"class","svelte-53dfht")},m(l,c){J(l,e,c),g(e,r),J(l,i,c),J(l,s,c),g(s,u)},p(l,c){c&1&&n!==(n=(l[16].well_count||"")+"")&&fe(r,n),c&1&&o!==(o=(l[16].well_count?l[16].well_count*l[16].field_count:"")+"")&&fe(u,o)},d(l){l&&(j(e),j(i),j(s))}}}function gr(t){let e=(t[3][t[16].organism_id]||t[10](t[16].organism_id))+"",n;return{c(){n=X(e)},m(r,i){J(r,n,i)},p(r,i){i&9&&e!==(e=(r[3][r[16].organism_id]||r[10](r[16].organism_id))+"")&&fe(n,e)},d(r){r&&j(n)}}}function yr(t){let e=(t[3][t[16].fbbi_id]||t[11](t[16].fbbi_id))+"",n;return{c(){n=X(e)},m(r,i){J(r,n,i)},p(r,i){i&9&&e!==(e=(r[3][r[16].fbbi_id]||r[11](r[16].fbbi_id))+"")&&fe(n,e)},d(r){r&&j(n)}}}function wr(t,e){let n,r,i,s,o,u,l,c,h=(e[16].load_failed?"x":e[16].shape||"")+"",p,d,y,A=Kt(e[16].written)+"",M,k,b,w,E,V,U,B,S,f,a=e[16].image_attrs&&hr(e);function _(K,I){return K[16].csv_row_count&&K[16].csv?Js:qs}let R=_(e),T=R(e),L=e[2]&&dr(e),O=e[8]&&_r(e),W=e[7]&&mr(e),z=e[16].organism_id&&gr(e),v=e[16].fbbi_id&&yr(e);return{key:t,first:null,c(){n=N("tr"),r=N("td"),a&&a.c(),i=q(),s=N("td"),T.c(),o=q(),L&&L.c(),u=q(),O&&O.c(),l=q(),c=N("td"),p=X(h),d=q(),y=N("td"),M=X(A),k=q(),W&&W.c(),b=q(),w=N("td"),z&&z.c(),V=q(),U=N("td"),v&&v.c(),S=q(),C(r,"class","svelte-53dfht"),C(s,"class","svelte-53dfht"),C(c,"class","svelte-53dfht"),C(y,"class","svelte-53dfht"),C(w,"title",E=e[16].organism_id||""),C(w,"class","svelte-53dfht"),C(U,"title",B=e[16].fbbi_id||""),C(U,"class","svelte-53dfht"),this.first=n},m(K,I){J(K,n,I),g(n,r),a&&a.m(r,null),g(n,i),g(n,s),T.m(s,null),g(n,o),L&&L.m(n,null),g(n,u),O&&O.m(n,null),g(n,l),g(n,c),g(c,p),g(n,d),g(n,y),g(y,M),g(n,k),W&&W.m(n,null),g(n,b),g(n,w),z&&z.m(w,null),g(n,V),g(n,U),v&&v.m(U,null),g(n,S),f=!0},p(K,I){e=K,e[16].image_attrs?a?(a.p(e,I),I&1&&P(a,1)):(a=hr(e),a.c(),P(a,1),a.m(r,null)):a&&(Je(),G(a,1,1,()=>{a=null}),He()),R===(R=_(e))&&T?T.p(e,I):(T.d(1),T=R(e),T&&(T.c(),T.m(s,null))),e[2]?L?L.p(e,I):(L=dr(e),L.c(),L.m(n,u)):L&&(L.d(1),L=null),e[8]?O?O.p(e,I):(O=_r(e),O.c(),O.m(n,l)):O&&(O.d(1),O=null),(!f||I&1)&&h!==(h=(e[16].load_failed?"x":e[16].shape||"")+"")&&fe(p,h),(!f||I&1)&&A!==(A=Kt(e[16].written)+"")&&fe(M,A),e[7]?W?W.p(e,I):(W=mr(e),W.c(),W.m(n,b)):W&&(W.d(1),W=null),e[16].organism_id?z?z.p(e,I):(z=gr(e),z.c(),z.m(w,null)):z&&(z.d(1),z=null),(!f||I&1&&E!==(E=e[16].organism_id||""))&&C(w,"title",E),e[16].fbbi_id?v?v.p(e,I):(v=yr(e),v.c(),v.m(U,null)):v&&(v.d(1),v=null),(!f||I&1&&B!==(B=e[16].fbbi_id||""))&&C(U,"title",B)},i(K){f||(P(a),f=!0)},o(K){G(a),f=!1},d(K){K&&j(n),a&&a.d(),T.d(),L&&L.d(),O&&O.d(),W&&W.d(),z&&z.d(),v&&v.d()}}}function Hs(t){let e,n,r,i,s,o,u,l,c,h,p,d,y,A,M,k,b,w,E,V,U,B,S,f,a,_=t[0].length+"",R,T,L,O=t[0].reduce(vr,0)+"",W,z,v,K=Kt(t[0].reduce(t[13],0))+"",I,Me,ce,F,Z,_e,re,ge,oe,he,$,Y,se,ue,Q,ve,le,ne,Re,Se,Le,$e,Ie,ie,ae,ze,x,We,Ne,pe=[],De=new Map,Ee;e=new je({}),n=new je({}),r=new je({}),i=new je({}),s=new je({}),u=new je({}),l=new je({}),c=new je({}),h=new je({}),p=new je({}),y=new Ps({}),w=new Ms({props:{csvUrl:t[1]}});function Be(m,D){return m[6]?Ws:js}let Ce=Be(t),Fe=Ce(t);Q=new Yt({props:{col_label:"Url",col_name:"url",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}});let te=t[2]&&ur(t),Te=t[8]&&fr();$e=new Yt({props:{col_label:"Data size",col_name:"written",handleSort:t[12],sortedBy:t[4],sortAscending:t[5]}});let de=t[7]&&cr(t),_t=Ht(t[0]);const On=m=>m[16].url;for(let m=0;m<_t.length;m+=1){let D=ar(t,_t,m),Pe=On(D);De.set(Pe,pe[m]=wr(Pe,D))}return{c(){ke(e.$$.fragment),ke(n.$$.fragment),ke(r.$$.fragment),ke(i.$$.fragment),ke(s.$$.fragment),o=q(),ke(u.$$.fragment),ke(l.$$.fragment),ke(c.$$.fragment),ke(h.$$.fragment),ke(p.$$.fragment),d=q(),ke(y.$$.fragment),A=q(),M=N("main"),k=N("h1"),k.textContent="OME 2024 NGFF Challenge",b=q(),ke(w.$$.fragment),E=q(),V=N("div"),U=N("table"),B=N("tr"),B.innerHTML='Zarr Samples (URLs) Images Bytes written Organisms',S=q(),f=N("tr"),a=N("td"),R=X(_),T=q(),L=N("td"),W=X(O),z=q(),v=N("td"),I=X(K),Me=q(),ce=N("td"),Fe.c(),F=q(),Z=N("progress"),ge=q(),oe=N("table"),he=N("thead"),$=N("tr"),Y=N("th"),Y.textContent="Thumb",se=q(),ue=N("th"),ke(Q.$$.fragment),ve=q(),te&&te.c(),le=q(),Te&&Te.c(),ne=q(),Re=N("th"),Re.textContent="Shape",Se=q(),Le=N("th"),ke($e.$$.fragment),Ie=q(),de&&de.c(),ie=q(),ae=N("th"),ae.textContent="Organism",ze=q(),x=N("th"),x.textContent="Imaging",We=q(),Ne=N("tbody");for(let m=0;m{te=null}),He()),m[8]?Te||(Te=fr(),Te.c(),Te.m($,ne)):Te&&(Te.d(1),Te=null);const Zt={};D&16&&(Zt.sortedBy=m[4]),D&32&&(Zt.sortAscending=m[5]),$e.$set(Zt),m[7]?de?(de.p(m,D),D&128&&P(de,1)):(de=cr(m),de.c(),P(de,1),de.m($,ie)):de&&(Je(),G(de,1,1,()=>{de=null}),He()),D&3469&&(_t=Ht(m[0]),Je(),pe=Mr(pe,D,On,1,m,_t,De,Ne,Fr,wr,null,ar),He())},i(m){if(!Ee){P(e.$$.fragment,m),P(n.$$.fragment,m),P(r.$$.fragment,m),P(i.$$.fragment,m),P(s.$$.fragment,m),P(u.$$.fragment,m),P(l.$$.fragment,m),P(c.$$.fragment,m),P(h.$$.fragment,m),P(p.$$.fragment,m),P(y.$$.fragment,m),P(w.$$.fragment,m),P(Q.$$.fragment,m),P(te),P($e.$$.fragment,m),P(de);for(let D=0;D<_t.length;D+=1)P(pe[D]);Ee=!0}},o(m){G(e.$$.fragment,m),G(n.$$.fragment,m),G(r.$$.fragment,m),G(i.$$.fragment,m),G(s.$$.fragment,m),G(u.$$.fragment,m),G(l.$$.fragment,m),G(c.$$.fragment,m),G(h.$$.fragment,m),G(p.$$.fragment,m),G(y.$$.fragment,m),G(w.$$.fragment,m),G(Q.$$.fragment,m),G(te),G($e.$$.fragment,m),G(de);for(let D=0;D50&&(e=e.slice(0,20)+"..."+e.slice(-20)),e}const vr=(t,e)=>t+(e.well_count?e.well_count*e.field_count:1),kr=t=>t.loaded;function Ks(t,e,n){let r,i,s,u=new URLSearchParams(window.location.search).get("csv");try{new URL(u)}catch{console.error("Invalid csv URL",u),u=et}let l=[],c=!1,h={},p={};Xe.subscribe(E=>{n(0,l=E)}),u&&gn(u,Xe);function d(){Xe.loadRocrateJsonAllRows()}function y(E){return console.log("loadOrganism",E),E?h[E]?h[E]:(n(3,h[E]=E,h),vi(E).then(V=>{n(3,h={...h,[E]:V})}),E):""}function A(E){return E?p[E]?p[E]:(p[E]=E,ki(E).then(V=>{p={...p,[E]:V}}),E):""}let M="",k=!0;function b(E){console.log("handleSort",E,"sortedBy",M),M===E?n(5,k=!k):n(5,k=!0),n(4,M=E),Xe.sortTable(E,k)}const w=(E,V)=>E+parseInt(V.written)||0;return t.$$.update=()=>{t.$$.dirty&1&&n(2,c=l.some(E=>E.source)),t.$$.dirty&1&&n(8,r=l.some(E=>E.origin)),t.$$.dirty&1&&n(7,i=l.some(E=>E.well_count)),t.$$.dirty&1&&n(6,s=!l.some(E=>E.rocrate_loaded))},[l,u,c,h,M,k,s,i,r,d,y,A,b,w]}class Vs extends st{constructor(e){super(),it(this,e,Ks,Hs,Ye,{})}}new Vs({target:document.getElementById("app")}); diff --git a/index.html b/index.html index b4eafb2..00df6c5 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ ome2024-ngff-challenge - - + +