"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2018],{52018:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var l=a(7552),i=a(943),o=a(1343),n=a(5401),s=a(75785),r=a(99546),c=a(91468);const u=(0,s.n9)()((e=>({textbox:{width:"100%"},paper:{margin:e.spacing(),padding:e.spacing()},submit:{marginTop:25,marginBottom:100,display:"block"}})));function m({model:e}){const{classes:t}=u(),[a,s]=(0,l.useState)(""),[m,p]=(0,l.useState)("MultiWiggle"+ +Date.now());return l.createElement(i.A,{className:t.paper},l.createElement("ul",null,l.createElement("li",null,"Enter list of URLs for bigwig files in the textbox"),l.createElement("li",null,"Or, use the button below the text box to select files from your computer")),l.createElement(o.A,{multiline:!0,rows:10,value:a,onChange:e=>{s(e.target.value)},placeholder:"Paste list of URLs here, or use file selector below",variant:"outlined",className:t.textbox}),l.createElement(n.A,{variant:"outlined",component:"label"},"Choose Files from your computer",l.createElement("input",{type:"file",hidden:!0,multiple:!0,onChange:({target:e})=>{const t=[...e.files||[]].map((e=>({type:"BigWigAdapter",bigWigLocation:r.isElectron?{localPath:e.path,locationType:"LocalPathLocation"}:(0,c.storeBlobLocation)({blob:e}),source:e.name})));s(JSON.stringify(t,null,2))}})),l.createElement(o.A,{value:m,onChange:e=>{p(e.target.value)},helperText:"Track name"}),l.createElement(n.A,{variant:"contained",className:t.submit,onClick:()=>{const t=(0,r.getSession)(e),l=[`${m.toLowerCase().replaceAll(" ","_")}-${Date.now()}`,t.adminMode?"":"-sessionTrack"].join("");let i;try{i=JSON.parse(a)}catch(e){i=a.split(/\n|\r\n|\r/).map((e=>e.trim())).filter((e=>!!e))}const o="string"==typeof i[0]?{bigWigs:i}:{subadapters:i};(0,r.isSessionWithAddTracks)(t)&&(t.addTrackConf({trackId:l,type:"MultiQuantitativeTrack",name:m,assemblyNames:[e.assembly],adapter:{type:"MultiWiggleAdapter",...o}}),e.view?.showTrack(l)),e.clearData(),(0,r.isSessionModelWithWidgets)(t)&&t.hideWidget(e)}},"Submit"),l.createElement("p",null,"Additional notes: "),l.createElement("ul",null,l.createElement("li",null,"The list of bigwig files in the text box can be a list of URLs, or a list of elements like"," ",l.createElement("code",null,'[{"type":"BigWigAdapter","bigWigLocation":{"uri":"http://host/file.bw"}, "color":"green","source":"name for subtrack"}]')," ","to apply e.g. the color attribute to the view"),l.createElement("li",null,'Adding local files will update the textbox with JSON contents that are ready to submit with the "Submit" button')))}}}]);
//# sourceMappingURL=2018.9ce7fb06.chunk.js.map