"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[7790],{47790:(e,n,a)=>{a.r(n),a.d(n,{default:()=>m});var l=a(7552),s=a(67112),r=a(99546),t=a(44928),i=a(61282),o=a(93062),c=a(76218),h=a(10240),d=a(7946),u=a(22762),j=a(30698),x=a(69092),v=a(69500);function f(){return(0,v.jsxs)("div",{children:[(0,v.jsx)(t.A,{size:20,style:{marginRight:20}}),(0,v.jsx)(i.A,{display:"inline",children:"Creating SVG"})]})}function b({children:e,...n}){return(0,v.jsx)("div",{children:(0,v.jsx)(o.A,{...n,children:e})})}function g(e,n){return(0,r.useLocalStorage)(`svg-${e}`,n)}function m({model:e,handleClose:n}){const a=(0,r.getSession)(e),t="undefined"!=typeof OffscreenCanvas,[o,m]=(0,l.useState)(t),[y,p]=(0,l.useState)(!1),[A,C]=(0,l.useState)(),[k,w]=g("file","jbrowse.svg"),[S,T]=g("tracklabels","offset"),[z,L]=g("theme",a.themeName||"default");return(0,v.jsxs)(s.Dialog,{open:!0,onClose:n,title:"Export SVG",children:[(0,v.jsxs)(c.A,{children:[A?(0,v.jsx)(s.ErrorMessage,{error:A}):y?(0,v.jsx)(f,{}):null,(0,v.jsx)(b,{helperText:"filename",value:k,onChange:e=>{w(e.target.value)}}),(0,v.jsxs)(b,{select:!0,label:"Track label positioning",variant:"outlined",style:{width:150},value:S,onChange:e=>{T(e.target.value)},children:[(0,v.jsx)(h.A,{value:"offset",children:"Offset"}),(0,v.jsx)(h.A,{value:"overlay",children:"Overlay"}),(0,v.jsx)(h.A,{value:"left",children:"Left"}),(0,v.jsx)(h.A,{value:"none",children:"None"})]}),(0,v.jsx)("br",{}),a.allThemes?(0,v.jsx)(b,{select:!0,label:"Theme",variant:"outlined",value:z,onChange:e=>{L(e.target.value)},children:Object.entries(a.allThemes()).map((([e,n])=>(0,v.jsx)(h.A,{value:e,children:n.name||"(Unknown name)"},e)))}):null,t?(0,v.jsx)(d.A,{control:(0,v.jsx)(u.A,{checked:o,onChange:()=>{m((e=>!e))}}),label:"Rasterize canvas based tracks? File may be much larger if this is turned off"}):(0,v.jsx)(i.A,{children:"Note: rasterizing layers not yet supported in this browser, so SVG size may be large"})]}),(0,v.jsxs)(j.A,{children:[(0,v.jsx)(x.A,{variant:"contained",color:"secondary",onClick:()=>{n()},children:"Cancel"}),(0,v.jsx)(x.A,{variant:"contained",color:"primary",type:"submit",onClick:async()=>{p(!0),C(void 0);try{await e.exportSvg({rasterizeLayers:o,filename:k,trackLabels:S,themeName:z}),n()}catch(e){console.error(e),C(e)}finally{p(!1)}},children:"Submit"})]})]})}}}]);
//# sourceMappingURL=7790.30672426.chunk.js.map