pacem 0.50.1-atlantis → 0.50.1-babylon

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.
Files changed (56) hide show
  1. package/dist/css/pacem-dark-content.min.css +1 -1
  2. package/dist/css/pacem-dark-shell.min.css +1 -1
  3. package/dist/css/pacem-dark.min.css +1 -1
  4. package/dist/css/pacem-light-content.min.css +1 -1
  5. package/dist/css/pacem-light-shell.min.css +1 -1
  6. package/dist/css/pacem-light.min.css +1 -1
  7. package/dist/css/pacem-phousys-content.min.css +1 -1
  8. package/dist/css/pacem-phousys-shell.min.css +1 -1
  9. package/dist/css/pacem-phousys.min.css +1 -1
  10. package/dist/js/azure-maps.d.ts +1 -1
  11. package/dist/js/pacem-2d.d.ts +1 -1
  12. package/dist/js/pacem-2d.js +1 -1
  13. package/dist/js/pacem-2d.min.js +1 -1
  14. package/dist/js/pacem-3d.d.ts +1 -1
  15. package/dist/js/pacem-3d.js +1 -1
  16. package/dist/js/pacem-3d.min.js +1 -1
  17. package/dist/js/pacem-charts.d.ts +1 -1
  18. package/dist/js/pacem-charts.js +1 -1
  19. package/dist/js/pacem-charts.min.js +1 -1
  20. package/dist/js/pacem-cms.d.ts +1 -1
  21. package/dist/js/pacem-cms.js +1 -1
  22. package/dist/js/pacem-cms.min.js +1 -1
  23. package/dist/js/pacem-core.d.ts +1 -1
  24. package/dist/js/pacem-core.js +1 -1
  25. package/dist/js/pacem-core.min.js +1 -1
  26. package/dist/js/pacem-foundation.d.ts +1 -1
  27. package/dist/js/pacem-foundation.js +3 -3
  28. package/dist/js/pacem-foundation.min.js +2 -2
  29. package/dist/js/pacem-fx.d.ts +1 -1
  30. package/dist/js/pacem-fx.js +1 -1
  31. package/dist/js/pacem-fx.min.js +1 -1
  32. package/dist/js/pacem-logging.d.ts +1 -1
  33. package/dist/js/pacem-logging.js +1 -1
  34. package/dist/js/pacem-logging.min.js +1 -1
  35. package/dist/js/pacem-maps.d.ts +1 -1
  36. package/dist/js/pacem-maps.js +1 -1
  37. package/dist/js/pacem-maps.min.js +1 -1
  38. package/dist/js/pacem-media.d.ts +1 -1
  39. package/dist/js/pacem-media.js +1 -1
  40. package/dist/js/pacem-media.min.js +1 -1
  41. package/dist/js/pacem-networking.js +1 -1
  42. package/dist/js/pacem-networking.min.js +1 -1
  43. package/dist/js/pacem-numerical.d.ts +4 -2
  44. package/dist/js/pacem-numerical.js +10 -3
  45. package/dist/js/pacem-numerical.min.js +2 -2
  46. package/dist/js/pacem-plus.d.ts +1 -1
  47. package/dist/js/pacem-plus.js +1 -1
  48. package/dist/js/pacem-plus.min.js +1 -1
  49. package/dist/js/pacem-scaffolding.d.ts +1 -1
  50. package/dist/js/pacem-scaffolding.js +1 -1
  51. package/dist/js/pacem-scaffolding.min.js +1 -1
  52. package/dist/js/pacem-ui.d.ts +1 -1
  53. package/dist/js/pacem-ui.js +1 -1
  54. package/dist/js/pacem-ui.min.js +1 -1
  55. package/dist/js/swagger-types.d.ts +1 -1
  56. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -662,8 +662,8 @@ var Pacem;
662
662
  const invdet = 1 / det;
663
663
  return this.multiply({
664
664
  a: m.d,
665
- b: -m.c,
666
- c: -m.b,
665
+ b: -m.b,
666
+ c: -m.c,
667
667
  d: m.a,
668
668
  e: -m.e * m.d + m.c * m.f,
669
669
  f: m.e * m.b - m.a * m.f
@@ -1,6 +1,6 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
6
- var Pacem,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};!function(e){e.Arrays=class Arrays{static range(e,t,r=2){let n=e;const s=(t-e)/(r-1),a=[];if(s>0)for(;a.length<r;)a.push(n.roundoff()),n+=s;return a}static chunkify(t,r){if(e.NullChecker.isNullOrEmpty(t))return[];if(r<=0||r%1!=0)throw new Error("Provide a positive integer number.");const n=Math.ceil(t.length/r);return Array.from({length:n},((e,n)=>{const s=n*r,a=s+r;return t.slice(s,a)}))}}}(Pacem||(Pacem={})),function(e){const t=/^hsl\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)%\s*\)$/,r=/^hsla\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)\)$/,n=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,s=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\)$/,a=/^#[a-f0-9]{6}$/,i=/^#[a-f0-9]{3}$/;function o(t){return!e.NullChecker.isNullOrEmpty(t)&&"object"==typeof t&&"r"in t&&"g"in t&&"b"in t&&"number"==typeof t.r&&"number"==typeof t.b&&"number"==typeof t.g&&(t.a??=1,t.r>=0&&t.r<=1&&t.g>=0&&t.g<=1&&t.b>=0&&t.b<=1&&t.a>=0&&t.a<=1)}function c(t){return!e.NullChecker.isNullOrEmpty(t)&&"object"==typeof t&&"h"in t&&"s"in t&&"l"in t&&"number"==typeof t.h&&"number"==typeof t.s&&"number"==typeof t.l&&(t.a??=1,t.h>=0&&t.h<=360&&t.s>=0&&t.s<=1&&t.l>=0&&t.l<=1&&t.a>=0&&t.a<=1)}const l={adjustRgbChannel:e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),adjustRgbChannelInv:e=>e<=.00304?12.92*e:1.055*(Math.pow(e,1/2.4)-.055),adjustRgb:e=>({r:l.adjustRgbChannel(e.r),g:l.adjustRgbChannel(e.g),b:l.adjustRgbChannel(e.b),a:e.a}),adjustRgbInv:e=>({r:l.adjustRgbChannelInv(e.r),g:l.adjustRgbChannelInv(e.g),b:l.adjustRgbChannelInv(e.b),a:e.a}),X:e=>.4125*e.r+.3576*e.g+.1804*e.b,Y:e=>.2126*e.r+.7152*e.g+.0722*e.b,Z:e=>.0193*e.r+.1191*e.g+.9503*e.b,relativeLuminance:e=>{const t=l.adjustRgb(e);return l.Y(t)},rgbToCieXYZ:e=>{const t=l.adjustRgb(e);return{x:l.X(t),y:l.Y(t),z:l.Z(t),a:e.a}},cieXYZToRgb:e=>{const t=3.241*e.x-1.5374*e.y-.4986*e.z,r=-.9692*e.x+1.876*e.y+.0416*e.z,n=.0556*e.x-.204*e.y+1.057*e.z;return l.adjustRgbInv({r:t,g:r,b:n,a:e.a})},contrastRatio:(e,t)=>{const r=l.relativeLuminance(e)+.05,n=l.relativeLuminance(t)+.05;return r>n?r/n:n/r}};function u(t){return e.Strings.leftPad(t.toString(16),2,"0")}e.Colors=class Colors{static _clampRGB(e){const t=e=>Math.min(1,Math.max(0,e));return null==e[3]&&(e[3]=1),{r:t(e[0]),g:t(e[1]),b:t(e[2]),a:Math.min(1,Math.max(0,e[3]))}}static _normalize(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}static parse(e){if(e=(e||"").toLowerCase(),n.test(e)){let t=n.exec(e);return this._clampRGB(this._normalize([parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),1]))}if(s.test(e)){let t=s.exec(e);return this._clampRGB(this._normalize([parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]))}if(a.test(e)){let t=a.exec(e)[0];return this._clampRGB(this._normalize([parseInt("0x"+t.substr(1,2)),parseInt("0x"+t.substr(3,2)),parseInt("0x"+t.substr(5,2)),1]))}if(i.test(e)){let t=i.exec(e)[0],r=t.substr(1,1),n=t.substr(2,1),s=t.substr(3,1);return this._clampRGB(this._normalize([parseInt("0x"+r+r),parseInt("0x"+n+n),parseInt("0x"+s+s),1]))}if(t.test(e)){let r=t.exec(e);const n={h:parseFloat(r[1]),s:.01*parseFloat(r[2]),l:.01*parseFloat(r[3])};return this.rgb(n)}if(r.test(e)){let t=r.exec(e);const n={h:parseFloat(t[1]),s:.01*parseFloat(t[2]),l:.01*parseFloat(t[3]),a:parseFloat(t[4])};return this.rgb(n)}}static hsl(e){const t=function(e){const t=e.r,r=e.g,n=e.b;return.5*(Math.max(t,r,n)+Math.min(t,r,n))}(e),r=function(e,t){const r=e.r,n=e.g,s=e.b,a=Math.max(r,n,s),i=Math.min(r,n,s);return 0===t||1===t?0:(a-i)/(1-Math.abs(2*t-1))}(e,t),n=function(e){const t=e.r,r=e.g,n=e.b;return t>=r&&r>n?60*(r-n)/(t-n):r>t&&t>=n?60*(2-(t-n)/(r-n)):r>=n&&n>t?60*(2+(n-t)/(r-t)):n>r&&r>t?60*(4-(r-t)/(n-t)):n>t&&t>=r?60*(4+(t-r)/(n-r)):t>=n&&n>r?60*(6-(n-r)/(t-r)):void 0}(e);return{h:n,s:r,l:t,a:e.a}}static cieXYZ(e){return c(e)&&(e=this.rgb(e)),l.rgbToCieXYZ(e)}static rgb(e){if(!c(e))return l.cieXYZToRgb(e);{const t=e.h,r=e.s,n=e.l,s=t/60,a=(1-Math.abs(2*n-1))*r,i=a*(1-Math.abs(s%2-1)),o=n-a/2,c=(t,r,n)=>this._clampRGB([t+o,r+o,n+o,e.a]);if(s<=1)return c(a,i,0);if(s<=2)return c(i,a,0);if(s<=3)return c(0,a,i);if(s<=4)return c(0,i,a);if(s<=5)return c(i,0,a);if(s<=6)return c(a,0,i)}}static stringify(e,t=1){if(c(e)){t??=1,e.a??=1;const r="number"==typeof t?t:1;return`hsla(${e.h.roundoff(r)},${(100*e.s).roundoff(r)}%,${(100*e.l).roundoff(r)}%,${e.a.roundoff()})`}if(o(e)){t??=!0,e.a??=1;const r="boolean"==typeof t?t:!!t,n=Math.round(255*e.r),s=Math.round(255*e.g),a=Math.round(255*e.b),i=e.a.roundoff();return 1===i?r?("#"+u(n)+u(s)+u(a)).toUpperCase():`rgb(${n},${s},${a})`:`rgba(${n},${s},${a},${i})`}}static contrastRatio(e,t){return c(e)&&(e=this.rgb(e)),c(t)&&(t=this.rgb(t)),l.contrastRatio(e,t)}static lighten(e,t=.1){if(t||=0,c(e)){const r=Math.min(1,Math.max(0,e.l+t));return Object.assign({},e,{l:r})}if(o(e)){const r=this.lighten(this.hsl(e),t);return this.rgb(r)}return e}static darken(e,t=.1){return this.lighten(e,-t)}static saturate(e,t=.1){if(t||=0,c(e)){const r=Math.min(1,Math.max(0,e.s+t));return Object.assign({},e,{s:r})}if(o(e)){const r=this.saturate(this.hsl(e),t);return this.rgb(r)}return e}static desaturate(e,t=.1){return this.saturate(e,-t)}}}(Pacem||(Pacem={})),function(e){const t=/^\/Date\([\d]+\)\/$/i;class Dates{static parse(e){let r;return"string"==typeof e?(r=t.test(e)?parseInt(e.substring(6)):Date.parse(e),new Date(r)):"number"==typeof e?new Date(e):e}static isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}static daysInMonth(e,t){return[31,Dates.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]}static isDate(e){return e instanceof Date&&!isNaN(e.valueOf())}static dateOnly(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}static addMonths(e,t){let r=e.getDate(),n=new Date(e),s=n.getMonth()+t,a=0;for(;s<0;)s+=12,a--;return n.setDate(1),n.setMonth(s%12),n.setFullYear(n.getFullYear()+a+Math.floor(s/12)),n.setDate(Math.min(r,Dates.daysInMonth(n.getFullYear(),n.getMonth()))),n}static addDays(e,t){return new Date(e.valueOf()+864e5*t)}static daysBetween(e,t){return(t.valueOf()-e.valueOf())/864e5}}e.Dates=Dates}(Pacem||(Pacem={})),function(e){const t=/[-+]?[\d]+(\.[\d]+(e-[\d]+)?)?/g;function r(e){const r=[];let n=e.match(t);return n&&n.length>0&&n.forEach((e=>r.push(parseFloat(e)))),r}e.parseAsNumericalArray=r;class Angle{static isAngle(e){return"object"==typeof e&&"vertex"in e&&Point.isPoint(e.vertex)&&"start"in e&&Point.isPoint(e.start)&&"end"in e&&Point.isPoint(e.end)}static value(t){if(e.NullChecker.isNullOrEmpty(t)||!Angle.isAngle(t))return Number.NaN;const{vertex:r,start:n,end:s}=t;return Angle.angleBetween(r,n,s)}static angleBetween(e,t,r){const n=t.x-e.x,s=t.y-e.y,a=r.x-e.x,i=r.y-e.y,o=n*a+s*i,c=n*i-s*a;return-Math.atan2(c,o)}}e.Angle=Angle;class Size{static parse(e){let t=r(e);if(t&&4===t.length)return{width:t[0],height:t[1]};throw new Error(`Cannot parse "${e}" as a valid Size.`)}static isSize(e){return"object"==typeof e&&"width"in e&&"number"==typeof e.width&&"height"in e&&"number"==typeof e.height}}e.Size=Size;class Point{static parse(e){let t=r(e);if(t&&2===t.length)return{x:t[0],y:t[1]};throw new Error(`Cannot parse "${e}" as a valid Point.`)}static isPoint(e){return"object"==typeof e&&"x"in e&&"number"==typeof e.x&&"y"in e&&"number"==typeof e.y}static distance(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static subtract(e,t){return{x:t.x-e.x,y:t.y-e.y}}static add(...e){var t={x:0,y:0};for(var r of e)t.x+=r.x,t.y+=r.y;return t}}e.Point=Point;class Rect{static parse(e){let t=r(e);if(t&&4===t.length)return{x:t[0],y:t[1],width:t[2],height:t[3]};throw new Error(`Cannot parse "${e}" as a valid Rect.`)}static isRect(e){return Point.isPoint(e)&&Size.isSize(e)}static _stretch(e,t){return{a:t.width/e.width,b:0,c:0,d:t.height/e.height,e:t.x-e.x,f:t.y-e.y}}static _contain(t,r,n,s){let a=1;a=t.width/t.height>=r.width/r.height?r.width/t.width:r.height/t.height;const i=t.width*a,o=t.height*a,c=this._align({x:t.x,y:t.y,width:i,height:o},r,n,s);return e.Matrix2D.translate({a:a,b:0,c:0,d:a,e:0,f:0},c)}static _cover(t,r,n,s){let a=1;a=t.width/t.height<r.width/r.height?r.width/t.width:r.height/t.height;const i=t.width*a,o=t.height*a,c=this._align({x:t.x,y:t.y,width:i,height:o},r,n,s);return e.Matrix2D.translate({a:a,b:0,c:0,d:a,e:0,f:0},c)}static _align(e,t,r,n){let s=0,a=0;switch(r){case"left":s=t.x-e.x;break;case"right":s=t.x+t.width-e.width-e.x;break;default:s=t.x+.5*t.width-.5*e.width-e.x}switch(n){case"top":a=t.y-e.y;break;case"bottom":a=t.y+t.height-e.height-e.y;break;default:a=t.y+.5*t.height-.5*e.height-e.y}return{x:s,y:a}}static findTransform(e,t,r="stretch",n="center",s="middle"){switch(r){case"contain":return this._contain(e,t,n,s);case"cover":return this._cover(e,t,n,s);default:return this._stretch(e,t)}}static intersect(...e){const t={x:0,y:0,height:0,width:0},r=Array.from(e||[]);if(r.length<=0)return t;for(var n=r[0],s=1;s<r.length;s++){const e=r[s],a=Math.max(e.x,n.x),i=Math.max(e.y,n.y),o=Math.min(e.x+e.width,n.x+n.width)-a,c=Math.min(e.y+e.height,n.y+n.height)-i;if(o<0||c<=0)return t;n={x:a,y:i,width:o,height:c}}return n}static expand(e,...t){const r=Array.from(t||[]);let n=e.x,s=e.y,a=n,i=s;Rect.isRect(e)&&(a+=e.width,i+=e.height);for(let e of r)n=Math.min(e.x,n),s=Math.min(e.y,s),a=Math.max(e.x,a),i=Math.max(e.y,i);return{x:n,y:s,width:a-n,height:i-s}}}e.Rect=Rect}(Pacem||(Pacem={})),function(e){var t,r,n,s;t=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,e.HistoryService=class HistoryService{constructor(e,a){t.set(this,[]),r.set(this,[]),n.set(this,void 0),s.set(this,void 0),__classPrivateFieldSet(this,s,e,"f"),__classPrivateFieldSet(this,n,a,"f")}get current(){return __classPrivateFieldGet(this,s,"f")}get canUndo(){return __classPrivateFieldGet(this,t,"f").length>0}get canRedo(){return __classPrivateFieldGet(this,r,"f").length>0}set maxlength(e){__classPrivateFieldSet(this,n,e,"f")}undo(){if(this.canUndo){const e=__classPrivateFieldGet(this,t,"f"),n=__classPrivateFieldGet(this,r,"f"),a=__classPrivateFieldGet(this,s,"f");n.unshift(a),__classPrivateFieldSet(this,s,e.pop(),"f")}}redo(){if(this.canRedo){const e=__classPrivateFieldGet(this,t,"f"),n=__classPrivateFieldGet(this,r,"f"),a=__classPrivateFieldGet(this,s,"f");e.push(a),__classPrivateFieldSet(this,s,n.shift(),"f")}}push(e){__classPrivateFieldGet(this,r,"f").splice(0),__classPrivateFieldGet(this,t,"f").push(__classPrivateFieldGet(this,s,"f")),__classPrivateFieldSet(this,s,e,"f");const a=__classPrivateFieldGet(this,n,"f"),i=__classPrivateFieldGet(this,t,"f");a>0&&i.length>a&&i.splice(0,i.length-a)}reset(){__classPrivateFieldGet(this,r,"f").splice(0),__classPrivateFieldGet(this,t,"f").splice(0)}}}(Pacem||(Pacem={})),function(e){class Matrix2D{static isIdentity(e){return 1===e.a&&1===e.d&&0===e.b&&0===e.f&&0===e.c&&0===e.e}static get identity(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static copy(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}}static scale(e,t,r=t){return{a:e.a*t,b:e.b,c:e.c,d:e.d*r,e:e.e,f:e.f}}static translate(e,t){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e+t.x,f:e.f+t.y}}static rotate(e,t){const r=Math.cos(t),n=Math.sin(t);return Matrix2D.multiply(e,{a:r,b:n,c:-n,d:r,e:0,f:0})}static multiply(e,t){return"x"in e&&"y"in e?"number"==typeof t?{x:e.x*t,y:e.y*t}:{x:e.x*t.a+e.y*t.c+t.e,y:e.x*t.b+e.y*t.d+t.f}:"number"==typeof t?{a:e.a*t,b:e.b*t,c:e.c*t,d:e.d*t,e:e.e*t,f:e.f*t}:{a:e.a*t.a+e.b*t.c,b:e.a*t.b+e.b*t.d,c:e.c*t.a+e.d*t.c,d:e.c*t.b+e.d*t.d,e:e.e*t.a+e.f*t.c+t.e,f:e.e*t.b+e.f*t.d+t.f}}static det(e){return e.a*e.d-e.c*e.b}static invert(e){const t=this.det(e);if(0===t)return null;const r=1/t;return this.multiply({a:e.d,b:-e.c,c:-e.b,d:e.a,e:-e.e*e.d+e.c*e.f,f:e.e*e.b-e.a*e.f},r)}}e.Matrix2D=Matrix2D}(Pacem||(Pacem={})),function(e){class NullChecker{static isNull(e){return null==e}static isEmpty(t){try{return Array.isArray(t)&&0===t.length||"string"==typeof t&&""===t||"object"==typeof t&&0===Object.keys(t).length&&!e.Dates.isDate(t)&&!(t instanceof RegExp)}catch(e){return!1}}static isNullOrEmpty(e){return NullChecker.isNull(e)||NullChecker.isEmpty(e)}}e.NullChecker=NullChecker}(Pacem||(Pacem={})),Number.prototype.isCloseTo=function(e,t=14){return this.toFixed(t)===e.toFixed(t)},Number.prototype.roundoff=function(e=14){return parseFloat(this.toFixed(e))},Number.prototype.clamp=function(e,t){let r=this;return null==e||isNaN(e)||(r=Math.max(r,e)),null==t||isNaN(t)||(r=Math.min(r,t)),r},function(e){e.Numbers=class Numbers{static round(e,t=1){return Math.round(e/t)*t}static log(e,t){return Math.log10(e)/Math.log10(t)}static rebase(e,t,r){const n=e.toString(),s=parseInt(n,t);return n.endsWith(s.toString(t))?parseInt(e.toString(),t).toString(r):Number.NaN.toString()}}}(Pacem||(Pacem={})),function(e){e.Strings=class Strings{static leftPad(e,t,r){let n=e.toString();for(;n.length<t;)n=r+n;return n}static format(t,...r){const n=Array.from(r);let s=t;for(let e=0;e<n.length;e++){const t=new RegExp("(^|[^\\{])\\{"+e+"\\}($|[^\\}])","g");s=s.replaceAll(t,((t,...r)=>t.replace("{"+e+"}",n[e])))}const a=/(^|[^\{}])\{(\d+)\}($|[^\}])/.exec(s);if(!e.NullChecker.isNullOrEmpty(a))throw new Error(`Missing argument at index ${a[2]}.`);return s}}}(Pacem||(Pacem={})),function(e){!function(e){class LexerClass{tokenize(e,t){const r=[];for(;e;){const n=e.length;for(let n of t){const t=n.exec(e,this),s=t?.length;if(s>0){Array.prototype.push.apply(r,t);const n=t[s-1];e=e.substr((n.index||0)+n.raw.length);break}}if(e.length>=n)throw new Error(`Cannot parse\n"${e}"\n using the provided grammar.`)}return r}}e.Parser=class Parser{constructor(e=new LexerClass){this._lexer=e}parse(e,t,r){const n=this._lexer.tokenize(e,t);return r.render(n)}}}(e.Compile||(e.Compile={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){function r(e){return(e??"").replace(/</g,"&lt;")}function n(e){return e?.index||void 0}function s(e){return e?.replace(/[^\w]+/g," ").trim().replace(/ +/g,"-").toLowerCase()}function a(e,t,r){const n=t.exec(e);return n&&n.length?r(n):null}const i=/(<!--)([\s\S]*?)(-->|$)/,o=/^ {0,3}(={3,}|_{3,}|-{3,})(\r?\n|$)/,c=/^ {0,3}(#{1,6})\s+([^\n]+)(\r?\n|$)+/,l=/^ {0,3}([^\n]+)(\r?\n=+(\r?\n|$))+/,u=/^ {0,3}([^\n]+)(\r?\n-+(\r?\n|$))+/,h=/^ {4,}.+(\r?\n {4,}.+)*(\r?\n|$)+/,d=/^ {0,3}``` *([^\n]*)\r?\n(([\s\S](?!\r?\n {0,3}```))*.(\r?\n)+) {0,3}```(\r?\n|$)+/,p=/^ {0,3}> *([^\n]+)(\r?\n {0,3}> *([^\n]*))*(\r?\n|$)+/,f=/^( {0,3}([-+]).*\r?\n|$)((?!(?: {0,3}(?:\d+[.\)]|\r?\n\S))).*(\r?\n|$))*/,g=/^( {0,3}(\d+[.\)]).*\r?\n|$)((?!(?: {0,3}(?:[+-]|\r?\n\S))).*(\r?\n|$))*/,m=/^(?:[-+*]|\d+[.\)])/m,y=/^(?! {4,})(.+(\n(?! {0,3}```)(?! {0,3}([-+]|\d+[.\)]))(?! {4,})(?! {0,3}>).+)*)/,x=/^ {0,3}(!?)\[([^\]]+)\]: +(\S+)(?: +['"\(](.+)['"\)])?(\r?\n|$)+/,b=/!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?(\[[^\[\]]*\]|\([^\(\)]*\))?/,k=/(\*\*?|__?)(\[[^\]]*]\([^\)]+\))\1/,w=/(?:(?<!\\)`)(.+?)(?:(?<!\\)`)/,_=/(\*\*?|__?)((?!\1\s?)(?:(?!\1)[\S\s])*[^\s])\1/,P=/(~~?|__?)(?!\1\s?)([^\s][\s\S]*?(?!\1)[^\s])\1/,v=/(:")(?!":\s?)([^\s][\s\S]*?(?!":)[^\s])":/,$=/^\s+/,C=/ {2,}\r?\n/,M=/^[^\r\n]+/;let N,R;function L(t=[]){const L={[R.Comment]:{exec:(e,t)=>a(e,i,(r=>{const s=n(r),a=[{type:N.Html,index:s,raw:r[0],text:r[2]}];if(s>0){const r=e.substr(0,s),n=t.tokenize(r,G);Array.prototype.unshift.apply(a,n)}return a}))},[R.Reference]:{exec:e=>a(e,x,(e=>{const t=n(e),r=e[0],s=r,a="!"===e[1],i=e[2],o=e[3],c=e[4];return[{type:N.Reference,index:t,raw:r,text:s,id:i,image:a,url:o,title:c}]}))}},S=[],z=[],F={};for(let e of t){let t,r="inline";switch("type"in e?(r=e.type,t=e.rule):t=e,r){case"block":S.push(t);break;case"code":if("lang"in e){const r=e.lang.toLowerCase();(F[r]=F[r]||[]).push(t)}break;default:const r={exec:(e,r)=>{const n=t.exec(e,r);return O(e,n,r),n}};z.push(r)}}const I={[R.Text]:{exec:e=>a(e,M,(e=>{const t=e[0],r=t;return[{index:n(e),raw:t,text:r,type:N.Text}]}))},[R.Space]:{exec:e=>a(e,$,(e=>{const t=e[0];return[{type:N.Space,raw:t,text:t}]}))}},E={[R.ImageOrLink]:{exec:(t,r)=>B(t,b,r,(t=>{const a=n(t),i=t[0],o="!"===i.charAt(0),c=t[1],l=function(t){if(!(e.NullChecker.isNullOrEmpty(t)||/^\[/.test(t)&&/\]$/.test(t)))return/^\(/.test(t)&&/\)$/.test(t)&&(t=t.substr(1,t.length-2)),t}(t[2]),u=s(function(t){if(!(e.NullChecker.isNullOrEmpty(t)||/^\(/.test(t)&&/\)$/.test(t)))return/^\[/.test(t)&&/\]$/.test(t)&&(t=t.substr(1,t.length-2)),t}(t[2])??c);return o?[{index:a,type:l?N.Image:N.ImageLike,raw:i,text:c,src:l,ref:u,tokens:r.tokenize(c,H)}]:[{index:a,type:l?N.Link:N.LinkLike,raw:i,text:c,href:l,ref:u,tokens:r.tokenize(c,H)}]}))},[R.Code]:{exec:(e,t)=>B(e,w,t,(e=>{const t=r(e[1]);return[{type:N.Code,raw:e[0],text:t,index:n(e)}]}))},[R.EmphasizedLink]:{exec:(t,r)=>B(t,k,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=t[1].length>1?N.Bold:N.Italic,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.Emphasize]:{exec:(t,r)=>B(t,_,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=t[1].length>1?N.Bold:N.Italic,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.StrikeThrough]:{exec:(t,r)=>B(t,P,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=N.StrikeThrough,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.Quote]:{exec:(t,r)=>B(t,v,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=N.Quote,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.LineBreak]:{exec:(e,t)=>B(e,C,t,(e=>{const t=e[0],r=t;return[{index:n(e),raw:t,text:r,type:N.LineBreak}]}))}},O=(e,t,r)=>{const n=t?.length>0&&t[0].index;if(n>0){const s=e.substr(0,n),a=r.tokenize(s,H)||[];Array.prototype.unshift.apply(t,a)}},B=(e,t,r,n)=>{const s=a(e,t,(r=>{if(t!=w){const t=w.exec(e);if(t&&t.length&&t.index<r.index)return null}return n(r)}));return O(e,s,r),s},H=Object.values(E);Array.prototype.push.apply(H,z),H.push(I[R.Text],I[R.Space]);const j=e=>{const t=[I[R.Text],I[R.Space]],r=e?.toLowerCase()||"";return r&&r in F&&Array.prototype.unshift.apply(t,F[r]),t},D={[R.Paragraph]:{exec:(e,t)=>a(e,y,(e=>{const r=e[0],n=r;return[{type:N.Paragraph,raw:r,text:n,tokens:t.tokenize(n,H)}]}))},[R.Space]:I[R.Space]},T=(e,t)=>{const r=/^ {0,3}(`{3,}|$|>|[+-]\s|\d+[.\)])/m.test(e)?G:H;return t.tokenize(e,r)},A={[R.HorizontalRule]:{exec:(e,t)=>a(e,o,(e=>{const t=e[0],r=t;return[{type:N.HorizontalRule,raw:t,text:r}]}))},[R.Heading]:{exec:(e,t)=>a(e,c,(e=>{const r=e[2];return[{type:N.Heading,raw:e[0],text:r,level:e[1].length,ref:s(r),tokens:t.tokenize(r,H)}]}))},[R.Heading1]:{exec:(e,t)=>a(e,l,(e=>{const r=e[1];return[{type:N.Heading,raw:e[0],text:r,level:1,ref:s(r),tokens:t.tokenize(r,H)}]}))},[R.Heading2]:{exec:(e,t)=>a(e,u,(e=>{const r=e[1];return[{type:N.Heading,raw:e[0],text:r,level:2,ref:s(r),tokens:t.tokenize(r,H)}]}))},[R.CodeBlock]:{exec:(e,t)=>a(e,h,(e=>{const n=e[0],s=r(n);return[{type:N.CodeBlock,raw:n,text:s,tokens:t.tokenize(s,[])}]}))},[R.Fences]:{exec:(e,t)=>a(e,d,(e=>{const n=r(e[2]),s=e[1]?.toLowerCase();return[{type:N.CodeBlock,raw:e[0],text:n,lang:s,tokens:t.tokenize(n,j(s))}]}))},[R.BlockQuote]:{exec:(e,t)=>a(e,p,(e=>{const r=e[0],n=r.replace(/^ {0,3}> */gm,"");return[{type:N.BlockQuote,raw:r,text:n,tokens:t.tokenize(n,[D[R.Paragraph],D[R.Space]])}]}))},[R.OrderedList]:{exec:(t,r)=>a(t,g,(t=>{const n=t[0],s=n.replace(/^ {0,3}/gm,"").split(m).filter((t=>!e.NullChecker.isNullOrEmpty(t))).map((e=>e.trim()));return[{type:N.OrderedList,start:parseInt(/\d/.exec(t[0])[0]),raw:n,text:n,tokens:s.map((e=>({type:N.ListItem,raw:e,text:e,tokens:T(e,r)})))}]}))},[R.UnorderedList]:{exec:(t,r)=>a(t,f,(t=>{const n=t[0],s=n.replace(/^ {0,3}/gm,"").split(m).filter((t=>!e.NullChecker.isNullOrEmpty(t))).map((e=>e.trim()));return[{type:N.UnorderedList,raw:n,text:n,tokens:s.map((e=>({type:N.ListItem,raw:e,text:e,tokens:T(e,r)})))}]}))}},G=Object.values(A);return Array.prototype.push.apply(G,S),G.push(D[R.Paragraph],D[R.Space]),[L[R.Comment],L[R.Reference]].concat(G)}!function(e){e.Html="html",e.Text="text",e.Paragraph="paragraph",e.BlockQuote="blockquote",e.Space="space",e.Heading="heading",e.Bold="bold",e.Italic="italic",e.CodeBlock="codeblock",e.Code="code",e.Image="img",e.ImageLike="imglike",e.Link="link",e.LinkLike="linklike",e.LineBreak="br",e.StrikeThrough="strike",e.Quote="quote",e.HorizontalRule="hr",e.OrderedList="ol",e.UnorderedList="ul",e.ListItem="listitem",e.Reference="ref"}(N||(N={})),function(e){e[e.Comment=0]="Comment",e[e.Reference=1]="Reference",e[e.HorizontalRule=2]="HorizontalRule",e[e.Heading=3]="Heading",e[e.Heading1=4]="Heading1",e[e.Heading2=5]="Heading2",e[e.CodeBlock=6]="CodeBlock",e[e.Fences=7]="Fences",e[e.BlockQuote=8]="BlockQuote",e[e.OrderedList=9]="OrderedList",e[e.UnorderedList=10]="UnorderedList",e[e.Paragraph=11]="Paragraph",e[e.EmphasizedLink=12]="EmphasizedLink",e[e.ImageOrLink=13]="ImageOrLink",e[e.Emphasize=14]="Emphasize",e[e.StrikeThrough=15]="StrikeThrough",e[e.Quote=16]="Quote",e[e.Code=17]="Code",e[e.LineBreak=18]="LineBreak",e[e.Text=254]="Text",e[e.Space=255]="Space"}(R||(R={}));const S=/[ \r\n]*\0+[ \r\n]*/g;class HtmlRenderer{constructor(t=((e,t)=>e?.text||"")){this._extraItemRender=t,this._renderContent=t=>{const r=t.tokens;return e.NullChecker.isNullOrEmpty(r)?t.text:this._render(r)}}_rendeItem(e,t){const r=this._renderContent,n="\0";switch(e?.type){case N.Reference:return"";case N.Html:return e.raw;case N.BlockQuote:return`<blockquote>\n${r(e)}</blockquote>${n}`;case N.Bold:return`<b>${r(e)}</b>`;case N.CodeBlock:const s=e.lang;return`<pre>${n}<code${s?' class="'+s+'"':""}>${r(e)}</code>${n}</pre>${n}`;case N.Code:return`<code>${r(e)}</code>`;case N.HorizontalRule:return`<hr />${n}`;case N.Heading:const a=e.level;return`<h${a} id="${e.ref}">${r(e)}</h${a}>${n}`;case N.Image:case N.ImageLike:const i=e;let o=i.src,c="";const l=i.text,u=i.ref;if(!o&&u){const e=t.find((e=>e.type===N.Reference&&!0===e.image&&e.id?.toLowerCase()===u.toLowerCase()));e&&(o=e.url,c=e.title??"")}return o?`<img src="${o}" alt="${l}"${c?' title="'+c+'"':""} />`:`![${r(e)}]`;case N.Italic:return`<i>${r(e)}</i>`;case N.StrikeThrough:return`<s>${r(e)}</s>`;case N.Quote:return`<q>${r(e)}</q>`;case N.LineBreak:return"<br />\0";case N.OrderedList:return`<ol start="${e.start}">\n${r(e)}</ol>${n}`;case N.UnorderedList:return`<ul>\n${r(e)}</ul>${n}`;case N.ListItem:return`\t<li>${r(e)}</li>${n}`;case N.Link:case N.LinkLike:const h=e;let d=h.href,p="";const f=h.ref;if(!d&&f){const e=t.find((e=>e.type===N.Reference&&!0!==e.image&&e.id?.toLowerCase()===f.toLowerCase()));e&&(d=e.url,p=e.title??"")}return d?`<a href="${d}"${p?' title="'+p+'"':""}>${r(e)}</a>`:`[${r(e)}]`;case N.Paragraph:return`<p>${r(e)}</p>${n}`;case N.Text:case N.Space:return e.text}return this._extraItemRender(e,t)}_render(e){let t="";for(let r of e||[])t+=this._rendeItem(r,e);return t}render(e){return t=this._render(e),t?.replace(S,"\n").trim();var t}}class TokenRenderer{_render(t){return e.NullChecker.isNullOrEmpty(t)?"":JSON.stringify(t)}render(t){return"["+t.filter((t=>!e.NullChecker.isNullOrEmpty(t))).map(this._render).join(",")+"]"}}class Parser extends e.Compile.Parser{toHtml(t,r,n){const s=new HtmlRenderer(n);return e.NullChecker.isNullOrEmpty(r)?this.parse(t,s):this.parse(t,L(r),s)}tokenize(e,t){const r=this.parse(e,L(t),new TokenRenderer);return JSON.parse(r)}parse(e,t=L(),r=new HtmlRenderer){return(n=t)&&"object"==typeof n&&"function"==typeof n.render?super.parse(e,L(),t):super.parse(e,t,r);var n}}t.Parser=Parser}(t.Markdown||(t.Markdown={}))}(e.Compile||(e.Compile={}))}(Pacem||(Pacem={}));
6
+ var Pacem,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};!function(e){e.Arrays=class Arrays{static range(e,t,r=2){let n=e;const s=(t-e)/(r-1),a=[];if(s>0)for(;a.length<r;)a.push(n.roundoff()),n+=s;return a}static chunkify(t,r){if(e.NullChecker.isNullOrEmpty(t))return[];if(r<=0||r%1!=0)throw new Error("Provide a positive integer number.");const n=Math.ceil(t.length/r);return Array.from({length:n},((e,n)=>{const s=n*r,a=s+r;return t.slice(s,a)}))}}}(Pacem||(Pacem={})),function(e){const t=/^hsl\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)%\s*\)$/,r=/^hsla\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)\)$/,n=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,s=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\)$/,a=/^#[a-f0-9]{6}$/,i=/^#[a-f0-9]{3}$/;function o(t){return!e.NullChecker.isNullOrEmpty(t)&&"object"==typeof t&&"r"in t&&"g"in t&&"b"in t&&"number"==typeof t.r&&"number"==typeof t.b&&"number"==typeof t.g&&(t.a??=1,t.r>=0&&t.r<=1&&t.g>=0&&t.g<=1&&t.b>=0&&t.b<=1&&t.a>=0&&t.a<=1)}function c(t){return!e.NullChecker.isNullOrEmpty(t)&&"object"==typeof t&&"h"in t&&"s"in t&&"l"in t&&"number"==typeof t.h&&"number"==typeof t.s&&"number"==typeof t.l&&(t.a??=1,t.h>=0&&t.h<=360&&t.s>=0&&t.s<=1&&t.l>=0&&t.l<=1&&t.a>=0&&t.a<=1)}const l={adjustRgbChannel:e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),adjustRgbChannelInv:e=>e<=.00304?12.92*e:1.055*(Math.pow(e,1/2.4)-.055),adjustRgb:e=>({r:l.adjustRgbChannel(e.r),g:l.adjustRgbChannel(e.g),b:l.adjustRgbChannel(e.b),a:e.a}),adjustRgbInv:e=>({r:l.adjustRgbChannelInv(e.r),g:l.adjustRgbChannelInv(e.g),b:l.adjustRgbChannelInv(e.b),a:e.a}),X:e=>.4125*e.r+.3576*e.g+.1804*e.b,Y:e=>.2126*e.r+.7152*e.g+.0722*e.b,Z:e=>.0193*e.r+.1191*e.g+.9503*e.b,relativeLuminance:e=>{const t=l.adjustRgb(e);return l.Y(t)},rgbToCieXYZ:e=>{const t=l.adjustRgb(e);return{x:l.X(t),y:l.Y(t),z:l.Z(t),a:e.a}},cieXYZToRgb:e=>{const t=3.241*e.x-1.5374*e.y-.4986*e.z,r=-.9692*e.x+1.876*e.y+.0416*e.z,n=.0556*e.x-.204*e.y+1.057*e.z;return l.adjustRgbInv({r:t,g:r,b:n,a:e.a})},contrastRatio:(e,t)=>{const r=l.relativeLuminance(e)+.05,n=l.relativeLuminance(t)+.05;return r>n?r/n:n/r}};function u(t){return e.Strings.leftPad(t.toString(16),2,"0")}e.Colors=class Colors{static _clampRGB(e){const t=e=>Math.min(1,Math.max(0,e));return null==e[3]&&(e[3]=1),{r:t(e[0]),g:t(e[1]),b:t(e[2]),a:Math.min(1,Math.max(0,e[3]))}}static _normalize(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}static parse(e){if(e=(e||"").toLowerCase(),n.test(e)){let t=n.exec(e);return this._clampRGB(this._normalize([parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),1]))}if(s.test(e)){let t=s.exec(e);return this._clampRGB(this._normalize([parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]))}if(a.test(e)){let t=a.exec(e)[0];return this._clampRGB(this._normalize([parseInt("0x"+t.substr(1,2)),parseInt("0x"+t.substr(3,2)),parseInt("0x"+t.substr(5,2)),1]))}if(i.test(e)){let t=i.exec(e)[0],r=t.substr(1,1),n=t.substr(2,1),s=t.substr(3,1);return this._clampRGB(this._normalize([parseInt("0x"+r+r),parseInt("0x"+n+n),parseInt("0x"+s+s),1]))}if(t.test(e)){let r=t.exec(e);const n={h:parseFloat(r[1]),s:.01*parseFloat(r[2]),l:.01*parseFloat(r[3])};return this.rgb(n)}if(r.test(e)){let t=r.exec(e);const n={h:parseFloat(t[1]),s:.01*parseFloat(t[2]),l:.01*parseFloat(t[3]),a:parseFloat(t[4])};return this.rgb(n)}}static hsl(e){const t=function(e){const t=e.r,r=e.g,n=e.b;return.5*(Math.max(t,r,n)+Math.min(t,r,n))}(e),r=function(e,t){const r=e.r,n=e.g,s=e.b,a=Math.max(r,n,s),i=Math.min(r,n,s);return 0===t||1===t?0:(a-i)/(1-Math.abs(2*t-1))}(e,t),n=function(e){const t=e.r,r=e.g,n=e.b;return t>=r&&r>n?60*(r-n)/(t-n):r>t&&t>=n?60*(2-(t-n)/(r-n)):r>=n&&n>t?60*(2+(n-t)/(r-t)):n>r&&r>t?60*(4-(r-t)/(n-t)):n>t&&t>=r?60*(4+(t-r)/(n-r)):t>=n&&n>r?60*(6-(n-r)/(t-r)):void 0}(e);return{h:n,s:r,l:t,a:e.a}}static cieXYZ(e){return c(e)&&(e=this.rgb(e)),l.rgbToCieXYZ(e)}static rgb(e){if(!c(e))return l.cieXYZToRgb(e);{const t=e.h,r=e.s,n=e.l,s=t/60,a=(1-Math.abs(2*n-1))*r,i=a*(1-Math.abs(s%2-1)),o=n-a/2,c=(t,r,n)=>this._clampRGB([t+o,r+o,n+o,e.a]);if(s<=1)return c(a,i,0);if(s<=2)return c(i,a,0);if(s<=3)return c(0,a,i);if(s<=4)return c(0,i,a);if(s<=5)return c(i,0,a);if(s<=6)return c(a,0,i)}}static stringify(e,t=1){if(c(e)){t??=1,e.a??=1;const r="number"==typeof t?t:1;return`hsla(${e.h.roundoff(r)},${(100*e.s).roundoff(r)}%,${(100*e.l).roundoff(r)}%,${e.a.roundoff()})`}if(o(e)){t??=!0,e.a??=1;const r="boolean"==typeof t?t:!!t,n=Math.round(255*e.r),s=Math.round(255*e.g),a=Math.round(255*e.b),i=e.a.roundoff();return 1===i?r?("#"+u(n)+u(s)+u(a)).toUpperCase():`rgb(${n},${s},${a})`:`rgba(${n},${s},${a},${i})`}}static contrastRatio(e,t){return c(e)&&(e=this.rgb(e)),c(t)&&(t=this.rgb(t)),l.contrastRatio(e,t)}static lighten(e,t=.1){if(t||=0,c(e)){const r=Math.min(1,Math.max(0,e.l+t));return Object.assign({},e,{l:r})}if(o(e)){const r=this.lighten(this.hsl(e),t);return this.rgb(r)}return e}static darken(e,t=.1){return this.lighten(e,-t)}static saturate(e,t=.1){if(t||=0,c(e)){const r=Math.min(1,Math.max(0,e.s+t));return Object.assign({},e,{s:r})}if(o(e)){const r=this.saturate(this.hsl(e),t);return this.rgb(r)}return e}static desaturate(e,t=.1){return this.saturate(e,-t)}}}(Pacem||(Pacem={})),function(e){const t=/^\/Date\([\d]+\)\/$/i;class Dates{static parse(e){let r;return"string"==typeof e?(r=t.test(e)?parseInt(e.substring(6)):Date.parse(e),new Date(r)):"number"==typeof e?new Date(e):e}static isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}static daysInMonth(e,t){return[31,Dates.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]}static isDate(e){return e instanceof Date&&!isNaN(e.valueOf())}static dateOnly(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}static addMonths(e,t){let r=e.getDate(),n=new Date(e),s=n.getMonth()+t,a=0;for(;s<0;)s+=12,a--;return n.setDate(1),n.setMonth(s%12),n.setFullYear(n.getFullYear()+a+Math.floor(s/12)),n.setDate(Math.min(r,Dates.daysInMonth(n.getFullYear(),n.getMonth()))),n}static addDays(e,t){return new Date(e.valueOf()+864e5*t)}static daysBetween(e,t){return(t.valueOf()-e.valueOf())/864e5}}e.Dates=Dates}(Pacem||(Pacem={})),function(e){const t=/[-+]?[\d]+(\.[\d]+(e-[\d]+)?)?/g;function r(e){const r=[];let n=e.match(t);return n&&n.length>0&&n.forEach((e=>r.push(parseFloat(e)))),r}e.parseAsNumericalArray=r;class Angle{static isAngle(e){return"object"==typeof e&&"vertex"in e&&Point.isPoint(e.vertex)&&"start"in e&&Point.isPoint(e.start)&&"end"in e&&Point.isPoint(e.end)}static value(t){if(e.NullChecker.isNullOrEmpty(t)||!Angle.isAngle(t))return Number.NaN;const{vertex:r,start:n,end:s}=t;return Angle.angleBetween(r,n,s)}static angleBetween(e,t,r){const n=t.x-e.x,s=t.y-e.y,a=r.x-e.x,i=r.y-e.y,o=n*a+s*i,c=n*i-s*a;return-Math.atan2(c,o)}}e.Angle=Angle;class Size{static parse(e){let t=r(e);if(t&&4===t.length)return{width:t[0],height:t[1]};throw new Error(`Cannot parse "${e}" as a valid Size.`)}static isSize(e){return"object"==typeof e&&"width"in e&&"number"==typeof e.width&&"height"in e&&"number"==typeof e.height}}e.Size=Size;class Point{static parse(e){let t=r(e);if(t&&2===t.length)return{x:t[0],y:t[1]};throw new Error(`Cannot parse "${e}" as a valid Point.`)}static isPoint(e){return"object"==typeof e&&"x"in e&&"number"==typeof e.x&&"y"in e&&"number"==typeof e.y}static distance(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static subtract(e,t){return{x:t.x-e.x,y:t.y-e.y}}static add(...e){var t={x:0,y:0};for(var r of e)t.x+=r.x,t.y+=r.y;return t}}e.Point=Point;class Rect{static parse(e){let t=r(e);if(t&&4===t.length)return{x:t[0],y:t[1],width:t[2],height:t[3]};throw new Error(`Cannot parse "${e}" as a valid Rect.`)}static isRect(e){return Point.isPoint(e)&&Size.isSize(e)}static _stretch(e,t){return{a:t.width/e.width,b:0,c:0,d:t.height/e.height,e:t.x-e.x,f:t.y-e.y}}static _contain(t,r,n,s){let a=1;a=t.width/t.height>=r.width/r.height?r.width/t.width:r.height/t.height;const i=t.width*a,o=t.height*a,c=this._align({x:t.x,y:t.y,width:i,height:o},r,n,s);return e.Matrix2D.translate({a:a,b:0,c:0,d:a,e:0,f:0},c)}static _cover(t,r,n,s){let a=1;a=t.width/t.height<r.width/r.height?r.width/t.width:r.height/t.height;const i=t.width*a,o=t.height*a,c=this._align({x:t.x,y:t.y,width:i,height:o},r,n,s);return e.Matrix2D.translate({a:a,b:0,c:0,d:a,e:0,f:0},c)}static _align(e,t,r,n){let s=0,a=0;switch(r){case"left":s=t.x-e.x;break;case"right":s=t.x+t.width-e.width-e.x;break;default:s=t.x+.5*t.width-.5*e.width-e.x}switch(n){case"top":a=t.y-e.y;break;case"bottom":a=t.y+t.height-e.height-e.y;break;default:a=t.y+.5*t.height-.5*e.height-e.y}return{x:s,y:a}}static findTransform(e,t,r="stretch",n="center",s="middle"){switch(r){case"contain":return this._contain(e,t,n,s);case"cover":return this._cover(e,t,n,s);default:return this._stretch(e,t)}}static intersect(...e){const t={x:0,y:0,height:0,width:0},r=Array.from(e||[]);if(r.length<=0)return t;for(var n=r[0],s=1;s<r.length;s++){const e=r[s],a=Math.max(e.x,n.x),i=Math.max(e.y,n.y),o=Math.min(e.x+e.width,n.x+n.width)-a,c=Math.min(e.y+e.height,n.y+n.height)-i;if(o<0||c<=0)return t;n={x:a,y:i,width:o,height:c}}return n}static expand(e,...t){const r=Array.from(t||[]);let n=e.x,s=e.y,a=n,i=s;Rect.isRect(e)&&(a+=e.width,i+=e.height);for(let e of r)n=Math.min(e.x,n),s=Math.min(e.y,s),a=Math.max(e.x,a),i=Math.max(e.y,i);return{x:n,y:s,width:a-n,height:i-s}}}e.Rect=Rect}(Pacem||(Pacem={})),function(e){var t,r,n,s;t=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,e.HistoryService=class HistoryService{constructor(e,a){t.set(this,[]),r.set(this,[]),n.set(this,void 0),s.set(this,void 0),__classPrivateFieldSet(this,s,e,"f"),__classPrivateFieldSet(this,n,a,"f")}get current(){return __classPrivateFieldGet(this,s,"f")}get canUndo(){return __classPrivateFieldGet(this,t,"f").length>0}get canRedo(){return __classPrivateFieldGet(this,r,"f").length>0}set maxlength(e){__classPrivateFieldSet(this,n,e,"f")}undo(){if(this.canUndo){const e=__classPrivateFieldGet(this,t,"f"),n=__classPrivateFieldGet(this,r,"f"),a=__classPrivateFieldGet(this,s,"f");n.unshift(a),__classPrivateFieldSet(this,s,e.pop(),"f")}}redo(){if(this.canRedo){const e=__classPrivateFieldGet(this,t,"f"),n=__classPrivateFieldGet(this,r,"f"),a=__classPrivateFieldGet(this,s,"f");e.push(a),__classPrivateFieldSet(this,s,n.shift(),"f")}}push(e){__classPrivateFieldGet(this,r,"f").splice(0),__classPrivateFieldGet(this,t,"f").push(__classPrivateFieldGet(this,s,"f")),__classPrivateFieldSet(this,s,e,"f");const a=__classPrivateFieldGet(this,n,"f"),i=__classPrivateFieldGet(this,t,"f");a>0&&i.length>a&&i.splice(0,i.length-a)}reset(){__classPrivateFieldGet(this,r,"f").splice(0),__classPrivateFieldGet(this,t,"f").splice(0)}}}(Pacem||(Pacem={})),function(e){class Matrix2D{static isIdentity(e){return 1===e.a&&1===e.d&&0===e.b&&0===e.f&&0===e.c&&0===e.e}static get identity(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static copy(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}}static scale(e,t,r=t){return{a:e.a*t,b:e.b,c:e.c,d:e.d*r,e:e.e,f:e.f}}static translate(e,t){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e+t.x,f:e.f+t.y}}static rotate(e,t){const r=Math.cos(t),n=Math.sin(t);return Matrix2D.multiply(e,{a:r,b:n,c:-n,d:r,e:0,f:0})}static multiply(e,t){return"x"in e&&"y"in e?"number"==typeof t?{x:e.x*t,y:e.y*t}:{x:e.x*t.a+e.y*t.c+t.e,y:e.x*t.b+e.y*t.d+t.f}:"number"==typeof t?{a:e.a*t,b:e.b*t,c:e.c*t,d:e.d*t,e:e.e*t,f:e.f*t}:{a:e.a*t.a+e.b*t.c,b:e.a*t.b+e.b*t.d,c:e.c*t.a+e.d*t.c,d:e.c*t.b+e.d*t.d,e:e.e*t.a+e.f*t.c+t.e,f:e.e*t.b+e.f*t.d+t.f}}static det(e){return e.a*e.d-e.c*e.b}static invert(e){const t=this.det(e);if(0===t)return null;const r=1/t;return this.multiply({a:e.d,b:-e.b,c:-e.c,d:e.a,e:-e.e*e.d+e.c*e.f,f:e.e*e.b-e.a*e.f},r)}}e.Matrix2D=Matrix2D}(Pacem||(Pacem={})),function(e){class NullChecker{static isNull(e){return null==e}static isEmpty(t){try{return Array.isArray(t)&&0===t.length||"string"==typeof t&&""===t||"object"==typeof t&&0===Object.keys(t).length&&!e.Dates.isDate(t)&&!(t instanceof RegExp)}catch(e){return!1}}static isNullOrEmpty(e){return NullChecker.isNull(e)||NullChecker.isEmpty(e)}}e.NullChecker=NullChecker}(Pacem||(Pacem={})),Number.prototype.isCloseTo=function(e,t=14){return this.toFixed(t)===e.toFixed(t)},Number.prototype.roundoff=function(e=14){return parseFloat(this.toFixed(e))},Number.prototype.clamp=function(e,t){let r=this;return null==e||isNaN(e)||(r=Math.max(r,e)),null==t||isNaN(t)||(r=Math.min(r,t)),r},function(e){e.Numbers=class Numbers{static round(e,t=1){return Math.round(e/t)*t}static log(e,t){return Math.log10(e)/Math.log10(t)}static rebase(e,t,r){const n=e.toString(),s=parseInt(n,t);return n.endsWith(s.toString(t))?parseInt(e.toString(),t).toString(r):Number.NaN.toString()}}}(Pacem||(Pacem={})),function(e){e.Strings=class Strings{static leftPad(e,t,r){let n=e.toString();for(;n.length<t;)n=r+n;return n}static format(t,...r){const n=Array.from(r);let s=t;for(let e=0;e<n.length;e++){const t=new RegExp("(^|[^\\{])\\{"+e+"\\}($|[^\\}])","g");s=s.replaceAll(t,((t,...r)=>t.replace("{"+e+"}",n[e])))}const a=/(^|[^\{}])\{(\d+)\}($|[^\}])/.exec(s);if(!e.NullChecker.isNullOrEmpty(a))throw new Error(`Missing argument at index ${a[2]}.`);return s}}}(Pacem||(Pacem={})),function(e){!function(e){class LexerClass{tokenize(e,t){const r=[];for(;e;){const n=e.length;for(let n of t){const t=n.exec(e,this),s=t?.length;if(s>0){Array.prototype.push.apply(r,t);const n=t[s-1];e=e.substr((n.index||0)+n.raw.length);break}}if(e.length>=n)throw new Error(`Cannot parse\n"${e}"\n using the provided grammar.`)}return r}}e.Parser=class Parser{constructor(e=new LexerClass){this._lexer=e}parse(e,t,r){const n=this._lexer.tokenize(e,t);return r.render(n)}}}(e.Compile||(e.Compile={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){function r(e){return(e??"").replace(/</g,"&lt;")}function n(e){return e?.index||void 0}function s(e){return e?.replace(/[^\w]+/g," ").trim().replace(/ +/g,"-").toLowerCase()}function a(e,t,r){const n=t.exec(e);return n&&n.length?r(n):null}const i=/(<!--)([\s\S]*?)(-->|$)/,o=/^ {0,3}(={3,}|_{3,}|-{3,})(\r?\n|$)/,c=/^ {0,3}(#{1,6})\s+([^\n]+)(\r?\n|$)+/,l=/^ {0,3}([^\n]+)(\r?\n=+(\r?\n|$))+/,u=/^ {0,3}([^\n]+)(\r?\n-+(\r?\n|$))+/,h=/^ {4,}.+(\r?\n {4,}.+)*(\r?\n|$)+/,d=/^ {0,3}``` *([^\n]*)\r?\n(([\s\S](?!\r?\n {0,3}```))*.(\r?\n)+) {0,3}```(\r?\n|$)+/,p=/^ {0,3}> *([^\n]+)(\r?\n {0,3}> *([^\n]*))*(\r?\n|$)+/,f=/^( {0,3}([-+]).*\r?\n|$)((?!(?: {0,3}(?:\d+[.\)]|\r?\n\S))).*(\r?\n|$))*/,g=/^( {0,3}(\d+[.\)]).*\r?\n|$)((?!(?: {0,3}(?:[+-]|\r?\n\S))).*(\r?\n|$))*/,m=/^(?:[-+*]|\d+[.\)])/m,y=/^(?! {4,})(.+(\n(?! {0,3}```)(?! {0,3}([-+]|\d+[.\)]))(?! {4,})(?! {0,3}>).+)*)/,x=/^ {0,3}(!?)\[([^\]]+)\]: +(\S+)(?: +['"\(](.+)['"\)])?(\r?\n|$)+/,b=/!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?(\[[^\[\]]*\]|\([^\(\)]*\))?/,k=/(\*\*?|__?)(\[[^\]]*]\([^\)]+\))\1/,w=/(?:(?<!\\)`)(.+?)(?:(?<!\\)`)/,_=/(\*\*?|__?)((?!\1\s?)(?:(?!\1)[\S\s])*[^\s])\1/,P=/(~~?|__?)(?!\1\s?)([^\s][\s\S]*?(?!\1)[^\s])\1/,v=/(:")(?!":\s?)([^\s][\s\S]*?(?!":)[^\s])":/,$=/^\s+/,C=/ {2,}\r?\n/,M=/^[^\r\n]+/;let N,R;function L(t=[]){const L={[R.Comment]:{exec:(e,t)=>a(e,i,(r=>{const s=n(r),a=[{type:N.Html,index:s,raw:r[0],text:r[2]}];if(s>0){const r=e.substr(0,s),n=t.tokenize(r,G);Array.prototype.unshift.apply(a,n)}return a}))},[R.Reference]:{exec:e=>a(e,x,(e=>{const t=n(e),r=e[0],s=r,a="!"===e[1],i=e[2],o=e[3],c=e[4];return[{type:N.Reference,index:t,raw:r,text:s,id:i,image:a,url:o,title:c}]}))}},S=[],z=[],F={};for(let e of t){let t,r="inline";switch("type"in e?(r=e.type,t=e.rule):t=e,r){case"block":S.push(t);break;case"code":if("lang"in e){const r=e.lang.toLowerCase();(F[r]=F[r]||[]).push(t)}break;default:const r={exec:(e,r)=>{const n=t.exec(e,r);return O(e,n,r),n}};z.push(r)}}const I={[R.Text]:{exec:e=>a(e,M,(e=>{const t=e[0],r=t;return[{index:n(e),raw:t,text:r,type:N.Text}]}))},[R.Space]:{exec:e=>a(e,$,(e=>{const t=e[0];return[{type:N.Space,raw:t,text:t}]}))}},E={[R.ImageOrLink]:{exec:(t,r)=>B(t,b,r,(t=>{const a=n(t),i=t[0],o="!"===i.charAt(0),c=t[1],l=function(t){if(!(e.NullChecker.isNullOrEmpty(t)||/^\[/.test(t)&&/\]$/.test(t)))return/^\(/.test(t)&&/\)$/.test(t)&&(t=t.substr(1,t.length-2)),t}(t[2]),u=s(function(t){if(!(e.NullChecker.isNullOrEmpty(t)||/^\(/.test(t)&&/\)$/.test(t)))return/^\[/.test(t)&&/\]$/.test(t)&&(t=t.substr(1,t.length-2)),t}(t[2])??c);return o?[{index:a,type:l?N.Image:N.ImageLike,raw:i,text:c,src:l,ref:u,tokens:r.tokenize(c,H)}]:[{index:a,type:l?N.Link:N.LinkLike,raw:i,text:c,href:l,ref:u,tokens:r.tokenize(c,H)}]}))},[R.Code]:{exec:(e,t)=>B(e,w,t,(e=>{const t=r(e[1]);return[{type:N.Code,raw:e[0],text:t,index:n(e)}]}))},[R.EmphasizedLink]:{exec:(t,r)=>B(t,k,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=t[1].length>1?N.Bold:N.Italic,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.Emphasize]:{exec:(t,r)=>B(t,_,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=t[1].length>1?N.Bold:N.Italic,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.StrikeThrough]:{exec:(t,r)=>B(t,P,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=N.StrikeThrough,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.Quote]:{exec:(t,r)=>B(t,v,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=N.Quote,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[R.LineBreak]:{exec:(e,t)=>B(e,C,t,(e=>{const t=e[0],r=t;return[{index:n(e),raw:t,text:r,type:N.LineBreak}]}))}},O=(e,t,r)=>{const n=t?.length>0&&t[0].index;if(n>0){const s=e.substr(0,n),a=r.tokenize(s,H)||[];Array.prototype.unshift.apply(t,a)}},B=(e,t,r,n)=>{const s=a(e,t,(r=>{if(t!=w){const t=w.exec(e);if(t&&t.length&&t.index<r.index)return null}return n(r)}));return O(e,s,r),s},H=Object.values(E);Array.prototype.push.apply(H,z),H.push(I[R.Text],I[R.Space]);const j=e=>{const t=[I[R.Text],I[R.Space]],r=e?.toLowerCase()||"";return r&&r in F&&Array.prototype.unshift.apply(t,F[r]),t},D={[R.Paragraph]:{exec:(e,t)=>a(e,y,(e=>{const r=e[0],n=r;return[{type:N.Paragraph,raw:r,text:n,tokens:t.tokenize(n,H)}]}))},[R.Space]:I[R.Space]},T=(e,t)=>{const r=/^ {0,3}(`{3,}|$|>|[+-]\s|\d+[.\)])/m.test(e)?G:H;return t.tokenize(e,r)},A={[R.HorizontalRule]:{exec:(e,t)=>a(e,o,(e=>{const t=e[0],r=t;return[{type:N.HorizontalRule,raw:t,text:r}]}))},[R.Heading]:{exec:(e,t)=>a(e,c,(e=>{const r=e[2];return[{type:N.Heading,raw:e[0],text:r,level:e[1].length,ref:s(r),tokens:t.tokenize(r,H)}]}))},[R.Heading1]:{exec:(e,t)=>a(e,l,(e=>{const r=e[1];return[{type:N.Heading,raw:e[0],text:r,level:1,ref:s(r),tokens:t.tokenize(r,H)}]}))},[R.Heading2]:{exec:(e,t)=>a(e,u,(e=>{const r=e[1];return[{type:N.Heading,raw:e[0],text:r,level:2,ref:s(r),tokens:t.tokenize(r,H)}]}))},[R.CodeBlock]:{exec:(e,t)=>a(e,h,(e=>{const n=e[0],s=r(n);return[{type:N.CodeBlock,raw:n,text:s,tokens:t.tokenize(s,[])}]}))},[R.Fences]:{exec:(e,t)=>a(e,d,(e=>{const n=r(e[2]),s=e[1]?.toLowerCase();return[{type:N.CodeBlock,raw:e[0],text:n,lang:s,tokens:t.tokenize(n,j(s))}]}))},[R.BlockQuote]:{exec:(e,t)=>a(e,p,(e=>{const r=e[0],n=r.replace(/^ {0,3}> */gm,"");return[{type:N.BlockQuote,raw:r,text:n,tokens:t.tokenize(n,[D[R.Paragraph],D[R.Space]])}]}))},[R.OrderedList]:{exec:(t,r)=>a(t,g,(t=>{const n=t[0],s=n.replace(/^ {0,3}/gm,"").split(m).filter((t=>!e.NullChecker.isNullOrEmpty(t))).map((e=>e.trim()));return[{type:N.OrderedList,start:parseInt(/\d/.exec(t[0])[0]),raw:n,text:n,tokens:s.map((e=>({type:N.ListItem,raw:e,text:e,tokens:T(e,r)})))}]}))},[R.UnorderedList]:{exec:(t,r)=>a(t,f,(t=>{const n=t[0],s=n.replace(/^ {0,3}/gm,"").split(m).filter((t=>!e.NullChecker.isNullOrEmpty(t))).map((e=>e.trim()));return[{type:N.UnorderedList,raw:n,text:n,tokens:s.map((e=>({type:N.ListItem,raw:e,text:e,tokens:T(e,r)})))}]}))}},G=Object.values(A);return Array.prototype.push.apply(G,S),G.push(D[R.Paragraph],D[R.Space]),[L[R.Comment],L[R.Reference]].concat(G)}!function(e){e.Html="html",e.Text="text",e.Paragraph="paragraph",e.BlockQuote="blockquote",e.Space="space",e.Heading="heading",e.Bold="bold",e.Italic="italic",e.CodeBlock="codeblock",e.Code="code",e.Image="img",e.ImageLike="imglike",e.Link="link",e.LinkLike="linklike",e.LineBreak="br",e.StrikeThrough="strike",e.Quote="quote",e.HorizontalRule="hr",e.OrderedList="ol",e.UnorderedList="ul",e.ListItem="listitem",e.Reference="ref"}(N||(N={})),function(e){e[e.Comment=0]="Comment",e[e.Reference=1]="Reference",e[e.HorizontalRule=2]="HorizontalRule",e[e.Heading=3]="Heading",e[e.Heading1=4]="Heading1",e[e.Heading2=5]="Heading2",e[e.CodeBlock=6]="CodeBlock",e[e.Fences=7]="Fences",e[e.BlockQuote=8]="BlockQuote",e[e.OrderedList=9]="OrderedList",e[e.UnorderedList=10]="UnorderedList",e[e.Paragraph=11]="Paragraph",e[e.EmphasizedLink=12]="EmphasizedLink",e[e.ImageOrLink=13]="ImageOrLink",e[e.Emphasize=14]="Emphasize",e[e.StrikeThrough=15]="StrikeThrough",e[e.Quote=16]="Quote",e[e.Code=17]="Code",e[e.LineBreak=18]="LineBreak",e[e.Text=254]="Text",e[e.Space=255]="Space"}(R||(R={}));const S=/[ \r\n]*\0+[ \r\n]*/g;class HtmlRenderer{constructor(t=((e,t)=>e?.text||"")){this._extraItemRender=t,this._renderContent=t=>{const r=t.tokens;return e.NullChecker.isNullOrEmpty(r)?t.text:this._render(r)}}_rendeItem(e,t){const r=this._renderContent,n="\0";switch(e?.type){case N.Reference:return"";case N.Html:return e.raw;case N.BlockQuote:return`<blockquote>\n${r(e)}</blockquote>${n}`;case N.Bold:return`<b>${r(e)}</b>`;case N.CodeBlock:const s=e.lang;return`<pre>${n}<code${s?' class="'+s+'"':""}>${r(e)}</code>${n}</pre>${n}`;case N.Code:return`<code>${r(e)}</code>`;case N.HorizontalRule:return`<hr />${n}`;case N.Heading:const a=e.level;return`<h${a} id="${e.ref}">${r(e)}</h${a}>${n}`;case N.Image:case N.ImageLike:const i=e;let o=i.src,c="";const l=i.text,u=i.ref;if(!o&&u){const e=t.find((e=>e.type===N.Reference&&!0===e.image&&e.id?.toLowerCase()===u.toLowerCase()));e&&(o=e.url,c=e.title??"")}return o?`<img src="${o}" alt="${l}"${c?' title="'+c+'"':""} />`:`![${r(e)}]`;case N.Italic:return`<i>${r(e)}</i>`;case N.StrikeThrough:return`<s>${r(e)}</s>`;case N.Quote:return`<q>${r(e)}</q>`;case N.LineBreak:return"<br />\0";case N.OrderedList:return`<ol start="${e.start}">\n${r(e)}</ol>${n}`;case N.UnorderedList:return`<ul>\n${r(e)}</ul>${n}`;case N.ListItem:return`\t<li>${r(e)}</li>${n}`;case N.Link:case N.LinkLike:const h=e;let d=h.href,p="";const f=h.ref;if(!d&&f){const e=t.find((e=>e.type===N.Reference&&!0!==e.image&&e.id?.toLowerCase()===f.toLowerCase()));e&&(d=e.url,p=e.title??"")}return d?`<a href="${d}"${p?' title="'+p+'"':""}>${r(e)}</a>`:`[${r(e)}]`;case N.Paragraph:return`<p>${r(e)}</p>${n}`;case N.Text:case N.Space:return e.text}return this._extraItemRender(e,t)}_render(e){let t="";for(let r of e||[])t+=this._rendeItem(r,e);return t}render(e){return t=this._render(e),t?.replace(S,"\n").trim();var t}}class TokenRenderer{_render(t){return e.NullChecker.isNullOrEmpty(t)?"":JSON.stringify(t)}render(t){return"["+t.filter((t=>!e.NullChecker.isNullOrEmpty(t))).map(this._render).join(",")+"]"}}class Parser extends e.Compile.Parser{toHtml(t,r,n){const s=new HtmlRenderer(n);return e.NullChecker.isNullOrEmpty(r)?this.parse(t,s):this.parse(t,L(r),s)}tokenize(e,t){const r=this.parse(e,L(t),new TokenRenderer);return JSON.parse(r)}parse(e,t=L(),r=new HtmlRenderer){return(n=t)&&"object"==typeof n&&"function"==typeof n.render?super.parse(e,L(),t):super.parse(e,t,r);var n}}t.Parser=Parser}(t.Markdown||(t.Markdown={}))}(e.Compile||(e.Compile={}))}(Pacem||(Pacem={}));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -51,7 +51,8 @@ declare namespace Pacem.Geometry {
51
51
  static inLine(p: Point, segment: Segment): boolean;
52
52
  static inSegment(p: Point, segment: Segment): boolean;
53
53
  static inTriangle(p: Point, triangle: [Point, Point, Point]): boolean;
54
- static inPolygon(p: Point, vertices: Point[]): boolean;
54
+ static inPolygon(p: Point, vertices: Point[]): any;
55
+ static inPolygon(p: Point, vertices: Point[], precision: number): any;
55
56
  static area(points: Point[]): number;
56
57
  static area(...points: Point[]): number;
57
58
  }
@@ -140,6 +141,7 @@ declare namespace Pacem.Geometry {
140
141
  class Polygon {
141
142
  static isPolygon(obj: any): obj is Polygon;
142
143
  static from(...points: Point[]): Polygon;
144
+ static contains(polygon: Polygon, p: Point): any;
143
145
  static centroid(polygon: Polygon): Point;
144
146
  static boundingBox(polygon: Polygon): Rect;
145
147
  static sides(polygon: Polygon): Segment[];
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -263,7 +263,7 @@ var Pacem;
263
263
  }
264
264
  return true;
265
265
  }
266
- static inPolygon(p, vertices) {
266
+ static inPolygon(p, vertices, precision) {
267
267
  if (!((vertices === null || vertices === void 0 ? void 0 : vertices.length) >= 3)) {
268
268
  throw `Not enough vertices`;
269
269
  }
@@ -271,7 +271,11 @@ var Pacem;
271
271
  if (length === 3) {
272
272
  return this.inTriangle(p, [vertices[0], vertices[1], vertices[2]]);
273
273
  }
274
- let minx = Number.POSITIVE_INFINITY, miny = Number.POSITIVE_INFINITY, maxx = 0, maxy = 0;
274
+ if (precision > 0) {
275
+ vertices = vertices.map(v => { return { x: v.x.roundoff(precision), y: v.y.roundoff(precision) }; });
276
+ p = { x: p.x.roundoff(precision), y: p.y.roundoff(precision) };
277
+ }
278
+ let minx = Number.MAX_VALUE, miny = Number.MAX_VALUE, maxx = Number.MIN_VALUE, maxy = Number.MIN_VALUE;
275
279
  for (let j = 0; j < length; j++) {
276
280
  const v = vertices[j];
277
281
  minx = Math.min(minx, v.x);
@@ -753,6 +757,9 @@ var Pacem;
753
757
  static from(...points) {
754
758
  return { vertices: Array.from(points) };
755
759
  }
760
+ static contains(polygon, p) {
761
+ return Geometry.Utils.inPolygon(p, polygon.vertices, 12);
762
+ }
756
763
  static centroid(polygon) {
757
764
  const bbox = Polygon.boundingBox(polygon);
758
765
  return { x: bbox.x + bbox.width / 2, y: bbox.y + bbox.height / 2 };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
6
- var Pacem,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(t,r):a?a.value=r:e.set(t,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||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(t){!function(e){!function(e){class Vector{static unit(t){const e={x:t.x,y:t.y};return this.normalize(e),e}static magSqr(t){return t.x*t.x+t.y*t.y}static mag(t){return Math.sqrt(Vector.magSqr(t))}static normalize(t){const e=Vector.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r}static from(e,r){return t.Point.subtract(e,r)}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}}e.Vector=Vector}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=180/Math.PI,n=2*Math.PI,a=e.LinearAlgebra.Vector;function s(e){return t.Point.isPoint(e)}e.Utils=class Utils{static slopeRad(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}static slopeRad2(t,e){return(n+this.slopeRad(t,e))%n}static slopeDeg(t,e){return this.slopeRad(t,e)*r}static slopeDeg2(t,e){return(360+this.slopeDeg(t,e))%360}static intersect(t,e,...r){return Array.isArray(t)&&Array.isArray(e)?this._intersectSegments(t,e,!0):this._intersectRects.apply(this,arguments)}static intersectLines(t,e,r,n){let a,s;if(Array.isArray(t)&&Array.isArray(e)&&2===t.length&&2===e.length&&"number"==typeof t[0]&&"number"==typeof e[0]&&"number"==typeof t[1]&&"number"==typeof e[1]&&(r=e[0],n=e[1],e=t[1],t=t[0]),"number"==typeof t&&"number"==typeof e){a=[{x:0,y:e},{x:1,y:t+e}],s=[{x:0,y:n},{x:1,y:r+n}]}else a=t,s=e;return this._intersectSegments(a,s,!1)}static cramer(t,e){Array.isArray(t)&&(t={a:t[0],b:t[1],c:t[2]}),Array.isArray(e)&&(e={a:e[0],b:e[1],c:e[2]});let r=(t.b*e.c-t.c*e.b)/(t.b*e.a-t.a*e.b),n=(t.c*e.a-t.a*e.c)/(t.b*e.a-t.a*e.b);return{x:-r.roundoff(),y:-n.roundoff()}}static mq(t,e){let r;if(s(t)?r=t:(r=t[0],e=t[1]),r.x===e.x)return[Number.NaN,Number.NaN];const n=(e.y-r.y)/(e.x-r.x);return[n,r.y-n*r.x]}static _intersectSegments(t,e,r){const n=t[0],a=t[1],s=e[0],m=e[1],i=Math.min(n.x,a.x),o=Math.min(n.y,a.y),c=Math.max(n.x,a.x),f=c-i,l=Math.max(n.y,a.y),u=l-o,h=Math.min(s.x,m.x),y=Math.min(s.y,m.y),x=Math.max(s.x,m.x),g=x-h,d=Math.max(s.y,m.y),M=d-y;if(0===f&&0===g)return null;if(0===u&&0===M)return null;const p=t=>t.x<h||t.x>x||t.x<i||t.x>c,b=t=>t.y<y||t.y>d||t.y<o||t.y>l;var w=null;if(0===f){if(r&&(h>i||x<c))return null;const t=this.mq(s,m);w=this.cramer([1,0,-i],[t[0],-1,t[1]]),r&&b(w)&&(w=null)}else if(0===g){if(r&&(i>h||c<x))return null;const t=this.mq(n,a);w=this.cramer([t[0],-1,t[1]],[1,0,-h]),r&&b(w)&&(w=null)}else if(0===u){if(r&&(y>o||d<l))return null;const t=this.mq(s,m);w=this.cramer([0,1,-o],[t[0],-1,t[1]]),r&&p(w)&&(w=null)}else if(0===M){if(r&&(o>y||l<d))return null;const t=this.mq(n,a);w=this.cramer([t[0],-1,t[1]],[0,1,-y]),r&&p(w)&&(w=null)}else{let t;if(!r||(t=this._intersectRects({x:i,y:o,width:f,height:u},{x:h,y:y,width:g,height:M}))&&t.width>0&&t.height>0){const e=this.mq(n,a),i=this.mq(s,m),o=e[0],c=i[0],f=e[1],l=i[1];if(o!==c){let e=(w=this.cramer([o,-1,f],[c,-1,l])).x,n=w.y;r&&(e<t.x||e>t.x+t.width||n<t.y||n>t.y+t.height)&&(w=null)}}}return null===w?null:{x:w.x,y:w.y}}static _intersectRects(...e){return t.Rect.intersect.apply(this,e)}static dot(t,e){return a.dot(t,e)}static cross(t,e){return a.cross(t,e)}static distance(e,r){if(null!=(n=e)&&Array.isArray(n)&&2===n.length&&s(n[0])&&s(n[1]))return t.Point.distance(e[0],e[1]);if(s(r))return t.Point.distance(e,r);{const t=r[0],n=r[1];return Math.abs(t*e.x-e.y+n)/Math.sqrt(Math.pow(t,2)+1)}var n}static inLine(t,e){const r=a.from(e[0],t),n=a.from(t,e[1]);return this.cross(r,n).isCloseTo(0)}static inSegment(t,e){const r=Math.min(e[0].x,e[1].x),n=Math.max(e[0].x,e[1].x),a=Math.min(e[0].y,e[1].y),s=Math.max(e[0].y,e[1].y);return t.x>=r&&t.x<=n&&t.y>=a&&t.y<=s&&this.inLine(t,e)}static inTriangle(e,r){let n;for(let a=0;a<3;a++){const s=r[a],m=r[(a+1)%3],i=t.Point.subtract(m,e),o=t.Point.subtract(s,e),c=this.cross(i,o);if(a>0&&c*n<=0)return!1;n=c}return!0}static inPolygon(t,e){if(!((null==e?void 0:e.length)>=3))throw"Not enough vertices";const r=e.length;if(3===r)return this.inTriangle(t,[e[0],e[1],e[2]]);let n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=0,m=0;for(let t=0;t<r;t++){const r=e[t];n=Math.min(n,r.x),a=Math.min(a,r.y),s=Math.max(s,r.x),m=Math.max(m,r.y)}if(t.x<n||t.x>s||t.y<a||t.y>m)return!1;const i=[{x:n-1,y:t.y},t];let o=0;for(let n=0;n<r;n++){const a=e[n],s=e[(n+1)%r],m=[a,s];if(a.y===t.y){const m=e[(n-1+r)%r];t.x>a.x&&(m.y-t.y)*(s.y-t.y)<0&&o++}else{if(s.y===t.y)continue;null!=this.intersect(m,i)&&o++}}return o%2==1}static area(t,...e){const r=[].concat(t).concat(e);let n=0;const a=r.length;if(a>=3){for(let t=0;t<r.length;t++){const{x:e,y:s}=r[t],m=t===a-1?0:t+1,{x:i,y:o}=r[m];n+=e*o-s*i}n*=.5}return Math.abs(n.roundoff())}}}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r=180/Math.PI,n=1/r;class Vector3D{static from(...t){if(3!==t.length)throw new RangeError("Must provide exactly 3 numbers");return{x:t[0],y:t[1],z:t[2]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&3===r.length)return Vector3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Vector3D.`)}static i(){return{x:1,y:0,z:0}}static j(){return{x:0,y:1,z:0}}static k(){return{x:0,y:0,z:1}}static subtract(t,e){return{x:e.x-t.x,y:e.y-t.y,z:e.z-t.z}}static add(...t){var e={x:0,y:0,z:0};for(var r of t)e.x+=r.x,e.y+=r.y,e.z+=r.z;return e}static dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}static cross(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}static magSqr(t){return t.x*t.x+t.y*t.y+t.z*t.z}static mag(t){return Math.sqrt(Vector3D.magSqr(t))}static unit(t){const e={x:t.x,y:t.y,z:t.z};return this.normalize(e),e}static normalize(t){const e=Vector3D.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r,t.z*=r}static angleBetween(t,e){let n;const a=Vector3D.unit(t),s=Vector3D.unit(e);if(Vector3D.dot(a,s)<0){const t={x:-a.x-s.x,y:-a.y-s.y,z:-a.z-s.z},e=Vector3D.mag(t);n=Math.PI-2*Math.asin(e/2)}else{const t={x:a.x-s.x,y:a.y-s.y,z:a.z-s.z},e=Vector3D.mag(t);n=2*Math.asin(e/2)}return r*n}}e.Vector3D=Vector3D;class Matrix3D{static identity(){return{m11:1,m12:0,m13:0,m14:0,m21:0,m22:1,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,offsetX:0,offsetY:0,offsetZ:0,m44:1}}static from(...t){if(16!==t.length)throw new RangeError("Must provide exactly 16 numbers");return{m11:t[0],m12:t[1],m13:t[2],m14:t[3],m21:t[4],m22:t[5],m23:t[6],m24:t[7],m31:t[8],m32:t[9],m33:t[10],m34:t[11],offsetX:t[12],offsetY:t[13],offsetZ:t[14],m44:t[15]}}static transpose(t){return Matrix3D.from(t.m11,t.m21,t.m31,t.offsetX,t.m12,t.m22,t.m32,t.offsetY,t.m13,t.m23,t.m33,t.offsetZ,t.m14,t.m24,t.m34,t.m44)}static toArray(t){return[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.offsetX,t.offsetY,t.offsetZ,t.m44]}static clone(t){return Matrix3D.from.apply(null,Matrix3D.toArray(t))}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&16===r.length)return Matrix3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Matrix3D.`)}static isIdentity(t){return 1==t.m11&&0==t.m12&&0==t.m13&&0==t.m14&&0==t.m21&&1==t.m22&&0==t.m23&&0==t.m24&&0==t.m31&&0==t.m32&&1==t.m33&&0==t.m34&&0==t.offsetX&&0==t.offsetY&&0==t.offsetZ&&1==t.m44}static isAffine(t){return 0==t.m14&&0==t.m24&&0==t.m34&&1==t.m44}static determinant(t){if(Matrix3D.isIdentity(t))return 1;if(Matrix3D.isAffine(t))return t.m11*(t.m22*t.m33-t.m32*t.m23)-t.m12*(t.m21*t.m33-t.m31*t.m23)+t.m13*(t.m21*t.m32-t.m31*t.m22);{const e=t.m13*t.m24-t.m23*t.m14,r=t.m13*t.m34-t.m33*t.m14,n=t.m13*t.m44-t.offsetZ*t.m14,a=t.m23*t.m34-t.m33*t.m24,s=t.m23*t.m44-t.offsetZ*t.m24,m=t.m33*t.m44-t.offsetZ*t.m34,i=t.m22*r-t.m32*e-t.m12*a,o=t.m12*s-t.m22*n+t.offsetY*e,c=t.m32*n-t.offsetY*r-t.m12*m,f=t.m22*m-t.m32*s+t.offsetY*a;return t.offsetX*i+t.m31*o+t.m21*c+t.m11*f}}static multiply(t,e){return Matrix3D.isIdentity(t)?e:Matrix3D.isIdentity(e)?t:Matrix3D.from(t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.offsetX,t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.offsetY,t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.offsetZ,t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.offsetX,t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.offsetY,t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.offsetZ,t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.offsetX,t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.offsetY,t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.offsetZ,t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,t.offsetX*e.m11+t.offsetY*e.m21+t.offsetZ*e.m31+t.m44*e.offsetX,t.offsetX*e.m12+t.offsetY*e.m22+t.offsetZ*e.m32+t.m44*e.offsetY,t.offsetX*e.m13+t.offsetY*e.m23+t.offsetZ*e.m33+t.m44*e.offsetZ,t.offsetX*e.m14+t.offsetY*e.m24+t.offsetZ*e.m34+t.m44*e.m44)}static invert(t){if(Matrix3D.isAffine(t)){const e=t.m12*t.m23-t.m22*t.m13,r=t.m32*t.m13-t.m12*t.m33,n=t.m22*t.m33-t.m32*t.m23,a=Matrix3D.determinant(t);if(0==a)return null;const s=t.m21*t.m13-t.m11*t.m23,m=t.m11*t.m33-t.m31*t.m13,i=t.m31*t.m23-t.m21*t.m33,o=t.m11*t.m22-t.m21*t.m12,c=t.m11*t.m32-t.m31*t.m12,f=t.m11*t.offsetY-t.offsetX*t.m12,l=t.m21*t.m32-t.m31*t.m22,u=t.m21*t.offsetY-t.offsetX*t.m22,h=t.m31*t.offsetY-t.offsetX*t.m32,y=t.m23*f-t.offsetZ*o-t.m13*u,x=t.m13*h-t.m33*f+t.offsetZ*c,g=t.m33*u-t.offsetZ*l-t.m23*h,d=o,M=-c,p=l,b=1/a;return Matrix3D.from(n*b,r*b,e*b,0,i*b,m*b,s*b,0,p*b,M*b,d*b,0,g*b,x*b,y*b,1)}{const e=Matrix3D.determinant(t);if(0==e)return null;const r=t.m33*t.m44-t.m34*t.offsetZ,n=t.m32*t.m44-t.m34*t.offsetY,a=t.m31*t.m44-t.m34*t.offsetX,s=t.m32*t.offsetZ-t.m33*t.offsetY,m=t.m31*t.offsetZ-t.m33*t.offsetX,i=t.m31*t.offsetY-t.m32*t.offsetX,o=t.m33*t.m44-t.m34*t.offsetZ,c=t.m32*t.m44-t.m34*t.offsetY,f=t.m31*t.m44-t.m34*t.offsetX,l=t.m32*t.offsetZ-t.m33*t.offsetY,u=t.m31*t.offsetZ-t.m33*t.offsetX,h=t.m31*t.offsetY-t.m32*t.offsetX,y=t.m23*t.m44-t.m24*t.offsetZ,x=t.m22*t.m44-t.m24*t.offsetY,g=t.m21*t.m44-t.m24*t.offsetX,d=t.m22*t.offsetZ-t.m23*t.offsetY,M=t.m21*t.offsetZ-t.m23*t.offsetX,p=t.m21*t.offsetY-t.m22*t.offsetX,b=t.m23*t.m34-t.m24*t.m33,w=t.m22*t.m34-t.m24*t.m32,v=t.m21*t.m34-t.m24*t.m31,z=t.m22*t.m33-t.m23*t.m32,P=t.m21*t.m33-t.m23*t.m31,A=t.m21*t.m32-t.m22*t.m31,N=t.m22*r-t.m23*n+t.m24*s,D=-(t.m21*r-t.m23*a+t.m24*m),_=t.m21*n-t.m22*a+t.m24*i,C=-(t.m21*s-t.m22*m+t.m23*i),I=-(t.m12*o-t.m13*c+t.m14*l),V=t.m11*o-t.m13*f+t.m14*u,Y=-(t.m11*c-t.m12*f+t.m14*h),q=t.m11*l-t.m12*u+t.m13*h,X=t.m12*y-t.m13*x+t.m14*d,Z=-(t.m11*y-t.m13*g+t.m14*M),S=t.m11*x-t.m12*g+t.m14*p,E=-(t.m11*d-t.m12*M+t.m13*p),F=-(t.m12*b-t.m13*w+t.m14*z),T=t.m11*b-t.m13*v+t.m14*P,L=-(t.m11*w-t.m12*v+t.m14*A),G=t.m11*z-t.m12*P+t.m13*A,Q=1/e;return Matrix3D.from(N*Q,I*Q,X*Q,F*Q,D*Q,V*Q,Z*Q,T*Q,_*Q,Y*Q,S*Q,L*Q,C*Q,q*Q,E*Q,G*Q)}}static transform(t,e){var r={x:t.x,y:t.y,z:t.z};if(!Matrix3D.isIdentity(e)){var n=r.x,a=r.y,s=r.z;if(r.x=n*e.m11+a*e.m21+s*e.m31+e.offsetX,r.y=n*e.m12+a*e.m22+s*e.m32+e.offsetY,r.z=n*e.m13+a*e.m23+s*e.m33+e.offsetZ,!Matrix3D.isAffine(e)){var m=n*e.m14+a*e.m24+s*e.m34+e.m44;0!=m&&(r.x/=m,r.y/=m,r.z/=m)}}return r}}e.Matrix3D=Matrix3D;class Quaternion{static from(...t){if(4!==t.length)throw new RangeError("Must provide exactly 4 numbers");return{x:t[0],y:t[1],z:t[2],w:t[3]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&4===r.length)return Quaternion.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Quaternion.`)}static fromAxisAngle(t,e){var r=n*(e%=360),a=Vector3D.mag(t);if(0==a)throw new RangeError("Invalid argument");var s=Math.sin(.5*r)/a,m=t.x*s,i=t.y*s,o=t.z*s;return Quaternion.from(m,i,o,Math.cos(.5*r))}static fromRotationMatrix(t){const e=t.m11+t.m22+t.m33+t.m44;if(e>0){const r=.5/Math.sqrt(e),n=.25/r,a=(t.m23-t.m32)*r,s=(t.m31-t.m13)*r,m=(t.m12-t.m21)*r;return Quaternion.from(a,s,m,n)}if(t.m11>t.m22&&t.m11>t.m22){const e=.5/Math.sqrt(t.m44+t.m11-t.m22-t.m33),r=(t.m23-t.m32)*e,n=.25/e,a=(t.m12+t.m21)*e,s=(t.m31+t.m13)*e;return Quaternion.from(n,a,s,r)}if(t.m22>t.m33){const e=.5/Math.sqrt(t.m44+t.m22-t.m11-t.m33),r=(t.m23+t.m32)*e,n=.25/e,a=(t.m12+t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(a,n,r,s)}{const e=.5/Math.sqrt(t.m44+t.m33-t.m11-t.m22),r=(t.m23+t.m32)*e,n=.25/e,a=(t.m12-t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(s,r,n,a)}}static conjugate(t){return Quaternion.from(-t.x,-t.y,-t.z,t.w)}static norm(t){return t.x*t.x+t.y*t.y+t.z*t.z}static axis(t){return 0==t.x&&0==t.y&&0==t.z?Vector3D.j():Vector3D.unit(t)}static angle(t){let e=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),r=t.w;if(e>Number.MAX_VALUE){const n=Math.max(Math.abs(t.x),Math.max(Math.abs(t.y),Math.abs(t.z))),a=t.x/n,s=t.y/n,m=t.z/n;e=Math.sqrt(a*a+s*s+m*m),r/=n}return 114.59155902616465*Math.atan2(e,r)}static toRotationMatrix(t){var e=Matrix3D.identity(),r=t.x,n=t.y,a=t.z,s=t.w;return e.m11=1-2*n*n-2*a*a,e.m12=2*r*n+2*s*a,e.m13=2*r*a-2*s*n,e.m21=2*r*n-2*s*a,e.m22=1-2*r*r-2*a*a,e.m23=2*n*a+2*s*r,e.m31=2*s*n+2*r*a,e.m32=2*n*a-2*s*r,e.m33=1-2*r*r-2*n*n,e}static invert(t){const e=1/Quaternion.norm(t),r=Quaternion.conjugate(t);return r.x*=e,r.y*=e,r.z*=e,r.w*=e,r}static multiply(t,e){return Quaternion.from(t.w*e.x+t.x+e.w+t.y*e.z-t.z*e.y,t.w*e.y-t.x*e.z+t.y*e.w+t.z*e.x,t.w*e.z+t.x*e.y-t.y*e.x+t.z*e.w,t.w*e.w-t.x*e.x-t.y*e.y-t.z*e.z)}static dot(t,e){return Quaternion.multiply(t,Quaternion.conjugate(e)).w}}e.Quaternion=Quaternion}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){class Polygon{static isPolygon(e){return function(e){let r;return"vertices"in e&&Array.isArray(e.vertices)&&(r=e.vertices).length>=3&&r.every((e=>t.Point.isPoint(e)))}(e)}static from(...t){return{vertices:Array.from(t)}}static centroid(t){const e=Polygon.boundingBox(t);return{x:e.x+e.width/2,y:e.y+e.height/2}}static boundingBox(t){let e=Number.MAX_VALUE,r=Number.MAX_VALUE,n=Number.MIN_VALUE,a=Number.MIN_VALUE;const{vertices:s}=t;s.length;for(let t of s)e=Math.min(e,t.x),r=Math.min(r,t.y),n=Math.max(n,t.x),a=Math.max(a,t.y);return{x:e,y:r,width:n-e,height:a-r}}static sides(t){const{vertices:e}=t,r=[];for(let t=1;t<=e.length;t++){const n=e[t%e.length],a=e[t-1];r.push([a,n])}return r}static isConvex(e){const{vertices:r}=e,n=r.length;if(n<=3)return!0;let a=0;for(let e=0;e<r.length;e++){const s=r[(e-1+n)%n],m=r[e],i=r[(e+1)%n],o=t.Angle.angleBetween(m,s,i);if(0!==a){if(a!=Math.sign(o))return!1}else a=Math.sign(o)}return!0}static isSelfIntersecting(r){const{vertices:n}=r;if(n.length<=3)return!1;const a=Polygon.sides(r);for(let r of a)for(let n of a){if(n===r||n[0]===r[1]||r[0]===n[1])continue;const a=e.Utils.intersect(n,r);if(!t.NullChecker.isNull(a))return!0}return!1}static isCounterClockwise(e){const{vertices:[r,n,a]}=e;return t.Angle.angleBetween(n,r,a)>0}static expand(r,n){const{vertices:a}=r,s=a.length,m=[];for(let r=0;r<a.length;r++){const i=a[(r-1+s)%s],o=a[r],c=a[(r+1)%s],f=t.Angle.angleBetween(o,i,c),l=-n/Math.sin(Math.abs(f)/2),u=t.Matrix2D.scale(t.Matrix2D.identity,l),h=t.Point.subtract(o,i);e.LinearAlgebra.Vector.normalize(h);const y=t.Point.subtract(o,c);e.LinearAlgebra.Vector.normalize(y);const x=t.Point.add(h,y);e.LinearAlgebra.Vector.normalize(x);const g=t.Matrix2D.multiply(x,u);m.push(t.Point.add(o,{x:g.x.roundoff(),y:g.y.roundoff()}))}return{vertices:m}}static area(t){return e.Utils.area(t.vertices)}}e.Polygon=Polygon}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(t){function e(t){return"number"==typeof t&&(t={real:t,img:0}),t}var r;function n(t,e){const r={};return Object.defineProperty(r,"real",{value:t,writable:!1}),Object.defineProperty(r,"img",{value:e,writable:!1}),r}function a(){return r||(r=n(Number.NaN,Number.NaN))}t.Complex=class Complex{static build(t,e){return this.isComplex(t)?t:(null!=e||(e=0),"number"!=typeof t||"number"!=typeof e?a():n(t,e||0))}static add(t,r){const a=e(t),s=e(r);return n(a.real+s.real,a.img+s.img)}static subtract(t,r){const a=e(t),s=e(r);return n(a.real-s.real,a.img-s.img)}static multiply(t,r){const a=e(t),s=e(r);return n(a.real*s.real-a.img*s.img,a.real*s.img+a.img*s.real)}static divide(t,r){const s=e(t),m=e(r),i=this.absSquare(m).roundoff();if(0===i)return a();const o=1/i;return n(o*(s.real*m.real+s.img*m.img),o*(s.img*m.real-s.real*m.img))}static absSquare(t){const r=e(t);return Math.pow(r.real,2)+Math.pow(r.img,2)}static modulus(t){return Math.sqrt(this.absSquare(t))}static isComplex(t){return null!=t&&"object"==typeof t&&"real"in t&&"img"in t&&"number"==typeof t.real&&"number"==typeof t.img}static conjugate(t){return n((t=e(t)).real,0==Math.abs(t.img)?0:-t.img)}static equals(t,e){const r=this.build(t),n=this.build(e);return!(!this.isComplex(t)||!this.isComplex(e))&&(r.real===n.real&&r.img===n.img)}static get NaC(){return a()}}}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(e){const r={};function n(e,n){const a=r[n]=r[n]||{};return a[e]=a[e]||function(e,r){const n=2*Math.PI*e/r;return t.Complex.build(Math.cos(n),Math.sin(n))}(e,n)}function a(e){const r=[],s=e.length;if(1===s)return[t.Complex.build(e[0])];const m=a(e.filter(((t,e)=>e%2==0))),i=a(e.filter(((t,e)=>e%2==1)));for(var o=0;o<s/2;o++){const e=m[o],a=t.Complex.multiply(n(o,s),i[o]);r[o]=t.Complex.add(e,a),r[o+s/2]=t.Complex.subtract(e,a)}return r}e.Fourier=class Fourier{static transform(t,e=!0){return(r=(t=t||[]).length)>0&&0==(r&r-1)?this.fft(t,e):this.dft(t,e);var r}static invert(t,e=!0){return this.idft(t||[],e)}static dft(e,r=!0){var a;const s=null===(a=e||[])||void 0===a?void 0:a.length,m=r?1/Math.sqrt(s):1,i=[];for(let r=0;r<s;r++){i.push({real:0,img:0});for(let a=0;a<s;a++){const o=n(r*a,s),c=t.Complex.multiply(e[a],o),f=t.Complex.multiply(c,m);i[r]=t.Complex.add(i[r],f)}}return i}static idft(e,r=!0){const n=e.map((e=>t.Complex.build(e.img,e.real)));return this.transform(n,r).map((e=>t.Complex.build(e.img,e.real)))}static fft(e,r=!0){const n=a(e);if(!r)return n;const s=1/Math.sqrt(e.length);return n.map((e=>t.Complex.multiply(e,s)))}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){const e=Math.sqrt(Math.PI);function r(t){let e,r,n;return r=Math.abs(t),e=1/(1+.5*r),n=e*Math.exp(-r*r-1.26551223+e*(1.00002368+e*(.37409196+e*(.09678418+e*(e*(.27886807+e*(e*(1.48851587+e*(.17087277*e-.82215223))-1.13520398))-.18628806))))),t>=0?n:2-n}class Gaussian{constructor(t,e){this.mean=t,this.stdev=Math.abs(e),this.variance=Math.pow(e,2)}static get normal(){return n}probabilityDensity(t){const r=this.stdev*Math.SQRT2*e;return Math.exp(-.5*Math.pow(this._z(t),2))/r}_z(t){return(t-this.mean)/this.stdev}probability(t){return.5*r(-this._z(t)/Math.SQRT2)}}t.Gaussian=Gaussian;const n=new Gaussian(0,1)}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){var e,r;class Lagrangian{constructor(...t){e.set(this,void 0),r.set(this,void 0),__classPrivateFieldSet(this,e,Array.from(t)||[],"f")}_unsafeCreate(){const t=__classPrivateFieldGet(this,e,"f")||[];let n,a="var ljs = [];\n";for(let e=0;e<t.length;e++){const r=t[e],s=r.x;if(null!=n&&n>=s)throw new Error("Invalid function provided.");n=s,a+=`ljs.push( ${r.y}`;for(let r=0;r<t.length;r++)if(r!==e){const e=t[r];a+=` * ((x - ${e.x})/${s-e.x})`}a+=");\n"}a+="return ljs.reduce((prev, next) => prev + next, 0);",__classPrivateFieldSet(this,r,new Function("x",a),"f")}_compute(t){const r=__classPrivateFieldGet(this,e,"f")||[];let n;const a=[];for(let e=0;e<r.length;e++){const s=r[e].x;if(null!=n&&n>=s)throw new Error("Invalid function provided.");n=s;let m=r[e].y;for(let n=0;n<r.length;n++)if(n!==e){const e=r[n];m*=(t-e.x)/(s-e.x)}a.push(m)}return a.reduce(((t,e)=>t+e),0)}interpolate(t){return"function"==typeof __classPrivateFieldGet(this,r,"f")?__classPrivateFieldGet(this,r,"f").apply(null,[t]):this._compute(t)}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map(((t,e)=>"number"==typeof t?{x:e,y:t}:t)),r=new(Function.prototype.bind.apply(Lagrangian,[null].concat(e)));try{r._unsafeCreate()}catch(t){}return r}}e=new WeakMap,r=new WeakMap,t.Lagrangian=Lagrangian}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r="0123456789abcdefghijklmnopqrstuvwxyz",n="Radix out of range: possible values go between positive 1 exclusive and 36 inclusive";class Utils{static lcd(...e){if(t.NullChecker.isNullOrEmpty(e)||e.length<=1)throw"Insufficient set of numbers.";function r(t,e){return e?r(e,t%e):0===e?t:NaN}function n(t,e){return t*e/r(t,e)}let a=Math.round(e[0]);for(let t=1;t<e.length;t++)a=n(a,Math.round(e[t]));return a}static gcd(t,e){return t=Math.round(t),e=Math.round(e),0===t?e:Utils.gcd(e%t,t)}static rebaseInt(e,r,n){return t.Numbers.rebase(e,r,n)}static rebaseFloat(t,e,r,n=12){const a=Utils.rebaseFloat10ToN,s=Utils.rebaseFloatNTo10;if(10===e){const e=parseFloat(t.toString());return r%1==0?Utils.rebaseFloat10ToNIntBase(e,r,n):a(e,r,n)}if(10===r)return s(t.toString(),e,n);return a(s(t.toString(),e,n+1),r,n)}static rebaseFloatNTo10(t,e,a=12){const s=r;if(e<=1||e>s.length)throw new Error(n);const m=(null!=t?t:"0").toString().toLowerCase(),i=Number.NaN;if("0"===m)return 0;const o=/^([-+]?) *([\da-z]+)?(.[\da-z]+)?$/.exec(m);if(o.length<2)return i;const c="-"===o[1]?-1:1,f=o[2]||"0",l=o[3]||".0";let u=0,h=0;for(let t of f+l.substr(1)){const r=s.indexOf(t);if(-1===r||r>=e)return i;u+=r*Math.pow(e,f.length-h-1),h++}return c*u}static rebaseFloat10ToNIntBase(t,e,a=12){const s=r;if(e<=1||e>36)throw new Error(n);const m=e;let i=Math.abs(null!=t?t:0);if(0===i||Number.isNaN(i))return t.toString();let o=(i%1).roundoff(),c="";for(;;){let t=i/m,e=Math.floor(t),r=(i-e*m).roundoff(),n=Math.floor(r);if(c=n>=36?`[${n}]`+c:s[n]+c,e<=0)break;i=e}if(c=c.replace(/^0+/,""),c||(c="0"),0===o)return c;let f="";do{i=(o*m).roundoff();const t=Math.floor(i),e=(i-t).roundoff();t>=36?f=`[${t}]`:f+=s[t],o=e}while(!o.isCloseTo(0)&&f.length<a);return/^0*$/.test(f)?c:(Math.sign(t)<0?"-":"")+c+"."+f.replace(/0+$/,"")}static rebaseFloat10ToN(e,a,s=12){const m=r;if(a<=1||a>m.length)throw new Error(n);const i=a;let o=Math.abs(null!=e?e:0);if(0===o||Number.isNaN(o))return e.toString();let c=Math.sign(e)<0?"-":"",f=[],l=[];for(let t=0;t<20;t++)f.push("0"),l.push("0");const u=i%1==0?i:Math.ceil(i);function h(t,e,r){const n=t?f:l,a=n[e]=n[e]||"0",s=m.indexOf(a)+r,i=s%u,o=Math.floor(s/u);return n[e]=m[i],o>0&&(t?h(t,e+1,o):0===e?h(!0,0,o):h(!1,e-1,o)),o}let y=0;for(;;){const e=Math.floor(t.Numbers.log(o,i)),r=e>=0;if(h(r,r?e:Math.abs(1+e),1),o=(o-Math.pow(i,e).roundoff()).roundoff(),r||y++,0===o||y>=100){const t=c+(f.reverse().map((t=>t||"0")).join("").replace(/^0+/,"")||"0"),e=l.map((t=>t||"0")).join("").substr(0,s).replace(/0+$/,"");return/^0*$/.test(e)?t:t+"."+e}}}}e.Utils=Utils}(e.NumberTheory||(e.NumberTheory={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){function e(t,e=!1){const r=this._varNum(t);return Math.sqrt(r/(t.length+(e?1:0)))}t.Utils=class Utils{static sum(t){return t.reduce(((t,e)=>t+e),0)}static mean(t){return this.sum(t)/t.length}static var(t){return function(t){const e=this.mean(t);return t.reduce(((t,r)=>Math.pow(r-e,2)+t),0)}(t)/t.length}static pstdev(t){return e(t,!1)}static sstdev(t){return e(t,!0)}static gaussian(e,r){return new t.Gaussian(e,r)}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={}));
6
+ var Pacem,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(t,r):a?a.value=r:e.set(t,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||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(t){!function(e){!function(e){class Vector{static unit(t){const e={x:t.x,y:t.y};return this.normalize(e),e}static magSqr(t){return t.x*t.x+t.y*t.y}static mag(t){return Math.sqrt(Vector.magSqr(t))}static normalize(t){const e=Vector.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r}static from(e,r){return t.Point.subtract(e,r)}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}}e.Vector=Vector}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=180/Math.PI,n=2*Math.PI,a=e.LinearAlgebra.Vector;function s(e){return t.Point.isPoint(e)}e.Utils=class Utils{static slopeRad(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}static slopeRad2(t,e){return(n+this.slopeRad(t,e))%n}static slopeDeg(t,e){return this.slopeRad(t,e)*r}static slopeDeg2(t,e){return(360+this.slopeDeg(t,e))%360}static intersect(t,e,...r){return Array.isArray(t)&&Array.isArray(e)?this._intersectSegments(t,e,!0):this._intersectRects.apply(this,arguments)}static intersectLines(t,e,r,n){let a,s;if(Array.isArray(t)&&Array.isArray(e)&&2===t.length&&2===e.length&&"number"==typeof t[0]&&"number"==typeof e[0]&&"number"==typeof t[1]&&"number"==typeof e[1]&&(r=e[0],n=e[1],e=t[1],t=t[0]),"number"==typeof t&&"number"==typeof e){a=[{x:0,y:e},{x:1,y:t+e}],s=[{x:0,y:n},{x:1,y:r+n}]}else a=t,s=e;return this._intersectSegments(a,s,!1)}static cramer(t,e){Array.isArray(t)&&(t={a:t[0],b:t[1],c:t[2]}),Array.isArray(e)&&(e={a:e[0],b:e[1],c:e[2]});let r=(t.b*e.c-t.c*e.b)/(t.b*e.a-t.a*e.b),n=(t.c*e.a-t.a*e.c)/(t.b*e.a-t.a*e.b);return{x:-r.roundoff(),y:-n.roundoff()}}static mq(t,e){let r;if(s(t)?r=t:(r=t[0],e=t[1]),r.x===e.x)return[Number.NaN,Number.NaN];const n=(e.y-r.y)/(e.x-r.x);return[n,r.y-n*r.x]}static _intersectSegments(t,e,r){const n=t[0],a=t[1],s=e[0],m=e[1],i=Math.min(n.x,a.x),o=Math.min(n.y,a.y),c=Math.max(n.x,a.x),f=c-i,u=Math.max(n.y,a.y),l=u-o,h=Math.min(s.x,m.x),y=Math.min(s.y,m.y),x=Math.max(s.x,m.x),g=x-h,d=Math.max(s.y,m.y),M=d-y;if(0===f&&0===g)return null;if(0===l&&0===M)return null;const p=t=>t.x<h||t.x>x||t.x<i||t.x>c,b=t=>t.y<y||t.y>d||t.y<o||t.y>u;var w=null;if(0===f){if(r&&(h>i||x<c))return null;const t=this.mq(s,m);w=this.cramer([1,0,-i],[t[0],-1,t[1]]),r&&b(w)&&(w=null)}else if(0===g){if(r&&(i>h||c<x))return null;const t=this.mq(n,a);w=this.cramer([t[0],-1,t[1]],[1,0,-h]),r&&b(w)&&(w=null)}else if(0===l){if(r&&(y>o||d<u))return null;const t=this.mq(s,m);w=this.cramer([0,1,-o],[t[0],-1,t[1]]),r&&p(w)&&(w=null)}else if(0===M){if(r&&(o>y||u<d))return null;const t=this.mq(n,a);w=this.cramer([t[0],-1,t[1]],[0,1,-y]),r&&p(w)&&(w=null)}else{let t;if(!r||(t=this._intersectRects({x:i,y:o,width:f,height:l},{x:h,y:y,width:g,height:M}))&&t.width>0&&t.height>0){const e=this.mq(n,a),i=this.mq(s,m),o=e[0],c=i[0],f=e[1],u=i[1];if(o!==c){let e=(w=this.cramer([o,-1,f],[c,-1,u])).x,n=w.y;r&&(e<t.x||e>t.x+t.width||n<t.y||n>t.y+t.height)&&(w=null)}}}return null===w?null:{x:w.x,y:w.y}}static _intersectRects(...e){return t.Rect.intersect.apply(this,e)}static dot(t,e){return a.dot(t,e)}static cross(t,e){return a.cross(t,e)}static distance(e,r){if(null!=(n=e)&&Array.isArray(n)&&2===n.length&&s(n[0])&&s(n[1]))return t.Point.distance(e[0],e[1]);if(s(r))return t.Point.distance(e,r);{const t=r[0],n=r[1];return Math.abs(t*e.x-e.y+n)/Math.sqrt(Math.pow(t,2)+1)}var n}static inLine(t,e){const r=a.from(e[0],t),n=a.from(t,e[1]);return this.cross(r,n).isCloseTo(0)}static inSegment(t,e){const r=Math.min(e[0].x,e[1].x),n=Math.max(e[0].x,e[1].x),a=Math.min(e[0].y,e[1].y),s=Math.max(e[0].y,e[1].y);return t.x>=r&&t.x<=n&&t.y>=a&&t.y<=s&&this.inLine(t,e)}static inTriangle(e,r){let n;for(let a=0;a<3;a++){const s=r[a],m=r[(a+1)%3],i=t.Point.subtract(m,e),o=t.Point.subtract(s,e),c=this.cross(i,o);if(a>0&&c*n<=0)return!1;n=c}return!0}static inPolygon(t,e,r){if(!((null==e?void 0:e.length)>=3))throw"Not enough vertices";const n=e.length;if(3===n)return this.inTriangle(t,[e[0],e[1],e[2]]);r>0&&(e=e.map((t=>({x:t.x.roundoff(r),y:t.y.roundoff(r)}))),t={x:t.x.roundoff(r),y:t.y.roundoff(r)});let a=Number.MAX_VALUE,s=Number.MAX_VALUE,m=Number.MIN_VALUE,i=Number.MIN_VALUE;for(let t=0;t<n;t++){const r=e[t];a=Math.min(a,r.x),s=Math.min(s,r.y),m=Math.max(m,r.x),i=Math.max(i,r.y)}if(t.x<a||t.x>m||t.y<s||t.y>i)return!1;const o=[{x:a-1,y:t.y},t];let c=0;for(let r=0;r<n;r++){const a=e[r],s=e[(r+1)%n],m=[a,s];if(a.y===t.y){const m=e[(r-1+n)%n];t.x>a.x&&(m.y-t.y)*(s.y-t.y)<0&&c++}else{if(s.y===t.y)continue;null!=this.intersect(m,o)&&c++}}return c%2==1}static area(t,...e){const r=[].concat(t).concat(e);let n=0;const a=r.length;if(a>=3){for(let t=0;t<r.length;t++){const{x:e,y:s}=r[t],m=t===a-1?0:t+1,{x:i,y:o}=r[m];n+=e*o-s*i}n*=.5}return Math.abs(n.roundoff())}}}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r=180/Math.PI,n=1/r;class Vector3D{static from(...t){if(3!==t.length)throw new RangeError("Must provide exactly 3 numbers");return{x:t[0],y:t[1],z:t[2]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&3===r.length)return Vector3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Vector3D.`)}static i(){return{x:1,y:0,z:0}}static j(){return{x:0,y:1,z:0}}static k(){return{x:0,y:0,z:1}}static subtract(t,e){return{x:e.x-t.x,y:e.y-t.y,z:e.z-t.z}}static add(...t){var e={x:0,y:0,z:0};for(var r of t)e.x+=r.x,e.y+=r.y,e.z+=r.z;return e}static dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}static cross(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}static magSqr(t){return t.x*t.x+t.y*t.y+t.z*t.z}static mag(t){return Math.sqrt(Vector3D.magSqr(t))}static unit(t){const e={x:t.x,y:t.y,z:t.z};return this.normalize(e),e}static normalize(t){const e=Vector3D.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r,t.z*=r}static angleBetween(t,e){let n;const a=Vector3D.unit(t),s=Vector3D.unit(e);if(Vector3D.dot(a,s)<0){const t={x:-a.x-s.x,y:-a.y-s.y,z:-a.z-s.z},e=Vector3D.mag(t);n=Math.PI-2*Math.asin(e/2)}else{const t={x:a.x-s.x,y:a.y-s.y,z:a.z-s.z},e=Vector3D.mag(t);n=2*Math.asin(e/2)}return r*n}}e.Vector3D=Vector3D;class Matrix3D{static identity(){return{m11:1,m12:0,m13:0,m14:0,m21:0,m22:1,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,offsetX:0,offsetY:0,offsetZ:0,m44:1}}static from(...t){if(16!==t.length)throw new RangeError("Must provide exactly 16 numbers");return{m11:t[0],m12:t[1],m13:t[2],m14:t[3],m21:t[4],m22:t[5],m23:t[6],m24:t[7],m31:t[8],m32:t[9],m33:t[10],m34:t[11],offsetX:t[12],offsetY:t[13],offsetZ:t[14],m44:t[15]}}static transpose(t){return Matrix3D.from(t.m11,t.m21,t.m31,t.offsetX,t.m12,t.m22,t.m32,t.offsetY,t.m13,t.m23,t.m33,t.offsetZ,t.m14,t.m24,t.m34,t.m44)}static toArray(t){return[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.offsetX,t.offsetY,t.offsetZ,t.m44]}static clone(t){return Matrix3D.from.apply(null,Matrix3D.toArray(t))}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&16===r.length)return Matrix3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Matrix3D.`)}static isIdentity(t){return 1==t.m11&&0==t.m12&&0==t.m13&&0==t.m14&&0==t.m21&&1==t.m22&&0==t.m23&&0==t.m24&&0==t.m31&&0==t.m32&&1==t.m33&&0==t.m34&&0==t.offsetX&&0==t.offsetY&&0==t.offsetZ&&1==t.m44}static isAffine(t){return 0==t.m14&&0==t.m24&&0==t.m34&&1==t.m44}static determinant(t){if(Matrix3D.isIdentity(t))return 1;if(Matrix3D.isAffine(t))return t.m11*(t.m22*t.m33-t.m32*t.m23)-t.m12*(t.m21*t.m33-t.m31*t.m23)+t.m13*(t.m21*t.m32-t.m31*t.m22);{const e=t.m13*t.m24-t.m23*t.m14,r=t.m13*t.m34-t.m33*t.m14,n=t.m13*t.m44-t.offsetZ*t.m14,a=t.m23*t.m34-t.m33*t.m24,s=t.m23*t.m44-t.offsetZ*t.m24,m=t.m33*t.m44-t.offsetZ*t.m34,i=t.m22*r-t.m32*e-t.m12*a,o=t.m12*s-t.m22*n+t.offsetY*e,c=t.m32*n-t.offsetY*r-t.m12*m,f=t.m22*m-t.m32*s+t.offsetY*a;return t.offsetX*i+t.m31*o+t.m21*c+t.m11*f}}static multiply(t,e){return Matrix3D.isIdentity(t)?e:Matrix3D.isIdentity(e)?t:Matrix3D.from(t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.offsetX,t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.offsetY,t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.offsetZ,t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.offsetX,t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.offsetY,t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.offsetZ,t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.offsetX,t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.offsetY,t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.offsetZ,t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,t.offsetX*e.m11+t.offsetY*e.m21+t.offsetZ*e.m31+t.m44*e.offsetX,t.offsetX*e.m12+t.offsetY*e.m22+t.offsetZ*e.m32+t.m44*e.offsetY,t.offsetX*e.m13+t.offsetY*e.m23+t.offsetZ*e.m33+t.m44*e.offsetZ,t.offsetX*e.m14+t.offsetY*e.m24+t.offsetZ*e.m34+t.m44*e.m44)}static invert(t){if(Matrix3D.isAffine(t)){const e=t.m12*t.m23-t.m22*t.m13,r=t.m32*t.m13-t.m12*t.m33,n=t.m22*t.m33-t.m32*t.m23,a=Matrix3D.determinant(t);if(0==a)return null;const s=t.m21*t.m13-t.m11*t.m23,m=t.m11*t.m33-t.m31*t.m13,i=t.m31*t.m23-t.m21*t.m33,o=t.m11*t.m22-t.m21*t.m12,c=t.m11*t.m32-t.m31*t.m12,f=t.m11*t.offsetY-t.offsetX*t.m12,u=t.m21*t.m32-t.m31*t.m22,l=t.m21*t.offsetY-t.offsetX*t.m22,h=t.m31*t.offsetY-t.offsetX*t.m32,y=t.m23*f-t.offsetZ*o-t.m13*l,x=t.m13*h-t.m33*f+t.offsetZ*c,g=t.m33*l-t.offsetZ*u-t.m23*h,d=o,M=-c,p=u,b=1/a;return Matrix3D.from(n*b,r*b,e*b,0,i*b,m*b,s*b,0,p*b,M*b,d*b,0,g*b,x*b,y*b,1)}{const e=Matrix3D.determinant(t);if(0==e)return null;const r=t.m33*t.m44-t.m34*t.offsetZ,n=t.m32*t.m44-t.m34*t.offsetY,a=t.m31*t.m44-t.m34*t.offsetX,s=t.m32*t.offsetZ-t.m33*t.offsetY,m=t.m31*t.offsetZ-t.m33*t.offsetX,i=t.m31*t.offsetY-t.m32*t.offsetX,o=t.m33*t.m44-t.m34*t.offsetZ,c=t.m32*t.m44-t.m34*t.offsetY,f=t.m31*t.m44-t.m34*t.offsetX,u=t.m32*t.offsetZ-t.m33*t.offsetY,l=t.m31*t.offsetZ-t.m33*t.offsetX,h=t.m31*t.offsetY-t.m32*t.offsetX,y=t.m23*t.m44-t.m24*t.offsetZ,x=t.m22*t.m44-t.m24*t.offsetY,g=t.m21*t.m44-t.m24*t.offsetX,d=t.m22*t.offsetZ-t.m23*t.offsetY,M=t.m21*t.offsetZ-t.m23*t.offsetX,p=t.m21*t.offsetY-t.m22*t.offsetX,b=t.m23*t.m34-t.m24*t.m33,w=t.m22*t.m34-t.m24*t.m32,v=t.m21*t.m34-t.m24*t.m31,z=t.m22*t.m33-t.m23*t.m32,A=t.m21*t.m33-t.m23*t.m31,P=t.m21*t.m32-t.m22*t.m31,N=t.m22*r-t.m23*n+t.m24*s,D=-(t.m21*r-t.m23*a+t.m24*m),_=t.m21*n-t.m22*a+t.m24*i,C=-(t.m21*s-t.m22*m+t.m23*i),V=-(t.m12*o-t.m13*c+t.m14*u),X=t.m11*o-t.m13*f+t.m14*l,q=-(t.m11*c-t.m12*f+t.m14*h),Y=t.m11*u-t.m12*l+t.m13*h,Z=t.m12*y-t.m13*x+t.m14*d,E=-(t.m11*y-t.m13*g+t.m14*M),L=t.m11*x-t.m12*g+t.m14*p,S=-(t.m11*d-t.m12*M+t.m13*p),I=-(t.m12*b-t.m13*w+t.m14*z),U=t.m11*b-t.m13*v+t.m14*A,F=-(t.m11*w-t.m12*v+t.m14*P),G=t.m11*z-t.m12*A+t.m13*P,T=1/e;return Matrix3D.from(N*T,V*T,Z*T,I*T,D*T,X*T,E*T,U*T,_*T,q*T,L*T,F*T,C*T,Y*T,S*T,G*T)}}static transform(t,e){var r={x:t.x,y:t.y,z:t.z};if(!Matrix3D.isIdentity(e)){var n=r.x,a=r.y,s=r.z;if(r.x=n*e.m11+a*e.m21+s*e.m31+e.offsetX,r.y=n*e.m12+a*e.m22+s*e.m32+e.offsetY,r.z=n*e.m13+a*e.m23+s*e.m33+e.offsetZ,!Matrix3D.isAffine(e)){var m=n*e.m14+a*e.m24+s*e.m34+e.m44;0!=m&&(r.x/=m,r.y/=m,r.z/=m)}}return r}}e.Matrix3D=Matrix3D;class Quaternion{static from(...t){if(4!==t.length)throw new RangeError("Must provide exactly 4 numbers");return{x:t[0],y:t[1],z:t[2],w:t[3]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&4===r.length)return Quaternion.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Quaternion.`)}static fromAxisAngle(t,e){var r=n*(e%=360),a=Vector3D.mag(t);if(0==a)throw new RangeError("Invalid argument");var s=Math.sin(.5*r)/a,m=t.x*s,i=t.y*s,o=t.z*s;return Quaternion.from(m,i,o,Math.cos(.5*r))}static fromRotationMatrix(t){const e=t.m11+t.m22+t.m33+t.m44;if(e>0){const r=.5/Math.sqrt(e),n=.25/r,a=(t.m23-t.m32)*r,s=(t.m31-t.m13)*r,m=(t.m12-t.m21)*r;return Quaternion.from(a,s,m,n)}if(t.m11>t.m22&&t.m11>t.m22){const e=.5/Math.sqrt(t.m44+t.m11-t.m22-t.m33),r=(t.m23-t.m32)*e,n=.25/e,a=(t.m12+t.m21)*e,s=(t.m31+t.m13)*e;return Quaternion.from(n,a,s,r)}if(t.m22>t.m33){const e=.5/Math.sqrt(t.m44+t.m22-t.m11-t.m33),r=(t.m23+t.m32)*e,n=.25/e,a=(t.m12+t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(a,n,r,s)}{const e=.5/Math.sqrt(t.m44+t.m33-t.m11-t.m22),r=(t.m23+t.m32)*e,n=.25/e,a=(t.m12-t.m21)*e,s=(t.m31-t.m13)*e;return Quaternion.from(s,r,n,a)}}static conjugate(t){return Quaternion.from(-t.x,-t.y,-t.z,t.w)}static norm(t){return t.x*t.x+t.y*t.y+t.z*t.z}static axis(t){return 0==t.x&&0==t.y&&0==t.z?Vector3D.j():Vector3D.unit(t)}static angle(t){let e=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),r=t.w;if(e>Number.MAX_VALUE){const n=Math.max(Math.abs(t.x),Math.max(Math.abs(t.y),Math.abs(t.z))),a=t.x/n,s=t.y/n,m=t.z/n;e=Math.sqrt(a*a+s*s+m*m),r/=n}return 114.59155902616465*Math.atan2(e,r)}static toRotationMatrix(t){var e=Matrix3D.identity(),r=t.x,n=t.y,a=t.z,s=t.w;return e.m11=1-2*n*n-2*a*a,e.m12=2*r*n+2*s*a,e.m13=2*r*a-2*s*n,e.m21=2*r*n-2*s*a,e.m22=1-2*r*r-2*a*a,e.m23=2*n*a+2*s*r,e.m31=2*s*n+2*r*a,e.m32=2*n*a-2*s*r,e.m33=1-2*r*r-2*n*n,e}static invert(t){const e=1/Quaternion.norm(t),r=Quaternion.conjugate(t);return r.x*=e,r.y*=e,r.z*=e,r.w*=e,r}static multiply(t,e){return Quaternion.from(t.w*e.x+t.x+e.w+t.y*e.z-t.z*e.y,t.w*e.y-t.x*e.z+t.y*e.w+t.z*e.x,t.w*e.z+t.x*e.y-t.y*e.x+t.z*e.w,t.w*e.w-t.x*e.x-t.y*e.y-t.z*e.z)}static dot(t,e){return Quaternion.multiply(t,Quaternion.conjugate(e)).w}}e.Quaternion=Quaternion}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){class Polygon{static isPolygon(e){return function(e){let r;return"vertices"in e&&Array.isArray(e.vertices)&&(r=e.vertices).length>=3&&r.every((e=>t.Point.isPoint(e)))}(e)}static from(...t){return{vertices:Array.from(t)}}static contains(t,r){return e.Utils.inPolygon(r,t.vertices,12)}static centroid(t){const e=Polygon.boundingBox(t);return{x:e.x+e.width/2,y:e.y+e.height/2}}static boundingBox(t){let e=Number.MAX_VALUE,r=Number.MAX_VALUE,n=Number.MIN_VALUE,a=Number.MIN_VALUE;const{vertices:s}=t;s.length;for(let t of s)e=Math.min(e,t.x),r=Math.min(r,t.y),n=Math.max(n,t.x),a=Math.max(a,t.y);return{x:e,y:r,width:n-e,height:a-r}}static sides(t){const{vertices:e}=t,r=[];for(let t=1;t<=e.length;t++){const n=e[t%e.length],a=e[t-1];r.push([a,n])}return r}static isConvex(e){const{vertices:r}=e,n=r.length;if(n<=3)return!0;let a=0;for(let e=0;e<r.length;e++){const s=r[(e-1+n)%n],m=r[e],i=r[(e+1)%n],o=t.Angle.angleBetween(m,s,i);if(0!==a){if(a!=Math.sign(o))return!1}else a=Math.sign(o)}return!0}static isSelfIntersecting(r){const{vertices:n}=r;if(n.length<=3)return!1;const a=Polygon.sides(r);for(let r of a)for(let n of a){if(n===r||n[0]===r[1]||r[0]===n[1])continue;const a=e.Utils.intersect(n,r);if(!t.NullChecker.isNull(a))return!0}return!1}static isCounterClockwise(e){const{vertices:[r,n,a]}=e;return t.Angle.angleBetween(n,r,a)>0}static expand(r,n){const{vertices:a}=r,s=a.length,m=[];for(let r=0;r<a.length;r++){const i=a[(r-1+s)%s],o=a[r],c=a[(r+1)%s],f=t.Angle.angleBetween(o,i,c),u=-n/Math.sin(Math.abs(f)/2),l=t.Matrix2D.scale(t.Matrix2D.identity,u),h=t.Point.subtract(o,i);e.LinearAlgebra.Vector.normalize(h);const y=t.Point.subtract(o,c);e.LinearAlgebra.Vector.normalize(y);const x=t.Point.add(h,y);e.LinearAlgebra.Vector.normalize(x);const g=t.Matrix2D.multiply(x,l);m.push(t.Point.add(o,{x:g.x.roundoff(),y:g.y.roundoff()}))}return{vertices:m}}static area(t){return e.Utils.area(t.vertices)}}e.Polygon=Polygon}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(t){function e(t){return"number"==typeof t&&(t={real:t,img:0}),t}var r;function n(t,e){const r={};return Object.defineProperty(r,"real",{value:t,writable:!1}),Object.defineProperty(r,"img",{value:e,writable:!1}),r}function a(){return r||(r=n(Number.NaN,Number.NaN))}t.Complex=class Complex{static build(t,e){return this.isComplex(t)?t:(null!=e||(e=0),"number"!=typeof t||"number"!=typeof e?a():n(t,e||0))}static add(t,r){const a=e(t),s=e(r);return n(a.real+s.real,a.img+s.img)}static subtract(t,r){const a=e(t),s=e(r);return n(a.real-s.real,a.img-s.img)}static multiply(t,r){const a=e(t),s=e(r);return n(a.real*s.real-a.img*s.img,a.real*s.img+a.img*s.real)}static divide(t,r){const s=e(t),m=e(r),i=this.absSquare(m).roundoff();if(0===i)return a();const o=1/i;return n(o*(s.real*m.real+s.img*m.img),o*(s.img*m.real-s.real*m.img))}static absSquare(t){const r=e(t);return Math.pow(r.real,2)+Math.pow(r.img,2)}static modulus(t){return Math.sqrt(this.absSquare(t))}static isComplex(t){return null!=t&&"object"==typeof t&&"real"in t&&"img"in t&&"number"==typeof t.real&&"number"==typeof t.img}static conjugate(t){return n((t=e(t)).real,0==Math.abs(t.img)?0:-t.img)}static equals(t,e){const r=this.build(t),n=this.build(e);return!(!this.isComplex(t)||!this.isComplex(e))&&(r.real===n.real&&r.img===n.img)}static get NaC(){return a()}}}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(e){const r={};function n(e,n){const a=r[n]=r[n]||{};return a[e]=a[e]||function(e,r){const n=2*Math.PI*e/r;return t.Complex.build(Math.cos(n),Math.sin(n))}(e,n)}function a(e){const r=[],s=e.length;if(1===s)return[t.Complex.build(e[0])];const m=a(e.filter(((t,e)=>e%2==0))),i=a(e.filter(((t,e)=>e%2==1)));for(var o=0;o<s/2;o++){const e=m[o],a=t.Complex.multiply(n(o,s),i[o]);r[o]=t.Complex.add(e,a),r[o+s/2]=t.Complex.subtract(e,a)}return r}e.Fourier=class Fourier{static transform(t,e=!0){return(r=(t=t||[]).length)>0&&0==(r&r-1)?this.fft(t,e):this.dft(t,e);var r}static invert(t,e=!0){return this.idft(t||[],e)}static dft(e,r=!0){var a;const s=null===(a=e||[])||void 0===a?void 0:a.length,m=r?1/Math.sqrt(s):1,i=[];for(let r=0;r<s;r++){i.push({real:0,img:0});for(let a=0;a<s;a++){const o=n(r*a,s),c=t.Complex.multiply(e[a],o),f=t.Complex.multiply(c,m);i[r]=t.Complex.add(i[r],f)}}return i}static idft(e,r=!0){const n=e.map((e=>t.Complex.build(e.img,e.real)));return this.transform(n,r).map((e=>t.Complex.build(e.img,e.real)))}static fft(e,r=!0){const n=a(e);if(!r)return n;const s=1/Math.sqrt(e.length);return n.map((e=>t.Complex.multiply(e,s)))}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){const e=Math.sqrt(Math.PI);function r(t){let e,r,n;return r=Math.abs(t),e=1/(1+.5*r),n=e*Math.exp(-r*r-1.26551223+e*(1.00002368+e*(.37409196+e*(.09678418+e*(e*(.27886807+e*(e*(1.48851587+e*(.17087277*e-.82215223))-1.13520398))-.18628806))))),t>=0?n:2-n}class Gaussian{constructor(t,e){this.mean=t,this.stdev=Math.abs(e),this.variance=Math.pow(e,2)}static get normal(){return n}probabilityDensity(t){const r=this.stdev*Math.SQRT2*e;return Math.exp(-.5*Math.pow(this._z(t),2))/r}_z(t){return(t-this.mean)/this.stdev}probability(t){return.5*r(-this._z(t)/Math.SQRT2)}}t.Gaussian=Gaussian;const n=new Gaussian(0,1)}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){var e,r;class Lagrangian{constructor(...t){e.set(this,void 0),r.set(this,void 0),__classPrivateFieldSet(this,e,Array.from(t)||[],"f")}_unsafeCreate(){const t=__classPrivateFieldGet(this,e,"f")||[];let n,a="var ljs = [];\n";for(let e=0;e<t.length;e++){const r=t[e],s=r.x;if(null!=n&&n>=s)throw new Error("Invalid function provided.");n=s,a+=`ljs.push( ${r.y}`;for(let r=0;r<t.length;r++)if(r!==e){const e=t[r];a+=` * ((x - ${e.x})/${s-e.x})`}a+=");\n"}a+="return ljs.reduce((prev, next) => prev + next, 0);",__classPrivateFieldSet(this,r,new Function("x",a),"f")}_compute(t){const r=__classPrivateFieldGet(this,e,"f")||[];let n;const a=[];for(let e=0;e<r.length;e++){const s=r[e].x;if(null!=n&&n>=s)throw new Error("Invalid function provided.");n=s;let m=r[e].y;for(let n=0;n<r.length;n++)if(n!==e){const e=r[n];m*=(t-e.x)/(s-e.x)}a.push(m)}return a.reduce(((t,e)=>t+e),0)}interpolate(t){return"function"==typeof __classPrivateFieldGet(this,r,"f")?__classPrivateFieldGet(this,r,"f").apply(null,[t]):this._compute(t)}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map(((t,e)=>"number"==typeof t?{x:e,y:t}:t)),r=new(Function.prototype.bind.apply(Lagrangian,[null].concat(e)));try{r._unsafeCreate()}catch(t){}return r}}e=new WeakMap,r=new WeakMap,t.Lagrangian=Lagrangian}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r="0123456789abcdefghijklmnopqrstuvwxyz",n="Radix out of range: possible values go between positive 1 exclusive and 36 inclusive";class Utils{static lcd(...e){if(t.NullChecker.isNullOrEmpty(e)||e.length<=1)throw"Insufficient set of numbers.";function r(t,e){return e?r(e,t%e):0===e?t:NaN}function n(t,e){return t*e/r(t,e)}let a=Math.round(e[0]);for(let t=1;t<e.length;t++)a=n(a,Math.round(e[t]));return a}static gcd(t,e){return t=Math.round(t),e=Math.round(e),0===t?e:Utils.gcd(e%t,t)}static rebaseInt(e,r,n){return t.Numbers.rebase(e,r,n)}static rebaseFloat(t,e,r,n=12){const a=Utils.rebaseFloat10ToN,s=Utils.rebaseFloatNTo10;if(10===e){const e=parseFloat(t.toString());return r%1==0?Utils.rebaseFloat10ToNIntBase(e,r,n):a(e,r,n)}if(10===r)return s(t.toString(),e,n);return a(s(t.toString(),e,n+1),r,n)}static rebaseFloatNTo10(t,e,a=12){const s=r;if(e<=1||e>s.length)throw new Error(n);const m=(null!=t?t:"0").toString().toLowerCase(),i=Number.NaN;if("0"===m)return 0;const o=/^([-+]?) *([\da-z]+)?(.[\da-z]+)?$/.exec(m);if(o.length<2)return i;const c="-"===o[1]?-1:1,f=o[2]||"0",u=o[3]||".0";let l=0,h=0;for(let t of f+u.substr(1)){const r=s.indexOf(t);if(-1===r||r>=e)return i;l+=r*Math.pow(e,f.length-h-1),h++}return c*l}static rebaseFloat10ToNIntBase(t,e,a=12){const s=r;if(e<=1||e>36)throw new Error(n);const m=e;let i=Math.abs(null!=t?t:0);if(0===i||Number.isNaN(i))return t.toString();let o=(i%1).roundoff(),c="";for(;;){let t=i/m,e=Math.floor(t),r=(i-e*m).roundoff(),n=Math.floor(r);if(c=n>=36?`[${n}]`+c:s[n]+c,e<=0)break;i=e}if(c=c.replace(/^0+/,""),c||(c="0"),0===o)return c;let f="";do{i=(o*m).roundoff();const t=Math.floor(i),e=(i-t).roundoff();t>=36?f=`[${t}]`:f+=s[t],o=e}while(!o.isCloseTo(0)&&f.length<a);return/^0*$/.test(f)?c:(Math.sign(t)<0?"-":"")+c+"."+f.replace(/0+$/,"")}static rebaseFloat10ToN(e,a,s=12){const m=r;if(a<=1||a>m.length)throw new Error(n);const i=a;let o=Math.abs(null!=e?e:0);if(0===o||Number.isNaN(o))return e.toString();let c=Math.sign(e)<0?"-":"",f=[],u=[];for(let t=0;t<20;t++)f.push("0"),u.push("0");const l=i%1==0?i:Math.ceil(i);function h(t,e,r){const n=t?f:u,a=n[e]=n[e]||"0",s=m.indexOf(a)+r,i=s%l,o=Math.floor(s/l);return n[e]=m[i],o>0&&(t?h(t,e+1,o):0===e?h(!0,0,o):h(!1,e-1,o)),o}let y=0;for(;;){const e=Math.floor(t.Numbers.log(o,i)),r=e>=0;if(h(r,r?e:Math.abs(1+e),1),o=(o-Math.pow(i,e).roundoff()).roundoff(),r||y++,0===o||y>=100){const t=c+(f.reverse().map((t=>t||"0")).join("").replace(/^0+/,"")||"0"),e=u.map((t=>t||"0")).join("").substr(0,s).replace(/0+$/,"");return/^0*$/.test(e)?t:t+"."+e}}}}e.Utils=Utils}(e.NumberTheory||(e.NumberTheory={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){function e(t,e=!1){const r=this._varNum(t);return Math.sqrt(r/(t.length+(e?1:0)))}t.Utils=class Utils{static sum(t){return t.reduce(((t,e)=>t+e),0)}static mean(t){return this.sum(t)/t.length}static var(t){return function(t){const e=this.mean(t);return t.reduce(((t,r)=>Math.pow(r-e,2)+t),0)}(t)/t.length}static pstdev(t){return e(t,!1)}static sstdev(t){return e(t,!0)}static gaussian(e,r){return new t.Gaussian(e,r)}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={}));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pacem v0.50.1-atlantis (https://js.pacem.it)
2
+ * pacem v0.50.1-babylon (https://js.pacem.it)
3
3
  * Copyright 2024 Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.50.1-atlantis",
2
+ "version": "0.50.1-babylon",
3
3
  "name": "pacem",
4
4
  "homepage": "https://js.pacem.it",
5
5
  "repository": {