view x/static/js/3199.a36b17a7.chunk.js @ 133:cec274db51c0 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 7d28252954cae9f8db5f8a85d8f29cb2865b504b-dirty
author fubar
date Fri, 18 Oct 2024 11:57:55 +0000
parents 49f3d3878413
children
line wrap: on
line source

"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[3199],{53199:(e,l,t)=>{t.r(l),t.d(l,{default:()=>G});var a=t(7552),n=t(68446),o=t(75785),s=t(99546),r=t(9937),i=t(23758),c=t(87731),m=t(85676),d=t(92179),b=t(66395),u=t(84495);const h=(0,a.lazy)((()=>t.e(4773).then(t.bind(t,84773)))),k=(0,o.n9)()((()=>({cell:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}))),w=(0,n.observer)((function({model:e}){const{classes:l}=k(),{bookmarks:t,bookmarksWithValidAssemblies:n,selectedAssemblies:o,selectedBookmarks:r}=e,i=(0,s.getSession)(e),w=new Set(o),g=t.filter((e=>w.has(e.assemblyName))).map(((e,l)=>{const{assemblyName:t,...a}=e;return{...e,id:l,assemblyName:t,locString:(0,s.assembleLocString)(a),correspondingObj:e}})),f=[50,Math.max((0,s.measureText)("Bookmark link",12)+30,(0,s.measureGridWidth)(g.map((e=>e.locString)))),Math.max((0,s.measureText)("Label",12)+30,(0,s.measureGridWidth)(g.map((e=>e.label)))),Math.max((0,s.measureText)("Assembly",12)+30,(0,s.measureGridWidth)(g.map((e=>e.assemblyName)))),100];return a.createElement(m.z,{autoHeight:!0,density:"compact",rows:g,columns:[{...d.f,width:f[0]},{field:"locString",headerName:"Bookmark link",width:f[1],renderCell:({value:t,row:n})=>a.createElement(c.A,{className:l.cell,href:"#",onClick:async l=>{l.preventDefault();const{views:a}=i;await(0,u.Jn)(t,n.assemblyName,a,e)}},t)},{field:"label",headerName:"Label",width:f[2],editable:!0},{field:"assemblyName",headerName:"Assembly",width:f[3]},{field:"highlight",headerName:"Highlight",width:f[4],renderCell:({value:l,row:t})=>a.createElement(b.Ay,{color:l||"black",onChange:l=>{e.updateBookmarkHighlight(t,l)}})}],onCellDoubleClick:({row:l})=>{(0,s.getSession)(e).queueDialog((t=>[h,{onClose:t,model:e,dialogRow:l}]))},processRowUpdate:l=>{const t=g[l.id];return e.updateBookmarkLabel(t,l.label),l},onProcessRowUpdateError:e=>{i.notifyError(`${e}`,e)},checkboxSelection:!0,onRowSelectionModelChange:l=>{n.length>0&&e.setSelectedBookmarks(l.map((e=>({...g[e]}))))},rowSelectionModel:r.map((e=>e.id)),disableRowSelectionOnClick:!0})}));var g=t(48171),f=t(17125),y=t(98360),p=t(28172),A=t(29629),v=t(32808),E=t(81453);const S=(0,n.observer)((function({model:e}){const{validAssemblies:l,selectedAssemblies:t}=e,n=0===l.size,o="Select assemblies",s="select-assemblies-label",r=new Set(t),i=[...l].every((e=>r.has(e)));return a.createElement(g.A,{disabled:n,fullWidth:!0},a.createElement(f.A,{id:s},o),a.createElement(y.A,{labelId:s,multiple:!0,value:t,onChange:l=>{e.setSelectedAssemblies([...l.target.value])},input:a.createElement(p.A,{label:o}),renderValue:e=>e.join(", ")},a.createElement(A.A,{onClickCapture:l=>{i?e.setSelectedAssemblies([]):e.setSelectedAssemblies(void 0),l.preventDefault()}},a.createElement(v.A,{checked:i,indeterminate:!i&&t.length>0}),a.createElement(E.A,{primary:"Select all"})),[...l].map((e=>a.createElement(A.A,{key:e,value:e},a.createElement(v.A,{checked:t.includes(e)}),a.createElement(E.A,{primary:e}))))))}));var C=t(922),N=t(91194),x=t(550),$=t(22168),_=t(53794),D=t(37702),B=t(25762);const z=(0,a.lazy)((()=>t.e(5746).then(t.bind(t,5746)))),L=(0,a.lazy)((()=>Promise.all([t.e(3011),t.e(3425)]).then(t.bind(t,23425)))),T=(0,a.lazy)((()=>t.e(419).then(t.bind(t,20419)))),q=(0,a.lazy)((()=>t.e(772).then(t.bind(t,70772)))),V=(0,a.lazy)((()=>t.e(1326).then(t.bind(t,11326)))),W=(0,a.lazy)((()=>t.e(1811).then(t.bind(t,71811)))),j=(0,o.n9)()({flex:{display:"flex"}}),G=(0,n.observer)((function({model:e}){const{classes:l}=j();return a.createElement("div",null,a.createElement(r.A,{severity:"info"},"Click and type within the ",a.createElement("strong",null,"label")," field to annotate your bookmark. Double click the ",a.createElement("strong",null,"label")," field to do so within a dialog."),a.createElement("div",{className:l.flex},a.createElement(i.A,{"data-testid":"grid_bookmark_menu",menuItems:[{label:"Export",icon:N.A,onClick:()=>{(0,s.getSession)(e).queueDialog((l=>[z,{onClose:l,model:e}]))}},{label:"Import",icon:x.A,onClick:()=>{(0,s.getSession)(e).queueDialog((l=>[L,{model:e,onClose:l}]))}},{label:"Delete",icon:B.A,onClick:()=>{(0,s.getSession)(e).queueDialog((l=>[W,{model:e,onClose:l}]))}},{label:"Share",icon:D.A,onClick:()=>{(0,s.getSession)(e).queueDialog((l=>[T,{model:e,onClose:l}]))}},{label:"Edit colors",icon:_.A,onClick:()=>{(0,s.getSession)(e).queueDialog((l=>[V,{model:e,onClose:l}]))}},{label:"Settings",icon:$.A,onClick:()=>{(0,s.getSession)(e).queueDialog((l=>[q,{model:e,onClose:l}]))}}]},a.createElement(C.A,null)),a.createElement(S,{model:e})),a.createElement(w,{model:e}))}))},84495:(e,l,t)=>{t.d(l,{Jn:()=>o,LP:()=>r,eW:()=>i,fU:()=>s});var a=t(45465),n=t(99546);async function o(e,l,t,a){const o=(0,n.getSession)(a);try{let n=t.find((e=>e.id===o.focusedViewId));if(n?.assemblyNames[0]!==l&&(n=t.find((e=>"LinearGenomeView"===e.type&&e.assemblyNames[0]===l))),!n){const e=`${a.id}_${l}`;n=o.addView("LinearGenomeView",{id:e})}await n.navToLocString(e,l)}catch(e){console.error(e),o.notifyError(`${e}`,e)}}function s(e,l){const{selectedBookmarks:t,bookmarksWithValidAssemblies:o}=l,s=0===t.length?o:t;if("BED"===e){const e="",l={};s.forEach((e=>{const{label:t}=e,a=""===t?".":t,n=`${e.refName}\t${e.start}\t${e.end}\t${a}\n`;l[e.assemblyName]?l[e.assemblyName].push(n):l[e.assemblyName]=[n]}));for(const t in l){const n=l[t].reduce(((e,l)=>e+l),e),o=new Blob([n||""],{type:"text/x-bed;charset=utf-8"}),s=`jbrowse_bookmarks_${t}.bed`;(0,a.saveAs)(o,s)}}else{const e="chrom\tstart\tend\tlabel\tassembly_name\tcoord_range\n",l=s.map((e=>{const{label:l}=e,t=""===l?".":l,a=(0,n.assembleLocString)(e);return`${e.refName}\t${e.start+1}\t${e.end}\t${t}\t${e.assemblyName}\t${a}\n`})).reduce(((e,l)=>e+l),e),t=new Blob([l||""],{type:"text/tab-separated-values;charset=utf-8"}),o="jbrowse_bookmarks.tsv";(0,a.saveAs)(t,o)}}async function r(e){const l=function(e){let l=0;switch(e.length%4){case 3:l=1;break;case 2:l=2;break;case 0:l=0;break;default:throw new Error("base64 not a valid length")}return e+"=".repeat(l)}(e.replaceAll("-","+").replaceAll("_","/")),{toByteArray:a}=await Promise.resolve().then(t.t.bind(t,47130,19)),{inflate:n}=await t.e(7864).then(t.t.bind(t,57864,23)),o=n(a(l));return(new TextDecoder).decode(o)}async function i(e){const l=(new TextEncoder).encode(e),{deflate:a}=await t.e(7864).then(t.t.bind(t,57864,23)),{fromByteArray:n}=await Promise.resolve().then(t.t.bind(t,47130,19)),o=n(a(l)),s=o.indexOf("=");return s>0?o.slice(0,s).replaceAll("+","-").replaceAll("/","_"):o.replaceAll("+","-").replaceAll("/","_")}}}]);
//# sourceMappingURL=3199.a36b17a7.chunk.js.map