@datagrok/sequence-translator 1.1.0 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,36 @@
1
1
  # Sequence Translator changelog
2
2
 
3
- ## 1.0.17 (2023-07-24) (WIP)
3
+ ## 1.1.4 (2023-09-07)
4
+
5
+ ### Bug fixes
6
+
7
+ * Fixed molfile direction for AS and AS2 on SDF tab
8
+
9
+ ## 1.1.3 (2023-09-07)
10
+
11
+ ### Bug fixes
12
+
13
+ * Fixed Direction of AS and AS2 for SDF tab
14
+
15
+ ## 1.1.2 (2023-08-16)
16
+
17
+ ### Bug fixes
18
+
19
+ * Fixed HELM generation for modifications
20
+
21
+ ## 1.1.1 (2023-08-10)
22
+
23
+ ### Features
24
+
25
+ * Updated dependencies
26
+
27
+ ## 1.1.0 (2023-07-26)
28
+
29
+ * Dependency: datgarok-api >= 1.15.2
30
+
31
+ ### Features
32
+
33
+ * Option to add extra formats for translation in addition to `Axolabs`, `BioSpring` and `MerMade12`
34
+ * Generation of HELM strings
35
+ * Improved SMILES generation
36
+ * UI/UX adjustments
@@ -1,2 +1,2 @@
1
- var sequencetranslator_test;(()=>{"use strict";var t={61:(t,e,n)=>{n.d(e,{Bu:()=>C,QK:()=>a,W3:()=>d,bb:()=>f,ci:()=>g,l_:()=>h});var r=n(469),o=n(976),s=function(t,e,n,r){return new(n||(n=Promise))((function(o,s){function a(t){try{c(r.next(t))}catch(t){s(t)}}function i(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,i)}c((r=r.apply(t,e||[])).next())}))};const a={};let i;var c;!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(c||(c={}));class l{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class u{constructor(t,e,n,r){var o;this.category=t,this.name=e,null!=r||(r={}),null!==(o=r.timeout)&&void 0!==o||(r.timeout=3e4),this.options=r,this.test=()=>s(this,void 0,void 0,(function*(){return new Promise(((t,e)=>s(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(t){e(t)}t(r)}))))}))}}function C(t,e,n){null==a[i]&&(a[i]={}),null==a[i].tests&&(a[i].tests=[]),a[i].tests.push(new u(i,t,e,n))}function h(t,e){if(t!==e)throw new Error(`Expected "${e}", got "${t}"`)}function d(t,e){i=t,e()}function f(t){null==a[i]&&(a[i]={}),a[i].before=t}function g(t){var e,n,i,c,u;return s(this,void 0,void 0,(function*(){const C=[],h=null===(n=null===(e=r.functions.getCurrentCall())||void 0===e?void 0:e.func)||void 0===n?void 0:n.package;console.log("Running tests"),null!=t||(t={}),null!==(i=(u=t).testContext)&&void 0!==i||(u.testContext=new l),r.shell.lastError="";for(const[e,n]of Object.entries(a)){if(null!=(null==t?void 0:t.category)&&!e.toLowerCase().startsWith(null==t?void 0:t.category.toLowerCase()))continue;console.log(`Started ${e} category`);try{n.before&&(yield n.before())}catch(t){n.beforeStatus=t.toString()}const r=null!==(c=n.tests)&&void 0!==c?c:[],o=[];for(let e=0;e<r.length;e++)o.push(yield m(r[e],null==t?void 0:t.test));const s=(yield Promise.all(o)).filter((t=>"skipped"!=t.result));try{n.after&&(yield n.after())}catch(t){n.afterStatus=t.toString()}n.afterStatus&&s.push({category:e,name:"init",result:n.afterStatus,success:!1,ms:0,skipped:!1}),n.beforeStatus&&s.push({category:e,name:"init",result:n.beforeStatus,success:!1,ms:0,skipped:!1}),C.push(...s)}if(t.testContext.catchUnhandled&&(yield function(t){return s(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}(1e3),r.shell.lastError.length>0&&C.push({category:"Unhandled exceptions",name:"exceptions",result:r.shell.lastError,success:!1,ms:0,skipped:!1})),t.testContext.report){const t=new o.Logger,e=C.filter((t=>t.success)).length,n=C.filter((t=>t.skipped)).length,r=C.filter((t=>!t.success)),s="Package @package tested: @successful successful, @skipped skipped, @failed failed tests",a={successful:e,skipped:n,failed:r.length,package:h};for(const t of r)Object.assign(a,{[`${t.category} | ${t.name}`]:t.result});t.log(s,a,"package-tested")}return C}))}function m(t,e){var n,r,o;return s(this,void 0,void 0,(function*(){let s;const a=null!=e&&!t.name.toLowerCase().startsWith(e.toLowerCase()),i=(null===(n=t.options)||void 0===n?void 0:n.skipReason)||a,c=a?"skipped":null===(r=t.options)||void 0===r?void 0:r.skipReason;i||console.log(`Started ${t.category} ${t.name}`);const l=new Date;try{s=i?{success:!0,result:c,ms:0,skipped:!0}:{success:!0,result:null!==(o=yield t.test())&&void 0!==o?o:"OK",ms:0,skipped:!1}}catch(t){s={success:!1,result:t.toString(),ms:0,skipped:!1}}const u=new Date;return s.ms=u-l,i||console.log(`Finished ${t.category} ${t.name} for ${s.ms} ms`),s.category=t.category,s.name=t.name,s}))}},973:(t,e,n)=>{n.d(e,{Z:()=>i});var r=n(537),o=n.n(r),s=n(645),a=n.n(s)()(o());a.push([t.id,".colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto Mono', 'Roboto Mono Local', monospace;\n font-size: 12px;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/view/css/colored-text-input.css"],names:[],mappings:"AAAA;EACE,WAAW;EACX,oCAAoC;EACpC,6BAA6B;EAC7B,kBAAkB;EAClB,UAAU;EACV,YAAY;EACZ,YAAY,EAAE,wEAAwE;AACxF;;AAEA;EACE;iCAC+B;EAC/B,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,YAAY;EACZ,UAAU;EACV,eAAe;EACf,YAAY;EACZ,mBAAmB;EACnB,0DAA0D;EAC1D,eAAe;EACf,kBAAkB;EAClB,qBAAqB;EACrB,qBAAqB;AACvB",sourcesContent:[".colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto Mono', 'Roboto Mono Local', monospace;\n font-size: 12px;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n"],sourceRoot:""}]);const i=a},284:(t,e,n)=>{n.d(e,{Z:()=>i});var r=n(537),o=n.n(r),s=n(645),a=n.n(s)()(o());a.push([t.id,"/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n.st-main-input-table {\n width: 100%;\n}\n\n.st-main-input-table td:has(textarea) {\n width: 100%;\n padding-right: 20px;\n}\n\n.st-main-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-main-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n/* .st-main-output-table table tbody tr td { */\n/* max-width: 20%; */\n/* } */\n\n.st-main-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-main-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-main-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table td a {\n overflow-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/view/css/main-tab.css"],names:[],mappings:"AAAA,iHAAiH;AACjH;EACE,WAAW;AACb;;AAEA;EACE,WAAW;EACX,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,WAAW;EACX,mBAAmB;AACrB;;AAEA,8CAA8C;AAC9C,sBAAsB;AACtB,MAAM;;AAEN;EACE,gBAAgB;EAChB,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yBAAyB;AAC3B",sourcesContent:["/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n.st-main-input-table {\n width: 100%;\n}\n\n.st-main-input-table td:has(textarea) {\n width: 100%;\n padding-right: 20px;\n}\n\n.st-main-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-main-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n/* .st-main-output-table table tbody tr td { */\n/* max-width: 20%; */\n/* } */\n\n.st-main-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-main-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-main-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table td a {\n overflow-wrap: break-word;\n}\n"],sourceRoot:""}]);const i=a},865:(t,e,n)=>{n.d(e,{Z:()=>i});var r=n(537),o=n.n(r),s=n(645),a=n.n(s)()(o());a.push([t.id,"/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n\n.st-sdf-body {\n padding-right: 20px;\n}\n\n.st-sdf-input-form {\n text-align: right;\n vertical-align: top;\n min-width: 95px;\n}\n\n.st-sdf-direction-choice label {\n min-width: 100px;\n float: right;\n}\n\n.st-sdf-direction-choice div {\n justify-content: right;\n}\n\n.st-sdf-text-input-td { /* Style for td containing textarea */\n width: 100%;\n}\n\n.st-sdf-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-sdf-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-sdf-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n","",{version:3,sources:["webpack://./src/view/css/sdf-tab.css"],names:[],mappings:"AAAA,iHAAiH;;AAEjH;EACE,mBAAmB;AACrB;;AAEA;EACE,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,YAAY;AACd;;AAEA;EACE,sBAAsB;AACxB;;AAEA,wBAAwB,qCAAqC;EAC3D,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA;EACE,2BAA2B;EAC3B,iBAAiB;AACnB",sourcesContent:["/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n\n.st-sdf-body {\n padding-right: 20px;\n}\n\n.st-sdf-input-form {\n text-align: right;\n vertical-align: top;\n min-width: 95px;\n}\n\n.st-sdf-direction-choice label {\n min-width: 100px;\n float: right;\n}\n\n.st-sdf-direction-choice div {\n justify-content: right;\n}\n\n.st-sdf-text-input-td { /* Style for td containing textarea */\n width: 100%;\n}\n\n.st-sdf-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-sdf-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-sdf-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n"],sourceRoot:""}]);const i=a},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(r)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(a[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);r&&a[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},537:t=>{t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),s="/*# ".concat(o," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},803:(t,e)=>{var n;!function(){var r=e||{}||this||window;void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n),r.default=r;var o="http://www.w3.org/2000/xmlns/",s="http://www.w3.org/2000/svg",a=/url\(["']?(.+?)["']?\)/,i={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},c=function(t){return t instanceof HTMLElement||t instanceof SVGElement},l=function(t){if(!c(t))throw new Error("an HTMLElement or SVGElement is required; got "+t)},u=function(t){return new Promise((function(e,n){c(t)?e(t):n(new Error("an HTMLElement or SVGElement is required; got "+t))}))},C=function(t,e,n){var r=t.viewBox&&t.viewBox.baseVal&&t.viewBox.baseVal[n]||null!==e.getAttribute(n)&&!e.getAttribute(n).match(/%$/)&&parseInt(e.getAttribute(n))||t.getBoundingClientRect()[n]||parseInt(e.style[n])||parseInt(window.getComputedStyle(t).getPropertyValue(n));return null==r||isNaN(parseFloat(r))?0:r},h=function(t){for(var e=window.atob(t.split(",")[1]),n=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(e.length),o=new Uint8Array(r),s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return new Blob([r],{type:n})},d={},f=null,g=function(t,e){var n=e||{},r=n.selectorRemap,o=n.modifyStyle,s=n.modifyCss,c=n.fonts,l=n.excludeUnusedCss,u=s||function(t,e){return(r?r(t):t)+"{"+(o?o(e):e)+"}\n"},C=[],h=void 0===c,g=c||[];return(f||(f=Array.from(document.styleSheets).map((function(t){try{return{rules:t.cssRules,href:t.href}}catch(e){return console.warn("Stylesheet could not be loaded: "+t.href,e),{}}})))).forEach((function(e){var n=e.rules,r=e.href;n&&Array.from(n).forEach((function(e){if(void 0!==e.style)if(function(t,e){if(e)try{return t.querySelector(e)||t.parentNode&&t.parentNode.querySelector(e)}catch(t){console.warn('Invalid CSS selector "'+e+'"',t)}}(t,e.selectorText))C.push(u(e.selectorText,e.style.cssText));else if(h&&e.cssText.match(/^@font-face/)){var n=function(t,e){var n=t.cssText.match(a),r=n&&n[1]||"";if(r&&!r.match(/^data:/)&&"about:blank"!==r){var o,s,c=r.startsWith("../")?e+"/../"+r:r.startsWith("./")?e+"/."+r:r;return{text:t.cssText,format:(o=c,s=Object.keys(i).filter((function(t){return o.indexOf("."+t)>0})).map((function(t){return i[t]})),s?s[0]:(console.error("Unknown font format for "+o+". Fonts may not be working correctly."),"application/octet-stream")),url:c}}}(e,r);n&&g.push(n)}else l||C.push(e.cssText)}))})),function(t){return Promise.all(t.map((function(t){return new Promise((function(e,n){if(d[t.url])return e(d[t.url]);var r=new XMLHttpRequest;r.addEventListener("load",(function(){var n=function(t){for(var e="",n=new Uint8Array(t),r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return window.btoa(e)}(r.response),o=t.text.replace(a,'url("data:'+t.format+";base64,"+n+'")')+"\n";d[t.url]=o,e(o)})),r.addEventListener("error",(function(n){console.warn("Failed to load font from: "+t.url,n),d[t.url]=null,e(null)})),r.addEventListener("abort",(function(n){console.warn("Aborted loading font from: "+t.url,n),e(null)})),r.open("GET",t.url),r.responseType="arraybuffer",r.send()}))}))).then((function(t){return t.filter((function(t){return t})).join("")}))}(g).then((function(t){return C.join("\n")+t}))},m=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};r.prepareSvg=function(t,e,n){l(t);var r=e||{},a=r.left,i=void 0===a?0:a,c=r.top,u=void 0===c?0:c,h=r.width,d=r.height,f=r.scale,m=void 0===f?1:f,p=r.responsive,O=void 0!==p&&p,A=r.excludeCss,b=void 0!==A&&A;return function(t){return Promise.all(Array.from(t.querySelectorAll("image")).map((function(t){var e,n=t.getAttributeNS("http://www.w3.org/1999/xlink","href")||t.getAttribute("href");return n?((e=n)&&0===e.lastIndexOf("http",0)&&-1===e.lastIndexOf(window.location.host)&&(n+=(-1===n.indexOf("?")?"?":"&")+"t="+(new Date).valueOf()),new Promise((function(e,r){var o=document.createElement("canvas"),s=new Image;s.crossOrigin="anonymous",s.src=n,s.onerror=function(){return r(new Error("Could not load "+n))},s.onload=function(){o.width=s.width,o.height=s.height,o.getContext("2d").drawImage(s,0,0),t.setAttributeNS("http://www.w3.org/1999/xlink","href",o.toDataURL("image/png")),e(!0)}}))):Promise.resolve(null)})))}(t).then((function(){var r=t.cloneNode(!0);r.style.backgroundColor=(e||{}).backgroundColor||t.style.backgroundColor;var a=function(t,e,n,r){if("svg"===t.tagName)return{width:n||C(t,e,"width"),height:r||C(t,e,"height")};if(t.getBBox){var o=t.getBBox(),s=o.x,a=o.y;return{width:s+o.width,height:a+o.height}}}(t,r,h,d),c=a.width,l=a.height;if("svg"!==t.tagName){if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);null!=r.getAttribute("transform")&&r.setAttribute("transform",r.getAttribute("transform").replace(/translate\(.*?\)/,""));var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.appendChild(r),r=f}if(r.setAttribute("version","1.1"),r.setAttribute("viewBox",[i,u,c,l].join(" ")),r.getAttribute("xmlns")||r.setAttributeNS(o,"xmlns",s),r.getAttribute("xmlns:xlink")||r.setAttributeNS(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),O?(r.removeAttribute("width"),r.removeAttribute("height"),r.setAttribute("preserveAspectRatio","xMinYMin meet")):(r.setAttribute("width",c*m),r.setAttribute("height",l*m)),Array.from(r.querySelectorAll("foreignObject > *")).forEach((function(t){t.setAttributeNS(o,"xmlns","svg"===t.tagName?s:"http://www.w3.org/1999/xhtml")})),!b)return g(t,e).then((function(t){var e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML="<![CDATA[\n"+t+"\n]]>";var o=document.createElement("defs");o.appendChild(e),r.insertBefore(o,r.firstChild);var s=document.createElement("div");s.appendChild(r);var a=s.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if("function"!=typeof n)return{src:a,width:c,height:l};n(a,c,l)}));var p=document.createElement("div");p.appendChild(r);var A=p.innerHTML;if("function"!=typeof n)return{src:A,width:c,height:l};n(A,c,l)}))},r.svgAsDataUri=function(t,e,n){return l(t),r.prepareSvg(t,e).then((function(t){var e=t.src,r=t.width,o=t.height,s="data:image/svg+xml;base64,"+window.btoa(decodeURIComponent(encodeURIComponent('<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp "&#160;">]>'+e).replace(/%([0-9A-F]{2})/g,(function(t,e){var n=String.fromCharCode("0x"+e);return"%"===n?"%25":n}))));return"function"==typeof n&&n(s,r,o),s}))},r.svgAsPngUri=function(t,e,n){l(t);var o=e||{},s=o.encoderType,a=void 0===s?"image/png":s,i=o.encoderOptions,c=void 0===i?.8:i,u=o.canvg,C=function(t){var e=t.src,r=t.width,o=t.height,s=document.createElement("canvas"),i=s.getContext("2d"),l=window.devicePixelRatio||1;s.width=r*l,s.height=o*l,s.style.width=s.width+"px",s.style.height=s.height+"px",i.setTransform(l,0,0,l,0,0),u?u(s,e):i.drawImage(e,0,0);var C=void 0;try{C=s.toDataURL(a,c)}catch(t){if("undefined"!=typeof SecurityError&&t instanceof SecurityError||"SecurityError"===t.name)return void console.error("Rendered SVG images cannot be downloaded in this browser.");throw t}return"function"==typeof n&&n(C,s.width,s.height),Promise.resolve(C)};return u?r.prepareSvg(t,e).then(C):r.svgAsDataUri(t,e).then((function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){return e(C({src:r,width:r.width,height:r.height}))},r.onerror=function(){n("There was an error loading the data URI as an image on the following SVG\n"+window.atob(t.slice(26))+"Open the following link to see browser's diagnosis\n"+t)},r.src=t}))}))},r.download=function(t,e,n){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(h(e),t);else{var r=document.createElement("a");if("download"in r){r.download=t,r.style.display="none",document.body.appendChild(r);try{var o=h(e),s=URL.createObjectURL(o);r.href=s,r.onclick=function(){return requestAnimationFrame((function(){return URL.revokeObjectURL(s)}))}}catch(t){console.error(t),console.warn("Error while getting object URL. Falling back to string URL."),r.href=e}r.click(),document.body.removeChild(r)}else n&&n.popup&&(n.popup.document.title=t,n.popup.location.replace(e))}},r.saveSvg=function(t,e,n){var o=m();return u(t).then((function(t){return r.svgAsDataUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))},r.saveSvgAsPng=function(t,e,n){var o=m();return u(t).then((function(t){return r.svgAsPngUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))}}()},379:t=>{var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var s={},a=[],i=0;i<t.length;i++){var c=t[i],l=r.base?c[0]+r.base:c[0],u=s[l]||0,C="".concat(l," ").concat(u);s[l]=u+1;var h=n(C),d={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)e[h].references++,e[h].updater(d);else{var f=o(d,r);r.byIndex=i,e.splice(i,0,{identifier:C,updater:f,references:1})}a.push(C)}return a}function o(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var s=r(t=t||[],o=o||{});return function(t){t=t||[];for(var a=0;a<s.length;a++){var i=n(s[a]);e[i].references--}for(var c=r(t,o),l=0;l<s.length;l++){var u=n(s[l]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}s=c}}},569:t=>{var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},29:(t,e,n)=>{var r;n.d(e,{NI:()=>r}),function(t){t.HELM="HELM",t.AXOLABS="Axolabs"}(r||(r={}))},895:(t,e,n)=>{n.d(e,{BX:()=>r,Dv:()=>i,VV:()=>c,Xz:()=>l,a_:()=>o,dz:()=>a,pl:()=>s});const r="System:AppData/SequenceTranslator",o="monomer-lib.json",s="System:AppData/SequenceTranslator",a="axolabs-style.json",i="formats-to-helm.json",c="codes-to-symbols.json",l="linkers.json"},996:(t,e,n)=>{n.d(e,{BF:()=>c,VO:()=>u,iA:()=>l});var r=n(976),o=n(895);const s=new r.FileSource(o.pl);let a,i,c,l;async function u(){[a,i,c,l].every((t=>void 0!==t))||(a=await C(o.dz),i=await C(o.Dv),c=await C(o.VV),l=await C(o.Xz))}async function C(t){let e;try{e=JSON.parse(await s.readAsText(t))}catch(e){const n=e.hasOwnProperty("message")?e.message:e.toString();throw new Error(`Error loading json from ${t}:`+n)}return e}},669:(t,e,n)=>{function r(t){return t.sort(((t,e)=>e.length-t.length))}n.d(e,{x:()=>r})},397:(t,e,n)=>{n.d(e,{A:()=>a});var r=n(976),o=n(559),s=n(996);class a{constructor(){const t=o._package.monomerLib;if(null===t)throw new Error("SequenceTranslator: monomer library is null");this.lib=t,this.allMonomers=this.getAllMonomers()}lib;static instance;allMonomers;formatMonomerForViewer(t){const e={};return e.name=t.symbol,e.symbol=t.symbol,e.molfile=t.molfile,e}getAllMonomers(){const t=this.lib.getPolymerTypes();let e=[];for(const n of t){const t=this.lib.getMonomerSymbolsByType(n).map((t=>this.lib.getMonomer(n,t))).filter((t=>null!==t));e=e.concat(t)}return e}getMonomer(t){const e=this.lib.getMonomer("RNA",t);if(void 0===e)throw new Error(`SequenceTranslator: no monomer with symbol ${t}`);return e}static getInstance(){return void 0===a.instance&&(a.instance=new a),a.instance}getMolfileBySymbol(t){return this.getMonomer(t).molfile}getNaturalAnalogBySymbol(t){const e=this.getMonomer(t).naturalAnalog;if(!e)throw new Error(`ST: no natural analog for ${t}`);return e}isModification(t){return!!this.getMolfileBySymbol(t).includes("MODIFICATION")}getCodeToSymbolMap(t){return new Map(Object.entries(s.BF[t]))}getCodesByFormat(t){return Object.keys(s.BF[t])}getTableForViewer(){const t=this.allMonomers.map((t=>this.formatMonomerForViewer(t)));return r.DataFrame.fromObjects(t)}getCodesToWeightsMap(){const t=new Map;return Object.entries(s.BF).forEach((([e,n])=>{Object.entries(n).forEach((([e,n])=>{const r=this.getMonomer(n).meta?.molecularWeight;t.set(e,r)}))})),t}}},402:(t,e,n)=>{n.d(e,{K:()=>c});var r=n(669),o=n(397),s=n(996);class a{sequence;invert;codeMap;constructor(t,e=!1,n){this.sequence=t,this.invert=e,this.codeMap=n,this.lib=o.A.getInstance()}lib;parseSequence(){const t=this.parseRawSequence();return this.addLinkers(t)}addLinkers(t){const e=[];return t.forEach(((n,r)=>{const o=this.getSymbolForCode(n);r>0&&function(t){return s.iA.left.includes(t)}(o)&&e.pop(),e.push(o);const a=i(o),c=r===t.length-1,l=r+1<t.length&&i(this.getSymbolForCode(t[r+1]));a||function(t){return s.iA.right.includes(t)}(o)||l||c||e.push("p")})),e}getSymbolForCode(t){let e=this.codeMap.get(t);return e??=t,e}parseRawSequence(){const t=this.getAllCodesOfFormat(),e=[];let n=0;for(;n<this.sequence.length;){const r=t.find((t=>t===this.sequence.substring(n,n+t.length)));this.invert?e.unshift(r):e.push(r),n+=r.length}return e}getAllCodesOfFormat(){let t=Array.from(this.codeMap.keys());return(0,r.x)(t)}}function i(t){return s.iA.phosphate.includes(t)}class c{constructor(t,e=!1,n){this.lib=o.A.getInstance();const r=this.lib.getCodeToSymbolMap(n);this.parser=new a(t,e,r)}parser;lib;convert(){const t=this.parser.parseSequence(),e=[];return t.forEach(((t,n)=>{const r=this.getMonomerMolfile(t,n);e.push(r)})),this.getPolymerMolfile(e)}getMonomerMolfile(t,e){const n=this.lib.getMolfileBySymbol(t);return this.lib.isModification(t)?0===e?this.reflect(n):n:this.rotateNucleotidesV3000(n)}getPolymerMolfile(t){return this.linkV3000(t)}reflect(t){const e=this.extractAtomDataV3000(t),n=e.atomIndex.length,r=e.atomIndex.indexOf(1),o=e.atomIndex.indexOf(n),s=(e.x[o]+e.x[r])/2,a=(e.y[o]+e.y[r])/2;for(let t=0;t<n;t++)e.x[t]-=s,e.y[t]-=a;for(let t=0;t<n;t++)e.x[t]=-e.x[t];const i=e.x[r];for(let t=0;t<n;t++)e.x[t]-=i;let c=t.indexOf("M V30 BEGIN ATOM");c=t.indexOf("\n",c);let l=c;for(let r=0;r<n;r++)c=t.indexOf("V30",c)+4,c=t.indexOf(" ",c)+1,c=t.indexOf(" ",c)+1,l=t.indexOf(" ",c)+1,l=t.indexOf(" ",l),c=(t=t.slice(0,c)+e.x[r]+" "+e.y[r]+t.slice(l)).indexOf("\n",c)+1;return t}extractAtomDataV3000(t){const e=this.extractAtomsBondsNumbersV3000(t);let n=t.indexOf("M V30 BEGIN ATOM");n=t.indexOf("\n",n);let r=n;const o=Array(e.natom),s=Array(e.natom),a=Array(e.natom),i=Array(e.natom);for(let c=0;c<e.natom;c++)n=t.indexOf("V30",n)+4,r=t.indexOf(" ",n),o[c]=parseInt(t.substring(n,r)),n=r+1,r=t.indexOf(" ",n),s[c]=t.substring(n,r),n=r+1,r=t.indexOf(" ",n),a[c]=parseFloat(t.substring(n,r)),n=r+1,r=t.indexOf(" ",n),i[c]=parseFloat(t.substring(n,r)),n=t.indexOf("\n",n)+1;return{atomIndex:o,atomType:s,x:a,y:i}}extractAtomsBondsNumbersV3000(t){let e=(t=t.replaceAll("\r","")).indexOf("COUNTS")+7,n=t.indexOf(" ",e);const r=parseInt(t.substring(e,n));return e=n+1,n=t.indexOf(" ",e),{natom:r,nbond:parseInt(t.substring(e,n))}}rotateNucleotidesV3000(t){const e=this.extractAtomDataV3000(t),n=e.atomIndex.length,r=e.atomIndex.indexOf(1),o=e.atomIndex.indexOf(n);n>8&&this.fix5Prime(e,r,o);const s=(e.x[o]+e.x[r])/2,a=(e.y[o]+e.y[r])/2;for(let t=0;t<n;t++)e.x[t]-=s,e.y[t]-=a;let i=0;if(0===e.x[r])i=e.y[r]>e.y[o]?Math.PI/2:3*Math.PI/2;else if(0===e.y[r])i=e.x[r]>e.x[o]?Math.PI:0;else{const t=e.y[r]/e.x[r];i=t>0?e.x[r]>0?Math.PI-Math.atan(t):2*Math.PI-Math.atan(t):e.x[r]>0?-Math.PI-Math.atan(t):Math.atan(t)}const c=Math.cos(i),l=Math.sin(i);for(let t=0;t<n;t++){const n=e.x[t];e.x[t]=n*c-e.y[t]*l,e.y[t]=n*l+e.y[t]*c}const u=e.x[r];for(let t=0;t<n;t++)e.x[t]-=u;let C=t.indexOf("M V30 BEGIN ATOM");C=t.indexOf("\n",C);let h=C;for(let r=0;r<n;r++)C=t.indexOf("V30",C)+4,C=t.indexOf(" ",C)+1,C=t.indexOf(" ",C)+1,h=t.indexOf(" ",C)+1,h=t.indexOf(" ",h),C=(t=t.slice(0,C)+e.x[r]+" "+e.y[r]+t.slice(h)).indexOf("\n",C)+1;return t}linkV3000(t,e=!0){let n="\nDatagrok macromolecule handler\n\n";n+=" 0 0 0 0 0 0 999 V3000\n",n+="M V30 BEGIN CTAB\n";let r="",o="",s="";const a=[];let i=0,c=0,l=0;for(let e=0;e<t.length;e++){const n=t[e].includes("MODIFICATION")&&0===e;let s=0;n&&(s=this.extractAtomDataV3000(t[e]).atomIndex.length),t[e]=t[e].replaceAll("(-\nM V30 ","(").replaceAll("-\nM V30 ","").replaceAll(" )",")");const u=this.extractAtomsBondsNumbersV3000(t[e]),C=this.extractAtomDataV3000(t[e]);let h=t[e].indexOf("M V30 BEGIN ATOM");h=t[e].indexOf("\n",h);let d=h,f=h;for(let r=0;r<u.natom;r++)if(1!==C.atomIndex[r]||0===e){d=t[e].indexOf("V30",d)+4,f=t[e].indexOf(" ",d);let r=0;n?(r=parseInt(t[e].substring(d,f)),1===r?r=s:r===s&&(r=1),r+=i):r=parseInt(t[e].substring(d,f))+i,t[e]=t[e].slice(0,d)+r+t[e].slice(f),d=t[e].indexOf(" ",d)+1,d=t[e].indexOf(" ",d)+1,f=t[e].indexOf(" ",d);const o=l-C.x[0];let a=Math.round(1e4*(parseFloat(t[e].substring(d,f))+o))/1e4;t[e]=t[e].slice(0,d)+a+t[e].slice(f),d=t[e].indexOf(" ",d)+1,f=t[e].indexOf(" ",d),a=Math.round(1e4*parseFloat(t[e].substring(d,f)))/1e4,t[e]=t[e].slice(0,d)+a+t[e].slice(f),d=t[e].indexOf("\n",d)+1}else d=t[e].indexOf("M V30",d)-1,f=t[e].indexOf("\n",d+1),t[e]=t[e].slice(0,d)+t[e].slice(f);const g=t[e].indexOf("M V30 END ATOM");r+=t[e].substring(h+1,g);let m=t[e].indexOf("M V30 BEGIN BOND");m=t[e].indexOf("\n",m),d=m,f=m;for(let r=0;r<u.nbond;r++){d=t[e].indexOf("V30",d)+4,f=t[e].indexOf(" ",d);const r=parseInt(t[e].substring(d,f))+c;t[e]=t[e].slice(0,d)+r+t[e].slice(f),d=t[e].indexOf(" ",d)+1,d=t[e].indexOf(" ",d)+1,f=t[e].indexOf(" ",d);let o=0;n?(o=parseInt(t[e].substring(d,f)),1===o?o=s:o===s&&(o=1),o+=i):o=parseInt(t[e].substring(d,f))+i,t[e]=t[e].slice(0,d)+o+t[e].slice(f),d=t[e].indexOf(" ",d)+1,f=Math.min(t[e].indexOf("\n",d),t[e].indexOf(" ",d)),o=0,n?(o=parseInt(t[e].substring(d,f)),1===o?o=s:o===s&&(o=1),o+=i):o=parseInt(t[e].substring(d,f))+i,t[e]=t[e].slice(0,d)+o+t[e].slice(f),d=t[e].indexOf("\n",d)+1}const p=t[e].indexOf("M V30 END BOND");o+=t[e].substring(m+1,p);let O=t[e].indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==O;){O+=28;const n=t[e].indexOf(")",O);t[e].substring(O,n).split(" ").slice(1).forEach((t=>{a.push(parseInt(t)+i)})),O=n,O=t[e].indexOf("M V30 MDLV30/STEABS ATOMS=(",O)}i+=u.natom-1,c+=u.nbond,l+=n?Math.max(...C.x):C.x[u.natom-1]-C.x[0]}const u=Math.ceil(a.length/4);s+="M V30 MDLV30/STEABS ATOMS=("+a.length+" -\n";for(let t=0;t<u;t++){s+="M V30 ";const e=t+1===u?a.length-4*(u-1):4;for(let n=0;n<e;n++)s+=n+1===e?t===u-1?a[4*t+n]+")\n":a[4*t+n]+" -\n":a[4*t+n]+" "}return i++,n+="M V30 COUNTS "+i+" "+c+" 0 0 0\n",n+="M V30 BEGIN ATOM\n",n+=r,n+="M V30 END ATOM\n",n+="M V30 BEGIN BOND\n",n+=o,n+="M V30 END BOND\n",e&&a.length>0?(n+="M V30 BEGIN COLLECTION\n",n+=s,n+="M V30 END COLLECTION\n"):n=n.replace(/ CFG=\d/g," "),n+="M V30 END CTAB\n",n+="M END",n}fix5Prime(t,e,n){const r=e+1,o=t.x[r],s=t.y[r],a=t.x[n]-o,i=t.y[n]-s,c=t.x[e]-o,l=t.y[e]-s,u=c*Math.cos(2*Math.PI/3)-l*Math.sin(2*Math.PI/3),C=c*Math.sin(2*Math.PI/3)+l*Math.cos(2*Math.PI/3),h=c-a,d=l-i,f=u-a,g=C-i;Math.sqrt(g*g+f*f)>=Math.sqrt(d*d+h*h)&&(t.x[e]=u+o,t.y[e]=C+s)}}},559:(t,e,n)=>{n.d(e,{_package:()=>tt}),n(469);var r=n(976);ui,rxjs;var o=n(379),s=n.n(o),a=n(795),i=n.n(a),c=n(569),l=n.n(c),u=n(565),C=n.n(u),h=n(216),d=n.n(h),f=n(589),g=n.n(f),m=n(284),p={};p.styleTagTransform=g(),p.setAttributes=C(),p.insert=l().bind(null,"head"),p.domAPI=i(),p.insertStyleElement=d(),s()(m.Z,p),m.Z&&m.Z.locals&&m.Z.locals,$,n(29),n(397),n(996);var O,A,b=n(973),H={};H.styleTagTransform=g(),H.setAttributes=C(),H.insert=l().bind(null,"head"),H.domAPI=i(),H.insertStyleElement=d(),s()(b.Z,H),b.Z&&b.Z.locals&&b.Z.locals,n(402),(A=O||(O={})).HEADER="V2000",A[A.NUM_OF_HEADER_LINES=3]="NUM_OF_HEADER_LINES",A[A.NUM_OF_COUNTS_DIGITS=3]="NUM_OF_COUNTS_DIGITS",A[A.ATOM_TYPE_COL=4]="ATOM_TYPE_COL",A[A.FIRST_BONDED_ATOM_COL=1]="FIRST_BONDED_ATOM_COL",A[A.BOND_TYPE_COL=3]="BOND_TYPE_COL",A[A.RGP_SHIFT=8]="RGP_SHIFT",A.RGP_LINE="M RGP",A.A_LINE="A ",A.END="M END",Error;var w=n(865),E={};function x(t,e){const n=document.createElement("canvas").getContext("2d");return n.font=String(e),2*n.measureText(t).width}E.styleTagTransform=g(),E.setAttributes=C(),E.insert=l().bind(null,"head"),E.domAPI=i(),E.insertStyleElement=d(),s()(w.Z,E),w.Z&&w.Z.locals&&w.Z.locals;Math.max(x("SS: 5'",17),x("AS: 3'",17)),Math.max(x("3'",17),x("5'",17)),n(803);var y=n(895);wu;class v{constructor(t,e,n){this.name=t,this.alphabet=e,this.cutoff=n}}class S extends v{constructor(t,e,n){super(t.name,t.alphabet,t.cutoff),this.freq=e,this.similarity=n}}const M=/(\[[A-Za-z0-9-_]+\]|.)/g,N=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}},T=[new v("PT",N.fasta.peptide,.5),new v("DNA",N.fasta.dna,.55),new v("RNA",N.fasta.rna,.55)],B=new Uint32Array(65536),P={gapOpen:8,gapExtend:2,scoringMatrix:[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0,-4],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1,-4],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1,-4],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1,-4],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2,-4],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1,-4],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1,-4],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1,-4],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1,-4],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1,-4],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1,-4],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1,-4],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1,-4],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2,-4],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0,-4],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0,-4],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2,-4],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1,-4],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1,-4],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1,-4],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1,-4],[-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,1]],alphabetIndexes:{A:0,R:1,N:2,D:3,C:4,Q:5,E:6,G:7,H:8,I:9,L:10,K:11,M:12,F:13,P:14,S:15,T:16,W:17,Y:18,V:19,B:20,Z:21,X:22,"*":23}};var I;!function(t){t.HAMMING="Hamming",t.LEVENSHTEIN="Levenshtein",t.NEEDLEMANN_WUNSCH="Needlemann-Wunsch"}(I||(I={}));const L={[I.HAMMING]:function(){return(t,e)=>{let n=0;t.length!==e.length&&(n=Math.abs(t.length-e.length));let r=0;for(let n=0;n<Math.min(t.length,e.length);n++)t[n]!==e[n]&&r++;return r+=n,r/=Math.max(t.length,e.length),r}},[I.LEVENSHTEIN]:function(){return(t,e)=>((t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return 0===e.length?t.length:t.length<=32?((t,e)=>{const n=t.length,r=e.length,o=1<<n-1;let s=-1,a=0,i=n,c=n;for(;c--;)B[t.charCodeAt(c)]|=1<<c;for(c=0;c<r;c++){let t=B[e.charCodeAt(c)];const n=t|a;t|=(t&s)+s^s,a|=~(t|s),s&=t,a&o&&i++,s&o&&i--,a=a<<1|1,s=s<<1|~(n|a),a&=n}for(c=n;c--;)B[t.charCodeAt(c)]=0;return i})(t,e):((t,e)=>{const n=e.length,r=t.length,o=[],s=[],a=Math.ceil(n/32),i=Math.ceil(r/32);for(let t=0;t<a;t++)s[t]=-1,o[t]=0;let c=0;for(;c<i-1;c++){let a=0,i=-1;const l=32*c,u=Math.min(32,r)+l;for(let e=l;e<u;e++)B[t.charCodeAt(e)]|=1<<e;for(let t=0;t<n;t++){const n=B[e.charCodeAt(t)],r=s[t/32|0]>>>t&1,c=o[t/32|0]>>>t&1,l=n|a,u=((n|c)&i)+i^i|n|c;let C=a|~(u|i),h=i&u;C>>>31^r&&(s[t/32|0]^=1<<t),h>>>31^c&&(o[t/32|0]^=1<<t),C=C<<1|r,h=h<<1|c,i=h|~(l|C),a=C&l}for(let e=l;e<u;e++)B[t.charCodeAt(e)]=0}let l=0,u=-1;const C=32*c,h=Math.min(32,r-C)+C;for(let e=C;e<h;e++)B[t.charCodeAt(e)]|=1<<e;let d=r;for(let t=0;t<n;t++){const n=B[e.charCodeAt(t)],a=s[t/32|0]>>>t&1,i=o[t/32|0]>>>t&1,c=n|l,C=((n|i)&u)+u^u|n|i;let h=l|~(C|u),f=u&C;d+=h>>>r-1&1,d-=f>>>r-1&1,h>>>31^a&&(s[t/32|0]^=1<<t),f>>>31^i&&(o[t/32|0]^=1<<t),h=h<<1|a,f=f<<1|i,u=f|~(c|h),l=h&c}for(let e=C;e<h;e++)B[t.charCodeAt(e)]=0;return d})(t,e)})(t,e)/Math.max(t.length,e.length)},[I.NEEDLEMANN_WUNSCH]:function(t){return(e,n)=>{const{gapOpen:r,gapExtend:o,scoringMatrix:s,alphabetIndexes:a}={...P,...t},i=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)],c=new Array(e.length+1).fill(!1),l=new Array(e.length+1).fill(!1);let u=0,C=1;for(let t=1;t<e.length+1;t++)i[0][t]=-r-(t-1)*o;for(let t=1;t<n.length+1;t++){i[C][0]=-r-(t-1)*o;for(let h=1;h<e.length+1;h++){const d=i[u][h-1]+s[a[e[h-1]]][a[n[t-1]]],f=i[u][h]-(c[h]?o:r),g=i[C][h-1]-(l[h-1]?o:r);i[C][h]=Math.max(d,g,f),i[C][h]===d?(c[h]=!1,l[h]=!1):i[C][h]===g?(c[h]=!1,l[h]=!0):(c[h]=!0,l[h]=!1)}u=C,C=(C+1)%2}const h=e.split("").map((t=>s[a[t]][a[t]])).reduce(((t,e)=>t+e),0),d=n.split("").map((t=>s[a[t]][a[t]])).reduce(((t,e)=>t+e),0),f=Math.max(h,d);return(f-i[u][e.length])/f}}},k=new class{constructor(){this.uhTemp=`units-handler.${r.SEMTYPE.MACROMOLECULE}`}};class F{static setUnitsToFastaColumn(t){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE||"fasta"!==t.column.getTag(r.TAGS.UNITS))throw new Error(`The column of notation 'fasta' must be '${r.SEMTYPE.MACROMOLECULE}'.`);t.column.setTag(r.TAGS.UNITS,"fasta"),F.setTags(t)}static setUnitsToSeparatorColumn(t,e){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE||"separator"!==t.column.getTag(r.TAGS.UNITS))throw new Error(`The column of notation 'separator' must be '${r.SEMTYPE.MACROMOLECULE}'.`);if(!e)throw new Error("The column of notation 'separator' must have the separator tag.");t.column.setTag(r.TAGS.UNITS,"separator"),t.column.setTag("separator",e),F.setTags(t)}static setUnitsToHelmColumn(t){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE)throw new Error(`The column of notation 'helm' must be '${r.SEMTYPE.MACROMOLECULE}'`);t.column.setTag(r.TAGS.UNITS,"helm"),F.setTags(t)}static setTags(t){const e=t.column.getTag(r.TAGS.UNITS),n=t.stats;if(Object.keys(n.freq).some((t=>t.length>1)),["fasta","separator"].includes(e)){if(0===Object.keys(n.freq).length)throw new Error("Alphabet is empty");const e=n.sameLength?"SEQ.MSA":"SEQ";t.column.setTag("aligned",e);const r=function(t,e,n="-"){const r=e.map((e=>{const r=function(t,e,n="-"){const r=new Set([...new Set(Object.keys(t)),...e]);r.delete(n);const o=[],s=[];for(const n of r)o.push(n in t?t[n]:0),s.push(e.has(n)?1:0);const a=new U(o),i=new U(s);return function(t,e){if(t.length!=e.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let r=0;r<t.length;r++)n+=t[r]*e[r];return n}(a,i)/(D(a)*D(i))}(t,e.alphabet,n);return new S(e,t,r)}));let o;const s=Math.max(...r.map((t=>t.similarity>t.cutoff?t.similarity:-1)));o=s>0?r.find((t=>t.similarity===s)).name:"UN";return o}(n.freq,T);if(t.column.setTag("alphabet",r),"UN"===r){const e=Object.keys(n.freq).length,r=Object.keys(n.freq).some((t=>t.length>1));t.column.setTag(".alphabetSize",e.toString()),t.column.setTag(".alphabetIsMultichar",r?"true":"false")}}}get units(){return this._units}get column(){return this._column}get notation(){return this._notation}get defaultGapSymbol(){return this._defaultGapSymbol}get separator(){const t=this.column.getTag("separator")??void 0;if("separator"===this.notation&&void 0===t)throw new Error(`Separator is mandatory for column '${this.column.name}' of notation '${this.notation}'.`);return t}get aligned(){const t=this.column.getTag("aligned");if(!t&&(this.isFasta()||this.isSeparator()))throw new Error("Tag aligned not set");return t}get alphabet(){const t=this.column.getTag("alphabet");if(!t&&(this.isFasta()||this.isSeparator()))throw new Error("Tag alphabet not set");return t}get helmCompatible(){return this.column.getTag(".isHelmCompatible")}getAlphabetSize(){if("helm"==this.notation||"UN"==this.alphabet){const t=this.column.getTag(".alphabetSize");let e;if(t)e=parseInt(t);else{const t=this.stats;e=Object.keys(t.freq).length}return e}switch(this.alphabet){case"PT":return 20;case"DNA":case"RNA":return 4;case"NT":return console.warn("Unexpected alphabet 'NT'."),4;default:throw new Error(`Unexpected alphabet '${this.alphabet}'.`)}}getAlphabetIsMultichar(){return"helm"===this.notation||"UN"===this.alphabet&&"true"===this.column.getTag(".alphabetIsMultichar")}get splitted(){if(null===this._splitted){const t=this.getSplitter(),e=this._column.length;this._splitted=new Array(e);const n=this._column.getRawData(),r=this._column.categories;for(let o=0;o<e;o++){const e=r[n[o]];this._splitted[o]=t(e)}}return this._splitted}get stats(){if(null===this._stats){const t={};let e=!0,n=null;for(const r of this.splitted){null==n?n=r.length:r.length!==n&&(e=!1);for(const e of r)e in t||(t[e]=0),t[e]+=1}this._stats={freq:t,sameLength:e}}return this._stats}isFasta(){return"fasta"===this.notation}isSeparator(){return"separator"===this.notation}isHelm(){return"helm"===this.notation}isRna(){return"RNA"===this.alphabet}isDna(){return"DNA"===this.alphabet}isPeptide(){return"PT"===this.alphabet}isMsa(){return!!this.aligned&&this.aligned.toUpperCase().includes("MSA")}isHelmCompatible(){return"true"===this.helmCompatible}getNotation(){if(this.units.toLowerCase().startsWith("fasta"))return"fasta";if(this.units.toLowerCase().startsWith("separator"))return"separator";if(this.units.toLowerCase().startsWith("helm"))return"helm";throw new Error(`Column '${this.column.name}' has unexpected notation '${this.units}'.`)}getNewColumn(t,e){const n=this.column,o=n.length,s=t.toLowerCase()+"("+n.name+")",a=n.dataFrame.columns.getUnusedName(s),i=r.Column.fromList("string",a,new Array(o).fill(""));if(i.semType=r.SEMTYPE.MACROMOLECULE,i.setTag(r.TAGS.UNITS,t),"separator"===t){if(!e)throw new Error("Notation 'separator' requires separator value.");i.setTag("separator",e)}i.setTag(r.TAGS.CELL_RENDERER,"Macromolecule");const c=n.getTag("aligned");c&&i.setTag("aligned",c);const l=n.getTag("alphabet");l&&i.setTag("alphabet",l);let u=n.getTag(".alphabetSize");u&&i.setTag(".alphabetSize",u);const C=n.getTag(".alphabetIsMultichar");return void 0!==C&&i.setTag(".alphabetIsMultichar",C),"helm"==t&&(u=this.getAlphabetSize().toString(),i.setTag(".alphabetSize",u)),i}static getNewColumn(t){const e=F.getOrCreate(t),n=e.notation;return e.getNewColumn(n)}static unitsStringIsValid(t){return t=t.toLowerCase(),["fasta","separator","helm"].some((e=>t.startsWith(e.toLowerCase())))}static getNewColumnFromParams(t,e,n){if(!F.unitsStringIsValid(n))throw new Error("Invalid format of 'units' parameter");const o=r.Column.fromList("string",e,new Array(t).fill(""));return o.semType=r.SEMTYPE.MACROMOLECULE,o.setTag(r.TAGS.UNITS,n),o}getSplitter(){return function(t){if(t.semType!==r.SEMTYPE.MACROMOLECULE)throw new Error(`Get splitter for semType "${r.SEMTYPE.MACROMOLECULE}" only.`);return function(t,e,n){if(t.toLowerCase().startsWith("fasta"))return Y;if(t.toLowerCase().startsWith("separator"))return z(e,void 0);if(t.toLowerCase().startsWith("helm"))return Q;throw new Error(`Unexpected units ${t} .`)}(t.getTag(r.TAGS.UNITS),t.getTag("separator"))}(this._column)}getDistanceFunctionName(){if(!this.isFasta())throw new Error("Only FASTA notation is supported");if(this.isMsa())return I.HAMMING;switch(this.alphabet){case"DNA":case"RNA":default:return I.LEVENSHTEIN;case"PT":return I.NEEDLEMANN_WUNSCH}}getDistanceFunction(){return L[this.getDistanceFunctionName()]()}async checkHelmCompatibility(){if(this.column.tags.has(".isHelmCompatible"))return"true"===this.column.getTag(".isHelmCompatible");const t=(await X()).getBioLib().getMonomerSymbolsByType("PEPTIDE".toString()),e=new Set(t),n=z(this.separator);for(const t of this.column.categories){const r=n(t);for(const t of r)if(!e.has(t))return this.column.setTag(".isHelmCompatible","false"),!1}return this.column.setTag(".isHelmCompatible","true"),!0}constructor(t){this._splitted=null,this._stats=null,this._column=t;const e=this._column.getTag(r.TAGS.UNITS);if(null==e)throw new Error("Units are not specified in column");if(this._units=e,this._notation=this.getNotation(),this._defaultGapSymbol=this.isFasta()?F._defaultGapSymbolsDict.FASTA:this.isHelm()?F._defaultGapSymbolsDict.HELM:F._defaultGapSymbolsDict.SEPARATOR,!this.column.tags.has("aligned")||!this.column.tags.has("alphabet")||!this.column.tags.has(".alphabetIsMultichar")&&!this.isHelm()&&"UN"===this.alphabet)if(this.isFasta())F.setUnitsToFastaColumn(this);else if(this.isSeparator()){const e=t.getTag("separator");F.setUnitsToSeparatorColumn(this,e)}else{if(!this.isHelm())throw new Error(`Unexpected units '${this.column.getTag(r.TAGS.UNITS)}'.`);F.setUnitsToHelmColumn(this)}if(!this.column.tags.has(".alphabetIsMultichar"))if(this.isHelm())this.column.setTag(".alphabetIsMultichar","true");else if(["UN"].includes(this.alphabet))throw new Error(`For column '${this.column.name}' of alphabet '${this.alphabet}' tag '.alphabetIsMultichar' is mandatory.`)}static getOrCreate(t){return k.uhTemp in t.temp||(t.temp[k.uhTemp]=new F(t)),t.temp[k.uhTemp]}}F._defaultGapSymbolsDict={HELM:"*",SEPARATOR:"",FASTA:"-"};class U extends Float32Array{}function D(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*t[n];return Math.sqrt(e)}class _{static makePalette(t,e=!1,n=_){const r={};return t.forEach((t=>{const n=t[0],o=t[1];n.forEach(((t,n)=>{r[t]=this.colourPalette[o][e?0:n]}))})),new n(r)}constructor(t){this._palette=t}get(t){return this._palette[t]}}_.undefinedColor="rgb(100,100,100)",_.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]};class V extends _{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,V)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,V)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new V({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(t){const e=t in V.aaSynonyms?V.aaSynonyms[t]:t;return super.get(e)}}V.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class G{static getPalette(t="grok"){switch(t){case"grok":return V.GrokGroups;case"lesk":return V.Lesk;default:throw new Error(`ChemPalette: scheme \`${t}\` does not exist`)}}static getInnerOuter(t){let e=0,n="",r="";for(const o of t)"("==o?e++:")"==o?e--:e?n+=o:r+=o;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(t="",e="grok"){const n=this.getPalette(e);let[r,o]=this.getInnerOuter(t);if(r=r.length>6?`${r.slice(0,3)}...`:r,o=o.length>6?`${o.slice(0,3)}...`:o,1==t.length||"("==t[1]){const e=t[0]?.toUpperCase();return e in n?[n.get(e),e,o,1]:[this.undefinedColor,r,o,1]}if("d"==t[0]&&t[1]in n&&(2==t.length||"("==t[2])){const e=t[1]?.toUpperCase();return e in n?[n.get(e),e,o,2]:[this.undefinedColor,r,o,2]}if(t.substring(0,3)in this.AAFullNames&&(3==t.length||"("==t[3])){const e=this.AAFullNames[t.substring(0,3)];return e in n?[n.get(e),e,o,3]:[this.undefinedColor,r,o,3]}if(t[0]?.toLowerCase()==t[0]&&t.substring(1,3)in this.AAFullNames&&(4==t.length||"("==t[4])){const e=this.AAFullNames[t.substring(1,3)];return e in n?[n.get(e),e,o,4]:[this.undefinedColor,r,o,4]}return[this.undefinedColor,r,o,0]}}G.SemType="Aminoacids",G.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",G.undefinedColor="rgb(100,100,100)",G.Names={G:"Glycine",L:"Leucine",Y:"Tyrosine",S:"Serine",E:"Glutamic acid",Q:"Glutamine",D:"Aspartic acid",N:"Asparagine",F:"Phenylalanine",A:"Alanine",K:"Lysine",R:"Arginine",H:"Histidine",C:"Cysteine",V:"Valine",P:"Proline",W:"Tryptophan",I:"Isoleucine",M:"Methionine",T:"Threonine"},G.AASmiles={G:"NCC(=O)O",L:"N[C@H](CC(C)C)C(=O)O",Y:"NC(CC1=CC=C(O)C=C1)C(=O)O",S:"NC(CO)C(=O)O",E:"N[C@@H](CCC(O)=O)C(=O)O",Q:"N[C@@H](CCC(N)=O)C(=O)O",D:"N[C@@H](CC(O)=O)C(=O)O",N:"N[C@@H](CC(N)=O)C(=O)O",F:"NC(CC1=CC=CC=C1)C(=O)O",A:"N[C@H](C)C(=O)O",K:"NC(CCCCN)C(=O)O",R:"N[C@H](CCCNC(=N)C)C(=O)O",H:"NC(CC1=CN=C[N]1)C(=O)O",C:"N[C@@H](CS)C(=O)O",V:"NC(C(C)C)C(=O)O",P:"N(CCC1)C1C(=O)O",W:"N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O",I:"N[C@H]([C@H](C)CC)C(=O)O",M:"NC(CCSC)C(=O)O",T:"NC(C(O)C)C(=O)O"},G.AASmilesTruncated={G:"*C*",L:"CC(C)C[C@H](*)*",Y:"C1=CC(=CC=C1CC(*)*)O",S:"OCC(*)C*",E:"*[C@@H](CCC(O)=O)*",Q:"*N[C@@H](CCC(N)=O)*",D:"*[C@@H](CC(O)=O)*",N:"*[C@@H](CC(N)=O)*",F:"C1=CC=C(C=C1)CC(*)*",A:"C[C@H](*)*",K:"C(CCN)CC(*)*",R:"*[C@H](CCCNC(=N)C)*",H:"C1=C(NC=N1)CC(*)*",C:"C([C@@H](*)*)S",V:"CC(C)C(*)*",P:"C1CCN(*)C1*",W:"*[C@@H](Cc1c2ccccc2n([H])c1)*",I:"CC[C@H](C)[C@H](*)*",M:"CSCCC(*)*",T:"CC(O)C(*)*"},G.AAFullNames={Ala:"A",Arg:"R",Asn:"N",Asp:"D",Cys:"C",Gln:"Q",Glu:"E",Gly:"G",His:"H",Ile:"I",Leu:"L",Lys:"K",Met:"M",Phe:"F",Pro:"P",Ser:"S",Thr:"T",Trp:"W",Tyr:"Y",Val:"V"};class R{}R.SemType="Nucleotides",R.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",R.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"};class j{static hashCode(t){let e=0;if(0===t.length)return e;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}}class q{}class W extends q{static buildPalette(){return[].concat(...Object.values(_.colourPalette))}get(t){const e=j.hashCode(t)%W.palette.length;return function(t){if(null==t)return"rgb(100,100,100)";const e=r.Color.fromHtml(t),n=r.Color.g(e),o=r.Color.r(e),s=r.Color.b(e),a=Math.sqrt(Math.pow(0-o,2)+Math.pow(0-n,2)+Math.pow(0-s,2));return a>210?`rgb(${o/a*210},${n/a*210},${s/a*210})`:r.Color.toRgb(e)}(W.palette[e])}}function Y(t){return t.toString().replace(M,".$1").slice(1).split(".").map((t=>t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):"-"===t?"":t))}function z(t,e){return n=>n.split(t,e)}W.palette=W.buildPalette();const Z=/(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g,K=/\[([^\[\]]+)]/g;function Q(t){Z.lastIndex=0;const e=Z.exec(t.toString()),n=e?e[2]:null;return(n?n.split("."):[]).map((t=>{K.lastIndex=0;const e=K.exec(t);return e&&e.length>=2?e[1]:t}))}async function X(){const t=r.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===t.length)throw new Error('Package "Bio" must be installer for MonomerLibraryHelper.');return(await t[0].prepare().call()).getOutputParamValue()}n(61);class J extends r.Package{_monomerLib;get monomerLib(){if(!this._monomerLib)throw new Error("ST: monomer lib not loaded");return this._monomerLib}async initMonomerLib(){if(void 0!==this._monomerLib)return;const t=r.TaskBarProgressIndicator.create("Initializing Sequence Translator monomer library ...");try{const e=await X();this._monomerLib=await e.readLibrary(y.BX,y.a_)}catch(t){const e=t.hasOwnProperty("message")?t.message:t.toString();throw new Error("Sequence Translator: Loading monomer library error: "+e)}finally{t.close()}}}const tt=new J},976:t=>{t.exports=DG},469:t=>{t.exports=grok}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var s=e[r]={id:r,exports:{}};return t[r](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0;var r={};(()=>{n.r(r),n.d(r,{_package:()=>C,test:()=>h,tests:()=>e.QK});var t=n(976),e=n(61),o=n(29),s=n(996);const a={usCfCfUfGfAf:"CO[C@@H]1[C@H](OP(=O)(S)OC[C@H]2O[C@@H](n3ccc(N)nc3=O)[C@H](F)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3ccc(N)nc3=O)[C@H](F)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3ccc(=O)[nH]c3=O)[C@H](F)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](F)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3cnc4c(N)ncnc43)[C@H](F)[C@@H]2O)[C@@H](CO)O[C@H]1n1ccc(=O)[nH]c1=O",usAfsusgsgsg:"CO[C@@H]1[C@H](OP(=O)(S)OC[C@H]2O[C@@H](n3cnc4c(N)ncnc43)[C@H](F)[C@@H]2OP(=O)(S)OC[C@H]2O[C@@H](n3ccc(=O)[nH]c3=O)[C@H](OC)[C@@H]2OP(=O)(S)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2OP(=O)(S)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2OP(=O)(S)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2O)[C@@H](CO)O[C@H]1n1ccc(=O)[nH]c1=O",UfUfUfsCfsuacg:"CO[C@@H]1[C@H](OP(=O)(O)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2O)[C@@H](COP(=O)(O)O[C@@H]2[C@@H](COP(=O)(O)O[C@@H]3[C@@H](COP(=O)(S)O[C@@H]4[C@@H](COP(=O)(S)O[C@@H]5[C@@H](COP(=O)(O)O[C@@H]6[C@@H](COP(=O)(O)O[C@@H]7[C@@H](CO)O[C@@H](n8ccc(=O)[nH]c8=O)[C@@H]7F)O[C@@H](n7ccc(=O)[nH]c7=O)[C@@H]6F)O[C@@H](n6ccc(=O)[nH]c6=O)[C@@H]5F)O[C@@H](n5ccc(N)nc5=O)[C@@H]4F)O[C@@H](n4ccc(=O)[nH]c4=O)[C@@H]3OC)O[C@@H](n3cnc4c(N)ncnc43)[C@@H]2OC)O[C@H]1n1ccc(N)nc1=O",susususauasu:"CO[C@@H]1[C@H](O)[C@@H](COP(=O)(S)O[C@@H]2[C@@H](COP(=O)(O)O[C@@H]3[C@@H](COP(=O)(O)O[C@@H]4[C@@H](COP(=O)(S)O[C@@H]5[C@@H](COP(=O)(S)O[C@@H]6[C@@H](COP(=O)(S)O[C@@H]7[C@@H](COP(=O)(O)S)O[C@@H](n8ccc(=O)[nH]c8=O)[C@@H]7OC)O[C@@H](n7ccc(=O)[nH]c7=O)[C@@H]6OC)O[C@@H](n6ccc(=O)[nH]c6=O)[C@@H]5OC)O[C@@H](n5cnc6c(N)ncnc65)[C@@H]4OC)O[C@@H](n4ccc(=O)[nH]c4=O)[C@@H]3OC)O[C@@H](n3cnc4c(N)ncnc43)[C@@H]2OC)O[C@H]1n1ccc(=O)[nH]c1=O",CfGfCfsGfsCf:"Nc1ccn([C@@H]2O[C@H](COP(=O)(S)O[C@@H]3[C@@H](COP(=O)(S)O[C@@H]4[C@@H](COP(=O)(O)O[C@@H]5[C@@H](COP(=O)(O)O[C@@H]6[C@@H](CO)O[C@@H](n7ccc(N)nc7=O)[C@@H]6F)O[C@@H](n6cnc7c(=O)[nH]c(N)nc76)[C@@H]5F)O[C@@H](n5ccc(N)nc5=O)[C@@H]4F)O[C@@H](n4cnc5c(=O)[nH]c(N)nc54)[C@@H]3F)[C@@H](O)[C@H]2F)c(=O)n1",acacacsacsac:"CO[C@@H]1[C@H](O)[C@@H](COP(=O)(O)O[C@@H]2[C@@H](COP(=O)(S)O[C@@H]3[C@@H](COP(=O)(O)O[C@@H]4[C@@H](COP(=O)(S)O[C@@H]5[C@@H](COP(=O)(O)O[C@@H]6[C@@H](COP(=O)(O)O[C@@H]7[C@@H](COP(=O)(O)O[C@@H]8[C@@H](COP(=O)(O)O[C@@H]9[C@@H](COP(=O)(O)O[C@@H]%10[C@@H](CO)O[C@@H](n%11cnc%12c(N)ncnc%12%11)[C@@H]%10OC)O[C@@H](n%10ccc(N)nc%10=O)[C@@H]9OC)O[C@@H](n9cnc%10c(N)ncnc%109)[C@@H]8OC)O[C@@H](n8ccc(N)nc8=O)[C@@H]7OC)O[C@@H](n7cnc8c(N)ncnc87)[C@@H]6OC)O[C@@H](n6ccc(N)nc6=O)[C@@H]5OC)O[C@@H](n5cnc6c(N)ncnc65)[C@@H]4OC)O[C@@H](n4ccc(N)nc4=O)[C@@H]3OC)O[C@@H](n3cnc4c(N)ncnc43)[C@@H]2OC)O[C@H]1n1ccc(N)nc1=O",cccgggusug:"CO[C@@H]1[C@H](OP(=O)(O)OC[C@H]2O[C@@H](n3ccc(N)nc3=O)[C@H](OC)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3ccc(N)nc3=O)[C@H](OC)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3ccc(=O)[nH]c3=O)[C@H](OC)[C@@H]2OP(=O)(S)OC[C@H]2O[C@@H](n3ccc(=O)[nH]c3=O)[C@H](OC)[C@@H]2OP(=O)(O)OC[C@H]2O[C@@H](n3cnc4c(=O)[nH]c(N)nc43)[C@H](OC)[C@@H]2O)[C@@H](CO)O[C@H]1n1ccc(N)nc1=O",UfAfCfGfGfCfAfUf:"Nc1ccn([C@@H]2O[C@H](COP(=O)(O)O[C@@H]3[C@@H](COP(=O)(O)O[C@@H]4[C@@H](CO)O[C@@H](n5ccc(=O)[nH]c5=O)[C@@H]4F)O[C@@H](n4cnc5c(N)ncnc54)[C@@H]3F)[C@@H](OP(=O)(O)OC[C@H]3O[C@@H](n4cnc5c(=O)[nH]c(N)nc54)[C@H](F)[C@@H]3OP(=O)(O)OC[C@H]3O[C@@H](n4cnc5c(=O)[nH]c(N)nc54)[C@H](F)[C@@H]3OP(=O)(O)OC[C@H]3O[C@@H](n4ccc(N)nc4=O)[C@H](F)[C@@H]3OP(=O)(O)OC[C@H]3O[C@@H](n4cnc5c(N)ncnc54)[C@H](F)[C@@H]3OP(=O)(O)OC[C@H]3O[C@@H](n4ccc(=O)[nH]c4=O)[C@H](F)[C@@H]3O)[C@H]2F)c(=O)n1"};var i=n(559),c=n(402);function l(e,n){const r=new c.K(e,!1,n).convert();return t.chem.convert(r,t.chem.Notation.MolBlock,t.chem.Notation.Smiles)}const u=o.NI.AXOLABS;(0,e.W3)("Axolabs to smiles",(()=>{(0,e.bb)((async()=>{await(0,s.VO)(),await i._package.initMonomerLib()}));for(const t of Object.keys(a))(0,e.Bu)(`${t} to SMILES`,(async()=>{const n=a[t],r=l(t,u);(0,e.l_)(r,n)}))}));const C=new t.Package;async function h(n,r,o){const s=await(0,e.ci)({category:n,test:r,testContext:o});return t.DataFrame.fromObjects(s)}})(),sequencetranslator_test=r})();
1
+ var sequencetranslator_test;(()=>{"use strict";var t={61:(t,e,n)=>{n.d(e,{Bu:()=>d,QK:()=>s,W3:()=>f,bb:()=>g,ci:()=>A,l_:()=>p});var r=n(469),o=n(976),i=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const s={};let a;var l;!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(l||(l={}));class c{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class u{constructor(t,e,n,r){var o;this.category=t,this.name=e,null!=r||(r={}),null!==(o=r.timeout)&&void 0!==o||(r.timeout=3e4),this.options=r,this.test=()=>i(this,void 0,void 0,(function*(){return new Promise(((t,e)=>i(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(t){e(t)}t(r)}))))}))}}function d(t,e,n){null==s[a]&&(s[a]={}),null==s[a].tests&&(s[a].tests=[]),s[a].tests.push(new u(a,t,e,n))}function p(t,e){if(t!==e)throw new Error(`Expected "${e}", got "${t}"`)}function f(t,e){a=t,e()}function g(t){null==s[a]&&(s[a]={}),s[a].before=t}function A(t){var e,n,a,l,u;return i(this,void 0,void 0,(function*(){const d=[],p=null===(n=null===(e=r.functions.getCurrentCall())||void 0===e?void 0:e.func)||void 0===n?void 0:n.package;console.log("Running tests"),null!=t||(t={}),null!==(a=(u=t).testContext)&&void 0!==a||(u.testContext=new c),r.shell.lastError="";for(const[e,n]of Object.entries(s)){if(null!=(null==t?void 0:t.category)&&!e.toLowerCase().startsWith(null==t?void 0:t.category.toLowerCase()))continue;console.log(`Started ${e} category`);try{n.before&&(yield n.before())}catch(t){n.beforeStatus=t.toString()}const r=null!==(l=n.tests)&&void 0!==l?l:[],o=[];for(let e=0;e<r.length;e++)o.push(yield h(r[e],null==t?void 0:t.test));const i=(yield Promise.all(o)).filter((t=>"skipped"!=t.result));try{n.after&&(yield n.after())}catch(t){n.afterStatus=t.toString()}n.afterStatus&&i.push({category:e,name:"init",result:n.afterStatus,success:!1,ms:0,skipped:!1}),n.beforeStatus&&i.push({category:e,name:"init",result:n.beforeStatus,success:!1,ms:0,skipped:!1}),d.push(...i)}if(t.testContext.catchUnhandled&&(yield function(t){return i(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}(1e3),r.shell.lastError.length>0&&d.push({category:"Unhandled exceptions",name:"exceptions",result:r.shell.lastError,success:!1,ms:0,skipped:!1})),t.testContext.report){const t=new o.Logger,e=d.filter((t=>t.success)).length,n=d.filter((t=>t.skipped)).length,r=d.filter((t=>!t.success)),i="Package @package tested: @successful successful, @skipped skipped, @failed failed tests",s={successful:e,skipped:n,failed:r.length,package:p};for(const t of r)Object.assign(s,{[`${t.category} | ${t.name}`]:t.result});t.log(i,s,"package-tested")}return d}))}function h(t,e){var n,r,o;return i(this,void 0,void 0,(function*(){let i;const s=null!=e&&!t.name.toLowerCase().startsWith(e.toLowerCase()),a=(null===(n=t.options)||void 0===n?void 0:n.skipReason)||s,l=s?"skipped":null===(r=t.options)||void 0===r?void 0:r.skipReason;a||console.log(`Started ${t.category} ${t.name}`);const c=new Date;try{i=a?{success:!0,result:l,ms:0,skipped:!0}:{success:!0,result:null!==(o=yield t.test())&&void 0!==o?o:"OK",ms:0,skipped:!1}}catch(t){i={success:!1,result:t.toString(),ms:0,skipped:!1}}const u=new Date;return i.ms=u-c,a||console.log(`Finished ${t.category} ${t.name} for ${i.ms} ms`),i.category=t.category,i.name=t.name,i}))}},973:(t,e,n)=>{n.d(e,{Z:()=>a});var r=n(537),o=n.n(r),i=n(645),s=n.n(i)()(o());s.push([t.id,".colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto Mono', 'Roboto Mono Local', monospace;\n font-size: 12px;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/view/css/colored-text-input.css"],names:[],mappings:"AAAA;EACE,WAAW;EACX,oCAAoC;EACpC,6BAA6B;EAC7B,kBAAkB;EAClB,UAAU;EACV,YAAY;EACZ,YAAY,EAAE,wEAAwE;AACxF;;AAEA;EACE;iCAC+B;EAC/B,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,YAAY;EACZ,UAAU;EACV,eAAe;EACf,YAAY;EACZ,mBAAmB;EACnB,0DAA0D;EAC1D,eAAe;EACf,kBAAkB;EAClB,qBAAqB;EACrB,qBAAqB;AACvB",sourcesContent:[".colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto Mono', 'Roboto Mono Local', monospace;\n font-size: 12px;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n"],sourceRoot:""}]);const a=s},284:(t,e,n)=>{n.d(e,{Z:()=>a});var r=n(537),o=n.n(r),i=n(645),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n.st-main-input-table {\n width: 100%;\n}\n\n.st-main-input-table td:has(textarea) {\n width: 100%;\n padding-right: 20px;\n}\n\n.st-main-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-main-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n/* .st-main-output-table table tbody tr td { */\n/* max-width: 20%; */\n/* } */\n\n.st-main-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-main-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-main-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table td a {\n overflow-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/view/css/main-tab.css"],names:[],mappings:"AAAA,iHAAiH;AACjH;EACE,WAAW;AACb;;AAEA;EACE,WAAW;EACX,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,WAAW;EACX,mBAAmB;AACrB;;AAEA,8CAA8C;AAC9C,sBAAsB;AACtB,MAAM;;AAEN;EACE,gBAAgB;EAChB,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yBAAyB;AAC3B",sourcesContent:["/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n.st-main-input-table {\n width: 100%;\n}\n\n.st-main-input-table td:has(textarea) {\n width: 100%;\n padding-right: 20px;\n}\n\n.st-main-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-main-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n/* .st-main-output-table table tbody tr td { */\n/* max-width: 20%; */\n/* } */\n\n.st-main-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-main-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-main-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-main-output-table td a {\n overflow-wrap: break-word;\n}\n"],sourceRoot:""}]);const a=s},865:(t,e,n)=>{n.d(e,{Z:()=>a});var r=n(537),o=n.n(r),i=n(645),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n\n.st-sdf-body {\n padding-right: 20px;\n}\n\n.st-sdf-input-form {\n text-align: right;\n vertical-align: top;\n min-width: 95px;\n}\n\n.st-sdf-direction-choice label {\n min-width: 100px;\n float: right;\n}\n\n.st-sdf-direction-choice div {\n justify-content: right;\n}\n\n.st-sdf-text-input-td { /* Style for td containing textarea */\n width: 100%;\n}\n\n.st-sdf-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-sdf-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-sdf-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n","",{version:3,sources:["webpack://./src/view/css/sdf-tab.css"],names:[],mappings:"AAAA,iHAAiH;;AAEjH;EACE,mBAAmB;AACrB;;AAEA;EACE,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,YAAY;AACd;;AAEA;EACE,sBAAsB;AACxB;;AAEA,wBAAwB,qCAAqC;EAC3D,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA;EACE,2BAA2B;EAC3B,iBAAiB;AACnB",sourcesContent:["/* Naming convention: class names should begin with st and tab name (main, axo, sdf) to avoid naming collitions */\n\n.st-sdf-body {\n padding-right: 20px;\n}\n\n.st-sdf-input-form {\n text-align: right;\n vertical-align: top;\n min-width: 95px;\n}\n\n.st-sdf-direction-choice label {\n min-width: 100px;\n float: right;\n}\n\n.st-sdf-direction-choice div {\n justify-content: right;\n}\n\n.st-sdf-text-input-td { /* Style for td containing textarea */\n width: 100%;\n}\n\n.st-sdf-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-sdf-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-sdf-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n"],sourceRoot:""}]);const a=s},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);r&&s[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},537:t=>{t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */");return[e].concat([i]).join("\n")}return[e].join("\n")}},803:(t,e)=>{var n;!function(){var r=e||{}||this||window;void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n),r.default=r;var o="http://www.w3.org/2000/xmlns/",i="http://www.w3.org/2000/svg",s=/url\(["']?(.+?)["']?\)/,a={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},l=function(t){return t instanceof HTMLElement||t instanceof SVGElement},c=function(t){if(!l(t))throw new Error("an HTMLElement or SVGElement is required; got "+t)},u=function(t){return new Promise((function(e,n){l(t)?e(t):n(new Error("an HTMLElement or SVGElement is required; got "+t))}))},d=function(t,e,n){var r=t.viewBox&&t.viewBox.baseVal&&t.viewBox.baseVal[n]||null!==e.getAttribute(n)&&!e.getAttribute(n).match(/%$/)&&parseInt(e.getAttribute(n))||t.getBoundingClientRect()[n]||parseInt(e.style[n])||parseInt(window.getComputedStyle(t).getPropertyValue(n));return null==r||isNaN(parseFloat(r))?0:r},p=function(t){for(var e=window.atob(t.split(",")[1]),n=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(e.length),o=new Uint8Array(r),i=0;i<e.length;i++)o[i]=e.charCodeAt(i);return new Blob([r],{type:n})},f={},g=null,A=function(t,e){var n=e||{},r=n.selectorRemap,o=n.modifyStyle,i=n.modifyCss,l=n.fonts,c=n.excludeUnusedCss,u=i||function(t,e){return(r?r(t):t)+"{"+(o?o(e):e)+"}\n"},d=[],p=void 0===l,A=l||[];return(g||(g=Array.from(document.styleSheets).map((function(t){try{return{rules:t.cssRules,href:t.href}}catch(e){return console.warn("Stylesheet could not be loaded: "+t.href,e),{}}})))).forEach((function(e){var n=e.rules,r=e.href;n&&Array.from(n).forEach((function(e){if(void 0!==e.style)if(function(t,e){if(e)try{return t.querySelector(e)||t.parentNode&&t.parentNode.querySelector(e)}catch(t){console.warn('Invalid CSS selector "'+e+'"',t)}}(t,e.selectorText))d.push(u(e.selectorText,e.style.cssText));else if(p&&e.cssText.match(/^@font-face/)){var n=function(t,e){var n=t.cssText.match(s),r=n&&n[1]||"";if(r&&!r.match(/^data:/)&&"about:blank"!==r){var o,i,l=r.startsWith("../")?e+"/../"+r:r.startsWith("./")?e+"/."+r:r;return{text:t.cssText,format:(o=l,i=Object.keys(a).filter((function(t){return o.indexOf("."+t)>0})).map((function(t){return a[t]})),i?i[0]:(console.error("Unknown font format for "+o+". Fonts may not be working correctly."),"application/octet-stream")),url:l}}}(e,r);n&&A.push(n)}else c||d.push(e.cssText)}))})),function(t){return Promise.all(t.map((function(t){return new Promise((function(e,n){if(f[t.url])return e(f[t.url]);var r=new XMLHttpRequest;r.addEventListener("load",(function(){var n=function(t){for(var e="",n=new Uint8Array(t),r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return window.btoa(e)}(r.response),o=t.text.replace(s,'url("data:'+t.format+";base64,"+n+'")')+"\n";f[t.url]=o,e(o)})),r.addEventListener("error",(function(n){console.warn("Failed to load font from: "+t.url,n),f[t.url]=null,e(null)})),r.addEventListener("abort",(function(n){console.warn("Aborted loading font from: "+t.url,n),e(null)})),r.open("GET",t.url),r.responseType="arraybuffer",r.send()}))}))).then((function(t){return t.filter((function(t){return t})).join("")}))}(A).then((function(t){return d.join("\n")+t}))},h=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};r.prepareSvg=function(t,e,n){c(t);var r=e||{},s=r.left,a=void 0===s?0:s,l=r.top,u=void 0===l?0:l,p=r.width,f=r.height,g=r.scale,h=void 0===g?1:g,m=r.responsive,C=void 0!==m&&m,b=r.excludeCss,v=void 0!==b&&b;return function(t){return Promise.all(Array.from(t.querySelectorAll("image")).map((function(t){var e,n=t.getAttributeNS("http://www.w3.org/1999/xlink","href")||t.getAttribute("href");return n?((e=n)&&0===e.lastIndexOf("http",0)&&-1===e.lastIndexOf(window.location.host)&&(n+=(-1===n.indexOf("?")?"?":"&")+"t="+(new Date).valueOf()),new Promise((function(e,r){var o=document.createElement("canvas"),i=new Image;i.crossOrigin="anonymous",i.src=n,i.onerror=function(){return r(new Error("Could not load "+n))},i.onload=function(){o.width=i.width,o.height=i.height,o.getContext("2d").drawImage(i,0,0),t.setAttributeNS("http://www.w3.org/1999/xlink","href",o.toDataURL("image/png")),e(!0)}}))):Promise.resolve(null)})))}(t).then((function(){var r=t.cloneNode(!0);r.style.backgroundColor=(e||{}).backgroundColor||t.style.backgroundColor;var s=function(t,e,n,r){if("svg"===t.tagName)return{width:n||d(t,e,"width"),height:r||d(t,e,"height")};if(t.getBBox){var o=t.getBBox(),i=o.x,s=o.y;return{width:i+o.width,height:s+o.height}}}(t,r,p,f),l=s.width,c=s.height;if("svg"!==t.tagName){if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);null!=r.getAttribute("transform")&&r.setAttribute("transform",r.getAttribute("transform").replace(/translate\(.*?\)/,""));var g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.appendChild(r),r=g}if(r.setAttribute("version","1.1"),r.setAttribute("viewBox",[a,u,l,c].join(" ")),r.getAttribute("xmlns")||r.setAttributeNS(o,"xmlns",i),r.getAttribute("xmlns:xlink")||r.setAttributeNS(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),C?(r.removeAttribute("width"),r.removeAttribute("height"),r.setAttribute("preserveAspectRatio","xMinYMin meet")):(r.setAttribute("width",l*h),r.setAttribute("height",c*h)),Array.from(r.querySelectorAll("foreignObject > *")).forEach((function(t){t.setAttributeNS(o,"xmlns","svg"===t.tagName?i:"http://www.w3.org/1999/xhtml")})),!v)return A(t,e).then((function(t){var e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML="<![CDATA[\n"+t+"\n]]>";var o=document.createElement("defs");o.appendChild(e),r.insertBefore(o,r.firstChild);var i=document.createElement("div");i.appendChild(r);var s=i.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if("function"!=typeof n)return{src:s,width:l,height:c};n(s,l,c)}));var m=document.createElement("div");m.appendChild(r);var b=m.innerHTML;if("function"!=typeof n)return{src:b,width:l,height:c};n(b,l,c)}))},r.svgAsDataUri=function(t,e,n){return c(t),r.prepareSvg(t,e).then((function(t){var e=t.src,r=t.width,o=t.height,i="data:image/svg+xml;base64,"+window.btoa(decodeURIComponent(encodeURIComponent('<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp "&#160;">]>'+e).replace(/%([0-9A-F]{2})/g,(function(t,e){var n=String.fromCharCode("0x"+e);return"%"===n?"%25":n}))));return"function"==typeof n&&n(i,r,o),i}))},r.svgAsPngUri=function(t,e,n){c(t);var o=e||{},i=o.encoderType,s=void 0===i?"image/png":i,a=o.encoderOptions,l=void 0===a?.8:a,u=o.canvg,d=function(t){var e=t.src,r=t.width,o=t.height,i=document.createElement("canvas"),a=i.getContext("2d"),c=window.devicePixelRatio||1;i.width=r*c,i.height=o*c,i.style.width=i.width+"px",i.style.height=i.height+"px",a.setTransform(c,0,0,c,0,0),u?u(i,e):a.drawImage(e,0,0);var d=void 0;try{d=i.toDataURL(s,l)}catch(t){if("undefined"!=typeof SecurityError&&t instanceof SecurityError||"SecurityError"===t.name)return void console.error("Rendered SVG images cannot be downloaded in this browser.");throw t}return"function"==typeof n&&n(d,i.width,i.height),Promise.resolve(d)};return u?r.prepareSvg(t,e).then(d):r.svgAsDataUri(t,e).then((function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){return e(d({src:r,width:r.width,height:r.height}))},r.onerror=function(){n("There was an error loading the data URI as an image on the following SVG\n"+window.atob(t.slice(26))+"Open the following link to see browser's diagnosis\n"+t)},r.src=t}))}))},r.download=function(t,e,n){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(p(e),t);else{var r=document.createElement("a");if("download"in r){r.download=t,r.style.display="none",document.body.appendChild(r);try{var o=p(e),i=URL.createObjectURL(o);r.href=i,r.onclick=function(){return requestAnimationFrame((function(){return URL.revokeObjectURL(i)}))}}catch(t){console.error(t),console.warn("Error while getting object URL. Falling back to string URL."),r.href=e}r.click(),document.body.removeChild(r)}else n&&n.popup&&(n.popup.document.title=t,n.popup.location.replace(e))}},r.saveSvg=function(t,e,n){var o=h();return u(t).then((function(t){return r.svgAsDataUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))},r.saveSvgAsPng=function(t,e,n){var o=h();return u(t).then((function(t){return r.svgAsPngUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))}}()},379:t=>{var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var i={},s=[],a=0;a<t.length;a++){var l=t[a],c=r.base?l[0]+r.base:l[0],u=i[c]||0,d="".concat(c," ").concat(u);i[c]=u+1;var p=n(d),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)e[p].references++,e[p].updater(f);else{var g=o(f,r);r.byIndex=a,e.splice(a,0,{identifier:d,updater:g,references:1})}s.push(d)}return s}function o(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var i=r(t=t||[],o=o||{});return function(t){t=t||[];for(var s=0;s<i.length;s++){var a=n(i[s]);e[a].references--}for(var l=r(t,o),c=0;c<i.length;c++){var u=n(i[c]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}i=l}}},569:t=>{var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},29:(t,e,n)=>{n.d(e,{NI:()=>o,mc:()=>r});const r=["A","G","C","U","T"];var o;!function(t){t.HELM="HELM",t.AXOLABS="Axolabs"}(o||(o={}))},895:(t,e,n)=>{n.d(e,{BX:()=>r,Dv:()=>a,VV:()=>l,Xz:()=>c,a_:()=>o,dz:()=>s,pl:()=>i});const r="System:AppData/SequenceTranslator",o="monomer-lib.json",i="System:AppData/SequenceTranslator",s="axolabs-style.json",a="formats-to-helm.json",l="codes-to-symbols.json",c="linkers.json"},996:(t,e,n)=>{n.d(e,{BF:()=>l,Rv:()=>a,VO:()=>u});var r=n(976),o=n(895);const i=new r.FileSource(o.pl);let s,a,l,c;async function u(){[s,a,l,c].every((t=>void 0!==t))||(s=await d(o.dz),a=await d(o.Dv),l=await d(o.VV),c=await d(o.Xz))}async function d(t){let e;try{e=JSON.parse(await i.readAsText(t))}catch(e){const n=e.hasOwnProperty("message")?e.message:e.toString();throw new Error(`Error loading json from ${t}:`+n)}return e}},800:(t,e,n)=>{n.d(e,{$3:()=>o,DD:()=>r,s8:()=>i});const r={NUCLEOSIDE:"nucleoside",LINKAGE:"phosphateBackbone"},o="p",i="<?>"},112:(t,e,n)=>{n.d(e,{C:()=>c,D:()=>l});var r=n(29),o=n(800),i=n(893),s=n(996),a=n(559);function l(t,e,n){const o=Object.keys(s.Rv).concat([r.NI.HELM]);if(!t||-1!==e&&n!==r.NI.HELM)return{};if(!o.includes(n))throw new Error(`${n} format is not supported by SequenceTranslator`);const l=o.filter((t=>t!=n)).sort(((t,e)=>t.localeCompare(e))),u=new i.I(t,n),d=Object.fromEntries(l.map((t=>{let e;try{e=u.convertTo(t)}catch{e=null}return[t,e]})).filter((([t,e])=>e))),p=c(n===r.NI.HELM?t:d[r.NI.HELM],a.A.getInstance());return p&&(d.Nucleotides=p),d}function c(t,e){const n=new RegExp("\\([^()]*\\)","g"),i=t.match(n);return i?i.map((t=>{const n=t.replace(/[\[\]()]/g,"");return r.mc.includes(n)?n:e.getNaturalAnalogBySymbol(n)})).map((t=>t||o.s8)).join(""):null}},893:(t,e,n)=>{n.d(e,{I:()=>a});var r=n(29),o=n(800),i=n(996);const s={LEFT:"RNA1{",RIGHT:"}$$$$"};class a{sequence;sourceFormat;constructor(t,e){this.sequence=t,this.sourceFormat=e}convertTo(t){const e=Object.keys(i.Rv);if(this.sourceFormat===r.NI.HELM&&e.includes(t))return u(this.sequence,t);if(e.includes(this.sourceFormat)&&t===r.NI.HELM)return d(this.sequence,this.sourceFormat);if([this.sourceFormat,t].every((t=>e.includes(t))))return u(d(this.sequence,this.sourceFormat),t);throw new Error(`ST: unsupported translation direction ${this.sourceFormat} -> ${t}`)}}function l(t){return t.map((t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).map((t=>t.includes("(")||t.includes(")")?t:`(?<!\\([^()]*)${t}(?![^()]*\\))`)).join("|")}function c(t,e){return e.length-t.length}function u(t,e){const n=function(t){const e={};return Object.values(t).forEach((t=>{Object.entries(t).forEach((([t,n])=>{const r=n.replace(/\)p/g,")").replace(/\]p/g,"]");void 0===e[r]?e[r]=[t]:e[r].push(t)}))})),Object.entries(e).forEach((([t,n])=>{const r=n.sort(c);e[t]=r[0]})),e}(i.Rv[e]),r=new RegExp(l(Object.values(s)),"g");let a=t.replace(r,"");const u=Object.keys(n).sort(c),d=new RegExp(l(u)+"|.","g");return a=a.replace(d,(t=>u.includes(t)?n[t]:"p"===t||"."===t?t:"?")).replace(/\?+/g,o.s8).replace(/p\.|\./g,""),a=a.replace(/<empty>/g,""),a=a.replace(/\/\//g,"/"),a}function d(t,e){const n=i.Rv[e],r=Object.assign({},...Object.values(n)),a=Object.keys(r).sort(c),u=new RegExp(l(a)+"|\\([^()]*\\)|.","g"),d=l(Array.from(new Set(Object.values(n[o.DD.LINKAGE]))).sort(c)),p=new RegExp(`${o.$3}.(${d})`,"g");let f=t.replace(u,(t=>a.includes(t)?r[t]+".":"?"));return f=f.replace(/\?+/g,`${o.s8}.`),f=f.slice(0,-1),f[f.length-1]===o.$3&&(f=f.slice(0,-1)),f=f.replace(p,((t,e)=>e)),f=f.replace(/<empty>/g,""),`${s.LEFT+f+s.RIGHT}`}},669:(t,e,n)=>{function r(t){return t.sort(((t,e)=>e.length-t.length))}n.d(e,{x:()=>r})},559:(t,e,n)=>{n.d(e,{A:()=>a});var r=n(976),o=n(563),i=n(29),s=n(996);class a{constructor(){const t=o._package.monomerLib;if(null===t)throw new Error("SequenceTranslator: monomer library is null");this.lib=t,this.allMonomers=this.getAllMonomers()}lib;static instance;allMonomers;formatMonomerForViewer(t){const e={};return e.name=t.symbol,e.symbol=t.symbol,e.molfile=t.molfile,this.getAllFormats().forEach((n=>{if(n===i.NI.HELM)return;const r=s.BF[n],o=Object.keys(r).filter((e=>r[e]===t.symbol));e[n]=o.join(", ")})),e}getAllMonomers(){const t=this.lib.getPolymerTypes();let e=[];for(const n of t){const t=this.lib.getMonomerSymbolsByType(n).map((t=>this.lib.getMonomer(n,t))).filter((t=>null!==t));e=e.concat(t)}return e}getMonomer(t){const e=this.lib.getMonomer("RNA",t);if(void 0===e)throw new Error(`SequenceTranslator: no monomer with symbol ${t}`);return e}static getInstance(){return void 0===a.instance&&(a.instance=new a),a.instance}getMolfileBySymbol(t){return this.getMonomer(t).molfile}getNaturalAnalogBySymbol(t){const e=this.getMonomer(t).naturalAnalog;if(!e)throw new Error(`ST: no natural analog for ${t}`);return e}isModification(t){return!!this.getMolfileBySymbol(t).includes("MODIFICATION")}getCodeToSymbolMap(t){return new Map(Object.entries(s.BF[t]))}getCodesByFormat(t){return Object.keys(s.BF[t])}getAllFormats(){return Object.keys(s.BF)}getTableForViewer(){const t=this.allMonomers.map((t=>this.formatMonomerForViewer(t)));return r.DataFrame.fromObjects(t)}getCodesToWeightsMap(){const t=new Map;return Object.entries(s.BF).forEach((([e,n])=>{Object.entries(n).forEach((([e,n])=>{const r=this.getMonomer(n).meta?.molecularWeight;t.set(e,r)}))})),t}}},947:(t,e,n)=>{n.d(e,{b:()=>s});var r=n(29),o=n(559),i=n(669);class s{sequence;constructor(t){this.sequence=t,this.libWrapper=o.A.getInstance()}libWrapper;getInvalidCodeIndex(t){if(t===r.NI.HELM)return this.sequence.length;const e=["r","d"],n=(0,i.x)(this.libWrapper.getCodesByFormat(t));let o=0;for(;o<this.sequence.length;){const t=n.find((t=>t===this.sequence.substring(o,o+t.length)));if(!t)break;if(o>1&&r.mc.includes(this.sequence[o])&&e.includes(this.sequence[o-2]))break;if(e.includes(this.sequence[o+1])&&r.mc.includes(this.sequence[o])){o++;break}o+=t.length}return o===this.sequence.length&&(o=-1),o}isValidSequence(t){return-1===this.getInvalidCodeIndex(t)}}},563:(t,e,n)=>{n.d(e,{_package:()=>j}),n(469);var r=n(976);ui,rxjs;var o=n(379),i=n.n(o),s=n(795),a=n.n(s),l=n(569),c=n.n(l),u=n(565),d=n.n(u),p=n(216),f=n.n(p),g=n(589),A=n.n(g),h=n(284),m={};m.styleTagTransform=A(),m.setAttributes=d(),m.insert=c().bind(null,"head"),m.domAPI=a(),m.insertStyleElement=f(),i()(h.Z,m),h.Z&&h.Z.locals&&h.Z.locals,$,n(947),n(29),n(559),n(996);var C,b,v=n(973),w={};w.styleTagTransform=A(),w.setAttributes=d(),w.insert=c().bind(null,"head"),w.domAPI=a(),w.insertStyleElement=f(),i()(v.Z,w),v.Z&&v.Z.locals&&v.Z.locals,n(112),(b=C||(C={})).HEADER="V2000",b[b.NUM_OF_HEADER_LINES=3]="NUM_OF_HEADER_LINES",b[b.NUM_OF_COUNTS_DIGITS=3]="NUM_OF_COUNTS_DIGITS",b[b.ATOM_TYPE_COL=4]="ATOM_TYPE_COL",b[b.FIRST_BONDED_ATOM_COL=1]="FIRST_BONDED_ATOM_COL",b[b.BOND_TYPE_COL=3]="BOND_TYPE_COL",b[b.RGP_SHIFT=8]="RGP_SHIFT",b.RGP_LINE="M RGP",b.A_LINE="A ",b.END="M END",Error,n(893);var E=n(865),y={};function x(t,e){const n=document.createElement("canvas").getContext("2d");return n.font=String(e),2*n.measureText(t).width}y.styleTagTransform=A(),y.setAttributes=d(),y.insert=c().bind(null,"head"),y.domAPI=a(),y.insertStyleElement=f(),i()(E.Z,y),E.Z&&E.Z.locals&&E.Z.locals;Math.max(x("SS: 5'",17),x("AS: 3'",17)),Math.max(x("3'",17),x("5'",17)),n(803);var O,B,N=n(895);wu;class S{constructor(t,e,n){this.name=t,this.alphabet=e,this.cutoff=n}}(B=O||(O={})).FASTA="fasta",B.SEPARATOR="separator",B.HELM="helm";const M=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}};new S("PT",M.fasta.peptide,.5),new S("DNA",M.fasta.dna,.55),new S("RNA",M.fasta.rna,.55);class T extends Float32Array{}class k{static makePalette(t,e=!1,n=k){const r={};return t.forEach((t=>{const n=t[0],o=t[1];n.forEach(((t,n)=>{r[t]=this.colourPalette[o][e?0:n]}))})),new n(r)}constructor(t){this._palette=t}get(t){return this._palette[t]}}k.undefinedColor="rgb(100,100,100)",k.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]};class R extends k{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,R)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,R)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new R({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(t){const e=t in R.aaSynonyms?R.aaSynonyms[t]:t;return super.get(e)}}R.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class L{static getPalette(t="grok"){switch(t){case"grok":return R.GrokGroups;case"lesk":return R.Lesk;default:throw new Error(`ChemPalette: scheme \`${t}\` does not exist`)}}static getInnerOuter(t){let e=0,n="",r="";for(const o of t)"("==o?e++:")"==o?e--:e?n+=o:r+=o;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(t="",e="grok"){const n=this.getPalette(e);let[r,o]=this.getInnerOuter(t);if(r=r.length>6?`${r.slice(0,3)}...`:r,o=o.length>6?`${o.slice(0,3)}...`:o,1==t.length||"("==t[1]){const e=t[0]?.toUpperCase();return e in n?[n.get(e),e,o,1]:[this.undefinedColor,r,o,1]}if("d"==t[0]&&t[1]in n&&(2==t.length||"("==t[2])){const e=t[1]?.toUpperCase();return e in n?[n.get(e),e,o,2]:[this.undefinedColor,r,o,2]}if(t.substring(0,3)in this.AAFullNames&&(3==t.length||"("==t[3])){const e=this.AAFullNames[t.substring(0,3)];return e in n?[n.get(e),e,o,3]:[this.undefinedColor,r,o,3]}if(t[0]?.toLowerCase()==t[0]&&t.substring(1,3)in this.AAFullNames&&(4==t.length||"("==t[4])){const e=this.AAFullNames[t.substring(1,3)];return e in n?[n.get(e),e,o,4]:[this.undefinedColor,r,o,4]}return[this.undefinedColor,r,o,0]}}L.SemType="Aminoacids",L.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",L.undefinedColor="rgb(100,100,100)",L.Names={G:"Glycine",L:"Leucine",Y:"Tyrosine",S:"Serine",E:"Glutamic acid",Q:"Glutamine",D:"Aspartic acid",N:"Asparagine",F:"Phenylalanine",A:"Alanine",K:"Lysine",R:"Arginine",H:"Histidine",C:"Cysteine",V:"Valine",P:"Proline",W:"Tryptophan",I:"Isoleucine",M:"Methionine",T:"Threonine"},L.AASmiles={G:"NCC(=O)O",L:"N[C@H](CC(C)C)C(=O)O",Y:"NC(CC1=CC=C(O)C=C1)C(=O)O",S:"NC(CO)C(=O)O",E:"N[C@@H](CCC(O)=O)C(=O)O",Q:"N[C@@H](CCC(N)=O)C(=O)O",D:"N[C@@H](CC(O)=O)C(=O)O",N:"N[C@@H](CC(N)=O)C(=O)O",F:"NC(CC1=CC=CC=C1)C(=O)O",A:"N[C@H](C)C(=O)O",K:"NC(CCCCN)C(=O)O",R:"N[C@H](CCCNC(=N)C)C(=O)O",H:"NC(CC1=CN=C[N]1)C(=O)O",C:"N[C@@H](CS)C(=O)O",V:"NC(C(C)C)C(=O)O",P:"N(CCC1)C1C(=O)O",W:"N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O",I:"N[C@H]([C@H](C)CC)C(=O)O",M:"NC(CCSC)C(=O)O",T:"NC(C(O)C)C(=O)O"},L.AASmilesTruncated={G:"*C*",L:"CC(C)C[C@H](*)*",Y:"C1=CC(=CC=C1CC(*)*)O",S:"OCC(*)C*",E:"*[C@@H](CCC(O)=O)*",Q:"*N[C@@H](CCC(N)=O)*",D:"*[C@@H](CC(O)=O)*",N:"*[C@@H](CC(N)=O)*",F:"C1=CC=C(C=C1)CC(*)*",A:"C[C@H](*)*",K:"C(CCN)CC(*)*",R:"*[C@H](CCCNC(=N)C)*",H:"C1=C(NC=N1)CC(*)*",C:"C([C@@H](*)*)S",V:"CC(C)C(*)*",P:"C1CCN(*)C1*",W:"*[C@@H](Cc1c2ccccc2n([H])c1)*",I:"CC[C@H](C)[C@H](*)*",M:"CSCCC(*)*",T:"CC(O)C(*)*"},L.AAFullNames={Ala:"A",Arg:"R",Asn:"N",Asp:"D",Cys:"C",Gln:"Q",Glu:"E",Gly:"G",His:"H",Ile:"I",Leu:"L",Lys:"K",Met:"M",Phe:"F",Pro:"P",Ser:"S",Thr:"T",Trp:"W",Tyr:"Y",Val:"V"};class I{}I.SemType="Nucleotides",I.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",I.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"};class H{static hashCode(t){let e=0;if(0===t.length)return e;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}}class F{}class G extends F{static buildPalette(){return[].concat(...Object.values(k.colourPalette))}get(t){const e=H.hashCode(t)%G.palette.length;return function(t){if(null==t)return"rgb(100,100,100)";const e=r.Color.fromHtml(t),n=r.Color.g(e),o=r.Color.r(e),i=r.Color.b(e),s=Math.sqrt(Math.pow(0-o,2)+Math.pow(0-n,2)+Math.pow(0-i,2));return s>210?`rgb(${o/s*210},${n/s*210},${i/s*210})`:r.Color.toRgb(e)}(G.palette[e])}}G.palette=G.buildPalette();new Uint32Array(65536);var U,_;(_=U||(U={})).HAMMING="Hamming",_.LEVENSHTEIN="Levenshtein",_.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",U.HAMMING,U.LEVENSHTEIN,U.NEEDLEMANN_WUNSCH,new class{constructor(){this.uhTemp=`units-handler.${r.SEMTYPE.MACROMOLECULE}`}},O.FASTA,O.SEPARATOR,O.HELM,n(61);class P extends r.Package{_monomerLib;get monomerLib(){if(!this._monomerLib)throw new Error("ST: monomer lib not loaded");return this._monomerLib}async initMonomerLib(){if(void 0!==this._monomerLib)return;const t=r.TaskBarProgressIndicator.create("Initializing Sequence Translator monomer library ...");try{const e=await async function(){const t=r.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===t.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await t[0].prepare().call()).getOutputParamValue()}();this._monomerLib=await e.readLibrary(N.BX,N.a_)}catch(t){const e=t.hasOwnProperty("message")?t.message:t.toString();throw new Error("Loading monomer library: "+e)}finally{t.close()}}}const j=new P},976:t=>{t.exports=DG},469:t=>{t.exports=grok}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0;var r={};(()=>{n.r(r),n.d(r,{_package:()=>h,test:()=>m,tests:()=>e.QK});var t=n(976),e=n(61),o=n(29),i=n(893),s=n(996);const a={Axolabs:{UfAfsCfsGfuacg:"RNA1{[fR](U)p.[fR](A)[sp].[fR](C)[sp].[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$"},BioSpring:{"AT*GC*123456789":"RNA1{r(A)p.r(T)[sp].r(G)p.r(C)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)p.d([m5C])}$$$$"},Mermade12:{hefglijkLIJKHEFG:"RNA1{[25r](U)[sp].[25r](A)[sp].[25r](C)[sp].[25r](G)[sp].[fR](U)[sp].[fR](A)[sp].[fR](C)[sp].[fR](G)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$"}},l={"RNA1{[fR](U)p.[fR](A)[sp].[fR](C)[sp].[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$":"UACGUACG","RNA1{r(A)p.r(T)[sp].r(G)p.r(C)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)p.d([m5C])}$$$$":"ATGCUACGUACGC","RNA1{[25r](U)[sp].[25r](A)[sp].[25r](C)[sp].[25r](G)[sp].[fR](U)[sp].[fR](A)[sp].[fR](C)[sp].[fR](G)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$":"UACGUACGUACGUACG"};var c=n(563);function u(t,e){return new i.I(t,e).convertTo(o.NI.HELM)}function d(t,e){return new i.I(t,o.NI.HELM).convertTo(e)}(0,e.W3)("Formats to HELM",(()=>{(0,e.bb)((async()=>{await(0,s.VO)(),await c._package.initMonomerLib()}));for(const t of Object.keys(a))for(const[n,r]of Object.entries(a[t]))(0,e.Bu)(`${t} to HELM`,(async()=>{const o=r,i=u(n,t);(0,e.l_)(i,o)}))})),(0,e.W3)("HELM to Formats",(()=>{(0,e.bb)((async()=>{await(0,s.VO)(),await c._package.initMonomerLib()}));for(const t of Object.keys(a))for(const[n,r]of Object.entries(a[t]))(0,e.Bu)(`${t} to HELM`,(async()=>{const o=n,i=d(r,t);(0,e.l_)(i,o)}))}));var p=n(112),f=n(559);(0,e.W3)("HELM to Nucleotides",(()=>{(0,e.bb)((async()=>{await(0,s.VO)(),await c._package.initMonomerLib()})),Object.entries(l).forEach((([t,n],r)=>{(0,e.Bu)(`Sequence ${r+1} to nucleotides`,(async()=>{const r=n,o=(0,p.C)(t,f.A.getInstance());(0,e.l_)(o,r)}))}))}));var g=n(947);const A={[o.NI.AXOLABS]:"Afcgacsu",[o.NI.HELM]:"RNA1{[fR](A)p.[25r](C)p.[25r](G)p.[25r](A)p.[25r](C)[sp].[25r](U)}$$$$"};(0,e.W3)("Formats support",(()=>{(0,e.bb)((async()=>{await(0,s.VO)(),await c._package.initMonomerLib()})),Object.entries(A).forEach((([t,n])=>{(0,e.Bu)(`All formats for ${t}`,(async()=>{const r=function(t,e){const n=new g.b(t).getInvalidCodeIndex(e);return(0,p.D)(t,n,e)}(n,t),o=Object.keys(r).length,i=Object.keys(a).length+1;(0,e.l_)(o,i)}))}))}));const h=new t.Package;async function m(n,r,o){const i=await(0,e.ci)({category:n,test:r,testContext:o});return t.DataFrame.fromObjects(i)}})(),sequencetranslator_test=r})();
2
2
  //# sourceMappingURL=package-test.js.map