@rnacanvas/draw.bonds.curved 1.1.0 → 2.0.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/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Installation
2
+
3
+ With `npm`:
4
+
5
+ ```
6
+ npm install @rnacanvas/draw.bonds.curved
7
+ ```
8
+
9
+ # Usage
10
+
11
+ All exports of this package can be accessed as named imports.
12
+
13
+ ```javascript
14
+ // an example import
15
+ import { CurvedBond } from '@rnacanvas/draw.bonds.curved';
16
+ ```
17
+
18
+ ## `class CurvedBond`
19
+
20
+ A bond that can have one or more curves in it
21
+ (often used for tertiary bonds in drawings).
22
+
23
+ ### `static between()`
24
+
25
+ Creates and returns a new curved bond between two bases.
26
+
27
+ ```javascript
28
+ var base1 = Nucleobase.create('A');
29
+ var base2 = Nucleobase.create('U');
30
+
31
+ var bond = CurvedBond.betweeen(base1, base2);
32
+
33
+ bond.base1 === base1; // true
34
+ bond.base2 === base2; // true
35
+
36
+ // the `static between()` method automatically assigns a UUID
37
+ bond.domNode.id.length >= 36; // true
38
+ ```
@@ -1,3 +1,4 @@
1
+ import type { VectorLike } from '@rnacanvas/vectors.oopified';
1
2
  /**
2
3
  * A base padding vector.
3
4
  *
@@ -16,6 +17,7 @@ export declare class BasePadding {
16
17
  * This method doesn't throw.
17
18
  */
18
19
  static from(value: string | undefined | unknown): BasePadding;
20
+ static matching(vector: VectorLike): BasePadding;
19
21
  constructor(magnitude: number, direction: number);
20
22
  toJSON(): string;
21
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BasePadding.d.ts","sourceRoot":"","sources":["../src/BasePadding.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,qBAAa,WAAW;IAmCH,SAAS,EAAE,MAAM;IAAS,SAAS,EAAE,MAAM;IAlC9D;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW;gBAyB1C,SAAS,EAAE,MAAM,EAAS,SAAS,EAAE,MAAM;IAE9D,MAAM,IAAI,MAAM;CAMjB"}
1
+ {"version":3,"file":"BasePadding.d.ts","sourceRoot":"","sources":["../src/BasePadding.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAI9D;;;;GAIG;AACH,qBAAa,WAAW;IAuCH,SAAS,EAAE,MAAM;IAAS,SAAS,EAAE,MAAM;IAtC9D;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW;IAuB7D,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW;gBAM7B,SAAS,EAAE,MAAM,EAAS,SAAS,EAAE,MAAM;IAE9D,MAAM,IAAI,MAAM;CAMjB"}
@@ -1,8 +1,13 @@
1
1
  import type { Nucleobase } from './Nucleobase';
2
2
  export declare class CurvedBond {
3
+ #private;
3
4
  readonly domNode: SVGPathElement;
4
5
  readonly base1: Nucleobase;
5
6
  readonly base2: Nucleobase;
7
+ /**
8
+ * Creates and returns a new curved bond between the two bases.
9
+ */
10
+ static between(base1: Nucleobase, base2: Nucleobase): CurvedBond;
6
11
  constructor(domNode: SVGPathElement, base1: Nucleobase, base2: Nucleobase);
7
12
  }
8
13
  //# sourceMappingURL=CurvedBond.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurvedBond.d.ts","sourceRoot":"","sources":["../src/CurvedBond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,qBAAa,UAAU;IACT,QAAQ,CAAC,OAAO,EAAE,cAAc;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;gBAA/E,OAAO,EAAE,cAAc,EAAW,KAAK,EAAE,UAAU,EAAW,KAAK,EAAE,UAAU;CACrG"}
1
+ {"version":3,"file":"CurvedBond.d.ts","sourceRoot":"","sources":["../src/CurvedBond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAc/C,qBAAa,UAAU;;IA4BT,QAAQ,CAAC,OAAO,EAAE,cAAc;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IA3BpG;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU;gBAwB3C,OAAO,EAAE,cAAc,EAAW,KAAK,EAAE,UAAU,EAAW,KAAK,EAAE,UAAU;CAyGrG"}
@@ -1,3 +1,11 @@
1
1
  export interface Nucleobase {
2
+ readonly domNode: SVGTextElement;
3
+ readonly id: string;
4
+ readonly centerPoint: {
5
+ readonly x: number;
6
+ readonly y: number;
7
+ };
8
+ addEventListener(name: 'change', listener: () => void): void;
9
+ removeEventListener(name: 'change', listener: () => void): void;
2
10
  }
3
11
  //# sourceMappingURL=Nucleobase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Nucleobase.d.ts","sourceRoot":"","sources":["../src/Nucleobase.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;CAAG"}
1
+ {"version":3,"file":"Nucleobase.d.ts","sourceRoot":"","sources":["../src/Nucleobase.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAEjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,WAAW,EAAE;QACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAE7D,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACjE"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports["draw.bonds.curved"]=o():e["draw.bonds.curved"]=o()}(this,()=>(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{CurvedBond:()=>t});class t{constructor(e,o,t){this.domNode=e,this.base1=o,this.base2=t}}return o})());
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.bonds.curved"]=e():t["draw.bonds.curved"]=e()}(this,()=>(()=>{var t={456(t){var e;e=()=>(()=>{var t={986(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,clamp:()=>y,degrees:()=>v,flipAway:()=>O,isBetween:()=>l,isBetweenExclusive:()=>h,isBetweenInclusive:()=>l,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>N,radians:()=>g,round:()=>d,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>p,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;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 s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(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 c(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 l(t,e,r){return t>=e&&t<=r}function h(t,e,r){return t>e&&t<r}function y(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function p(t){var e=s(t);return e.reverse(),e}function d(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function v(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function N(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 O(t,e){var r=(e=N(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854(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 o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return""===t}function c(t){return a(t)&&!u(t)}function l(t){return!!a(t)&&0==t.trim().length}function h(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function y(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function d(t){return"object"==typeof t&&null!==t}function v(t){return Array.isArray(t)}function g(t){return v(t)&&0==t.length}function N(t){return v(t)&&t.length>0}function O(t){return v(t)&&t.every(r)}function b(t){return O(t)&&t.length>0}function x(t){return v(t)&&t.every(n)}function T(t){return v(t)&&t.every(i)}function E(t){return v(t)&&t.every(a)}function _(t){return E(t)&&t.length>0}function A(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>v,isEmptyArray:()=>g,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>h,isJSONSerializable:()=>y,isNonEmptyArray:()=>N,isNonEmptyNumbersArray:()=>b,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>_,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>d,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>O,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>A,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>f,isWhitespace:()=>l}),e})()},277(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){let e="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new r(e,n)}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 o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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,{FinitePoint:()=>o,Point:()=>i,RelativePoint:()=>y,midpoint:()=>m});var t=r(277),e=r(854);class i{static matching(t){return new i(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}set(t){(0,e.isNumber)(null==t?void 0:t.x)&&(this.x=t.x),(0,e.isNumber)(null==t?void 0:t.y)&&(this.y=t.y)}displace(e){let r=t.Vector.matching(e);this.x+=r.x,this.y+=r.y}displaced(t){let e=i.matching(this);return e.displace(t),e}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}}class o extends i{static matching(t){let e=i.matching(t);return new o(e.x,e.y)}constructor(t,r){if(super(t,r),!(0,e.isFiniteNumber)(t)||!(0,e.isFiniteNumber)(r))throw new Error(`Finite points must have finite number coordinates: (${t}, ${r}).`)}set(...t){let e=new i(0,0);e.set(...t),o.matching(e),super.set(...t)}}var s,a,u,c,l,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 y{constructor(e){s.add(this),a.set(this,void 0),u.set(this,new t.Vector(0,0)),c.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,a,e),e.addEventListener("move",()=>h(this,s,"m",l).call(this,"move"))}get x(){return h(this,a,"f").x+h(this,u,"f").x}set x(t){h(this,u,"f").x=t-h(this,a,"f").x,h(this,s,"m",l).call(this,"move")}get y(){return h(this,a,"f").y+h(this,u,"f").y}set y(t){h(this,u,"f").y=t-h(this,a,"f").y,h(this,s,"m",l).call(this,"move")}addEventListener(t,e){h(this,c,"f")[t].push(e)}removeEventListener(t,e){h(this,c,"f")[t]=h(this,c,"f")[t].filter(t=>t!==e)}}a=new WeakMap,u=new WeakMap,c=new WeakMap,s=new WeakSet,l=function(t){h(this,c,"f")[t].forEach(t=>t())};var f=r(986);function m(t,e){return new i((0,f.average)([t.x,e.x]),(0,f.average)([t.y,e.y]))}})(),n})(),t.exports=e()},725(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:()=>y,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>h,isBetweenInclusive:()=>l,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>d,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>m,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;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 s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(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 c(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 l(t,e,r){return t>=e&&t<=r}function h(t,e,r){return t>e&&t<r}function y(t,e,r){return Math.abs(t-e)<=r}function f(t){i(t),t.reverse()}function m(t){var e=s(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function d(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 o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function c(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>o,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 o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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:()=>f,deepCopy:()=>o,direction:()=>h,displaced:()=>c,displacement:()=>u,distance:()=>s,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 o(t){return{x:t.x,y:t.y}}function s(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 s(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var l=r(30);function h(t,e){return(0,l.direction)(u(t,e))}var y=r(986);function f(t){return{x:(0,y.mean)(t.map(function(t){return t.x})),y:(0,y.mean)(t.map(function(t){return t.y}))}}function m(t,e){return f([t,e])}})(),n})()},106(t){var e;e=()=>(()=>{var t={992(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,o,s,a,u,c,l,h,y=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},f=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),o.set(this,void 0),s.set(this,void 0),y(this,n,e,"f"),y(this,i,t=>f(this,r,"m",h).call(this,t),"f"),y(this,o,a,"f")}get owner(){return f(this,s,"f")}set owner(t){var e;null===(e=f(this,s,"f"))||void 0===e||e.removeEventListener("keydown",f(this,i,"f")),null==t||t.addEventListener("keydown",f(this,i,"f"),{passive:!1}),y(this,s,t,"f")}}return n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},l=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},h=function(t){this.owner&&this.owner===document.activeElement&&t.key.toUpperCase()===this.key.toUpperCase()&&t.altKey===f(this,r,"a",a)&&t.ctrlKey===f(this,r,"a",u)&&t.metaKey===f(this,r,"a",c)&&t.shiftKey===f(this,r,"a",l)&&(t.preventDefault(),f(this,n,"f").call(this))},e})(),t.exports=e()},854(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 o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return""===t}function c(t){return a(t)&&!u(t)}function l(t){return!!a(t)&&0==t.trim().length}function h(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function y(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function d(t){return"object"==typeof t&&null!==t}function v(t){return Array.isArray(t)}function g(t){return v(t)&&0==t.length}function N(t){return v(t)&&t.length>0}function O(t){return v(t)&&t.every(r)}function b(t){return O(t)&&t.length>0}function x(t){return v(t)&&t.every(n)}function T(t){return v(t)&&t.every(i)}function E(t){return v(t)&&t.every(a)}function _(t){return E(t)&&t.length>0}function A(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>v,isEmptyArray:()=>g,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>h,isJSONSerializable:()=>y,isNonEmptyArray:()=>N,isNonEmptyNumbersArray:()=>b,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>_,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>d,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>O,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>A,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>f,isWhitespace:()=>l}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function o(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}r.r(n),r.d(n,{DownloadableFile:()=>g,EventfulSet:()=>N,FiniteStack:()=>_,KeyBinding:()=>y.KeyBinding,containsFocus:()=>h,detectMac:()=>m,detectWindows:()=>f,first:()=>t,hasFocus:()=>l,isJSON:()=>s.isJSON,isJSONSerializable:()=>s.isJSONSerializable,isURL:()=>A,last:()=>e,middleFour:()=>o,middleThree:()=>i,removeWhitespace:()=>a,shuffled:()=>c,splitLines:()=>u});var s=r(854);function a(t){return[...t].filter(t=>!(0,s.isWhitespace)(t)).join("")}function u(t){return t.split(/\r\n|\r|\n/)}function c(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function h(t){return!!document.activeElement&&t.contains(document.activeElement)}var y=r(992);function f(){return-1!==navigator.userAgent.indexOf("Windows")}function m(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var p,d=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},v=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,e,r){p.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",d(this,p,null==r?void 0:r.type,"f")}get type(){return null!=v(this,p,"f")?v(this,p,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){d(this,p,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}p=new WeakMap;class N{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 O,b,x,T,E=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){O.add(this),this.maxSize=t,b.set(this,[]),x.set(this,{change:[]})}get size(){return E(this,b,"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,b),E(this,O,"m",T).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,b,"f")[E(this,b,"f").length-1]}push(t){E(this,b,"f").push(t),this.size>this.maxSize&&E(this,b,"f").shift(),E(this,O,"m",T).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,b,"f").pop();return E(this,O,"m",T).call(this,"change"),t}addEventListener(t,e){E(this,x,"f")[t].push(e)}removeEventListener(t,e){E(this,x,"f")[t]=E(this,x,"f")[t].filter(t=>t!==e)}}function A(t){try{return new URL(t),!0}catch(t){return!1}}b=new WeakMap,x=new WeakMap,O=new WeakSet,T=function(t){E(this,x,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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 o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function c(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}function h(t){return l(t)&&0==t.length}function y(t){return l(t)&&t.length>0}function f(t){return l(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return l(t)&&t.every(n)}function d(t){return l(t)&&t.every(i)}function v(t){return l(t)&&t.every(a)}function g(t){return v(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>l,isEmptyArray:()=>h,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>y,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>g,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>d,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>o,isString:()=>a,isStringsArray:()=>v}),e})()},277(t){var e;e=()=>(()=>{var t={854(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 o(t){return n(t)&&t>0}function s(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return""===t}function c(t){return a(t)&&!u(t)}function l(t){return!!a(t)&&0==t.trim().length}function h(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function y(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function d(t){return"object"==typeof t&&null!==t}function v(t){return Array.isArray(t)}function g(t){return v(t)&&0==t.length}function N(t){return v(t)&&t.length>0}function O(t){return v(t)&&t.every(r)}function b(t){return O(t)&&t.length>0}function x(t){return v(t)&&t.every(n)}function T(t){return v(t)&&t.every(i)}function E(t){return v(t)&&t.every(a)}function _(t){return E(t)&&t.length>0}function A(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>v,isEmptyArray:()=>g,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>h,isJSONSerializable:()=>y,isNonEmptyArray:()=>N,isNonEmptyNumbersArray:()=>b,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>_,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>d,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>O,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>A,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>f,isWhitespace:()=>l}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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,{Vector:()=>e,isFiniteVectorLike:()=>o,isVectorLike:()=>i});var t=r(854);class e{static matching(t){let r="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new e(r,n)}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)}isFinite(){return(0,t.isFiniteNumber)(this.x)&&(0,t.isFiniteNumber)(this.y)}}function i(e){return!(!(0,t.isNonNullObject)(e)||!((0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)||(0,t.isNumber)(e.magnitude)&&(0,t.isNumber)(e.direction)))}function o(t){return!!i(t)&&e.matching(t).isFinite()}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],o=e[n++];r.o(t,i)?0===o&&n++:0===o?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:o})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{CurvedBond:()=>F});const t={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let e;const i=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function s(t,r,n){const s=(t=t||{}).random??t.rng?.()??function(){if(!e){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(i)}();if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,r){if((n=n||0)<0||n+16>r.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)r[n+t]=s[t];return r}return function(t,e=0){return(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase()}(s)}const a=" ";function u([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function c(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const l=Math.PI;function h(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:o,y:s}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+o)/2,t.cY=(r+s)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*l,[c,h]=u([(e-o)/2,(r-s)/2],-a),y=Math.pow(c,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(i,2);1<y&&(n*=Math.sqrt(y),i*=Math.sqrt(y)),t.rX=n,t.rY=i;const f=Math.pow(n,2)*Math.pow(h,2)+Math.pow(i,2)*Math.pow(c,2),m=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-f)/f)),p=n*h/i*m,d=-i*c/n*m,v=u([p,d],a);t.cX=v[0]+(e+o)/2,t.cY=v[1]+(r+s)/2,t.phi1=Math.atan2((h-d)/i,(c-p)/n),t.phi2=Math.atan2((-h-d)/i,(-c-p)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*l),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*l),t.phi1*=180/l,t.phi2*=180/l}function y(t,e,r){c(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const f=Math.PI/180;function m(t,e,r){return(1-r)*t+r*e}function p(t,e,r,n){return t+Math.cos(n/180*l)*e+Math.sin(n/180*l)*r}function d(t,e,r,n){const i=1e-6,o=e-t,s=r-e,a=3*o+3*(n-r)-6*s,u=6*(s-o),c=3*o;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function v(t,e,r,n,i){const o=1-i;return t*(o*o*o)+e*(3*o*o*i)+r*(3*o*i*i)+n*(i*i*i)}function g(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],a=n*s-i*o;if(!(Math.abs(a)<1e-10))return!1;const u=n*o+i*s,c=o*o+s*s;return 0<=u&&u<=c&&n*n+i*i<=c}function N(t){const e=t[t.length-1]?.type===C.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:C.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case C.HORIZ_LINE_TO:n.push({type:C.HORIZ_LINE_TO,relative:!1,x:i.x});break;case C.VERT_LINE_TO:n.push({type:C.VERT_LINE_TO,relative:!1,y:i.y});break;case C.LINE_TO:case C.MOVE_TO:n.push({type:C.LINE_TO,relative:!1,x:i.x,y:i.y});break;case C.CURVE_TO:n.push({type:C.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case C.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case C.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case C.ARC:throw new Error("Unsupported command: A (arc)");case C.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:C.CLOSE_PATH}),n}function O(){return T((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function b(){let t=NaN,e=NaN,r=NaN,n=NaN;return T((i,o,s)=>(i.type&C.SMOOTH_CURVE_TO&&(i.type=C.CURVE_TO,t=isNaN(t)?o:t,e=isNaN(e)?s:e,i.x1=i.relative?o-t:2*o-t,i.y1=i.relative?s-e:2*s-e),i.type&C.CURVE_TO?(t=i.relative?o+i.x2:i.x2,e=i.relative?s+i.y2:i.y2):(t=NaN,e=NaN),i.type&C.SMOOTH_QUAD_TO&&(i.type=C.QUAD_TO,r=isNaN(r)?o:r,n=isNaN(n)?s:n,i.x1=i.relative?o-r:2*o-r,i.y1=i.relative?s-n:2*s-n),i.type&C.QUAD_TO?(r=i.relative?o+i.x1:i.x1,n=i.relative?s+i.y1:i.y1):(r=NaN,n=NaN),i))}function x(){let t=NaN,e=NaN;return T((r,n,i)=>{if(r.type&C.SMOOTH_QUAD_TO&&(r.type=C.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&C.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const o=r.x1,s=r.y1;r.type=C.CURVE_TO,r.x1=((r.relative?0:n)+2*o)/3,r.y1=((r.relative?0:i)+2*s)/3,r.x2=(r.x+2*o)/3,r.y2=(r.y+2*s)/3}else t=NaN,e=NaN;return r})}function T(t){let e=0,r=0,n=NaN,i=NaN;return function(o){if(isNaN(n)&&!(o.type&C.MOVE_TO))throw new Error("path must start with moveto");const s=t(o,e,r,n,i);return o.type&C.CLOSE_PATH&&(e=n,r=i),"x"in o&&void 0!==o.x&&(e=o.relative?e+o.x:o.x),"y"in o&&void 0!==o.y&&(r=o.relative?r+o.y:o.y),o.type&C.MOVE_TO&&(n=e,i=r),s}}function E(t,e,r,n,i,o){return c(t,e,r,n,i,o),T((s,a,u,c)=>{const l=s.x1,h=s.x2,y=s.relative&&!isNaN(c),f=void 0!==s.x?s.x:y?0:a,m=void 0!==s.y?s.y:y?0:u;function p(t){return t*t}s.type&C.HORIZ_LINE_TO&&0!==e&&(s.type=C.LINE_TO,s.y=s.relative?0:u),s.type&C.VERT_LINE_TO&&0!==r&&(s.type=C.LINE_TO,s.x=s.relative?0:a),void 0!==s.x&&(s.x=s.x*t+m*r+(y?0:i)),void 0!==s.y&&(s.y=f*e+s.y*n+(y?0:o)),void 0!==s.x1&&(s.x1=s.x1*t+s.y1*r+(y?0:i)),void 0!==s.y1&&(s.y1=l*e+s.y1*n+(y?0:o)),void 0!==s.x2&&(s.x2=s.x2*t+s.y2*r+(y?0:i)),void 0!==s.y2&&(s.y2=h*e+s.y2*n+(y?0:o));const d=t*n-e*r;if(void 0!==s.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===d)delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag,s.type=C.LINE_TO;else{const i=s.xRot*Math.PI/180,o=Math.sin(i),a=Math.cos(i),u=1/p(s.rX),c=1/p(s.rY),l=p(a)*u+p(o)*c,h=2*o*a*(u-c),y=p(o)*u+p(a)*c,f=l*n*n-h*e*n+y*e*e,m=h*(t*n+e*r)-2*(l*r*n+y*t*e),v=l*r*r-h*t*r+y*t*t,g=(Math.atan2(m,f-v)+Math.PI)%Math.PI/2,N=Math.sin(g),O=Math.cos(g);s.rX=Math.abs(d)/Math.sqrt(f*p(O)+m*N*O+v*p(N)),s.rY=Math.abs(d)/Math.sqrt(f*p(N)-m*N*O+v*p(O)),s.xRot=180*g/Math.PI}return void 0!==s.sweepFlag&&0>d&&(s.sweepFlag=+!s.sweepFlag),s})}const _={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return c(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:O,TO_REL:function(){return T((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return T((i,o,s,a,u)=>{if(isNaN(a)&&!(i.type&C.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&C.HORIZ_LINE_TO&&(i.type=C.LINE_TO,i.y=i.relative?0:s),r&&i.type&C.VERT_LINE_TO&&(i.type=C.LINE_TO,i.x=i.relative?0:o),t&&i.type&C.CLOSE_PATH&&(i.type=C.LINE_TO,i.x=i.relative?a-o:a,i.y=i.relative?u-s:u),i.type&C.ARC&&(0===i.rX||0===i.rY)&&(i.type=C.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&C.QUAD_TO&&g([o,s],i.relative?[o+i.x1,s+i.y1]:[i.x1,i.y1],i.relative?[o+i.x,s+i.y]:[i.x,i.y])&&(i.type=C.LINE_TO,delete i.x1,delete i.y1),n&&i.type&C.CURVE_TO){const t=[o,s],e=i.relative?[o+i.x1,s+i.y1]:[i.x1,i.y1],r=i.relative?[o+i.x2,s+i.y2]:[i.x2,i.y2],n=i.relative?[o+i.x,s+i.y]:[i.x,i.y];g(t,e,n)&&g(t,r,n)&&(i.type=C.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:b,QT_TO_C:x,INFO:T,SANITIZE:function(t=0){c(t);let e=NaN,r=NaN,n=NaN,i=NaN;return T((o,s,a,u,c)=>{const l=Math.abs;let h=!1,y=0,f=0;if(o.type&C.SMOOTH_CURVE_TO&&(y=isNaN(e)?0:s-e,f=isNaN(r)?0:a-r),o.type&(C.CURVE_TO|C.SMOOTH_CURVE_TO)?(e=o.relative?s+o.x2:o.x2,r=o.relative?a+o.y2:o.y2):(e=NaN,r=NaN),o.type&C.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,i=isNaN(i)?a:2*a-i):o.type&C.QUAD_TO?(n=o.relative?s+o.x1:o.x1,i=o.relative?a+o.y1:o.y2):(n=NaN,i=NaN),o.type&C.LINE_COMMANDS||o.type&C.ARC&&(0===o.rX||0===o.rY||!o.lArcFlag)||o.type&C.CURVE_TO||o.type&C.SMOOTH_CURVE_TO||o.type&C.QUAD_TO||o.type&C.SMOOTH_QUAD_TO){const e=void 0===o.x?0:o.relative?o.x:o.x-s,r=void 0===o.y?0:o.relative?o.y:o.y-a;y=isNaN(n)?void 0===o.x1?y:o.relative?o.x:o.x1-s:n-s,f=isNaN(i)?void 0===o.y1?f:o.relative?o.y:o.y1-a:i-a;const u=void 0===o.x2?0:o.relative?o.x:o.x2-s,c=void 0===o.y2?0:o.relative?o.y:o.y2-a;l(e)<=t&&l(r)<=t&&l(y)<=t&&l(f)<=t&&l(u)<=t&&l(c)<=t&&(h=!0)}return o.type&C.CLOSE_PATH&&l(s-u)<=t&&l(a-c)<=t&&(h=!0),h?[]:o})},MATRIX:E,ROTATE:function(t,e=0,r=0){c(t,e,r);const n=Math.sin(t),i=Math.cos(t);return E(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return c(t,e),E(1,0,0,1,t,e)},SCALE:function(t,e=t){return c(t,e),E(t,0,0,e,0,0)},SKEW_X:function(t){return c(t),E(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return c(t),E(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return c(t),E(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return c(t),E(1,0,0,-1,0,t)},A_TO_C:function(){return T((t,e,r)=>C.ARC===t.type?function(t,e,r){t.cX||h(t,e,r);const n=t.xRot/180*l;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:C.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),o=Math.max(t.phi1,t.phi2)-i,s=Math.ceil(o/90),a=new Array(s);let c=e,y=r;const p=(e,r)=>{const[i,o]=u([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+o]};for(let e=0;e<s;e++){const r=m(t.phi1,t.phi2,e/s),n=m(t.phi1,t.phi2,(e+1)/s),i=n-r,o=4/3*Math.tan(i*f/4),u=Math.cos(r*f)-o*Math.sin(r*f),l=Math.sin(r*f)+o*Math.cos(r*f),h=Math.cos(n*f),d=Math.sin(n*f),v=h+o*d,g=d-o*h,N=p(u,l),O=p(v,g),b=p(h,d),x={relative:t.relative,type:C.CURVE_TO,x:b[0],y:b[1],x1:N[0],y1:N[1],x2:O[0],y2:O[1]};t.relative&&(x.x1-=c,x.y1-=y,x.x2-=c,x.y2-=y,x.x-=c,x.y-=y),c=b[0],y=b[1],a[e]=x}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return T((t,e,r)=>(t.relative&&(e=0,r=0),C.ARC===t.type&&h(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=O(),e=x(),r=b(),n=T((i,o,s)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&C.DRAWING_COMMANDS&&(u(o),c(s)),a.type&C.HORIZ_LINE_TO&&u(a.x),a.type&C.VERT_LINE_TO&&c(a.y),a.type&C.LINE_TO&&(u(a.x),c(a.y)),a.type&C.CURVE_TO){u(a.x),c(a.y);const t=d(o,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(v(o,a.x1,a.x2,a.x,e));const e=d(s,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(v(s,a.y1,a.y2,a.y,t))}if(a.type&C.ARC){u(a.x),c(a.y),h(a,o,s);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[l,f]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],m=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<l?r+360:r},d=y(n,-e,0).map(m);for(const t of d)t>l&&t<f&&u(p(a.cX,e,n,t));const v=y(i,-r,0).map(m);for(const t of v)t>l&&t<f&&c(p(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=_.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const o of t){const t=r(o);t.type===C.MOVE_TO&&i.length>0&&(e?n.push(...N(i)):n.unshift(...N(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...N(i)):n.unshift(...N(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(_.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const o=t[i],s=t[i+1];if(i<t.length-1&&s&&o.type&C.LINE_COMMANDS&&s.type&C.LINE_COMMANDS){const t=r[i+1];if(g(n,r[i],t)){"relative"in s&&s.relative&&("x"in s&&(s.x=t[0]-n[0]),"y"in s&&(s.y=t[1]-n[1]));continue}}e.push(o),n=r[i]}return e}};class A{round(t){return this.transform(_.ROUND(t))}toAbs(){return this.transform(_.TO_ABS())}toRel(){return this.transform(_.TO_REL())}normalizeHVZ(t,e,r){return this.transform(_.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(_.NORMALIZE_ST())}qtToC(){return this.transform(_.QT_TO_C())}aToC(){return this.transform(_.A_TO_C())}sanitize(t){return this.transform(_.SANITIZE(t))}translate(t,e){return this.transform(_.TRANSLATE(t,e))}scale(t,e){return this.transform(_.SCALE(t,e))}rotate(t,e,r){return this.transform(_.ROTATE(t,e,r))}matrix(t,e,r,n,i,o){return this.transform(_.MATRIX(t,e,r,n,i,o))}skewX(t){return this.transform(_.SKEW_X(t))}skewY(t){return this.transform(_.SKEW_Y(t))}xSymmetry(t){return this.transform(_.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(_.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(_.ANNOTATE_ARCS())}}const w=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,M=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class S extends A{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],o=!(this.curCommandType!==C.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=M(i)&&("0"===this.curNumber&&"0"===i||o);if(!M(i)||s)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||o){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===C.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===R[this.curCommandType]&&(C.HORIZ_LINE_TO===this.curCommandType?r({type:C.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):C.VERT_LINE_TO===this.curCommandType?r({type:C.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===C.MOVE_TO||this.curCommandType===C.LINE_TO||this.curCommandType===C.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),C.MOVE_TO===this.curCommandType&&(this.curCommandType=C.LINE_TO)):this.curCommandType===C.CURVE_TO?r({type:C.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===C.SMOOTH_CURVE_TO?r({type:C.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.QUAD_TO?r({type:C.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.ARC&&r({type:C.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!w(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(s)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=C.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=C.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=C.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=C.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=C.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=C.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=C.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=C.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=C.ARC,this.curCommandRelative="a"===i}else e.push({type:C.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class C extends A{commands;constructor(t){super(),this.commands="string"==typeof t?C.parse(t):t}encode(){return C.encode(this.commands)}getBounds(){const t=_.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=_.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=_.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===C.CLOSE_PATH)e+="z";else if(n.type===C.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===C.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===C.MOVE_TO)e+=(n.relative?"m":"M")+n.x+a+n.y;else if(n.type===C.LINE_TO)e+=(n.relative?"l":"L")+n.x+a+n.y;else if(n.type===C.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+a+n.y1+a+n.x2+a+n.y2+a+n.x+a+n.y;else if(n.type===C.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+a+n.y2+a+n.x+a+n.y;else if(n.type===C.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+a+n.y1+a+n.x+a+n.y;else if(n.type===C.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+a+n.y;else{if(n.type!==C.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+a+n.rY+a+n.xRot+a+ +n.lArcFlag+a+ +n.sweepFlag+a+n.x+a+n.y}}return e}(t)}static parse(t){const e=new S,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=C.LINE_TO|C.HORIZ_LINE_TO|C.VERT_LINE_TO;static DRAWING_COMMANDS=C.HORIZ_LINE_TO|C.VERT_LINE_TO|C.LINE_TO|C.CURVE_TO|C.SMOOTH_CURVE_TO|C.QUAD_TO|C.SMOOTH_QUAD_TO|C.ARC}const R={[C.MOVE_TO]:2,[C.LINE_TO]:2,[C.HORIZ_LINE_TO]:1,[C.VERT_LINE_TO]:1,[C.CLOSE_PATH]:0,[C.QUAD_TO]:4,[C.SMOOTH_QUAD_TO]:2,[C.CURVE_TO]:6,[C.SMOOTH_CURVE_TO]:4,[C.ARC]:7};r(456);var P=r(725);new WeakMap;r(106);var I=r(854);var L=r(277);class U{static from(t){let e,r=new U(0,0);if(!(0,I.isString)(t))return r;try{JSON.parse(t)}catch{return r}return(0,L.isVectorLike)(e)?U.matching(e):r}static matching(t){let e=L.Vector.matching(t);return new U(e.magnitude,e.direction)}constructor(t,e){this.magnitude=t,this.direction=e}toJSON(){return JSON.stringify({magnitude:this.magnitude,direction:this.direction})}}var j;class F{static between(e,r){let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.id="id-"+(!t.randomUUID||o||i?s(i,o,a):t.randomUUID()),n.setAttribute("stroke","black"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-opacity","1"),n.setAttribute("stroke-dasharray",""),n.setAttribute("stroke-linecap",""),n.setAttribute("stroke-linejoin",""),n.setAttribute("fill","none"),new F(n,e,r);var i,o,a}constructor(t,e,r){j.add(this),this.domNode=t,this.base1=e,this.base2=r}}j=new WeakSet})(),n})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnacanvas/draw.bonds.curved",
3
- "version": "1.1.0",
3
+ "version": "2.0.1",
4
4
  "description": "Draw curved bonds",
5
5
  "repository": {
6
6
  "type": "git",