@rnacanvas/draw 12.7.0 → 12.7.1
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/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.draw=e():t.draw=e()}(this,(()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&t.every(r)}function f(t){return c(t)&&t.every(n)}function d(t){return c(t)&&t.every(i)}function m(t){return c(t)&&t.every(a)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>f,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>d,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>l,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>m}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>g,Stems:()=>p,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}var p=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(p.bind.apply(p,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function b(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>i,LastPairedBase:()=>o,LeadingDanglingBases:()=>a,Linkers:()=>l,PositionPairs:()=>e,Stems:()=>c,TrailingDanglingBases:()=>u,consecutivePairs:()=>m,knotless:()=>f,other:()=>t,parseDotBracket:()=>d});class e{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];return this.targetStructure[1].map((e=>[t.indexOf(e[0])+1,t.indexOf(e[1])+1]))}}class i{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat(),n=t.findIndex((t=>r.includes(t)));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var s=r(986);class o{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat().map((e=>t.indexOf(e)));if((0,s.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,s.max)(r)]}}class a{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new i(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)}}class u{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new o(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)}}var h=r(369);class c{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Stems(t,r).get().map((e=>e.map((e=>[t[e[0]-1],t[e[1]-1]]))))}}class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Linkers(t,r).get().map((e=>e.map((e=>t[e-1]))))}}function f(...t){let[r,n]=t,i=new e(...t).get();(0,h.areKnotless)(i)||(i=(0,h.knotless)(i));let s=i.map((t=>[r[t[0]-1],r[t[1]-1]]));return[[...r],s]}function d(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map((e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]}))}function m(t){return t.length<2?[]:t.slice(0,-1).map(((e,r)=>[t[r],t[r+1]]))}})(),n})(),t.exports=e()},282:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}t.r(e),t.d(e,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,sendToBack:()=>g,setAttributes:()=>r});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=i[s];return e}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}return v=new WeakMap,e})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function m(t,e){return d([t,e])}})(),n})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{InvertedStraightBondsHider:()=>Br,StraightBond:()=>kr});var t={};r.r(t),r.d(t,{cx:()=>It,cy:()=>Lt,height:()=>Ft,rx:()=>Tt,ry:()=>Dt,width:()=>Vt,x:()=>kt,y:()=>Bt});var e={};r.r(e),r.d(e,{from:()=>Rt,to:()=>Yt});var i={};r.r(i),r.d(i,{MorphArray:()=>Qt,height:()=>te,width:()=>Zt,x:()=>Jt,y:()=>Kt});var s={};r.r(s),r.d(s,{array:()=>Ae,clear:()=>Ce,move:()=>Ee,plot:()=>je,size:()=>Te});var o={};r.r(o),r.d(o,{amove:()=>or,ax:()=>ir,ay:()=>sr,build:()=>ar,center:()=>nr,cx:()=>er,cy:()=>rr,length:()=>Je,move:()=>tr,plain:()=>Qe,x:()=>Ke,y:()=>Ze});var a={};r.r(a),r.d(a,{dmove:()=>dr,dx:()=>mr,dy:()=>pr,height:()=>gr,move:()=>yr,size:()=>br,width:()=>wr,x:()=>vr,y:()=>xr});const u={},h=[];function c(t,e){if(Array.isArray(t))for(const r of t)c(r,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const e in t)c(e,t[e])}function l(t){return u[t]||{}}function f(t){h.push(...t)}function d(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function m(t){return t%360*Math.PI/180}function p(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function y(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const b=new Set(["desc","metadata","title"]),w=t=>b.has(t.nodeName),v=(t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},x="http://www.w3.org/2000/svg",_="http://www.w3.org/2000/xmlns/",S="http://www.w3.org/1999/xlink",N={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class M{}const P={},O="___SYMBOL___ROOT___";function A(t,e=x){return N.document.createElementNS(e,t)}function C(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return T(t);if(null==t)return new P[O];if("string"==typeof t&&"<"!==t.charAt(0))return T(N.document.querySelector(t));const r=e?N.document.createElement("div"):A("svg");return r.innerHTML=t,t=T(r.firstChild),r.removeChild(r.firstChild),t}function E(t,e){return e&&(e instanceof N.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:A(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new P.Fragment(t);let e=p(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":P[e]||(e="Dom"),new P[e](t)}let T=j;function D(t,e=t.name,r=!1){return P[e]=t,r&&(P[O]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let k=1e3;function B(t){return"Svgjs"+p(t)+k++}function I(t){for(let e=t.children.length-1;e>=0;e--)I(t.children[e]);return t.id?(t.id=B(t.nodeName),t):t}function L(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function V(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}c("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=C(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=C(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=C(t)).before(this),this},insertAfter:function(t){return(t=C(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,Y=/\s/g,q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,U=/^rgb\(/,H=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,J=/[MLHVCSQTAZ]/i;function K(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Z(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function tt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),c("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,r){if(null==t)return this.data(d(function(t){let e;const r=t.length,n=[];for(e=0;e<r;e++)0===t[e].nodeName.indexOf("data-")&&n.push(t[e]);return n}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class et{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof et||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:r,round:n,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new et(t,e,n,"lch")}if("sine"===t){const t=n(80*i(2*s*(e=null==e?r():e)/.5+.01)+150),o=n(50*i(2*s*e/.5+4.6)+200),a=n(100*i(2*s*e/.5+2.3)+150);return new et(t,o,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new et(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new et(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new et(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new et(t,e,n,"lab")}if("grey"===t){const t=255*r();return new et(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(q.test(t)||U.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new et(0,0,0,1,"cmyk"):new et((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new et(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=Z(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Z(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Z(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Z(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Z(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Z(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(U.test(t)){const e=t.replace(Y,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=z.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new et(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new et(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new et(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new et(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*tt(i,n,t+1/3),o=255*tt(i,n,t),a=255*tt(i,n,t-1/3);return new et(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new et(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(K);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new et(f,d,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function nt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class it{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),m=d.x,p=d.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,px:m,py:p}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new it(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),m=Math.sin(l),p=(r*i+n*s)/u,g=i*c/(p*r-n)||s*c/(p*n+r);return{scaleX:c,scaleY:g,shear:p,rotate:f,translateX:o-t+t*d*c+e*(p*d*c-m*g),translateY:a-e+t*m*c+e*(p*m*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new it(t);return nt(this.a,e.a)&&nt(this.b,e.b)&&nt(this.c,e.c)&&nt(this.d,e.d)&&nt(this.e,e.e)&&nt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=it.fromArray([1,0,0,1,0,0]);return t=t instanceof Ot?t.matrixify():"string"==typeof t?it.fromArray(t.split(Q).map(parseFloat)):Array.isArray(t)?it.fromArray(t):"object"==typeof t&&it.isMatrixLike(t)?t:"object"==typeof t?(new it).transform(t):6===arguments.length?it.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=m(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:c}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-c*i+r*i-e*n+e,this.f=c*n+h*i-e*i-r*n+r,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:c,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=c+l*i-n*i,this.f=l+c*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(it.isMatrixLike(t))return new it(t).multiplyO(this);const e=it.formatTransforms(t),{x:r,y:n}=new rt(e.ox,e.oy).transform(this),i=(new it).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new rt(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function st(){if(!st.nodes){const t=C().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;st.nodes={svg:t,path:e}}if(!st.nodes.svg.node.parentNode){const t=N.document.body||N.document.documentElement;st.nodes.svg.addTo(t)}return st.nodes}function ot(t){return!(t.width||t.height||t.x||t.y)}D(it,"Matrix");class at{constructor(...t){this.init(...t)}addOffset(){return this.x+=N.window.pageXOffset,this.y+=N.window.pageYOffset,new at(this)}init(t){return t="string"==typeof t?t.split(Q).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ot(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new at(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof it||(t=new it(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new at(e,n,r-e,i-n)}}function ut(t,e,r){let n;try{if(n=e(t.node),ot(n)&&(i=t.node)!==N.document&&!(N.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===N.document}).call(N.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}c({viewbox:{viewbox(t,e,r,n){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new rt(r/2/s+i.x,n/2/o+i.y);const h=new at(i).transform(new it({scale:u,origin:e}));return this.viewbox(h)}}}),D(at,"Box");class ht extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const ct=ht;L([ht],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const lt=["toArray","constructor","each"];function ft(t,e){return new ct(d((e||N.document).querySelectorAll(t),(function(t){return j(t)})))}ht.extend=function(t){t=t.reduce(((t,e)=>(lt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),L([ht],t)};let dt=0;const mt={};function pt(t){let e=t.getEventHolder();return e===N.window&&(e=mt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,r,n,i){const s=r.bind(n||t),o=C(t),a=pt(o),u=gt(o);e=Array.isArray(e)?e:e.split(Q),r._svgjsListenerId||(r._svgjsListenerId=++dt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function bt(t,e,r,n){const i=C(t),s=pt(i),o=gt(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])bt(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&bt(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])bt(o,[e,u].join("."));delete s[e]}}else{for(t in s)bt(o,t);!function(t){let e=t.getEventHolder();e===N.window&&(e=mt),e.events&&(e.events={})}(i)}}))}class wt extends M{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=gt(t);return e instanceof N.window.Event||(e=new N.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return bt(this,t,e,r),this}on(t,e,r,n){return yt(this,t,e,r,n),this}removeEventListener(){}}function vt(){}D(wt,"EventTarget");const xt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class _t extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Q).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class St{constructor(...t){this.init(...t)}convert(t){return new St(this.value,t)}divide(t){return t=new St(t),new St(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof St&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new St(t),new St(this-t,this.unit||t.unit)}plus(t){return t=new St(t),new St(this+t,this.unit||t.unit)}times(t){return t=new St(t),new St(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Nt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Mt=[];class Pt extends wt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=C(t)).removeNamespace&&this.node instanceof N.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return C(t).put(this,e)}children(){return new ct(d(this.node.children,(function(t){return j(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let r=this.node.cloneNode(t);return e&&(r=I(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new Pt(A(t),e))}first(){return j(this.node.firstChild)}get(t){return j(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=B(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=C(t),this.add(t,e),t}putIn(t,e){return C(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=C(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,x)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=j(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=A("wrapper",r),i=N.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}L(Pt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=W.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?xt[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=Mt.reduce(((e,r)=>r(t,e,this)),e))?e=new St(e):Nt.has(t)&&et.isColor(e)?e=new et(e):e.constructor===Array&&(e=new _t(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return ft(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),D(Pt,"Dom");class Ot extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new St(t).plus(this.x()))}dy(t=0){return this.y(new St(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=C(t));const r=new ct;let n=this;for(;(n=n.parent())&&n.node!==N.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?C(e[1]):null}root(){const t=this.parent(P[O]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=g(this,t,e);return this.width(new St(r.width)).height(new St(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}L(Ot,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(st().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new at(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.height},point:function(t,e){return new rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new it(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new it(e)}return new it(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new it}}}),D(Ot,"Element");const At={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let r;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof et||et.isRgb(e)||e instanceof Ot)this.attr(t,e);else for(r=At[t].length-1;r>=0;r--)null!=e[At[t][r]]&&this.attr(At.prefix(t,At[t][r]),e[At[t][r]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new it(this):this.attr("transform",new it(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new St(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(it.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new it)},toParent:function(t,e){if(this===t)return this;if(w(this.node))return this.addTo(t,e);const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new it(this).decompose();return null==t?e:e[t]}it.isMatrixLike(t)||(t={...t,origin:y(t,this)});const r=new it(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class Ct extends Ot{flatten(){return this.each((function(){if(this instanceof Ct)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}D(Ct,"Container");class Et extends Ct{constructor(t,e=t){super(E("defs",t),e)}flatten(){return this}ungroup(){return this}}D(Et,"Defs");class jt extends Ot{}function Tt(t){return this.attr("rx",t)}function Dt(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Bt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Vt(t){return null==t?2*this.rx():this.rx(new St(t).divide(2))}function Ft(t){return null==t?2*this.ry():this.ry(new St(t).divide(2))}D(jt,"Shape");class zt extends jt{constructor(t,e=t){super(E("ellipse",t),e)}size(t,e){const r=g(this,t,e);return this.rx(new St(r.width).divide(2)).ry(new St(r.height).divide(2))}}L(zt,t),c("Container",{ellipse:V((function(t=0,e=t){return this.put(new zt).size(t,e).move(0,0)}))}),D(zt,"Ellipse");class Xt extends Pt{constructor(t=N.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(A("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}D(Xt,"Fragment");const Gt=Xt;function Rt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new St(t),fy:new St(e)}):this.attr({x1:new St(t),y1:new St(e)})}function Yt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new St(t),cy:new St(e)}):this.attr({x2:new St(t),y2:new St(e)})}class qt extends Ct{constructor(t,e){super(E(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}L(qt,e),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:V((function(t,e){return this.put(new qt(t)).update(e)}))}}),D(qt,"Gradient");class Ut extends Ct{constructor(t,e=t){super(E("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}c({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:V((function(t,e,r){return this.put(new Ut).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Ut,"Pattern");class Ht extends jt{constructor(t,e=t){super(E("image",t),e)}load(t,e){if(!t)return this;const r=new N.window.Image;return yt(r,"load",(function(t){const n=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof Ut&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(r,"load error",(function(){bt(r)})),this.attr("href",r.src=t,S)}}var Wt;Wt=function(t,e,r){return"fill"!==t&&"stroke"!==t||$.test(e)&&(e=r.root().defs().image(e)),e instanceof Ht&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Mt.push(Wt),c({Container:{image:V((function(t,e){return this.put(new Ht).size(0,0).load(t,e)}))}}),D(Ht,"Image");class $t extends _t{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new at(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e<r;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));for(let e=this.length;e--;){const[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}const Qt=$t;function Jt(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function Kt(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Zt(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function te(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class ee extends jt{constructor(t,e=t){super(E("line",t),e)}array(){return new $t([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new $t(t).toLine(),this.attr(t))}size(t,e){const r=g(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}L(ee,i),c({Container:{line:V((function(...t){return ee.prototype.plot.apply(this.put(new ee),null!=t[0]?t:[0,0,0,0])}))}}),D(ee,"Line");class re extends Ct{constructor(t,e=t){super(E("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ne(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:V((function(t,e,r){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),D(re,"Marker");const ie={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class se{done(){return!1}}class oe extends se{constructor(t=">"){super(),this.ease=ie[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class ae extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}L(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:ne("_duration",ue),overshoot:ne("_overshoot",ue)}),L(class extends ae{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ne("_windup"),p:ne("P"),i:ne("I"),d:ne("D")});const he={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let t=0,e=le.length;t<e;++t)ce[le[t]]=function(t){return function(e,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return ce[t](e,r,n)}}(le[t].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===he[t.segment[0].toUpperCase()]}function de(t,e){t.inNumber&&me(t,!1);const r=J.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function me(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fe(t)&&pe(t)}function pe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ge(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ye(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);class we extends _t{bbox(){return st().path.setAttribute("d",this.toString()),new at(st.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!de(i,n))if("."!==n)if(isNaN(parseInt(n)))if(be.has(n))i.inNumber&&me(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(J.test(n)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");pe(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ye(i)){me(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||ge(i)){i.inNumber=!0,i.number=n,me(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){me(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&pe(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const ve=t=>{const e=typeof t;return"number"===e?St:"string"===e?et.isColor(t)?et:Q.test(t)?J.test(t)?we:_t:F.test(t)?St:_e:Pe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?_t:"object"===e?Me:_e};class xe{constructor(t){this._stepper=t||new oe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ve(t));let e=new this._type(t);return this._type===et&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ne=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class Me{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===et&&t[r+7]!==e[r+7]){const e=t[r+7],n=new et(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=ve(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(Ne),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const Pe=[_e,Se,Me];class Oe extends jt{constructor(t,e=t){super(E("path",t),e)}array(){return this._array||(this._array=new we(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new we(t))}size(t,e){const r=g(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function Ae(){return this._array||(this._array=new $t(this.attr("points")))}function Ce(){return delete this._array,this}function Ee(t,e){return this.attr("points",this.array().move(t,e))}function je(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new $t(t))}function Te(t,e){const r=g(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}Oe.prototype.MorphArray=we,c({Container:{path:V((function(t){return this.put(new Oe).plot(t||new we)}))}}),D(Oe,"Path");class De extends jt{constructor(t,e=t){super(E("polygon",t),e)}}c({Container:{polygon:V((function(t){return this.put(new De).plot(t||new $t)}))}}),L(De,i),L(De,s),D(De,"Polygon");class ke extends jt{constructor(t,e=t){super(E("polyline",t),e)}}c({Container:{polyline:V((function(t){return this.put(new ke).plot(t||new $t)}))}}),L(ke,i),L(ke,s),D(ke,"Polyline");class Be extends jt{constructor(t,e=t){super(E("rect",t),e)}}L(Be,{rx:Tt,ry:Dt}),c({Container:{rect:V((function(t,e){return this.put(new Be).size(t,e)}))}}),D(Be,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>N.window.performance||N.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const r=Le.timer().now()+e,n=Le.timeouts.push({run:t,time:r});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),n},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const r=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==r););let n=null;const i=Le.frames.last();for(;n!==i&&(n=Le.frames.shift());)n.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?N.window.requestAnimationFrame(Le._draw):null}},Ve=Le,Fe=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},ze=function(){const t=N.window;return(t.performance||t.Date).now()};class Xe extends wt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Fe);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ge extends wt{constructor(t){super(),this.id=Ge.id++,t="function"==typeof(t=null==t?400:t)?new ae(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ae,this._stepper=this._isDeclarative?t:new oe,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new it,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e??0,r=r||"last","object"!=typeof(t=t??400)||t instanceof se||(e=t.delay??e,r=t.when??r,i=t.swing||i,n=t.times??n,s=t.wait??s,t=t.duration??400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=Ge.sanitise(t,e,r),i=new Ge(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new it,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new oe(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,r,n){return this._queue.push({initialiser:t||vt,runner:e||vt,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,r){if(t instanceof Xe||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new it,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Ge.id=0;class Re{constructor(t=new it,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}L([Ge,Re],{mergeWith(t){return new Re(t.transforms.lmultiply(this.transforms),t.id)}});const Ye=(t,e)=>t.lmultiplyO(e),qe=t=>t.transforms;function Ue(){const t=this._transformationRunners.runners.map(qe).reduce(Ye,new it);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class He{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Re).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}c({Element:{animate(t,e,r){const n=Ge.sanitise(t,e,r),i=this.timeline();return new Ge(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(qe).reduce(Ye,new it)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(Ue.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new He).add(new Re(new it(this))))}}}),L(Ge,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new xe(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Me(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Me(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new xe(this._stepper).to(new St(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=it.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new xe(this._stepper).type(r?Se:it);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||y(t,o),h=new it(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new rt(s).transform(o._currentTransform(this));let d=new it({...t,origin:[l,f]}),m=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),m=m.decompose(l,f);const t=d.rotate,e=m.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(m.rotate=u)),i.from(m),i.to(d);const p=i.at(c);return u=p.rotate,a=new it(p),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=y(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new St(e),this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new St(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new St(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new at(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),L(Ge,{rx:Tt,ry:Dt,from:Rt,to:Yt}),D(Ge,"Runner");class We extends Ct{constructor(t,e=t){super(E("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new Et):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof N.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:x,version:"1.1"}).attr("xmlns:xlink",S,_):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,_).attr("xmlns:svgjs",null,_)}root(){return this.isRoot()?this:super.root()}}c({Container:{nested:V((function(){return this.put(new We)}))}}),D(We,"Svg",!0);class $e extends Ct{constructor(t,e=t){super(E("symbol",t),e)}}function Qe(t){return!1===this._build&&this.clear(),this.node.appendChild(N.document.createTextNode(t)),this}function Je(){return this.node.getComputedTextLength()}function Ke(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Ze(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function tr(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function er(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function rr(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function nr(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function ir(t){return this.attr("x",t)}function sr(t){return this.attr("y",t)}function or(t,e){return this.ax(t).ay(e)}function ar(t){return this._build=!!t,this}c({Container:{symbol:V((function(){return this.put(new $e)}))}}),D($e,"Symbol");class ur extends jt{constructor(t,e=t){super(E("text",t),e),this.dom.leading=this.dom.leading??new St(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new St(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){if(w(this.node))return;const i=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new St(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new St(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"===e[n].nodeName||w(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===j(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}L(ur,o),c({Container:{text:V((function(t=""){return this.put(new ur).text(t)})),plain:V((function(t=""){return this.put(new ur).plain(t)}))}}),D(ur,"Text");class hr extends jt{constructor(t,e=t){super(E("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ur))return this;const e=t.index(this),r=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new St(r);return this.dy(e?n:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}L(hr,o),c({Tspan:{tspan:V((function(t=""){const e=new hr;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),D(hr,"Tspan");class cr extends jt{constructor(t,e=t){super(E("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new St(t).divide(2))}}L(cr,{x:kt,y:Bt,cx:It,cy:Lt,width:Vt,height:Ft}),c({Container:{circle:V((function(t=0){return this.put(new cr).size(t).move(0,0)}))}}),D(cr,"Circle");class lr extends Ct{constructor(t,e=t){super(E("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return ft("svg [clip-path*="+this.id()+"]")}}c({Container:{clip:V((function(){return this.defs().put(new lr)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lr?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),D(lr,"ClipPath");class fr extends Ot{constructor(t,e=t){super(E("foreignObject",t),e)}}function dr(t,e){return this.children().forEach((r=>{let n;try{n=r.node instanceof N.window.SVGSVGElement?new at(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new it(r),s=i.translate(t,e).transform(i.inverse()),o=new rt(n.x,n.y).transform(s);r.move(o.x,o.y)})),this}function mr(t){return this.dmove(t,0)}function pr(t){return this.dmove(0,t)}function gr(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function yr(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function br(t,e,r=this.bbox()){const n=g(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach((t=>{const e=new rt(r).transform(new it(t).inverse());t.scale(i,s,e.x,e.y)})),this}function wr(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function vr(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function xr(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}c({Container:{foreignObject:V((function(t,e){return this.put(new fr).size(t,e)}))}}),D(fr,"ForeignObject");class _r extends Ct{constructor(t,e=t){super(E("g",t),e)}}L(_r,a),c({Container:{group:V((function(){return this.put(new _r)}))}}),D(_r,"G");class Sr extends Ct{constructor(t,e=t){super(E("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,S)}}L(Sr,a),c({Container:{link:V((function(t){return this.put(new Sr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Sr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),D(Sr,"A");class Nr extends Ct{constructor(t,e=t){super(E("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return ft("svg [mask*="+this.id()+"]")}}c({Container:{mask:V((function(){return this.defs().put(new Nr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Nr?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),D(Nr,"Mask");class Mr extends Ot{constructor(t,e=t){super(E("stop",t),e)}update(t){return("number"==typeof t||t instanceof St)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new St(t.offset)),this}}c({Gradient:{stop:function(t,e,r){return this.put(new Mr).update(t,e,r)}}}),D(Mr,"Stop");class Pr extends Ot{constructor(t,e=t){super(E("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}c("Dom",{style(t,e){return this.put(new Pr).rule(t,e)},fontface(t,e,r){return this.put(new Pr).font(t,e,r)}}),D(Pr,"Style");class Or extends ur{constructor(t,e=t){super(E("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}c({Container:{textPath:V((function(t,e){return t instanceof ur||(t=this.text(t)),t.path(e)}))},Text:{path:V((function(t,e=!0){const r=new Or;let n;if(t instanceof Oe||(t=this.defs().path(t)),r.attr("href","#"+t,S),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:V((function(t){return t instanceof ur||(t=(new ur).addTo(this.parent()).text(t)),t.path(this)})),targets(){return ft("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Or.prototype.MorphArray=we,D(Or,"TextPath");class Ar extends jt{constructor(t,e=t){super(E("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,S)}}c({Container:{use:V((function(t,e){return this.put(new Ar).use(t,e)}))}}),D(Ar,"Use"),L([We,$e,Ht,Ut,re],l("viewbox")),L([ee,ke,De,Oe],l("marker")),L(ur,l("Text")),L(Oe,l("Path")),L(Et,l("Defs")),L([ur,hr],l("Tspan")),L([Be,zt,qt,Ge],l("radius")),L(wt,l("EventTarget")),L(Pt,l("Dom")),L(Ot,l("Element")),L(jt,l("Shape")),L([Ct,Gt],l("Container")),L(qt,l("Gradient")),L(Ge,l("Runner")),ct.extend([...new Set(h)]),function(t=[]){Pe.push(...[].concat(t))}([St,et,at,it,_t,$t,we,rt]),L(Pe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Cr=r(726),Er=r(725),jr=r(854);const Tr=["basePadding1","basePadding2"],Dr={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"};class kr{static between(t,e){let r=(new ee).node,n=new kr(r,t,e);return n.assignUUID(),n.set(kr.defaultValues),n.reposition(),n}constructor(t,e,r){this.line=t,this.base1=e,this.base2=r,this.cachedBasePadding1=(0,Er.distance)(this.point1,this.base1.centerPoint),this.cachedBasePadding2=(0,Er.distance)(this.point2,this.base2.centerPoint),e.centerPoint.addEventListener("move",(()=>this.reposition())),r.centerPoint.addEventListener("move",(()=>this.reposition()))}get basePair(){return[this.base1,this.base2]}get domNode(){return this.line}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){if((0,jr.isNonNullObject)(t))try{new ee(this.domNode).attr(t)}catch(t){}}get id(){return this.domNode.id}assignUUID(){(0,Cr.assignUUID)(this.domNode)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}getTotalLength(){return this.domNode.getTotalLength()}getPointAtLength(t){return this.domNode.getPointAtLength(t)}get point1(){return{x:this.domNode.x1.baseVal.value,y:this.domNode.y1.baseVal.value}}get point2(){return{x:this.domNode.x2.baseVal.value,y:this.domNode.y2.baseVal.value}}get basePadding1(){return this.cachedBasePadding1}set basePadding1(t){this.cachedBasePadding1=t,this.reposition()}setBasePadding1(t){(0,jr.isFiniteNumber)(t)&&(this.basePadding1=Math.max(0,t))}get basePadding2(){return this.cachedBasePadding2}set basePadding2(t){this.cachedBasePadding2=t,this.reposition()}setBasePadding2(t){(0,jr.isFiniteNumber)(t)&&(this.basePadding2=Math.max(0,t))}isInverted(){return this.basePadding1+this.basePadding2>(0,Er.distance)(this.base1.centerPoint,this.base2.centerPoint)}set(t){try{this.setAttributes(t.attributes)}catch(t){}Tr.forEach((e=>{try{this[Dr[e]](t[e])}catch(t){}}))}reposition(){let t=this.base1.centerPoint,e=this.base2.centerPoint,r=(0,Er.direction)(t,e);this.setAttribute("x1",`${t.x+this.basePadding1*Math.cos(r)}`),this.setAttribute("y1",`${t.y+this.basePadding1*Math.sin(r)}`),this.setAttribute("x2",""+(e.x-this.basePadding2*Math.cos(r))),this.setAttribute("y2",""+(e.y-this.basePadding2*Math.sin(r)))}serialized(){let t=this.id;if(!t)throw new Error("Straight bond ID is falsy.");let e=this.base1.id;if(!e)throw new Error("Base 1 ID is falsy.");let r=this.base2.id;if(!r)throw new Error("Base 2 ID is falsy.");return{id:t,baseID1:e,baseID2:r,basePadding1:this.basePadding1,basePadding2:this.basePadding2}}static deserialized(t,e){var r,n,i;if(!(0,jr.isNonNullObject)(t))throw new Error("Saved straight bond must be an object.");let s=null!==(r=t.id)&&void 0!==r?r:t.lineId;if(!s)throw new Error("Straight bond ID is missing.");let o=e.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find straight bond DOM node.");if(!(o instanceof SVGLineElement))throw new Error("Straight bond DOM node must be an SVG line element.");let a=null!==(n=t.baseID1)&&void 0!==n?n:t.baseId1,u=null!==(i=t.baseID2)&&void 0!==i?i:t.baseId2;if(!a)throw new Error("Missing base 1 ID.");if(!u)throw new Error("Missing base 2 ID.");let h=[...e.bases].find((t=>t.id===a)),c=[...e.bases].find((t=>t.id===u));if(!h)throw new Error("Unable to find base 1.");if(!c)throw new Error("Unable to find base 2.");let l=new kr(o,h,c);return(0,jr.isNumber)(t.basePadding1)&&(l.basePadding1=t.basePadding1),(0,jr.isNumber)(t.basePadding2)&&(l.basePadding2=t.basePadding2),l}}kr.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6};class Br{constructor(t,e){this.targetStraightBonds=t,new MutationObserver((t=>{let e=new Set([...this.targetStraightBonds].map((t=>t.domNode)));!t.some((t=>e.has(t.target)))||this.updateOpacities()})).observe(e,{attributes:!0,attributeFilter:["x1","y1","x2","y2"],subtree:!0})}updateOpacities(){[...this.targetStraightBonds].forEach((t=>{let e=t.isInverted()?"0":"1";t.setAttribute("opacity",e)}))}}})(),n})(),t.exports=e()},297:function(t){var e;e=()=>(()=>{var t={106:function(t){var e;e=()=>(()=>{var t={992:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{KeyBinding:()=>m});var r,n,i,s,o,a,u,h,c,l,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class m{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,(t=>d(this,r,"m",l).call(this,t)),"f"),f(this,s,a,"f")}get owner(){return d(this,o,"f")}set owner(t){var e;null===(e=d(this,o,"f"))||void 0===e||e.removeEventListener("keydown",d(this,i,"f")),null==t||t.addEventListener("keydown",d(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&t.key.toUpperCase()===this.key.toUpperCase()&&t.altKey===d(this,r,"a",a)&&t.ctrlKey===d(this,r,"a",u)&&t.metaKey===d(this,r,"a",h)&&t.shiftKey===d(this,r,"a",c)&&(t.preventDefault(),d(this,n,"f").call(this))},e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t){return t.split(/\r\n|\r|\n/)}function e(t){try{return JSON.stringify(t),!0}catch(t){return!1}}function i(t){return t.map((t=>({v:t,priority:Math.random()}))).sort(((t,e)=>t.priority-e.priority)).map((({v:t})=>t))}function s(t){return t===document.activeElement}function o(t){return!!document.activeElement&&t.contains(document.activeElement)}r.r(n),r.d(n,{DownloadableFile:()=>h,EventfulSet:()=>c,FiniteStack:()=>g,KeyBinding:()=>a.KeyBinding,containsFocus:()=>o,detectMacOS:()=>u,hasFocus:()=>s,isJSONSerializable:()=>e,isURL:()=>y,shuffled:()=>i,splitLines:()=>t});var a=r(992);function u(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}class h{constructor(t){this.textContent=t}downloadAs(t,e){let r=new File([this.textContent],t,{type:e.type}),n=URL.createObjectURL(r),i=document.createElement("a");i.href=n,i.download=r.name,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(n)}}class c{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}includes(t){return this.underlyingSet.has(t)}include(t){return this.includes(t)}addAll(t){let e=[...t];0!=e.length&&(e.every((t=>this.includes(t)))||(e.forEach((t=>this.underlyingSet.add(t))),this.callEventListeners("change")))}removeAll(t){let e=[...t];0!=e.length&&(e.every((t=>!this.includes(t)))||(e.forEach((t=>this.underlyingSet.delete(t))),this.callEventListeners("change")))}clear(){0!=this.underlyingSet.size&&(this.underlyingSet.clear(),this.callEventListeners("change"))}addEventListener(t,e){this.eventListeners[t].push(e)}callEventListeners(t){this.eventListeners[t].forEach((t=>t()))}removeEventListener(t,e){this.eventListeners[t]=this.eventListeners[t].filter((t=>t!==e))}}var l,f,d,m,p=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class g{constructor(t){l.add(this),this.maxSize=t,f.set(this,[]),d.set(this,{change:[]})}get size(){return p(this,f,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,f),p(this,l,"m",m).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return p(this,f,"f")[p(this,f,"f").length-1]}push(t){p(this,f,"f").push(t),this.size>this.maxSize&&p(this,f,"f").shift(),p(this,l,"m",m).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=p(this,f,"f").pop();return p(this,l,"m",m).call(this,"change"),t}addEventListener(t,e){p(this,d,"f")[t].push(e)}removeEventListener(t,e){p(this,d,"f")[t]=p(this,d,"f")[t].filter((t=>t!==e))}}function y(t){try{return new URL(t),!0}catch(t){return!1}}f=new WeakMap,d=new WeakMap,l=new WeakSet,m=function(t){p(this,d,"f")[t].forEach((t=>t()))}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{parseCT:()=>e});var t=r(106);function e(e){let r=function(t){let e=t.findIndex((t=>!i(t)&&!s(t)));if(e<0)throw new Error("Unable to find the start of the structure.");let r=[...t].reverse().findIndex((t=>!i(t)&&!s(t)));if(r<0)throw new Error("Unable to find the end of the structure.");return r=t.length-r-1,t.slice(e,r+1)}((0,t.splitLines)(e));return{description:o(r),sequence:a(r),positionPairs:u(r),numberingOffset:h(r)}}function i(t){return 0==t.trim().length}function s(t){return"#"==t.trim().charAt(0)}function o(t){if(0==t.length)return;let e=t[0],r=c(e);if(r.length<2)return;let n=r[0];return e.slice(e.indexOf(n)+n.length).trim()}function a(t){return t.slice(1).map((t=>{let e=c(t);if(e.length<2)throw new Error("Line is missing a character.");return e[1]})).join("")}function u(t){let e=t.slice(1),r=[];return e.forEach(((t,e)=>{let n=e+1,i=c(t);if(i.length>=5){let t=Number.parseFloat(i[4]);if(Number.isNaN(t))throw new Error("Partner positions must be numbers.");if(!Number.isInteger(t))throw new Error("Partner positions must be integers.");0!=t&&n<=t&&r.push([n,t])}})),r}function h(t){if(t.length<2)return 0;let e=c(t[1]);if(e.length<6)return 0;let r=Number.parseFloat(e[5]);return Number.isNaN(r)?0:Number.isInteger(r)?r-1:0}function c(t){return function(t){return t.split(/\s/)}(t).filter(l)}function l(t){return t.length>0}})(),n})(),t.exports=e()},358:function(t){var e;e=()=>(()=>{var t={731:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{CenterPoint:()=>h});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver((()=>u(this,r,"m",o).call(this,"move"))),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter((t=>t!==e))}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach((t=>t()))},e})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}r.r(n),r.d(n,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,isSVGGraphicsElement:()=>S,isSVGGraphicsElementsArray:()=>M,sendToBack:()=>g,setAttributes:()=>t});const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,r,n){if(e.randomUUID&&!r&&!t)return e.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,r){n=n||0;for(var s=0;s<16;++s)r[n+s]=i[s];return r}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function S(t){return t instanceof SVGGraphicsElement}v=new WeakMap;var N=r(854);function M(t){return(0,N.isArray)(t)&&t.every(S)}})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BasePair:()=>kr,Nucleobase:()=>Dr});var t={};r.r(t),r.d(t,{cx:()=>It,cy:()=>Lt,height:()=>Ft,rx:()=>Tt,ry:()=>Dt,width:()=>Vt,x:()=>kt,y:()=>Bt});var e={};r.r(e),r.d(e,{from:()=>Rt,to:()=>Yt});var i={};r.r(i),r.d(i,{MorphArray:()=>Qt,height:()=>te,width:()=>Zt,x:()=>Jt,y:()=>Kt});var s={};r.r(s),r.d(s,{array:()=>Ae,clear:()=>Ce,move:()=>Ee,plot:()=>je,size:()=>Te});var o={};r.r(o),r.d(o,{amove:()=>or,ax:()=>ir,ay:()=>sr,build:()=>ar,center:()=>nr,cx:()=>er,cy:()=>rr,length:()=>Je,move:()=>tr,plain:()=>Qe,x:()=>Ke,y:()=>Ze});var a={};r.r(a),r.d(a,{dmove:()=>dr,dx:()=>mr,dy:()=>pr,height:()=>gr,move:()=>yr,size:()=>br,width:()=>wr,x:()=>vr,y:()=>xr});const u={},h=[];function c(t,e){if(Array.isArray(t))for(const r of t)c(r,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const e in t)c(e,t[e])}function l(t){return u[t]||{}}function f(t){h.push(...t)}function d(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function m(t){return t%360*Math.PI/180}function p(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function y(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const b=new Set(["desc","metadata","title"]),w=t=>b.has(t.nodeName),v=(t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},x="http://www.w3.org/2000/svg",_="http://www.w3.org/2000/xmlns/",S="http://www.w3.org/1999/xlink",N={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class M{}const P={},O="___SYMBOL___ROOT___";function A(t,e=x){return N.document.createElementNS(e,t)}function C(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return T(t);if(null==t)return new P[O];if("string"==typeof t&&"<"!==t.charAt(0))return T(N.document.querySelector(t));const r=e?N.document.createElement("div"):A("svg");return r.innerHTML=t,t=T(r.firstChild),r.removeChild(r.firstChild),t}function E(t,e){return e&&(e instanceof N.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:A(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new P.Fragment(t);let e=p(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":P[e]||(e="Dom"),new P[e](t)}let T=j;function D(t,e=t.name,r=!1){return P[e]=t,r&&(P[O]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let k=1e3;function B(t){return"Svgjs"+p(t)+k++}function I(t){for(let e=t.children.length-1;e>=0;e--)I(t.children[e]);return t.id?(t.id=B(t.nodeName),t):t}function L(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function V(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}c("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=C(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=C(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=C(t)).before(this),this},insertAfter:function(t){return(t=C(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,Y=/\s/g,q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,U=/^rgb\(/,H=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,J=/[MLHVCSQTAZ]/i;function K(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Z(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function tt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),c("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,r){if(null==t)return this.data(d(function(t){let e;const r=t.length,n=[];for(e=0;e<r;e++)0===t[e].nodeName.indexOf("data-")&&n.push(t[e]);return n}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class et{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof et||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:r,round:n,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new et(t,e,n,"lch")}if("sine"===t){const t=n(80*i(2*s*(e=null==e?r():e)/.5+.01)+150),o=n(50*i(2*s*e/.5+4.6)+200),a=n(100*i(2*s*e/.5+2.3)+150);return new et(t,o,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new et(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new et(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new et(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new et(t,e,n,"lab")}if("grey"===t){const t=255*r();return new et(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(q.test(t)||U.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new et(0,0,0,1,"cmyk"):new et((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new et(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=Z(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Z(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Z(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Z(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Z(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Z(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(U.test(t)){const e=t.replace(Y,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=z.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new et(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new et(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new et(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new et(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*tt(i,n,t+1/3),o=255*tt(i,n,t),a=255*tt(i,n,t-1/3);return new et(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new et(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(K);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new et(f,d,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function nt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class it{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),m=d.x,p=d.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,px:m,py:p}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new it(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),m=Math.sin(l),p=(r*i+n*s)/u,g=i*c/(p*r-n)||s*c/(p*n+r);return{scaleX:c,scaleY:g,shear:p,rotate:f,translateX:o-t+t*d*c+e*(p*d*c-m*g),translateY:a-e+t*m*c+e*(p*m*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new it(t);return nt(this.a,e.a)&&nt(this.b,e.b)&&nt(this.c,e.c)&&nt(this.d,e.d)&&nt(this.e,e.e)&&nt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=it.fromArray([1,0,0,1,0,0]);return t=t instanceof Ot?t.matrixify():"string"==typeof t?it.fromArray(t.split(Q).map(parseFloat)):Array.isArray(t)?it.fromArray(t):"object"==typeof t&&it.isMatrixLike(t)?t:"object"==typeof t?(new it).transform(t):6===arguments.length?it.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=m(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:c}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-c*i+r*i-e*n+e,this.f=c*n+h*i-e*i-r*n+r,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:c,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=c+l*i-n*i,this.f=l+c*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(it.isMatrixLike(t))return new it(t).multiplyO(this);const e=it.formatTransforms(t),{x:r,y:n}=new rt(e.ox,e.oy).transform(this),i=(new it).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new rt(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function st(){if(!st.nodes){const t=C().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;st.nodes={svg:t,path:e}}if(!st.nodes.svg.node.parentNode){const t=N.document.body||N.document.documentElement;st.nodes.svg.addTo(t)}return st.nodes}function ot(t){return!(t.width||t.height||t.x||t.y)}D(it,"Matrix");class at{constructor(...t){this.init(...t)}addOffset(){return this.x+=N.window.pageXOffset,this.y+=N.window.pageYOffset,new at(this)}init(t){return t="string"==typeof t?t.split(Q).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ot(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new at(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof it||(t=new it(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new at(e,n,r-e,i-n)}}function ut(t,e,r){let n;try{if(n=e(t.node),ot(n)&&(i=t.node)!==N.document&&!(N.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===N.document}).call(N.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}c({viewbox:{viewbox(t,e,r,n){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new rt(r/2/s+i.x,n/2/o+i.y);const h=new at(i).transform(new it({scale:u,origin:e}));return this.viewbox(h)}}}),D(at,"Box");class ht extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const ct=ht;L([ht],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const lt=["toArray","constructor","each"];function ft(t,e){return new ct(d((e||N.document).querySelectorAll(t),(function(t){return j(t)})))}ht.extend=function(t){t=t.reduce(((t,e)=>(lt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),L([ht],t)};let dt=0;const mt={};function pt(t){let e=t.getEventHolder();return e===N.window&&(e=mt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,r,n,i){const s=r.bind(n||t),o=C(t),a=pt(o),u=gt(o);e=Array.isArray(e)?e:e.split(Q),r._svgjsListenerId||(r._svgjsListenerId=++dt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function bt(t,e,r,n){const i=C(t),s=pt(i),o=gt(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])bt(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&bt(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])bt(o,[e,u].join("."));delete s[e]}}else{for(t in s)bt(o,t);!function(t){let e=t.getEventHolder();e===N.window&&(e=mt),e.events&&(e.events={})}(i)}}))}class wt extends M{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=gt(t);return e instanceof N.window.Event||(e=new N.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return bt(this,t,e,r),this}on(t,e,r,n){return yt(this,t,e,r,n),this}removeEventListener(){}}function vt(){}D(wt,"EventTarget");const xt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class _t extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Q).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class St{constructor(...t){this.init(...t)}convert(t){return new St(this.value,t)}divide(t){return t=new St(t),new St(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof St&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new St(t),new St(this-t,this.unit||t.unit)}plus(t){return t=new St(t),new St(this+t,this.unit||t.unit)}times(t){return t=new St(t),new St(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Nt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Mt=[];class Pt extends wt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=C(t)).removeNamespace&&this.node instanceof N.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return C(t).put(this,e)}children(){return new ct(d(this.node.children,(function(t){return j(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let r=this.node.cloneNode(t);return e&&(r=I(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new Pt(A(t),e))}first(){return j(this.node.firstChild)}get(t){return j(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=B(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=C(t),this.add(t,e),t}putIn(t,e){return C(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=C(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,x)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=j(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=A("wrapper",r),i=N.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}L(Pt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=W.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?xt[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=Mt.reduce(((e,r)=>r(t,e,this)),e))?e=new St(e):Nt.has(t)&&et.isColor(e)?e=new et(e):e.constructor===Array&&(e=new _t(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return ft(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),D(Pt,"Dom");class Ot extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new St(t).plus(this.x()))}dy(t=0){return this.y(new St(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=C(t));const r=new ct;let n=this;for(;(n=n.parent())&&n.node!==N.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?C(e[1]):null}root(){const t=this.parent(P[O]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=g(this,t,e);return this.width(new St(r.width)).height(new St(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}L(Ot,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(st().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new at(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.height},point:function(t,e){return new rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new it(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new it(e)}return new it(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new it}}}),D(Ot,"Element");const At={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let r;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof et||et.isRgb(e)||e instanceof Ot)this.attr(t,e);else for(r=At[t].length-1;r>=0;r--)null!=e[At[t][r]]&&this.attr(At.prefix(t,At[t][r]),e[At[t][r]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new it(this):this.attr("transform",new it(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new St(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(it.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new it)},toParent:function(t,e){if(this===t)return this;if(w(this.node))return this.addTo(t,e);const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new it(this).decompose();return null==t?e:e[t]}it.isMatrixLike(t)||(t={...t,origin:y(t,this)});const r=new it(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class Ct extends Ot{flatten(){return this.each((function(){if(this instanceof Ct)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}D(Ct,"Container");class Et extends Ct{constructor(t,e=t){super(E("defs",t),e)}flatten(){return this}ungroup(){return this}}D(Et,"Defs");class jt extends Ot{}function Tt(t){return this.attr("rx",t)}function Dt(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Bt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Vt(t){return null==t?2*this.rx():this.rx(new St(t).divide(2))}function Ft(t){return null==t?2*this.ry():this.ry(new St(t).divide(2))}D(jt,"Shape");class zt extends jt{constructor(t,e=t){super(E("ellipse",t),e)}size(t,e){const r=g(this,t,e);return this.rx(new St(r.width).divide(2)).ry(new St(r.height).divide(2))}}L(zt,t),c("Container",{ellipse:V((function(t=0,e=t){return this.put(new zt).size(t,e).move(0,0)}))}),D(zt,"Ellipse");class Xt extends Pt{constructor(t=N.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(A("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}D(Xt,"Fragment");const Gt=Xt;function Rt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new St(t),fy:new St(e)}):this.attr({x1:new St(t),y1:new St(e)})}function Yt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new St(t),cy:new St(e)}):this.attr({x2:new St(t),y2:new St(e)})}class qt extends Ct{constructor(t,e){super(E(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}L(qt,e),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:V((function(t,e){return this.put(new qt(t)).update(e)}))}}),D(qt,"Gradient");class Ut extends Ct{constructor(t,e=t){super(E("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}c({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:V((function(t,e,r){return this.put(new Ut).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Ut,"Pattern");class Ht extends jt{constructor(t,e=t){super(E("image",t),e)}load(t,e){if(!t)return this;const r=new N.window.Image;return yt(r,"load",(function(t){const n=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof Ut&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(r,"load error",(function(){bt(r)})),this.attr("href",r.src=t,S)}}var Wt;Wt=function(t,e,r){return"fill"!==t&&"stroke"!==t||$.test(e)&&(e=r.root().defs().image(e)),e instanceof Ht&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Mt.push(Wt),c({Container:{image:V((function(t,e){return this.put(new Ht).size(0,0).load(t,e)}))}}),D(Ht,"Image");class $t extends _t{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new at(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e<r;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));for(let e=this.length;e--;){const[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}const Qt=$t;function Jt(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function Kt(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Zt(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function te(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class ee extends jt{constructor(t,e=t){super(E("line",t),e)}array(){return new $t([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new $t(t).toLine(),this.attr(t))}size(t,e){const r=g(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}L(ee,i),c({Container:{line:V((function(...t){return ee.prototype.plot.apply(this.put(new ee),null!=t[0]?t:[0,0,0,0])}))}}),D(ee,"Line");class re extends Ct{constructor(t,e=t){super(E("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ne(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:V((function(t,e,r){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),D(re,"Marker");const ie={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class se{done(){return!1}}class oe extends se{constructor(t=">"){super(),this.ease=ie[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class ae extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}L(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:ne("_duration",ue),overshoot:ne("_overshoot",ue)}),L(class extends ae{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ne("_windup"),p:ne("P"),i:ne("I"),d:ne("D")});const he={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let t=0,e=le.length;t<e;++t)ce[le[t]]=function(t){return function(e,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return ce[t](e,r,n)}}(le[t].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===he[t.segment[0].toUpperCase()]}function de(t,e){t.inNumber&&me(t,!1);const r=J.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function me(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fe(t)&&pe(t)}function pe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ge(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ye(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);class we extends _t{bbox(){return st().path.setAttribute("d",this.toString()),new at(st.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!de(i,n))if("."!==n)if(isNaN(parseInt(n)))if(be.has(n))i.inNumber&&me(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(J.test(n)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");pe(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ye(i)){me(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||ge(i)){i.inNumber=!0,i.number=n,me(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){me(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&pe(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const ve=t=>{const e=typeof t;return"number"===e?St:"string"===e?et.isColor(t)?et:Q.test(t)?J.test(t)?we:_t:F.test(t)?St:_e:Pe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?_t:"object"===e?Me:_e};class xe{constructor(t){this._stepper=t||new oe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ve(t));let e=new this._type(t);return this._type===et&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ne=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class Me{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===et&&t[r+7]!==e[r+7]){const e=t[r+7],n=new et(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=ve(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(Ne),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const Pe=[_e,Se,Me];class Oe extends jt{constructor(t,e=t){super(E("path",t),e)}array(){return this._array||(this._array=new we(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new we(t))}size(t,e){const r=g(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function Ae(){return this._array||(this._array=new $t(this.attr("points")))}function Ce(){return delete this._array,this}function Ee(t,e){return this.attr("points",this.array().move(t,e))}function je(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new $t(t))}function Te(t,e){const r=g(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}Oe.prototype.MorphArray=we,c({Container:{path:V((function(t){return this.put(new Oe).plot(t||new we)}))}}),D(Oe,"Path");class De extends jt{constructor(t,e=t){super(E("polygon",t),e)}}c({Container:{polygon:V((function(t){return this.put(new De).plot(t||new $t)}))}}),L(De,i),L(De,s),D(De,"Polygon");class ke extends jt{constructor(t,e=t){super(E("polyline",t),e)}}c({Container:{polyline:V((function(t){return this.put(new ke).plot(t||new $t)}))}}),L(ke,i),L(ke,s),D(ke,"Polyline");class Be extends jt{constructor(t,e=t){super(E("rect",t),e)}}L(Be,{rx:Tt,ry:Dt}),c({Container:{rect:V((function(t,e){return this.put(new Be).size(t,e)}))}}),D(Be,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>N.window.performance||N.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const r=Le.timer().now()+e,n=Le.timeouts.push({run:t,time:r});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),n},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const r=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==r););let n=null;const i=Le.frames.last();for(;n!==i&&(n=Le.frames.shift());)n.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?N.window.requestAnimationFrame(Le._draw):null}},Ve=Le,Fe=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},ze=function(){const t=N.window;return(t.performance||t.Date).now()};class Xe extends wt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Fe);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ge extends wt{constructor(t){super(),this.id=Ge.id++,t="function"==typeof(t=null==t?400:t)?new ae(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ae,this._stepper=this._isDeclarative?t:new oe,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new it,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e??0,r=r||"last","object"!=typeof(t=t??400)||t instanceof se||(e=t.delay??e,r=t.when??r,i=t.swing||i,n=t.times??n,s=t.wait??s,t=t.duration??400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=Ge.sanitise(t,e,r),i=new Ge(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new it,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new oe(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,r,n){return this._queue.push({initialiser:t||vt,runner:e||vt,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,r){if(t instanceof Xe||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new it,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Ge.id=0;class Re{constructor(t=new it,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}L([Ge,Re],{mergeWith(t){return new Re(t.transforms.lmultiply(this.transforms),t.id)}});const Ye=(t,e)=>t.lmultiplyO(e),qe=t=>t.transforms;function Ue(){const t=this._transformationRunners.runners.map(qe).reduce(Ye,new it);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class He{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Re).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}c({Element:{animate(t,e,r){const n=Ge.sanitise(t,e,r),i=this.timeline();return new Ge(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(qe).reduce(Ye,new it)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(Ue.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new He).add(new Re(new it(this))))}}}),L(Ge,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new xe(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Me(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Me(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new xe(this._stepper).to(new St(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=it.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new xe(this._stepper).type(r?Se:it);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||y(t,o),h=new it(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new rt(s).transform(o._currentTransform(this));let d=new it({...t,origin:[l,f]}),m=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),m=m.decompose(l,f);const t=d.rotate,e=m.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(m.rotate=u)),i.from(m),i.to(d);const p=i.at(c);return u=p.rotate,a=new it(p),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=y(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new St(e),this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new St(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new St(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new at(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),L(Ge,{rx:Tt,ry:Dt,from:Rt,to:Yt}),D(Ge,"Runner");class We extends Ct{constructor(t,e=t){super(E("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new Et):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof N.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:x,version:"1.1"}).attr("xmlns:xlink",S,_):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,_).attr("xmlns:svgjs",null,_)}root(){return this.isRoot()?this:super.root()}}c({Container:{nested:V((function(){return this.put(new We)}))}}),D(We,"Svg",!0);class $e extends Ct{constructor(t,e=t){super(E("symbol",t),e)}}function Qe(t){return!1===this._build&&this.clear(),this.node.appendChild(N.document.createTextNode(t)),this}function Je(){return this.node.getComputedTextLength()}function Ke(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Ze(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function tr(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function er(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function rr(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function nr(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function ir(t){return this.attr("x",t)}function sr(t){return this.attr("y",t)}function or(t,e){return this.ax(t).ay(e)}function ar(t){return this._build=!!t,this}c({Container:{symbol:V((function(){return this.put(new $e)}))}}),D($e,"Symbol");class ur extends jt{constructor(t,e=t){super(E("text",t),e),this.dom.leading=this.dom.leading??new St(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new St(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){if(w(this.node))return;const i=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new St(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new St(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"===e[n].nodeName||w(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===j(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}L(ur,o),c({Container:{text:V((function(t=""){return this.put(new ur).text(t)})),plain:V((function(t=""){return this.put(new ur).plain(t)}))}}),D(ur,"Text");class hr extends jt{constructor(t,e=t){super(E("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ur))return this;const e=t.index(this),r=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new St(r);return this.dy(e?n:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}L(hr,o),c({Tspan:{tspan:V((function(t=""){const e=new hr;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),D(hr,"Tspan");class cr extends jt{constructor(t,e=t){super(E("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new St(t).divide(2))}}L(cr,{x:kt,y:Bt,cx:It,cy:Lt,width:Vt,height:Ft}),c({Container:{circle:V((function(t=0){return this.put(new cr).size(t).move(0,0)}))}}),D(cr,"Circle");class lr extends Ct{constructor(t,e=t){super(E("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return ft("svg [clip-path*="+this.id()+"]")}}c({Container:{clip:V((function(){return this.defs().put(new lr)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lr?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),D(lr,"ClipPath");class fr extends Ot{constructor(t,e=t){super(E("foreignObject",t),e)}}function dr(t,e){return this.children().forEach((r=>{let n;try{n=r.node instanceof N.window.SVGSVGElement?new at(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new it(r),s=i.translate(t,e).transform(i.inverse()),o=new rt(n.x,n.y).transform(s);r.move(o.x,o.y)})),this}function mr(t){return this.dmove(t,0)}function pr(t){return this.dmove(0,t)}function gr(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function yr(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function br(t,e,r=this.bbox()){const n=g(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach((t=>{const e=new rt(r).transform(new it(t).inverse());t.scale(i,s,e.x,e.y)})),this}function wr(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function vr(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function xr(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}c({Container:{foreignObject:V((function(t,e){return this.put(new fr).size(t,e)}))}}),D(fr,"ForeignObject");class _r extends Ct{constructor(t,e=t){super(E("g",t),e)}}L(_r,a),c({Container:{group:V((function(){return this.put(new _r)}))}}),D(_r,"G");class Sr extends Ct{constructor(t,e=t){super(E("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,S)}}L(Sr,a),c({Container:{link:V((function(t){return this.put(new Sr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Sr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),D(Sr,"A");class Nr extends Ct{constructor(t,e=t){super(E("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return ft("svg [mask*="+this.id()+"]")}}c({Container:{mask:V((function(){return this.defs().put(new Nr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Nr?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),D(Nr,"Mask");class Mr extends Ot{constructor(t,e=t){super(E("stop",t),e)}update(t){return("number"==typeof t||t instanceof St)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new St(t.offset)),this}}c({Gradient:{stop:function(t,e,r){return this.put(new Mr).update(t,e,r)}}}),D(Mr,"Stop");class Pr extends Ot{constructor(t,e=t){super(E("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}c("Dom",{style(t,e){return this.put(new Pr).rule(t,e)},fontface(t,e,r){return this.put(new Pr).font(t,e,r)}}),D(Pr,"Style");class Or extends ur{constructor(t,e=t){super(E("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}c({Container:{textPath:V((function(t,e){return t instanceof ur||(t=this.text(t)),t.path(e)}))},Text:{path:V((function(t,e=!0){const r=new Or;let n;if(t instanceof Oe||(t=this.defs().path(t)),r.attr("href","#"+t,S),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:V((function(t){return t instanceof ur||(t=(new ur).addTo(this.parent()).text(t)),t.path(this)})),targets(){return ft("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Or.prototype.MorphArray=we,D(Or,"TextPath");class Ar extends jt{constructor(t,e=t){super(E("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,S)}}c({Container:{use:V((function(t,e){return this.put(new Ar).use(t,e)}))}}),D(Ar,"Use"),L([We,$e,Ht,Ut,re],l("viewbox")),L([ee,ke,De,Oe],l("marker")),L(ur,l("Text")),L(Oe,l("Path")),L(Et,l("Defs")),L([ur,hr],l("Tspan")),L([Be,zt,qt,Ge],l("radius")),L(wt,l("EventTarget")),L(Pt,l("Dom")),L(Ot,l("Element")),L(jt,l("Shape")),L([Ct,Gt],l("Container")),L(qt,l("Gradient")),L(Ge,l("Runner")),ct.extend([...new Set(h)]),function(t=[]){Pe.push(...[].concat(t))}([St,et,at,it,_t,$t,we,rt]),L(Pe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Cr=r(726),Er=r(854),jr=r(731),Tr=r(986);class Dr{static create(t){let e=document.createElementNS("http://www.w3.org/2000/svg","text");e.textContent=t;let r=new Dr(e);return r.assignUUID(),r.setAttributes(Dr.defaultAttributes),r}static deserialized(t,e){var r;if(!(0,Er.isNonNullObject)(t))throw new Error("Saved base must be an object.");let n=null!==(r=t.id)&&void 0!==r?r:t.textId;if(!n)throw new Error("Missing base ID.");if(!(0,Er.isString)(n))throw new Error("Base IDs must be strings.");let i=e.domNode.querySelector("#"+n);if(!i)throw new Error("Unable to find nucleobase DOM node.");if(!(i instanceof SVGTextElement))throw new Error("Nucleobase DOM node must be an SVG text element.");return new Dr(i)}constructor(t){this.domNode=t,this.centerPoint=new jr.CenterPoint(t)}serialized(){if(!this.id)throw new Error("Nucleobase ID is falsy.");return{id:this.id}}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}bringToFront(){(0,Cr.bringToFront)(this.domNode)}sendToBack(){(0,Cr.sendToBack)(this.domNode)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){try{new ur(this.domNode).attr(t)}catch(t){}}get id(){return this.domNode.id}assignUUID(){(0,Cr.assignUUID)(this.domNode)}get textContent(){return this.domNode.textContent}set textContent(t){this.domNode.textContent=t}isA(){var t;return"A"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isU(){var t;return"U"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isT(){var t;return"T"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isG(){var t;return"G"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isC(){var t;return"C"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}get bbox(){return this.domNode.getBBox()}getCenterPoint(){return this.centerPoint}setCenterPoint(t){this.centerPoint.x=t.x,this.centerPoint.y=t.y}maintainingCenterPoint(t){let{x:e,y:r}=this.centerPoint;t(),this.centerPoint.x=e,this.centerPoint.y=r}get boundingClientRect(){return this.domNode.getBoundingClientRect()}get clientCenterPoint(){let t=this.domNode.getBoundingClientRect();return{x:(0,Tr.mean)([t.left,t.right]),y:(0,Tr.mean)([t.top,t.bottom])}}getClientCenterPoint(){return this.clientCenterPoint}}Dr.defaultAttributes={"font-family":"Arial","font-size":"9","font-weight":"700"},Dr.defaultAttributeNames=["font-family","font-size","font-weight"];class kr{constructor(t,e){this.base1=t,this.base2=e}[Symbol.iterator](){return[this.base1,this.base2].values()}isAU(){return this.base1.isA()&&this.base2.isU()||this.base1.isU()&&this.base2.isA()}isAT(){return this.base1.isA()&&this.base2.isT()||this.base1.isT()&&this.base2.isA()}isGC(){return this.base1.isG()&&this.base2.isC()||this.base1.isC()&&this.base2.isG()}isGU(){return this.base1.isG()&&this.base2.isU()||this.base1.isU()&&this.base2.isG()}isGT(){return this.base1.isG()&&this.base2.isT()||this.base1.isT()&&this.base2.isG()}}})(),n})(),t.exports=e()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>g,Stems:()=>p,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>w,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}var p=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(p.bind.apply(p,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function b(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}function w(t,e){return e.forEach((function(e){e.forEach((function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")}))})),e.map((function(e){return[t[e[0]-1],t[e[1]-1]]}))}})(),n})(),t.exports=e()},534:function(t){var e;e=()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&t.every(r)}function f(t){return c(t)&&t.every(n)}function d(t){return c(t)&&t.every(i)}function m(t){return c(t)&&t.every(a)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>f,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>d,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>l,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>m}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>g,Stems:()=>p,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}var p=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(p.bind.apply(p,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function b(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>i,LastPairedBase:()=>o,LeadingDanglingBases:()=>a,Linkers:()=>l,PositionPairs:()=>e,Stems:()=>c,TrailingDanglingBases:()=>u,consecutivePairs:()=>m,knotless:()=>f,other:()=>t,parseDotBracket:()=>d});class e{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];return this.targetStructure[1].map((e=>[t.indexOf(e[0])+1,t.indexOf(e[1])+1]))}}class i{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat(),n=t.findIndex((t=>r.includes(t)));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var s=r(986);class o{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat().map((e=>t.indexOf(e)));if((0,s.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,s.max)(r)]}}class a{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new i(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)}}class u{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new o(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)}}var h=r(369);class c{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Stems(t,r).get().map((e=>e.map((e=>[t[e[0]-1],t[e[1]-1]]))))}}class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Linkers(t,r).get().map((e=>e.map((e=>t[e-1]))))}}function f(...t){let[r,n]=t,i=new e(...t).get();(0,h.areKnotless)(i)||(i=(0,h.knotless)(i));let s=i.map((t=>[r[t[0]-1],r[t[1]-1]]));return[[...r],s]}function d(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map((e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]}))}function m(t){return t.length<2?[]:t.slice(0,-1).map(((e,r)=>[t[r],t[r+1]]))}})(),n})(),t.exports=e()},173:function(t){var e;e=()=>(()=>{var t={422:function(t){t.exports=(()=>{var t={138:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}return t.r(e),t.d(e,{average:()=>n,mean:()=>n,sum:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}r.r(n),r.d(n,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=r(138);function s(t){return{x:(0,i.mean)(t.map((function(t){return t.x}))),y:(0,i.mean)(t.map((function(t){return t.y})))}}function o(t,e){return s([t,e])}})(),n})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{CircularSegment:()=>a,Semicircle:()=>e});var t=r(422),e=function(){function e(t){this.chord=t}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return Math.PI*this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcAngle",{get:function(){return Math.PI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){return(0,t.midpoint)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),e}(),i=r(872),s=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(n<=i)throw new Error("Arc length is too small.");if(n>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(n/i*Math.sin(s)-s)/(n/i*Math.cos(s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e+=(Math.PI-this.arcAngle)/2;var r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(n<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(n/i*Math.sin(Math.PI-s)-s)/(-n/i*Math.cos(Math.PI-s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e-=(this.arcAngle-Math.PI)/2;var r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function r(r,n){this.chord=r,this.moreProps=n;var i=n.arcLength,a=(0,t.distance)(r[0],r[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,c=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||c?new e(r):i<h?new s(r,{arcLength:i}):new o(r,{arcLength:i})}return Object.defineProperty(r.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),r}()})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},456:function(t){var e;e=()=>(()=>{var t={277:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}get direction(){return Math.atan2(this.y,this.x)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Point:()=>e,RelativePoint:()=>c});var t=r(277);class e{static matching(t){return new e(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}}var i,s,o,a,u,h=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(e){i.add(this),s.set(this,void 0),o.set(this,new t.Vector(0,0)),a.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,s,e),e.addEventListener("move",(()=>h(this,i,"m",u).call(this,"move")))}get x(){return h(this,s,"f").x+h(this,o,"f").x}set x(t){h(this,o,"f").x=t-h(this,s,"f").x,h(this,i,"m",u).call(this,"move")}get y(){return h(this,s,"f").y+h(this,o,"f").y}set y(t){h(this,o,"f").y=t-h(this,s,"f").y,h(this,i,"m",u).call(this,"move")}addEventListener(t,e){h(this,a,"f")[t].push(e)}removeEventListener(t,e){h(this,a,"f")[t]=h(this,a,"f")[t].filter((t=>t!==e))}}s=new WeakMap,o=new WeakMap,a=new WeakMap,i=new WeakSet,u=function(t){h(this,a,"f")[t].forEach((t=>t()))}})(),n})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function m(t,e){return d([t,e])}})(),n})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&t.every(r)}function f(t){return c(t)&&t.every(n)}function d(t){return c(t)&&t.every(i)}function m(t){return c(t)&&t.every(a)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>f,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>d,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>l,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>m}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>g,Stems:()=>p,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}var p=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(p.bind.apply(p,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function b(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}})(),n})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Centroid:()=>s,Direction:()=>d,MaxCenterX:()=>u,MaxCenterY:()=>c,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,arrange:()=>A,circularize:()=>N,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>m,flipY:()=>p,linearize:()=>x,outwardNormal:()=>v,rotate:()=>f,round:()=>P,shift:()=>e,stemmify:()=>S,straighten:()=>_,tangent:()=>b,untangle:()=>L});class t{constructor(t){this.props=t}getCenterPoint(){return this.props.centerPoint}setCenterPoint(t){this.props.centerPoint=t}}function e(t,e){t.forEach((t=>{let r=t.getCenterPoint();t.setCenterPoint({x:r.x+e.x,y:r.y+e.y})}))}var i=r(725);class s{constructor(t){this.targetBases=t}get(){let t=this.targetBases.map((t=>t.getCenterPoint()));return(0,i.centroid)(t)}set(t){let r=this.get(),n=(0,i.displacement)(r,t);e(this.targetBases,n)}}var o=r(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}class c{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}var l=r(30);function f(t,e){if(t.length<2)return;let r=t[0],n=t[t.length-1],s=(0,i.midpoint)(r.getCenterPoint(),n.getCenterPoint());t.forEach((t=>{let r=t.getCenterPoint(),n=(0,i.distance)(s,r),o=(0,l.direction)((0,i.displacement)(s,r));o+=e,t.setCenterPoint({x:s.x+n*Math.cos(o),y:s.y+n*Math.sin(o)})}))}class d{constructor(t){this.targetBases=t}get(){if(this.targetBases.length<2)return 0;let t=this.targetBases[0],e=this.targetBases[this.targetBases.length-1];return(0,l.direction)((0,i.displacement)(t.getCenterPoint(),e.getCenterPoint()))}set(t){let e=t-this.get();f(this.targetBases,e)}}function m(t){let e=new s(t).get().y;t.forEach((t=>{let r=t.getCenterPoint(),n=r.y-e;t.setCenterPoint({x:r.x,y:e-n})}))}function p(t){let e=new s(t).get().x;t.forEach((t=>{let r=t.getCenterPoint(),n=r.x-e;t.setCenterPoint({x:e-n,y:r.y})}))}function g(t){if(0==t.length)return;let r=t[0],{x:n,y:s}=r.getCenterPoint(),o={x:n,y:s},a=new d(t).get();f(t,-a),m(t),f(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function y(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,a=new d(t).get();f(t,-a),p(t),f(t,a),e.set({x:i,y:o})}function b(t,e){let r=e.indexOf(t);if(-1==r)throw new Error("The target base is not present in the parent sequence.");let n=r-1,i=r+2;return n=Math.max(n,0),new d(e.slice(n,i)).get()}var w=r(127);function v(t,...e){var r;let n=e[0],s=null!==(r=e[1])&&void 0!==r?r:[],a=b(t,n)-Math.PI/2,u=n.indexOf(t);if(u<0)throw new Error("The target base is not present in the provided structure.");if(n.length>1&&u<n.length-1){let e=n[u+1];a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),e.getCenterPoint()))}let h=s.find((e=>e.includes(t)));return h&&(a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),(0,w.other)(t,h).getCenterPoint()))),a}function x(t,e){let{spacing:r}=e;if(t.length<2)return;let n=new d(t),i=n.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*r,y:0})})),n.set(i),o.set(h)}function _(t){if(t.length<3)return;let e=t[0],r=t[t.length-1],n=[e.getCenterPoint(),r.getCenterPoint()],s=(0,i.distance)(n[0],n[1]),o=(0,l.direction)((0,i.displacement)(n[0],n[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:c,y:f}=n[0];t.forEach((t=>{t.setCenterPoint({x:c,y:f}),c+=u,f+=h}))}function S(t,r){let{basePairLength:n,basePairSpacing:o}=r;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),c=new s(t),{x:l,y:m}=c.get(),p={x:l,y:m},g=new d(t).get();x(u,{spacing:o}),x(h,{spacing:o}),new d(u).set(-Math.PI/2),new d(h).set(Math.PI/2);let y=t[0],b=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(b.getCenterPoint(),{x:n,y:0})),f(t,g),c.set(p)}function N(t,e){let{spacing:r,terminiGap:n}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,c=new d(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let m=l/(2*Math.PI),p=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach(((t,e)=>{let n=p+2*Math.PI*(e*r)/l;t.setCenterPoint({x:m*Math.cos(n),y:m*Math.sin(n)})})),f(t,c),i.set({x:u,y:h})}var M=r(173);function P(t,r){let{spacing:n}=r;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=n*(t.length-1);if(h-u<.001)return void _(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return N(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let c=new M.CircularSegment(a,{arcLength:h}),f=c.parentCircleCenterPoint,d=c.parentCircleRadius,m=(0,l.direction)((0,i.displacement)(f,s.getCenterPoint())),p=c.arcAngle/(t.length-1);t.forEach((t=>{t.setCenterPoint({x:f.x+d*Math.cos(m),y:f.y+d*Math.sin(m)}),m+=p}))}var O=r(369);function A(t,r,n){var a,u,h;let{spacing:c}=n,l=null!==(a=n.basePairSpacing)&&void 0!==a?a:c,f=null!==(u=n.hairpinLoopSpacing)&&void 0!==u?u:c,m=null!==(h=n.terminiGap)&&void 0!==h?h:c,{x:p,y:g}=new s(t).get(),y={x:p,y:g},b=new d(t).get();[,r]=(0,w.knotless)(t,r);let v=new w.PositionPairs(t,r).get(),x=(0,O.mountainPlotTraversal)(t,v),_=t.filter(((t,e)=>0==x[e]));N(_,{spacing:c,terminiGap:m});let M=new w.Stems(t,r).get(),A=new Set(_),C=M.filter((t=>A.has(t[0][0]))),E=r=>{let n=r[0],{x:a,y:u}=new s(n).get(),h={x:a,y:u},m=new d(r[0]).get(),p=[...r.map((t=>t[0])),...r.map((t=>t[1])).reverse()];S(p,{basePairLength:c,basePairSpacing:l}),new d(p).set(m),e(p,(0,i.displacement)(new s(n).get(),h));let g=r[r.length-1],y=g.map((e=>t.indexOf(e))),b=t.filter(((t,e)=>(0,o.isBetweenExclusive)(e,(0,o.min)(y),(0,o.max)(y))&&x[e]==x[(0,o.min)(y)]+1)),w=new Set(b),v=M.filter((t=>w.has(t[0][0])));P([g[0],...b,g[1]],{spacing:v.length>0?c:f}),v.forEach((t=>E(t)))};C.forEach((t=>E(t))),new d(t).set(b),new s(t).set(y)}var C,E,j,T,D,k=r(456),B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},I=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function L(e,r,n){let i,{spacing:a}=n;if(0==e.length)return;if(0==r.length)return void function(t,e){let{spacing:r}=e,n=k.Point.matching(new s(t).get());N(t,{spacing:r,terminiGap:2*r}),new d(t).set(Math.PI/2),new s(t).set(n)}(e,n);[i,r]=(0,w.knotless)(e,r);let u=[...e],h=k.Point.matching(new s(u).get());e=[...e,new t({centerPoint:{x:0,y:0}})];let c=new F(e,r),l=c.loops;l.sort(((t,e)=>X(t,c)-X(e,c)));let m=l[0],p=(0,o.max)(m.linkers.map((t=>t.length))),g=m.linkers.flatMap((e=>[G(e),...Array.from({length:p-2}).map((()=>new t({centerPoint:{x:0,y:0}}))),R(e)]));if(N(g,{spacing:a,terminiGap:a}),f(g,-new d(g).get()),new s(g).set(h),m.linkers.forEach((t=>P(t,{spacing:a}))),m.emanatingStems.forEach((t=>V(t.bottomBasePair,c,n))),"outerStem"in m){let t=[m.outerStem.topBasePair[1],m.outerStem.topBasePair[0]],i=[...e.slice(c.indexOf(t[0])),...e.slice(0,c.indexOf(t[1])+1)],s=new Set(i);V(t,new F(i,r.filter((t=>t.every((t=>s.has(t)))))),n)}}function V(r,n,s){var a,u;let{spacing:h}=s,c=null!==(a=s.basePairSpacing)&&void 0!==a?a:h,l=null!==(u=s.hairpinLoopSpacing)&&void 0!==u?u:h,f=n.stems.find((t=>t.bottomBasePair[0]===r[0]));if(!f)throw new Error("Closing stem not found.");let d=k.Point.matching(r[0].getCenterPoint());S(f.bases,{basePairSpacing:c,basePairLength:h}),e(f.bases,(0,i.displacement)(r[0].getCenterPoint(),d));let m=n.loop(f.topBasePair);m.innerStems.length>0?function(r,n,s){let{spacing:a}=s,u=[n.indexOf(r[0]),n.indexOf(r[1])],h=n.loop(r).innerStems.flatMap((t=>t.bottomBasePair.map((t=>n.indexOf(t))))),c=(0,o.min)(h),l=(0,o.max)(h),f=n.sequence.filter(((t,e)=>e>=c&&e<=l&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[c]&&[e-1,e,e+1].some((t=>h.includes(t))))),d=(0,o.max)([f.length-2,c-(0,o.min)(u)-1,(0,o.max)(u)-l-1]);d=(0,o.max)([d,0]);let m=Array.from({length:d}).map((()=>new t({centerPoint:{x:0,y:0}}))),p=m.map((()=>new t({centerPoint:{x:0,y:0}}))),g=k.Point.matching(r[0].getCenterPoint());N([r[0],...m,...f,...p,r[1]],{spacing:a,terminiGap:a}),e([...r,...f],(0,i.displacement)(r[0].getCenterPoint(),g)),P(n.sequence.slice(u[0],c+1),{spacing:a}),P(n.sequence.slice(l,u[1]+1),{spacing:a})}(f.topBasePair,n,s):P(m.bases,{spacing:l}),m.innerStems.forEach((t=>V(t.bottomBasePair,n,s))),(0,w.consecutivePairs)(m.innerStems).map((([t,e])=>[t.bottomBasePair[1],...n.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]])).filter((t=>t.length>=5)).forEach((t=>{let r=t.slice(1,-1),n=k.Point.matching(r[0].getCenterPoint()),s=(0,i.distance)(G(r).getCenterPoint(),R(r).getCenterPoint());S(r,{basePairLength:s,basePairSpacing:c}),P(r.length%2==0?function(t){if(t.length<4)throw new Error("The array has less than four items.");if(t.length%2!=0)throw new Error("The array has an odd number of items.");return t.slice(Math.floor(t.length/2)-2,Math.floor(t.length/2)+2)}(r):function(t){if(t.length<3)throw new Error("The array has less than three items.");if(t.length%2==0)throw new Error("The array has an even number of items.");let e=Math.floor(t.length/2);return t.slice(e-1,e+2)}(r),{spacing:r.length>=5?c:s}),e(r,(0,i.displacement)(r[0].getCenterPoint(),n))}))}class F{constructor(t,e){this.sequence=t,this.basePairs=e,C.set(this,void 0),E.set(this,void 0),j.set(this,void 0),T.set(this,void 0),B(this,C,new Map,"f"),this.sequence.forEach(((t,e)=>I(this,C,"f").set(t,e))),B(this,E,new Map,"f"),this.sequence.forEach(((t,e)=>I(this,E,"f").set(t,e+1))),B(this,j,new Map,"f"),this.basePairs.forEach((t=>I(this,j,"f").set(t[0],t[1]))),this.basePairs.forEach((t=>I(this,j,"f").set(t[1],t[0]))),B(this,T,this.basePairs.map((t=>[this.positionOf(t[0]),this.positionOf(t[1])])),"f"),this.mountainPlotTraversal=(0,O.mountainPlotTraversal)(this.sequence,I(this,T,"f")),this.stems=new w.Stems(this.sequence,this.basePairs).get().map((t=>new z(t)))}indexOf(t){let e=I(this,C,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}positionOf(t){let e=I(this,E,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}spannedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return this.sequence.slice((0,o.min)([e,r])+1,(0,o.max)([e,r]))}numSpannedBases(t){return this.spannedBases(t).length}joinedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return[...this.sequence.slice(0,(0,o.min)([e,r])+1),...this.sequence.slice((0,o.max)([e,r]))]}numJoinedBases(t){return this.joinedBases(t).length}interveningBases(t,e){let r=this.indexOf(t),n=this.indexOf(e);return this.sequence.slice((0,o.min)([r,n])+1,(0,o.max)([r,n]))}get loops(){return[this.outermostLoop,...this.stems.map((t=>this.loop(t.topBasePair)))]}loop(t){let e=[this.indexOf(t[0]),this.indexOf(t[1])],r=this.mountainPlotTraversal[e[0]]+1,n=this.spannedBases(t).filter((t=>this.mountainPlotTraversal[this.indexOf(t)]==r)),i=new Set(n),s=[t[0],...n,t[1]],o=this.stems.filter((t=>i.has(t.bottomBasePair[0]))),a=o,u=this.stems.find((e=>t.includes(e.topBasePair[0])));if(!u)throw new Error("Outer stem not found.");let h=(0,w.consecutivePairs)(o).map((([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]));return o.length>0&&(h.unshift([t[0],...this.interveningBases(t[0],G(o).bottomBasePair[0]),G(o).bottomBasePair[0]]),h.push([R(o).bottomBasePair[1],...this.interveningBases(R(o).bottomBasePair[1],t[1]),t[1]])),{bases:s,closingBasePair:t,outerStem:u,innerStems:o,emanatingStems:a,linkers:h}}get outermostLoop(){let t=this.stems.filter((t=>0==this.mountainPlotTraversal[this.indexOf(t.bottomBasePair[0])])),e=t,r=(0,w.consecutivePairs)(e).map((([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]));return e.length>0&&r.push([...this.sequence.slice(this.indexOf(R(e).bottomBasePair[1])),...this.sequence.slice(0,this.indexOf(G(e).bottomBasePair[0])+1)]),{stems:e,emanatingStems:t,linkers:r}}}C=new WeakMap,E=new WeakMap,j=new WeakMap,T=new WeakMap;class z{constructor(t){if(D.set(this,void 0),0==t.length)throw new Error("A stem must have at least one base-pair.");B(this,D,t,"f")}get bottomBasePair(){return G(I(this,D,"f"))}get topBasePair(){return R(I(this,D,"f"))}get side5(){return I(this,D,"f").map((t=>t[0]))}get side3(){let t=I(this,D,"f").map((t=>t[1]));return t.reverse(),t}get bases(){return[...this.side5,...this.side3]}}function X(t,e){let r=(0,o.max)(t.emanatingStems.map((t=>e.numSpannedBases(t.bottomBasePair))));return"closingBasePair"in t&&(r=(0,o.max)([r,e.numJoinedBases(t.closingBasePair)-2])),r}function G(t){if(0==t.length)throw new Error("The array is empty.");return t[0]}function R(t){if(0==t.length)throw new Error("The array is empty.");return t[t.length-1]}D=new WeakMap})(),n})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}r.r(n),r.d(n,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,isSVGGraphicsElement:()=>S,isSVGGraphicsElementsArray:()=>M,sendToBack:()=>g,setAttributes:()=>t});const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,r,n){if(e.randomUUID&&!r&&!t)return e.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,r){n=n||0;for(var s=0;s<16;++s)r[n+s]=i[s];return r}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function S(t){return t instanceof SVGGraphicsElement}v=new WeakMap;var N=r(854);function M(t){return(0,N.isArray)(t)&&t.every(S)}})(),n})(),t.exports=e()},742:function(t){var e;e=()=>(()=>{var t={645:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Box:()=>e});var t=r(986);class e{static bounding(r){let n=r.map((t=>e.matching(t))),i=(0,t.min)(n.map((t=>t.left))),s=(0,t.min)(n.map((t=>t.top))),o=(0,t.max)(n.map((t=>t.right)))-i,a=(0,t.max)(n.map((t=>t.bottom)))-s;return new e(i,s,o,a)}static matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}get minX(){return this.x}get minY(){return this.y}get maxX(){return this.minX+this.width}get maxY(){return this.minY+this.height}get top(){return this.minY}get right(){return this.maxX}get bottom(){return this.maxY}get left(){return this.minX}isBoundedBy(t){let r=e.matching(t);return this.minX>=r.minX&&this.minY>=r.minY&&this.maxX<=r.maxX&&this.maxY<=r.maxY}padded(t,r){return"number"!=typeof r&&(r=t),new e(this.x-t,this.y-r,this.width+2*t,this.height+2*r)}peripheralPoint(t){let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}})(),n})(),t.exports=e()},731:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{CenterPoint:()=>h});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver((()=>u(this,r,"m",o).call(this,"move"))),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter((t=>t!==e))}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach((t=>t()))},e})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}r.r(n),r.d(n,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,isSVGGraphicsElement:()=>S,isSVGGraphicsElementsArray:()=>M,sendToBack:()=>g,setAttributes:()=>t});const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,r,n){if(e.randomUUID&&!r&&!t)return e.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,r){n=n||0;for(var s=0;s<16;++s)r[n+s]=i[s];return r}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function S(t){return t instanceof SVGGraphicsElement}v=new WeakMap;var N=r(854);function M(t){return(0,N.isArray)(t)&&t.every(S)}})(),n})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function m(t,e){return d([t,e])}})(),n})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},277:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseNumbering:()=>m,BaseNumberingLine:()=>M});var t,e=r(726),i=r(731),s=r(277),o=r(725),a=r(854),u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(e){if(t.set(this,void 0),!(0,a.isNonNullObject)(e))throw new Error("Saved base numberings must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}get id(){if((0,a.isString)(u(this,t,"f").id))return u(this,t,"f").id;if((0,a.isString)(u(this,t,"f").textId))return u(this,t,"f").textId;throw new Error("Unable to find the ID of the saved base numbering.")}get ownerID(){if((0,a.isString)(u(this,t,"f").ownerID))return u(this,t,"f").ownerID;throw new Error("Unable to find the owner ID of the saved base numbering.")}get displacement(){return u(this,t,"f").displacement}}t=new WeakMap;var c,l,f,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class m{static numbering(t,r){let n=document.createElementNS("http://www.w3.org/2000/svg","text");(0,e.assignUUID)(n),n.textContent=`${r}`;let i=new m(n,t);return i.setAttributes(m.defaultValues.attributes),i.displacement.magnitude=0,i}constructor(t,e){c.add(this),this.domNode=t,this.owner=e,l.set(this,void 0),this.centerPoint=new i.CenterPoint(t),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,s.Vector.matching((0,o.displacement)(e.centerPoint,this.centerPoint))),e.centerPoint.addEventListener("move",(()=>d(this,c,"m",f).call(this)))}get id(){return this.domNode.id}get textContent(){return this.domNode.textContent}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach((([t,e])=>this.setAttribute(t,e)))}removeAttribute(t){this.domNode.removeAttribute(t)}get displacement(){const t=()=>d(this,l,"f").x,e=t=>{d(this,l,"f").x=t,d(this,c,"m",f).call(this)},r=()=>d(this,l,"f").y,n=t=>{d(this,l,"f").y=t,d(this,c,"m",f).call(this)},i=()=>d(this,l,"f").magnitude,s=t=>{d(this,l,"f").magnitude=t,d(this,c,"m",f).call(this)},o=()=>d(this,l,"f").direction,a=t=>{d(this,l,"f").direction=t,d(this,c,"m",f).call(this)};return{get x(){return t()},set x(t){e(t)},get y(){return r()},set y(t){n(t)},get magnitude(){return i()},set magnitude(t){s(t)},get direction(){return o()},set direction(t){a(t)}}}serialized(){return{id:this.id,ownerID:this.owner.id,displacement:{x:this.displacement.x,y:this.displacement.y}}}static deserialized(t,e){let r=new h(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Base numbering DOM node not found.");if(!(n instanceof SVGTextElement))throw new Error("Base numbering DOM node must be an SVG text element.");let i=e.bases.find((t=>t.id===r.ownerID));if(!i)throw new Error("Unable to find base numbering owner.");let s=new m(n,i);return(0,o.isPoint)(r.displacement)&&(s.displacement.x=r.displacement.x,s.displacement.y=r.displacement.y),s}}l=new WeakMap,c=new WeakSet,f=function(){this.centerPoint.x=this.owner.centerPoint.x+d(this,l,"f").x,this.centerPoint.y=this.owner.centerPoint.y+d(this,l,"f").y},m.defaultValues={attributes:{"font-family":"Arial","font-size":"8","font-weight":"400",fill:"#808080"}};var p,g=r(645),y=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class b{constructor(t){if(p.set(this,void 0),!(0,a.isNonNullObject)(t))throw new Error("Saved base numbering lines must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,p,t)}get id(){if((0,a.isString)(y(this,p,"f").id))return y(this,p,"f").id;if((0,a.isString)(y(this,p,"f").lineId))return y(this,p,"f").lineId;throw new Error("Unable to find the ID of the saved base numbering line.")}get ownerID(){if((0,a.isString)(y(this,p,"f").ownerID))return y(this,p,"f").ownerID;if((0,a.isString)(y(this,p,"f").textId))return y(this,p,"f").textId;throw new Error("Unable to find the owner ID of the saved base numbering line.")}get basePadding(){return y(this,p,"f").basePadding}get numberingPadding(){return y(this,p,"f").numberingPadding}}p=new WeakMap;var w,v,x,_,S=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},N=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class M{static connecting(t){let r=document.createElementNS("http://www.w3.org/2000/svg","line");(0,e.assignUUID)(r),r.setAttribute("x1",`${t.owner.centerPoint.x}`),r.setAttribute("y1",`${t.owner.centerPoint.y}`),r.setAttribute("x2",`${t.centerPoint.x}`),r.setAttribute("y2",`${t.centerPoint.y}`);let n=new M(r,t);return n.set(M.defaultValues),n}static unpadded(t){let e=M.connecting(t);return e.basePadding=0,e.numberingPadding=0,e}constructor(t,e){w.add(this),this.domNode=t,this.owner=e,v.set(this,void 0),x.set(this,void 0),S(this,v,(0,o.distance)(e.owner.centerPoint,this.point1),"f");let r=g.Box.matching(e.domNode.getBBox());S(this,x,(0,o.distance)(this.point2,r.peripheralPoint(e.displacement.direction+Math.PI)),"f"),e.centerPoint.addEventListener("move",(()=>N(this,w,"m",_).call(this))),e.owner.centerPoint.addEventListener("move",(()=>N(this,w,"m",_).call(this)))}get id(){return this.domNode.id}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach((([t,e])=>this.setAttribute(t,e)))}removeAttribute(t){this.domNode.removeAttribute(t)}get x1(){return this.domNode.x1.baseVal.value}get y1(){return this.domNode.y1.baseVal.value}get point1(){return{x:this.x1,y:this.y1}}get x2(){return this.domNode.x2.baseVal.value}get y2(){return this.domNode.y2.baseVal.value}get point2(){return{x:this.x2,y:this.y2}}get length(){return(0,o.distance)(this.point1,this.point2)}set length(t){let e=g.Box.matching(this.owner.domNode.getBBox());this.owner.displacement.magnitude=this.basePadding+t+this.numberingPadding+(0,o.distance)(this.owner.centerPoint,e.peripheralPoint(this.owner.displacement.direction+Math.PI))}get direction(){return(0,o.direction)(this.point1,this.point2)}set direction(t){let e=this.length;this.owner.displacement.direction=t,this.length=e}get basePadding(){return N(this,v,"f")}set basePadding(t){S(this,v,t,"f"),N(this,w,"m",_).call(this)}get numberingPadding(){return N(this,x,"f")}set numberingPadding(t){S(this,x,t,"f"),N(this,w,"m",_).call(this)}set(t){!t.attributes||this.setAttributes(t.attributes),!(0,a.isNumber)(t.basePadding)||(this.basePadding=t.basePadding),!(0,a.isNumber)(t.numberingPadding)||(this.numberingPadding=t.numberingPadding)}serialized(){return{id:this.id,ownerID:this.owner.id,basePadding:this.basePadding,numberingPadding:this.numberingPadding}}static deserialized(t,e){let r=new b(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Base numbering line DOM node not found.");if(!(n instanceof SVGLineElement))throw new Error("Base numbering line DOM node must be an SVG line element.");let i=e.baseNumberings.find((t=>t.id===r.ownerID));if(!i)throw new Error("Base numbering line owner not found.");let s=new M(n,i);return(0,a.isNumber)(r.basePadding)&&(s.basePadding=r.basePadding),(0,a.isNumber)(r.numberingPadding)&&(s.numberingPadding=r.numberingPadding),s}}v=new WeakMap,x=new WeakMap,w=new WeakSet,_=function(){let t=this.owner.displacement.direction;this.domNode.setAttribute("x1",`${this.owner.owner.centerPoint.x+N(this,v,"f")*Math.cos(t)}`),this.domNode.setAttribute("y1",`${this.owner.owner.centerPoint.y+N(this,v,"f")*Math.sin(t)}`);let e=g.Box.matching(this.owner.domNode.getBBox()).peripheralPoint(t+Math.PI);this.domNode.setAttribute("x2",`${e.x+N(this,x,"f")*Math.cos(t+Math.PI)}`),this.domNode.setAttribute("y2",`${e.y+N(this,x,"f")*Math.sin(t+Math.PI)}`)},M.defaultValues={attributes:{stroke:"#808080","stroke-width":"1","stroke-opacity":"1"},basePadding:5,numberingPadding:1}})(),n})(),t.exports=e()},775:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}t.r(e),t.d(e,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,sendToBack:()=>g,setAttributes:()=>r});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=i[s];return e}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}return v=new WeakMap,e})(),t.exports=e()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>i});var t=r(726),e=r(854);class i{static outlining(e){let r=document.createElementNS("http://www.w3.org/2000/svg","circle");(0,t.assignUUID)(r),r.setAttribute("cx",`${e.centerPoint.x}`),r.setAttribute("cy",`${e.centerPoint.y}`);let n=new i(r,e);return n.set(i.defaultValues.circle),n}static deserialized(t,r){var n;if(!(0,e.isNonNullObject)(t))throw new Error("Saved base outline must be an object.");let s=null!==(n=t.id)&&void 0!==n?n:t.circleId;if(!s)throw new Error("Base outline ID is missing.");if(!(0,e.isString)(s))throw new Error("Base outline ID must be a string.");let o=r.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find base outline DOM node.");if(!(o instanceof SVGCircleElement))throw new Error("Base outline DOM node must be an SVG circle element.");let a=t.ownerID;if(!a)throw new Error("Missing base outline owner ID.");if(!(0,e.isString)(a))throw new Error("Base outline owner ID must be a string.");let u=[...r.bases].find((t=>t.id===a));if(!u)throw new Error("Unable to find base outline owner.");return new i(o,u)}constructor(t,e){this.domNode=t,this.owner=e,e.centerPoint.addEventListener("move",(()=>{t.setAttribute("cx",`${e.centerPoint.x}`),t.setAttribute("cy",`${e.centerPoint.y}`)}))}serialized(){let t=this.id;if(!t)throw new Error("Base outline ID is falsy.");let e=this.owner.id;if(!e)throw new Error("Base outline owner ID is falsy.");return{id:t,ownerID:e}}get id(){return this.domNode.id}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(e){(0,t.setAttributes)(this.domNode,e)}set(t){t.attributes&&this.setAttributes(t.attributes)}}i.defaultValues={circle:{attributes:{r:"5.5",stroke:"#000000","stroke-width":"0","stroke-opacity":"1",fill:"#00ffff","fill-opacity":"1"}}}})(),n})(),t.exports=e()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>Hr.BaseOutline,CTDrawer:()=>_n,DotBracketDrawer:()=>yn,Drawing:()=>fn,Nucleobase:()=>Er.Nucleobase,SchemaDrawer:()=>An,StraightBond:()=>Qr.StraightBond});var t={};r.r(t),r.d(t,{cx:()=>It,cy:()=>Lt,height:()=>Ft,rx:()=>Tt,ry:()=>Dt,width:()=>Vt,x:()=>kt,y:()=>Bt});var e={};r.r(e),r.d(e,{from:()=>Rt,to:()=>Yt});var i={};r.r(i),r.d(i,{MorphArray:()=>Qt,height:()=>te,width:()=>Zt,x:()=>Jt,y:()=>Kt});var s={};r.r(s),r.d(s,{array:()=>Ae,clear:()=>Ce,move:()=>Ee,plot:()=>je,size:()=>Te});var o={};r.r(o),r.d(o,{amove:()=>or,ax:()=>ir,ay:()=>sr,build:()=>ar,center:()=>nr,cx:()=>er,cy:()=>rr,length:()=>Je,move:()=>tr,plain:()=>Qe,x:()=>Ke,y:()=>Ze});var a={};r.r(a),r.d(a,{dmove:()=>dr,dx:()=>mr,dy:()=>pr,height:()=>gr,move:()=>yr,size:()=>br,width:()=>wr,x:()=>vr,y:()=>xr});const u={},h=[];function c(t,e){if(Array.isArray(t))for(const r of t)c(r,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const e in t)c(e,t[e])}function l(t){return u[t]||{}}function f(t){h.push(...t)}function d(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function m(t){return t%360*Math.PI/180}function p(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function y(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const b=new Set(["desc","metadata","title"]),w=t=>b.has(t.nodeName),v=(t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},x="http://www.w3.org/2000/svg",_="http://www.w3.org/2000/xmlns/",S="http://www.w3.org/1999/xlink",N={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class M{}const P={},O="___SYMBOL___ROOT___";function A(t,e=x){return N.document.createElementNS(e,t)}function C(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return T(t);if(null==t)return new P[O];if("string"==typeof t&&"<"!==t.charAt(0))return T(N.document.querySelector(t));const r=e?N.document.createElement("div"):A("svg");return r.innerHTML=t,t=T(r.firstChild),r.removeChild(r.firstChild),t}function E(t,e){return e&&(e instanceof N.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:A(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new P.Fragment(t);let e=p(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":P[e]||(e="Dom"),new P[e](t)}let T=j;function D(t,e=t.name,r=!1){return P[e]=t,r&&(P[O]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let k=1e3;function B(t){return"Svgjs"+p(t)+k++}function I(t){for(let e=t.children.length-1;e>=0;e--)I(t.children[e]);return t.id?(t.id=B(t.nodeName),t):t}function L(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function V(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}c("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=C(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=C(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=C(t)).before(this),this},insertAfter:function(t){return(t=C(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,Y=/\s/g,q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,U=/^rgb\(/,H=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,J=/[MLHVCSQTAZ]/i;function K(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Z(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function tt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),c("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,r){if(null==t)return this.data(d(function(t){let e;const r=t.length,n=[];for(e=0;e<r;e++)0===t[e].nodeName.indexOf("data-")&&n.push(t[e]);return n}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class et{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof et||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:r,round:n,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new et(t,e,n,"lch")}if("sine"===t){const t=n(80*i(2*s*(e=null==e?r():e)/.5+.01)+150),o=n(50*i(2*s*e/.5+4.6)+200),a=n(100*i(2*s*e/.5+2.3)+150);return new et(t,o,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new et(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new et(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new et(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new et(t,e,n,"lab")}if("grey"===t){const t=255*r();return new et(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(q.test(t)||U.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new et(0,0,0,1,"cmyk"):new et((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new et(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=Z(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Z(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Z(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Z(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Z(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Z(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(U.test(t)){const e=t.replace(Y,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!q.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=z.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new et(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new et(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new et(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new et(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*tt(i,n,t+1/3),o=255*tt(i,n,t),a=255*tt(i,n,t-1/3);return new et(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new et(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(K);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new et(f,d,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function nt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class it{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),m=d.x,p=d.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,px:m,py:p}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new it(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),m=Math.sin(l),p=(r*i+n*s)/u,g=i*c/(p*r-n)||s*c/(p*n+r);return{scaleX:c,scaleY:g,shear:p,rotate:f,translateX:o-t+t*d*c+e*(p*d*c-m*g),translateY:a-e+t*m*c+e*(p*m*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new it(t);return nt(this.a,e.a)&&nt(this.b,e.b)&&nt(this.c,e.c)&&nt(this.d,e.d)&&nt(this.e,e.e)&&nt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=it.fromArray([1,0,0,1,0,0]);return t=t instanceof Ot?t.matrixify():"string"==typeof t?it.fromArray(t.split(Q).map(parseFloat)):Array.isArray(t)?it.fromArray(t):"object"==typeof t&&it.isMatrixLike(t)?t:"object"==typeof t?(new it).transform(t):6===arguments.length?it.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=m(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:c}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-c*i+r*i-e*n+e,this.f=c*n+h*i-e*i-r*n+r,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:c,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=c+l*i-n*i,this.f=l+c*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(it.isMatrixLike(t))return new it(t).multiplyO(this);const e=it.formatTransforms(t),{x:r,y:n}=new rt(e.ox,e.oy).transform(this),i=(new it).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new rt(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function st(){if(!st.nodes){const t=C().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;st.nodes={svg:t,path:e}}if(!st.nodes.svg.node.parentNode){const t=N.document.body||N.document.documentElement;st.nodes.svg.addTo(t)}return st.nodes}function ot(t){return!(t.width||t.height||t.x||t.y)}D(it,"Matrix");class at{constructor(...t){this.init(...t)}addOffset(){return this.x+=N.window.pageXOffset,this.y+=N.window.pageYOffset,new at(this)}init(t){return t="string"==typeof t?t.split(Q).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ot(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new at(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof it||(t=new it(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new at(e,n,r-e,i-n)}}function ut(t,e,r){let n;try{if(n=e(t.node),ot(n)&&(i=t.node)!==N.document&&!(N.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===N.document}).call(N.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}c({viewbox:{viewbox(t,e,r,n){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new rt(r/2/s+i.x,n/2/o+i.y);const h=new at(i).transform(new it({scale:u,origin:e}));return this.viewbox(h)}}}),D(at,"Box");class ht extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const ct=ht;L([ht],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const lt=["toArray","constructor","each"];function ft(t,e){return new ct(d((e||N.document).querySelectorAll(t),(function(t){return j(t)})))}ht.extend=function(t){t=t.reduce(((t,e)=>(lt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),L([ht],t)};let dt=0;const mt={};function pt(t){let e=t.getEventHolder();return e===N.window&&(e=mt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,r,n,i){const s=r.bind(n||t),o=C(t),a=pt(o),u=gt(o);e=Array.isArray(e)?e:e.split(Q),r._svgjsListenerId||(r._svgjsListenerId=++dt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function bt(t,e,r,n){const i=C(t),s=pt(i),o=gt(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])bt(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&bt(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])bt(o,[e,u].join("."));delete s[e]}}else{for(t in s)bt(o,t);!function(t){let e=t.getEventHolder();e===N.window&&(e=mt),e.events&&(e.events={})}(i)}}))}class wt extends M{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=gt(t);return e instanceof N.window.Event||(e=new N.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return bt(this,t,e,r),this}on(t,e,r,n){return yt(this,t,e,r,n),this}removeEventListener(){}}function vt(){}D(wt,"EventTarget");const xt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class _t extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Q).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class St{constructor(...t){this.init(...t)}convert(t){return new St(this.value,t)}divide(t){return t=new St(t),new St(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof St&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new St(t),new St(this-t,this.unit||t.unit)}plus(t){return t=new St(t),new St(this+t,this.unit||t.unit)}times(t){return t=new St(t),new St(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Nt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Mt=[];class Pt extends wt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=C(t)).removeNamespace&&this.node instanceof N.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return C(t).put(this,e)}children(){return new ct(d(this.node.children,(function(t){return j(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let r=this.node.cloneNode(t);return e&&(r=I(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new Pt(A(t),e))}first(){return j(this.node.firstChild)}get(t){return j(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=B(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=C(t),this.add(t,e),t}putIn(t,e){return C(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=C(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,x)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=j(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=A("wrapper",r),i=N.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}L(Pt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=W.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?xt[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=Mt.reduce(((e,r)=>r(t,e,this)),e))?e=new St(e):Nt.has(t)&&et.isColor(e)?e=new et(e):e.constructor===Array&&(e=new _t(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return ft(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),D(Pt,"Dom");class Ot extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new St(t).plus(this.x()))}dy(t=0){return this.y(new St(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=C(t));const r=new ct;let n=this;for(;(n=n.parent())&&n.node!==N.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?C(e[1]):null}root(){const t=this.parent(P[O]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=g(this,t,e);return this.width(new St(r.width)).height(new St(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}L(Ot,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(st().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new at(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.height},point:function(t,e){return new rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new it(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new it(e)}return new it(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new it}}}),D(Ot,"Element");const At={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let r;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof et||et.isRgb(e)||e instanceof Ot)this.attr(t,e);else for(r=At[t].length-1;r>=0;r--)null!=e[At[t][r]]&&this.attr(At.prefix(t,At[t][r]),e[At[t][r]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new it(this):this.attr("transform",new it(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new St(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(it.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new it)},toParent:function(t,e){if(this===t)return this;if(w(this.node))return this.addTo(t,e);const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new it(this).decompose();return null==t?e:e[t]}it.isMatrixLike(t)||(t={...t,origin:y(t,this)});const r=new it(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class Ct extends Ot{flatten(){return this.each((function(){if(this instanceof Ct)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}D(Ct,"Container");class Et extends Ct{constructor(t,e=t){super(E("defs",t),e)}flatten(){return this}ungroup(){return this}}D(Et,"Defs");class jt extends Ot{}function Tt(t){return this.attr("rx",t)}function Dt(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Bt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Vt(t){return null==t?2*this.rx():this.rx(new St(t).divide(2))}function Ft(t){return null==t?2*this.ry():this.ry(new St(t).divide(2))}D(jt,"Shape");class zt extends jt{constructor(t,e=t){super(E("ellipse",t),e)}size(t,e){const r=g(this,t,e);return this.rx(new St(r.width).divide(2)).ry(new St(r.height).divide(2))}}L(zt,t),c("Container",{ellipse:V((function(t=0,e=t){return this.put(new zt).size(t,e).move(0,0)}))}),D(zt,"Ellipse");class Xt extends Pt{constructor(t=N.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(A("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}D(Xt,"Fragment");const Gt=Xt;function Rt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new St(t),fy:new St(e)}):this.attr({x1:new St(t),y1:new St(e)})}function Yt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new St(t),cy:new St(e)}):this.attr({x2:new St(t),y2:new St(e)})}class qt extends Ct{constructor(t,e){super(E(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}L(qt,e),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:V((function(t,e){return this.put(new qt(t)).update(e)}))}}),D(qt,"Gradient");class Ut extends Ct{constructor(t,e=t){super(E("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}c({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:V((function(t,e,r){return this.put(new Ut).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Ut,"Pattern");class Ht extends jt{constructor(t,e=t){super(E("image",t),e)}load(t,e){if(!t)return this;const r=new N.window.Image;return yt(r,"load",(function(t){const n=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof Ut&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(r,"load error",(function(){bt(r)})),this.attr("href",r.src=t,S)}}var Wt;Wt=function(t,e,r){return"fill"!==t&&"stroke"!==t||$.test(e)&&(e=r.root().defs().image(e)),e instanceof Ht&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Mt.push(Wt),c({Container:{image:V((function(t,e){return this.put(new Ht).size(0,0).load(t,e)}))}}),D(Ht,"Image");class $t extends _t{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new at(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e<r;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));for(let e=this.length;e--;){const[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}const Qt=$t;function Jt(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function Kt(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Zt(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function te(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class ee extends jt{constructor(t,e=t){super(E("line",t),e)}array(){return new $t([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new $t(t).toLine(),this.attr(t))}size(t,e){const r=g(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}L(ee,i),c({Container:{line:V((function(...t){return ee.prototype.plot.apply(this.put(new ee),null!=t[0]?t:[0,0,0,0])}))}}),D(ee,"Line");class re extends Ct{constructor(t,e=t){super(E("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ne(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:V((function(t,e,r){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),D(re,"Marker");const ie={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class se{done(){return!1}}class oe extends se{constructor(t=">"){super(),this.ease=ie[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class ae extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}L(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:ne("_duration",ue),overshoot:ne("_overshoot",ue)}),L(class extends ae{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ne("_windup"),p:ne("P"),i:ne("I"),d:ne("D")});const he={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let t=0,e=le.length;t<e;++t)ce[le[t]]=function(t){return function(e,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return ce[t](e,r,n)}}(le[t].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===he[t.segment[0].toUpperCase()]}function de(t,e){t.inNumber&&me(t,!1);const r=J.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function me(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fe(t)&&pe(t)}function pe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ge(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ye(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);class we extends _t{bbox(){return st().path.setAttribute("d",this.toString()),new at(st.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!de(i,n))if("."!==n)if(isNaN(parseInt(n)))if(be.has(n))i.inNumber&&me(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(J.test(n)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");pe(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ye(i)){me(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||ge(i)){i.inNumber=!0,i.number=n,me(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){me(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&pe(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const ve=t=>{const e=typeof t;return"number"===e?St:"string"===e?et.isColor(t)?et:Q.test(t)?J.test(t)?we:_t:F.test(t)?St:_e:Pe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?_t:"object"===e?Me:_e};class xe{constructor(t){this._stepper=t||new oe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ve(t));let e=new this._type(t);return this._type===et&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ne=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class Me{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===et&&t[r+7]!==e[r+7]){const e=t[r+7],n=new et(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=ve(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(Ne),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const Pe=[_e,Se,Me];class Oe extends jt{constructor(t,e=t){super(E("path",t),e)}array(){return this._array||(this._array=new we(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new we(t))}size(t,e){const r=g(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function Ae(){return this._array||(this._array=new $t(this.attr("points")))}function Ce(){return delete this._array,this}function Ee(t,e){return this.attr("points",this.array().move(t,e))}function je(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new $t(t))}function Te(t,e){const r=g(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}Oe.prototype.MorphArray=we,c({Container:{path:V((function(t){return this.put(new Oe).plot(t||new we)}))}}),D(Oe,"Path");class De extends jt{constructor(t,e=t){super(E("polygon",t),e)}}c({Container:{polygon:V((function(t){return this.put(new De).plot(t||new $t)}))}}),L(De,i),L(De,s),D(De,"Polygon");class ke extends jt{constructor(t,e=t){super(E("polyline",t),e)}}c({Container:{polyline:V((function(t){return this.put(new ke).plot(t||new $t)}))}}),L(ke,i),L(ke,s),D(ke,"Polyline");class Be extends jt{constructor(t,e=t){super(E("rect",t),e)}}L(Be,{rx:Tt,ry:Dt}),c({Container:{rect:V((function(t,e){return this.put(new Be).size(t,e)}))}}),D(Be,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>N.window.performance||N.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const r=Le.timer().now()+e,n=Le.timeouts.push({run:t,time:r});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),n},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const r=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==r););let n=null;const i=Le.frames.last();for(;n!==i&&(n=Le.frames.shift());)n.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?N.window.requestAnimationFrame(Le._draw):null}},Ve=Le,Fe=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},ze=function(){const t=N.window;return(t.performance||t.Date).now()};class Xe extends wt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Fe);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ge extends wt{constructor(t){super(),this.id=Ge.id++,t="function"==typeof(t=null==t?400:t)?new ae(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ae,this._stepper=this._isDeclarative?t:new oe,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new it,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e??0,r=r||"last","object"!=typeof(t=t??400)||t instanceof se||(e=t.delay??e,r=t.when??r,i=t.swing||i,n=t.times??n,s=t.wait??s,t=t.duration??400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=Ge.sanitise(t,e,r),i=new Ge(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new it,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new oe(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,r,n){return this._queue.push({initialiser:t||vt,runner:e||vt,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,r){if(t instanceof Xe||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new it,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Ge.id=0;class Re{constructor(t=new it,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}L([Ge,Re],{mergeWith(t){return new Re(t.transforms.lmultiply(this.transforms),t.id)}});const Ye=(t,e)=>t.lmultiplyO(e),qe=t=>t.transforms;function Ue(){const t=this._transformationRunners.runners.map(qe).reduce(Ye,new it);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class He{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Re).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}c({Element:{animate(t,e,r){const n=Ge.sanitise(t,e,r),i=this.timeline();return new Ge(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(qe).reduce(Ye,new it)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(Ue.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new He).add(new Re(new it(this))))}}}),L(Ge,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new xe(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Me(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Me(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new xe(this._stepper).to(new St(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=it.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new xe(this._stepper).type(r?Se:it);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||y(t,o),h=new it(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new rt(s).transform(o._currentTransform(this));let d=new it({...t,origin:[l,f]}),m=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),m=m.decompose(l,f);const t=d.rotate,e=m.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(m.rotate=u)),i.from(m),i.to(d);const p=i.at(c);return u=p.rotate,a=new it(p),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=y(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new St(e),this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new St(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new St(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new at(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),L(Ge,{rx:Tt,ry:Dt,from:Rt,to:Yt}),D(Ge,"Runner");class We extends Ct{constructor(t,e=t){super(E("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new Et):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof N.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:x,version:"1.1"}).attr("xmlns:xlink",S,_):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,_).attr("xmlns:svgjs",null,_)}root(){return this.isRoot()?this:super.root()}}c({Container:{nested:V((function(){return this.put(new We)}))}}),D(We,"Svg",!0);class $e extends Ct{constructor(t,e=t){super(E("symbol",t),e)}}function Qe(t){return!1===this._build&&this.clear(),this.node.appendChild(N.document.createTextNode(t)),this}function Je(){return this.node.getComputedTextLength()}function Ke(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Ze(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function tr(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function er(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function rr(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function nr(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function ir(t){return this.attr("x",t)}function sr(t){return this.attr("y",t)}function or(t,e){return this.ax(t).ay(e)}function ar(t){return this._build=!!t,this}c({Container:{symbol:V((function(){return this.put(new $e)}))}}),D($e,"Symbol");class ur extends jt{constructor(t,e=t){super(E("text",t),e),this.dom.leading=this.dom.leading??new St(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new St(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){if(w(this.node))return;const i=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new St(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new St(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"===e[n].nodeName||w(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===j(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}L(ur,o),c({Container:{text:V((function(t=""){return this.put(new ur).text(t)})),plain:V((function(t=""){return this.put(new ur).plain(t)}))}}),D(ur,"Text");class hr extends jt{constructor(t,e=t){super(E("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ur))return this;const e=t.index(this),r=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new St(r);return this.dy(e?n:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}L(hr,o),c({Tspan:{tspan:V((function(t=""){const e=new hr;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),D(hr,"Tspan");class cr extends jt{constructor(t,e=t){super(E("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new St(t).divide(2))}}L(cr,{x:kt,y:Bt,cx:It,cy:Lt,width:Vt,height:Ft}),c({Container:{circle:V((function(t=0){return this.put(new cr).size(t).move(0,0)}))}}),D(cr,"Circle");class lr extends Ct{constructor(t,e=t){super(E("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return ft("svg [clip-path*="+this.id()+"]")}}c({Container:{clip:V((function(){return this.defs().put(new lr)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lr?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),D(lr,"ClipPath");class fr extends Ot{constructor(t,e=t){super(E("foreignObject",t),e)}}function dr(t,e){return this.children().forEach((r=>{let n;try{n=r.node instanceof N.window.SVGSVGElement?new at(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new it(r),s=i.translate(t,e).transform(i.inverse()),o=new rt(n.x,n.y).transform(s);r.move(o.x,o.y)})),this}function mr(t){return this.dmove(t,0)}function pr(t){return this.dmove(0,t)}function gr(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function yr(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function br(t,e,r=this.bbox()){const n=g(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach((t=>{const e=new rt(r).transform(new it(t).inverse());t.scale(i,s,e.x,e.y)})),this}function wr(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function vr(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function xr(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}c({Container:{foreignObject:V((function(t,e){return this.put(new fr).size(t,e)}))}}),D(fr,"ForeignObject");class _r extends Ct{constructor(t,e=t){super(E("g",t),e)}}L(_r,a),c({Container:{group:V((function(){return this.put(new _r)}))}}),D(_r,"G");class Sr extends Ct{constructor(t,e=t){super(E("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,S)}}L(Sr,a),c({Container:{link:V((function(t){return this.put(new Sr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Sr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),D(Sr,"A");class Nr extends Ct{constructor(t,e=t){super(E("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return ft("svg [mask*="+this.id()+"]")}}c({Container:{mask:V((function(){return this.defs().put(new Nr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Nr?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),D(Nr,"Mask");class Mr extends Ot{constructor(t,e=t){super(E("stop",t),e)}update(t){return("number"==typeof t||t instanceof St)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new St(t.offset)),this}}c({Gradient:{stop:function(t,e,r){return this.put(new Mr).update(t,e,r)}}}),D(Mr,"Stop");class Pr extends Ot{constructor(t,e=t){super(E("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}c("Dom",{style(t,e){return this.put(new Pr).rule(t,e)},fontface(t,e,r){return this.put(new Pr).font(t,e,r)}}),D(Pr,"Style");class Or extends ur{constructor(t,e=t){super(E("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}c({Container:{textPath:V((function(t,e){return t instanceof ur||(t=this.text(t)),t.path(e)}))},Text:{path:V((function(t,e=!0){const r=new Or;let n;if(t instanceof Oe||(t=this.defs().path(t)),r.attr("href","#"+t,S),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:V((function(t){return t instanceof ur||(t=(new ur).addTo(this.parent()).text(t)),t.path(this)})),targets(){return ft("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Or.prototype.MorphArray=we,D(Or,"TextPath");class Ar extends jt{constructor(t,e=t){super(E("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,S)}}c({Container:{use:V((function(t,e){return this.put(new Ar).use(t,e)}))}}),D(Ar,"Use"),L([We,$e,Ht,Ut,re],l("viewbox")),L([ee,ke,De,Oe],l("marker")),L(ur,l("Text")),L(Oe,l("Path")),L(Et,l("Defs")),L([ur,hr],l("Tspan")),L([Be,zt,qt,Ge],l("radius")),L(wt,l("EventTarget")),L(Pt,l("Dom")),L(Ot,l("Element")),L(jt,l("Shape")),L([Ct,Gt],l("Container")),L(qt,l("Gradient")),L(Ge,l("Runner")),ct.extend([...new Set(h)]),function(t=[]){Pe.push(...[].concat(t))}([St,et,at,it,_t,$t,we,rt]),L(Pe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Cr=r(726),Er=r(358);class jr{constructor(t,e){this.svgDoc=t,this.elements=e,new MutationObserver((t=>{t.some((t=>t.removedNodes.length>0))&&(this.elements=this.elements.filter((t=>this.svgDoc.contains(t.domNode))))})).observe(t,{childList:!0,subtree:!0})}}class Tr{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new jr(t,e)}get bases(){return this.elementsDrawing.elements}set bases(t){this.elementsDrawing.elements=t}append(t){t.appendTo(this.svgDoc),this.bases.push(t)}add(t){let e=Er.Nucleobase.create(t);return this.append(e),e}}var Dr,kr,Br=r(534),Ir=r(742),Lr=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},Vr=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Fr{constructor(t){this.domNode=t,Dr.set(this,void 0),kr.set(this,void 0),Lr(this,Dr,new jr(t,[]),"f"),Lr(this,kr,new MutationObserver((()=>{this.elements.forEach((t=>{this.domNode.contains(t.owner.domNode)||t.domNode.remove()}))})),"f"),Vr(this,kr,"f").observe(t,{childList:!0,subtree:!0})}get elements(){return Vr(this,Dr,"f").elements}set elements(t){Vr(this,Dr,"f").elements=t}}Dr=new WeakMap,kr=new WeakMap;var zr,Xr,Gr=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},Rr=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Yr{constructor(t){this.domNode=t,zr.set(this,void 0),Gr(this,zr,new Fr(t),"f")}get baseNumberings(){return Rr(this,zr,"f").elements}set baseNumberings(t){Rr(this,zr,"f").elements=t}number(t,e){let r=Ir.BaseNumbering.numbering(t,e);return this.domNode.insertBefore(r.domNode,t.domNode),Rr(this,zr,"f").elements.push(r),r}}zr=new WeakMap;class qr{constructor(t){this.domNode=t,Xr.set(this,void 0),Gr(this,Xr,new Fr(t),"f")}get baseNumberingLines(){return Rr(this,Xr,"f").elements}set baseNumberingLines(t){Rr(this,Xr,"f").elements=t}connect(t){let e=Ir.BaseNumberingLine.connecting(t);return this.domNode.insertBefore(e.domNode,t.domNode),Rr(this,Xr,"f").elements.push(e),e}}Xr=new WeakMap;var Ur,Hr=r(775),Wr=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class $r{constructor(t){this.domNode=t,Ur.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,Ur,new Fr(t),"f")}get baseOutlines(){return Wr(this,Ur,"f").elements}set baseOutlines(t){Wr(this,Ur,"f").elements=t}append(t){this.domNode.append(t.domNode),this.baseOutlines.push(t)}outline(t){let e=Hr.BaseOutline.outlining(t);return t.domNode.insertAdjacentElement("beforebegin",e.domNode),this.baseOutlines.push(e),e}}Ur=new WeakMap;var Qr=r(282);class Jr{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new jr(t,e),new MutationObserver((()=>{this.bonds.forEach((t=>{this.svgDoc.contains(t.base1.domNode)&&this.svgDoc.contains(t.base2.domNode)||t.remove()}))})).observe(t,{childList:!0,subtree:!0})}get bonds(){return this.elementsDrawing.elements}set bonds(t){this.elementsDrawing.elements=t}}class Kr{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#808080","stroke-width":"1"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Jr(t,e)}get primaryBonds(){return this.bondsDrawing.bonds}set primaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.primaryBonds.push(t)}add(t,e){let r=Qr.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}class Zr{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Jr(t,e)}get secondaryBonds(){return this.bondsDrawing.bonds}set secondaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.secondaryBonds.push(t)}add(t,e){let r=Qr.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}var tn,en=r(854),rn=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class nn{constructor(t){if(tn.set(this,void 0),!(0,en.isNonNullObject)(t))throw new Error("Saved drawings must be non-null objects.");!function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,tn,t,"f")}get outerXML(){if((0,en.isString)(rn(this,tn,"f").outerXML))return rn(this,tn,"f").outerXML;if((0,en.isString)(rn(this,tn,"f").svg))return rn(this,tn,"f").svg;throw new Error("Unable to find the outer XML of the saved drawing.")}get bases(){if((0,en.isArray)(rn(this,tn,"f").bases)){if(!rn(this,tn,"f").bases.every(en.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return rn(this,tn,"f").bases}if((0,en.isArray)(rn(this,tn,"f").sequences)){if(!rn(this,tn,"f").sequences.every(en.isNonNullObject))throw new Error("Saved sequences must be non-null objects.");let t=rn(this,tn,"f").sequences.flatMap((t=>t.bases));if(!t.every(en.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return t}return[]}get outlines(){if((0,en.isArray)(rn(this,tn,"f").outlines))return rn(this,tn,"f").outlines;if((0,en.isArray)(rn(this,tn,"f").baseOutlines))return rn(this,tn,"f").baseOutlines;try{let t=this.bases;if(t.some((t=>t.outline)))return t.filter((t=>t.outline)).map((t=>{if(!(0,en.isNonNullObject)(t.outline))throw new Error("Saved outlines must be non-null objects.");return Object.assign(Object.assign({},t.outline),{ownerID:t.textId})}))}catch(t){}return[]}get numberings(){if((0,en.isArray)(rn(this,tn,"f").numberings))return rn(this,tn,"f").numberings;if((0,en.isArray)(rn(this,tn,"f").baseNumberings))return rn(this,tn,"f").baseNumberings;try{let t=this.bases;if(t.some((t=>t.numbering)))return t.filter((t=>t.numbering)).map((t=>{if(!(0,en.isNonNullObject)(t.numbering))throw new Error("Saved numberings must be non-null objects.");return Object.assign(Object.assign({},t.numbering),{ownerID:t.textId})}))}catch(t){}return[]}get numberingLines(){if((0,en.isArray)(rn(this,tn,"f").numberingLines))return rn(this,tn,"f").numberingLines;if((0,en.isArray)(rn(this,tn,"f").baseNumberingLines))return rn(this,tn,"f").baseNumberingLines;try{let t=this.bases;if(t.some((t=>t.numbering)))return t.filter((t=>t.numbering)).map((t=>t.numbering))}catch(t){}return[]}get primaryBonds(){return(0,en.isArray)(rn(this,tn,"f").primaryBonds)?rn(this,tn,"f").primaryBonds:[]}get secondaryBonds(){return(0,en.isArray)(rn(this,tn,"f").secondaryBonds)?rn(this,tn,"f").secondaryBonds:[]}}tn=new WeakMap;var sn,on,an,un,hn,cn=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},ln=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class fn{constructor(){sn.add(this),on.set(this,void 0),an.set(this,void 0),un.set(this,void 0),this.domNode=(new We).node,this.domNode.setAttribute("viewBox",`0 0 ${dn} ${mn}`),this.domNode.setAttribute("width",`${dn}`),this.domNode.setAttribute("height",`${mn}`),this.basesDrawing=new Tr(this.domNode,[]),cn(this,on,new Yr(this.domNode),"f"),cn(this,an,new qr(this.domNode),"f"),cn(this,un,new $r(this.domNode),"f"),this.primaryBondsDrawing=new Kr(this.domNode,[]),this.secondaryBondsDrawing=new Zr(this.domNode,[])}get outerXML(){return this.domNode.outerHTML}set outerXML(t){new Cr.OuterXML(this.domNode).set(t)}get innerXML(){return this.domNode.innerHTML}set innerXML(t){new Cr.InnerXML(this.domNode).set(t)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}get minX(){return this.domNode.viewBox.baseVal.x}set minX(t){let e=this.maxX-t,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${t} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get maxX(){return this.minX+this.width}set maxX(t){let e=t-this.minX,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get minY(){return this.domNode.viewBox.baseVal.y}set minY(t){let e=this.maxY-t,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${t} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}get maxY(){return this.minY+this.height}set maxY(t){let e=t-this.minY,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}setBoundaries({minX:t,maxX:e,minY:r,maxY:n}){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}get width(){return this.domNode.viewBox.baseVal.width}set width(t){this.maxX=this.minX+t}get height(){return this.domNode.viewBox.baseVal.height}set height(t){this.maxY=this.minY+t}get horizontalScaling(){let t=this.width;return this.domNode.width.baseVal.value/t}set horizontalScaling(t){let e=this.width;this.domNode.setAttribute("width",(t*e).toString())}get verticalScaling(){let t=this.height;return this.domNode.height.baseVal.value/t}set verticalScaling(t){let e=this.height;this.domNode.setAttribute("height",(t*e).toString())}setScaling(t){this.horizontalScaling=t,this.verticalScaling=t}get horizontalClientScaling(){return new Cr.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new Cr.VerticalClientScaling(this.domNode).get()}get bases(){return this.basesDrawing.bases}set bases(t){this.basesDrawing.bases=[...t]}appendBase(t){this.basesDrawing.append(t)}addBase(t){return this.basesDrawing.add(t)}number(t,e){let r=ln(this,on,"f").number(t,e),n=ln(this,an,"f").connect(r);return r.displacement.magnitude=10,n.direction=(0,Br.outwardNormal)(t,...ln(this,sn,"a",hn)),n.length=1.15*r.domNode.getBBox().height,[r,n]}get baseNumberings(){return ln(this,on,"f").baseNumberings}set baseNumberings(t){ln(this,on,"f").baseNumberings=[...t]}get baseNumberingLines(){return ln(this,an,"f").baseNumberingLines}set baseNumberingLines(t){ln(this,an,"f").baseNumberingLines=[...t]}get baseOutlines(){return ln(this,un,"f").baseOutlines}set baseOutlines(t){ln(this,un,"f").baseOutlines=[...t]}get outlines(){return this.baseOutlines}outlineBase(t){return ln(this,un,"f").outline(t)}outline(t){return this.outlineBase(t)}appendBaseOutline(t){ln(this,un,"f").append(t)}get primaryBonds(){return this.primaryBondsDrawing.primaryBonds}set primaryBonds(t){this.primaryBondsDrawing.primaryBonds=[...t]}appendPrimaryBond(t){this.primaryBondsDrawing.append(t)}addPrimaryBond(t,e){return this.primaryBondsDrawing.add(t,e)}get secondaryBonds(){return this.secondaryBondsDrawing.secondaryBonds}set secondaryBonds(t){this.secondaryBondsDrawing.secondaryBonds=[...t]}appendSecondaryBond(t){this.secondaryBondsDrawing.append(t)}addSecondaryBond(t,e){return this.secondaryBondsDrawing.add(t,e)}rotate(t,e){let r=new Set(t);for(let t of this.baseNumberings)if(r.has(t.owner)){let r=Ir.BaseNumberingLine.unpadded(t);this.domNode.append(r.domNode),r.direction+=e,r.domNode.remove()}(0,Br.rotate)(t,e)}get defaultValues(){let t=this.primaryBondsDrawing,e=this.secondaryBondsDrawing;return{get primaryBonds(){return t.defaultValues},set primaryBonds(e){t.defaultValues=e},get secondaryBonds(){return e.defaultValues},set secondaryBonds(t){e.defaultValues=t}}}get contentBBox(){return this.domNode.getBBox()}setPadding(t){let e=this.contentBBox;this.setBoundaries({minX:e.x-t,maxX:e.x+e.width+t,minY:e.y-t,maxY:e.y+e.height+t})}reset(){this.domNode.innerHTML="",this.basesDrawing.bases=[],ln(this,un,"f").baseOutlines=[],this.primaryBondsDrawing.primaryBonds=[],this.secondaryBondsDrawing.secondaryBonds=[],[...this.domNode.attributes].forEach((t=>this.domNode.removeAttribute(t.name))),this.domNode.setAttribute("viewBox",`0 0 ${dn} ${mn}`),this.domNode.setAttribute("width",`${dn}`),this.domNode.setAttribute("height",`${mn}`)}serialized(){return{outerXML:this.outerXML,bases:[...this.bases].map((t=>t.serialized())),baseNumberings:[...this.baseNumberings].map((t=>t.serialized())),baseNumberingLines:[...this.baseNumberingLines].map((t=>t.serialized())),baseOutlines:[...this.baseOutlines].map((t=>t.serialized())),primaryBonds:[...this.primaryBonds].map((t=>t.serialized())),secondaryBonds:[...this.secondaryBonds].map((t=>t.serialized()))}}static deserialized(t){let e=new nn(t),r=new fn,n=document.createElement("div");n.append(r.domNode),n.style.width="0px",n.style.height="0px",document.body.append(n),r.outerXML=e.outerXML;let i=r.domNode;r.bases=e.bases.map((t=>Er.Nucleobase.deserialized(t,r)));let s=[...r.bases];r.baseNumberings=e.numberings.map((t=>Ir.BaseNumbering.deserialized(t,{domNode:i,bases:s})));let o=[...r.baseNumberings];return r.baseNumberingLines=e.numberingLines.map((t=>Ir.BaseNumberingLine.deserialized(t,{domNode:i,baseNumberings:o}))),r.baseOutlines=e.outlines.map((t=>Hr.BaseOutline.deserialized(t,r))),r.primaryBonds=e.primaryBonds.map((t=>Qr.StraightBond.deserialized(t,r))),r.secondaryBonds=e.secondaryBonds.map((t=>Qr.StraightBond.deserialized(t,r))),r.domNode.remove(),n.remove(),r}restore(t){let e=fn.deserialized(t),r=[...e.bases],n=[...e.baseNumberings],i=[...e.baseNumberingLines],s=[...e.baseOutlines],o=[...e.primaryBonds],a=[...e.secondaryBonds];this.reset(),[...this.domNode.attributes].forEach((t=>this.domNode.removeAttribute(t.name))),[...e.domNode.attributes].forEach((t=>this.domNode.setAttribute(t.name,t.value))),[...e.domNode.childNodes].forEach((t=>this.domNode.appendChild(t))),this.bases=r,this.baseNumberings=n,this.baseNumberingLines=i,this.baseOutlines=s,this.primaryBonds=o,this.secondaryBonds=a}}on=new WeakMap,an=new WeakMap,un=new WeakMap,sn=new WeakSet,hn=function(){return[[...this.bases],this.secondaryBondsDrawing.secondaryBonds.map((t=>t.basePair))]};const dn=250,mn=250;var pn=r(127),gn=r(986);class yn{constructor(t){this.targetDrawing=t}draw(t,e){let r=[...t].map((t=>this.targetDrawing.addBase(t)));(0,pn.consecutivePairs)(r).forEach((t=>this.targetDrawing.addPrimaryBond(...t)));let n=[...(0,pn.parseDotBracket)(r,e)];n.forEach((t=>this.targetDrawing.addSecondaryBond(...t))),r.forEach((t=>t.bringToFront()));let i=1.87*(0,gn.mean)(r.map((t=>t.bbox.height)));(0,Br.untangle)(r,n,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2})}}var bn,wn=r(297),vn=r(369),xn=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _n{constructor(t){bn.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,bn,t,"f")}draw(t){let e=(0,wn.parseCT)(t),r=[...e.sequence].map((t=>xn(this,bn,"f").addBase(t)));(0,pn.consecutivePairs)(r).forEach((t=>xn(this,bn,"f").addPrimaryBond(...t)));let n=(0,vn.basePairs)(r,e.positionPairs);n.forEach((t=>xn(this,bn,"f").addSecondaryBond(...t)));let i=1.87*(0,gn.mean)(r.map((t=>t.bbox.height)));(0,Br.untangle)(r,n,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2}),!(r.length>0)||xn(this,bn,"f").number(r[0],1+e.numberingOffset),r.slice(0,-20).forEach(((t,r)=>{let n=r+1;n%20!=0||xn(this,bn,"f").number(t,n+e.numberingOffset)})),!(r.length>0)||xn(this,bn,"f").number(r[r.length-1],r.length+e.numberingOffset),r.forEach((t=>t.bringToFront()))}}bn=new WeakMap;var Sn,Nn,Mn,Pn,On=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class An{constructor(t){Sn.add(this),Nn.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,Nn,t,"f")}draw(t){t.rnaComplexes.forEach((e=>{e.rnaMolecules.forEach((e=>{let r=e.sequence.map((e=>On(this,Sn,"m",Mn).call(this,e,t))),n=(0,gn.mean)(r.map((t=>t.bbox.height)));On(this,Nn,"f").defaultValues.primaryBonds.attributes["stroke-width"]=""+.125*n,On(this,Nn,"f").defaultValues.primaryBonds.basePadding1=.6*n,On(this,Nn,"f").defaultValues.primaryBonds.basePadding2=.6*n,(0,pn.consecutivePairs)(r).forEach((t=>On(this,Nn,"f").addPrimaryBond(...t))),On(this,Nn,"f").defaultValues.secondaryBonds.attributes["stroke-width"]=""+.15*n,On(this,Nn,"f").defaultValues.secondaryBonds.basePadding1=.5*n,On(this,Nn,"f").defaultValues.secondaryBonds.basePadding2=.5*n,new Set(e.basePairs.map((t=>JSON.stringify(t)))).forEach((e=>On(this,Sn,"m",Pn).call(this,JSON.parse(e),r,t)))}))}))}}Nn=new WeakMap,Sn=new WeakSet,Mn=function(t,e){let r=On(this,Nn,"f").addBase(t.residueName);return t.classes.forEach((t=>{e.classes.filter((e=>e.name==t)).forEach((t=>r.setAttributes(Object.assign(Object.assign({},t),{name:void 0}))))})),r.centerPoint.x=t.x,r.centerPoint.y=t.y,r},Pn=function(t,e,r){let n=e[t.residueIndex1],i=e[t.residueIndex2],s=On(this,Nn,"f").addSecondaryBond(n,i);return t.classes.forEach((t=>{r.classes.filter((e=>e.name==t)).forEach((t=>s.setAttributes(Object.assign(Object.assign({},t),{name:void 0}))))})),s}})(),n})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.draw=e():t.draw=e()}(this,(()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={369:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>y,Stems:()=>g,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>b,parseDotBracket:()=>w,radializable:()=>p,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}function p(t){var e=i(t);e.sort((function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)}));var r=[],n=[];return e.forEach((function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)})),m(r)}var g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),y=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(g.bind.apply(g,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function w(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}function v(t,e){return e.forEach((function(e){e.forEach((function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")}))})),e.map((function(e){return[t[e[0]-1],t[e[1]-1]]}))}})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>i,LastPairedBase:()=>o,LeadingDanglingBases:()=>a,Linkers:()=>l,PositionPairs:()=>e,Stems:()=>c,TrailingDanglingBases:()=>u,consecutivePairs:()=>p,knotless:()=>f,other:()=>t,parseDotBracket:()=>m,radializable:()=>d});class e{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];return this.targetStructure[1].map((e=>[t.indexOf(e[0])+1,t.indexOf(e[1])+1]))}}class i{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat(),n=t.findIndex((t=>r.includes(t)));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var s=r(986);class o{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat().map((e=>t.indexOf(e)));if((0,s.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,s.max)(r)]}}class a{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new i(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)}}class u{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new o(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)}}var h=r(369);class c{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Stems(t,r).get().map((e=>e.map((e=>[t[e[0]-1],t[e[1]-1]]))))}}class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Linkers(t,r).get().map((e=>e.map((e=>t[e-1]))))}}function f(...t){let[r,n]=t,i=new e(...t).get();(0,h.areKnotless)(i)||(i=(0,h.knotless)(i));let s=i.map((t=>[r[t[0]-1],r[t[1]-1]]));return[[...r],s]}function d(...t){let[r,n]=t,i=new e(...t).get();return[[...r],(0,h.radializable)(i).map((([t,e])=>[r[t-1],r[e-1]]))]}function m(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map((e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]}))}function p(t){return t.length<2?[]:t.slice(0,-1).map(((e,r)=>[t[r],t[r+1]]))}})(),n})(),t.exports=e()},282:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}t.r(e),t.d(e,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,sendToBack:()=>g,setAttributes:()=>r});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=i[s];return e}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}return v=new WeakMap,e})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function m(t,e){return d([t,e])}})(),n})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{InvertedStraightBondsHider:()=>Br,StraightBond:()=>kr});var t={};r.r(t),r.d(t,{cx:()=>It,cy:()=>Lt,height:()=>Ft,rx:()=>Tt,ry:()=>Dt,width:()=>Vt,x:()=>kt,y:()=>Bt});var e={};r.r(e),r.d(e,{from:()=>Rt,to:()=>qt});var i={};r.r(i),r.d(i,{MorphArray:()=>Qt,height:()=>te,width:()=>Zt,x:()=>Jt,y:()=>Kt});var s={};r.r(s),r.d(s,{array:()=>Ee,clear:()=>Ae,move:()=>Ce,plot:()=>je,size:()=>Te});var o={};r.r(o),r.d(o,{amove:()=>or,ax:()=>ir,ay:()=>sr,build:()=>ar,center:()=>nr,cx:()=>er,cy:()=>rr,length:()=>Je,move:()=>tr,plain:()=>Qe,x:()=>Ke,y:()=>Ze});var a={};r.r(a),r.d(a,{dmove:()=>dr,dx:()=>mr,dy:()=>pr,height:()=>gr,move:()=>yr,size:()=>br,width:()=>wr,x:()=>vr,y:()=>xr});const u={},h=[];function c(t,e){if(Array.isArray(t))for(const r of t)c(r,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const e in t)c(e,t[e])}function l(t){return u[t]||{}}function f(t){h.push(...t)}function d(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function m(t){return t%360*Math.PI/180}function p(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function y(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const b=new Set(["desc","metadata","title"]),w=t=>b.has(t.nodeName),v=(t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},x="http://www.w3.org/2000/svg",_="http://www.w3.org/2000/xmlns/",S="http://www.w3.org/1999/xlink",N={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class M{}const P={},O="___SYMBOL___ROOT___";function E(t,e=x){return N.document.createElementNS(e,t)}function A(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return T(t);if(null==t)return new P[O];if("string"==typeof t&&"<"!==t.charAt(0))return T(N.document.querySelector(t));const r=e?N.document.createElement("div"):E("svg");return r.innerHTML=t,t=T(r.firstChild),r.removeChild(r.firstChild),t}function C(t,e){return e&&(e instanceof N.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:E(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new P.Fragment(t);let e=p(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":P[e]||(e="Dom"),new P[e](t)}let T=j;function D(t,e=t.name,r=!1){return P[e]=t,r&&(P[O]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let k=1e3;function B(t){return"Svgjs"+p(t)+k++}function I(t){for(let e=t.children.length-1;e>=0;e--)I(t.children[e]);return t.id?(t.id=B(t.nodeName),t):t}function L(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function V(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}c("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=A(t)).before(this),this},insertAfter:function(t){return(t=A(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,q=/\s/g,Y=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,U=/^rgb\(/,H=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,J=/[MLHVCSQTAZ]/i;function K(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Z(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function tt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),c("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,r){if(null==t)return this.data(d(function(t){let e;const r=t.length,n=[];for(e=0;e<r;e++)0===t[e].nodeName.indexOf("data-")&&n.push(t[e]);return n}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class et{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof et||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:r,round:n,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new et(t,e,n,"lch")}if("sine"===t){const t=n(80*i(2*s*(e=null==e?r():e)/.5+.01)+150),o=n(50*i(2*s*e/.5+4.6)+200),a=n(100*i(2*s*e/.5+2.3)+150);return new et(t,o,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new et(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new et(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new et(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new et(t,e,n,"lab")}if("grey"===t){const t=255*r();return new et(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Y.test(t)||U.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new et(0,0,0,1,"cmyk"):new et((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new et(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=Z(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Z(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Z(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Z(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Z(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Z(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(U.test(t)){const e=t.replace(q,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!Y.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=z.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new et(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new et(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new et(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new et(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*tt(i,n,t+1/3),o=255*tt(i,n,t),a=255*tt(i,n,t-1/3);return new et(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new et(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(K);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new et(f,d,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function nt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class it{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),m=d.x,p=d.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,px:m,py:p}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new it(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),m=Math.sin(l),p=(r*i+n*s)/u,g=i*c/(p*r-n)||s*c/(p*n+r);return{scaleX:c,scaleY:g,shear:p,rotate:f,translateX:o-t+t*d*c+e*(p*d*c-m*g),translateY:a-e+t*m*c+e*(p*m*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new it(t);return nt(this.a,e.a)&&nt(this.b,e.b)&&nt(this.c,e.c)&&nt(this.d,e.d)&&nt(this.e,e.e)&&nt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=it.fromArray([1,0,0,1,0,0]);return t=t instanceof Ot?t.matrixify():"string"==typeof t?it.fromArray(t.split(Q).map(parseFloat)):Array.isArray(t)?it.fromArray(t):"object"==typeof t&&it.isMatrixLike(t)?t:"object"==typeof t?(new it).transform(t):6===arguments.length?it.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=m(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:c}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-c*i+r*i-e*n+e,this.f=c*n+h*i-e*i-r*n+r,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:c,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=c+l*i-n*i,this.f=l+c*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(it.isMatrixLike(t))return new it(t).multiplyO(this);const e=it.formatTransforms(t),{x:r,y:n}=new rt(e.ox,e.oy).transform(this),i=(new it).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new rt(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function st(){if(!st.nodes){const t=A().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;st.nodes={svg:t,path:e}}if(!st.nodes.svg.node.parentNode){const t=N.document.body||N.document.documentElement;st.nodes.svg.addTo(t)}return st.nodes}function ot(t){return!(t.width||t.height||t.x||t.y)}D(it,"Matrix");class at{constructor(...t){this.init(...t)}addOffset(){return this.x+=N.window.pageXOffset,this.y+=N.window.pageYOffset,new at(this)}init(t){return t="string"==typeof t?t.split(Q).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ot(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new at(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof it||(t=new it(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new at(e,n,r-e,i-n)}}function ut(t,e,r){let n;try{if(n=e(t.node),ot(n)&&(i=t.node)!==N.document&&!(N.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===N.document}).call(N.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}c({viewbox:{viewbox(t,e,r,n){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new rt(r/2/s+i.x,n/2/o+i.y);const h=new at(i).transform(new it({scale:u,origin:e}));return this.viewbox(h)}}}),D(at,"Box");class ht extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const ct=ht;L([ht],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const lt=["toArray","constructor","each"];function ft(t,e){return new ct(d((e||N.document).querySelectorAll(t),(function(t){return j(t)})))}ht.extend=function(t){t=t.reduce(((t,e)=>(lt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),L([ht],t)};let dt=0;const mt={};function pt(t){let e=t.getEventHolder();return e===N.window&&(e=mt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,r,n,i){const s=r.bind(n||t),o=A(t),a=pt(o),u=gt(o);e=Array.isArray(e)?e:e.split(Q),r._svgjsListenerId||(r._svgjsListenerId=++dt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function bt(t,e,r,n){const i=A(t),s=pt(i),o=gt(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])bt(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&bt(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])bt(o,[e,u].join("."));delete s[e]}}else{for(t in s)bt(o,t);!function(t){let e=t.getEventHolder();e===N.window&&(e=mt),e.events&&(e.events={})}(i)}}))}class wt extends M{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=gt(t);return e instanceof N.window.Event||(e=new N.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return bt(this,t,e,r),this}on(t,e,r,n){return yt(this,t,e,r,n),this}removeEventListener(){}}function vt(){}D(wt,"EventTarget");const xt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class _t extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Q).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class St{constructor(...t){this.init(...t)}convert(t){return new St(this.value,t)}divide(t){return t=new St(t),new St(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof St&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new St(t),new St(this-t,this.unit||t.unit)}plus(t){return t=new St(t),new St(this+t,this.unit||t.unit)}times(t){return t=new St(t),new St(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Nt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Mt=[];class Pt extends wt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=A(t)).removeNamespace&&this.node instanceof N.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return A(t).put(this,e)}children(){return new ct(d(this.node.children,(function(t){return j(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let r=this.node.cloneNode(t);return e&&(r=I(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new Pt(E(t),e))}first(){return j(this.node.firstChild)}get(t){return j(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=B(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=A(t),this.add(t,e),t}putIn(t,e){return A(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=A(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,x)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=j(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=E("wrapper",r),i=N.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}L(Pt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=W.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?xt[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=Mt.reduce(((e,r)=>r(t,e,this)),e))?e=new St(e):Nt.has(t)&&et.isColor(e)?e=new et(e):e.constructor===Array&&(e=new _t(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return ft(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),D(Pt,"Dom");class Ot extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new St(t).plus(this.x()))}dy(t=0){return this.y(new St(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=A(t));const r=new ct;let n=this;for(;(n=n.parent())&&n.node!==N.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?A(e[1]):null}root(){const t=this.parent(P[O]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=g(this,t,e);return this.width(new St(r.width)).height(new St(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}L(Ot,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(st().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new at(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.height},point:function(t,e){return new rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new it(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new it(e)}return new it(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new it}}}),D(Ot,"Element");const Et={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let r;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof et||et.isRgb(e)||e instanceof Ot)this.attr(t,e);else for(r=Et[t].length-1;r>=0;r--)null!=e[Et[t][r]]&&this.attr(Et.prefix(t,Et[t][r]),e[Et[t][r]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new it(this):this.attr("transform",new it(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new St(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(it.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new it)},toParent:function(t,e){if(this===t)return this;if(w(this.node))return this.addTo(t,e);const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new it(this).decompose();return null==t?e:e[t]}it.isMatrixLike(t)||(t={...t,origin:y(t,this)});const r=new it(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class At extends Ot{flatten(){return this.each((function(){if(this instanceof At)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}D(At,"Container");class Ct extends At{constructor(t,e=t){super(C("defs",t),e)}flatten(){return this}ungroup(){return this}}D(Ct,"Defs");class jt extends Ot{}function Tt(t){return this.attr("rx",t)}function Dt(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Bt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Vt(t){return null==t?2*this.rx():this.rx(new St(t).divide(2))}function Ft(t){return null==t?2*this.ry():this.ry(new St(t).divide(2))}D(jt,"Shape");class zt extends jt{constructor(t,e=t){super(C("ellipse",t),e)}size(t,e){const r=g(this,t,e);return this.rx(new St(r.width).divide(2)).ry(new St(r.height).divide(2))}}L(zt,t),c("Container",{ellipse:V((function(t=0,e=t){return this.put(new zt).size(t,e).move(0,0)}))}),D(zt,"Ellipse");class Xt extends Pt{constructor(t=N.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(E("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}D(Xt,"Fragment");const Gt=Xt;function Rt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new St(t),fy:new St(e)}):this.attr({x1:new St(t),y1:new St(e)})}function qt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new St(t),cy:new St(e)}):this.attr({x2:new St(t),y2:new St(e)})}class Yt extends At{constructor(t,e){super(C(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}L(Yt,e),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:V((function(t,e){return this.put(new Yt(t)).update(e)}))}}),D(Yt,"Gradient");class Ut extends At{constructor(t,e=t){super(C("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}c({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:V((function(t,e,r){return this.put(new Ut).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Ut,"Pattern");class Ht extends jt{constructor(t,e=t){super(C("image",t),e)}load(t,e){if(!t)return this;const r=new N.window.Image;return yt(r,"load",(function(t){const n=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof Ut&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(r,"load error",(function(){bt(r)})),this.attr("href",r.src=t,S)}}var Wt;Wt=function(t,e,r){return"fill"!==t&&"stroke"!==t||$.test(e)&&(e=r.root().defs().image(e)),e instanceof Ht&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Mt.push(Wt),c({Container:{image:V((function(t,e){return this.put(new Ht).size(0,0).load(t,e)}))}}),D(Ht,"Image");class $t extends _t{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new at(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e<r;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));for(let e=this.length;e--;){const[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}const Qt=$t;function Jt(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function Kt(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Zt(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function te(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class ee extends jt{constructor(t,e=t){super(C("line",t),e)}array(){return new $t([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new $t(t).toLine(),this.attr(t))}size(t,e){const r=g(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}L(ee,i),c({Container:{line:V((function(...t){return ee.prototype.plot.apply(this.put(new ee),null!=t[0]?t:[0,0,0,0])}))}}),D(ee,"Line");class re extends At{constructor(t,e=t){super(C("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ne(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:V((function(t,e,r){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),D(re,"Marker");const ie={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class se{done(){return!1}}class oe extends se{constructor(t=">"){super(),this.ease=ie[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class ae extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}L(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:ne("_duration",ue),overshoot:ne("_overshoot",ue)}),L(class extends ae{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ne("_windup"),p:ne("P"),i:ne("I"),d:ne("D")});const he={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let t=0,e=le.length;t<e;++t)ce[le[t]]=function(t){return function(e,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return ce[t](e,r,n)}}(le[t].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===he[t.segment[0].toUpperCase()]}function de(t,e){t.inNumber&&me(t,!1);const r=J.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function me(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fe(t)&&pe(t)}function pe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ge(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ye(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);class we extends _t{bbox(){return st().path.setAttribute("d",this.toString()),new at(st.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!de(i,n))if("."!==n)if(isNaN(parseInt(n)))if(be.has(n))i.inNumber&&me(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(J.test(n)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");pe(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ye(i)){me(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||ge(i)){i.inNumber=!0,i.number=n,me(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){me(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&pe(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const ve=t=>{const e=typeof t;return"number"===e?St:"string"===e?et.isColor(t)?et:Q.test(t)?J.test(t)?we:_t:F.test(t)?St:_e:Pe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?_t:"object"===e?Me:_e};class xe{constructor(t){this._stepper=t||new oe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ve(t));let e=new this._type(t);return this._type===et&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ne=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class Me{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===et&&t[r+7]!==e[r+7]){const e=t[r+7],n=new et(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=ve(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(Ne),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const Pe=[_e,Se,Me];class Oe extends jt{constructor(t,e=t){super(C("path",t),e)}array(){return this._array||(this._array=new we(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new we(t))}size(t,e){const r=g(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function Ee(){return this._array||(this._array=new $t(this.attr("points")))}function Ae(){return delete this._array,this}function Ce(t,e){return this.attr("points",this.array().move(t,e))}function je(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new $t(t))}function Te(t,e){const r=g(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}Oe.prototype.MorphArray=we,c({Container:{path:V((function(t){return this.put(new Oe).plot(t||new we)}))}}),D(Oe,"Path");class De extends jt{constructor(t,e=t){super(C("polygon",t),e)}}c({Container:{polygon:V((function(t){return this.put(new De).plot(t||new $t)}))}}),L(De,i),L(De,s),D(De,"Polygon");class ke extends jt{constructor(t,e=t){super(C("polyline",t),e)}}c({Container:{polyline:V((function(t){return this.put(new ke).plot(t||new $t)}))}}),L(ke,i),L(ke,s),D(ke,"Polyline");class Be extends jt{constructor(t,e=t){super(C("rect",t),e)}}L(Be,{rx:Tt,ry:Dt}),c({Container:{rect:V((function(t,e){return this.put(new Be).size(t,e)}))}}),D(Be,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>N.window.performance||N.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const r=Le.timer().now()+e,n=Le.timeouts.push({run:t,time:r});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),n},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const r=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==r););let n=null;const i=Le.frames.last();for(;n!==i&&(n=Le.frames.shift());)n.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?N.window.requestAnimationFrame(Le._draw):null}},Ve=Le,Fe=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},ze=function(){const t=N.window;return(t.performance||t.Date).now()};class Xe extends wt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Fe);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ge extends wt{constructor(t){super(),this.id=Ge.id++,t="function"==typeof(t=null==t?400:t)?new ae(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ae,this._stepper=this._isDeclarative?t:new oe,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new it,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e??0,r=r||"last","object"!=typeof(t=t??400)||t instanceof se||(e=t.delay??e,r=t.when??r,i=t.swing||i,n=t.times??n,s=t.wait??s,t=t.duration??400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=Ge.sanitise(t,e,r),i=new Ge(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new it,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new oe(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,r,n){return this._queue.push({initialiser:t||vt,runner:e||vt,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,r){if(t instanceof Xe||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new it,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Ge.id=0;class Re{constructor(t=new it,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}L([Ge,Re],{mergeWith(t){return new Re(t.transforms.lmultiply(this.transforms),t.id)}});const qe=(t,e)=>t.lmultiplyO(e),Ye=t=>t.transforms;function Ue(){const t=this._transformationRunners.runners.map(Ye).reduce(qe,new it);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class He{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Re).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}c({Element:{animate(t,e,r){const n=Ge.sanitise(t,e,r),i=this.timeline();return new Ge(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ye).reduce(qe,new it)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(Ue.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new He).add(new Re(new it(this))))}}}),L(Ge,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new xe(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Me(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Me(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new xe(this._stepper).to(new St(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=it.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new xe(this._stepper).type(r?Se:it);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||y(t,o),h=new it(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new rt(s).transform(o._currentTransform(this));let d=new it({...t,origin:[l,f]}),m=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),m=m.decompose(l,f);const t=d.rotate,e=m.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(m.rotate=u)),i.from(m),i.to(d);const p=i.at(c);return u=p.rotate,a=new it(p),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=y(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new St(e),this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new St(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new St(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new at(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),L(Ge,{rx:Tt,ry:Dt,from:Rt,to:qt}),D(Ge,"Runner");class We extends At{constructor(t,e=t){super(C("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new Ct):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof N.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:x,version:"1.1"}).attr("xmlns:xlink",S,_):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,_).attr("xmlns:svgjs",null,_)}root(){return this.isRoot()?this:super.root()}}c({Container:{nested:V((function(){return this.put(new We)}))}}),D(We,"Svg",!0);class $e extends At{constructor(t,e=t){super(C("symbol",t),e)}}function Qe(t){return!1===this._build&&this.clear(),this.node.appendChild(N.document.createTextNode(t)),this}function Je(){return this.node.getComputedTextLength()}function Ke(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Ze(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function tr(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function er(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function rr(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function nr(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function ir(t){return this.attr("x",t)}function sr(t){return this.attr("y",t)}function or(t,e){return this.ax(t).ay(e)}function ar(t){return this._build=!!t,this}c({Container:{symbol:V((function(){return this.put(new $e)}))}}),D($e,"Symbol");class ur extends jt{constructor(t,e=t){super(C("text",t),e),this.dom.leading=this.dom.leading??new St(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new St(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){if(w(this.node))return;const i=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new St(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new St(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"===e[n].nodeName||w(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===j(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}L(ur,o),c({Container:{text:V((function(t=""){return this.put(new ur).text(t)})),plain:V((function(t=""){return this.put(new ur).plain(t)}))}}),D(ur,"Text");class hr extends jt{constructor(t,e=t){super(C("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ur))return this;const e=t.index(this),r=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new St(r);return this.dy(e?n:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}L(hr,o),c({Tspan:{tspan:V((function(t=""){const e=new hr;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),D(hr,"Tspan");class cr extends jt{constructor(t,e=t){super(C("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new St(t).divide(2))}}L(cr,{x:kt,y:Bt,cx:It,cy:Lt,width:Vt,height:Ft}),c({Container:{circle:V((function(t=0){return this.put(new cr).size(t).move(0,0)}))}}),D(cr,"Circle");class lr extends At{constructor(t,e=t){super(C("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return ft("svg [clip-path*="+this.id()+"]")}}c({Container:{clip:V((function(){return this.defs().put(new lr)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lr?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),D(lr,"ClipPath");class fr extends Ot{constructor(t,e=t){super(C("foreignObject",t),e)}}function dr(t,e){return this.children().forEach((r=>{let n;try{n=r.node instanceof N.window.SVGSVGElement?new at(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new it(r),s=i.translate(t,e).transform(i.inverse()),o=new rt(n.x,n.y).transform(s);r.move(o.x,o.y)})),this}function mr(t){return this.dmove(t,0)}function pr(t){return this.dmove(0,t)}function gr(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function yr(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function br(t,e,r=this.bbox()){const n=g(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach((t=>{const e=new rt(r).transform(new it(t).inverse());t.scale(i,s,e.x,e.y)})),this}function wr(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function vr(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function xr(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}c({Container:{foreignObject:V((function(t,e){return this.put(new fr).size(t,e)}))}}),D(fr,"ForeignObject");class _r extends At{constructor(t,e=t){super(C("g",t),e)}}L(_r,a),c({Container:{group:V((function(){return this.put(new _r)}))}}),D(_r,"G");class Sr extends At{constructor(t,e=t){super(C("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,S)}}L(Sr,a),c({Container:{link:V((function(t){return this.put(new Sr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Sr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),D(Sr,"A");class Nr extends At{constructor(t,e=t){super(C("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return ft("svg [mask*="+this.id()+"]")}}c({Container:{mask:V((function(){return this.defs().put(new Nr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Nr?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),D(Nr,"Mask");class Mr extends Ot{constructor(t,e=t){super(C("stop",t),e)}update(t){return("number"==typeof t||t instanceof St)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new St(t.offset)),this}}c({Gradient:{stop:function(t,e,r){return this.put(new Mr).update(t,e,r)}}}),D(Mr,"Stop");class Pr extends Ot{constructor(t,e=t){super(C("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}c("Dom",{style(t,e){return this.put(new Pr).rule(t,e)},fontface(t,e,r){return this.put(new Pr).font(t,e,r)}}),D(Pr,"Style");class Or extends ur{constructor(t,e=t){super(C("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}c({Container:{textPath:V((function(t,e){return t instanceof ur||(t=this.text(t)),t.path(e)}))},Text:{path:V((function(t,e=!0){const r=new Or;let n;if(t instanceof Oe||(t=this.defs().path(t)),r.attr("href","#"+t,S),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:V((function(t){return t instanceof ur||(t=(new ur).addTo(this.parent()).text(t)),t.path(this)})),targets(){return ft("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Or.prototype.MorphArray=we,D(Or,"TextPath");class Er extends jt{constructor(t,e=t){super(C("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,S)}}c({Container:{use:V((function(t,e){return this.put(new Er).use(t,e)}))}}),D(Er,"Use"),L([We,$e,Ht,Ut,re],l("viewbox")),L([ee,ke,De,Oe],l("marker")),L(ur,l("Text")),L(Oe,l("Path")),L(Ct,l("Defs")),L([ur,hr],l("Tspan")),L([Be,zt,Yt,Ge],l("radius")),L(wt,l("EventTarget")),L(Pt,l("Dom")),L(Ot,l("Element")),L(jt,l("Shape")),L([At,Gt],l("Container")),L(Yt,l("Gradient")),L(Ge,l("Runner")),ct.extend([...new Set(h)]),function(t=[]){Pe.push(...[].concat(t))}([St,et,at,it,_t,$t,we,rt]),L(Pe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ar=r(726),Cr=r(725),jr=r(854);const Tr=["basePadding1","basePadding2"],Dr={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"};class kr{static between(t,e){let r=(new ee).node,n=new kr(r,t,e);return n.assignUUID(),n.set(kr.defaultValues),n.reposition(),n}constructor(t,e,r){this.line=t,this.base1=e,this.base2=r,this.cachedBasePadding1=(0,Cr.distance)(this.point1,this.base1.centerPoint),this.cachedBasePadding2=(0,Cr.distance)(this.point2,this.base2.centerPoint),e.centerPoint.addEventListener("move",(()=>this.reposition())),r.centerPoint.addEventListener("move",(()=>this.reposition()))}get basePair(){return[this.base1,this.base2]}get domNode(){return this.line}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){if((0,jr.isNonNullObject)(t))try{new ee(this.domNode).attr(t)}catch(t){}}get id(){return this.domNode.id}assignUUID(){(0,Ar.assignUUID)(this.domNode)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}getTotalLength(){return this.domNode.getTotalLength()}getPointAtLength(t){return this.domNode.getPointAtLength(t)}get point1(){return{x:this.domNode.x1.baseVal.value,y:this.domNode.y1.baseVal.value}}get point2(){return{x:this.domNode.x2.baseVal.value,y:this.domNode.y2.baseVal.value}}get basePadding1(){return this.cachedBasePadding1}set basePadding1(t){this.cachedBasePadding1=t,this.reposition()}setBasePadding1(t){(0,jr.isFiniteNumber)(t)&&(this.basePadding1=Math.max(0,t))}get basePadding2(){return this.cachedBasePadding2}set basePadding2(t){this.cachedBasePadding2=t,this.reposition()}setBasePadding2(t){(0,jr.isFiniteNumber)(t)&&(this.basePadding2=Math.max(0,t))}isInverted(){return this.basePadding1+this.basePadding2>(0,Cr.distance)(this.base1.centerPoint,this.base2.centerPoint)}set(t){try{this.setAttributes(t.attributes)}catch(t){}Tr.forEach((e=>{try{this[Dr[e]](t[e])}catch(t){}}))}reposition(){let t=this.base1.centerPoint,e=this.base2.centerPoint,r=(0,Cr.direction)(t,e);this.setAttribute("x1",`${t.x+this.basePadding1*Math.cos(r)}`),this.setAttribute("y1",`${t.y+this.basePadding1*Math.sin(r)}`),this.setAttribute("x2",""+(e.x-this.basePadding2*Math.cos(r))),this.setAttribute("y2",""+(e.y-this.basePadding2*Math.sin(r)))}serialized(){let t=this.id;if(!t)throw new Error("Straight bond ID is falsy.");let e=this.base1.id;if(!e)throw new Error("Base 1 ID is falsy.");let r=this.base2.id;if(!r)throw new Error("Base 2 ID is falsy.");return{id:t,baseID1:e,baseID2:r,basePadding1:this.basePadding1,basePadding2:this.basePadding2}}static deserialized(t,e){var r,n,i;if(!(0,jr.isNonNullObject)(t))throw new Error("Saved straight bond must be an object.");let s=null!==(r=t.id)&&void 0!==r?r:t.lineId;if(!s)throw new Error("Straight bond ID is missing.");let o=e.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find straight bond DOM node.");if(!(o instanceof SVGLineElement))throw new Error("Straight bond DOM node must be an SVG line element.");let a=null!==(n=t.baseID1)&&void 0!==n?n:t.baseId1,u=null!==(i=t.baseID2)&&void 0!==i?i:t.baseId2;if(!a)throw new Error("Missing base 1 ID.");if(!u)throw new Error("Missing base 2 ID.");let h=[...e.bases].find((t=>t.id===a)),c=[...e.bases].find((t=>t.id===u));if(!h)throw new Error("Unable to find base 1.");if(!c)throw new Error("Unable to find base 2.");let l=new kr(o,h,c);return(0,jr.isNumber)(t.basePadding1)&&(l.basePadding1=t.basePadding1),(0,jr.isNumber)(t.basePadding2)&&(l.basePadding2=t.basePadding2),l}}kr.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6};class Br{constructor(t,e){this.targetStraightBonds=t,new MutationObserver((t=>{let e=new Set([...this.targetStraightBonds].map((t=>t.domNode)));!t.some((t=>e.has(t.target)))||this.updateOpacities()})).observe(e,{attributes:!0,attributeFilter:["x1","y1","x2","y2"],subtree:!0})}updateOpacities(){[...this.targetStraightBonds].forEach((t=>{let e=t.isInverted()?"0":"1";t.setAttribute("opacity",e)}))}}})(),n})(),t.exports=e()},297:function(t){var e;e=()=>(()=>{var t={106:function(t){var e;e=()=>(()=>{var t={992:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{KeyBinding:()=>m});var r,n,i,s,o,a,u,h,c,l,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class m{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,(t=>d(this,r,"m",l).call(this,t)),"f"),f(this,s,a,"f")}get owner(){return d(this,o,"f")}set owner(t){var e;null===(e=d(this,o,"f"))||void 0===e||e.removeEventListener("keydown",d(this,i,"f")),null==t||t.addEventListener("keydown",d(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=d(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&t.key.toUpperCase()===this.key.toUpperCase()&&t.altKey===d(this,r,"a",a)&&t.ctrlKey===d(this,r,"a",u)&&t.metaKey===d(this,r,"a",h)&&t.shiftKey===d(this,r,"a",c)&&(t.preventDefault(),d(this,n,"f").call(this))},e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t){return t.split(/\r\n|\r|\n/)}function e(t){try{return JSON.stringify(t),!0}catch(t){return!1}}function i(t){return t.map((t=>({v:t,priority:Math.random()}))).sort(((t,e)=>t.priority-e.priority)).map((({v:t})=>t))}function s(t){return t===document.activeElement}function o(t){return!!document.activeElement&&t.contains(document.activeElement)}r.r(n),r.d(n,{DownloadableFile:()=>h,EventfulSet:()=>c,FiniteStack:()=>g,KeyBinding:()=>a.KeyBinding,containsFocus:()=>o,detectMacOS:()=>u,hasFocus:()=>s,isJSONSerializable:()=>e,isURL:()=>y,shuffled:()=>i,splitLines:()=>t});var a=r(992);function u(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}class h{constructor(t){this.textContent=t}downloadAs(t,e){let r=new File([this.textContent],t,{type:e.type}),n=URL.createObjectURL(r),i=document.createElement("a");i.href=n,i.download=r.name,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(n)}}class c{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}includes(t){return this.underlyingSet.has(t)}include(t){return this.includes(t)}addAll(t){let e=[...t];0!=e.length&&(e.every((t=>this.includes(t)))||(e.forEach((t=>this.underlyingSet.add(t))),this.callEventListeners("change")))}removeAll(t){let e=[...t];0!=e.length&&(e.every((t=>!this.includes(t)))||(e.forEach((t=>this.underlyingSet.delete(t))),this.callEventListeners("change")))}clear(){0!=this.underlyingSet.size&&(this.underlyingSet.clear(),this.callEventListeners("change"))}addEventListener(t,e){this.eventListeners[t].push(e)}callEventListeners(t){this.eventListeners[t].forEach((t=>t()))}removeEventListener(t,e){this.eventListeners[t]=this.eventListeners[t].filter((t=>t!==e))}}var l,f,d,m,p=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class g{constructor(t){l.add(this),this.maxSize=t,f.set(this,[]),d.set(this,{change:[]})}get size(){return p(this,f,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,f),p(this,l,"m",m).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return p(this,f,"f")[p(this,f,"f").length-1]}push(t){p(this,f,"f").push(t),this.size>this.maxSize&&p(this,f,"f").shift(),p(this,l,"m",m).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=p(this,f,"f").pop();return p(this,l,"m",m).call(this,"change"),t}addEventListener(t,e){p(this,d,"f")[t].push(e)}removeEventListener(t,e){p(this,d,"f")[t]=p(this,d,"f")[t].filter((t=>t!==e))}}function y(t){try{return new URL(t),!0}catch(t){return!1}}f=new WeakMap,d=new WeakMap,l=new WeakSet,m=function(t){p(this,d,"f")[t].forEach((t=>t()))}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{parseCT:()=>e});var t=r(106);function e(e){let r=function(t){let e=t.findIndex((t=>!i(t)&&!s(t)));if(e<0)throw new Error("Unable to find the start of the structure.");let r=[...t].reverse().findIndex((t=>!i(t)&&!s(t)));if(r<0)throw new Error("Unable to find the end of the structure.");return r=t.length-r-1,t.slice(e,r+1)}((0,t.splitLines)(e));return{description:o(r),sequence:a(r),positionPairs:u(r),numberingOffset:h(r)}}function i(t){return 0==t.trim().length}function s(t){return"#"==t.trim().charAt(0)}function o(t){if(0==t.length)return;let e=t[0],r=c(e);if(r.length<2)return;let n=r[0];return e.slice(e.indexOf(n)+n.length).trim()}function a(t){return t.slice(1).map((t=>{let e=c(t);if(e.length<2)throw new Error("Line is missing a character.");return e[1]})).join("")}function u(t){let e=t.slice(1),r=[];return e.forEach(((t,e)=>{let n=e+1,i=c(t);if(i.length>=5){let t=Number.parseFloat(i[4]);if(Number.isNaN(t))throw new Error("Partner positions must be numbers.");if(!Number.isInteger(t))throw new Error("Partner positions must be integers.");0!=t&&n<=t&&r.push([n,t])}})),r}function h(t){if(t.length<2)return 0;let e=c(t[1]);if(e.length<6)return 0;let r=Number.parseFloat(e[5]);return Number.isNaN(r)?0:Number.isInteger(r)?r-1:0}function c(t){return function(t){return t.split(/\s/)}(t).filter(l)}function l(t){return t.length>0}})(),n})(),t.exports=e()},358:function(t){var e;e=()=>(()=>{var t={731:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{CenterPoint:()=>h});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver((()=>u(this,r,"m",o).call(this,"move"))),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter((t=>t!==e))}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach((t=>t()))},e})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}r.r(n),r.d(n,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,isSVGGraphicsElement:()=>S,isSVGGraphicsElementsArray:()=>M,sendToBack:()=>g,setAttributes:()=>t});const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,r,n){if(e.randomUUID&&!r&&!t)return e.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,r){n=n||0;for(var s=0;s<16;++s)r[n+s]=i[s];return r}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function S(t){return t instanceof SVGGraphicsElement}v=new WeakMap;var N=r(854);function M(t){return(0,N.isArray)(t)&&t.every(S)}})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BasePair:()=>kr,Nucleobase:()=>Dr});var t={};r.r(t),r.d(t,{cx:()=>It,cy:()=>Lt,height:()=>Ft,rx:()=>Tt,ry:()=>Dt,width:()=>Vt,x:()=>kt,y:()=>Bt});var e={};r.r(e),r.d(e,{from:()=>Rt,to:()=>qt});var i={};r.r(i),r.d(i,{MorphArray:()=>Qt,height:()=>te,width:()=>Zt,x:()=>Jt,y:()=>Kt});var s={};r.r(s),r.d(s,{array:()=>Ee,clear:()=>Ae,move:()=>Ce,plot:()=>je,size:()=>Te});var o={};r.r(o),r.d(o,{amove:()=>or,ax:()=>ir,ay:()=>sr,build:()=>ar,center:()=>nr,cx:()=>er,cy:()=>rr,length:()=>Je,move:()=>tr,plain:()=>Qe,x:()=>Ke,y:()=>Ze});var a={};r.r(a),r.d(a,{dmove:()=>dr,dx:()=>mr,dy:()=>pr,height:()=>gr,move:()=>yr,size:()=>br,width:()=>wr,x:()=>vr,y:()=>xr});const u={},h=[];function c(t,e){if(Array.isArray(t))for(const r of t)c(r,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const e in t)c(e,t[e])}function l(t){return u[t]||{}}function f(t){h.push(...t)}function d(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function m(t){return t%360*Math.PI/180}function p(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function y(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const b=new Set(["desc","metadata","title"]),w=t=>b.has(t.nodeName),v=(t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},x="http://www.w3.org/2000/svg",_="http://www.w3.org/2000/xmlns/",S="http://www.w3.org/1999/xlink",N={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class M{}const P={},O="___SYMBOL___ROOT___";function E(t,e=x){return N.document.createElementNS(e,t)}function A(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return T(t);if(null==t)return new P[O];if("string"==typeof t&&"<"!==t.charAt(0))return T(N.document.querySelector(t));const r=e?N.document.createElement("div"):E("svg");return r.innerHTML=t,t=T(r.firstChild),r.removeChild(r.firstChild),t}function C(t,e){return e&&(e instanceof N.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:E(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new P.Fragment(t);let e=p(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":P[e]||(e="Dom"),new P[e](t)}let T=j;function D(t,e=t.name,r=!1){return P[e]=t,r&&(P[O]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let k=1e3;function B(t){return"Svgjs"+p(t)+k++}function I(t){for(let e=t.children.length-1;e>=0;e--)I(t.children[e]);return t.id?(t.id=B(t.nodeName),t):t}function L(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function V(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}c("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=A(t)).before(this),this},insertAfter:function(t){return(t=A(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,q=/\s/g,Y=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,U=/^rgb\(/,H=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,J=/[MLHVCSQTAZ]/i;function K(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Z(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function tt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),c("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,r){if(null==t)return this.data(d(function(t){let e;const r=t.length,n=[];for(e=0;e<r;e++)0===t[e].nodeName.indexOf("data-")&&n.push(t[e]);return n}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class et{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof et||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:r,round:n,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new et(t,e,n,"lch")}if("sine"===t){const t=n(80*i(2*s*(e=null==e?r():e)/.5+.01)+150),o=n(50*i(2*s*e/.5+4.6)+200),a=n(100*i(2*s*e/.5+2.3)+150);return new et(t,o,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new et(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new et(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new et(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new et(t,e,n,"lab")}if("grey"===t){const t=255*r();return new et(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Y.test(t)||U.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new et(0,0,0,1,"cmyk"):new et((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new et(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=Z(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Z(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Z(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Z(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Z(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Z(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(U.test(t)){const e=t.replace(q,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!Y.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=z.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new et(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new et(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new et(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new et(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*tt(i,n,t+1/3),o=255*tt(i,n,t),a=255*tt(i,n,t-1/3);return new et(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new et(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(K);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new et(f,d,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function nt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class it{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),m=d.x,p=d.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,px:m,py:p}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new it(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),m=Math.sin(l),p=(r*i+n*s)/u,g=i*c/(p*r-n)||s*c/(p*n+r);return{scaleX:c,scaleY:g,shear:p,rotate:f,translateX:o-t+t*d*c+e*(p*d*c-m*g),translateY:a-e+t*m*c+e*(p*m*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new it(t);return nt(this.a,e.a)&&nt(this.b,e.b)&&nt(this.c,e.c)&&nt(this.d,e.d)&&nt(this.e,e.e)&&nt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=it.fromArray([1,0,0,1,0,0]);return t=t instanceof Ot?t.matrixify():"string"==typeof t?it.fromArray(t.split(Q).map(parseFloat)):Array.isArray(t)?it.fromArray(t):"object"==typeof t&&it.isMatrixLike(t)?t:"object"==typeof t?(new it).transform(t):6===arguments.length?it.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=m(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:c}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-c*i+r*i-e*n+e,this.f=c*n+h*i-e*i-r*n+r,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:c,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=c+l*i-n*i,this.f=l+c*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(it.isMatrixLike(t))return new it(t).multiplyO(this);const e=it.formatTransforms(t),{x:r,y:n}=new rt(e.ox,e.oy).transform(this),i=(new it).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new rt(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function st(){if(!st.nodes){const t=A().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;st.nodes={svg:t,path:e}}if(!st.nodes.svg.node.parentNode){const t=N.document.body||N.document.documentElement;st.nodes.svg.addTo(t)}return st.nodes}function ot(t){return!(t.width||t.height||t.x||t.y)}D(it,"Matrix");class at{constructor(...t){this.init(...t)}addOffset(){return this.x+=N.window.pageXOffset,this.y+=N.window.pageYOffset,new at(this)}init(t){return t="string"==typeof t?t.split(Q).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ot(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new at(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof it||(t=new it(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new at(e,n,r-e,i-n)}}function ut(t,e,r){let n;try{if(n=e(t.node),ot(n)&&(i=t.node)!==N.document&&!(N.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===N.document}).call(N.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}c({viewbox:{viewbox(t,e,r,n){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new rt(r/2/s+i.x,n/2/o+i.y);const h=new at(i).transform(new it({scale:u,origin:e}));return this.viewbox(h)}}}),D(at,"Box");class ht extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const ct=ht;L([ht],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const lt=["toArray","constructor","each"];function ft(t,e){return new ct(d((e||N.document).querySelectorAll(t),(function(t){return j(t)})))}ht.extend=function(t){t=t.reduce(((t,e)=>(lt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),L([ht],t)};let dt=0;const mt={};function pt(t){let e=t.getEventHolder();return e===N.window&&(e=mt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,r,n,i){const s=r.bind(n||t),o=A(t),a=pt(o),u=gt(o);e=Array.isArray(e)?e:e.split(Q),r._svgjsListenerId||(r._svgjsListenerId=++dt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function bt(t,e,r,n){const i=A(t),s=pt(i),o=gt(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])bt(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&bt(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])bt(o,[e,u].join("."));delete s[e]}}else{for(t in s)bt(o,t);!function(t){let e=t.getEventHolder();e===N.window&&(e=mt),e.events&&(e.events={})}(i)}}))}class wt extends M{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=gt(t);return e instanceof N.window.Event||(e=new N.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return bt(this,t,e,r),this}on(t,e,r,n){return yt(this,t,e,r,n),this}removeEventListener(){}}function vt(){}D(wt,"EventTarget");const xt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class _t extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Q).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class St{constructor(...t){this.init(...t)}convert(t){return new St(this.value,t)}divide(t){return t=new St(t),new St(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof St&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new St(t),new St(this-t,this.unit||t.unit)}plus(t){return t=new St(t),new St(this+t,this.unit||t.unit)}times(t){return t=new St(t),new St(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Nt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Mt=[];class Pt extends wt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=A(t)).removeNamespace&&this.node instanceof N.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return A(t).put(this,e)}children(){return new ct(d(this.node.children,(function(t){return j(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let r=this.node.cloneNode(t);return e&&(r=I(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new Pt(E(t),e))}first(){return j(this.node.firstChild)}get(t){return j(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=B(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=A(t),this.add(t,e),t}putIn(t,e){return A(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=A(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,x)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=j(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=E("wrapper",r),i=N.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}L(Pt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=W.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?xt[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=Mt.reduce(((e,r)=>r(t,e,this)),e))?e=new St(e):Nt.has(t)&&et.isColor(e)?e=new et(e):e.constructor===Array&&(e=new _t(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return ft(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),D(Pt,"Dom");class Ot extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new St(t).plus(this.x()))}dy(t=0){return this.y(new St(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=A(t));const r=new ct;let n=this;for(;(n=n.parent())&&n.node!==N.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?A(e[1]):null}root(){const t=this.parent(P[O]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=g(this,t,e);return this.width(new St(r.width)).height(new St(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}L(Ot,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(st().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new at(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.height},point:function(t,e){return new rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new it(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new it(e)}return new it(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new it}}}),D(Ot,"Element");const Et={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let r;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof et||et.isRgb(e)||e instanceof Ot)this.attr(t,e);else for(r=Et[t].length-1;r>=0;r--)null!=e[Et[t][r]]&&this.attr(Et.prefix(t,Et[t][r]),e[Et[t][r]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new it(this):this.attr("transform",new it(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new St(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(it.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new it)},toParent:function(t,e){if(this===t)return this;if(w(this.node))return this.addTo(t,e);const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new it(this).decompose();return null==t?e:e[t]}it.isMatrixLike(t)||(t={...t,origin:y(t,this)});const r=new it(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class At extends Ot{flatten(){return this.each((function(){if(this instanceof At)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}D(At,"Container");class Ct extends At{constructor(t,e=t){super(C("defs",t),e)}flatten(){return this}ungroup(){return this}}D(Ct,"Defs");class jt extends Ot{}function Tt(t){return this.attr("rx",t)}function Dt(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Bt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Vt(t){return null==t?2*this.rx():this.rx(new St(t).divide(2))}function Ft(t){return null==t?2*this.ry():this.ry(new St(t).divide(2))}D(jt,"Shape");class zt extends jt{constructor(t,e=t){super(C("ellipse",t),e)}size(t,e){const r=g(this,t,e);return this.rx(new St(r.width).divide(2)).ry(new St(r.height).divide(2))}}L(zt,t),c("Container",{ellipse:V((function(t=0,e=t){return this.put(new zt).size(t,e).move(0,0)}))}),D(zt,"Ellipse");class Xt extends Pt{constructor(t=N.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(E("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}D(Xt,"Fragment");const Gt=Xt;function Rt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new St(t),fy:new St(e)}):this.attr({x1:new St(t),y1:new St(e)})}function qt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new St(t),cy:new St(e)}):this.attr({x2:new St(t),y2:new St(e)})}class Yt extends At{constructor(t,e){super(C(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}L(Yt,e),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:V((function(t,e){return this.put(new Yt(t)).update(e)}))}}),D(Yt,"Gradient");class Ut extends At{constructor(t,e=t){super(C("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}c({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:V((function(t,e,r){return this.put(new Ut).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Ut,"Pattern");class Ht extends jt{constructor(t,e=t){super(C("image",t),e)}load(t,e){if(!t)return this;const r=new N.window.Image;return yt(r,"load",(function(t){const n=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof Ut&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(r,"load error",(function(){bt(r)})),this.attr("href",r.src=t,S)}}var Wt;Wt=function(t,e,r){return"fill"!==t&&"stroke"!==t||$.test(e)&&(e=r.root().defs().image(e)),e instanceof Ht&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Mt.push(Wt),c({Container:{image:V((function(t,e){return this.put(new Ht).size(0,0).load(t,e)}))}}),D(Ht,"Image");class $t extends _t{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new at(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e<r;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));for(let e=this.length;e--;){const[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}const Qt=$t;function Jt(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function Kt(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Zt(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function te(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class ee extends jt{constructor(t,e=t){super(C("line",t),e)}array(){return new $t([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new $t(t).toLine(),this.attr(t))}size(t,e){const r=g(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}L(ee,i),c({Container:{line:V((function(...t){return ee.prototype.plot.apply(this.put(new ee),null!=t[0]?t:[0,0,0,0])}))}}),D(ee,"Line");class re extends At{constructor(t,e=t){super(C("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ne(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:V((function(t,e,r){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),D(re,"Marker");const ie={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class se{done(){return!1}}class oe extends se{constructor(t=">"){super(),this.ease=ie[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class ae extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}L(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:ne("_duration",ue),overshoot:ne("_overshoot",ue)}),L(class extends ae{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ne("_windup"),p:ne("P"),i:ne("I"),d:ne("D")});const he={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let t=0,e=le.length;t<e;++t)ce[le[t]]=function(t){return function(e,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return ce[t](e,r,n)}}(le[t].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===he[t.segment[0].toUpperCase()]}function de(t,e){t.inNumber&&me(t,!1);const r=J.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function me(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fe(t)&&pe(t)}function pe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ge(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ye(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);class we extends _t{bbox(){return st().path.setAttribute("d",this.toString()),new at(st.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!de(i,n))if("."!==n)if(isNaN(parseInt(n)))if(be.has(n))i.inNumber&&me(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(J.test(n)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");pe(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ye(i)){me(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||ge(i)){i.inNumber=!0,i.number=n,me(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){me(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&pe(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const ve=t=>{const e=typeof t;return"number"===e?St:"string"===e?et.isColor(t)?et:Q.test(t)?J.test(t)?we:_t:F.test(t)?St:_e:Pe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?_t:"object"===e?Me:_e};class xe{constructor(t){this._stepper=t||new oe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ve(t));let e=new this._type(t);return this._type===et&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ne=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class Me{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===et&&t[r+7]!==e[r+7]){const e=t[r+7],n=new et(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=ve(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(Ne),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const Pe=[_e,Se,Me];class Oe extends jt{constructor(t,e=t){super(C("path",t),e)}array(){return this._array||(this._array=new we(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new we(t))}size(t,e){const r=g(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function Ee(){return this._array||(this._array=new $t(this.attr("points")))}function Ae(){return delete this._array,this}function Ce(t,e){return this.attr("points",this.array().move(t,e))}function je(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new $t(t))}function Te(t,e){const r=g(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}Oe.prototype.MorphArray=we,c({Container:{path:V((function(t){return this.put(new Oe).plot(t||new we)}))}}),D(Oe,"Path");class De extends jt{constructor(t,e=t){super(C("polygon",t),e)}}c({Container:{polygon:V((function(t){return this.put(new De).plot(t||new $t)}))}}),L(De,i),L(De,s),D(De,"Polygon");class ke extends jt{constructor(t,e=t){super(C("polyline",t),e)}}c({Container:{polyline:V((function(t){return this.put(new ke).plot(t||new $t)}))}}),L(ke,i),L(ke,s),D(ke,"Polyline");class Be extends jt{constructor(t,e=t){super(C("rect",t),e)}}L(Be,{rx:Tt,ry:Dt}),c({Container:{rect:V((function(t,e){return this.put(new Be).size(t,e)}))}}),D(Be,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>N.window.performance||N.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const r=Le.timer().now()+e,n=Le.timeouts.push({run:t,time:r});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),n},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const r=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==r););let n=null;const i=Le.frames.last();for(;n!==i&&(n=Le.frames.shift());)n.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?N.window.requestAnimationFrame(Le._draw):null}},Ve=Le,Fe=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},ze=function(){const t=N.window;return(t.performance||t.Date).now()};class Xe extends wt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Fe);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ge extends wt{constructor(t){super(),this.id=Ge.id++,t="function"==typeof(t=null==t?400:t)?new ae(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ae,this._stepper=this._isDeclarative?t:new oe,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new it,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e??0,r=r||"last","object"!=typeof(t=t??400)||t instanceof se||(e=t.delay??e,r=t.when??r,i=t.swing||i,n=t.times??n,s=t.wait??s,t=t.duration??400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=Ge.sanitise(t,e,r),i=new Ge(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new it,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new oe(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,r,n){return this._queue.push({initialiser:t||vt,runner:e||vt,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,r){if(t instanceof Xe||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new it,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Ge.id=0;class Re{constructor(t=new it,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}L([Ge,Re],{mergeWith(t){return new Re(t.transforms.lmultiply(this.transforms),t.id)}});const qe=(t,e)=>t.lmultiplyO(e),Ye=t=>t.transforms;function Ue(){const t=this._transformationRunners.runners.map(Ye).reduce(qe,new it);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class He{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Re).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}c({Element:{animate(t,e,r){const n=Ge.sanitise(t,e,r),i=this.timeline();return new Ge(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ye).reduce(qe,new it)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(Ue.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new He).add(new Re(new it(this))))}}}),L(Ge,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new xe(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Me(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Me(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new xe(this._stepper).to(new St(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=it.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new xe(this._stepper).type(r?Se:it);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||y(t,o),h=new it(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new rt(s).transform(o._currentTransform(this));let d=new it({...t,origin:[l,f]}),m=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),m=m.decompose(l,f);const t=d.rotate,e=m.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(m.rotate=u)),i.from(m),i.to(d);const p=i.at(c);return u=p.rotate,a=new it(p),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=y(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new St(e),this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new St(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new St(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new at(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),L(Ge,{rx:Tt,ry:Dt,from:Rt,to:qt}),D(Ge,"Runner");class We extends At{constructor(t,e=t){super(C("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new Ct):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof N.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:x,version:"1.1"}).attr("xmlns:xlink",S,_):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,_).attr("xmlns:svgjs",null,_)}root(){return this.isRoot()?this:super.root()}}c({Container:{nested:V((function(){return this.put(new We)}))}}),D(We,"Svg",!0);class $e extends At{constructor(t,e=t){super(C("symbol",t),e)}}function Qe(t){return!1===this._build&&this.clear(),this.node.appendChild(N.document.createTextNode(t)),this}function Je(){return this.node.getComputedTextLength()}function Ke(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Ze(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function tr(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function er(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function rr(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function nr(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function ir(t){return this.attr("x",t)}function sr(t){return this.attr("y",t)}function or(t,e){return this.ax(t).ay(e)}function ar(t){return this._build=!!t,this}c({Container:{symbol:V((function(){return this.put(new $e)}))}}),D($e,"Symbol");class ur extends jt{constructor(t,e=t){super(C("text",t),e),this.dom.leading=this.dom.leading??new St(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new St(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){if(w(this.node))return;const i=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new St(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new St(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"===e[n].nodeName||w(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===j(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}L(ur,o),c({Container:{text:V((function(t=""){return this.put(new ur).text(t)})),plain:V((function(t=""){return this.put(new ur).plain(t)}))}}),D(ur,"Text");class hr extends jt{constructor(t,e=t){super(C("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ur))return this;const e=t.index(this),r=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new St(r);return this.dy(e?n:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}L(hr,o),c({Tspan:{tspan:V((function(t=""){const e=new hr;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),D(hr,"Tspan");class cr extends jt{constructor(t,e=t){super(C("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new St(t).divide(2))}}L(cr,{x:kt,y:Bt,cx:It,cy:Lt,width:Vt,height:Ft}),c({Container:{circle:V((function(t=0){return this.put(new cr).size(t).move(0,0)}))}}),D(cr,"Circle");class lr extends At{constructor(t,e=t){super(C("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return ft("svg [clip-path*="+this.id()+"]")}}c({Container:{clip:V((function(){return this.defs().put(new lr)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lr?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),D(lr,"ClipPath");class fr extends Ot{constructor(t,e=t){super(C("foreignObject",t),e)}}function dr(t,e){return this.children().forEach((r=>{let n;try{n=r.node instanceof N.window.SVGSVGElement?new at(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new it(r),s=i.translate(t,e).transform(i.inverse()),o=new rt(n.x,n.y).transform(s);r.move(o.x,o.y)})),this}function mr(t){return this.dmove(t,0)}function pr(t){return this.dmove(0,t)}function gr(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function yr(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function br(t,e,r=this.bbox()){const n=g(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach((t=>{const e=new rt(r).transform(new it(t).inverse());t.scale(i,s,e.x,e.y)})),this}function wr(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function vr(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function xr(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}c({Container:{foreignObject:V((function(t,e){return this.put(new fr).size(t,e)}))}}),D(fr,"ForeignObject");class _r extends At{constructor(t,e=t){super(C("g",t),e)}}L(_r,a),c({Container:{group:V((function(){return this.put(new _r)}))}}),D(_r,"G");class Sr extends At{constructor(t,e=t){super(C("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,S)}}L(Sr,a),c({Container:{link:V((function(t){return this.put(new Sr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Sr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),D(Sr,"A");class Nr extends At{constructor(t,e=t){super(C("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return ft("svg [mask*="+this.id()+"]")}}c({Container:{mask:V((function(){return this.defs().put(new Nr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Nr?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),D(Nr,"Mask");class Mr extends Ot{constructor(t,e=t){super(C("stop",t),e)}update(t){return("number"==typeof t||t instanceof St)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new St(t.offset)),this}}c({Gradient:{stop:function(t,e,r){return this.put(new Mr).update(t,e,r)}}}),D(Mr,"Stop");class Pr extends Ot{constructor(t,e=t){super(C("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}c("Dom",{style(t,e){return this.put(new Pr).rule(t,e)},fontface(t,e,r){return this.put(new Pr).font(t,e,r)}}),D(Pr,"Style");class Or extends ur{constructor(t,e=t){super(C("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}c({Container:{textPath:V((function(t,e){return t instanceof ur||(t=this.text(t)),t.path(e)}))},Text:{path:V((function(t,e=!0){const r=new Or;let n;if(t instanceof Oe||(t=this.defs().path(t)),r.attr("href","#"+t,S),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:V((function(t){return t instanceof ur||(t=(new ur).addTo(this.parent()).text(t)),t.path(this)})),targets(){return ft("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Or.prototype.MorphArray=we,D(Or,"TextPath");class Er extends jt{constructor(t,e=t){super(C("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,S)}}c({Container:{use:V((function(t,e){return this.put(new Er).use(t,e)}))}}),D(Er,"Use"),L([We,$e,Ht,Ut,re],l("viewbox")),L([ee,ke,De,Oe],l("marker")),L(ur,l("Text")),L(Oe,l("Path")),L(Ct,l("Defs")),L([ur,hr],l("Tspan")),L([Be,zt,Yt,Ge],l("radius")),L(wt,l("EventTarget")),L(Pt,l("Dom")),L(Ot,l("Element")),L(jt,l("Shape")),L([At,Gt],l("Container")),L(Yt,l("Gradient")),L(Ge,l("Runner")),ct.extend([...new Set(h)]),function(t=[]){Pe.push(...[].concat(t))}([St,et,at,it,_t,$t,we,rt]),L(Pe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ar=r(726),Cr=r(854),jr=r(731),Tr=r(986);class Dr{static create(t){let e=document.createElementNS("http://www.w3.org/2000/svg","text");e.textContent=t;let r=new Dr(e);return r.assignUUID(),r.setAttributes(Dr.defaultAttributes),r}static deserialized(t,e){var r;if(!(0,Cr.isNonNullObject)(t))throw new Error("Saved base must be an object.");let n=null!==(r=t.id)&&void 0!==r?r:t.textId;if(!n)throw new Error("Missing base ID.");if(!(0,Cr.isString)(n))throw new Error("Base IDs must be strings.");let i=e.domNode.querySelector("#"+n);if(!i)throw new Error("Unable to find nucleobase DOM node.");if(!(i instanceof SVGTextElement))throw new Error("Nucleobase DOM node must be an SVG text element.");return new Dr(i)}constructor(t){this.domNode=t,this.centerPoint=new jr.CenterPoint(t)}serialized(){if(!this.id)throw new Error("Nucleobase ID is falsy.");return{id:this.id}}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}bringToFront(){(0,Ar.bringToFront)(this.domNode)}sendToBack(){(0,Ar.sendToBack)(this.domNode)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){try{new ur(this.domNode).attr(t)}catch(t){}}get id(){return this.domNode.id}assignUUID(){(0,Ar.assignUUID)(this.domNode)}get textContent(){return this.domNode.textContent}set textContent(t){this.domNode.textContent=t}isA(){var t;return"A"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isU(){var t;return"U"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isT(){var t;return"T"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isG(){var t;return"G"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isC(){var t;return"C"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}get bbox(){return this.domNode.getBBox()}getCenterPoint(){return this.centerPoint}setCenterPoint(t){this.centerPoint.x=t.x,this.centerPoint.y=t.y}maintainingCenterPoint(t){let{x:e,y:r}=this.centerPoint;t(),this.centerPoint.x=e,this.centerPoint.y=r}get boundingClientRect(){return this.domNode.getBoundingClientRect()}get clientCenterPoint(){let t=this.domNode.getBoundingClientRect();return{x:(0,Tr.mean)([t.left,t.right]),y:(0,Tr.mean)([t.top,t.bottom])}}getClientCenterPoint(){return this.clientCenterPoint}}Dr.defaultAttributes={"font-family":"Arial","font-size":"9","font-weight":"700"},Dr.defaultAttributeNames=["font-family","font-size","font-weight"];class kr{constructor(t,e){this.base1=t,this.base2=e}[Symbol.iterator](){return[this.base1,this.base2].values()}isAU(){return this.base1.isA()&&this.base2.isU()||this.base1.isU()&&this.base2.isA()}isAT(){return this.base1.isA()&&this.base2.isT()||this.base1.isT()&&this.base2.isA()}isGC(){return this.base1.isG()&&this.base2.isC()||this.base1.isC()&&this.base2.isG()}isGU(){return this.base1.isG()&&this.base2.isU()||this.base1.isU()&&this.base2.isG()}isGT(){return this.base1.isG()&&this.base2.isT()||this.base1.isT()&&this.base2.isG()}}})(),n})(),t.exports=e()},369:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>y,Stems:()=>g,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>b,parseDotBracket:()=>w,radializable:()=>p,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}function p(t){var e=i(t);e.sort((function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)}));var r=[],n=[];return e.forEach((function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)})),m(r)}var g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),y=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(g.bind.apply(g,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function w(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}function v(t,e){return e.forEach((function(e){e.forEach((function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")}))})),e.map((function(e){return[t[e[0]-1],t[e[1]-1]]}))}})(),n})(),t.exports=e()},534:function(t){var e;e=()=>(()=>{var t={30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()},127:function(t){var e;e=()=>(()=>{var t={369:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>y,Stems:()=>g,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>b,parseDotBracket:()=>w,radializable:()=>p,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}function p(t){var e=i(t);e.sort((function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)}));var r=[],n=[];return e.forEach((function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)})),m(r)}var g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),y=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(g.bind.apply(g,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function w(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}function v(t,e){return e.forEach((function(e){e.forEach((function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")}))})),e.map((function(e){return[t[e[0]-1],t[e[1]-1]]}))}})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>i,LastPairedBase:()=>o,LeadingDanglingBases:()=>a,Linkers:()=>l,PositionPairs:()=>e,Stems:()=>c,TrailingDanglingBases:()=>u,consecutivePairs:()=>p,knotless:()=>f,other:()=>t,parseDotBracket:()=>m,radializable:()=>d});class e{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];return this.targetStructure[1].map((e=>[t.indexOf(e[0])+1,t.indexOf(e[1])+1]))}}class i{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat(),n=t.findIndex((t=>r.includes(t)));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var s=r(986);class o{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let r=e.flat().map((e=>t.indexOf(e)));if((0,s.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,s.max)(r)]}}class a{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new i(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)}}class u{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new o(...this.targetStructure).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)}}var h=r(369);class c{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Stems(t,r).get().map((e=>e.map((e=>[t[e[0]-1],t[e[1]-1]]))))}}class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],r=new e(...this.targetStructure).get();return new h.Linkers(t,r).get().map((e=>e.map((e=>t[e-1]))))}}function f(...t){let[r,n]=t,i=new e(...t).get();(0,h.areKnotless)(i)||(i=(0,h.knotless)(i));let s=i.map((t=>[r[t[0]-1],r[t[1]-1]]));return[[...r],s]}function d(...t){let[r,n]=t,i=new e(...t).get();return[[...r],(0,h.radializable)(i).map((([t,e])=>[r[t-1],r[e-1]]))]}function m(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map((e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]}))}function p(t){return t.length<2?[]:t.slice(0,-1).map(((e,r)=>[t[r],t[r+1]]))}})(),n})(),t.exports=e()},173:function(t){var e;e=()=>(()=>{var t={422:function(t){t.exports=(()=>{var t={138:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}return t.r(e),t.d(e,{average:()=>n,mean:()=>n,sum:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}r.r(n),r.d(n,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=r(138);function s(t){return{x:(0,i.mean)(t.map((function(t){return t.x}))),y:(0,i.mean)(t.map((function(t){return t.y})))}}function o(t,e){return s([t,e])}})(),n})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{CircularSegment:()=>a,Semicircle:()=>e});var t=r(422),e=function(){function e(t){this.chord=t}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return Math.PI*this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcAngle",{get:function(){return Math.PI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){return(0,t.midpoint)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),e}(),i=r(872),s=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(n<=i)throw new Error("Arc length is too small.");if(n>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(n/i*Math.sin(s)-s)/(n/i*Math.cos(s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e+=(Math.PI-this.arcAngle)/2;var r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(n<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(n/i*Math.sin(Math.PI-s)-s)/(-n/i*Math.cos(Math.PI-s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e-=(this.arcAngle-Math.PI)/2;var r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function r(r,n){this.chord=r,this.moreProps=n;var i=n.arcLength,a=(0,t.distance)(r[0],r[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,c=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||c?new e(r):i<h?new s(r,{arcLength:i}):new o(r,{arcLength:i})}return Object.defineProperty(r.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),r}()})(),n})(),t.exports=e()},369:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>y,Stems:()=>g,areConflicting:()=>h,areCrossing:()=>f,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>m,mountainPlotTraversal:()=>b,parseDotBracket:()=>w,radializable:()=>p,sorted:()=>o});var t=r(854),e=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map((function(t){return e([],t,!0)}))}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort((function(t,e){return t[0]-e[0]})),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every((function(t){return r[t]==n[t]}))}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function h(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function c(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach((function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]})),e}function l(t){var e=c(t),r=[],n=!1;return e.forEach((function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))})),!n}function f(t,e){return!l([t,e])}var d=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function m(t){var e=[],r=i(t);return r.sort((function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])})),r.forEach((function(t){l(d(d([],e,!0),[t],!1))&&e.push(t)})),e}function p(t){var e=i(t);e.sort((function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)}));var r=[],n=[];return e.forEach((function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)})),m(r)}var g=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=o(t),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),y=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(g.bind.apply(g,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(s.min),t.map(s.max)]}));t.forEach(s.sortNumbers),t.sort((function(t,e){return(0,s.min)(t)-(0,s.min)(e)}));for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function b(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=c(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach((function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))})),s}function w(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return o(n)}function v(t,e){return e.forEach((function(e){e.forEach((function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")}))})),e.map((function(e){return[t[e[0]-1],t[e[1]-1]]}))}})(),n})(),t.exports=e()},456:function(t){var e;e=()=>(()=>{var t={277:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}get direction(){return Math.atan2(this.y,this.x)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Point:()=>e,RelativePoint:()=>c});var t=r(277);class e{static matching(t){return new e(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}}var i,s,o,a,u,h=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(e){i.add(this),s.set(this,void 0),o.set(this,new t.Vector(0,0)),a.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,s,e),e.addEventListener("move",(()=>h(this,i,"m",u).call(this,"move")))}get x(){return h(this,s,"f").x+h(this,o,"f").x}set x(t){h(this,o,"f").x=t-h(this,s,"f").x,h(this,i,"m",u).call(this,"move")}get y(){return h(this,s,"f").y+h(this,o,"f").y}set y(t){h(this,o,"f").y=t-h(this,s,"f").y,h(this,i,"m",u).call(this,"move")}addEventListener(t,e){h(this,a,"f")[t].push(e)}removeEventListener(t,e){h(this,a,"f")[t]=h(this,a,"f")[t].filter((t=>t!==e))}}s=new WeakMap,o=new WeakMap,a=new WeakMap,i=new WeakSet,u=function(t){h(this,a,"f")[t].forEach((t=>t()))}})(),n})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function m(t,e){return d([t,e])}})(),n})()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Centroid:()=>s,Direction:()=>d,MaxCenterX:()=>u,MaxCenterY:()=>c,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,arrange:()=>E,circularize:()=>N,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>m,flipY:()=>p,linearize:()=>x,outwardNormal:()=>v,rotate:()=>f,round:()=>P,shift:()=>e,stemmify:()=>S,straighten:()=>_,tangent:()=>b,untangle:()=>L});class t{constructor(t){this.props=t}getCenterPoint(){return this.props.centerPoint}setCenterPoint(t){this.props.centerPoint=t}}function e(t,e){t.forEach((t=>{let r=t.getCenterPoint();t.setCenterPoint({x:r.x+e.x,y:r.y+e.y})}))}var i=r(725);class s{constructor(t){this.targetBases=t}get(){let t=this.targetBases.map((t=>t.getCenterPoint()));return(0,i.centroid)(t)}set(t){let r=this.get(),n=(0,i.displacement)(r,t);e(this.targetBases,n)}}var o=r(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}class c{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}var l=r(30);function f(t,e){if(t.length<2)return;let r=t[0],n=t[t.length-1],s=(0,i.midpoint)(r.getCenterPoint(),n.getCenterPoint());t.forEach((t=>{let r=t.getCenterPoint(),n=(0,i.distance)(s,r),o=(0,l.direction)((0,i.displacement)(s,r));o+=e,t.setCenterPoint({x:s.x+n*Math.cos(o),y:s.y+n*Math.sin(o)})}))}class d{constructor(t){this.targetBases=t}get(){if(this.targetBases.length<2)return 0;let t=this.targetBases[0],e=this.targetBases[this.targetBases.length-1];return(0,l.direction)((0,i.displacement)(t.getCenterPoint(),e.getCenterPoint()))}set(t){let e=t-this.get();f(this.targetBases,e)}}function m(t){let e=new s(t).get().y;t.forEach((t=>{let r=t.getCenterPoint(),n=r.y-e;t.setCenterPoint({x:r.x,y:e-n})}))}function p(t){let e=new s(t).get().x;t.forEach((t=>{let r=t.getCenterPoint(),n=r.x-e;t.setCenterPoint({x:e-n,y:r.y})}))}function g(t){if(0==t.length)return;let r=t[0],{x:n,y:s}=r.getCenterPoint(),o={x:n,y:s},a=new d(t).get();f(t,-a),m(t),f(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function y(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,a=new d(t).get();f(t,-a),p(t),f(t,a),e.set({x:i,y:o})}function b(t,e){let r=e.indexOf(t);if(-1==r)throw new Error("The target base is not present in the parent sequence.");let n=r-1,i=r+2;return n=Math.max(n,0),new d(e.slice(n,i)).get()}var w=r(127);function v(t,...e){var r;let n=e[0],s=null!==(r=e[1])&&void 0!==r?r:[],a=b(t,n)-Math.PI/2,u=n.indexOf(t);if(u<0)throw new Error("The target base is not present in the provided structure.");if(n.length>1&&u<n.length-1){let e=n[u+1];a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),e.getCenterPoint()))}let h=s.find((e=>e.includes(t)));return h&&(a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),(0,w.other)(t,h).getCenterPoint()))),a}function x(t,e){let{spacing:r}=e;if(t.length<2)return;let n=new d(t),i=n.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*r,y:0})})),n.set(i),o.set(h)}function _(t){if(t.length<3)return;let e=t[0],r=t[t.length-1],n=[e.getCenterPoint(),r.getCenterPoint()],s=(0,i.distance)(n[0],n[1]),o=(0,l.direction)((0,i.displacement)(n[0],n[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:c,y:f}=n[0];t.forEach((t=>{t.setCenterPoint({x:c,y:f}),c+=u,f+=h}))}function S(t,r){let{basePairLength:n,basePairSpacing:o}=r;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),c=new s(t),{x:l,y:m}=c.get(),p={x:l,y:m},g=new d(t).get();x(u,{spacing:o}),x(h,{spacing:o}),new d(u).set(-Math.PI/2),new d(h).set(Math.PI/2);let y=t[0],b=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(b.getCenterPoint(),{x:n,y:0})),f(t,g),c.set(p)}function N(t,e){let{spacing:r,terminiGap:n}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,c=new d(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let m=l/(2*Math.PI),p=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach(((t,e)=>{let n=p+2*Math.PI*(e*r)/l;t.setCenterPoint({x:m*Math.cos(n),y:m*Math.sin(n)})})),f(t,c),i.set({x:u,y:h})}var M=r(173);function P(t,r){let{spacing:n}=r;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=n*(t.length-1);if(h-u<.001)return void _(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return N(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let c=new M.CircularSegment(a,{arcLength:h}),f=c.parentCircleCenterPoint,d=c.parentCircleRadius,m=(0,l.direction)((0,i.displacement)(f,s.getCenterPoint())),p=c.arcAngle/(t.length-1);t.forEach((t=>{t.setCenterPoint({x:f.x+d*Math.cos(m),y:f.y+d*Math.sin(m)}),m+=p}))}var O=r(369);function E(t,r,n){var a,u,h;let{spacing:c}=n,l=null!==(a=n.basePairSpacing)&&void 0!==a?a:c,f=null!==(u=n.hairpinLoopSpacing)&&void 0!==u?u:c,m=null!==(h=n.terminiGap)&&void 0!==h?h:c,{x:p,y:g}=new s(t).get(),y={x:p,y:g},b=new d(t).get();[,r]=(0,w.radializable)(t,r);let v=new w.PositionPairs(t,r).get(),x=(0,O.mountainPlotTraversal)(t,v),_=t.filter(((t,e)=>0==x[e]));N(_,{spacing:c,terminiGap:m});let M=new w.Stems(t,r).get(),E=new Set(_),A=M.filter((t=>E.has(t[0][0]))),C=r=>{let n=r[0],{x:a,y:u}=new s(n).get(),h={x:a,y:u},m=new d(r[0]).get(),p=[...r.map((t=>t[0])),...r.map((t=>t[1])).reverse()];S(p,{basePairLength:c,basePairSpacing:l}),new d(p).set(m),e(p,(0,i.displacement)(new s(n).get(),h));let g=r[r.length-1],y=g.map((e=>t.indexOf(e))),b=t.filter(((t,e)=>(0,o.isBetweenExclusive)(e,(0,o.min)(y),(0,o.max)(y))&&x[e]==x[(0,o.min)(y)]+1)),w=new Set(b),v=M.filter((t=>w.has(t[0][0])));P([g[0],...b,g[1]],{spacing:v.length>0?c:f}),v.forEach((t=>C(t)))};A.forEach((t=>C(t))),new d(t).set(b),new s(t).set(y)}var A,C,j,T,D,k=r(456),B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},I=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function L(e,r,n){let i,{spacing:a}=n;if(0==e.length)return;if(0==r.length)return void function(t,e){let{spacing:r}=e,n=k.Point.matching(new s(t).get());N(t,{spacing:r,terminiGap:2*r}),new d(t).set(Math.PI/2),new s(t).set(n)}(e,n);[i,r]=(0,w.radializable)(e,r);let u=[...e],h=k.Point.matching(new s(u).get());e=[...e,new t({centerPoint:{x:0,y:0}})];let c=new F(e,r),l=c.loops;l.sort(((t,e)=>X(t,c)-X(e,c)));let m=l[0],p=(0,o.max)(m.linkers.map((t=>t.length))),g=m.linkers.flatMap((e=>[G(e),...Array.from({length:p-2}).map((()=>new t({centerPoint:{x:0,y:0}}))),R(e)]));if(N(g,{spacing:a,terminiGap:a}),f(g,-new d(g).get()),new s(g).set(h),m.linkers.forEach((t=>P(t,{spacing:a}))),m.emanatingStems.forEach((t=>V(t.bottomBasePair,c,n))),"outerStem"in m){let t=[m.outerStem.topBasePair[1],m.outerStem.topBasePair[0]],i=[...e.slice(c.indexOf(t[0])),...e.slice(0,c.indexOf(t[1])+1)],s=new Set(i);V(t,new F(i,r.filter((t=>t.every((t=>s.has(t)))))),n)}}function V(r,n,s){var a,u;let{spacing:h}=s,c=null!==(a=s.basePairSpacing)&&void 0!==a?a:h,l=null!==(u=s.hairpinLoopSpacing)&&void 0!==u?u:h,f=n.stems.find((t=>t.bottomBasePair[0]===r[0]));if(!f)throw new Error("Closing stem not found.");let d=k.Point.matching(r[0].getCenterPoint());S(f.bases,{basePairSpacing:c,basePairLength:h}),e(f.bases,(0,i.displacement)(r[0].getCenterPoint(),d));let m=n.loop(f.topBasePair);m.innerStems.length>0?function(r,n,s){let{spacing:a}=s,u=[n.indexOf(r[0]),n.indexOf(r[1])],h=n.loop(r).innerStems.flatMap((t=>t.bottomBasePair.map((t=>n.indexOf(t))))),c=(0,o.min)(h),l=(0,o.max)(h),f=n.sequence.filter(((t,e)=>e>=c&&e<=l&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[c]&&[e-1,e,e+1].some((t=>h.includes(t))))),d=(0,o.max)([f.length-2,c-(0,o.min)(u)-1,(0,o.max)(u)-l-1]);d=(0,o.max)([d,0]);let m=Array.from({length:d}).map((()=>new t({centerPoint:{x:0,y:0}}))),p=m.map((()=>new t({centerPoint:{x:0,y:0}}))),g=k.Point.matching(r[0].getCenterPoint());N([r[0],...m,...f,...p,r[1]],{spacing:a,terminiGap:a}),e([...r,...f],(0,i.displacement)(r[0].getCenterPoint(),g)),P(n.sequence.slice(u[0],c+1),{spacing:a}),P(n.sequence.slice(l,u[1]+1),{spacing:a})}(f.topBasePair,n,s):P(m.bases,{spacing:l}),m.innerStems.forEach((t=>V(t.bottomBasePair,n,s))),(0,w.consecutivePairs)(m.innerStems).map((([t,e])=>[t.bottomBasePair[1],...n.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]])).filter((t=>t.length>=5)).forEach((t=>{let r=t.slice(1,-1),n=k.Point.matching(r[0].getCenterPoint()),s=(0,i.distance)(G(r).getCenterPoint(),R(r).getCenterPoint());S(r,{basePairLength:s,basePairSpacing:c}),P(r.length%2==0?function(t){if(t.length<4)throw new Error("The array has less than four items.");if(t.length%2!=0)throw new Error("The array has an odd number of items.");return t.slice(Math.floor(t.length/2)-2,Math.floor(t.length/2)+2)}(r):function(t){if(t.length<3)throw new Error("The array has less than three items.");if(t.length%2==0)throw new Error("The array has an even number of items.");let e=Math.floor(t.length/2);return t.slice(e-1,e+2)}(r),{spacing:r.length>=5?c:s}),e(r,(0,i.displacement)(r[0].getCenterPoint(),n))}))}class F{constructor(t,e){this.sequence=t,this.basePairs=e,A.set(this,void 0),C.set(this,void 0),j.set(this,void 0),T.set(this,void 0),B(this,A,new Map,"f"),this.sequence.forEach(((t,e)=>I(this,A,"f").set(t,e))),B(this,C,new Map,"f"),this.sequence.forEach(((t,e)=>I(this,C,"f").set(t,e+1))),B(this,j,new Map,"f"),this.basePairs.forEach((t=>I(this,j,"f").set(t[0],t[1]))),this.basePairs.forEach((t=>I(this,j,"f").set(t[1],t[0]))),B(this,T,this.basePairs.map((t=>[this.positionOf(t[0]),this.positionOf(t[1])])),"f"),this.mountainPlotTraversal=(0,O.mountainPlotTraversal)(this.sequence,I(this,T,"f")),this.stems=new w.Stems(this.sequence,this.basePairs).get().map((t=>new z(t)))}indexOf(t){let e=I(this,A,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}positionOf(t){let e=I(this,C,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}spannedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return this.sequence.slice((0,o.min)([e,r])+1,(0,o.max)([e,r]))}numSpannedBases(t){return this.spannedBases(t).length}joinedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return[...this.sequence.slice(0,(0,o.min)([e,r])+1),...this.sequence.slice((0,o.max)([e,r]))]}numJoinedBases(t){return this.joinedBases(t).length}interveningBases(t,e){let r=this.indexOf(t),n=this.indexOf(e);return this.sequence.slice((0,o.min)([r,n])+1,(0,o.max)([r,n]))}get loops(){return[this.outermostLoop,...this.stems.map((t=>this.loop(t.topBasePair)))]}loop(t){let e=[this.indexOf(t[0]),this.indexOf(t[1])],r=this.mountainPlotTraversal[e[0]]+1,n=this.spannedBases(t).filter((t=>this.mountainPlotTraversal[this.indexOf(t)]==r)),i=new Set(n),s=[t[0],...n,t[1]],o=this.stems.filter((t=>i.has(t.bottomBasePair[0]))),a=o,u=this.stems.find((e=>t.includes(e.topBasePair[0])));if(!u)throw new Error("Outer stem not found.");let h=(0,w.consecutivePairs)(o).map((([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]));return o.length>0&&(h.unshift([t[0],...this.interveningBases(t[0],G(o).bottomBasePair[0]),G(o).bottomBasePair[0]]),h.push([R(o).bottomBasePair[1],...this.interveningBases(R(o).bottomBasePair[1],t[1]),t[1]])),{bases:s,closingBasePair:t,outerStem:u,innerStems:o,emanatingStems:a,linkers:h}}get outermostLoop(){let t=this.stems.filter((t=>0==this.mountainPlotTraversal[this.indexOf(t.bottomBasePair[0])])),e=t,r=(0,w.consecutivePairs)(e).map((([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]));return e.length>0&&r.push([...this.sequence.slice(this.indexOf(R(e).bottomBasePair[1])),...this.sequence.slice(0,this.indexOf(G(e).bottomBasePair[0])+1)]),{stems:e,emanatingStems:t,linkers:r}}}A=new WeakMap,C=new WeakMap,j=new WeakMap,T=new WeakMap;class z{constructor(t){if(D.set(this,void 0),0==t.length)throw new Error("A stem must have at least one base-pair.");B(this,D,t,"f")}get bottomBasePair(){return G(I(this,D,"f"))}get topBasePair(){return R(I(this,D,"f"))}get side5(){return I(this,D,"f").map((t=>t[0]))}get side3(){let t=I(this,D,"f").map((t=>t[1]));return t.reverse(),t}get bases(){return[...this.side5,...this.side3]}}function X(t,e){let r=(0,o.max)(t.emanatingStems.map((t=>e.numSpannedBases(t.bottomBasePair))));return"closingBasePair"in t&&(r=(0,o.max)([r,e.numJoinedBases(t.closingBasePair)-2])),r}function G(t){if(0==t.length)throw new Error("The array is empty.");return t[0]}function R(t){if(0==t.length)throw new Error("The array is empty.");return t[t.length-1]}D=new WeakMap})(),n})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}r.r(n),r.d(n,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,isSVGGraphicsElement:()=>S,isSVGGraphicsElementsArray:()=>M,sendToBack:()=>g,setAttributes:()=>t});const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,r,n){if(e.randomUUID&&!r&&!t)return e.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,r){n=n||0;for(var s=0;s<16;++s)r[n+s]=i[s];return r}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function S(t){return t instanceof SVGGraphicsElement}v=new WeakMap;var N=r(854);function M(t){return(0,N.isArray)(t)&&t.every(S)}})(),n})(),t.exports=e()},742:function(t){var e;e=()=>(()=>{var t={645:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Box:()=>e});var t=r(986);class e{static bounding(r){let n=r.map((t=>e.matching(t))),i=(0,t.min)(n.map((t=>t.left))),s=(0,t.min)(n.map((t=>t.top))),o=(0,t.max)(n.map((t=>t.right)))-i,a=(0,t.max)(n.map((t=>t.bottom)))-s;return new e(i,s,o,a)}static matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}get minX(){return this.x}get minY(){return this.y}get maxX(){return this.minX+this.width}get maxY(){return this.minY+this.height}get top(){return this.minY}get right(){return this.maxX}get bottom(){return this.maxY}get left(){return this.minX}isBoundedBy(t){let r=e.matching(t);return this.minX>=r.minX&&this.minY>=r.minY&&this.maxX<=r.maxX&&this.maxY<=r.maxY}padded(t,r){return"number"!=typeof r&&(r=t),new e(this.x-t,this.y-r,this.width+2*t,this.height+2*r)}peripheralPoint(t){let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}})(),n})(),t.exports=e()},731:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{CenterPoint:()=>h});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver((()=>u(this,r,"m",o).call(this,"move"))),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map((t=>t.value));0!=r.length||r.push(0),r=r.map((r=>r+(t-e))),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter((t=>t!==e))}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach((t=>t()))},e})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{var t={854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}r.r(n),r.d(n,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,isSVGGraphicsElement:()=>S,isSVGGraphicsElementsArray:()=>M,sendToBack:()=>g,setAttributes:()=>t});const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,r,n){if(e.randomUUID&&!r&&!t)return e.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,r){n=n||0;for(var s=0;s<16;++s)r[n+s]=i[s];return r}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function S(t){return t instanceof SVGGraphicsElement}v=new WeakMap;var N=r(854);function M(t){return(0,N.isArray)(t)&&t.every(S)}})(),n})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function m(t,e){return d([t,e])}})(),n})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},277:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseNumbering:()=>m,BaseNumberingLine:()=>M});var t,e=r(726),i=r(731),s=r(277),o=r(725),a=r(854),u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(e){if(t.set(this,void 0),!(0,a.isNonNullObject)(e))throw new Error("Saved base numberings must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}get id(){if((0,a.isString)(u(this,t,"f").id))return u(this,t,"f").id;if((0,a.isString)(u(this,t,"f").textId))return u(this,t,"f").textId;throw new Error("Unable to find the ID of the saved base numbering.")}get ownerID(){if((0,a.isString)(u(this,t,"f").ownerID))return u(this,t,"f").ownerID;throw new Error("Unable to find the owner ID of the saved base numbering.")}get displacement(){return u(this,t,"f").displacement}}t=new WeakMap;var c,l,f,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class m{static numbering(t,r){let n=document.createElementNS("http://www.w3.org/2000/svg","text");(0,e.assignUUID)(n),n.textContent=`${r}`;let i=new m(n,t);return i.setAttributes(m.defaultValues.attributes),i.displacement.magnitude=0,i}constructor(t,e){c.add(this),this.domNode=t,this.owner=e,l.set(this,void 0),this.centerPoint=new i.CenterPoint(t),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,s.Vector.matching((0,o.displacement)(e.centerPoint,this.centerPoint))),e.centerPoint.addEventListener("move",(()=>d(this,c,"m",f).call(this)))}get id(){return this.domNode.id}get textContent(){return this.domNode.textContent}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach((([t,e])=>this.setAttribute(t,e)))}removeAttribute(t){this.domNode.removeAttribute(t)}get displacement(){const t=()=>d(this,l,"f").x,e=t=>{d(this,l,"f").x=t,d(this,c,"m",f).call(this)},r=()=>d(this,l,"f").y,n=t=>{d(this,l,"f").y=t,d(this,c,"m",f).call(this)},i=()=>d(this,l,"f").magnitude,s=t=>{d(this,l,"f").magnitude=t,d(this,c,"m",f).call(this)},o=()=>d(this,l,"f").direction,a=t=>{d(this,l,"f").direction=t,d(this,c,"m",f).call(this)};return{get x(){return t()},set x(t){e(t)},get y(){return r()},set y(t){n(t)},get magnitude(){return i()},set magnitude(t){s(t)},get direction(){return o()},set direction(t){a(t)}}}serialized(){return{id:this.id,ownerID:this.owner.id,displacement:{x:this.displacement.x,y:this.displacement.y}}}static deserialized(t,e){let r=new h(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Base numbering DOM node not found.");if(!(n instanceof SVGTextElement))throw new Error("Base numbering DOM node must be an SVG text element.");let i=e.bases.find((t=>t.id===r.ownerID));if(!i)throw new Error("Unable to find base numbering owner.");let s=new m(n,i);return(0,o.isPoint)(r.displacement)&&(s.displacement.x=r.displacement.x,s.displacement.y=r.displacement.y),s}}l=new WeakMap,c=new WeakSet,f=function(){this.centerPoint.x=this.owner.centerPoint.x+d(this,l,"f").x,this.centerPoint.y=this.owner.centerPoint.y+d(this,l,"f").y},m.defaultValues={attributes:{"font-family":"Arial","font-size":"8","font-weight":"400",fill:"#808080"}};var p,g=r(645),y=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class b{constructor(t){if(p.set(this,void 0),!(0,a.isNonNullObject)(t))throw new Error("Saved base numbering lines must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,p,t)}get id(){if((0,a.isString)(y(this,p,"f").id))return y(this,p,"f").id;if((0,a.isString)(y(this,p,"f").lineId))return y(this,p,"f").lineId;throw new Error("Unable to find the ID of the saved base numbering line.")}get ownerID(){if((0,a.isString)(y(this,p,"f").ownerID))return y(this,p,"f").ownerID;if((0,a.isString)(y(this,p,"f").textId))return y(this,p,"f").textId;throw new Error("Unable to find the owner ID of the saved base numbering line.")}get basePadding(){return y(this,p,"f").basePadding}get numberingPadding(){return y(this,p,"f").numberingPadding}}p=new WeakMap;var w,v,x,_,S=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},N=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class M{static connecting(t){let r=document.createElementNS("http://www.w3.org/2000/svg","line");(0,e.assignUUID)(r),r.setAttribute("x1",`${t.owner.centerPoint.x}`),r.setAttribute("y1",`${t.owner.centerPoint.y}`),r.setAttribute("x2",`${t.centerPoint.x}`),r.setAttribute("y2",`${t.centerPoint.y}`);let n=new M(r,t);return n.set(M.defaultValues),n}static unpadded(t){let e=M.connecting(t);return e.basePadding=0,e.numberingPadding=0,e}constructor(t,e){w.add(this),this.domNode=t,this.owner=e,v.set(this,void 0),x.set(this,void 0),S(this,v,(0,o.distance)(e.owner.centerPoint,this.point1),"f");let r=g.Box.matching(e.domNode.getBBox());S(this,x,(0,o.distance)(this.point2,r.peripheralPoint(e.displacement.direction+Math.PI)),"f"),e.centerPoint.addEventListener("move",(()=>N(this,w,"m",_).call(this))),e.owner.centerPoint.addEventListener("move",(()=>N(this,w,"m",_).call(this)))}get id(){return this.domNode.id}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach((([t,e])=>this.setAttribute(t,e)))}removeAttribute(t){this.domNode.removeAttribute(t)}get x1(){return this.domNode.x1.baseVal.value}get y1(){return this.domNode.y1.baseVal.value}get point1(){return{x:this.x1,y:this.y1}}get x2(){return this.domNode.x2.baseVal.value}get y2(){return this.domNode.y2.baseVal.value}get point2(){return{x:this.x2,y:this.y2}}get length(){return(0,o.distance)(this.point1,this.point2)}set length(t){let e=g.Box.matching(this.owner.domNode.getBBox());this.owner.displacement.magnitude=this.basePadding+t+this.numberingPadding+(0,o.distance)(this.owner.centerPoint,e.peripheralPoint(this.owner.displacement.direction+Math.PI))}get direction(){return(0,o.direction)(this.point1,this.point2)}set direction(t){let e=this.length;this.owner.displacement.direction=t,this.length=e}get basePadding(){return N(this,v,"f")}set basePadding(t){S(this,v,t,"f"),N(this,w,"m",_).call(this)}get numberingPadding(){return N(this,x,"f")}set numberingPadding(t){S(this,x,t,"f"),N(this,w,"m",_).call(this)}set(t){!t.attributes||this.setAttributes(t.attributes),!(0,a.isNumber)(t.basePadding)||(this.basePadding=t.basePadding),!(0,a.isNumber)(t.numberingPadding)||(this.numberingPadding=t.numberingPadding)}serialized(){return{id:this.id,ownerID:this.owner.id,basePadding:this.basePadding,numberingPadding:this.numberingPadding}}static deserialized(t,e){let r=new b(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Base numbering line DOM node not found.");if(!(n instanceof SVGLineElement))throw new Error("Base numbering line DOM node must be an SVG line element.");let i=e.baseNumberings.find((t=>t.id===r.ownerID));if(!i)throw new Error("Base numbering line owner not found.");let s=new M(n,i);return(0,a.isNumber)(r.basePadding)&&(s.basePadding=r.basePadding),(0,a.isNumber)(r.numberingPadding)&&(s.numberingPadding=r.numberingPadding),s}}v=new WeakMap,x=new WeakMap,w=new WeakSet,_=function(){let t=this.owner.displacement.direction;this.domNode.setAttribute("x1",`${this.owner.owner.centerPoint.x+N(this,v,"f")*Math.cos(t)}`),this.domNode.setAttribute("y1",`${this.owner.owner.centerPoint.y+N(this,v,"f")*Math.sin(t)}`);let e=g.Box.matching(this.owner.domNode.getBBox()).peripheralPoint(t+Math.PI);this.domNode.setAttribute("x2",`${e.x+N(this,x,"f")*Math.cos(t+Math.PI)}`),this.domNode.setAttribute("y2",`${e.y+N(this,x,"f")*Math.sin(t+Math.PI)}`)},M.defaultValues={attributes:{stroke:"#808080","stroke-width":"1","stroke-opacity":"1"},basePadding:5,numberingPadding:1}})(),n})(),t.exports=e()},775:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}t.r(e),t.d(e,{CoordinateSystem:()=>l,HorizontalClientScaling:()=>d,InnerXML:()=>w,OuterXML:()=>_,Scaling:()=>f,VerticalClientScaling:()=>m,assignUUID:()=>c,bringToFront:()=>p,sendToBack:()=>g,setAttributes:()=>r});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var i,s=new Uint8Array(16);function o(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(s)}for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));const h=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=i[s];return e}return function(t,e=0){return(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase()}(i)};function c(t){t.id="uuid-"+h()}class l{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class f{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class d{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class m{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function p(t){let e=t.parentNode;e&&e.appendChild(t)}function g(t){let e=t.parentNode;e&&e.prepend(t)}var y,b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){y.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,y,t)}toString(){return b(this,y,"f").innerHTML}set(t){b(this,y,"f").innerHTML=t}}y=new WeakMap;var v,x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){v.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,v,t)}toString(){return x(this,v,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=x(this,v,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...x(this,v,"f").attributes].forEach((t=>x(this,v,"f").removeAttribute(t.name))),[...e.firstElementChild.attributes].forEach((t=>x(this,v,"f").setAttribute(t.name,t.value))),x(this,v,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}return v=new WeakMap,e})(),t.exports=e()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>i});var t=r(726),e=r(854);class i{static outlining(e){let r=document.createElementNS("http://www.w3.org/2000/svg","circle");(0,t.assignUUID)(r),r.setAttribute("cx",`${e.centerPoint.x}`),r.setAttribute("cy",`${e.centerPoint.y}`);let n=new i(r,e);return n.set(i.defaultValues.circle),n}static deserialized(t,r){var n;if(!(0,e.isNonNullObject)(t))throw new Error("Saved base outline must be an object.");let s=null!==(n=t.id)&&void 0!==n?n:t.circleId;if(!s)throw new Error("Base outline ID is missing.");if(!(0,e.isString)(s))throw new Error("Base outline ID must be a string.");let o=r.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find base outline DOM node.");if(!(o instanceof SVGCircleElement))throw new Error("Base outline DOM node must be an SVG circle element.");let a=t.ownerID;if(!a)throw new Error("Missing base outline owner ID.");if(!(0,e.isString)(a))throw new Error("Base outline owner ID must be a string.");let u=[...r.bases].find((t=>t.id===a));if(!u)throw new Error("Unable to find base outline owner.");return new i(o,u)}constructor(t,e){this.domNode=t,this.owner=e,e.centerPoint.addEventListener("move",(()=>{t.setAttribute("cx",`${e.centerPoint.x}`),t.setAttribute("cy",`${e.centerPoint.y}`)}))}serialized(){let t=this.id;if(!t)throw new Error("Base outline ID is falsy.");let e=this.owner.id;if(!e)throw new Error("Base outline owner ID is falsy.");return{id:t,ownerID:e}}get id(){return this.domNode.id}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(e){(0,t.setAttributes)(this.domNode,e)}set(t){t.attributes&&this.setAttributes(t.attributes)}}i.defaultValues={circle:{attributes:{r:"5.5",stroke:"#000000","stroke-width":"0","stroke-opacity":"1",fill:"#00ffff","fill-opacity":"1"}}}})(),n})(),t.exports=e()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}function l(t){return c(t)&&0==t.length}function f(t){return c(t)&&t.length>0}function d(t){return c(t)&&t.every(r)}function m(t){return d(t)&&t.length>0}function p(t){return c(t)&&t.every(n)}function g(t){return c(t)&&t.every(i)}function y(t){return c(t)&&t.every(a)}function b(t){return y(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>c,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>f,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>g,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>d,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>y}),e})()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,flipAway:()=>w,isBetween:()=>c,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function h(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>Hr.BaseOutline,CTDrawer:()=>_n,DotBracketDrawer:()=>yn,Drawing:()=>fn,Nucleobase:()=>Cr.Nucleobase,SchemaDrawer:()=>En,StraightBond:()=>Qr.StraightBond});var t={};r.r(t),r.d(t,{cx:()=>It,cy:()=>Lt,height:()=>Ft,rx:()=>Tt,ry:()=>Dt,width:()=>Vt,x:()=>kt,y:()=>Bt});var e={};r.r(e),r.d(e,{from:()=>Rt,to:()=>qt});var i={};r.r(i),r.d(i,{MorphArray:()=>Qt,height:()=>te,width:()=>Zt,x:()=>Jt,y:()=>Kt});var s={};r.r(s),r.d(s,{array:()=>Ee,clear:()=>Ae,move:()=>Ce,plot:()=>je,size:()=>Te});var o={};r.r(o),r.d(o,{amove:()=>or,ax:()=>ir,ay:()=>sr,build:()=>ar,center:()=>nr,cx:()=>er,cy:()=>rr,length:()=>Je,move:()=>tr,plain:()=>Qe,x:()=>Ke,y:()=>Ze});var a={};r.r(a),r.d(a,{dmove:()=>dr,dx:()=>mr,dy:()=>pr,height:()=>gr,move:()=>yr,size:()=>br,width:()=>wr,x:()=>vr,y:()=>xr});const u={},h=[];function c(t,e){if(Array.isArray(t))for(const r of t)c(r,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const e in t)c(e,t[e])}function l(t){return u[t]||{}}function f(t){h.push(...t)}function d(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function m(t){return t%360*Math.PI/180}function p(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function y(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const b=new Set(["desc","metadata","title"]),w=t=>b.has(t.nodeName),v=(t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},x="http://www.w3.org/2000/svg",_="http://www.w3.org/2000/xmlns/",S="http://www.w3.org/1999/xlink",N={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class M{}const P={},O="___SYMBOL___ROOT___";function E(t,e=x){return N.document.createElementNS(e,t)}function A(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return T(t);if(null==t)return new P[O];if("string"==typeof t&&"<"!==t.charAt(0))return T(N.document.querySelector(t));const r=e?N.document.createElement("div"):E("svg");return r.innerHTML=t,t=T(r.firstChild),r.removeChild(r.firstChild),t}function C(t,e){return e&&(e instanceof N.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:E(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new P.Fragment(t);let e=p(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":P[e]||(e="Dom"),new P[e](t)}let T=j;function D(t,e=t.name,r=!1){return P[e]=t,r&&(P[O]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let k=1e3;function B(t){return"Svgjs"+p(t)+k++}function I(t){for(let e=t.children.length-1;e>=0;e--)I(t.children[e]);return t.id?(t.id=B(t.nodeName),t):t}function L(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function V(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}c("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=A(t)).before(this),this},insertAfter:function(t){return(t=A(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,R=/\)\s*,?\s*/,q=/\s/g,Y=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,U=/^rgb\(/,H=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,J=/[MLHVCSQTAZ]/i;function K(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Z(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function tt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),c("Dom",{css:function(t,e){const r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||H.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||H.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,r){if(null==t)return this.data(d(function(t){let e;const r=t.length,n=[];for(e=0;e<r;e++)0===t[e].nodeName.indexOf("data-")&&n.push(t[e]);return n}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class et{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof et||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:r,round:n,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new et(t,e,n,"lch")}if("sine"===t){const t=n(80*i(2*s*(e=null==e?r():e)/.5+.01)+150),o=n(50*i(2*s*e/.5+4.6)+200),a=n(100*i(2*s*e/.5+2.3)+150);return new et(t,o,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new et(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new et(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new et(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new et(t,e,n,"lab")}if("grey"===t){const t=255*r();return new et(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Y.test(t)||U.test(t))}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new et(0,0,0,1,"cmyk"):new et((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new et(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const r=function(t,e){const r=Z(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Z(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Z(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Z(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Z(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Z(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(U.test(t)){const e=t.replace(q,""),[r,n,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!Y.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=z.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new et(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new et(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new et(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new et(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*tt(i,n,t+1/3),o=255*tt(i,n,t),a=255*tt(i,n,t-1/3);return new et(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new et(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(K);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new et(f,d,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,e){const r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?0:r.x,this.y=null==r.y?0:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));const{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function nt(t,e,r){return Math.abs(e-t)<(r||1e-6)}class it{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),m=d.x,p=d.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,px:m,py:p}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,r){const n=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new it(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),m=Math.sin(l),p=(r*i+n*s)/u,g=i*c/(p*r-n)||s*c/(p*n+r);return{scaleX:c,scaleY:g,shear:p,rotate:f,translateX:o-t+t*d*c+e*(p*d*c-m*g),translateY:a-e+t*m*c+e*(p*m*c+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new it(t);return nt(this.a,e.a)&&nt(this.b,e.b)&&nt(this.c,e.c)&&nt(this.d,e.d)&&nt(this.e,e.e)&&nt(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=it.fromArray([1,0,0,1,0,0]);return t=t instanceof Ot?t.matrixify():"string"==typeof t?it.fromArray(t.split(Q).map(parseFloat)):Array.isArray(t)?it.fromArray(t):"object"==typeof t&&it.isMatrixLike(t)?t:"object"==typeof t?(new it).transform(t):6===arguments.length?it.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof it?t:new it(t);return it.matrixMultiply(this,e,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=m(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:c}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=h*n-c*i+r*i-e*n+e,this.f=c*n+h*i-e*i-r*n+r,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:c,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=c+l*i-n*i,this.f=l+c*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(it.isMatrixLike(t))return new it(t).multiplyO(this);const e=it.formatTransforms(t),{x:r,y:n}=new rt(e.ox,e.oy).transform(this),i=(new it).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new rt(r,n).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function st(){if(!st.nodes){const t=A().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;st.nodes={svg:t,path:e}}if(!st.nodes.svg.node.parentNode){const t=N.document.body||N.document.documentElement;st.nodes.svg.addTo(t)}return st.nodes}function ot(t){return!(t.width||t.height||t.x||t.y)}D(it,"Matrix");class at{constructor(...t){this.init(...t)}addOffset(){return this.x+=N.window.pageXOffset,this.y+=N.window.pageYOffset,new at(this)}init(t){return t="string"==typeof t?t.split(Q).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ot(this)}merge(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new at(e,r,n,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof it||(t=new it(t));let e=1/0,r=-1/0,n=1/0,i=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new at(e,n,r-e,i-n)}}function ut(t,e,r){let n;try{if(n=e(t.node),ot(n)&&(i=t.node)!==N.document&&!(N.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===N.document}).call(N.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}c({viewbox:{viewbox(t,e,r,n){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new rt(r/2/s+i.x,n/2/o+i.y);const h=new at(i).transform(new it({scale:u,origin:e}));return this.viewbox(h)}}}),D(at,"Box");class ht extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const ct=ht;L([ht],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const lt=["toArray","constructor","each"];function ft(t,e){return new ct(d((e||N.document).querySelectorAll(t),(function(t){return j(t)})))}ht.extend=function(t){t=t.reduce(((t,e)=>(lt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),L([ht],t)};let dt=0;const mt={};function pt(t){let e=t.getEventHolder();return e===N.window&&(e=mt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,r,n,i){const s=r.bind(n||t),o=A(t),a=pt(o),u=gt(o);e=Array.isArray(e)?e:e.split(Q),r._svgjsListenerId||(r._svgjsListenerId=++dt),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function bt(t,e,r,n){const i=A(t),s=pt(i),o=gt(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])bt(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&bt(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])bt(o,[e,u].join("."));delete s[e]}}else{for(t in s)bt(o,t);!function(t){let e=t.getEventHolder();e===N.window&&(e=mt),e.events&&(e.events={})}(i)}}))}class wt extends M{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=gt(t);return e instanceof N.window.Event||(e=new N.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return bt(this,t,e,r),this}on(t,e,r,n){return yt(this,t,e,r,n),this}removeEventListener(){}}function vt(){}D(wt,"EventTarget");const xt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class _t extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Q).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class St{constructor(...t){this.init(...t)}convert(t){return new St(this.value,t)}divide(t){return t=new St(t),new St(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof St&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new St(t),new St(this-t,this.unit||t.unit)}plus(t){return t=new St(t),new St(this+t,this.unit||t.unit)}times(t){return t=new St(t),new St(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Nt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Mt=[];class Pt extends wt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=A(t)).removeNamespace&&this.node instanceof N.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return A(t).put(this,e)}children(){return new ct(d(this.node.children,(function(t){return j(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let r=this.node.cloneNode(t);return e&&(r=I(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new Pt(E(t),e))}first(){return j(this.node.firstChild)}get(t){return j(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=B(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(this.node.lastChild)}matches(t){const e=this.node,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=A(t),this.add(t,e),t}putIn(t,e){return A(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=A(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,x)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=j(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=E("wrapper",r),i=N.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}L(Pt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=W.test(r.nodeValue)?parseFloat(r.nodeValue):r.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?xt[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=Mt.reduce(((e,r)=>r(t,e,this)),e))?e=new St(e):Nt.has(t)&&et.isColor(e)?e=new et(e):e.constructor===Array&&(e=new _t(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return ft(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),D(Pt,"Dom");class Ot extends Pt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new St(t).plus(this.x()))}dy(t=0){return this.y(new St(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=A(t));const r=new ct;let n=this;for(;(n=n.parent())&&n.node!==N.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?A(e[1]):null}root(){const t=this.parent(P[O]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=g(this,t,e);return this.width(new St(r.width)).height(new St(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}L(Ot,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(st().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),r=new at(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.height},point:function(t,e){return new rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new it(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new it(e)}return new it(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new it}}}),D(Ot,"Element");const Et={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let r;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof et||et.isRgb(e)||e instanceof Ot)this.attr(t,e);else for(r=Et[t].length-1;r>=0;r--)null!=e[Et[t][r]]&&this.attr(Et.prefix(t,Et[t][r]),e[Et[t][r]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new it(this):this.attr("transform",new it(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new St(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(R).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(it.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new it)},toParent:function(t,e){if(this===t)return this;if(w(this.node))return this.addTo(t,e);const r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new it(this).decompose();return null==t?e:e[t]}it.isMatrixLike(t)||(t={...t,origin:y(t,this)});const r=new it(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});class At extends Ot{flatten(){return this.each((function(){if(this instanceof At)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}D(At,"Container");class Ct extends At{constructor(t,e=t){super(C("defs",t),e)}flatten(){return this}ungroup(){return this}}D(Ct,"Defs");class jt extends Ot{}function Tt(t){return this.attr("rx",t)}function Dt(t){return this.attr("ry",t)}function kt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Bt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Lt(t){return this.attr("cy",t)}function Vt(t){return null==t?2*this.rx():this.rx(new St(t).divide(2))}function Ft(t){return null==t?2*this.ry():this.ry(new St(t).divide(2))}D(jt,"Shape");class zt extends jt{constructor(t,e=t){super(C("ellipse",t),e)}size(t,e){const r=g(this,t,e);return this.rx(new St(r.width).divide(2)).ry(new St(r.height).divide(2))}}L(zt,t),c("Container",{ellipse:V((function(t=0,e=t){return this.put(new zt).size(t,e).move(0,0)}))}),D(zt,"Ellipse");class Xt extends Pt{constructor(t=N.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new Pt(E("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}D(Xt,"Fragment");const Gt=Xt;function Rt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new St(t),fy:new St(e)}):this.attr({x1:new St(t),y1:new St(e)})}function qt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new St(t),cy:new St(e)}):this.attr({x2:new St(t),y2:new St(e)})}class Yt extends At{constructor(t,e){super(C(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}L(Yt,e),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:V((function(t,e){return this.put(new Yt(t)).update(e)}))}}),D(Yt,"Gradient");class Ut extends At{constructor(t,e=t){super(C("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new at}targets(){return ft("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}c({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:V((function(t,e,r){return this.put(new Ut).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Ut,"Pattern");class Ht extends jt{constructor(t,e=t){super(C("image",t),e)}load(t,e){if(!t)return this;const r=new N.window.Image;return yt(r,"load",(function(t){const n=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof Ut&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(r,"load error",(function(){bt(r)})),this.attr("href",r.src=t,S)}}var Wt;Wt=function(t,e,r){return"fill"!==t&&"stroke"!==t||$.test(e)&&(e=r.root().defs().image(e)),e instanceof Ht&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Mt.push(Wt),c({Container:{image:V((function(t,e){return this.put(new Ht).size(0,0).load(t,e)}))}}),D(Ht,"Image");class $t extends _t{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new at(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,r=this.length;e<r;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){it.isMatrixLike(t)||(t=new it(t));for(let e=this.length;e--;){const[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}const Qt=$t;function Jt(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function Kt(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Zt(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function te(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class ee extends jt{constructor(t,e=t){super(C("line",t),e)}array(){return new $t([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new $t(t).toLine(),this.attr(t))}size(t,e){const r=g(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}L(ee,i),c({Container:{line:V((function(...t){return ee.prototype.plot.apply(this.put(new ee),null!=t[0]?t:[0,0,0,0])}))}}),D(ee,"Line");class re extends At{constructor(t,e=t){super(C("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ne(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:V((function(t,e,r){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),D(re,"Marker");const ie={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class se{done(){return!1}}class oe extends se{constructor(t=">"){super(),this.ease=ie[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class ae extends se{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}L(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:ne("_duration",ue),overshoot:ne("_overshoot",ue)}),L(class extends ae{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ne("_windup"),p:ne("P"),i:ne("I"),d:ne("D")});const he={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,r){return e.x=r.x,e.y=r.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},le="mlhvqtcsaz".split("");for(let t=0,e=le.length;t<e;++t)ce[le[t]]=function(t){return function(e,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return ce[t](e,r,n)}}(le[t].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===he[t.segment[0].toUpperCase()]}function de(t,e){t.inNumber&&me(t,!1);const r=J.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function me(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fe(t)&&pe(t)}function pe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ge(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ye(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);class we extends _t{bbox(){return st().path.setAttribute("d",this.toString()),new at(st.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!de(i,n))if("."!==n)if(isNaN(parseInt(n)))if(be.has(n))i.inNumber&&me(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(J.test(n)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");pe(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ye(i)){me(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||ge(i)){i.inNumber=!0,i.number=n,me(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){me(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&pe(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const ve=t=>{const e=typeof t;return"number"===e?St:"string"===e?et.isColor(t)?et:Q.test(t)?J.test(t)?we:_t:F.test(t)?St:_e:Pe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?_t:"object"===e?Me:_e};class xe{constructor(t){this._stepper=t||new oe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ve(t));let e=new this._type(t);return this._type===et&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class _e{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Se{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Se.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ne=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class Me{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===et&&t[r+7]!==e[r+7]){const e=t[r+7],n=new et(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=ve(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(Ne),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const Pe=[_e,Se,Me];class Oe extends jt{constructor(t,e=t){super(C("path",t),e)}array(){return this._array||(this._array=new we(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new we(t))}size(t,e){const r=g(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function Ee(){return this._array||(this._array=new $t(this.attr("points")))}function Ae(){return delete this._array,this}function Ce(t,e){return this.attr("points",this.array().move(t,e))}function je(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new $t(t))}function Te(t,e){const r=g(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}Oe.prototype.MorphArray=we,c({Container:{path:V((function(t){return this.put(new Oe).plot(t||new we)}))}}),D(Oe,"Path");class De extends jt{constructor(t,e=t){super(C("polygon",t),e)}}c({Container:{polygon:V((function(t){return this.put(new De).plot(t||new $t)}))}}),L(De,i),L(De,s),D(De,"Polygon");class ke extends jt{constructor(t,e=t){super(C("polyline",t),e)}}c({Container:{polyline:V((function(t){return this.put(new ke).plot(t||new $t)}))}}),L(ke,i),L(ke,s),D(ke,"Polyline");class Be extends jt{constructor(t,e=t){super(C("rect",t),e)}}L(Be,{rx:Tt,ry:Dt}),c({Container:{rect:V((function(t,e){return this.put(new Be).size(t,e)}))}}),D(Be,"Rect");class Ie{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>N.window.performance||N.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const r=Le.timer().now()+e,n=Le.timeouts.push({run:t,time:r});return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),n},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=N.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const r=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==r););let n=null;const i=Le.frames.last();for(;n!==i&&(n=Le.frames.shift());)n.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?N.window.requestAnimationFrame(Le._draw):null}},Ve=Le,Fe=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},ze=function(){const t=N.window;return(t.performance||t.Date).now()};class Xe extends wt{constructor(t=ze){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(Fe);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Xe,this._timeline):(this._timeline=t,this)}}});class Ge extends wt{constructor(t){super(),this.id=Ge.id++,t="function"==typeof(t=null==t?400:t)?new ae(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ae,this._stepper=this._isDeclarative?t:new oe,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new it,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,r){let n=1,i=!1,s=0;return e=e??0,r=r||"last","object"!=typeof(t=t??400)||t instanceof se||(e=t.delay??e,r=t.when??r,i=t.swing||i,n=t.times??n,s=t.wait??s,t=t.duration??400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,r){const n=Ge.sanitise(t,e,r),i=new Ge(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.when)}clearTransform(){return this.transforms=new it,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new oe(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,r,n){return this._queue.push({initialiser:t||vt,runner:e||vt,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,r){if(t instanceof Xe||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),this.transforms=new it,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Ge.id=0;class Re{constructor(t=new it,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}L([Ge,Re],{mergeWith(t){return new Re(t.transforms.lmultiply(this.transforms),t.id)}});const qe=(t,e)=>t.lmultiplyO(e),Ye=t=>t.transforms;function Ue(){const t=this._transformationRunners.runners.map(Ye).reduce(qe,new it);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class He{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Re).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}c({Element:{animate(t,e,r){const n=Ge.sanitise(t,e,r),i=this.timeline();return new Ge(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ye).reduce(qe,new it)},_addRunner(t){this._transformationRunners.add(t),Ve.cancelImmediate(this._frameId),this._frameId=Ve.immediate(Ue.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new He).add(new Re(new it(this))))}}}),L(Ge,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new xe(this._stepper).to(n),s=Object.keys(n);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new Me(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new Me(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new xe(this._stepper).to(new St(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=it.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new xe(this._stepper).type(r?Se:it);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||y(t,o),h=new it(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new rt(s).transform(o._currentTransform(this));let d=new it({...t,origin:[l,f]}),m=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),m=m.decompose(l,f);const t=d.rotate,e=m.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(m.rotate=u)),i.from(m),i.to(d);const p=i.at(c);return u=p.rotate,a=new it(p),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=y(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new St(e),this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new St(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new xe(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new St(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);if(this._tryRetarget("plot",t))return this;const i=new xe(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,n){return this._queueObject("viewbox",new at(t,e,r,n))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),L(Ge,{rx:Tt,ry:Dt,from:Rt,to:qt}),D(Ge,"Runner");class We extends At{constructor(t,e=t){super(C("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new Ct):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof N.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:x,version:"1.1"}).attr("xmlns:xlink",S,_):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,_).attr("xmlns:svgjs",null,_)}root(){return this.isRoot()?this:super.root()}}c({Container:{nested:V((function(){return this.put(new We)}))}}),D(We,"Svg",!0);class $e extends At{constructor(t,e=t){super(C("symbol",t),e)}}function Qe(t){return!1===this._build&&this.clear(),this.node.appendChild(N.document.createTextNode(t)),this}function Je(){return this.node.getComputedTextLength()}function Ke(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Ze(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function tr(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function er(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function rr(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function nr(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function ir(t){return this.attr("x",t)}function sr(t){return this.attr("y",t)}function or(t,e){return this.ax(t).ay(e)}function ar(t){return this._build=!!t,this}c({Container:{symbol:V((function(){return this.put(new $e)}))}}),D($e,"Symbol");class ur extends jt{constructor(t,e=t){super(C("text",t),e),this.dom.leading=this.dom.leading??new St(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new St(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const r=this.dom.leading;this.each((function(n){if(w(this.node))return;const i=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new St(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new St(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"===e[n].nodeName||w(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===j(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}L(ur,o),c({Container:{text:V((function(t=""){return this.put(new ur).text(t)})),plain:V((function(t=""){return this.put(new ur).plain(t)}))}}),D(ur,"Text");class hr extends jt{constructor(t,e=t){super(C("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ur))return this;const e=t.index(this),r=N.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new St(r);return this.dy(e?n:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}L(hr,o),c({Tspan:{tspan:V((function(t=""){const e=new hr;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),D(hr,"Tspan");class cr extends jt{constructor(t,e=t){super(C("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new St(t).divide(2))}}L(cr,{x:kt,y:Bt,cx:It,cy:Lt,width:Vt,height:Ft}),c({Container:{circle:V((function(t=0){return this.put(new cr).size(t).move(0,0)}))}}),D(cr,"Circle");class lr extends At{constructor(t,e=t){super(C("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return ft("svg [clip-path*="+this.id()+"]")}}c({Container:{clip:V((function(){return this.defs().put(new lr)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lr?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),D(lr,"ClipPath");class fr extends Ot{constructor(t,e=t){super(C("foreignObject",t),e)}}function dr(t,e){return this.children().forEach((r=>{let n;try{n=r.node instanceof N.window.SVGSVGElement?new at(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new it(r),s=i.translate(t,e).transform(i.inverse()),o=new rt(n.x,n.y).transform(s);r.move(o.x,o.y)})),this}function mr(t){return this.dmove(t,0)}function pr(t){return this.dmove(0,t)}function gr(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function yr(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function br(t,e,r=this.bbox()){const n=g(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach((t=>{const e=new rt(r).transform(new it(t).inverse());t.scale(i,s,e.x,e.y)})),this}function wr(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function vr(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function xr(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}c({Container:{foreignObject:V((function(t,e){return this.put(new fr).size(t,e)}))}}),D(fr,"ForeignObject");class _r extends At{constructor(t,e=t){super(C("g",t),e)}}L(_r,a),c({Container:{group:V((function(){return this.put(new _r)}))}}),D(_r,"G");class Sr extends At{constructor(t,e=t){super(C("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,S)}}L(Sr,a),c({Container:{link:V((function(t){return this.put(new Sr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const r=e.index(t);return e.add(this,r),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Sr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),D(Sr,"A");class Nr extends At{constructor(t,e=t){super(C("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return ft("svg [mask*="+this.id()+"]")}}c({Container:{mask:V((function(){return this.defs().put(new Nr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Nr?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),D(Nr,"Mask");class Mr extends Ot{constructor(t,e=t){super(C("stop",t),e)}update(t){return("number"==typeof t||t instanceof St)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new St(t.offset)),this}}c({Gradient:{stop:function(t,e,r){return this.put(new Mr).update(t,e,r)}}}),D(Mr,"Stop");class Pr extends Ot{constructor(t,e=t){super(C("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}c("Dom",{style(t,e){return this.put(new Pr).rule(t,e)},fontface(t,e,r){return this.put(new Pr).font(t,e,r)}}),D(Pr,"Style");class Or extends ur{constructor(t,e=t){super(C("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}c({Container:{textPath:V((function(t,e){return t instanceof ur||(t=this.text(t)),t.path(e)}))},Text:{path:V((function(t,e=!0){const r=new Or;let n;if(t instanceof Oe||(t=this.defs().path(t)),r.attr("href","#"+t,S),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:V((function(t){return t instanceof ur||(t=(new ur).addTo(this.parent()).text(t)),t.path(this)})),targets(){return ft("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Or.prototype.MorphArray=we,D(Or,"TextPath");class Er extends jt{constructor(t,e=t){super(C("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,S)}}c({Container:{use:V((function(t,e){return this.put(new Er).use(t,e)}))}}),D(Er,"Use"),L([We,$e,Ht,Ut,re],l("viewbox")),L([ee,ke,De,Oe],l("marker")),L(ur,l("Text")),L(Oe,l("Path")),L(Ct,l("Defs")),L([ur,hr],l("Tspan")),L([Be,zt,Yt,Ge],l("radius")),L(wt,l("EventTarget")),L(Pt,l("Dom")),L(Ot,l("Element")),L(jt,l("Shape")),L([At,Gt],l("Container")),L(Yt,l("Gradient")),L(Ge,l("Runner")),ct.extend([...new Set(h)]),function(t=[]){Pe.push(...[].concat(t))}([St,et,at,it,_t,$t,we,rt]),L(Pe,{to(t){return(new xe).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ar=r(726),Cr=r(358);class jr{constructor(t,e){this.svgDoc=t,this.elements=e,new MutationObserver((t=>{t.some((t=>t.removedNodes.length>0))&&(this.elements=this.elements.filter((t=>this.svgDoc.contains(t.domNode))))})).observe(t,{childList:!0,subtree:!0})}}class Tr{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new jr(t,e)}get bases(){return this.elementsDrawing.elements}set bases(t){this.elementsDrawing.elements=t}append(t){t.appendTo(this.svgDoc),this.bases.push(t)}add(t){let e=Cr.Nucleobase.create(t);return this.append(e),e}}var Dr,kr,Br=r(534),Ir=r(742),Lr=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},Vr=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Fr{constructor(t){this.domNode=t,Dr.set(this,void 0),kr.set(this,void 0),Lr(this,Dr,new jr(t,[]),"f"),Lr(this,kr,new MutationObserver((()=>{this.elements.forEach((t=>{this.domNode.contains(t.owner.domNode)||t.domNode.remove()}))})),"f"),Vr(this,kr,"f").observe(t,{childList:!0,subtree:!0})}get elements(){return Vr(this,Dr,"f").elements}set elements(t){Vr(this,Dr,"f").elements=t}}Dr=new WeakMap,kr=new WeakMap;var zr,Xr,Gr=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},Rr=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class qr{constructor(t){this.domNode=t,zr.set(this,void 0),Gr(this,zr,new Fr(t),"f")}get baseNumberings(){return Rr(this,zr,"f").elements}set baseNumberings(t){Rr(this,zr,"f").elements=t}number(t,e){let r=Ir.BaseNumbering.numbering(t,e);return this.domNode.insertBefore(r.domNode,t.domNode),Rr(this,zr,"f").elements.push(r),r}}zr=new WeakMap;class Yr{constructor(t){this.domNode=t,Xr.set(this,void 0),Gr(this,Xr,new Fr(t),"f")}get baseNumberingLines(){return Rr(this,Xr,"f").elements}set baseNumberingLines(t){Rr(this,Xr,"f").elements=t}connect(t){let e=Ir.BaseNumberingLine.connecting(t);return this.domNode.insertBefore(e.domNode,t.domNode),Rr(this,Xr,"f").elements.push(e),e}}Xr=new WeakMap;var Ur,Hr=r(775),Wr=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class $r{constructor(t){this.domNode=t,Ur.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,Ur,new Fr(t),"f")}get baseOutlines(){return Wr(this,Ur,"f").elements}set baseOutlines(t){Wr(this,Ur,"f").elements=t}append(t){this.domNode.append(t.domNode),this.baseOutlines.push(t)}outline(t){let e=Hr.BaseOutline.outlining(t);return t.domNode.insertAdjacentElement("beforebegin",e.domNode),this.baseOutlines.push(e),e}}Ur=new WeakMap;var Qr=r(282);class Jr{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new jr(t,e),new MutationObserver((()=>{this.bonds.forEach((t=>{this.svgDoc.contains(t.base1.domNode)&&this.svgDoc.contains(t.base2.domNode)||t.remove()}))})).observe(t,{childList:!0,subtree:!0})}get bonds(){return this.elementsDrawing.elements}set bonds(t){this.elementsDrawing.elements=t}}class Kr{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#808080","stroke-width":"1"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Jr(t,e)}get primaryBonds(){return this.bondsDrawing.bonds}set primaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.primaryBonds.push(t)}add(t,e){let r=Qr.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}class Zr{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Jr(t,e)}get secondaryBonds(){return this.bondsDrawing.bonds}set secondaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.secondaryBonds.push(t)}add(t,e){let r=Qr.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}var tn,en=r(854),rn=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class nn{constructor(t){if(tn.set(this,void 0),!(0,en.isNonNullObject)(t))throw new Error("Saved drawings must be non-null objects.");!function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,tn,t,"f")}get outerXML(){if((0,en.isString)(rn(this,tn,"f").outerXML))return rn(this,tn,"f").outerXML;if((0,en.isString)(rn(this,tn,"f").svg))return rn(this,tn,"f").svg;throw new Error("Unable to find the outer XML of the saved drawing.")}get bases(){if((0,en.isArray)(rn(this,tn,"f").bases)){if(!rn(this,tn,"f").bases.every(en.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return rn(this,tn,"f").bases}if((0,en.isArray)(rn(this,tn,"f").sequences)){if(!rn(this,tn,"f").sequences.every(en.isNonNullObject))throw new Error("Saved sequences must be non-null objects.");let t=rn(this,tn,"f").sequences.flatMap((t=>t.bases));if(!t.every(en.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return t}return[]}get outlines(){if((0,en.isArray)(rn(this,tn,"f").outlines))return rn(this,tn,"f").outlines;if((0,en.isArray)(rn(this,tn,"f").baseOutlines))return rn(this,tn,"f").baseOutlines;try{let t=this.bases;if(t.some((t=>t.outline)))return t.filter((t=>t.outline)).map((t=>{if(!(0,en.isNonNullObject)(t.outline))throw new Error("Saved outlines must be non-null objects.");return Object.assign(Object.assign({},t.outline),{ownerID:t.textId})}))}catch(t){}return[]}get numberings(){if((0,en.isArray)(rn(this,tn,"f").numberings))return rn(this,tn,"f").numberings;if((0,en.isArray)(rn(this,tn,"f").baseNumberings))return rn(this,tn,"f").baseNumberings;try{let t=this.bases;if(t.some((t=>t.numbering)))return t.filter((t=>t.numbering)).map((t=>{if(!(0,en.isNonNullObject)(t.numbering))throw new Error("Saved numberings must be non-null objects.");return Object.assign(Object.assign({},t.numbering),{ownerID:t.textId})}))}catch(t){}return[]}get numberingLines(){if((0,en.isArray)(rn(this,tn,"f").numberingLines))return rn(this,tn,"f").numberingLines;if((0,en.isArray)(rn(this,tn,"f").baseNumberingLines))return rn(this,tn,"f").baseNumberingLines;try{let t=this.bases;if(t.some((t=>t.numbering)))return t.filter((t=>t.numbering)).map((t=>t.numbering))}catch(t){}return[]}get primaryBonds(){return(0,en.isArray)(rn(this,tn,"f").primaryBonds)?rn(this,tn,"f").primaryBonds:[]}get secondaryBonds(){return(0,en.isArray)(rn(this,tn,"f").secondaryBonds)?rn(this,tn,"f").secondaryBonds:[]}}tn=new WeakMap;var sn,on,an,un,hn,cn=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},ln=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class fn{constructor(){sn.add(this),on.set(this,void 0),an.set(this,void 0),un.set(this,void 0),this.domNode=(new We).node,this.domNode.setAttribute("viewBox",`0 0 ${dn} ${mn}`),this.domNode.setAttribute("width",`${dn}`),this.domNode.setAttribute("height",`${mn}`),this.basesDrawing=new Tr(this.domNode,[]),cn(this,on,new qr(this.domNode),"f"),cn(this,an,new Yr(this.domNode),"f"),cn(this,un,new $r(this.domNode),"f"),this.primaryBondsDrawing=new Kr(this.domNode,[]),this.secondaryBondsDrawing=new Zr(this.domNode,[])}get outerXML(){return this.domNode.outerHTML}set outerXML(t){new Ar.OuterXML(this.domNode).set(t)}get innerXML(){return this.domNode.innerHTML}set innerXML(t){new Ar.InnerXML(this.domNode).set(t)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}get minX(){return this.domNode.viewBox.baseVal.x}set minX(t){let e=this.maxX-t,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${t} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get maxX(){return this.minX+this.width}set maxX(t){let e=t-this.minX,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get minY(){return this.domNode.viewBox.baseVal.y}set minY(t){let e=this.maxY-t,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${t} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}get maxY(){return this.minY+this.height}set maxY(t){let e=t-this.minY,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}setBoundaries({minX:t,maxX:e,minY:r,maxY:n}){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}get width(){return this.domNode.viewBox.baseVal.width}set width(t){this.maxX=this.minX+t}get height(){return this.domNode.viewBox.baseVal.height}set height(t){this.maxY=this.minY+t}get horizontalScaling(){let t=this.width;return this.domNode.width.baseVal.value/t}set horizontalScaling(t){let e=this.width;this.domNode.setAttribute("width",(t*e).toString())}get verticalScaling(){let t=this.height;return this.domNode.height.baseVal.value/t}set verticalScaling(t){let e=this.height;this.domNode.setAttribute("height",(t*e).toString())}setScaling(t){this.horizontalScaling=t,this.verticalScaling=t}get horizontalClientScaling(){return new Ar.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new Ar.VerticalClientScaling(this.domNode).get()}get bases(){return this.basesDrawing.bases}set bases(t){this.basesDrawing.bases=[...t]}appendBase(t){this.basesDrawing.append(t)}addBase(t){return this.basesDrawing.add(t)}number(t,e){let r=ln(this,on,"f").number(t,e),n=ln(this,an,"f").connect(r);return r.displacement.magnitude=10,n.direction=(0,Br.outwardNormal)(t,...ln(this,sn,"a",hn)),n.length=1.15*r.domNode.getBBox().height,[r,n]}get baseNumberings(){return ln(this,on,"f").baseNumberings}set baseNumberings(t){ln(this,on,"f").baseNumberings=[...t]}get baseNumberingLines(){return ln(this,an,"f").baseNumberingLines}set baseNumberingLines(t){ln(this,an,"f").baseNumberingLines=[...t]}get baseOutlines(){return ln(this,un,"f").baseOutlines}set baseOutlines(t){ln(this,un,"f").baseOutlines=[...t]}get outlines(){return this.baseOutlines}outlineBase(t){return ln(this,un,"f").outline(t)}outline(t){return this.outlineBase(t)}appendBaseOutline(t){ln(this,un,"f").append(t)}get primaryBonds(){return this.primaryBondsDrawing.primaryBonds}set primaryBonds(t){this.primaryBondsDrawing.primaryBonds=[...t]}appendPrimaryBond(t){this.primaryBondsDrawing.append(t)}addPrimaryBond(t,e){return this.primaryBondsDrawing.add(t,e)}get secondaryBonds(){return this.secondaryBondsDrawing.secondaryBonds}set secondaryBonds(t){this.secondaryBondsDrawing.secondaryBonds=[...t]}appendSecondaryBond(t){this.secondaryBondsDrawing.append(t)}addSecondaryBond(t,e){return this.secondaryBondsDrawing.add(t,e)}rotate(t,e){let r=new Set(t);for(let t of this.baseNumberings)if(r.has(t.owner)){let r=Ir.BaseNumberingLine.unpadded(t);this.domNode.append(r.domNode),r.direction+=e,r.domNode.remove()}(0,Br.rotate)(t,e)}get defaultValues(){let t=this.primaryBondsDrawing,e=this.secondaryBondsDrawing;return{get primaryBonds(){return t.defaultValues},set primaryBonds(e){t.defaultValues=e},get secondaryBonds(){return e.defaultValues},set secondaryBonds(t){e.defaultValues=t}}}get contentBBox(){return this.domNode.getBBox()}setPadding(t){let e=this.contentBBox;this.setBoundaries({minX:e.x-t,maxX:e.x+e.width+t,minY:e.y-t,maxY:e.y+e.height+t})}reset(){this.domNode.innerHTML="",this.basesDrawing.bases=[],ln(this,un,"f").baseOutlines=[],this.primaryBondsDrawing.primaryBonds=[],this.secondaryBondsDrawing.secondaryBonds=[],[...this.domNode.attributes].forEach((t=>this.domNode.removeAttribute(t.name))),this.domNode.setAttribute("viewBox",`0 0 ${dn} ${mn}`),this.domNode.setAttribute("width",`${dn}`),this.domNode.setAttribute("height",`${mn}`)}serialized(){return{outerXML:this.outerXML,bases:[...this.bases].map((t=>t.serialized())),baseNumberings:[...this.baseNumberings].map((t=>t.serialized())),baseNumberingLines:[...this.baseNumberingLines].map((t=>t.serialized())),baseOutlines:[...this.baseOutlines].map((t=>t.serialized())),primaryBonds:[...this.primaryBonds].map((t=>t.serialized())),secondaryBonds:[...this.secondaryBonds].map((t=>t.serialized()))}}static deserialized(t){let e=new nn(t),r=new fn,n=document.createElement("div");n.append(r.domNode),n.style.width="0px",n.style.height="0px",document.body.append(n),r.outerXML=e.outerXML;let i=r.domNode;r.bases=e.bases.map((t=>Cr.Nucleobase.deserialized(t,r)));let s=[...r.bases];r.baseNumberings=e.numberings.map((t=>Ir.BaseNumbering.deserialized(t,{domNode:i,bases:s})));let o=[...r.baseNumberings];return r.baseNumberingLines=e.numberingLines.map((t=>Ir.BaseNumberingLine.deserialized(t,{domNode:i,baseNumberings:o}))),r.baseOutlines=e.outlines.map((t=>Hr.BaseOutline.deserialized(t,r))),r.primaryBonds=e.primaryBonds.map((t=>Qr.StraightBond.deserialized(t,r))),r.secondaryBonds=e.secondaryBonds.map((t=>Qr.StraightBond.deserialized(t,r))),r.domNode.remove(),n.remove(),r}restore(t){let e=fn.deserialized(t),r=[...e.bases],n=[...e.baseNumberings],i=[...e.baseNumberingLines],s=[...e.baseOutlines],o=[...e.primaryBonds],a=[...e.secondaryBonds];this.reset(),[...this.domNode.attributes].forEach((t=>this.domNode.removeAttribute(t.name))),[...e.domNode.attributes].forEach((t=>this.domNode.setAttribute(t.name,t.value))),[...e.domNode.childNodes].forEach((t=>this.domNode.appendChild(t))),this.bases=r,this.baseNumberings=n,this.baseNumberingLines=i,this.baseOutlines=s,this.primaryBonds=o,this.secondaryBonds=a}}on=new WeakMap,an=new WeakMap,un=new WeakMap,sn=new WeakSet,hn=function(){return[[...this.bases],this.secondaryBondsDrawing.secondaryBonds.map((t=>t.basePair))]};const dn=250,mn=250;var pn=r(127),gn=r(986);class yn{constructor(t){this.targetDrawing=t}draw(t,e){let r=[...t].map((t=>this.targetDrawing.addBase(t)));(0,pn.consecutivePairs)(r).forEach((t=>this.targetDrawing.addPrimaryBond(...t)));let n=[...(0,pn.parseDotBracket)(r,e)];n.forEach((t=>this.targetDrawing.addSecondaryBond(...t))),r.forEach((t=>t.bringToFront()));let i=1.87*(0,gn.mean)(r.map((t=>t.bbox.height)));(0,Br.untangle)(r,n,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2})}}var bn,wn=r(297),vn=r(369),xn=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _n{constructor(t){bn.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,bn,t,"f")}draw(t){let e=(0,wn.parseCT)(t),r=[...e.sequence].map((t=>xn(this,bn,"f").addBase(t)));(0,pn.consecutivePairs)(r).forEach((t=>xn(this,bn,"f").addPrimaryBond(...t)));let n=(0,vn.basePairs)(r,e.positionPairs);n.forEach((t=>xn(this,bn,"f").addSecondaryBond(...t)));let i=1.87*(0,gn.mean)(r.map((t=>t.bbox.height)));(0,Br.untangle)(r,n,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2}),!(r.length>0)||xn(this,bn,"f").number(r[0],1+e.numberingOffset),r.slice(0,-20).forEach(((t,r)=>{let n=r+1;n%20!=0||xn(this,bn,"f").number(t,n+e.numberingOffset)})),!(r.length>0)||xn(this,bn,"f").number(r[r.length-1],r.length+e.numberingOffset),r.forEach((t=>t.bringToFront()))}}bn=new WeakMap;var Sn,Nn,Mn,Pn,On=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class En{constructor(t){Sn.add(this),Nn.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,Nn,t,"f")}draw(t){t.rnaComplexes.forEach((e=>{e.rnaMolecules.forEach((e=>{let r=e.sequence.map((e=>On(this,Sn,"m",Mn).call(this,e,t))),n=(0,gn.mean)(r.map((t=>t.bbox.height)));On(this,Nn,"f").defaultValues.primaryBonds.attributes["stroke-width"]=""+.125*n,On(this,Nn,"f").defaultValues.primaryBonds.basePadding1=.6*n,On(this,Nn,"f").defaultValues.primaryBonds.basePadding2=.6*n,(0,pn.consecutivePairs)(r).forEach((t=>On(this,Nn,"f").addPrimaryBond(...t))),On(this,Nn,"f").defaultValues.secondaryBonds.attributes["stroke-width"]=""+.15*n,On(this,Nn,"f").defaultValues.secondaryBonds.basePadding1=.5*n,On(this,Nn,"f").defaultValues.secondaryBonds.basePadding2=.5*n,new Set(e.basePairs.map((t=>JSON.stringify(t)))).forEach((e=>On(this,Sn,"m",Pn).call(this,JSON.parse(e),r,t)))}))}))}}Nn=new WeakMap,Sn=new WeakSet,Mn=function(t,e){let r=On(this,Nn,"f").addBase(t.residueName);return t.classes.forEach((t=>{e.classes.filter((e=>e.name==t)).forEach((t=>r.setAttributes(Object.assign(Object.assign({},t),{name:void 0}))))})),r.centerPoint.x=t.x,r.centerPoint.y=t.y,r},Pn=function(t,e,r){let n=e[t.residueIndex1],i=e[t.residueIndex2],s=On(this,Nn,"f").addSecondaryBond(n,i);return t.classes.forEach((t=>{r.classes.filter((e=>e.name==t)).forEach((t=>s.setAttributes(Object.assign(Object.assign({},t),{name:void 0}))))})),s}})(),n})()));
|