flo-mat 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n)},n={};function e(t){let n="";for(let e=0;e<t.length;e++){const r=t[e];0===e&&(n="M "+r[0][0].toString()+" "+r[0][1].toString()+"\n"),4===r.length?n+="C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" \n":3===r.length?n+="Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" \n":2===r.length&&(n+="L "+r[1][0].toString()+" "+r[1][1].toString()+" \n")}return n+" z\n"}t.d(n,{A3:()=>e,bz:()=>wn,Ev:()=>Sn,$d:()=>Se,zh:()=>Xm,Ls:()=>Lm,CU:()=>Fm,gM:()=>Dm,xD:()=>Dn,SQ:()=>Kv,f4:()=>Tn,BG:()=>$m,Ij:()=>Qm,tQ:()=>Hd,C_:()=>dm,G:()=>Mn,bx:()=>qm,DZ:()=>Ad,yc:()=>Cn,wH:()=>In,N0:()=>Nn,EC:()=>Bn,Jt:()=>l,DC:()=>Fn,PF:()=>Vn,tO:()=>_g,Sl:()=>yn,ZN:()=>zn,MY:()=>On,bA:()=>Yn,p8:()=>An,bQ:()=>Ca,WN:()=>En,r0:()=>kn,UW:()=>sb,_T:()=>fb,Dw:()=>pb,xs:()=>am,vU:()=>Xn,y9:()=>fm,Fw:()=>lm,QE:()=>om,pI:()=>Pn});class r{constructor(){this.initialPoint=void 0,this.vals=void 0,this.prev2ndCubicControlPoint=void 0,this.prev2ndQuadraticControlPoint=void 0,this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const s={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function c(t){let n=0,e=0,r=1,o=0,i=1,s=1;const c=t._currentIndex;if(t._skipOptionalSpaces(),t._currentIndex<t._endIndex&&"+"===t._string[t._currentIndex]?t._currentIndex+=1:t._currentIndex<t._endIndex&&"-"===t._string[t._currentIndex]&&(t._currentIndex+=1,i=-1),t._currentIndex===t._endIndex||(t._string[t._currentIndex]<"0"||t._string[t._currentIndex]>"9")&&"."!==t._string[t._currentIndex])throw new Error("The first character of a number must be one of [0-9+-.].");const u=t._currentIndex;for(;t._currentIndex<t._endIndex&&t._string[t._currentIndex]>="0"&&t._string[t._currentIndex]<="9";)t._currentIndex+=1;if(t._currentIndex!==u){let n=t._currentIndex-1,r=1;for(;n>=u;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(t._currentIndex<t._endIndex&&"."===t._string[t._currentIndex]){if(t._currentIndex+=1,t._currentIndex>=t._endIndex||t._string[t._currentIndex]<"0"||t._string[t._currentIndex]>"9")throw new Error("There must be a least one digit following the .");for(;t._currentIndex<t._endIndex&&t._string[t._currentIndex]>="0"&&t._string[t._currentIndex]<="9";)r*=10,o+=Number(t._string.charAt(t._currentIndex))/r,t._currentIndex+=1}if(t._currentIndex!==c&&t._currentIndex+1<t._endIndex&&("e"===t._string[t._currentIndex]||"E"===t._string[t._currentIndex])&&"x"!==t._string[t._currentIndex+1]&&"m"!==t._string[t._currentIndex+1]){if(t._currentIndex+=1,"+"===t._string[t._currentIndex]?t._currentIndex+=1:"-"===t._string[t._currentIndex]&&(t._currentIndex+=1,s=-1),t._currentIndex>=t._endIndex||t._string[t._currentIndex]<"0"||t._string[t._currentIndex]>"9")throw new Error("There must be an exponent.");for(;t._currentIndex<t._endIndex&&t._string[t._currentIndex]>="0"&&t._string[t._currentIndex]<="9";)n*=10,n+=Number(t._string[t._currentIndex]),t._currentIndex+=1}let f=e+o;if(f*=i,n&&(f*=Math.pow(10,s*n)),c===t._currentIndex)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),f}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[c(this)]:"M"===r||"L"===r||"T"===r?n=[c(this),c(this)]:"S"===r||"Q"===r?n=[c(this),c(this),c(this),c(this)]:"C"===r?n=[c(this),c(this),c(this),c(this),c(this),c(this)]:"A"===r?n=[c(this),c(this),c(this),this._parseArcFlag(),this._parseArcFlag(),c(this),c(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let c,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=s[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}c=l}else u.length&&("z"!==c&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,c=l}return u.length>0&&("z"!==c&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function h(t,n){let e=function(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t),e}(t.pointOnShape,n.pointOnShape);return 0!==e?e:(e=t.order-n.order,0!==e?e:t.order2-n.order2)}function a(t,n){const[[e,r],[o,i]]=t,[[s,c],[u,f]]=n,l=o-e,h=i-r,a=u-s,p=f-c,d=a*h-p*l;if(0===d)return;const g=((c-r)*l-(s-e)*h)/d;return[s+g*a,c+g*p]}function p(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function d(t,n){return[n[0]-t[0],n[1]-t[1]]}function g(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function v(t,n){return t[0]===n[0]&&t[1]===n[1]}function m(t,n,e){let r,o=Number.POSITIVE_INFINITY;for(let i=0;i<n.length;i++){const s=n[i],c=p(t,e(s));c<o&&(r=s,o=c)}return r}function b(t,n){return t[0]*n[0]+t[1]*n[1]}function x(t){return[-t[1],t[0]]}function _(t,n){return t[0]*n[1]-t[1]*n[0]}function I(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function N(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function S(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function E(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function w(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[3*(c-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-s)),6*(s+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(s+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function M(t,n){const[e,r]=w(t);return[E(e,n),E(r,n)]}function P(t){const n=new WeakMap;return function(e){let r=n.get(e);return void 0!==r||(r=t(e),n.set(e,r)),r}}function T(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function y(t){return t[t.length-1]}function C(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}function O(t){return C(t).map(A).join("")}function A(t){let n=t.toString(2);for(;n.length<8;n="0"+n);return n}function z(t){const n=C(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),s=0===i?0:16,c=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+s,{sign:o,exponent:c,significand:u}}function B(t){return z(t).significand}function Y(t){return Math.log2(t&-t)}function F(t){if(0===t||!Number.isFinite(t))return NaN;const n=B(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=Y(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function V(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function k(t){if(0===t||!Number.isFinite(t))return NaN;const n=B(t),e=n.length;for(let t=0;t<e;t++){const r=V(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function L(t){return z(t).exponent}function D(t){if(0===t||!Number.isFinite(t))return NaN;const n=L(t);return k(t)-52+n}function X(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const s=i-(r-e);s&&(n[--o]=r,r=s)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const s=o-(r-e);s&&(n[i++]=s)}return n[i++]=r,n.length=i,n}function q(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}const Q=y,$=X;function G(t,n){if(t=$(t),0===Q(t))return[0];const e=D(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=D(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let s=t[o];s=q(s,i);const c=t.slice(o);return c[0]=s,c}function H(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function R(t,n){const e=t.length,r=n.length;let o=0,i=0;const s=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(s.push(t[o]),o++):(s.push(n[i]),i++):i++:o++;for(;o<e;)s.push(t[o]),o++;for(;i<r;)s.push(n[i]),i++;if(0===s.length)return[0];const c=s.length;if(1===c)return s;const u=[],f=s[1],l=s[0];let h=f+l;const a=l-(h-f);0!==a&&u.push(a),i=0;for(let t=2;t<c;t++){const n=s[t],e=h+n,r=e-h,o=h-(e-r)+(n-r);0!==o&&u.push(o),h=e}return 0===h&&0!==u.length||u.push(h),u}const U=134217729;function Z(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const s=U*o,c=s-(s-o),u=o-c,f=U*n,l=f-(f-n),h=n-l,a=[],p=u*h-(i-c*l-u*l-c*h);0!==p&&a.push(p);for(let o=1;o<e;o++){const e=t[o],s=e*n,c=U*e,u=c-(c-e),f=e-u,l=U*n,h=l-(l-n),p=n-h,d=f*p-(s-u*h-f*h-u*p),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&a.push(m),r=g;const b=s+r,x=r-(b-s);0!==x&&a.push(x),i=b}return 0===i&&0!==a.length||a.push(i),a}function j(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const s=U*o,c=s-(s-o),u=o-c,f=U*t,l=f-(f-t),h=t-l,a=[],p=u*h-(i-c*l-u*l-c*h);0!==p&&a.push(p);for(let o=1;o<e;o++){const e=n[o],s=e*t,c=U*e,u=c-(c-e),f=e-u,l=U*t,h=l-(l-t),p=t-h,d=f*p-(s-u*h-f*h-u*p),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&a.push(m),r=g;const b=s+r,x=r-(b-s);0!==x&&a.push(x),i=b}return 0===i&&0!==a.length||a.push(i),a}const W=Z,J=R;function K(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,W(n,t[r]));return e}function tt(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}const nt=tt,et=R;function rt(t,n){const e=nt(n);return et(t,e)}function ot(t){return 0===t?0:k(t)-F(t)+1}function it(t){const n=X(t);if(0===y(n))return 0;const e=n[n.length-1],r=n[0];return L(e)-L(r)+(53-F(r))}const st=K,ct=G,ut=it,ft=rt,lt=H;function ht(t,n,e){let r=n,o=t,i=!1,s=0;e||(s=ut(o)-ut(r)+1,e=s/53+1,i=!0);let c=[1/lt(r)],u=1;for(;;){if(o=st(o,c),u>e)return i?(o=ct(o,s),o):o.slice(o.length-e,o.length);r=st(r,c),c=ft([2],r),u*=2}}function at(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,s=i-r,c=r-(i-s)+(e-s);0!==c&&o.push(c),r=i}return 0===r&&0!==o.length||o.push(r),o}function pt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}const dt=pt,gt=at,vt=R;function mt(t){let n=[0];for(let e=0;e<t.length;e++){const r=t[e];n=1===r.length?1===n.length?dt(n[0],r[0]):gt(n,r[0]):1===n.length?gt(r,n[0]):vt(n,r)}return n}const bt=tt,xt=R,_t=X,It=at,Nt=mt,St=Z,Et=rt,wt=Math.sign;function Mt(t,n){t=_t(t);const e=(n=_t(n))[n.length-1];if(1===n.length){if(0===e)throw new Error("division by zero");if(1===e)return{div:t,rem:[0]};if(-1===e)return{div:bt(t),rem:[0]}}const r=wt(t[t.length-1]);if(0===r)return{div:[0],rem:[0]};const o=wt(e),i=[];let s=0;for(;;){const r=[];for(let o=t.length-1;o>=0;o--){const s=t[o],c=Math.round((s-s%e)/e);if(r.push(St(n,c)),0===c)break;i.push(c)}if(t=_t(Et(t,Nt(r))),s===i.length)break;s=i.length}let c=t,u=[0];for(let t=0;t<i.length;t++)u=It(u,i[t]);u=_t(u);const f=wt(c[c.length-1]);return 0!==f&&f!==r&&(r>0?o>0?(u=It(u,-1),c=xt(c,n)):(u=It(u,1),c=xt(c,bt(n))):r<0&&(o>0?(u=It(u,1),c=xt(c,bt(n))):(u=It(u,-1),c=xt(c,n)))),{div:u,rem:c}}const Pt=Mt,Tt=Mt;function yt(t,n){return y(rt(t,n))}const Ct=tt;function Ot(t){return t[t.length-1]<0?Ct(t):t}function At(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function zt(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}function Bt(t){const n=[];for(let e=0;e<t.length;e++)n.push(.5*t[e]);return n}const Yt=134217729;function Ft(t,n){const e=t*n,r=Yt*t,o=r-(r-t),i=t-o,s=Yt*n,c=s-(s-n),u=n-c;return[i*u-(e-o*c-i*c-o*u),e]}const Vt=K,kt=Ft,Lt=Z,Dt=pt,Xt=at,qt=R,Qt=K,$t=Ft,Gt=Z,Ht=X;function Rt(t){let n=t[0];for(let e=1;e<t.length;e++){const r=t[e];n=1==r.length?1===n.length?$t(n[0],r[0]):Gt(n,r[0]):1===n.length?Gt(r,n[0]):Qt(r,n)}return Ht(n)}const Ut=K,Zt=Rt,jt=X;function Wt(t){const n=(t=jt(t)).length;return 2===n?t:1===n?[0,t[0]]:[t[n-2],t[n-1]]}const Jt=3330669073875472e-31,Kt=2220446049250315e-31,tn=1109335647967049e-46,nn=3330669073875471e-31;function en(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let s;if(r>0){if(o<=0)return i;s=r+o}else{if(!(r<0))return i;if(o>=0)return i;s=-r-o}return Math.abs(i)>=Jt*s?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],s=t[1]-e[1],c=n[1]-e[1],u=rt(Ft(o,c),Ft(s,i));let f=H(u);if(Math.abs(f)>=Kt*r)return f;const l=T(t[0],e[0])[0],h=T(n[0],e[0])[0],a=T(t[1],e[1])[0],p=T(n[1],e[1])[0];if(0===l&&0===a&&0===h&&0===p)return f;const d=tn*r+nn*Math.abs(f);if(f+=o*p+c*l-(s*h+i*a),Math.abs(f)>=d)return f;const g=R(u,rt(Ft(l,c),Ft(a,i))),v=R(g,rt(Ft(o,p),Ft(s,h)));let m=R(v,rt(Ft(l,p),Ft(a,h)));return m=X(m),m[m.length-1]}(t,n,e,s)}function rn(t,n){return!function(t,n){if(0===t||0===n)return!0;Math.abs(n)>Math.abs(t)&&([t,n]=[n,t]);const e=F(t),r=k(n);return e+(L(t)-L(n))>r}(t,n)}const on=R,sn=K,cn=j,un={fastTwoDiff:function(t,n){const e=t-n;return[t-e-n,e]},fastTwoSum:function(t,n){const e=t+n;return[n-(e-t),e]},split:function(t){const n=134217729*t,e=n-(n-t);return[e,t-e]},twoDiff:T,twoProduct:Ft,twoSum:pt,reduceSignificand:q,fastExpansionSum:R,eAdd:on,growExpansion:at,eAddDouble:at,expansionProduct:K,eMult:sn,scaleExpansion:Z,eMultDouble1:Z,scaleExpansion2:j,eMultDouble2:cn,eDiv:ht,eLongDivide:Mt,eIntDiv:function(t,n){return Pt(t,n).div},eRem:function(t,n){return Tt(t,n).rem},eCompress:X,eEstimate:H,eDiff:rt,eNegativeOf:tt,eMultBy2:At,eMultByNeg2:zt,eDivBy2:Bt,eSign:y,eCompare:yt,eAbs:Ot,eToBitlength:G,eIntPow:function(t,n){if(0===n)return[1];if(1===n)return t;if(2===n)return Ut(t,t);const e=[];for(let r=0;r<n;r++)e.push(t);return Zt(e)},eCalculate:function(t){let n=[0];for(let e=0;e<t.length;e++){const r=t[e];let o=r[0];for(let t=1;t<r.length;t++){const n=r[t];o=1==n.length?1===o.length?kt(o[0],n[0]):Lt(o,n[0]):1===o.length?Lt(n,o[0]):Vt(n,o)}n=1===o.length?1===n.length?Dt(n[0],o[0]):Xt(n,o[0]):1===n.length?Xt(o,n[0]):qt(n,o)}return n},eSum:mt,eProduct:Rt,eToDd:Wt,parseDouble:z,parseDoubleDetailed:function(t){const n=O(t),[,e,r,o]=n.match(/^(.)(.{11})(.{52})$/),i=0===parseInt(r,2)?"0":"1";return{full:e+r+i+o,sign:e,exponent:r,hidden:i,significand:o}},isBitAligned:function(t,n,e){if(0===t)return!0;const r=L(t),o=k(t)-52+r;return F(t)-52+r>=e&&o<=n-1+e},msbExponent:D,lsbExponent:function(t){if(0===t||!Number.isFinite(t))return NaN;const n=L(t);return F(t)-52+n},bitLength:ot,expBitLength:it,doubleToBinaryString:O,doubleToOctets:C,getHighestSetBit:k,getLowestSetBit:F,exponent:L,significand:B,orient2d:en,isAdjacent:function(t,n){return rn(t,n)||rn(t,2*n)||rn(2*t,n)},isNonOverlappingAll:function(t){for(let n=1;n<t.length;n++)if(rn(t[n-1],t[n]))return!1;return!0},eIsInteger:function(t){t=X(t);for(let n=0;n<t.length;n++)if(t[n]%1!=0)return!1;return!0}};function fn(t){if(4===t.length){const[[n,e],[r,o]]=t;return[3*(r-n),3*(o-e)]}if(3===t.length){const[[n,e],[r,o]]=t;return[2*(r-n),2*(o-e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[r-n,o-e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}function ln(t){if(4===t.length){const[[n,e],[r,o],[i,s]]=t;return[6*(i+n-2*r),6*(s+e-2*o)]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[2*(i+n-2*r),2*(s+e-2*o)]}if(t.length<=2)return[0,0];throw new Error("The given bezier curve must be of order <= 3")}function hn(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[6*(c-n+3*(r-i))],[6*(u-e+3*(o-s))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}const an=.0698;function pn(t,n){const e=function(t,n){const e=t[t.length-2],r=n[0],o=n[1],i=[r[0]-e[0],r[1]-e[1]],s=[o[0]-r[0],o[1]-r[1]],c=function(t,n,e){const r=T(t[0],e[0]),o=T(n[1],e[1]),i=T(t[1],e[1]),s=T(n[0],e[0]),c=sn(r,o),u=sn(i,s);return H(on(c,tt(u)))}(e,r,o);return 0!==c?c:b(i,s)>0?0:function(t,n){const[e,r]=fn(t),[o,i]=ln(t),[s,c]=fn(n),[u,f]=ln(n),l=rt(Ft(e,i),Ft(r,o)),h=rt(Ft(s,f),Ft(c,u)),a=y(l),p=y(h);if(a!==p)return a-p;const d=R(Ft(s,s),Ft(c,c)),g=R(Ft(e,e),Ft(r,r)),v=K(d,d),m=K(v,d),b=K(g,g),x=K(b,g);if(0!==a||0!==p){const t=K(l,l),n=K(h,h),e=y(rt(K(t,m),K(n,x)));if(0!==e)return a>0?e:-e}const[[_],[I]]=hn(t),[[N],[S]]=hn(n),E=rt(Ft(e,I),Ft(r,_)),w=R(Ft(e,o),Ft(r,i)),M=rt(Ft(s,S),Ft(c,N)),P=R(Ft(s,u),Ft(c,f)),T=rt(K(g,E),Z(K(l,w),3)),C=rt(K(d,M),Z(K(h,P),3)),O=y(T),A=y(C);if(a!==p)return O-A;if(0===O&&0===A)return 0;const z=K(T,T),B=K(v,m),Y=K(C,C),F=K(b,x),V=y(rt(K(z,B),K(Y,F)));return O>0?V:-V}(t.slice().reverse(),n)}(t,n),r=e<0,o=e>0,i=t[t.length-2],s=t[t.length-1],c=[s[0]-i[0],s[1]-i[1]],u=n[0],f=n[1],l=[f[0]-u[0],f[1]-u[1]],h=[N(c),N(l)],a=_(h[0],h[1]);let p,d;return b(c,l)>0?(p=a<-an,d=a>+an):(p=r,d=o),{tangents:h,crossTangents:a,isSharp:r,isDull:o,isQuiteSharp:p,isQuiteDull:d}}const dn=P((function(t){return pn(t.ps,t.next.ps)}));function gn(t){return dn(1===t.t?t.curve:t.curve.prev)}function vn(t){return 0===t.t||1===t.t}const mn=P((t=>!!vn(t)&&gn(t).isSharp));function bn(t){const n=t.cp.circle.center,e=t,r=t.nextOnCircle,o=e.cp.pointOnShape,i=r.cp.pointOnShape,s=o.p,c=i.p;let u;if(mn(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=N(M(t.ps,0)),r=[-(f=N(M(n.ps,1)))[0],-f[1]],i=b(e,r),s=Math.sqrt((1+i)/2);u=S(Math.sqrt((1-i)/2),s,r)}else u=s[0]===c[0]&&s[1]===c[1]?d(s,n):x(d(s,c));var f;return[n,I(N(u),n)]}const xn=.01,_n=1e-4;function In(t,n){const e=t.cp.circle.center,r=bn(t),o=n.cp.circle.center,i=bn(n.prevOnCircle),s=a(r,i),c=d(e,o);let u;if(s){const t=d(e,s),n=d(o,s);u=b(t,c)<0||b(n,c)>0}else u=!0;if(!u)return[e,s,o];const f=x(c),l=d(r[0],r[1]),h=d(i[0],i[1]),p=Math.abs(_(c,l))/9,v=Math.abs(_(c,h))/9;if(p>xn||v>xn)return[e,o];if(p>_n||v>_n){const t=g(e,o,1/3),n=g(e,o,2/3),s=I(f,t),c=[n,I(f,n)];return[e,a(r,[t,s]),a(i,c),o]}return[e,o]}function Nn(t){return In(t,t.next)}function Sn(t,n,e,r=void 0,o=void 0,i=void 0,s=void 0){return{cp:t,isHoleClosing:n,isIntersection:e,prev:r,next:o,prevOnCircle:i,nextOnCircle:s}}function En(t){return Nn(t)}const wn=(t,n)=>h(t.cp,n.cp);function Mn(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function Pn(t){if(An(t))return[];const n=[];let e=t;for(;e!==t.prevOnCircle;)An(e)||n.push(e.next),e=e.nextOnCircle;return n}function Tn(t){const n=t,e=[n];let r=t.next;for(;r!==n;)e.push(r),r=r.next;return e}function yn(t,n,e,r,o){const i=Sn(r,t,n);let s,c;return"undefined"!=typeof _debug_&&_debug_.generated.elems.cpNode.push({generated:_debug_.generated,cpNode:i}),o?(s=o,c=s.next):(s=i,c=i),c.prev=i,s.next=i,i.prev=s,i.next=c,e.insert(i),i}function Cn(t,n=!1){const e=t;let r=e;const o=[];do{n?n=!1:o.push(r),r=r.nextOnCircle}while(r!==e);return o}function On(t,n){return Cn(t,!0).indexOf(n)>=0}function An(t){return t===t.next.prevOnCircle}function zn(t){return Cn(t.prevOnCircle,!0).every((t=>An(t)))}function Bn(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function Yn(t){return 0===t.cp.circle.radius}function Fn(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function Vn(t){return function(t){const n=t;if(0===n.cp.circle.radius)return!0;const e=n.nextOnCircle,r=n.cp.pointOnShape.p,o=e.cp.pointOnShape.p;return r[0]===o[0]&&r[1]===o[1]}(t)?1:Fn(t)}function kn(t,n){const e=t.prev,r=t.next;e.next=r,r.prev=e;const o=r.prevOnCircle,i=e.nextOnCircle;o.next=i,i.prev=o,n&&n.remove(t,!1)}function Ln(t){const n=t.cp,e=n.pointOnShape;return{idx:e.curve.idx,t:e.t,order:n.order,order2:n.order2}}function Dn(t){const n=t.cp.pointOnShape.curve;return{...t,isTerminating:An(t),isFullyTerminating:zn(t),isSharp:Yn(t),prongCount:Fn(t),getRealProngCount:Vn(t),ordering:Ln(t),curve:n,loop:n.loop}}function Xn(t){let n=t;if(n===n.next.prevOnCircle)return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function qn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=r-i,c=s-r,u=e-o,f=u-e,l=r-(s-c)+(-i-c)+u,h=s+l,a=e-(u-f)+(-o-f)+(l-(h-s)),p=h+a;return[a-(p-h),p]}const Qn=qn,$n=qn;Number.EPSILON;const Gn=2**27+1;const Hn=134217729,Rn=134217729;function Un(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=r/i,c=i*s,u=Rn*i,f=u-(u-i),l=i-f,h=Rn*s,a=h-(h-s),p=s-a,d=o*s,g=c+d,v=d-(g-c)+(l*p-(c-f*a-l*a-f*p)),m=g+v,b=(r-m+(e-(v-(m-g))))/i,x=s+b;return[b-(x-s),x]}const Zn=134217729,jn=Un,Wn=Number.EPSILON/2,Jn=Wn*Wn,Kn=Number.EPSILON/2,te=function(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,s=i-(i-r),c=r-s,u=Hn*t,f=u-(u-t),l=t-f,h=c*l-(o-s*f-c*f-s*l)+e*t,a=o+h;return[h-(a-o),a]},ne=function(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,s=i-(i-r),c=r-s,u=.5*(e-o-(c*c-(o-s*s-s*c*2))+n)/r;return[u-(r+u-r),r+u]},ee=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}},re=function(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,s=e+(r-(o-i)+(n-i)),c=o+s;return[s-(c-o),c]},oe=function(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=r+i,c=s-r,u=e+o,f=u-e,l=r-(s-c)+(i-c)+u,h=s+l,a=e-(u-f)+(o-f)+(l-(h-s)),p=h+a;return[a-(p-h),p]},ie=qn,se=function(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,s=i-(i-r),c=r-s,u=Hn*t,f=u-(u-t),l=t-f,h=e*t,a=o+h,p=h-(a-o)+(c*l-(o-s*f-c*f-s*l)),d=a+p;return[p-(d-a),d]},ce=function(t){return[2*t[0],2*t[1]]},ue=function(t){return[4*t[0],4*t[1]]},fe=function(t){return[-2*t[0],-2*t[1]]},le=function(t,n){const e=t[1],r=n[1],o=e*r,i=Gn*e,s=i-(i-e),c=e-s,u=Gn*r,f=u-(u-r),l=r-f,h=c*l-(o-s*f-c*f-s*l)+(e*n[0]+t[0]*r),a=o+h;return[h-(a-o),a]},he=Un,ae=function(t){return[-t[0],-t[1]]},pe=function(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]},de=function(t,n){const e=t*n,r=Zn*t,o=r-(r-t),i=t-o,s=Zn*n,c=s-(s-n),u=n-c;return[i*u-(e-o*c-i*c-o*u),e]},ge=function(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]},ve=function(t,n,e,r){const o=t/n,i=Math.abs(t),s=Math.abs(n),c=s-r;return c<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(s*e+i*r)/c**2+Kn*Math.abs(i/s)}},me=le,be=oe,xe=ie,_e=pe,Ie=re;function Ne(t,n){if(0===n[0]&&0===n[1])return t[0].map((t=>[0,t]));if(0===n[0]&&1===n[1])return t[t.length-1].map((t=>[0,t]));if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=Ie(me(_e(o,e),n),e),h=Ie(me(_e(s,o),n),o),a=Ie(me(_e(u,s),n),s),p=be(l,me(xe(h,l),n)),d=be(h,me(xe(a,h),n)),g=be(p,me(xe(d,p),n)),v=Ie(me(_e(i,r),n),r),m=Ie(me(_e(c,i),n),i),b=Ie(me(_e(f,c),n),c),x=be(v,me(xe(m,v),n)),_=be(m,me(xe(b,m),n));return[g,be(x,me(xe(_,x),n))]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=be([0,e],me(_e(o,e),n)),f=be([0,o],me(_e(s,o),n)),l=be(u,me(xe(f,u),n)),h=be([0,r],me(_e(i,r),n)),a=be([0,i],me(_e(c,i),n));return[l,be(h,me(xe(a,h),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Ie(me(_e(o,e),n),e),Ie(me(_e(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}function Se(t,n,e){return{curve:t,t:n,p:Ne(t.ps,[0,n]).map((t=>t[1])),source:e}}const Ee=Number.EPSILON/2,we=Ee*Ee,Me=te,Pe=H,Te=function(t){const n=3*we;return n/(1-n)}(),ye=Z,Ce=pt,Oe=Ft,Ae=Math.abs,ze=Number.EPSILON/2;function Be(t,n){let e=t[0],r=.5*Ae(e);for(let o=1;o<t.length;o++)e=e*n+t[o],r=r*Ae(n)+Ae(e);return r=ze*(2*r-Ae(e)),[e,r]}const Ye=Math.abs,Fe=function(t){const n=t*Ee;return n/(1-n)},Ve=Be,ke=E,Le=Fe(1),De=Fe(2);function Xe(t,n,e=void 0,r=1){const o=Math.abs(n),i=t[0],[s,c]=Ve(i,n),u=De*function(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+Ye(t[r]);return e}(i,o),f=void 0!==e?ke(e,o):0;if((c+u+f)*r<Math.abs(s))return s;const l=function(t,n){const e=[],r=[];let o,i=t[0];for(let s=1;s<t.length;s++){const[c,u]=Oe(i,n);[o,i]=Ce(u,t[s]),e.push(c),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(i,n),{pπ:h,pσ:a}=l;let{r̂:p}=l;const[d,g]=Ve(h,n),[v,m]=Ve(a,n),[b,x]=Ve(t[1],n);let _=g+m+x+f;return p=d+v+b+p,_+=Le*p,_*r<Math.abs(p)?p:0}const qe=R,Qe=Z;function $e(t,n){let e=[0];for(let r=0;r<t.length;r++)e=qe(t[r],Qe(e,n));return e}const Ge=Xe,He=$e,Re=H,Ue=Xe,Ze=$e,je=H,We=Number.EPSILON,Je=Math.abs,Ke=Math.max;function tr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-t[e]);return n}const nr=tr,er=function(t){return n=>1/t(function(t){return t.slice().reverse()}(n))};function rr(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=nr(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=Number.POSITIVE_INFINITY,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const s=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>s&&(n=s),i=!0}i&&r<n&&(r=n)}return r}er(rr);const or=(Ir=rr,t=>-Ir(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2&&(e[t]=-e[t]);return e}(t))),ir=(er(or),function(t){const{p:n,pE:e}=t,r=[],o=[],i=n.length-1;for(let t=0;t<i;t++){const s=i-t,c=Me(s,n[t]);r.push(c);const u=0==(s&s-1)?0:Te,f=Pe(c);o.push(s*e[t]+Math.abs(f)*u)}return{p:r,pE:o}}),sr=Xe,cr=$e,ur=function(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e},fr=function(t,n,e,r){const o=Ge(t,e,n,4);return 0!==o?o:Re(He(r(),e))},lr=function(t,n,e,r,o,i,s,c){let u=e,f=r,l=u,h=o,a=f-u,p=a;for(;;){let d;Je(h)<Je(i)&&(u=f,f=l,l=u,o=i,i=h,h=o);const g=Ke(Je(u),Je(f));d=g<=1?We:We*2**Math.ceil(Math.log2(g));const v=.5*(l-f);if(Je(v)<=d)return f<l?[f,l]:[l,f];if(Je(a)<d||Je(o)<=Je(i))a=v,p=a;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/h;const r=i/h;t=e*(2*v*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=a,a=p,2*t<3*v*n-Je(d*n)&&t<Je(.5*e*n)?p=t/n:(a=v,p=a)}if(u=f,o=i,d<Je(p)?f+=p:0<v?f+=d:f-=d,0===(i=c?je(Ze(s(),f)):Ue(t,f,n))){if(c)return[f,f];const o=Math.max(e,f-d),u=Math.min(r,f+d);if(Ue(t,o,n)*Ue(t,u,n)!=0)return[o,u];if(c=!0,0===(i=je(Ze(s(),f))))return[f,f]}(0<i&&0<h||i<=0&&h<=0)&&(l=u,h=o,a=f-u,p=a)}},hr=or,ar=rr,pr=function(t){const n=[],e=t.length-1;for(let r=0;r<e;r++)n.push(ye(t[r],e-r));return n},dr=H,gr=Be,vr=y,mr=Math.max,br=Math.min,xr=Math.abs,_r=1+Number.EPSILON;var Ir;function Nr(t,n=0,e=1,r,o,i){o||(o=()=>t),r=r||new Array(t.length).fill(0);let s,c,u=0;for(;t.length>0&&xr(t[0][1])<=r[0]&&(c=c||o(),0===vr(c[0]));)(t=t.slice()).shift(),(r=r.slice()).shift(),c.shift();if(0===t.length)return i?void 0:[];if(1===t.length)return[];if(n===Number.NEGATIVE_INFINITY||e===Number.POSITIVE_INFINITY){const r=t.map((t=>t[1]));n===Number.NEGATIVE_INFINITY&&(n=hr(r)),e===Number.POSITIVE_INFINITY&&(e=ar(r))}const f=ur(t);let l,h;const a=t.length-1;let p,d;l=0,h=!1;do{if(p=h?dr(cr(_(),n)):sr(f,n,r),0===p){if(l++,l>=3&&!h){h=!0;continue}n-=2*Number.EPSILON*mr(1,xr(n))}}while(0===p);l=0,h=!1;do{if(d=h?dr(cr(_(),e)):sr(f,e,r),0===d){if(l++,l>=3&&!h){h=!0;continue}e+=2*Number.EPSILON*mr(1,xr(e))}}while(0===d);const g=[{p:t,pE:r}],v=[ur(t)];for(let t=1;t<=a;t++){const n=ir(g[t-1]);g.push(n),v.push(ur(n.p))}let m,b,x=[];for(u=a-1;u>=0;u--)m=g[u].pE,b=v[u],x=I();function _(){if(void 0!==s)return s[u];let t=c||o();for(s=[t];t.length>1;)t=pr(t),s.push(t);return s[u]}return x;function I(){const t=[],r=fr(b,m,n,_);if(!x.length){const t=fr(b,m,e,_);if(r*t>=0)return[];const[o,i]=lr(b,m,n,e,r,t,_);return[{tS:o,tE:i,multiplicity:1}]}let o=x[0].tS,i=fr(b,m,o,_);if(r*i>0);else if(r*i<0){const[e,s]=lr(b,m,n,o,r,i,_);t.push({tS:e,tE:s,multiplicity:1})}let s,c=n,f=r,l=o,h=i;for(let n=0;n<x.length;n++){const r=x[n+1];s=x[n],o=l,c=x[n].tE,l=r?r.tS:e;const u=f;if(i=h,f=fr(b,m,c,_),h=fr(b,m,l,_),i*f>0)if(f*h>0)c!==o&&s.multiplicity%2==1&&p();else if(f*h<0){c!==o&&s.multiplicity%2==1&&p();const[n,e]=lr(b,m,c,l,f,h,_);t.push({tS:n,tE:e,multiplicity:1})}else c!==o&&s.multiplicity%2==1&&p();else if(i*f<0){if(t.push({tS:s.tS,tE:s.tE,multiplicity:3}),f*h<0){const[n,e]=lr(b,m,c,l,f,h,_);t.push({tS:n,tE:e,multiplicity:1})}}else if(0===f)0===i?t.push({tS:s.tS,tE:s.tE,multiplicity:s.multiplicity+1}):i*h>0?t.push({tS:s.tS,tE:s.tE,multiplicity:2}):t.push({tS:s.tS,tE:s.tE,multiplicity:3});else{if(f*h<0){const[n,e]=lr(b,m,c,l,f,h,_);t.push({tS:n,tE:e,multiplicity:1})}u*f>0?t.push({tS:s.tS,tE:s.tE,multiplicity:2}):t.push({tS:s.tS,tE:s.tE,multiplicity:3})}}for(let n=0;n<t.length-1;n++){const e=t[n],r=t[n+1];if(e.tE>=r.tS)return Sr(t)}return t;function p(){const n=(c-o)*_r;let e=1,r=0;for(let t=u+2;t<=a;t++){const i=v[t][0],s=gr(i,o);r+=(xr(s[0])+s[1])*e,e*=n*_r}const l=f>0?br(i,f):mr(i,f),h=2*Number.EPSILON*mr(1,xr(c)),p=r*(2*h);(l+(f>0?2*-p*h:2*p*h))*f<0&&t.push({tS:s.tS,tE:s.tE,multiplicity:2})}}}function Sr(t){const n=[],e=t[0];let r={tS:e.tS,tE:e.tE,multiplicity:e.multiplicity};for(let e=0;e<t.length-1;e++){const o=t[e],i=t[e+1];o.tE<i.tS?(n.push(r),r={tS:i.tS,tE:i.tE,multiplicity:i.multiplicity}):(r.tE=i.tE,r.multiplicity=o.multiplicity+i.multiplicity)}return n.push(r),n}function Er(t,n=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY,r){return Nr(t.map((t=>[0,t])),n,e,void 0,void 0,r)}function wr(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[3*(c-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-s)),6*(s+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(s+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function Mr(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=e+(o-e)*n,h=o+(s-o)*n,a=l+(h-l)*n,p=r+(i-r)*n,d=i+(c-i)*n,g=p+(d-p)*n;return[a+(h+(s+(u-s)*n-h)*n-a)*n,g+(d+(c+(f-c)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(s-o)*n-u)*n,f+(i+(c-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const Pr=Math.abs;function Tr(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pr(n[1]);if(4===t.length){const[[n,r],[o,i],[s,c],[u,f]]=t,l=Pr(n),h=Pr(r),a=Pr(o),p=Pr(i),d=Pr(s),g=Pr(c),v=l+(a+l)*e,m=a+(d+a)*e,b=v+(m+v)*e,x=h+(p+h)*e,_=p+(g+p)*e,I=x+(_+x)*e;return[b+(m+(d+(Pr(u)+d)*e+m)*e+b)*e,I+(_+(g+(Pr(f)+g)*e+_)*e+I)*e]}if(3===t.length){const[[n,r],[o,i],[s,c]]=t,u=Pr(n),f=Pr(r),l=Pr(o),h=Pr(i),a=u+(l+u)*e,p=f+(h+f)*e;return[a+(l+(Pr(s)+l)*e+a)*e,p+(h+(Pr(c)+h)*e+p)*e]}if(2===t.length){const[[n,r],[o,i]]=t,s=Pr(n),c=Pr(r);return[s+(Pr(o)+s)*e,c+(Pr(i)+c)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const yr=Number.EPSILON/2,Cr=yr*yr;function Or(t){const n=t*yr;return n/(1-n)}function Ar(t){const n=t*Cr;return n/(1-n)}Or(1),Ar(3);const zr=Math.abs,Br=[[0,0],[0,0],[0,0],[0,0]];const Yr=Math.abs,Fr=[[0,0],[0,0],[0,0]];const Vr=Math.abs,kr=[[0,0],[0,0]];const Lr=Number.EPSILON/2,Dr=Or(1);function Xr(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Br}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-a))))),b=c-n*(c-f),x=f-n*(f-h),_=b-n*(b-x),I=_-n*(_-(x-n*(x-(h-n*(h-p))))),N=zr(n),S=zr(s),E=zr(u),w=zr(l),M=zr(a),P=zr(c),T=zr(f),y=zr(h),C=S+N*(S+E),O=E+N*(E+w),A=C+N*(C+O),z=P+N*(P+T),B=T+N*(T+y),Y=z+N*(z+B);return{ps:[[s,c],[d,b],[v,_],[m,I]],_ps:[[0,0],[C,z],[A,Y],[A+N*(A+(O+N*(O+(w+N*(w+M))))),Y+N*(Y+(B+N*(B+(y+N*(y+zr(p))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=m-n*(m-b),_=c-n*(c-f),I=f-n*(f-h),N=h-n*(h-p),S=_-n*(_-I),E=I-n*(I-N),w=S-n*(S-E),M=zr(n),P=zr(s),T=zr(u),y=zr(l),C=zr(a),O=zr(c),A=zr(f),z=zr(h),B=P+M*(P+T),Y=T+M*(T+y),F=y+M*(y+C),V=B+M*(B+Y),k=Y+M*(Y+F),L=O+M*(O+A),D=A+M*(A+z),X=z+M*(z+zr(p)),q=L+M*(L+D),Q=D+M*(D+X);return{ps:[[x,w],[b,E],[v,N],[a,p]],_ps:[[V+M*(V+k),q+M*(q+Q)],[k,Q],[F,X],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=s[0]-c,I=b+x,N=n*b,S=e*b,E=_-3*x,w=u-l,M=a-l,P=s[1]-u,T=w+M,y=n*w,C=e*w,O=P-3*M,A=d*E+(3*n*(n*I-b)+c),z=m*(n*E+2*I)+(p*I+c-(S+2*N)),B=m*(e*E+2*I)+(g*I+c-(2*S+N)),Y=v*E+(3*e*(e*I-b)+c),F=d*O+(3*n*(n*T-w)+u),V=m*(n*O+2*T)+(p*T+u-(C+2*y)),k=m*(e*O+2*T)+(g*T+u-(2*C+y)),L=v*O+(3*e*(e*T-w)+u),D=zr(n),X=zr(e),q=zr(m),Q=zr(d),$=zr(v),G=zr(c),H=zr(f),R=G+H,U=zr(h)+H,Z=R+U,j=D*R,W=X*R,J=zr(_)+3*U,K=zr(u),tt=zr(l),nt=K+tt,et=zr(a)+tt,rt=nt+et,ot=D*nt,it=X*nt,st=zr(P)+3*et;return{ps:[[A,F],[z,V],[B,k],[Y,L]],_ps:[[Q*J+(3*D*(D*Z+R)+G),Q*st+(3*D*(D*rt+nt)+K)],[q*(D*J+2*Z)+(p*Z+G+(W+2*j)),q*(D*st+2*rt)+(p*rt+K+(it+2*ot))],[q*(X*J+2*Z)+(g*Z+G+(2*W+j)),q*(X*st+2*rt)+(g*rt+K+(2*it+ot))],[$*J+(3*X*(X*Z+R)+G),$*st+(3*X*(X*rt+nt)+K)]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=e[3][0],u=9*Lr*r[0][0],f=9*Lr*r[1][0],l=9*Lr*r[2][0],h=9*Lr*r[3][0],a=e[0][1],p=e[1][1],d=e[2][1],g=e[3][1],v=9*Lr*r[0][1],m=9*Lr*r[1][1],b=9*Lr*r[2][1],x=9*Lr*r[3][1],_=Math.min(o-u,i-f,s-l,c-h),I=Math.max(o+u,i+f,s+l,c+h);return[[_,Math.min(a-v,p-m,d-b,g-x)],[I,Math.max(a+v,p+m,d+b,g+x)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Fr}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=s-u,d=[[i,s],[-n*a+i,-n*p+s],[h*(a+(f-c))-(2*n*a-i),h*(p+(l-u))-(2*n*p-s)]],g=Yr(n),v=Yr(i),m=Yr(c),b=Yr(f),x=v+m,_=Yr(s),I=Yr(u),N=_+I;return{ps:d,_ps:[[0,0],[g*x+v,g*N+_],[h*(x+(b+m))+(2*g*x+v),h*(N+(Yr(l)+I))+(2*g*N+_)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u,v=[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]],m=Yr(n),b=Yr(i),x=Yr(c),_=b+x,I=Yr(f)+x,N=Yr(s),S=Yr(u),E=N+S;return{ps:v,_ps:[[h*(_+I)+(2*m*_+b),h*(E+(Yr(l)+S))+(2*m*E+N)],[m*I+x,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=i[0],h=i[1],a=n*n,p=e*e,d=n*e,g=s-u,v=g+(l-u),m=c-f,b=m+(h-f),x=a*v-(2*n*g-s),_=d*v-(g*(e+n)-s),I=p*v-(2*e*g-s),N=a*b-(2*n*m-c),S=d*b-(m*(e+n)-c),E=p*b-(2*e*m-c),w=Yr(n),M=Yr(e),P=Yr(d),T=Yr(s),y=Yr(u),C=T+y,O=C+Yr(l)+y,A=Yr(c),z=Yr(f),B=A+z,Y=B+Yr(h)+z;return{ps:[[x,N],[_,S],[I,E]],_ps:[[a*O+(2*w*C+T),a*Y+(2*w*B+A)],[P*O+(C*(M+w)+T),P*b+(B*(M+w)+A)],[p*O+(2*M*C+T),p*Y+(2*M*B+A)]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=5*Lr*r[0][0],u=5*Lr*r[1][0],f=5*Lr*r[2][0],l=e[0][1],h=e[1][1],a=e[2][1],p=5*Lr*r[0][1],d=5*Lr*r[1][1],g=5*Lr*r[2][1],v=Math.min(o-c,i-u,s-f),m=Math.max(o+c,i+u,s+f);return[[v,Math.min(l-p,h-d,a-g)],[m,Math.max(l+p,h+d,a+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:kr}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[o,i],[n*(s-o)+o,n*(c-i)+i]],f=Vr(n),l=Vr(o),h=Vr(s),a=Vr(i);return{ps:u,_ps:[[0,0],[f*(h+l)+l,f*(Vr(c)+a)+a]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[n*(s-o)+o,n*(c-i)+i],[s,c]],f=Vr(n),l=Vr(o),h=Vr(s),a=Vr(i);return{ps:u,_ps:[[f*(h+l)+l,f*(Vr(c)+a)+a],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1],f=[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]],l=Vr(n),h=Vr(e),a=Vr(i),p=Vr(c),d=Vr(s),g=Vr(u);return{ps:f,_ps:[[l*(p+a)+a,l*(g+d)+d],[h*(p+a)+a,h*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=3*Lr*r[0][0],c=3*Lr*r[1][0],u=e[0][1],f=e[1][1],l=3*Lr*r[0][1],h=3*Lr*r[1][1],a=Math.min(o-s,i-c),p=Math.max(o+s,i+c);return[[a,Math.min(u-l,f-h)],[p,Math.max(u+l,f+h)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Mr(t,n);let i;if(4===t.length)i=Tr(t,[0,n]).map((t=>8*Dr*t));else if(3===t.length)i=Tr(t,[0,n]).map((t=>5*Dr*t));else if(2===t.length)i=Tr(t,[0,n]).map((t=>2*Dr*t));else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function qr(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=wr(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=Xr(t,i);c[0][1]<r.box[0][1]&&(r={ts:i,box:c}),c[1][1]>o.box[0][1]&&(o={ts:i,box:c})}return{minY:r,maxY:o}}function Qr(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=wr(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=Xr(t,i);c[0][0]<r.box[0][0]&&(r={ts:i,box:c}),c[1][0]>o.box[0][0]&&(o={ts:i,box:c})}return{minX:r,maxX:o}}(t),e=qr(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}function $r(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Gr(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,s;const c=function(t){let n=0;for(let e=0;e<t.length-1;e++)n+=$r(t[e],t[e+1]);return n}(t);if(256*p(t[0],t[t.length-1])<c*c){const[r,o]=Mr(t,.5),c=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/c,s=(r-n)/c}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,s=(r-n)/t}const u=function(t,n,e){const r=I(t[0].map((t=>-t)));return Qr(t.map((t=>S(-n,e,r(t)))))}(t,i,s),[[f,l],[h,a]]=u,d=[u[0],[h,l],u[1],[f,a]],g=S(i,s);return d.map((n=>I(t[0],g(n))))}function Hr(t,n,e){if(n===e)return;const r=t[n];t[n]=t[e],t[e]=r}function Rr(t,n=!1){if(!t.length)return;function e(t,e,r){const o=en(t,e,r);return n?o<0:o<=0}const r=t.slice(),o=r.length,i=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(r),[s]=r.splice(i,1);r.sort(((t,n)=>{let e=-en(s,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])})),r.unshift(s);let c=1;for(let t=2;t<o;t++){for(;e(r[c-1],r[c],r[t]);)if(c>1)c-=1;else{if(t===o-1){c-=1;break}t+=1}c+=1,Hr(r,c,t)}return r.slice(0,c+1)}const Ur=Rr,Zr=pe,jr=oe,Wr=te,Jr=le,Kr=ce,to=ue,no=ie,eo=pe,ro=oe,oo=te,io=le,so=ce,co=ie,uo=ue,fo=de,lo=oe,ho=fe,ao=ie,po=T,go=sn,vo=j,mo=At,bo=zt,xo=on,_o=rt,Io=T,No=sn,So=j,Eo=At,wo=on,Mo=rt;function Po(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const To=T,yo=sn,Co=zt,Oo=on,Ao=rt,zo=Math.abs;function Bo(t){return(t.tS+t.tE)/2}function Yo(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Fo=H,Vo=T,ko=sn,Lo=on,Do=Number.EPSILON,{sqrt:Xo}=Math,qo=Ar(6);function Qo(t,n){const e=t.length-1;let r;if(3===e)r=Nr(function(t,n){const e=t[0],r=t[1],o=t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[3],s=zo(e[0]),c=zo(e[1]),u=zo(r[0]),f=zo(r[1]),l=zo(o[0]),h=zo(o[1]),a=zo(i[0]),p=zo(i[1]),d=zo(n[0]),g=zo(n[1]),v=s+d,m=u+d,b=l+d,x=a+d,_=c+g,I=f+g,N=h+g,S=p+g,E=v*v,w=6*v*m,M=6*b*x,P=_*_,T=6*_*I,y=6*N*S,C=6*m*x+9*b*b,O=2*v*x+18*m*b,A=6*v*b+9*m*m,z=6*I*S+9*N*N,B=2*_*S+18*I*N,Y=6*_*N+9*I*I;return[6*(x*x+M+(E+w)+C+(A+O)+(S*S+y+(P+T)+z+(Y+B))),5*(M+5*w+3*O+2*(C+2*A+3*E)+(y+5*T+3*B+2*(z+2*Y+3*P))),4*(C+3*(O+2*A)+5*(2*w+3*E)+(z+3*(B+2*Y)+5*(2*T+3*P))),3*(O+2*(2*A+5*(w+2*E))+(B+2*(2*Y+5*(T+2*P)))),2*(A+5*(w+3*E)+(Y+5*(T+3*P))),w+6*E+(T+6*P)]}(t,n).map((t=>10*qo*t)),(()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],[d,g]=n,v=po(s,d),m=po(u,d),b=po(l,d),x=po(a,d),_=po(c,g),I=po(f,g),N=po(h,g),S=po(p,g),E=go(v,v),w=vo(6,go(v,m)),M=vo(6,go(v,b)),P=mo(go(v,x)),T=vo(9,go(m,m)),y=vo(18,go(m,b)),C=vo(6,go(m,x)),O=vo(9,go(b,b)),A=vo(6,go(b,x)),z=go(x,x),B=go(_,_),Y=vo(6,go(_,I)),F=vo(6,go(_,N)),V=mo(go(_,S)),k=vo(9,go(I,I)),L=vo(18,go(I,N)),D=vo(6,go(I,S)),X=vo(9,go(N,N)),q=vo(6,go(N,S)),Q=go(S,S),$=xo(C,O),G=xo(P,y),H=xo(M,T),R=xo(D,X),U=xo(V,L),Z=xo(F,k),j=_o(xo(xo(z,E),xo($,H)),xo(xo(G,A),w)),W=_o(xo(xo(Q,B),xo(R,Z)),xo(xo(U,q),Y)),J=vo(6,xo(j,W)),K=xo(bo(xo(xo($,mo(H)),vo(3,E))),xo(xo(A,vo(3,G)),vo(5,w))),tt=xo(bo(xo(xo(R,mo(Z)),vo(3,B))),xo(xo(q,vo(3,U)),vo(5,Y))),nt=vo(5,xo(K,tt)),et=xo(xo($,vo(3,_o(mo(H),G))),vo(5,_o(vo(3,E),mo(w)))),rt=xo(xo(R,vo(3,_o(mo(Z),U))),vo(5,_o(vo(3,B),mo(Y)))),ot=vo(4,xo(et,rt)),it=_o(G,mo(_o(mo(H),vo(5,_o(w,mo(E)))))),st=_o(U,mo(_o(mo(Z),vo(5,_o(Y,mo(B)))))),ct=vo(3,xo(it,st)),ut=_o(H,vo(5,_o(w,vo(3,E)))),ft=_o(Z,vo(5,_o(Y,vo(3,B)))),lt=mo(xo(ut,ft)),ht=_o(w,vo(6,E)),at=_o(Y,vo(6,B));return[J,nt,ot,ct,lt,xo(ht,at)]}(t,n)));else if(2===e)r=Nr(function(t,n){const[[e,r],[o,i],[s,c]]=t,[u,f]=n,l=eo(e,u),h=eo(o,u),a=eo(s,u),p=eo(r,f),d=eo(i,f),g=eo(c,f),v=io(l,l),m=io(l,h),b=io(l,a),x=io(h,h),_=io(h,a),I=io(a,a),N=io(p,p),S=io(p,d),E=io(p,g),w=io(d,d),M=io(d,g),P=io(g,g),T=ro(E,so(w)),y=ro(b,so(x));return[ro(co(ro(ro(P,N),so(T)),uo(ro(M,S))),co(ro(ro(I,v),so(y)),uo(ro(_,m)))),oo(3,ro(ro(co(M,T),co(oo(3,S),N)),ro(co(_,y),co(oo(3,m),v)))),ro(co(T,oo(3,co(so(S),N))),co(y,oo(3,co(so(m),v)))),ro(co(S,N),co(m,v))]}(t,n),0,1,function(t,n){const e=t[0],r=t[1],o=t[2],i=zo(e[0]),s=zo(e[1]),c=zo(r[0]),u=zo(r[1]),f=zo(o[0]),l=zo(o[1]),h=zo(n[0]),a=zo(n[1]),p=i+h,d=c+h,g=f+h,v=s+a,m=u+a,b=l+a,x=p*p,_=p*d,I=d*g,N=v*v,S=v*m,E=m*b,w=v*b+m*m*2,M=p*g+d*d*2;return[b*b+N+2*w+4*(E+S)+(g*g+x+2*M+4*(I+_)),3*(E+w+(3*S+N)+(I+M+(3*_+x))),w+3*(2*S+N)+(M+3*(2*_+x)),S+N+(_+x)]}(t,n).map((t=>8*qo*t)),(()=>function(t,n){const[[e,r],[o,i],[s,c]]=t,[u,f]=n,l=Io(e,u),h=Io(o,u),a=Io(s,u),p=Io(r,f),d=Io(i,f),g=Io(c,f),v=No(l,l),m=No(l,h),b=No(l,a),x=No(h,h),_=No(h,a),I=No(a,a),N=No(p,p),S=No(p,d),E=No(p,g),w=No(d,d),M=No(d,g),P=No(g,g),T=wo(E,Eo(w)),y=wo(b,Eo(x)),C=wo(Mo(wo(I,Eo(y)),Po(wo(_,m))),v),O=wo(Mo(wo(P,Eo(T)),Po(wo(M,S))),N),A=wo(C,O),z=wo(Mo(_,y),Mo(So(3,m),v)),B=wo(Mo(M,T),Mo(So(3,S),N)),Y=So(3,wo(z,B)),F=Mo(T,So(3,Mo(Eo(S),N))),V=Mo(y,So(3,Mo(Eo(m),v))),k=wo(F,V),L=Mo(S,N),D=Mo(m,v);return[A,Y,k,wo(L,D)]}(t,n)));else{if(1!==e){if(0===e)return[];throw new Error("The given bezier curve must be of order <= 3")}r=Nr(function(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=e-s,f=o-s,l=r-c,h=i-c,a=fo(u,u),p=fo(u,f),d=fo(f,f),g=fo(l,l),v=fo(l,h),m=fo(h,h),b=lo(p,v),x=lo(g,a);return[lo(lo(d,m),lo(x,ho(b))),ao(b,x)]}(t,n),0,1,function(t,n){const e=t[0],r=t[1],o=zo(e[0]),i=zo(e[1]),s=zo(r[0]),c=zo(r[1]),u=zo(n[0]),f=zo(n[1]),l=o+u,h=s+u,a=i+f,p=c+f,d=l*h+a*p,g=a*a+l*l;return[h*h+p*p+2*d+g,d+g]}(t,n).map((t=>6*qo*t)),(()=>function(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=To(e,s),f=To(o,s),l=To(r,c),h=To(i,c),a=yo(u,u),p=yo(u,f),d=yo(f,f),g=yo(l,l),v=yo(l,h),m=yo(h,h),b=Oo(p,v),x=Oo(g,a);return[Oo(Oo(d,m),Oo(Co(b),x)),Ao(b,x)]}(t,n)))}r.push({tS:0,tE:0,multiplicity:1}),r.push({tS:1,tE:1,multiplicity:1});const o=r.map((e=>{const r=Xr(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,c],[s,i],[s,c]]){const e=Vo(t,u),r=Vo(n,f),o=Lo(ko(e,e),ko(r,r)),i=Fo(o),s=i*(1-Do),c=i*(1+Do);s<=l&&(l=s),c>=h&&(h=c)}return[l,h]}(r,n);return{p:Yo(r),t:Bo(e),d:(Xo(o[0])+Xo(o[1]))/2,dSquaredI:o,box:r,ri:e}}));let i=Number.POSITIVE_INFINITY;for(let t=0;t<o.length;t++){const n=o[t].dSquaredI[1];n<i&&(i=n)}const s=[];for(let t=0;t<o.length;t++){const n=o[t];n.dSquaredI[0]<=i&&s.push(n)}return s}const $o=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=s-n*(s-u),p=u-n*(u-l),d=a-n*(a-p),g=c-n*(c-f),v=f-n*(f-h),m=g-n*(g-v);return[[s,c],[a,g],[d,m],[d-n*(d-(p-n*(p-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(h-n*(h-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=c-n*(c-f),_=f-n*(f-h),I=h-n*(h-p),N=x-n*(x-_),S=_-n*(_-I);return[[m-n*(m-b),N-n*(N-S)],[b,S],[v,I],[a,p]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=b+x,I=n*b,N=e*b,S=s[0]-c-3*x,E=u-l,w=a-l,M=E+w,P=n*E,T=e*E,y=s[1]-u-3*w;return[[d*S+(3*n*(n*_-b)+c),d*y+(3*n*(n*M-E)+u)],[m*(n*S+2*_)+(p*_+c-(N+2*I)),m*(n*y+2*M)+(p*M+u-(T+2*P))],[m*(e*S+2*_)+(g*_+c-(2*N+I)),m*(e*y+2*M)+(g*M+u-(2*T+P))],[v*S+(3*e*(e*_-b)+c),v*y+(3*e*(e*M-E)+u)]]}(t,n,e)},Go=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=n*n,l=i-c,h=s-u;return[[i,s],[-n*l+i,-n*h+s],[f*(l+(o[0]-c))-(2*n*l-i),f*(h+(o[1]-u))-(2*n*h-s)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u;return[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=n*n,h=e*e,a=n*e,p=s-u,d=p+(i[0]-u),g=c-f,v=g+(i[1]-f);return[[l*d-(2*n*p-s),l*v-(2*n*g-c)],[a*d-(p*(e+n)-s),a*v-(g*(e+n)-c)],[h*d-(2*e*p-s),h*v-(2*e*g-c)]]}(t,n,e)},Ho=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[o,i],[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1];return[[n*(s-o)+o,n*(c-i)+i],[s,c]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1];return[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]]}(t,n,e)};function Ro(t,n,e){if(4===t.length)return $o(t,n,e);if(3===t.length)return Go(t,n,e);if(2===t.length)return Ho(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function Uo(t,n){const e=n.xs;return e.length<=2&&7!==e[0].x.kind}function Zo(t,n,e,r,o){const i=function(t,n,e){return(r,o,i)=>{n.has(r)||r.orientation||(r.orientation=o*t.orientation,r.parent=i,r.windingNum=i.windingNum+r.orientation,e.push(r))}}(e,o,r);let s,c,u=0,f=1,l=n;for(;l=1===e.orientation?l.nextAround:l.prevAround,l!==n;)u=f,f-=l.dir,-1!==l.dir&&(c?1===u&&0===f?i(l,1,e.parent):0===u&&-1===f&&i(l,-1,e.parent):0===f?c=l:1===f&&i(l,1,e));return Uo(0,n.container)||(s=[n.p,c.p]),{out_:c,additionalBezier:s}}function jo(t,n){const e=n.next,r=e._x_.curve,o=e._x_.x.ri.tS;let i=n._x_.curve,s=n._x_.x.ri.tS;Uo(0,n.container)||(s=Bo(Qo(i.ps,n.p)[0].ri));const c=[];let u;for(;;){if(i===r&&(s<o||s===o&&c.length))return u=Ro(i.ps,s,o),{beziers:c,in_:e,inBez:u};{const t=Ro(i.ps,s,1);c.push(t)}s=0,i=i.next}}function Wo(t,n,e){const r=[],o=[];let i,s=e;do{n.add(s);const{beziers:t,in_:c,inBez:u}=jo(0,s);if(o.push(...t),({out_:s,additionalBezier:i}=Zo(0,c,e,r,n)),i){const t=Ro(u,0,Bo(Qo(u,i[0])[0].ri));o.push(t),o.push(i)}else o.push(u)}while(s!==e);return{beziers:o,additionalOutsToCheck:r}}function Jo(t,n,e,r){const o=[n];for(;o.length;){const t=o.pop();if(e.add(t._x_.curve.loop),r.has(t))continue;t.children=new Set;const{beziers:n,additionalOutsToCheck:i}=Wo(0,r,t);t.beziers=n,t.parent.children=t.parent.children||new Set,t.parent.children.add(t),o.push(...i)}}function Ko(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const ti=Ko;function ni(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let s=0;s<e+1;s++)for(let c=0;c<r+1;c++)i[o-(s+c)]+=t[e-s]*n[r-c];return ti(i)}const ei=ni;function ri(t){let n=[1];for(let e=0;e<t.length;e++)n=ei(n,[1,-t[e]]);return n}const oi=123456789,ii=4294967296;function si(t){return function(n,e,r,o,i=oi,s=0){const c=[];for(let u=0;u<n;u++){const n=t(e,r,o,i,s),u=n.p;i=n.seed,c.push(u)}return c}}function ci(t){return(134775813*t+1)%ii}function ui(t,n,e,r,o=0){let i=[];for(let s=0;s<t;s++)r=fi(r=ci(r),i,r/ii*(e-n)+n,o);return i=i.slice(0,t),{vs:i,seed:r}}function fi(t,n,e,r){return t=ci(t),n.push(e),t/ii<r&&(t=fi(t,n,e,r)),t}function li(t,n=-1,e=1,r=oi){const o=ui(t,n,e,r);return r=o.seed,{p:o.vs,seed:r}}function hi(t){const n=[],e=t.length-1;for(let r=0;r<e;r++)n.push((e-r)*t[r]);return n}si((function(t,n=0,e=1,r=oi,o=0){const i=ui(t,n,e,r,o);return r=i.seed,{p:ri(i.vs),seed:r}})),si(li);const ai=E,pi=Number.EPSILON/2,di=Math.abs,gi=Math.max,vi=hi,mi=E,bi=function(t,n,e,r=ai(t,n),o=ai(t,e)){let i=n,s=e,c=i,u=r,f=s-i,l=f;for(;;){di(u)<di(o)&&(i=s,s=c,c=i,r=o,o=u,u=r);const n=2*pi*gi(1,di(i),di(s)),e=.5*(c-s);if(di(e)<=n)return s;if(di(f)<n||di(r)<=di(o))f=e,l=f;else{let t,h,a=o/r;if(i===c)t=2*e*a,h=1-a;else{h=r/u;const n=o/u;t=a*(2*e*h*(h-n)-(s-i)*(n-1)),h=(h-1)*(n-1)*(a-1)}0<t?h=-h:t=-t,a=f,f=l,2*t<3*e*h-di(n*h)&&t<di(.5*a*h)?l=t/h:(f=e,l=f)}if(i=s,r=o,n<di(l)?s+=l:0<e?s+=n:s-=n,0===(o=ai(t,s)))return s;o*u>0&&(c=i,u=r,f=s-i,l=f)}},xi=or,_i=rr,Ii=Ko;function Ni(t,n=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY){t=Ii(t);let r=0;for(;0===t[t.length-1];)t=t.slice(0,-1),r++;if(t.length<=1){const t=[];for(let n=0;n<r;n++)t.push(0);return t}n===Number.NEGATIVE_INFINITY&&(n=xi(t)),e===Number.POSITIVE_INFINITY&&(e=_i(t));const o=[t];for(let n=1;n<=t.length-1;n++)o.push(vi(o[n-1]));let i=[];for(let r=t.length-2;r>=0;r--){const t=o[r],s=[];let c=n,u=mi(t,c);0===u&&0===r&&s.push(n);for(let n=0;n<i.length;n++){const e=i[n],r=mi(t,e);0===r?s.push(e):u*r<0&&s.push(bi(t,c,e,u,r)),c=e,u=r}const f=mi(t,e);u*f<0&&s.push(bi(t,c,e,u,f)),0===f&&0===r&&s.push(e),i=s}if(r>0&&n<=0&&e>=0){const t=[];let n=!1;for(let e=0;e<i.length;e++){if(!n&&i[e]>=0){for(let n=0;n<r;n++)t.push(0);n=!0}t.push(i[e])}return t}return i}function Si(t){if(4===t.length)return Ei(t);if(3===t.length)return wi(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function Ei(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[c-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-s),3*(s+e-2*o),3*(o-e),e]]}function wi(t){const[[n,e],[r,o],[i,s]]=t;return[[i+n-2*r,2*(r-n),n],[s+e-2*o,2*(o-e),e]]}function Mi(t,n){const[e,r]=wr(t);return[E(e,n),E(r,n)]}const Pi=P(Qr),Ti=P((function(t){const n=wr(t),e=Ni(n[0],0,1),r=Ni(n[1],0,1);e.push(0,1),r.push(0,1);let o,i,s,c,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[s]=Mr(t,r);s<u&&(u=s,o=r),s>f&&(f=s,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Mr(t,e);o<l&&(l=o,s=e),o>h&&(h=o,c=e)}return{ts:[[o,s],[i,c]],box:[[u,l],[f,h]]}})),yi=1e-6;function Ci(t){const n=t.map((t=>Ti(t)));return{minX:Math.min(...n.map((t=>t.box[0][0]))),maxX:Math.max(...n.map((t=>t.box[1][0]))),minY:Math.min(...n.map((t=>t.box[0][1]))),maxY:Math.max(...n.map((t=>t.box[1][1])))}}function Oi(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0,r=1231;do{e++;const i=li(1,0,1,r),s=i.p[0];r=i.seed;const c=li(1,0,t.length,r),u=Math.floor(c.p[0]);r=c.seed;const f=o(t,n,Mr(t[u],s));if(void 0!==f)return f}while(e<100);return;function o(t,n,e){if(function(t,n){const e=[t,n].map(Ci);return e[0].minX<e[1].minX||e[0].maxX>e[1].maxX||e[0].minY<e[1].minY||e[0].maxY>e[1].maxY}(t,n))return!1;const r=function(t,n,e){const[r,o]=n;let i=0;for(let e=0;e<t.length;e++){const s=t[e],[[c,u],[f,l]]=Pi(s);let h=u>o||l<o||!1;if(h=h||c>r||!1,h)continue;const a=[];let p,d,g;const v=!0;p=t=>Si(t)[1],d=[0,-o],g=0;const m=s.map(I(d)),b=Ni(p(m),0-yi,1+yi);for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<yi||Math.abs(e-1)<yi)return;const r=Mr(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&a.push(e)}if(1===a.length||3===a.length)for(const t of a){const n=N(Mi(s,t));if(Math.abs(n[1])<yi)return}i+=a.length}return i}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.beziers)){e=o;for(const t of o.children)r.push(t)}}}function Ai(t,n){return zi(t)-zi(n)}function zi(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=Ti(e).box[0][1];t<n&&(n=t)}return n}function Bi(t){const n=[t],e=Array.from(t.children);for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(t);for(const n of t.children)e.push(n)}return n}function Yi(t,n,e){let[[r,o],[i,s]]=n,[[c,u],[f,l]]=e;o>s&&([o,s]=[s,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),c>f&&([c,f]=[f,c]);const h=t||r===i&&c===f,a=t||o===s&&u===l;return(h?r<=f:r<f)&&(h?i>=c:i>c)&&(a?u<=s:u<s)&&(a?l>=o:l>o)}function Fi(t,n){return Yi(!0,t.box,n.box)}function Vi(t,n){for(let e=0;e<n.length;e++){const r=n[e];ki(t,[r.a,r.b])}}function ki(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Li(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Li(t,i,e,r)}}function Di(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Li(t,o,e,n[n.length-1]))}return n}function Xi(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function qi(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const s=[];for(const n of e){const[[e,c],[u,f]]=n.box;e<t&&(t=e),c<r&&(r=c),u>o&&(o=u),f>i&&(i=f),s.push(...n.xs)}const c={box:[[t,r],[o,i]],xs:s,inOuts:void 0};n.push(c)}return n}function Qi(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}const $i=K,Gi=R,Hi=j,Ri=function(t,n,e){const r=t.length-1;if(r<0)return[];const o=[];for(let t=0;t<r+1;t++)o.push(new Array(r+1).fill([0]));o[0][0]=[1];for(let t=1;t<=r;t++){o[0][t]=Hi(e,o[0][t-1]);for(let r=1;r<=t;r++)o[r][t]=Gi(Hi(e,o[r][t-1]),Hi(n,o[r-1][t-1]))}const i=new Array(r+1).fill([0]);for(let n=0;n<=r;n++){i[r-n]=[0];for(let e=n;e<=r;e++){const s=$i(o[n][e],t[r-e]);i[r-n]=Gi(i[r-n],s)}}return i},Ui=Nr,Zi=Wt,ji=pt,Wi=Number.EPSILON;function Ji(t,n){const e=t.tS,r=t.tE-e;if(0===r)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const o=Ri(n,r,e),i=o.map(Zi),s=i.map((t=>Wi*Wi*t[1])),c=Ui(i,0,1,s,(()=>o)),u=[];for(const t of c)u.push({tS:ji(e,t.tS*r),tE:ji(e,t.tE*r),multiplicity:t.multiplicity});return u}const Ki=pe,ts=te,ns=oe,es=re,rs=Math.abs;function os(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=Ki(c,n),l=Ki(r,i),h=3*(r-i),a=ts(3,l),p=rs(h),d=ns(f,a),g=p+rs(c-n+h),v=Ki(i,2*r),m=es(v,n),b=rs(i-2*r+n),x=ts(3,m),_=6*b,I=Ki(r,n),N=ts(3,I),S=rs(3*(r-n)),E=Ki(u,e),w=Ki(o,s),M=3*(o-s),P=ts(3,w),T=rs(M),y=ns(E,P),C=T+rs(u-e+M),O=Ki(s,2*o),A=es(O,e),z=rs(s-2*o+e),B=ts(3,A),Y=6*z,F=Ki(o,e);return{coeffs:[[d,x,N,[0,n]],[y,B,ts(3,F),[0,e]]],errorBound:[[g,_,S,0],[C,Y,rs(3*(o-e)),0]]}}function is(t){const[[n,e],[r,o],[i,s]]=t,c=i-2*r,u=Ki(i,2*r),f=es(u,n),l=rs(c+n),h=Ki(2*r,2*n),a=s-2*o,p=Ki(s,2*o),d=es(p,e),g=rs(a+e);return{coeffs:[[f,h,[0,n]],[d,Ki(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function ss(t){const[[n,e],[r,o]]=t;return[[Ki(r,n),[0,n]],[Ki(o,e),[0,e]]]}const cs=ie,us=te,fs=tt,ls=Math.abs;function hs(t){const[[n,[,e]],[r,[,o]]]=ss(t),i=fs(r),s=n,c=us(o,n),u=ls(c[1]),f=us(e,r),l=ls(f[1]),h=cs(f,c);return{coeffs:{vₓ:i,vᵧ:s,v:h},errorBound:{v_:u+l+ls(h[1])}}}const as=oe,ps=te,ds=le,gs=Math.abs,vs=Ar(3),ms=ae,bs=ce,xs=te,_s=le,Is=ie,Ns=Math.abs;function Ss(t){const{coeffs:[[n,e,[,r]],[o,i,[,s]]],errorBound:[[c],[u]]}=is(t),f=n[1],l=e[1],h=o[1],a=i[1],p=Ns(r),d=Ns(l),g=Ns(f),v=Ns(s),m=Ns(a),b=Ns(h),x=_s(n,i),_=c*m+2*Ns(f*a),I=_s(e,o),N=d*u+2*Ns(l*h),S=xs(s,n),E=v*c+Ns(s*f),w=xs(r,o),M=p*u+Ns(r*h),P=xs(s,e),T=Ns(s*l),y=xs(r,i),C=Ns(r*a),O=_s(n,n),A=2*(c*g+Ns(f*f)),z=_s(n,o),B=c*b+g*u+2*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yr=Fs(Fn,Zt),Fr=Vs(Br,Yr),Vr=lr*Os(Kt[1])+2*Os(Br[1])+Gn*Os(Zt[1])+2*Os(Yr[1])+Os(Fr[1]),kr=Fs(Qt,Ar),Lr=$t*zr+Sn*$n+Ln+Os(Or[1])+qn+zr+2*Os(kr[1]),Dr=ks(kr,Fr);return{coeffs:{vₓₓₓ:Un,vₓₓᵧ:Kn,vₓᵧᵧ:oe,vᵧᵧᵧ:se,vₓₓ:Se,vₓᵧ:He,vᵧᵧ:ze,vₓ:xr,vᵧ:yr,v:Dr},errorBound:{vₓₓₓ_:Zn,vₓₓᵧ_:te,vₓᵧᵧ_:ie,vᵧᵧᵧ_:ce,vₓₓ_:Ee,vₓᵧ_:Re,vᵧᵧ_:Be,vₓ_:_r,vᵧ_:Cr,v_:Lr+Vr+Os(Dr[1])}}}const Ds=de,Xs=ce,qs=te,Qs=le,$s=oe,Gs=Math.abs,Hs=Ar(3),Rs=oe,Us=te,Zs=le,js=Math.abs,Ws=Ar(3),Js=de,Ks=ce,tc=te,nc=le,ec=oe,rc=Math.abs,oc=Ar(3),ic=de,sc=ce,cc=te,uc=le,fc=oe,lc=Math.abs,hc=Ar(3),ac=oe,pc=te,dc=le,gc=Math.abs,vc=Ar(3),mc=de,bc=ce,xc=te,_c=le,Ic=oe,Nc=Math.abs,Sc=Ar(3),Ec=de,wc=ce,Mc=te,Pc=le,Tc=oe,yc=Math.abs,Cc=Ar(3),Oc=T,Ac=pt,zc=j,Bc=at,Yc=on;function Fc(t){if(4===t.length)return Vc(t);if(3===t.length)return kc(t);if(2===t.length)return Lc(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function Vc(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Yc(Oc(c,n),zc(3,Oc(r,i))),zc(3,Bc(Ac(i,n),-2*r)),zc(3,Oc(r,n)),[n]],[Yc(Oc(u,e),zc(3,Oc(o,s))),zc(3,Bc(Ac(s,e),-2*o)),zc(3,Oc(o,e)),[e]]]}function kc(t){const[[n,e],[r,o],[i,s]]=t;return[[Bc(Ac(i,n),-2*r),Oc(2*r,2*n),[n]],[Bc(Ac(s,e),-2*o),Oc(2*o,2*e),[e]]]}function Lc(t){const[[n,e],[r,o]]=t;return[[Oc(r,n),[n]],[Oc(o,e),[e]]]}const Dc=j,Xc=rt,qc=tt,Qc=y;function $c(t){const[[n,[e]],[r,[o]]]=t;if(0!==Qc(n)||0!==Qc(r))return{vₓ:qc(r),vᵧ:n,v:Xc(Dc(e,r),Dc(o,n))}}const Gc=j,Hc=K,Rc=R;function Uc(t,n){const e=Lc(t),[[r,[o]],[i,[s]]]=Lc(n),{vₓ:c,vᵧ:u,v:f}=$c(e),l=Hc(r,c),h=Hc(i,u),a=Rc(l,h),p=Gc(o,c),d=Gc(s,u),g=Rc(p,d);return[a,Rc(g,f)]}const Zc=j,jc=At,Wc=rt,Jc=K,Kc=tt;function tu(t){const[[n,e,[r]],[o,i,[s]]]=t;if(0===y(n)&&0===y(o))return $c([[e,[r]],[i,[s]]]);const c=Jc(n,i),u=Jc(e,o),f=Zc(s,n),l=Zc(r,o),h=Zc(s,e),a=Zc(r,i),p=Jc(n,n),d=Jc(n,o),g=Jc(o,o),v=Wc(c,u),m=Wc(f,l),b=Wc(h,a),x=Kc(g),_=jc(d),I=Kc(p),N=Jc(i,v),S=jc(Jc(o,m)),E=Wc(N,S),w=jc(Jc(n,m)),M=Jc(e,v),P=Wc(w,M),T=Jc(v,b),C=Jc(m,m);return{vₓₓ:x,vₓᵧ:_,vᵧᵧ:I,vₓ:E,vᵧ:P,v:Wc(T,C)}}const nu=Ft,eu=j,ru=K,ou=R,iu=At,su=y;function cu(t,n){const e=kc(t);if(0===su(e[0][0])&&0===su(e[1][0]))return Uc([t[0],t[2]],n);const[[r,[o]],[i,[s]]]=Lc(n),{vₓₓ:c,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:h,v:a}=tu(e),p=nu(o,o),d=eu(o,r),g=nu(o,s),v=eu(o,i),m=ru(r,r),b=eu(s,r),x=ru(r,i),_=nu(s,s),I=eu(s,i),N=ru(i,i),S=ru(m,c),E=ru(N,f),w=ru(x,u),M=ou(S,E),P=ou(M,w),T=ru(d,c),y=ru(I,f),C=ou(v,b),O=ru(C,u),A=iu(ou(T,y)),z=ou(A,O),B=ru(r,l),Y=ru(i,h),F=ou(B,Y),V=ou(z,F),k=ru(p,c),L=ru(g,u),D=ru(_,f),X=ou(k,L),q=ou(X,D),Q=eu(o,l),$=eu(s,h),G=ou(Q,$),H=ou(q,G);return[P,V,ou(H,a)]}const uu=K,fu=T,lu=rt,hu=y,au=H,pu=Z,du=pt;function gu(t,n=!1){if(!n){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[n,e],[au(lu(pu(du(r/4,i/4),3),du(n/4,c/4))),au(lu(pu(du(o/4,s/4),3),du(e/4,u/4)))],[c,u]]}const[e,r,o,i]=t,s=function(t,n){const[[e,r],[o,i]]=t,[[s,c],[u,f]]=n,l=fu(o,e),h=fu(i,r),a=fu(u,s),p=fu(f,c),d=lu(uu(a,h),uu(p,l));if(0===hu(d))return;const g=fu(s,e),v=fu(c,r),m=lu(uu(v,l),uu(g,h)),b=au(m)/au(d);return[s+b*au(a),c+b*au(p)]}([e,r],[i,o]);if(void 0!==s)return[e,s,i]}const vu=j,mu=K,bu=R,xu=rt,_u=tt,Iu=At,Nu=Bt,Su=y;function Eu(t){const[[n,e,r,[o]],[i,s,c,[u]]]=t;if(0===Su(n)&&0===Su(i))return tu([[e,r,[o]],[s,c,[u]]]);const f=mu(n,c),l=mu(r,i),h=mu(n,s),a=mu(e,s),p=mu(e,i),d=mu(n,n),g=mu(s,s),v=mu(i,i),m=mu(r,n),b=mu(e,e),x=mu(c,i),_=mu(s,i),I=mu(e,n),N=mu(n,i),S=vu(u,n),E=vu(o,i),w=vu(u,e),M=vu(o,s),P=mu(e,c),T=mu(r,s),y=vu(u,r),C=vu(o,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=Bu(b,x);return[d,m,Bu(_,h)]}const Vu=Ft,ku=j,Lu=K,Du=R,Xu=At,qu=y;function Qu(t,n){const e=kc(t);if(0===qu(e[0][0])&&0===qu(e[1][0]))return Fu([t[0],t[2]],n);const[[r,o,[i]],[s,c,[u]]]=kc(n);if(0===qu(r)&&0===qu(s))return cu(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:h,vₓ:a,vᵧ:p,v:d}=tu(e),g=Vu(i,i),v=ku(i,o),m=ku(i,r),b=Vu(i,u),x=ku(i,c),_=ku(i,s),I=Lu(o,o),N=Lu(o,r),S=ku(u,o),E=Lu(o,c),w=Lu(o,s),M=Lu(r,c),P=Lu(r,r),T=ku(u,r),y=Lu(r,s),C=Vu(u,u),O=ku(u,c),A=ku(u,s),z=Lu(c,c),B=Lu(c,s),Y=Lu(s,s),F=Lu(P,f),V=Lu(y,l),k=Lu(Y,h),L=Du(F,V),D=Du(L,k),X=Lu(N,f),q=Lu(B,h),Q=Du(w,M),$=Lu(Q,l),G=Xu(Du(X,q)),H=Du(G,$),R=Du(Xu(m),I),U=Du(Xu(A),z),Z=Du(_,E),j=Du(Z,T),W=Lu(R,f),J=Lu(U,h),K=Lu(j,l),tt=Lu(r,a),nt=Lu(s,p),et=Du(W,J),rt=Du(et,K),ot=Du(tt,nt),it=Du(rt,ot),st=Lu(v,f),ct=Lu(O,h),ut=Du(x,S),ft=Lu(ut,l),lt=Xu(Du(st,ct)),ht=Lu(o,a),at=Lu(c,p),pt=Du(lt,ft),dt=Du(ht,at),gt=Du(pt,dt),vt=Lu(g,f),mt=Lu(b,l),bt=Lu(C,h),xt=ku(i,a),_t=ku(u,p),It=Du(vt,mt),Nt=Du(It,bt),St=Du(xt,_t),Et=Du(Nt,St);return[D,H,it,gt,Du(Et,d)]}const $u=Ft,Gu=j,Hu=K,Ru=R,Uu=At,Zu=y;function ju(t,n){const e=Vc(t);if(0===Zu(e[0][0])&&0===Zu(e[1][0]))return Qu(gu(t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ie),ue=Gu(i,f),fe=Gu(i,h),le=Gu(u,l),he=Gu(u,a),ae=Ru(ue,le),pe=Ru(fe,he),de=Ru(ae,p),ge=Ru(pe,g),ve=Hu(x,de),me=Hu(B,ge),be=Hu(N,d),xe=Gu(i,v),_e=Gu(u,m),Ie=Ru(ve,me),Ne=Ru(Ie,be),Se=Ru(xe,_e),Ee=Ru(Ne,Se);return[U,Et,Gt,pn,kn,ce,Ru(Ee,b)]}const Wu=j,Ju=K,Ku=R,tf=y;function nf(t,n){const e=Lc(t),[[r,o,i,[s]],[c,u,f,[l]]]=Vc(n);if(0===tf(r)&&0===tf(c))return Fu(t,gu(n));const{vₓ:h,vᵧ:a,v:p}=$c(e),d=Ju(r,h),g=Ju(c,a),v=Ku(d,g),m=Ju(o,h),b=Ju(u,a),x=Ku(m,b),_=Ju(i,h),I=Ju(f,a),N=Ku(_,I),S=Wu(s,h),E=Wu(l,a),w=Ku(S,E);return[v,x,N,Ku(w,p)]}const ef=Ft,rf=j,of=K,sf=R,cf=At,uf=y;function ff(t,n){const e=kc(t);if(0===uf(e[0][0])&&0===uf(e[1][0]))return nf([t[0],t[2]],n);const[[r,o,i,[s]],[c,u,f,[l]]]=Vc(n);if(0===uf(r)&&0===uf(c))return Qu(t,gu(n));const{vₓₓ:h,vₓᵧ:a,vᵧᵧ:p,vₓ:d,vᵧ:g,v}=tu(e),m=ef(s,s),b=rf(s,i),x=rf(s,o),_=rf(s,r),I=ef(s,l),N=rf(s,f),S=rf(s,u),E=rf(s,c),w=of(i,i),M=of(i,o),P=of(i,r),T=rf(l,i),y=of(i,f),C=of(i,u),O=of(i,c),A=of(o,f),z=of(o,o),B=of(o,r),Y=rf(l,o),F=of(o,u),V=of(o,c),k=of(r,r),L=rf(l,r),D=of(r,f),X=of(r,u),q=of(r,c),Q=ef(l,l),$=rf(l,f),G=rf(l,u),H=rf(l,c),R=of(f,f),U=of(f,u),Z=of(c,c),j=of(u,u),W=of(u,c),J=of(f,c),K=of(k,h),tt=of(q,a),nt=of(Z,p),et=sf(K,tt),rt=sf(et,nt),ot=of(B,h),it=of(W,p),st=sf(ot,it),ct=sf(V,X),ut=of(ct,a),ft=sf(cf(st),ut),lt=sf(cf(P),z),ht=sf(cf(J),j),at=sf(O,F),pt=sf(at,D),dt=of(lt,h),gt=of(ht,p),vt=sf(dt,gt),mt=of(pt,a),bt=sf(vt,mt),xt=sf(_,M),_t=sf(H,U),It=sf(E,C),Nt=sf(A,L),St=sf(It,Nt),Et=of(xt,h),wt=of(_t,p),Mt=cf(sf(Et,wt)),Pt=of(St,a),Tt=of(r,d),yt=of(c,g),Ct=sf(Tt,yt),Ot=sf(Mt,Pt),At=sf(Ot,Ct),zt=sf(cf(x),w),Bt=sf(cf(G),R),Yt=sf(S,y),Ft=sf(Yt,Y),Vt=of(zt,h),kt=of(Bt,p),Lt=of(Ft,a),Dt=sf(Vt,kt),Xt=sf(Dt,Lt),qt=of(o,d),Qt=of(u,g),$t=sf(qt,Qt),Gt=sf(Xt,$t),Ht=of(b,h),Rt=of($,p),Ut=sf(N,T),Zt=of(Ut,a),jt=cf(sf(Ht,Rt)),Wt=sf(jt,Zt),Jt=of(i,d),Kt=of(f,g),tn=sf(Jt,Kt),nn=sf(Wt,tn),en=of(m,h),rn=of(I,a),on=of(Q,p),sn=rf(s,d),cn=rf(l,g),un=sf(en,rn),fn=sf(un,on),ln=sf(sn,cn),hn=sf(fn,ln);return[rt,ft,bt,At,Gt,nn,sf(hn,v)]}const lf=Ft,hf=j,af=K,pf=R,df=At,gf=y,vf=[[function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=hs(t),[[s,[,c]],[u,[,f]]]=ss(n),l=s[1],h=u[1],a=e[1],p=r[1],d=o[1],g=l*a,v=2*gs(g),m=ds(s,e),b=h*p,x=2*gs(b),_=ds(u,r),I=g+b,N=as(m,_),S=v+x+gs(I),E=c*a,w=ps(c,e),M=gs(E),P=f*p,T=ps(f,r),y=gs(P),C=E+P,O=as(w,T),A=M+y+gs(C),z=as(O,o),B=A+i+gs(C+d);return{coeffs:[N,z],errBound:[vs*S,vs*B]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=hs(t),{coeffs:[[s,c,[,u]],[f,l,[,h]]],errorBound:[[a],[p]]}=is(n),d=e[1],g=r[1],v=o[1],m=js(d),b=js(g),x=(js(v),c[1]),_=s[1],I=l[1],N=f[1],S=_*d,E=Zs(s,e),w=a*m+2*js(S),M=N*g,P=Zs(f,r),T=p*b+2*js(M),y=S+M,C=Rs(E,P),O=w+T+js(y),A=x*d,z=Zs(c,e),B=2*js(A),Y=I*g,F=Zs(l,r),V=2*js(Y),k=A+Y,L=Rs(z,F),D=B+V+js(k),X=Us(u,e),q=u*d,Q=js(q),$=Us(h,r),G=h*g,H=js(G),R=q+G,U=Rs(X,$),Z=Q+H+js(R),j=R+v,W=Rs(U,o),J=Z+i+js(j);return{coeffs:[C,L,W],errBound:[Ws*O,Ws*D,Ws*J]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=hs(t),{coeffs:[[s,c,u,[,f]],[l,h,a,[,p]]],errorBound:[[d,g,v],[m,b,x]]}=os(n),_=gc(e[1]),I=gc(r[1]),N=dc(s,e),S=d*_+2*gc(N[1]),E=dc(l,r),w=m*I+2*gc(E[1]),M=ac(N,E),P=S+w+gc(M[1]),T=dc(c,e),y=g*_+2*gc(T[1]),C=dc(h,r),O=b*I+2*gc(C[1]),A=ac(T,C),z=y+O+gc(A[1]),B=dc(u,e),Y=v*_+2*gc(B[1]),F=dc(a,r),V=x*I+2*gc(F[1]),k=ac(B,F),L=Y+V+gc(k[1]),D=pc(f,e),X=gc(D[1]),q=pc(p,r),Q=gc(q[1]),$=ac(D,q),G=X+Q+gc($[1]),H=ac($,o),R=G+i+gc(H[1]);return{coeffs:[M,A,k,H],errBound:[vc*P,vc*z,vc*L,vc*R]}}],[function(t,n){const{coeffs:{vₓₓ:e,v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x=y*$,xx=Mc(y,l),_x=ht*_+yc(bx),Ix=gx+bx,Nx=Tc(vx,xx),Sx=mx+_x+yc(Ix),Ex=ax+Ix,wx=Tc(px,Nx),Mx=dx+Sx+yc(Ex),Px=Ex+G,Tx=Tc(wx,h),yx=Mx+I+yc(Px);return{coeffs:[lr,no,yi,nu,gl,xa,jd,rm,Tb,Tx],errBound:[Cc*hr,Cc*eo,Cc*Ci,Cc*eu,Cc*vl,Cc*_a,Cc*Wd,Cc*om,Cc*yb,Cc*yx]}}]],mf=[[Uc,Fu,nf],[cu,Qu,ff],[Ou,ju,function(t,n){const e=Vc(t);if(0===gf(e[0][0])&&0===gf(e[1][0]))return ff(gu(t),n);const[[r,o,i,[s]],[c,u,f,[l]]]=Vc(n);if(0===gf(r)&&0===gf(c))return ju(t,gu(n));const{vₓₓₓ:h,vₓₓᵧ:a,vₓᵧᵧ:p,vᵧᵧᵧ:d,vₓₓ:g,vₓᵧ:v,vᵧᵧ:m,vₓ:b,vᵧ:x,v:_}=Eu(e),I=lf(s,s),N=hf(s,i),S=hf(s,o),E=hf(s,r),w=lf(s,l),M=hf(s,f),P=hf(s,u),T=hf(s,c),y=af(i,i),C=af(i,o),O=af(i,r),A=hf(l,i),z=af(i,f),B=af(i,u),Y=af(i,c),F=af(o,f),V=af(o,o),k=af(o,r),L=hf(l,o),D=af(o,u),X=af(o,c),q=af(r,r),Q=hf(l,r),$=af(r,f),G=af(r,u),H=af(r,c),R=lf(l,l),U=hf(l,f),Z=hf(l,u),j=hf(l,c),W=af(f,f),J=af(f,u),K=af(c,c),tt=af(u,u),nt=af(u,c),et=af(f,c),rt=af(r,q),ot=af(r,K),it=af(c,q),st=af(c,K),ct=af(rt,h),ut=af(ot,p),ft=af(it,a),lt=af(st,d),ht=pf(ct,ut),at=pf(ft,lt),pt=pf(ht,at),dt=pf(df(X),G),gt=pf(df(G),X),vt=af(r,dt),mt=af(c,gt),bt=af(o,q),xt=af(u,K),_t=af(h,bt),It=af(d,xt),N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pf(Rn,Qn),ee=pf(Un,$n),re=pf(ne,Gn),oe=pf(ee,Hn),ie=pf(Zn,Wn),se=pf(jn,Jn),ce=df(pf(Kn,te)),ue=af(a,re),fe=af(p,oe),le=af(h,ie),he=af(d,se),ae=pf(ue,fe),pe=hf(3,pf(le,he)),de=af(v,Jt),ge=pf(ae,pe),ve=pf(de,ce),me=pf(ge,ve),be=pf(Y,Yn),xe=pf(df(O),V),_e=pf(df(et),tt),Ie=hf(2*s,be),Ne=hf(2*l,be),Se=pf(B,df(F)),Ee=pf(F,df(B)),we=hf(l,xe),Me=hf(s,_e),Pe=af(i,Se),Te=af(f,Ee),ye=hf(s,xe),Ce=hf(l,_e),Oe=af(o,y),Ae=af(u,W),ze=pf(Ie,we),Be=pf(Ne,Me),Ye=pf(ze,Pe),Fe=pf(Be,Te),Ve=pf(ye,Oe),ke=pf(Ce,Ae),Le=af(a,Ye),De=af(p,Fe),Xe=af(h,Ve),qe=af(d,ke),Qe=pf(Xe,qe),$e=pf(Le,De),Ge=pf($e,hf(3,Qe)),He=af(v,be),Re=af(g,xe),Ue=pf(He,Re),Ze=af(m,_e),je=pf(Ue,Ze),We=pf(Ge,je),Je=pf(B,F),Ke=pf(Q,T),tr=pf(C,E),nr=pf(J,j),er=pf(df(Je),Q),rr=pf(df(Je),T),or=pf(df(L),z),ir=pf(df(P),z),sr=pf(tr,C),cr=pf(nr,J),ur=af(lf(3,s),sr),fr=af(lf(3,l),cr),lr=af(i,y),hr=af(f,W),ar=af(g,tr),pr=af(m,nr),dr=pf(er,Ke),gr=pf(rr,Ke),vr=hf(s,dr),mr=hf(l,gr),br=af(i,or),xr=af(f,ir),_r=af(r,b),Ir=af(c,x),Nr=pf(vr,br),Sr=pf(mr,xr),Er=pf(ur,lr),wr=pf(fr,hr),Mr=pf(Ke,Je),Pr=df(pf(ar,pr)),Tr=af(a,Nr),yr=af(p,Sr),Cr=af(h,Er),Or=af(d,wr),Ar=af(v,Mr),zr=pf(Tr,yr),Br=pf(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f[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:r,getPExact:()=>mf[t.length-2][n.length-2](t,n)}}const xf=le,_f=oe,If=ie,Nf=pe,Sf=re,Ef=ie,wf=function(t,n,e,r){const o=t[0],i=t[1],s=n[0],c=n[1],u=jn(t,n),f=Math.abs(o+i),l=Math.abs(s+c),h=l-Wn*l-r;return h<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/h**2+9*Jn*Math.abs(f/l)}},Mf=re,Pf=le,Tf=te,yf=oe,Cf=ce,Of=function(t,n){return Qn(t,n)[1]>0?n:t},Af=function(t,n){return $n(t,n)[1]>0?t:n},zf=Number.EPSILON/2,Bf=zf*zf,Yf=Math.abs,Ff=Ef,Vf=[0,1],kf=Mf,Lf=yf,Df=Pf,Xf=Tf,qf=Cf,Qf=wf,$f=Of,Gf=Af,Hf=Ar(3);function Rf(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,r],[o,i],[s,c]],[u,f]){const l=Ff(f,u),h=3*Bf*Yf(l[1]),a=Ff(Vf,u),p=3*Bf*Yf(a[1]),d=Qf(l,a,h,p);f=kf(d.est,d.err);const g=Ff(Vf,u),v=Df(u,u),m=Df(u,g),b=Df(g,g),x=Df(v,u),_=Df(v,g),I=Df(b,u),N=Df(b,g),S=Ff(Vf,f),E=Df(f,f),w=Df(f,S),M=Df(S,S),P=Df(E,f),T=Df(E,S),y=Df(M,f),C=Df(M,S),O=Yf(u[1]),A=Yf(g[1]),z=Yf(v[1]),B=Yf(m[1]),Y=Yf(b[1]),F=Yf(x[1]),V=Yf(_[1]),k=Yf(I[1]),L=Yf(N[1]),D=Yf(f[1]),X=Yf(S[1]),q=Yf(E[1]),Q=Yf(w[1]),$=Yf(M[1]),G=Yf(P[1]),H=Yf(T[1]),R=Yf(y[1]),U=Yf(C[1]);let Z=Yf(t),j=Yf(n),W=Yf(e),J=Yf(r),K=Yf(o),tt=Yf(i),nt=Yf(s),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.est,l.err);const h=Ff(Vf,o),a=Ff(Vf,i),p=Yf(o[1]),d=Yf(h[1]),g=Yf(i[1]),v=Yf(a[1]);let m=Yf(t),b=Yf(n),x=Yf(e),_=Yf(r);const I=Lf(Xf(e,o),Xf(t,h)),N=Lf(Xf(e,i),Df(I,a));m=x*p+m*d,x=x*g+m*v,m*=3*zf,x*=7*zf;const S=Lf(Xf(r,o),Xf(n,h)),E=Lf(Xf(r,i),Df(S,a));b=_*p+b*d,_=_*g+b*v,b*=3*zf,_*=7*zf;const w=$f(kf(I,-m),kf(N,-x)),M=Gf(kf(I,+m),kf(N,+x));return[[w,$f(kf(S,-b),kf(E,-_))],[M,Gf(kf(S,+b),kf(E,+_))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=function(t,n){if(0===n[0]&&0===n[1])return t[0].map((t=>[t]));if(0===n[0]&&1===n[1])return t[t.length-1].map((t=>[t]));if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=Sf(xf(Nf(o,e),n),e),h=Sf(xf(Nf(s,o),n),o),a=Sf(xf(Nf(u,s),n),s),p=_f(l,xf(If(h,l),n)),d=_f(h,xf(If(a,h),n)),g=_f(p,xf(If(d,p),n)),v=Sf(xf(Nf(i,r),n),r),m=Sf(xf(Nf(c,i),n),i),b=Sf(xf(Nf(f,c),n),c),x=_f(v,xf(If(m,v),n)),_=_f(m,xf(If(b,m),n));return[g,_f(x,xf(If(_,x),n))]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=_f([0,e],xf(Nf(o,e),n)),f=_f([0,o],xf(Nf(s,o),n)),l=_f(u,xf(If(f,u),n)),h=_f([0,r],xf(Nf(i,r),n)),a=_f([0,i],xf(Nf(c,i),n));return[l,_f(h,xf(If(a,h),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Sf(xf(Nf(o,e),n),e),Sf(xf(Nf(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}(t,n);let i;if(4===t.length)i=Tr(t,n).map((t=>16*Hf*t));else if(3===t.length)i=Tr(t,n).map((t=>10*Hf*t));else if(2===t.length)i=Tr(t,n).map((t=>4*Hf*t));else if(1===t.length)return[o,o];return[[kf(o[0],-i[0]),kf(o[1],-i[1])],[kf(o[0],+i[0]),kf(o[1],+i[1])]]}(t,n[0])}function Uf(t){return(n,e)=>{let[[r,o],[i,s]]=n,[[c,u],[f,l]]=e;return(o[1]>s[1]||o[1]===s[1]&&o[0]>s[0])&&([o,s]=[s,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])&&([c,f]=[f,c]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>c[1]||i[1]===c[1]&&i[0]>=c[0])&&(u[1]<s[1]||u[1]===s[1]&&u[0]<=s[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>c[1]||i[1]===c[1]&&i[0]>c[0])&&(u[1]<s[1]||u[1]===s[1]&&u[0]<s[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function Zf(t){return[(t.x.box[0][0]+t.x.box[1][0])/2,(t.x.box[0][1]+t.x.box[1][1])/2]}function jf(t,n){const e=bf(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,s=Nr(r,0,1,o,i);return 0!==s.length?{ris:s.map(Qi),getPExact:i}:void 0}function Wf(t){return{tS:H(t.tS),tE:H(t.tE),multiplicity:t.multiplicity}}function Jf(t,n){const e=jf(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const s=jf(n,t);if(void 0===s)return[];let{ris:c}=s;const{getPExact:u}=s;let f,l;l=1;let h,a=0;t:for(;a<l;){h=c.map((n=>Rf(t,[n.tS,n.tE])));for(let t=0;t<c.length;t++){const n=h[t];for(let e=t+1;e<c.length;e++){const t=h[e];if(Uf(!0)(n,t)){const t=[];for(const n of c)t.push(...Ji({tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},(f=f||u(),f)));c=t,a++;continue t}}}break t}l=1;let p,d=0;t:for(;d<l;){p=i.map((t=>Rf(n,[t.tS,t.tE])));for(let t=0;t<i.length;t++){const n=p[t];for(let e=t+1;e<i.length;e++){const t=p[e];if(Uf(!0)(n,t)){const t=[];for(const n of i)t.push(...Ji({tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},(o=o||r(),o)));i=t,d++;continue t}}}break t}const g=[];for(let t=0;t<c.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=p[e];if(Uf(!0)(n,o)){const s={compensated:a,ri:Wf(c[t]),riExp:a?c[t]:void 0,getPExact:a?void 0:u,kind:1,box:Kf(n)},f={compensated:d,ri:Wf(i[e]),riExp:d?i[e]:void 0,getPExact:d?void 0:r,kind:1,box:Kf(o)};g.push({psX:s,sideX:f})}}}return g}function Kf(t){return t.map((t=>t.map(H)))}function tl(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,s=e.slice();for(let t=0;t<i.length;t++){const n=Jf(o,i[t]);for(const{psX:e,sideX:r}of n)s.push({x:e,side:t,sideX:r,curve:void 0})}s.sort(((t,n)=>t.x.ri.tS-n.x.ri.tS));const c=[],u=[];let f,l;for(const n of s)void 0!==n.side?(!0===l&&u.push({dir:1,p:Zf(n),_x_:f,container:t,idx:++r,side:n.side,sideX:n.sideX}),l=!1):(!1===l&&(c.push({dir:-1,p:Zf(f),_x_:n,container:t,idx:++r,side:f.side,sideX:f.sideX}),n.in_=c[c.length-1]),l=!0),f=n;return{ins:c,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let s,c;({ins:s,outs:c,ioIdx:n}=i(e,o,n)),r.push(...s),r.push(...c)}return{inOuts:r,ioIdx:n}}function nl(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[3*(r-n),3*(o-e)],[3*(i-r),3*(s-o)],[3*(c-i),3*(u-s)]]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[[2*(r-n),2*(o-e)],[2*(i-r),2*(s-o)]]}if(2===t.length){const[[n,e],[r,o]]=t;return[[r-n,o-e]]}throw new Error("The given bezier curve must be of order 1, 2 or 3.")}function el(t,n){const e=t.xs;return 2===e.length&&1===e[0].x.kind&&1===e[1].x.kind&&e[0].x.ri.multiplicity%2==1&&e[1].x.ri.multiplicity%2==1?function(t,n){const e=t.xs,r=[],o=e[0],i=e[1],s=o.curve.ps,c=i.curve.ps,u=Mr(s,o.x.ri.tS),f=o.x.ri.tS,l=o.x.ri.tE,h=i.x.ri.tS,a=i.x.ri.tE;let p,d,g;p=4===s.length||3===s.length?Xr(nl(s),[f,l]):nl(s),d=4===c.length||3===c.length?Xr(nl(c),[h,a]):nl(c);for(let e=0;e<p.length;e++)for(let r=0;r<d.length;r++){const o=Math.sign(en(p[e],d[r],[0,0]));if(0===o)return tl(t,n);if(void 0!==g){if(g!==o)return tl(t,n)}else g=o}return g>0?(r.push({dir:-1,p:u,_x_:o,container:t}),r.push({dir:1,p:u,_x_:i,container:t}),r.push({dir:1,p:u,_x_:o,container:t}),r.push({dir:-1,p:u,_x_:i,container:t}),o.in_=r[0],i.in_=r[3]):(r.push({dir:-1,p:u,_x_:o,container:t}),r.push({dir:-1,p:u,_x_:i,container:t}),r.push({dir:1,p:u,_x_:o,container:t}),r.push({dir:1,p:u,_x_:i,container:t}),o.in_=r[0],i.in_=r[1]),{inOuts:r,ioIdx:n}}(t,n):tl(t,n)}const rl=-1,ol=1;function il(t,n,e,r){const o=[];for(const r of t)o.push({type:rl,item:r,x:n(r)}),o.push({type:ol,item:r,x:e(r)});o.sort(sl);const i=new Set,s=[];for(const t of o){const n=t.item;if(t.type===rl){for(const t of i.values()){const e=r(n,t);e&&s.push({a:n,b:t,u:e})}i.add(n)}else t.type===ol&&i.delete(t.item)}return s}function sl(t,n){const e=t.x-n.x;return 0!==e?e:t.type}const cl=oe,ul=K,fl=R,ll=y,hl=H,al=le,pl=Wt,dl=Math.abs,gl=Ar(3);const vl=Math.abs;const ml=Math.abs,bl=le,xl=oe,_l=K,Il=R,Nl=y,Sl=H,El=Wt,wl=Math.abs,Ml=Or(1),Pl=Ar(3);function Tl(t,n){const[e,r]=n,o=e.length,i=r.length,s=e[o-1],c=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,s]]=wi(t),c=n*i-e*o,u=n*s-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*c-2*o*u,vᵧ:2*n*u-e*c,v:c*(e*s-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:h,vᵧᵧ_:a,vₓ_:p,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,s]]=function(t){const[[n,e],[r,o],[i,s]]=t,c=vl(n),u=vl(r),f=vl(i),l=vl(e),h=vl(o);return[[f+c+2*u,2*(u+c),0],[vl(s)+l+2*h,2*(h+l),0]]}(t),c=ml(n),u=ml(e),f=r*s+o*i,l=r*u+c*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:s*f+2*i*l,vᵧ_:2*r*l+o*f,v_:f*(o*u+c*s)+l*l}}(t),v=u?0:1,m=wl(s),b=wl(c);if((v+12)*Ml*(l*(m*m)+h*(m*b)+a*(b*b)+(p*m+d*b)+g)<wl(n*s*s+e*s*c+r*c*c+(o*s+i*c)+f))return!1}{const{coeffs:{vₓₓ:n,vₓᵧ:o,vᵧᵧ:i,vₓ:u,vᵧ:f,v:l},errorBound:{vₓₓ_:h,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:d,vᵧ_:g,v_:v}}=Ss(t),m=El(e),b=El(r),x=wl(s),_=wl(c),I=x/3,N=_/3,S=bl(m,m),E=S[1],w=2*(x*I+E),M=bl(b,b),P=M[1],T=2*(_*N+P),y=bl(m,b),C=wl(y[1]),O=x*N+I*_+2*C,A=bl(n,S),z=wl(n[1])*w+h*E+2*wl(A[1]),B=bl(o,y),Y=wl(o[1])*O+a*C+2*wl(B[1]),F=bl(i,M),V=wl(i[1])*T+p*P+2*wl(F[1]),k=bl(m,u),L=wl(u[1])*I+d*x+2*wl(k[1]),D=bl(b,f),X=wl(f[1])*N+g*_+2*wl(D[1]),q=xl(A,B),Q=z+Y+wl(q[1]),$=xl(q,F),G=Q+V+wl($[1]),H=xl(k,D),R=L+X+wl(H[1]),U=xl($,H),Z=G+R+wl(U[1]),j=xl(U,l),W=Z+v+wl(j[1]);if(Pl*W<wl(Sl(j)))return!1}{const n=function(t){return tu(kc(t))}(t);if(void 0===n)return u&&s===t[0][0]&&c===t[0][1];n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓ:o,vₓᵧ:i,vᵧᵧ:f,vₓ:l,vᵧ:h,v:a}=n,p=Il(Il(Il(_l(o,_l(e,e)),_l(i,_l(e,r))),_l(f,_l(r,r))),Il(Il(_l(e,l),_l(r,h)),a));return 0===Nl(p)}}const yl=Math.abs,Cl=le,Ol=oe,Al=K,zl=R,Bl=y,Yl=H,Fl=Wt,Vl=Math.abs,kl=Or(1),Ll=Ar(3);function Dl(t,n){const[e,r]=n,o=e.length,i=r.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,b),w=Al(i,I),M=Al(f,N),P=Al(l,_),T=Al(h,m),y=Al(a,S),C=Al(p,x),O=Al(e,d),A=Al(r,g),z=zl(E,w),B=zl(M,P),Y=zl(z,B),F=zl(T,y),V=zl(F,C),k=zl(Y,V),L=zl(O,A),D=zl(L,v),X=zl(k,D);return 0===Bl(X)}}function Xl(t,n){const{coeffs:e,errBound:r,getPExact:o}=bf(t,n);return Nr(e,0,1,r,o,!0)}const ql=Math.min,Ql=Math.max;function $l(t,n){let[[e,r],[o,i]]=t,[[s,c],[u,f]]=n;if(e>o&&([e,o]=[o,e]),s>u&&([s,u]=[u,s]),r>i&&([r,i]=[i,r]),c>f&&([c,f]=[f,c]),e<=u&&o>=s&&c<=i&&f>=r)return[[Ql(e,s),Ql(r,c)],[ql(o,u),ql(i,f)]]}function Gl(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=Xl(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map((n=>Xr(t,[n.tS,n.tE]))),i=e.map((t=>Xr(n,[t.tS,t.tE]))),s=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const c=$l(n,i[o]);if(void 0!==c){const n={ri:r[t],box:c,kind:1},i={ri:e[o],box:c,kind:1};s.push([n,i])}}}return s}function Hl(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const s=r[i-1],c=r[i%o],u=[c[1]-s[1],s[0]-c[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let h=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<h&&(h=e),e>a&&(a=e)}if(e&&(l<h||a<f))return!1;if(!e&&(l<=h||a<=f))return!1}}return!0}const Rl=Ft,Ul=R,Zl=y,jl=rt,Wl=Number.EPSILON/2,Jl=Math.abs;function Kl(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=c+3*r,l=n+3*i,h=f-l,a=Jl(3*r)+Jl(f)+(Jl(3*i)+Jl(l))+Jl(h);if(Jl(h)-Wl*a>0)return!1;const p=u+3*o,d=e+3*s,g=p-d,v=Jl(3*o)+Jl(p)+(Jl(3*s)+Jl(d))+Jl(g);return!(Jl(g)-Wl*v>0)&&0===Zl(jl(Ul([c],Rl(3,r)),Ul([n],Rl(3,i))))&&0===Zl(jl(Ul([u],Rl(3,o)),Ul([e],Rl(3,s))))}const th=rt,nh=y,eh=pt,{abs:rh}=Math;function oh(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function ih(t){return 4===t.length&&Kl(t)&&(t=gu(t)),3===t.length&&function(t){const[[n,e],[r,o],[i,s]]=t,c=n+i,u=c-2*r,f=rh(c)+rh(u);if(rh(u)-f>0)return!1;const l=e+s,h=l-2*o,a=rh(l)+rh(h);return!(rh(h)-a>0)&&0===nh(th(eh(n,i),[2*r]))&&0===nh(th(eh(e,s),[2*o]))}(t)&&(t=[t[0],t[2]]),2===t.length&&oh(t)&&(t=[t[0]]),t}const sh=Number.EPSILON,ch=sh/2;function uh(t,n){return n<0?t<1?t:1-ch:0===n?1:t>1?t:1+sh}function fh(t){return H(ht(t[0],t[1],2))}function lh(t){return y(t[0])*y(t[1])}function hh(t){return(n,e)=>{const r=Fc(n),o=Fc(e),i=Fc(n.slice().reverse()),s=Fc(e.slice().reverse()),c=t(r,o),u=t(i,o),f=t(r,s),l=t(i,s),h=-lh(u),a=-lh(l),p=fh(c),d=fh(f);return[uh(p,h),uh(d,a)]}}const ah=hh((function(t,n){const e=0===y(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[rt(o,r),e]}(t[e],n[e])}));function ph(t,n){return yt(sn(t[0],n[1]),sn(t[1],n[0]))*y(t[1])*y(n[1])}const dh=L,gh=ot,vh=0n;function mh(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-dh(e)+gh(e)-1;o>n&&(n=o)}}return 0===n?t.map((t=>t.map((t=>BigInt(t))))):n>0?t.map((t=>t.map((t=>{if(0===t)return vh;const e=-dh(t)+gh(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})))):t.map((t=>t.map((t=>BigInt(t*2**n)))))}function bh(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const xh=BigInt(2**53);function _h(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/xh;const o=t%xh;n.push(Number(o)*2**(53*e)),t=r,e++}return X(n)}const{round:Ih,sqrt:Nh}=Math;function Sh(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Ih(Nh(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function Eh(t){return t<0n?-t:t}function wh(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function Mh(t,n){const[e,r]=Ph(t[0],n[0]),[o,i]=Ph(t[1],n[1]);if(0===ph(e,o)||0===ph(e,i))return e;if(0===ph(r,o)||0===ph(r,i))return r;throw new Error("An unexpected error occured.")}function Ph(t,n){const[e,r]=t,[o,i]=n,[s,c]=function(t){const[n,e]=mh(t).map(wh),r=bh(n,e);return[_h(Sh(Eh(n/r))),_h(Sh(Eh(e/r)))]}([o,e]);return[[rt(sn(i,c),sn(r,s)),sn(s,At(e))],[rt(sn(i,tt(c)),sn(r,s)),sn(s,At(e))]].sort(ph)}function Th(t,n){const e=Fc(t),r=0===y(e[0][0])?0:0===y(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],s=n[2][r];return ah([[e,e],[o,o]],[[i,i],[s,s]])}return hh(Mh)(t,n)}const{round:yh,cbrt:Ch}=Math;function Oh(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=Eh(t))<=1n)return n*t;let r=BigInt(yh(Ch(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Ah(t){return sn(t,t)}const zh=hh((function(t,n){const e=0===y(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,s=function(t){const[n,e]=mh(t).map(wh),r=bh(n,e);return[_h(Oh(n/r)),_h(Oh(e/r))]}([o,e]),c=Ah(s[0]);return[rt(sn(i,Ah(s[1])),sn(r,c)),sn(j(3,e),c)]}(t[e],n[e])})),{EPSILON:Bh}=Number,Yh=Bh/2+Bh**2/2;function Fh(t){return t>0?t-t*Yh:t+t*Yh}const{EPSILON:Vh}=Number,kh=Vh/2+Vh**2/2;function Lh(t){return t>0?t+t*kh:t-t*kh}function Dh(t){if(0===t||1===t)return[t,t];const n=Fh(Fh(t)),e=function(t){return Lh(Lh(t))}(t);return[n,e]}function Xh(t,n,e,r){const o=t.ps,i=n.ps,s=[];let c=Xl(o,i);if(void 0===c){const r=2**(e-47),c=function(t,n,e=!1){e||(t=ih(t),n=ih(n));const r=[,,ah,Th,zh],[o,i]=r[t.length](t,n),[s,c]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:s,bez:"A",start:!0},{tA:1,tB:c,bez:"A",start:!1}].sort(((t,n)=>t.tA-n.tA));if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=Xr(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{tS:e,tE:e,multiplicity:1},t2:r,ri2:{tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[h,a]=Dh(f.tA),[p,d]=Dh(f.tB),[g,v]=Dh(l.tA),[m,b]=Dh(l.tB),x=Xr(t,[h,a]),_=Xr(n,[p,d]),I=Xr(t,[g,v]),N=Xr(n,[m,b]),S=$l(x,_),E=$l(I,N),w={tS:h,tE:a,multiplicity:1},M={tS:p,tE:d,multiplicity:1},P={tS:g,tE:v,multiplicity:1},T={tS:m,tE:b,multiplicity:1};return[{p:Yo(S),kind:5,box:S,t1:Bo(w),ri1:w,t2:Bo(M),ri2:M},{p:Yo(E),kind:5,box:E,t1:Bo(P),ri1:P,t2:Bo(T),ri2:T}]}(o,i);for(const e of c){const i=Mr(o,e.ri1.tS),c=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:c},curve:t},f={x:{ri:e.ri2,kind:5,box:c},curve:n};s.push([u,f])}return s}if(r&&(c=c.filter((t=>t.tS>0))),0===c.length)return[];const u=Gl(o,i,c);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};s.push([r,o])}return s}const qh=Mr,Qh=Tr,$h=Or(1);function Gh(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=qh(t,n),r=Qh(t,[0,n]);if(4===t.length)return{p:e,pE:r.map((t=>9*$h*t))};if(3===t.length)return{p:e,pE:r.map((t=>6*$h*t))};if(2===t.length)return{p:e,pE:r.map((t=>3*$h*t))};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function Hh(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return Dl(t,n);if(3===t.length)return Tl(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,s=e[o-1],c=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=hs(t),f=pl(e),l=pl(r),h=dl(s),a=dl(c),p=dl(n[1]),d=dl(o[1]),g=h/3,v=a/3,m=n[1]*s,b=al(f,n),x=p*g+2*dl(m),_=o[1]*c,I=al(l,o),N=d*v+2*dl(_),S=cl(b,I),E=x+N+dl(S[1]),w=cl(S,i),M=E+u+dl(w[1]);if(gl*M<dl(hl(w)))return!1}{const n=function(t){return $c(Lc(t))}(t);if(void 0===n)return u&&s===t[0][0]&&c===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=ul(e,o),h=ul(r,i),a=fl(fl(l,h),f);return 0===ll(a)}}(t,n);if(1===t.length){const e=X(n[0]),r=X(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map((t=>[t])))){const i=Gl(e,r,[(o=1,{tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},Gh(1,n,1)]]}var o}const Rh=Math.abs;const Uh=Math.abs,Zh=Or(1),jh=K,Wh=R,Jh=rt,Kh=rt,ta=K,na=j,ea=pe,ra=ge,oa=ae,ia=oe,sa=ce,ca=he,ua=R,fa=at,la=2*Number.EPSILON,ha=Math.abs,aa=Or(1);function pa(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,s,c]}=function(t){const{coeffs:[[n,e,r],[o,i,s]],errorBound:[[c,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=c-n,l=r-i,h=f+3*l,a=i+n,p=a-2*r,d=r-n,g=u-e,v=o-s,m=g+3*v,b=s+e,x=b-2*o,_=o-e;return{coeffs:[[h,3*p,3*d,n],[m,3*x,3*_,e]],errorBound:[[Rh(f)+6*Rh(l)+Rh(h),6*(Rh(a)+Rh(p)),6*Rh(d),0],[Rh(g)+6*Rh(v)+Rh(m),6*(Rh(b)+Rh(x)),6*Rh(_),0]]}}(t),h=Uh(n),a=Uh(e),p=Uh(r),d=Uh(o),g=Uh(i),v=Uh(s),m=e*o,b=n*i,x=n*s,_=r*o,I=e*s,N=r*i,S=u*d+a*f+Uh(m),E=c*g+h*l+Uh(b),w=c*v+Uh(x),M=p*f+Uh(_),P=u*v+Uh(I),T=p*l+Uh(N),y=m-b,C=Uh(y),O=S+E+C,A=_-x,z=Uh(A),B=M+w+z,Y=I-N,F=Uh(Y),V=P+T+F,k=y*y,L=y*A,D=Y*y,X=A*A,q=D+X;return{coeffs:[k,L,q],errBound:[2*O*C+Uh(k),O*z+C*B+Uh(L),V*C+F*O+Uh(D)+(2*z*B+Uh(X))+Uh(q)].map((t=>Zh*t))}}(t);if(ha(e)<=i){const[[n,e],[r,o],[i,s],[c,u]]=t,f=ua(ea(c,n),na(3,ea(r,i))),l=fa(ra(i,n),-2*r),h=ua(ea(u,e),na(3,ea(o,s))),a=fa(ra(s,e),-2*o);if(0===yt(ta(l,h),ta(f,a)))return[]}const u=r*r,f=4*e*o,l=u-f,h=2*s*ha(r)+aa*u+(4*(i*ha(o)+ha(e)*c)+aa*ha(f))+aa*ha(l);if(l<-h)return[];if(l>h){const{est:t,err:u}=ee(l,h);let f;f=r>=0?-r-t:-r+t;const a=s+u+aa*ha(f),{est:p,err:d}=ve(f,2*e,a,2*i),{est:g,err:v}=ve(2*o,f,2*c,a);if(n){if(p+d<0||p-d>1||g+v<0||g-v>1)return[]}else if((p+d<0||p-d>1)&&(g+v<0||g-v>1))return[]}let[a,p,d]=function(t){const[[n,e,r],[o,i,s]]=Vc(t),c=jh(e,o),u=jh(n,i),f=jh(n,s),l=jh(r,o),h=jh(e,s),a=jh(r,i),p=Jh(c,u),d=Jh(l,f),g=Jh(h,a),v=jh(p,p),m=jh(p,d),b=jh(p,g),x=jh(d,d);return[v,m,Wh(b,x)]}(t);const g=Kh(ta(p,p),na(4,ta(a,d))),v=y(g);if(v<0)return[];if(v>0){const t=ne(Wt(g));let e;a=Wt(a),p=Wt(p),d=Wt(d),e=y(p)>=0?oa(ia(p,t)):ia(oa(p),t);let r=H(ca(e,sa(a))),o=H(ca(sa(d),e));if(n){if(r<-la||r>1+la||o<-la||o>1+la)return[]}else if((r<-la||r>1+la)&&(o<-la||o>1+la))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-la&&r<=1+la?o>=0-la&&o<=1+la?[r,o]:[r]:o>=0-la&&o<=1+la?[o]:[]}const m=zt(a);if(y(p)*y(m)<0)return[];if(yt(Ot(p),Ot(m))>0)return[];const b=Wt(p),x=Wt(m),_=ca(b,x),I=_[1]+_[0];return[I,I]}const da=Number.EPSILON;function ga(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[6*(c-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-s)),6*(s+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[[2*(i-2*r+n)],[2*(s-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}const{orient2d:va}=un;function ma(t){if(4===t.length)return 0===va(t[0],t[1],t[2])&&0===va(t[1],t[2],t[3])&&0===va(t[0],t[2],t[3]);if(3===t.length)return 0===va(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function ba(t){if(ma(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Kl(t)&&(t=gu(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,s]]=t,c=i-r,u=c-(r-n),f=s-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(c-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Ni(n,0,1),inflections:[]}}const n=function(t){const[[n,e,r],[o,i,s]]=wr(t),[[c,u],[f,l]]=ga(t),[h,a]=function(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[6*(c-n+3*(r-i)),6*(u-e+3*(o-s))]}if(t.length<=3)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}(t),p=h*i,d=a*e,g=u*s,v=u*i,m=f*f,b=c*s,x=l*r,_=l*e,I=f*r,N=r*e,S=r*n,E=r*o,w=e*e,M=e*n,P=e*i,T=n*s,y=n*o,C=n*n,O=s*i,A=s*o,z=i*i,B=i*o,Y=o*o,F=h*s-a*r,V=u*r+l*s,k=g-x,L=r*r+s*s,D=P+T,X=A+z,q=S+w,Q=e*o+n*i,$=C-Y,G=M-B,H=N-O,R=r*i+e*s,U=A+X,Z=S+q,j=E+D,W=P+D,J=Z-U,K=D+T,tt=E+P+T,nt=2*_+I;return{inflectionPoly:[c*o-f*n,u*o+c*i-l*n-f*e,v+b-_-I,g-x],otherExtremaPoly:[C*(p-3*d)+Y*(3*p-d)+2*(y*(h*e-a*i+3*(l*f-u*c))+3*c*f*G)+3*(Q*(m-c*c)+$*(u*f+l*c)),h*(o*(Z+3*X)+n*W)-a*(r*(3*C+Y)+e*(3*M+2*B)+n*U)+3*(u*(l*$-u*y+2*(f*G-c*Q))+c*(2*l*G+f*(2*(S-A)+(w-z))-c*tt)+l*(l*y+2*f*Q)+m*j),h*(2*r*Q+e*K+i*(4*A+U))-a*(2*r*(3*M+B)+e*(w+2*A)+i*K)+3*(u*(2*(l*G-c*tt)+f*J-u*Q)+c*(2*f*H-c*R)+l*(l*Q+2*f*j+c*J)+m*R),h*(r*(E+2*D)+s*(w+3*X))-a*(r*(3*q+U)+s*W)+3*(u*(l*J-u*j+2*(f*H-c*R))+c*(r*(nt-c*s)-s*(2*l*i+f*s))+l*(l*D+r*(2*f*i+l*o))+f*s*nt),L*(p-d)+2*(N+O)*F-3*(V*(v+b-_-I)+(u*e+c*r+l*i+f*s)*k),F*L-3*V*k]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Ni(r,0,1),i=hi(r),s=[],c=[];for(let t=0;t<o.length;t++){const n=o[t],r=E(i,n);E(e,n)*r>=0?s.push(n):c.push(n)}return{minima:s,maxima:c,inflections:Ni(e,0,1)}}function xa(t,n){const[e,r]=wr(t),[o,i]=ga(t),s=E(e,n),c=E(r,n),u=E(o,n);return(s*E(i,n)-c*u)/Math.sqrt((s*s+c*c)**3)}const{abs:_a}=Math,Ia=P((function(t){const n=t.curves;let e=qr(n[0].ps).minY,r=n[0];for(let o=1;o<n.length;o++){const n=qr(t.curves[o].ps).minY,i=n.box[0][1],s=e.box[0][1];(i<s||i===s&&n.ts[0]>e.ts[0])&&(e=n,r=t.curves[o])}return{curve:r,y:e}}));function Na(t){const{curve:n,y:e}=Ia(t),r=e.ts;return r[0]<=0?[Gh(0,n,0),Gh(1,n.prev,0)]:r[1]>=1?[Gh(1,n,0),Gh(0,n.next,0)]:[{x:{ri:{tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function Sa(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:q(t,r)}const{abs:Ea}=Math;function wa(t,n){let e=t.side-n.side;if(0!==e)return e;const r=t.sideX,o=n.sideX;e=r.ri.tS-o.ri.tS;const i=8*Number.EPSILON;return Ea(e)>=i?e:(r.compensated||(r.compensated=1,r.riExp=Ji(r.ri,r.getPExact())[0]),o.compensated||(o.compensated=1,o.riExp=Ji(o.ri,o.getPExact())[0]),e=yt(r.riExp.tS,o.riExp.tS),0!==e?e:(e=n.dir-t.dir,0!==e?e:1===t.dir?t.idx-n.idx:n.idx-t.idx))}function Ma(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=il(e,(t=>Pi(t.ps)[0][0]),(t=>Pi(t.ps)[1][0]),function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=Pi(r),s=Pi(o);if(t.next!==n&&n.next!==t){if(Yi(!0,i,s)){const r=Xh(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==en(r[0],r[1],o[1]))return;if(!Yi(!1,i,s))return;let c;return c=p(r[0],r[1])>p(o[0],o[1])?[Bo(Qo(r,o[1])[0].ri),1]:[0,Bo(Qo(o,r[0])[0].ri)],[[Gh(1,t,5),Gh(0,n,5)],[Gh(c[0],t,5),Gh(c[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return Yi(!1,Pi(r),Pi(o))&&Hl(Ur(r),Ur(o),!1)?e.next===n?Xh(e,n,t,!0):Xh(n,e,t,!0):Hh(n,e);let i=Yi(!0,Pi(r),Pi(o));return i?(i=Hl(Ur(r),Ur(o),!0),i?Xh(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=pa(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-da,s=r[0]+da,c=r[1]-da,u=r[1]+da,f=Xr(e,[i,s]),l=Xr(e,[c,u]);n.push([{x:{ri:{tS:i,tE:s,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{tS:c,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([Gh(1,t,4),Gh(0,t.next,4)]);return n}(t),{extremes:s,xs:c}=function(t){const n=new Map,e=[];for(const r of t){const t=Na(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=ba(r),{minima:i,maxima:s}=o,c=[0,1,...i,...s];for(let o of c)_a(xa(r,o))>1e7*2**-t&&e.push([Gh(o,n,7),Gh(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...c,...u];if("undefined"!=typeof _debug_){for(const t of r)_debug_.generated.elems.intersection.push(...t);for(const t of o)_debug_.generated.elems.intersection.push(...t);for(const t of i)_debug_.generated.elems.intersection.push(...t);for(const t of c)_debug_.generated.elems.intersection.push(...t);for(const t of u)_debug_.generated.elems.intersection.push(...t)}let l=f.map((t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0})));for(;;){const t=il(l,Pa,Ta,Fi);if(!t.length)break;const n=new Map;Vi(n,t);const e=Di(n),r=Xi(l,e);l=[...qi(e),...r]}l=function(t){return t.filter((t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1}))}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map((t=>{const e=t.box.map((t=>t.map((t=>Sa(t,n,n-r)))));return{...t,box:e}}))}(l,e,n),"undefined"!=typeof _debug_&&(_debug_.generated.elems.container=l);let h=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:h}=el(t,h)),t.inOuts=n}f=f.filter((t=>void 0!==t[0].container)),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort(((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)}));const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;let t=n._x_;for(;t=t.next,void 0===t.in_;);n.next=t.in_,n.idx=n.next.idx}for(const t of l)t.inOuts.sort(wa);for(const t of l){const n=t.inOuts;let e=n[n.length-1];for(let t=0;t<n.length;t++){const r=n[t];r.prevAround=e,e.nextAround=r,e=r}}return{extremes:s,containers:l}}function Pa(t){return t.box[0][0]}function Ta(t){return t.box[1][0]}function ya(t){const n=t.inOuts,e=n[0],r=n[n.length-1];return 1===e.dir?(e.orientation=-1,e):(r.orientation=1,r)}function Ca(t=[],n){const e=[],r={beziers:t,curves:e,idx:n};if(!t.length)return r;let o,i=0;for(let n=0;n<t.length;n++){if(2===(s=t[n]).length?s[0][0]===s[1][0]&&s[0][1]===s[1][1]:3===s.length?s[0][0]===s[1][0]&&s[0][1]===s[1][1]&&s[1][1]===s[2][1]&&s[1][1]===s[2][1]:s[0][0]===s[1][0]&&s[0][1]===s[1][1]&&s[1][1]===s[2][1]&&s[1][1]===s[2][1]&&s[2][1]===s[3][1]&&s[2][1]===s[3][1])continue;const c={loop:r,ps:t[n],prev:o,next:void 0,idx:i};o&&(o.next=c),o=c,e.push(c),i++}var s;const c=e[e.length-1];return e[0].prev=c,c.next=e[0],c.ps[c.ps.length-1]=e[0].ps[0],r}function Oa(t){if(!ma(t))return!1;const n=t.map((t=>t[0])),e=t.map((t=>t[1]));return!(Aa(n)&&Aa(e))}function Aa(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function za(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Ba(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:Ya}=Math;function Fa(t,n,e){if(void 0!==t&&!oh(t)){if(2===t.length)return t;if(3===t.length){if(Ba(t))return ma(t)?[t[0],t[2]]:t;if(ka(t[0],t[2]))return;return[t[0],t[2]]}if(Ba(t)){const r=Va(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:Fa(r,n,e)}if(ka(t[0],t[3])){if(ma(t))return;return t}if(ma(t))return[t[0],t[3]];if(ka(t[0],t[1])&&ka(t[1],t[2])||ka(t[1],t[2])&&ka(t[2],t[3])||ka(t[0],t[1])&&ka(t[2],t[3]))return Fa([t[0],t[t.length-1]],n,e);if(ka(t[0],t[2])||ka(t[1],t[3])||ka(t[1],t[2]))return t;if(ka(t[0],t[1])){if(p(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=za(d(t[1],t[2]),2*n),o=I(t[1],r);return Va([t[0],e(o),t[2],t[3]])}}if(ka(t[2],t[3])){if(p(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=za(d(t[2],t[1]),2*n),o=I(t[2],r);return Va([t[0],t[1],e(o),t[3]])}}}}function Va(t){return ma(t)?[t[0],t[3]]:Kl(t)?gu(t):t}function ka(t,n){return t[0]===n[0]&&t[1]===n[1]}function La(t){return t}function Da(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>[Sa(e[0],t,n),Sa(e[1],t,n)]}(t,n):La;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const s=n[n.length-1],c=s?s[s.length-1]:o(t[0][0]);i[0]=c,i=i.map((t=>o(t))),Oa(i)&&(i=[i[0],i[i.length-1]]),i=Fa(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let s=t.slice();return s=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map((t=>t.map((t=>{let o,i=0,s=0,c=0;for(;!(++s>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=Sa(i,e,n);const s=ot(i);s>c&&(c=s,o=i)}return o}))));t.push(i)}o.push(t)}return o}(s,n,e,1):s,s=s.map(i),s=s.filter((t=>t.length>0)),s}const Xa=P((t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n}));function qa(t,n){const e=[],r=t.length-1;for(let n=0;n<r+1;n++)e.push(t[n]/(r+1-n));return e.push(n),e}const Qa=Ko;function $a(t,n){const e=t.length-1,r=n.length-1,o=e-r,i=o<0?+o:0,s=o>0?-o:0,c=Math.max(e,r),u=[];for(let e=0;e<c+1;e++){const r=t[e+i]||0,o=n[e+s]||0;u.push(r+o)}return Qa(u)}function Ga(t){let n=0;for(const e of t.curves){const t=e.ps,[r,o]=Si(t),[i,s]=wr(t);n+=E(qa($a(ni(r,s),tr(ni(o,i))),0),1)}return-n/2}function Ha(t){return[t[1],-t[0]]}const Ra=P((t=>!!vn(t)&&gn(t).isDull));function Ua(t,n){return vn(n)&&Ra(n)?-b(Ha(gn(n).tangents[0]),N(d(n.p,t.center))):0}const Za=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=s-n*(s-u),p=u-n*(u-l),d=a-n*(a-p),g=c-n*(c-f),v=f-n*(f-h),m=g-n*(g-v);return[[s,c],[a,g],[d,m],[d-n*(d-(p-n*(p-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(h-n*(h-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=c-n*(c-f),_=f-n*(f-h),I=h-n*(h-p),N=x-n*(x-_),S=_-n*(_-I);return[[m-n*(m-b),N-n*(N-S)],[b,S],[v,I],[a,p]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=b+x,I=n*b,N=e*b,S=s[0]-c-3*x,E=u-l,w=a-l,M=E+w,P=n*E,T=e*E,y=s[1]-u-3*w;return[[d*S+(3*n*(n*_-b)+c),d*y+(3*n*(n*M-E)+u)],[m*(n*S+2*_)+(p*_+c-(N+2*I)),m*(n*y+2*M)+(p*M+u-(T+2*P))],[m*(e*S+2*_)+(g*_+c-(2*N+I)),m*(e*y+2*M)+(g*M+u-(2*T+P))],[v*S+(3*e*(e*_-b)+c),v*y+(3*e*(e*M-E)+u)]]}(t,n,e)},ja=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=n*n,l=i-c,h=s-u;return[[i,s],[-n*l+i,-n*h+s],[f*(l+(o[0]-c))-(2*n*l-i),f*(h+(o[1]-u))-(2*n*h-s)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u;return[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=n*n,h=e*e,a=n*e,p=s-u,d=p+(i[0]-u),g=c-f,v=g+(i[1]-f);return[[l*d-(2*n*p-s),l*v-(2*n*g-c)],[a*d-(p*(e+n)-s),a*v-(g*(e+n)-c)],[h*d-(2*e*p-s),h*v-(2*e*g-c)]]}(t,n,e)},Wa=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[o,i],[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1];return[[n*(s-o)+o,n*(c-i)+i],[s,c]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1];return[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]]}(t,n,e)};function Ja(t,n,e){if(4===t.length)return Za(t,n,e);if(3===t.length)return ja(t,n,e);if(2===t.length)return Wa(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function Ka(t){return t[0]*t[0]+t[1]*t[1]}function tp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}function np(t){const n=t[0],e=t[1],r=t[2],o=Ka,i=.5*tp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),s=.5*tp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),c=tp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/c,s/c]}function ep(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}const rp=pe,op=oe,ip=te,sp=le,cp=ce,up=ue,fp=ie;function lp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],[d,g]=n,v=rp(s,d),m=rp(u,d),b=rp(l,d),x=rp(a,d),_=rp(c,g),I=rp(f,g),N=rp(h,g),S=rp(p,g),E=sp(v,v),w=ip(6,sp(v,m)),M=ip(6,sp(v,b)),P=cp(sp(v,x)),T=ip(9,sp(m,m)),y=ip(18,sp(m,b)),C=ip(6,sp(m,x)),O=ip(9,sp(b,b)),A=ip(6,sp(b,x)),z=sp(x,x),B=sp(_,_),Y=ip(6,sp(_,I)),F=ip(6,sp(_,N)),V=cp(sp(_,S)),k=ip(9,sp(I,I)),L=ip(18,sp(I,N)),D=ip(6,sp(I,S)),X=ip(9,sp(N,N)),q=ip(6,sp(N,S)),Q=sp(S,S),$=op(C,O),G=op(P,y),H=op(M,T),R=op(D,X),U=op(V,L),Z=op(F,k);return[ip(6,op(op(op(op(fp(z,A),fp(E,w)),$),fp(H,G)),op(op(op(fp(Q,q),fp(B,Y)),R),fp(Z,U)))),ip(5,op(fp(op(op(A,ip(5,w)),ip(3,G)),cp(op(op($,cp(H)),ip(3,E)))),fp(op(op(q,ip(5,Y)),ip(3,U)),cp(op(op(R,cp(Z)),ip(3,B)))))),up(op(fp(fp($,ip(3,fp(G,cp(H)))),ip(5,fp(cp(w),ip(3,E)))),fp(fp(R,ip(3,fp(U,cp(Z)))),ip(5,fp(cp(Y),ip(3,B)))))),ip(3,op(fp(G,cp(fp(cp(H),ip(5,fp(w,cp(E)))))),fp(U,cp(fp(cp(Z),ip(5,fp(Y,cp(B)))))))),cp(op(fp(H,ip(5,fp(w,ip(3,E)))),fp(Z,ip(5,fp(Y,ip(3,B)))))),op(fp(w,ip(6,E)),fp(Y,ip(6,B)))]}const hp=pe,ap=oe,pp=te,dp=le,gp=ce,vp=ie,mp=ue;function bp(t,n){const[[e,r],[o,i],[s,c]]=t,[u,f]=n,l=hp(e,u),h=hp(o,u),a=hp(s,u),p=hp(r,f),d=hp(i,f),g=hp(c,f),v=dp(l,l),m=dp(l,h),b=dp(l,a),x=dp(h,h),_=dp(h,a),I=dp(a,a),N=dp(p,p),S=dp(p,d),E=dp(p,g),w=dp(d,d),M=dp(d,g),P=dp(g,g),T=ap(E,gp(w)),y=ap(b,gp(x));return[ap(vp(ap(ap(P,N),gp(T)),mp(ap(M,S))),vp(ap(ap(I,v),gp(y)),mp(ap(_,m)))),pp(3,ap(ap(vp(M,T),vp(pp(3,S),N)),ap(vp(_,y),vp(pp(3,m),v)))),ap(vp(T,pp(3,vp(gp(S),N))),vp(y,pp(3,vp(gp(m),v)))),ap(vp(S,N),vp(m,v))]}const xp=de,_p=oe,Ip=fe,Np=ie;function Sp(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=e-s,f=o-s,l=r-c,h=i-c,a=xp(u,u),p=xp(u,f),d=xp(f,f),g=xp(l,l),v=xp(l,h),m=xp(h,h),b=_p(p,v),x=_p(g,a);return[_p(_p(d,m),_p(x,Ip(b))),Np(b,x)]}const Ep=T,wp=sn,Mp=j,Pp=At,Tp=zt,yp=on,Cp=rt,Op=T,Ap=sn,zp=j,Bp=At,Yp=on,Fp=rt;function Vp(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const kp=T,Lp=sn,Dp=zt,Xp=on,qp=rt,Qp=Math.abs;function $p(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=Qp(e[0]),c=Qp(e[1]),u=Qp(r[0]),f=Qp(r[1]),l=Qp(o[0]),h=Qp(o[1]),a=Qp(i[0]),p=Qp(i[1]),d=Qp(n[0]),g=Qp(n[1]),v=s+d,m=u+d,b=l+d,x=a+d,_=c+g,I=f+g,N=h+g,S=p+g,E=v*v,w=6*v*m,M=6*b*x,P=_*_,T=6*_*I,y=6*N*S,C=6*m*x+9*b*b,O=2*v*x+18*m*b,A=6*v*b+9*m*m,z=6*I*S+9*N*N,B=2*_*S+18*I*N,Y=6*_*N+9*I*I;return[6*(x*x+M+(E+w)+C+(A+O)+(S*S+y+(P+T)+z+(Y+B))),5*(M+5*w+3*O+2*(C+2*A+3*E)+(y+5*T+3*B+2*(z+2*Y+3*P))),4*(C+3*(O+2*A)+5*(2*w+3*E)+(z+3*(B+2*Y)+5*(2*T+3*P))),3*(O+2*(2*A+5*(w+2*E))+(B+2*(2*Y+5*(T+2*P)))),2*(A+5*(w+3*E)+(Y+5*(T+3*P))),w+6*E+(T+6*P)]}function Gp(t,n){const e=t[0],r=t[1],o=t[2],i=Qp(e[0]),s=Qp(e[1]),c=Qp(r[0]),u=Qp(r[1]),f=Qp(o[0]),l=Qp(o[1]),h=Qp(n[0]),a=Qp(n[1]),p=i+h,d=c+h,g=f+h,v=s+a,m=u+a,b=l+a,x=p*p,_=p*d,I=d*g,N=v*v,S=v*m,E=m*b,w=v*b+m*m*2,M=p*g+d*d*2;return[b*b+N+2*w+4*(E+S)+(g*g+x+2*M+4*(I+_)),3*(E+w+(3*S+N)+(I+M+(3*_+x))),w+3*(2*S+N)+(M+3*(2*_+x)),S+N+(_+x)]}function Hp(t,n){const e=t[0],r=t[1],o=Qp(e[0]),i=Qp(e[1]),s=Qp(r[0]),c=Qp(r[1]),u=Qp(n[0]),f=Qp(n[1]),l=o+u,h=s+u,a=i+f,p=c+f,d=l*h+a*p,g=a*a+l*l;return[h*h+p*p+2*d+g,d+g]}const Rp=Number.EPSILON/2,Up=Rp*Rp;function Zp(t){const n=t*Rp;return n/(1-n)}function jp(t){const n=t*Up;return n/(1-n)}Zp(1),jp(3);const Wp=jp(6);function Jp(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=e+(o-e)*n,h=o+(s-o)*n,a=l+(h-l)*n,p=r+(i-r)*n,d=i+(c-i)*n,g=p+(d-p)*n;return[a+(h+(s+(u-s)*n-h)*n-a)*n,g+(d+(c+(f-c)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(s-o)*n-u)*n,f+(i+(c-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const Kp=Math.abs;function td(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Kp(n[1]);if(4===t.length){const[[n,r],[o,i],[s,c],[u,f]]=t,l=Kp(n),h=Kp(r),a=Kp(o),p=Kp(i),d=Kp(s),g=Kp(c),v=l+(a+l)*e,m=a+(d+a)*e,b=v+(m+v)*e,x=h+(p+h)*e,_=p+(g+p)*e,I=x+(_+x)*e;return[b+(m+(d+(Kp(u)+d)*e+m)*e+b)*e,I+(_+(g+(Kp(f)+g)*e+_)*e+I)*e]}if(3===t.length){const[[n,r],[o,i],[s,c]]=t,u=Kp(n),f=Kp(r),l=Kp(o),h=Kp(i),a=u+(l+u)*e,p=f+(h+f)*e;return[a+(l+(Kp(s)+l)*e+a)*e,p+(h+(Kp(c)+h)*e+p)*e]}if(2===t.length){const[[n,r],[o,i]]=t,s=Kp(n),c=Kp(r);return[s+(Kp(o)+s)*e,c+(Kp(i)+c)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const nd=Math.abs,ed=[[0,0],[0,0],[0,0],[0,0]];function rd(t,n,e){return 0===n?1===e?{ps:t,_ps:ed}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-a))))),b=c-n*(c-f),x=f-n*(f-h),_=b-n*(b-x),I=_-n*(_-(x-n*(x-(h-n*(h-p))))),N=nd(n),S=nd(s),E=nd(u),w=nd(l),M=nd(a),P=nd(c),T=nd(f),y=nd(h),C=S+N*(S+E),O=E+N*(E+w),A=C+N*(C+O),z=P+N*(P+T),B=T+N*(T+y),Y=z+N*(z+B);return{ps:[[s,c],[d,b],[v,_],[m,I]],_ps:[[0,0],[C,z],[A,Y],[A+N*(A+(O+N*(O+(w+N*(w+M))))),Y+N*(Y+(B+N*(B+(y+N*(y+nd(p))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=m-n*(m-b),_=c-n*(c-f),I=f-n*(f-h),N=h-n*(h-p),S=_-n*(_-I),E=I-n*(I-N),w=S-n*(S-E),M=nd(n),P=nd(s),T=nd(u),y=nd(l),C=nd(a),O=nd(c),A=nd(f),z=nd(h),B=P+M*(P+T),Y=T+M*(T+y),F=y+M*(y+C),V=B+M*(B+Y),k=Y+M*(Y+F),L=O+M*(O+A),D=A+M*(A+z),X=z+M*(z+nd(p)),q=L+M*(L+D),Q=D+M*(D+X);return{ps:[[x,w],[b,E],[v,N],[a,p]],_ps:[[V+M*(V+k),q+M*(q+Q)],[k,Q],[F,X],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=s[0]-c,I=b+x,N=n*b,S=e*b,E=_-3*x,w=u-l,M=a-l,P=s[1]-u,T=w+M,y=n*w,C=e*w,O=P-3*M,A=d*E+(3*n*(n*I-b)+c),z=m*(n*E+2*I)+(p*I+c-(S+2*N)),B=m*(e*E+2*I)+(g*I+c-(2*S+N)),Y=v*E+(3*e*(e*I-b)+c),F=d*O+(3*n*(n*T-w)+u),V=m*(n*O+2*T)+(p*T+u-(C+2*y)),k=m*(e*O+2*T)+(g*T+u-(2*C+y)),L=v*O+(3*e*(e*T-w)+u),D=nd(n),X=nd(e),q=nd(m),Q=nd(d),$=nd(v),G=nd(c),H=nd(f),R=G+H,U=nd(h)+H,Z=R+U,j=D*R,W=X*R,J=nd(_)+3*U,K=nd(u),tt=nd(l),nt=K+tt,et=nd(a)+tt,rt=nt+et,ot=D*nt,it=X*nt,st=nd(P)+3*et;return{ps:[[A,F],[z,V],[B,k],[Y,L]],_ps:[[Q*J+(3*D*(D*Z+R)+G),Q*st+(3*D*(D*rt+nt)+K)],[q*(D*J+2*Z)+(p*Z+G+(W+2*j)),q*(D*st+2*rt)+(p*rt+K+(it+2*ot))],[q*(X*J+2*Z)+(g*Z+G+(2*W+j)),q*(X*st+2*rt)+(g*rt+K+(2*it+ot))],[$*J+(3*X*(X*Z+R)+G),$*st+(3*X*(X*rt+nt)+K)]]}}(t,n,e)}const od=Math.abs,id=[[0,0],[0,0],[0,0]];function sd(t,n,e){return 0===n?1===e?{ps:t,_ps:id}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=s-u,d=[[i,s],[-n*a+i,-n*p+s],[h*(a+(f-c))-(2*n*a-i),h*(p+(l-u))-(2*n*p-s)]],g=od(n),v=od(i),m=od(c),b=od(f),x=v+m,_=od(s),I=od(u),N=_+I;return{ps:d,_ps:[[0,0],[g*x+v,g*N+_],[h*(x+(b+m))+(2*g*x+v),h*(N+(od(l)+I))+(2*g*N+_)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u,v=[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]],m=od(n),b=od(i),x=od(c),_=b+x,I=od(f)+x,N=od(s),S=od(u),E=N+S;return{ps:v,_ps:[[h*(_+I)+(2*m*_+b),h*(E+(od(l)+S))+(2*m*E+N)],[m*I+x,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=i[0],h=i[1],a=n*n,p=e*e,d=n*e,g=s-u,v=g+(l-u),m=c-f,b=m+(h-f),x=a*v-(2*n*g-s),_=d*v-(g*(e+n)-s),I=p*v-(2*e*g-s),N=a*b-(2*n*m-c),S=d*b-(m*(e+n)-c),E=p*b-(2*e*m-c),w=od(n),M=od(e),P=od(d),T=od(s),y=od(u),C=T+y,O=C+od(l)+y,A=od(c),z=od(f),B=A+z,Y=B+od(h)+z;return{ps:[[x,N],[_,S],[I,E]],_ps:[[a*O+(2*w*C+T),a*Y+(2*w*B+A)],[P*O+(C*(M+w)+T),P*b+(B*(M+w)+A)],[p*O+(2*M*C+T),p*Y+(2*M*B+A)]]}}(t,n,e)}const cd=Math.abs,ud=[[0,0],[0,0]];const fd=Number.EPSILON/2,ld=Zp(1);function hd(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=rd(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=e[3][0],u=9*fd*r[0][0],f=9*fd*r[1][0],l=9*fd*r[2][0],h=9*fd*r[3][0],a=e[0][1],p=e[1][1],d=e[2][1],g=e[3][1],v=9*fd*r[0][1],m=9*fd*r[1][1],b=9*fd*r[2][1],x=9*fd*r[3][1],_=Math.min(o-u,i-f,s-l,c-h),I=Math.max(o+u,i+f,s+l,c+h);return[[_,Math.min(a-v,p-m,d-b,g-x)],[I,Math.max(a+v,p+m,d+b,g+x)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=sd(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=5*fd*r[0][0],u=5*fd*r[1][0],f=5*fd*r[2][0],l=e[0][1],h=e[1][1],a=e[2][1],p=5*fd*r[0][1],d=5*fd*r[1][1],g=5*fd*r[2][1],v=Math.min(o-c,i-u,s-f),m=Math.max(o+c,i+u,s+f);return[[v,Math.min(l-p,h-d,a-g)],[m,Math.max(l+p,h+d,a+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:ud}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[o,i],[n*(s-o)+o,n*(c-i)+i]],f=cd(n),l=cd(o),h=cd(s),a=cd(i);return{ps:u,_ps:[[0,0],[f*(h+l)+l,f*(cd(c)+a)+a]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[n*(s-o)+o,n*(c-i)+i],[s,c]],f=cd(n),l=cd(o),h=cd(s),a=cd(i);return{ps:u,_ps:[[f*(h+l)+l,f*(cd(c)+a)+a],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1],f=[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]],l=cd(n),h=cd(e),a=cd(i),p=cd(c),d=cd(s),g=cd(u);return{ps:f,_ps:[[l*(p+a)+a,l*(g+d)+d],[h*(p+a)+a,h*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=3*fd*r[0][0],c=3*fd*r[1][0],u=e[0][1],f=e[1][1],l=3*fd*r[0][1],h=3*fd*r[1][1],a=Math.min(o-s,i-c),p=Math.max(o+s,i+c);return[[a,Math.min(u-l,f-h)],[p,Math.max(u+l,f+h)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Jp(t,n);let i;if(4===t.length)i=td(t,[0,n]).map((t=>8*ld*t));else if(3===t.length)i=td(t,[0,n]).map((t=>5*ld*t));else if(2===t.length)i=td(t,[0,n]).map((t=>2*ld*t));else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}const ad=Number.EPSILON/2,pd=ad*ad;function dd(t){const n=t*pd;return n/(1-n)}const gd=te,vd=oe,{abs:md}=Math,bd=dd(3);function xd(t,n,e){const r=t.length-1,o=[t[0]];let i=n[0];const s=[i];for(let c=1;c<r;c++){const r=o[c-1],u=e*r[1],f=md(e)*i+md(u),l=t[c];i=n[c]+f+md(l[1]+u);const h=vd(l,gd(e,r));o.push(h),s.push(i)}return{coeffs:o,errBound:s.map((t=>bd*t))}}const _d=cn,Id=on;function Nd(t,n){const e=t.length-1,r=[t[0]];for(let o=1;o<e;o++)r.push(Id(t[o],_d(n,r[o-1])));return r}const Sd=H,Ed=T,wd=sn,Md=on,Pd=Number.EPSILON,Td=dd(3),{sqrt:yd}=Math;function Cd(t,n,[e,r]=[0,1],o=void 0,i=void 0,s=!1,c=0){const u=t.ps,f=0===c&&t===o;let{polyDd:l,polyE:h,getPolyExact:a}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:lp(t,n),polyE:$p(t,n).map((t=>10*Wp*t)),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i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ot,ct,lt,yp(ht,at)]}(t,n)};if(2===e)return{polyDd:bp(t,n),polyE:Gp(t,n).map((t=>8*Wp*t)),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[s,c]]=t,[u,f]=n,l=Op(e,u),h=Op(o,u),a=Op(s,u),p=Op(r,f),d=Op(i,f),g=Op(c,f),v=Ap(l,l),m=Ap(l,h),b=Ap(l,a),x=Ap(h,h),_=Ap(h,a),I=Ap(a,a),N=Ap(p,p),S=Ap(p,d),E=Ap(p,g),w=Ap(d,d),M=Ap(d,g),P=Ap(g,g),T=Yp(E,Bp(w)),y=Yp(b,Bp(x)),C=Yp(Fp(Yp(I,Bp(y)),Vp(Yp(_,m))),v),O=Yp(Fp(Yp(P,Bp(T)),Vp(Yp(M,S))),N),A=Yp(C,O),z=Yp(Fp(_,y),Fp(zp(3,m),v)),B=Yp(Fp(M,T),Fp(zp(3,S),N)),Y=zp(3,Yp(z,B)),F=Fp(T,zp(3,Fp(Bp(S),N))),V=Fp(y,zp(3,Fp(Bp(m),v))),k=Yp(F,V),L=Fp(S,N),D=Fp(m,v);return[A,Y,k,Yp(L,D)]}(t,n)};if(1===e)return{polyDd:Sp(t,n),polyE:Hp(t,n).map((t=>6*Wp*t)),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=kp(e,s),f=kp(o,s),l=kp(r,c),h=kp(i,c),a=Lp(u,u),p=Lp(u,f),d=Lp(f,f),g=Lp(l,l),v=Lp(l,h),m=Lp(h,h),b=Xp(p,v),x=Xp(g,a);return[Xp(Xp(d,m),Xp(Dp(b),x)),qp(b,x)]}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order <= 3")}(u,n);const p=f?xd(l,h.map((t=>t/Td)),i):void 0,d=s&&f?xd(p.coeffs,p.errBound.map((t=>t/Td)),i):void 0,g=s&&f?xd(d.coeffs,d.errBound.map((t=>t/Td)),i):void 0,{polyDd:v,polyE:m,getPolyExact:b}=void 0!==g?{polyDd:g.coeffs,polyE:g.errBound.map((t=>t/Td)),getPolyExact:()=>Nd(Nd(Nd(a(),i),i),i)}:void 0!==p?{polyDd:p.coeffs,polyE:p.errBound.map((t=>t/Td)),getPolyExact:()=>Nd(a(),i)}:{polyDd:l,polyE:h,getPolyExact:a},x=Nr(v,e,r,m,b),_=1===i&&t===o.next||0===i&&t===o,I=0===i&&t===o.prev||1===i&&t===o;0===e?_||x.push({tS:0,tE:0,multiplicity:1}):1===e?I||x.push({tS:1,tE:1,multiplicity:1}):x.push({tS:e,tE:e,multiplicity:1}),0===r?_||x.push({tS:0,tE:0,multiplicity:1}):1===r?I||x.push({tS:1,tE:1,multiplicity:1}):x.push({tS:r,tE:r,multiplicity:1});const N=x.map((o=>{const{tS:i,tE:s}=o;if(s<e||i>r)return;const c=(i+s)/2,f=c<0?0:c>1?1:c,l=hd(u,[i,s]),h=function(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}(l),a=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,c],[s,i],[s,c]]){const e=Ed(t,u),r=Ed(n,f),o=Md(wd(e,e),wd(r,r)),i=Sd(o),s=i*(1-Pd),c=i*(1+Pd);s<=l&&(l=s),c>=h&&(h=c)}return[l,h]}(l,n),p=0===f?1:f;return{curve:0===f?t.prev:t,p:h,t:p,d:(yd(a[0])+yd(a[1]))/2,dSquaredI:a,box:l}}));return N.filter((t=>void 0!==t))}const Od=p;function Ad(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=n[0],f=n[1];return u<o?f<i?Od(t[0],n):f>c?Od([o,c],n):(o-u)**2:u>s?f<i?Od([s,i],n):f>c?Od(t[1],n):(u-s)**2:f<i?(i-f)**2:f>c?(f-c)**2:0}function zd(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=w(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=hd(t,i);c[0][0]<r.box[0][0]&&(r={ts:i,box:c}),c[1][0]>o.box[0][0]&&(o={ts:i,box:c})}return{minX:r,maxX:o}}(t),e=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=w(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=hd(t,i);c[0][1]<r.box[0][1]&&(r={ts:i,box:c}),c[1][1]>o.box[0][1]&&(o={ts:i,box:c})}return{minY:r,maxY:o}}(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const Bd=P(zd);function Yd(t){let n=0;for(let e=0;e<t.length-1;e++)n+=$r(t[e],t[e+1]);return n}function Fd(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,s;const c=Yd(t);if(256*p(t[0],t[t.length-1])<c*c){const[r,o]=Jp(t,.5),c=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/c,s=(r-n)/c}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,s=(r-n)/t}const u=function(t,n,e){const r=I(t[0].map((t=>-t)));return zd(t.map((t=>S(-n,e,r(t)))))}(t,i,s),[[f,l],[h,a]]=u,d=[u[0],[h,l],u[1],[f,a]],g=S(i,s);return d.map((n=>I(t[0],g(n))))}function Vd(t,n){const e=[0,1,2,3].map((e=>function(t,n){const e=p,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let s=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return s=Math.max(0,Math.min(1,s)),e(t,[r[0]+s*(o[0]-r[0]),r[1]+s*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]]))),r=p(t[0],t[1]),o=p(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const kd=P(Fd);function Ld(t,n){const e=function(t,n){let e=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){const o=t[r],i=o.curve.ps,s=Jp(i,o.ts[0]),c=Jp(i,o.ts[1]),u=Math.min(p(n,s),p(n,c));u<e&&(e=u)}return(1+2**-10)*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],s=i.curve.ps;Ad(Bd(s),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],s=i.curve.ps;Vd(kd(s),n)<=e&&r.push(i)}return r}(t,n,e),t}function Dd(t,n,e=void 0,r=void 0,o=!1,i=0){t=Ld(t,n);const s=[];for(let c=0;c<t.length;c++){const u=t[c],f=Cd(u.curve,n,u.ts,e,r,o,i);s.push(...f)}let c=Number.POSITIVE_INFINITY;for(let t=0;t<s.length;t++){const n=s[t].dSquaredI[1];n<c&&(c=n)}const u=[];for(let t=0;t<s.length;t++){const n=s[t];n.dSquaredI[0]<=c&&u.push(n)}return u.map((t=>Se(t.curve,t.t,!1)))}function Xd(t,n){return n.map((n=>Dd(n,t)[0]))}function qd(t,n,e){const r=ep(e);let o,i,s,c,u=1,f=0;do{i=I([(h=u)*(l=e)[0],h*l[1]],n),s=Xd(i,t),c=ep(d(i,np(s.map((t=>t.p))))),o=c<r,u/=2,f++}while(!o&&f<3);var l,h;return{newX:i,newV:c,newPs:s}}const Qd=d;function $d(t,n,e,r,o){const i=2**-32*o,s=[t[0],t[n],t[t.length-1]],c=[r[0],r[n],r[t.length-1]],u=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e],f=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e];if(Yn(u[0][0]))return;let l,h,a=0,p=function(t,n){const e=t[0][0].cp.circle.center,r=Dd(n[1],e)[0];return np([t[0][0].cp.pointOnShape.p,r.p,t[2][1].cp.pointOnShape.p])}(u,f);if("undefined"!=typeof _debug_){const t=_debug_.generated.elems.threeProng,n=t[t.length-1];n.traces[n.traces.length-1].push(p)}let g=Number.POSITIVE_INFINITY;for(;g>i&&a<10;){if(a++,l=Xd(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;h=np(l.map((t=>t.p)));const t=Qd(p,h);if(!Number.isFinite(t[0])||!Number.isFinite(t[1]))return;const n=qd(f,p,t);if(p=n.newX,l=n.newPs,"undefined"!=typeof _debug_){const t=_debug_.generated.elems.threeProng,n=t[t.length-1];n.traces[n.traces.length-1].push(p)}const e=ep(t);g=Math.abs(e-n.newV)}const v=($r(p,l[0].p)+$r(p,l[1].p)+$r(p,l[2].p))/3,m={center:p,radius:v};let b=0;for(let t=0;t<3;t++){const n=l[t],e=N(d(n.p,p)),r=x(e);if(Ra(n)){const t=dn(n.curve).tangents.map(x),r=Math.asin(_(t[0],e)),o=Math.asin(_(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),b+=i}else{const t=N(M(n.curve.ps,n.t));b+=Math.abs(Math.asin(_(r,t)))}}const I=[];for(let t=0;t<r.length;t++){const n=Dd(r[t],p)[0];I.push($r(n.p,p))}const S=Math.min(...I);return{ps:l,circle:m,error:1*Math.abs(v-S)+1*b,δ3s:u}}const Gd=P((t=>!!vn(t)&&gn(t).isQuiteSharp));function Hd(t){let n=t[0];const e=t[1],r=[];let o=!0;do{if(!o){o=!0,n=n.prevOnCircle;continue}o=!1;const t=n.cp.pointOnShape,e=n.next.cp.pointOnShape;e.curve===t.curve&&Gd(t)&&Gd(e)||(e.curve===t.curve&&h(n.next.cp,n.cp)>0?r.push({curve:t.curve,ts:[t.t,e.t]}):(r.push({curve:t.curve,ts:[t.t,1]}),n.cp.pointOnShape.curve.loop===n.next.cp.pointOnShape.curve.loop&&Rd(r,t.curve,e.curve,e.t))),n=n.next}while(n!==e);return r}function Rd(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function Ud(){if("undefined"!=typeof _debug_){const t=_debug_.generated.elems.threeProng,n=[];t[t.length-1].traces.push(n)}}function Zd(t,n,e){"undefined"!=typeof _debug_&&t.push({circle:n,ps:e})}function jd(t,n,e,r){const o=t.findBounds(Sn({pointOnShape:n,circle:void 0,order:e,order2:r},!1,!1));return o[0]||o[1]?o[0]&&o[1]?[o[0].datum,o[1].datum]:[t.max(t.root),t.min(t.root)]:[void 0,void 0]}function Wd(t,n,e,r,o){const i=r.map(((r,i)=>{const s=e.get(r.curve.loop);return yn(!1,!1,s,{pointOnShape:r,circle:t,order:n[i],order2:0},(o?o[i]:jd(s,r,n[i],0))[0])})),s=r.length;for(let t=0;t<s;t++){const n=0===t?s-1:t-1,e=t===s-1?0:t+1;i[t].prevOnCircle=i[n],i[t].nextOnCircle=i[e]}return i}const Jd=Math.cos(Math.PI/180*3);function Kd(t,n,e,r,o,i){const s=2e-14*i,c=.02*s,u=jd(t.get(n.curve.loop),n,r,o);if(!u[0])return;const{p:f,t:l}=n;for(const t of u){const n=t.cp.pointOnShape.p,r=$r(f,n);if(!(r>s)&&(b(N(d(n,t.cp.circle.center)),N(d(f,e.center)))>Jd||r<c&&0!==l&&1!==l))return t}}let tg=0;function ng(t,n,e){let r;do{if(r=Xn(n),r.length>2){const n=eg(t,r,e);1===n.length&&n[0],tg++}if("undefined"!=typeof _debug_&&tg===_debug_.directives.stopAfterThreeProngsNum)return}while(r.length>2);return r}function eg(t,n,e){const r=[];for(const t of n)r.push([t,t.next]);const o=function(t,n){const e=t.map(Hd);!function(t){if("undefined"!=typeof _debug_){const n=_debug_.generated.elems.threeProng;n.push({generated:void 0,circle:void 0,poss:void 0,cp3ss:void 0,cpss:void 0,bestIndx:void 0,candidateThreeProngs:void 0,visitedCps:void 0,boundaries:void 0,traces:void 0});const e=n[n.length-1];e.boundaries=[];for(const n of t){const t=[];e.boundaries.push(t);for(const e of n){const n=Ja(e.curve.ps,e.ts[0],e.ts[1]);t.push(n)}}e.traces=[]}}(e);const r=[];let o,i,s=Number.POSITIVE_INFINITY;for(let c=1;c<t.length-1;c++)for(let u=0;u<3;u++){Ud();const f=$d(t,c,u,e,n);if(!f)continue;const{circle:l,ps:h,error:a,δ3s:p}=f;Zd(r,l,h),a<s&&(s=a,i=c-1,o={circle:l,ps:h,δ3s:p})}return function(t,n,e,r){if("undefined"!=typeof _debug_){const o=_debug_.generated.elems.threeProng,i=o[o.length-1];i.generated=_debug_.generated,void 0!==t&&(i.circle=t.circle,i.poss=t.ps,i.cp3ss=t.δ3s),i.cpss=n,i.bestIndx=e,i.candidateThreeProngs=r}}(o,t,i,r),o}(r,e),i=[];for(let t=0;t<3;t++)i.push(Ua(o.circle,o.ps[t]));const s=function(t,n,e){const{circle:r,ps:o,δ3s:i}=e;return Kd(t,o[0],r,n[0],0,1e3),Kd(t,o[1],r,n[1],0,1e3),Kd(t,o[2],r,n[2],0,1e3),Wd(r,n,t,o,i)}(t,i,o);return"undefined"!=typeof _debug_&&3===s.length&&function(t,n){const e=_debug_.generated.elems.threeProng,r=e[e.length-1];r.visitedCps=n,r.circle=t}(s[0].cp.circle,n),s}function rg(t,n,e){function r(n,e){let r=t.get(n);r||(r=new Set,t.set(n,r)),r.add(e)}void 0!==n&&(r(n,e),r(e,n))}function og(t,n,e){let r;r=t.get(n);const o=r&&r.has(e);r=t.get(e);const i=r&&r.has(n);return o||i}const ig=-1,sg=1,cg=0;class ug{constructor(t){this.datum=t,this.color=cg}}function fg(t){return!!t&&t.color===cg}class lg{constructor(t,n=!0,e){if(this.compare=t,this.duplicatesAllowed=n,this.getMinNode=this.getMinOrMaxNode(ig),this.getMaxNode=this.getMinOrMaxNode(sg),this.root=void 0,this.nodeCount=0,this.valueCount=0,e)for(const t of e)this.insert(t)}isEmpty(){return!this.root}find(t){const n=this;let e=this.root;for(;e;){const r=n.compare(t,e.datum);if(0===r)return e;e=e[r>0?sg:ig]}}toArrayInOrder(){const t=[];return function n(e){e&&(n(e[ig]),t.push(e.datum),void 0!==e.extras&&t.push(...e.extras),n(e[sg]))}(this.root),t}insertMulti(t){const n=this;for(const e of t)n.insert(e)}insert(t){const n=this;n.root=function t(e,r){if(void 0===e)return n.valueCount++,n.nodeCount++,new ug(r);const o=n.compare(r,e.datum);if(0===o&&(n.duplicatesAllowed?(n.valueCount++,void 0===e.extras?e.extras=[r]:e.extras.push(r)):e.datum=r),0!==o){const n=o>0?sg:ig;e[n]=t(e[n],r),e[n].parent=e}return fg(e[sg])&&!fg(e[ig])&&(e=hg(ig,e)),fg(e[ig])&&fg(e[ig][ig])&&(e=hg(sg,e)),fg(e[ig])&&fg(e[sg])&&pg(e),e}(n.root,t),n.root.color=1,n.root.parent=void 0}remove(t,n=!1,e){const r=this;if(void 0===r.root)return;let o;const i=function t(i,s){const c=r.duplicatesAllowed&&void 0!==i.extras;let u=r.compare(s,i.datum);if(u<0&&!i[ig]||u>0&&!i[sg])return i;if(u<0){fg(i[ig])||fg(i[ig][ig])||(i=dg(i));const n=t(i[ig],s);return null===n?null:(i[ig]=n,i[ig]&&(i[ig].parent=i),gg(i))}if(fg(i[ig])&&(i=hg(sg,i),u=r.compare(s,i.datum)),0===u&&!i[sg]){if(c&&!n){if(void 0===e||!0===e(s,i.datum))return o=i.datum,i.datum=i.extras.pop(),r.valueCount--,0===i.extras.length&&(i.extras=void 0),i;{const t=i.extras;for(let n=0;n<t.length;n++)if(!0===e(s,t[n]))return o=t.splice(n,1)[0],r.valueCount--,0===t.length&&(i.extras=void 0),i;return null}}return void 0===e||!0===e(s,i.datum)?(o=i.datum,r.valueCount-=1+(c?i.extras.length:0),void r.nodeCount--):null}if(fg(i[sg])||fg(i[sg][ig])||(i=function(t){return pg(t),fg(t[ig][ig])&&pg(t=hg(sg,t)),t}(i),u=r.compare(s,i.datum)),0===u)if(c&&!n)if(void 0===e||!0===e(s,i.datum))o=i.datum,i.datum=i.extras.pop(),r.valueCount--,0===i.extras.length&&(i.extras=void 0);else{const t=i.extras;let n=!1;for(let c=0;c<t.length;c++)if(!0===e(s,t[c])){o=t.splice(c,1)[0],r.valueCount--,0===t.length&&(i.extras=void 0),n=!0;break}if(!n)return null}else{if(void 0!==e&&!0!==e(s,i.datum))return null;{r.valueCount-=1+(c?i.extras.length:0),o=i.datum;const t=r.getMinNode(i[sg]);i.datum=t?.datum,r.duplicatesAllowed&&(i.extras=t?.extras),i[sg]=ag(i[sg]),r.nodeCount--}}else{const n=t(i[sg],s);if(null===n)return null;i[sg]=n}return i[sg]&&(i[sg].parent=i),gg(i)}(r.root,t);return null!==i?(r.root=i,void 0!==r.root&&(r.root.color=1,r.root.parent=void 0),o):void 0}findBounds(t){const n=this;let e=n.root;const r=[void 0,void 0];if(void 0===e)return r;for(;e;){const o=n.compare(t,e.datum);o>=0?r[0]=e:r[1]=e,e=e[o>=0?sg:ig]}return r}findBoundsExcl(t){const n=this,e=n.root,r=[void 0,void 0];return void 0===e||function e(o){for(;o;){const i=n.compare(t,o.datum);if(0===i)return e(o[ig]),void e(o[sg]);i>0?r[0]=o:i<0&&(r[1]=o),o=o[i>0?sg:ig]}}(e),r}findAll(t){const n=this;let e=this.root;for(;e;){const r=n.compare(t,e.datum);if(0===r)return[e.datum,...e.extras?e.extras:[]];e=e[r>0?sg:ig]}return[]}getMinOrMaxNode(t){return n=>{if(void 0===n&&(n=this.root),n){for(;n[t];)n=n[t];return n}}}min(t){void 0===t&&(t=this.root);const n=this.getMinNode(t);if(void 0!==n)return n.datum}max(t){void 0===t&&(t=this.root);const n=this.getMaxNode(t);if(void 0!==n)return n.datum}}function hg(t,n){const e=n[-t];return n[-t]=e[t],e[t]&&(e[t].parent=n),e[t]=n,n.parent=e,e.color=n.color,n.color=cg,e}function ag(t){if(t[ig])return fg(t[ig])||fg(t[ig][ig])||(t=dg(t)),t[ig]=ag(t[ig]),t[ig]&&(t[ig].parent=t),gg(t)}function pg(t){t.color=(t.color+1)%2,t[ig].color=(t[ig].color+1)%2,t[sg].color=(t[sg].color+1)%2}function dg(t){if(pg(t),fg(t[sg][ig])){const n=hg(sg,t[sg]);t[sg]=n,n.parent=t,pg(t=hg(ig,t))}return t}function gg(t){return fg(t[sg])&&(t=hg(ig,t)),fg(t[ig])&&fg(t[ig][ig])&&(t=hg(sg,t)),fg(t[ig])&&fg(t[sg])&&pg(t),t}const vg=Rr;let mg;const bg=Number.POSITIVE_INFINITY,xg=P((function(t){const n=[[{bezier:void 0,t:void 0,val:bg},{bezier:void 0,t:void 0,val:bg}],[{bezier:void 0,t:void 0,val:-bg},{bezier:void 0,t:void 0,val:-bg}]];return t.curves.forEach((function(t){const e=function(t){const n=w(t),e=Ni(n[0],0,1),r=Ni(n[1],0,1);e.push(0,1),r.push(0,1);let o,i,s,c,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[s]=Jp(t,r);s<u&&(u=s,o=r),s>f&&(f=s,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Jp(t,e);o<l&&(l=o,s=e),o>h&&(h=o,c=e)}return{ts:[[o,s],[i,c]],box:[[u,l],[f,h]]}}(t.ps);{const r=e.box[0][0],o=n[0][0].val;(r<o||r===o&&e.ts[0][0]>n[0][0].t)&&(n[0][0]={bezier:t,t:e.ts[0][0],val:r})}{const r=e.box[0][1],o=n[0][1].val;(r<o||r===o&&e.ts[0][1]>n[0][1].t)&&(n[0][1]={bezier:t,t:e.ts[0][1],val:r})}{const r=e.box[1][0],o=n[1][0].val;(r>o||r===o&&e.ts[1][0]>n[1][0].t)&&(n[1][0]={bezier:t,t:e.ts[1][0],val:r})}{const r=e.box[1][1],o=n[1][1].val;(r>o||r===o&&e.ts[1][1]>n[1][1].t)&&(n[1][1]={bezier:t,t:e.ts[1][1],val:r})}})),{minY:Se(n[0][1].bezier,n[0][1].t,!0),minX:Se(n[0][0].bezier,n[0][0].t,!0),maxX:Se(n[1][0].bezier,n[1][0].t,!0),maxY:Se(n[1][1].bezier,n[1][1].t,!0)}})),_g=P((function(t){let n,e,r,o,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(const f of t){const t=xg(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>s&&(e=t.maxX,s=t.maxX.p[0]),t.minY.p[1]<c&&(r=t.minY,c=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}})),Ig=oe,Ng=te;function Sg(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ig(t[r],Ng(n,e));return e}Sg([[0,1],[0,1],[0,-2],[0,3]],.25);const Eg=ge,wg=pe,Mg=te,Pg=oe,Tg=re;function yg(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Mg(3,Pg(wg(c,n),Mg(3,wg(r,i)))),Mg(6,Tg(Eg(i,n),-2*r)),Mg(3,wg(r,n))],[Mg(3,Pg(wg(u,e),Mg(3,wg(o,s)))),Mg(6,Tg(Eg(s,e),-2*o)),Mg(3,wg(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[Tg(Eg(2*i,2*n),-4*r),wg(2*r,2*n)],[Tg(Eg(2*s,2*e),-4*o),wg(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[wg(r,n)],[wg(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Cg=pe,Og=oe,Ag=te,zg=re;function Bg(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Ag(6,Og(Cg(c,n),Ag(3,Cg(r,i)))),Ag(6,zg(Cg(i,2*r),n))],[Ag(6,Og(Cg(u,e),Ag(3,Cg(o,s)))),Ag(6,zg(Cg(s,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[[zg(Cg(2*i,4*r),2*n)],[zg(Cg(2*s,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Yg=le,Fg=oe,Vg=ie,kg=T,Lg=pt,Dg=j,Xg=on,qg=at;function Qg(t,n,e=!1){const r=n.curve.ps,{p:o,t:i}=n;let s=-function(t,n){const[e,r]=yg(t),[o,i]=Bg(t),s=Sg(e,n),c=Sg(r,n),u=Sg(o,n),f=Sg(i,n),l=Vg(Yg(s,f),Yg(c,u)),h=Fg(Yg(s,s),Yg(c,c)),a=Yg(h,Yg(h,h)),p=Math.sqrt(a[1]);return l[1]/p}(r,i);(s<t||e)&&(s=t);const c=function(t,n){const[e,r]=function(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Dg(3,Xg(kg(c,n),Dg(3,kg(r,i)))),Dg(6,qg(Lg(i,n),-2*r)),Dg(3,kg(r,n))],[Dg(3,Xg(kg(u,e),Dg(3,kg(o,s)))),Dg(6,qg(Lg(s,e),-2*o)),Dg(3,kg(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[qg(Lg(2*i,2*n),-4*r),kg(2*r,2*n)],[qg(Lg(2*s,2*e),-4*o),kg(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[kg(r,n)],[kg(o,e)]]}(t);if(1===t.length)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t);return[$e(e,n),$e(r,n)]}(r,i).map((t=>t[t.length-1])),u=[-c[1],c[0]],f=Math.sqrt(u[0]**2+u[1]**2);return{center:[o[0]-u[0]/(s*f),o[1]-u[1]/(s*f)],radius:1/s}}function $g(t){return t.holeClosing?"twoProng_holeClosing":"twoProng_regular"}const{abs:Gg}=Math,Hg=pe,Rg=de;function Ug(t,n,e){const r=Gg(t[1]-n[1])>Gg(t[0]-n[0]);let o,i,s,c,u,f;r?(o=t[1],i=t[0],s=n[1],c=n[0],u=e[1],f=e[0]):(o=t[0],i=t[1],s=n[0],c=n[1],u=e[0],f=e[1]);const l=he(Hg(i,c),Hg(o,s)),h=ie([0,c],se(s,l)),a=oe(ie(oe(Rg(s,s),Rg(c,c)),oe(Rg(u,u),Rg(f,f))),ce(le(h,Hg(f,c)))),p=oe(Hg(s,u),le(l,Hg(c,f))),d=he(a,ce(p)),g=oe(le(l,d),h);return r?[g[1],d[1]]:[d[1],g[1]]}function Zg(t,n,e,r){const o=(2**-14*t)**2;if(p(n,r)<o)return;const i=[(n[0]+r[0])/2,(n[1]+r[1])/2],s=[r[0]-n[0],r[1]-n[1]],c=[-s[1],s[0]],u=a([n,e],[i,[i[0]+c[0],i[1]+c[1]]]);return u?b([u[0]-n[0],u[1]-n[1]],[e[0]-n[0],e[1]-n[1]])<0?void 0:u:void 0}function jg(t,n){const[e,r]=t,[o,i]=n,s=pe(e,o),c=pe(r,i),u=le(s,s),f=le(c,c);return oe(u,f)[1]}function Wg(t,n,e){if(t.length<=1)return t;const r=[];for(const o of t){const t=o.curve.ps;Ad(Bd(t),n)<=1.0009765625*e&&r.push(o)}return r}function Jg(t,n,e,r){if(Ra(r))return;const o={radius:t,center:n};if(Kd(e,r,o,Ua(o,r),0,1e3))return;const i=Wd(o,[-.5,.5],e,[r,r]);"undefined"!=typeof _debug_&&_debug_.generated.elems.oneProng.push(i)}const{sqrt:Kg,abs:tv,sin:nv,cos:ev}=Math;function rv(t,n,e,r,o,i,s,c,u){const f=(2**-21*e)**2,l=2**-46*e,h=Kg(r),a=1/h;let v;const m=i.p;let b;if(s)v=[m[0],m[1]-h],b=h;else if(0===t)({center:v,radius:b}=Qg(a,i));else{({center:v,radius:b}=Qg(a,i,!0));const n=d(i.p,v),e=S(nv(t),ev(t))(n);v=I(i.p)(e)}const{bezierPieces:x,δ:_}=function(t,n,e,r,o,i,s){if(n){const t=[];for(let n=0;n<e;n++){const e=r[n].curves.map((t=>({curve:t,ts:[0,1]})));t.push(...e)}return{bezierPieces:t,δ:void 0}}let c;const u=Ra(i)?1===i.t&&0===t?-1:0===i.t?1:Ua(s,i):0,f=r[e],l=jd(o.get(f),i,u,0)[0],h=[l,l];return c=l&&l!==l.next.next?Hd(h):f.curves.map((t=>({curve:t,ts:[0,1]}))),{bezierPieces:c,δ:h}}(t,s,c,n,o,i,{center:v,radius:b});let N=v;const E=Kg(function(t,n,e,r){let o,i=Number.POSITIVE_INFINITY;for(let s=0;s<n.length;s++){const c=n[s],u=c.curve.ps;let f=Number.POSITIVE_INFINITY;const l=Jp(u,c.ts[0]);if(!o||o[0]!==l[0]||o[1]!==l[1]){const n=Zg(t,e,r,l);n&&(f=p(e,n))}let h=Number.POSITIVE_INFINITY;const a=Jp(u,c.ts[1]),d=Zg(t,e,r,a);d&&(h=p(e,d)),o=a;const g=Math.min(f,h);g<i&&(i=g)}return(1+2**-10)*i}(e,x,m,v));b>E&&(N=g(m,v,E/b));const w=[];let M,P,T=x,y=0;for(;y<25;){const n=jg(N,i.p);if(y<5&&(T=Wg(T,N,n)),M=Dd(T,N,i.curve,i.t,u&&0==y&&b!==1/a,t).map((t=>Se(t.curve,t.t,!1))),P=M[0],void 0===P)return void ov(s);const e=jg(N,P.p),r=jg(i.p,P.p);if(0===y&&b<(1-2**-6)*Kg(e))return void Jg(b,v,o,i);if("undefined"!=typeof _debug_&&w.push({x:N,y:i,z:Se(P.curve,P.t,!1),t:i.t}),!s&&r<=f)return;if(N=Ug(N,i.p,P.p),tv(Kg(n)-Kg(e))<l)break;if(y++,25===y)return void("undefined"!=typeof _debug_&&console.log("failed (slow): max iterations reached"))}const C={center:N,radius:$r(N,P.p)};return"undefined"!=typeof _debug_&&function(t,n,e,r,o,i,s,c,u){c.push({x:e,y:r,z:o,t:r.t});const f={generated:_debug_.generated,bezierPieces:t,pos:r,δ:s,z:o?o.p:void 0,circle:i,xs:c,failed:!1,holeClosing:u,notAdded:!1,deleted:!1,cpNode:void 0},l=$g(f);_debug_.generated.elems[l].push(f)}(x,0,N,i,P,C,_,w,s),{circle:C,zs:M}}function ov(t){if("undefined"!=typeof _debug_){const n=_debug_.generated.elems,e=t?n.twoProng_holeClosing:n.twoProng_regular,r=t?"hole-closing: "+e.length:"regular: "+e.length;console.log("failed: no closest point - "+r)}}function iv(t,n,e,r,o,i){let s=e.t;0===s&&(s=1,e=Se(e.curve.prev,s,!0));const c=Ua(n,e),u=r.map((t=>Ua(n,t)));let f=!1;for(let e=0;e<r.length;e++){const o=r[e],s=u[e];if(Kd(t,o,n,s,0,i)){f=!0;break}}if(Kd(t,e,n,c,0,i)||f)return void("undefined"!=typeof _debug_&&(o?_debug_.generated.elems.twoProng_holeClosing.pop():_debug_.generated.elems.twoProng_regular.pop()));const l=[],h=[],a=[],p=[],d=[];for(let e=0;e<r.length;e++){const i=r[e],s=u[e],c={pointOnShape:i,circle:n,order:s,order2:0};h.push(c);const f=i.curve.loop;d.push(f);const g=t.get(f);a.push(g);const v=jd(g,i,s,0);p.push(v),l.push(yn(o,!1,g,c,v[0]))}const g={pointOnShape:e,circle:n,order:c,order2:0},v=e.curve.loop,m=t.get(v),b=yn(o,!1,m,g,jd(m,e,c,0)[0]);if(1===l.length)b.prevOnCircle=l[0],b.nextOnCircle=l[0],l[0].prevOnCircle=b,l[0].nextOnCircle=b;else{const t=l.slice();t.push(b),t.sort(function(t){const n=t.center;return function(t,e){let r=t.cp.pointOnShape.p,o=e.cp.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(n));for(let n=0;n<t.length;n++){const e=n+1===t.length?0:n+1,r=0===n?t.length-1:n-1,o=t[n],i=t[e],s=t[r];o.nextOnCircle=i,o.prevOnCircle=s}}if(o){const t={pointOnShape:r[0],circle:n,order:h[0].order,order2:1},o=yn(!0,!1,a[0],t,l[0]),i=yn(!0,!1,m,{pointOnShape:e,circle:n,order:g.order,order2:-1},b.prev);i.prevOnCircle=o,i.nextOnCircle=o,o.prevOnCircle=i,o.nextOnCircle=i,l[0].next=b,b.prev=l[0],i.next=o,o.prev=i}if("undefined"!=typeof _debug_){let t;t=o?_debug_.generated.elems.twoProng_holeClosing:_debug_.generated.elems.twoProng_regular;const n=t[t.length-1];b||console.log("asas"),n.cpNode=b}return b}const{PI:sv,atan2:cv}=Math,uv=15*sv/180;function fv(t,n,e,r,o,i){let s;const c=_g(t),u=(c.maxX.p[0]-c.minX.p[0])**2+(c.maxY.p[1]-c.minY.p[1])**2;for(let c=0;c<r.length;c++){let f=[0];const l=r[c];if(1===l.t){const{curve:t}=l,n=pn(t.ps,t.next.ps);if(n.isQuiteDull){const t=Ha(n.tangents[0]),e=Ha(n.tangents[1]),r=(cv(t[1],t[0])+2*sv)%(2*sv),o=((cv(e[1],e[0])+2*sv)%(2*sv)-r+2*sv)%(2*sv);let i=uv;for(;i<=o-uv/2;)f.push(i),i+=uv}}for(let r of f){const f=rv(r,t,o,u,n,l,!1,e,i);if(f){const{circle:t,zs:e}=f,r=iv(n,t,l,e,!1,o);s=s||r}if("undefined"!=typeof _debug_&&c+1===_debug_.directives.stopAfterTwoProngsNum)return}}return s}function lv(t,n,e,r,o,i){for(let s=0;s<r.length;s++){const c=fv(n,e,s,r[s],o,i);t=t||c}return t}const hv=de,av=oe,pv=ie,{atan2:dv}=Math;function gv(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=pv(hv(i,e),hv(o,r))[1],c=av(hv(o,e),hv(i,r))[1];return dv(s,c)}const{abs:vv}=Math;function mv(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=vv(gv(n[t],n[t+1]));return r}function bv(t,n=.4,e=10,r=2**-16){const o={r:[0,1]};let i=o;for(;void 0!==i;){const o=i.r,s=Ja(t,o[0],o[1]);if(Yd(s)<=e&&mv(s)<=n||o[1]-o[0]<=r){i=i.next;continue}const c=(o[0]+o[1])/2,u=[o[0],c],f=[c,o[1]];i.r=u,i.next={r:f,next:i.next}}i=o;const s=[];for(;void 0!==i;)s.push(i.r[0]),void 0===i.next&&s.push(i.r[1]),i=i.next;return s}const xv=te,_v=pe,Iv=oe,Nv=te,Sv=ce,Ev=ue,wv=te,Mv=le,Pv=oe,Tv=ie;const{orient2d:yv}=un,Cv=Ft,Ov=R,Av=y,zv=rt,Bv=Number.EPSILON/2,Yv=Math.abs,Fv=K,Vv=T,kv=rt,Lv=y,Dv=H,Xv=Z,qv=pt;const Qv=pe,$v=te,Gv=le,Hv=oe,Rv=ie;function Uv(t){if(function(t){if(4===t.length)return 0===yv(t[0],t[1],t[2])&&0===yv(t[1],t[2],t[3])&&0===yv(t[0],t[2],t[3]);if(3===t.length)return 0===yv(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&function(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=c+3*r,l=n+3*i,h=f-l,a=Yv(3*r)+Yv(f)+(Yv(3*i)+Yv(l))+Yv(h);if(Yv(h)-Bv*a>0)return!1;const p=u+3*o,d=e+3*s,g=p-d,v=Yv(3*o)+Yv(p)+(Yv(3*s)+Yv(d))+Yv(g);return!(Yv(g)-Bv*v>0)&&0===Av(zv(Ov([c],Cv(3,r)),Ov([n],Cv(3,i))))&&0===Av(zv(Ov([u],Cv(3,o)),Ov([e],Cv(3,s))))}(t)&&(t=function(t,n=!1){if(!n){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[n,e],[Dv(kv(Xv(qv(r/4,i/4),3),qv(n/4,c/4))),Dv(kv(Xv(qv(o/4,s/4),3),qv(e/4,u/4)))],[c,u]]}const[e,r,o,i]=t,s=function(t,n){const[[e,r],[o,i]]=t,[[s,c],[u,f]]=n,l=Vv(o,e),h=Vv(i,r),a=Vv(u,s),p=Vv(f,c),d=kv(Fv(a,h),Fv(p,l));if(0===Lv(d))return;const g=Vv(s,e),v=Vv(c,r),m=kv(Fv(v,l),Fv(g,h)),b=Dv(m)/Dv(d);return[s+b*Dv(a),c+b*Dv(p)]}([e,r],[i,o]);if(void 0!==s)return[e,s,i]}(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,s]]=t,c=Qv(r,n),u=Qv(i,r),f=Rv(u,c),l=Qv(o,e),h=Qv(s,o),a=Rv(h,l),p=Hv(Rv($v(n,Rv(f,[0,-r])),$v(r,Rv(u,[0,-r]))),Rv($v(e,Rv(a,[0,-o])),$v(o,Rv(h,[0,-o]))));return[Hv(Gv(f,f),Gv(a,a)),ae(p)]}(t);return{minima:[],maxima:Nr(n,0,1).map((t=>(t.tS+t.tE)/2)),inflections:[]}}const n=function(t){const[[n,e,r],[o,i,s]]=yg(t),[[c,u],[f,l]]=Bg(t),[[h],[a]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Nv(6,Iv(_v(c,n),Nv(3,_v(r,i))))],[Nv(6,Iv(_v(u,e),Nv(3,_v(o,s))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),p=Mv(h,i),d=Mv(a,e),g=Mv(u,s),v=Mv(u,i),m=Mv(f,f),b=Mv(c,s),x=Mv(l,r),_=Mv(l,e),I=Mv(f,r),N=Mv(r,e),S=Mv(r,n),E=Mv(r,o),w=Mv(e,e),M=Mv(e,n),P=Mv(e,i),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0?s.push(n):c.push(n)}return{minima:s,maxima:c,inflections:Nr(e,0,1).map((t=>(t.tS+t.tE)/2))}}function Zv(t){return xg(t).minY}function jv(t,n,e,r,o){!function(t){if("undefined"==typeof _debug_)return;mg=performance.now();for(const n of t)_debug_.fs.nameObj(n,"l|");const n=_debug_.generated;for(const e of t){let t=0;e.curves.forEach((function(e){const r=e.ps,o=vg(r);n.elems.boundingHull.push(o);const i=Bd(r);n.elems.looseBoundingBox.push(i);const s=Fd(r);n.elems.tightBoundingBox.push(s);const c=dn(e);c.isQuiteSharp?n.elems.sharpCorner.push(e):c.isQuiteDull&&n.elems.dullCorner.push(e),t++}))}}(t);const i=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Yd(o.ps)<t||dn(o).isQuiteSharp&&e.push(Se(o,1,!0))}return e}}(n),s=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Yd(o.ps)<t||dn(o).isQuiteDull&&(e.push(Se(o,1,!0)),e.push(Se(o.next,0,!0)))}return e}}(n),c=t.map(i),u=t.map(s),f=new Map;if(function(t,n,e){let r;for(let o=0;o<e.length;o++){const i=e[o],s=new lg(wn,!1);let c,u;for(const t of i){t.curve.next.ps;const n={center:t.p,radius:0},e={pointOnShape:t,circle:n,order:1,order2:0};c=yn(!1,!1,s,{pointOnShape:t,circle:n,order:-1,order2:0},u),u=yn(!1,!1,s,e,c),c.prevOnCircle=u,u.prevOnCircle=c,c.nextOnCircle=u,u.nextOnCircle=c}r||(r=c);const f=t[o];n.set(f,s)}}(t,f,c),function(t,n,e){const r=_g(t),o=(r.maxX.p[0]-r.minX.p[0])**2+(r.maxY.p[1]-r.minY.p[1])**2,i=t.map(Zv);for(let r=1;r<i.length;r++){const s=i[r],c=rv(0,t,e,o,n,s,!0,r,!1);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:u,zs:f}=c;iv(n,u,s,[f[0]],!0,e)}}(t,f,o),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return;!function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.holeClosers+=n-mg,mg=n}();const l=t.map(function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(Yd(o.ps)<t)continue;const{minima:i,maxima:s}=Uv(o.ps),c=[...i,...s].map((t=>Se(o,t,!0)));e.push(...c)}return e}}(n)),h=t.map(function(t,n,e){return function(r){const o=[];for(let i=0;i<r.curves.length;i++){const s=r.curves[i];if(Yd(s.ps)<t)continue;let c=bv(s.ps,n,e);2===c.length&&(c=[0,.5,1]);const u=c.slice(1,c.length-1).map((t=>Se(s,t,!0)));o.push(...u)}return o}}(n,e,r));let a;if(a=lv(a,t,f,u,o,!1),a=lv(a,t,f,l,o,!0),a=lv(a,t,f,h,o,!1),function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.oneAnd2Prongs+=n-mg,mg=n}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return;if(void 0===a)return;if(function(t,n,e){const r=new Map,o=[{fromCpNode:void 0,cpStart:n}];for(;o.length;){const{fromCpNode:n,cpStart:i}=o.shift();rg(r,n,i);for(const n of Cn(i)){if(!mn(n.cp.pointOnShape)&&void 0===ng(t,n,e))return void console.log("Unable to find 3-prong");og(r,n,n.next)||o.push({fromCpNode:i,cpStart:n.next})}}}(f,a,o),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return;const p={cpNode:a,cpTrees:f};return function(t){if("undefined"==typeof _debug_)return;const n=_debug_.generated,e=n.timing;n.elems.mat.push(t),e.threeProngs+=performance.now()-mg}(p),p}const Wv=Math.max,Jv=Math.abs;function Kv(t,n=.4,r=4){let o,i;({maxCurviness:n,maxLength:r,maxCoordinate:o,minBezLength:i}=function(t,n,e){const{maxCoordinate:r,maxRadius:o}=function(t){let n=0,e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const s of t)for(const t of s)for(const s of t){const t=s[0],c=s[1],u=Wv(Jv(t),Jv(c));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),c<o&&(o=c),c>i&&(i=c)}return{maxCoordinate:n,maxRadius:Wv(r-e,i-o)}}(t),i=2**Math.ceil(Math.log2(r))*2**-16;return n<.05&&(n=.05),n>3&&(n=3),e<.1&&(e=.1),e>100&&(e=100),{maxCurviness:n,maxLength:e*=2**Math.ceil(Math.log2(o))*2**-10,maxCoordinate:r,minBezLength:i}}(t,n,r));const s=function(t,n){let r;"undefined"!=typeof _debug_&&(r=performance.now()),n=n||Xa(t);const o=Math.ceil(Math.log2(n)),i=2**o*2**-46*64;(function(t){if("undefined"!=typeof _debug_){if("undefined"!=typeof document){const n=function(t){let n="";for(const r of t)n=n+e(r)+"\n";return n}(t);document.getElementsByClassName("shape")[0].setAttributeNS(null,"d",n)}for(const n of t){_debug_.generated.elems.loopPre.push(...t),_debug_.generated.elems.loopsPre.push(t);for(const t of n){const n=Pi(t),e=Gr(t),r=Ur(t);_debug_.generated.elems.bezier_.push(t),_debug_.generated.elems.looseBoundingBox_.push(n),_debug_.generated.elems.tightBoundingBox_.push(e),_debug_.generated.elems.boundingHull_.push(r)}}}})(t=Da(t,46,o,!1,!0)),t.sort(Ai);const s=t.map(((t,n)=>Ca(t,n))),{extremes:c}=Ma(s,i,o),u={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0},f=new Set,l=new Set;for(const t of s){if(f.has(t))continue;f.add(t);const n=Oi(u,t),e=c.get(t)[0].container;if(!e.inOuts.length)continue;const r=ya(e);r.parent=n,r.windingNum=n.windingNum+r.orientation,r.children=new Set,Jo(0,ya(e),f,l)}const h=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();t.children=t.children||new Set;for(const r of t.children)0===t.windingNum&&n.push(r),e.push(r);0===t.windingNum&&(t.children=new Set)}return n}(u).map(Bi).map((t=>t.map(((n,e)=>function(t,n,e){const r=n<0?Ca(t.beziers,e):function(t){const n=[],e=t.curves;for(let t=e.length-1;t>=0;t--){const r=e[t].ps.slice().reverse();n.push(r)}return Ca(n,void 0)}(Ca(t.beziers,e));return r}(n,t[0].orientation,e))))),a=(2**o*2**-12)**2,p=[];for(let t=0;t<h.length;t++){const n=h[t].filter((t=>Math.abs(Ga(t))>a));n.length&&(n.sort(((t,n)=>Ai(t.beziers,n.beziers))),p.push(n))}return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.generated.elems.loop.push(...n),_debug_.generated.elems.loops.push(n)}(p),"undefined"!=typeof _debug_&&(_debug_.generated.timing.simplifyPaths=performance.now()-r),p}(t),c=[];for(const t of s){const e=jv(t,i,n,r,o);e&&c.push(e)}return c}function tm(t){const n=new Map;return Tn(t).forEach((function(t){const e=t.cp.pointOnShape.curve.loop;let r=n.get(e);r||(r=new lg(wn,!1),n.set(e,r)),r.insert(t)})),n}function nm(t){const n=[];return Tn(t).forEach((function(t){An(t)&&n.push(t)})),n}const em=["prev","next","prevOnCircle","nextOnCircle"];function rm(t){const n=new Map,e=Sn(t.cp,t.isHoleClosing,t.isIntersection);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of em){const i=t[o];let s=n.get(i);s||(s=Sn(i.cp,i.isHoleClosing,i.isIntersection),n.set(i,s),r.push({cpNode:i,newCpNode:s})),e[o]=s}}return e}function om(t){const n=function(t){let n=t;const e=nm(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(Fn(o)>2){const n=o.nextOnCircle;On(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(An(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(rm(t.cpNode));if(n)return{cpNode:n,cpTrees:tm(n)}}function im(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=sm[e],[i,s]=n;let c=0;const u=(s-i)/2,f=(s+i)/2;for(let n=0;n<=e-1;n++)c+=r[n]*t(u*o[n]+f);return u*c}const sm={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}};function cm(t){const[n,e]=w(t);return function(t){const r=E(n,t),o=E(e,t);return Math.sqrt(r*r+o*o)}}function um(t,n=.4,e=2**-16){const r={r:[0,1]};let o=r;for(;void 0!==o;){const r=o.r;if(mv(Ja(t,r[0],r[1]))<=n||r[1]-r[0]<=e){o=o.next;continue}const i=(r[0]+r[1])/2,s=[r[0],i],c=[i,r[1]];o.r=s,o.next={r:c,next:o.next}}o=r;const i=[];for(;void 0!==o;)i.push(o.r[0]),void 0===o.next&&i.push(o.r[1]),o=o.next;return i}function fm(t,n){const e=Cn(t);for(;e.length;){const t=e.pop();n(t),An(t)||e.push(...Mn(t))}}function lm(t,n){n(t),Cn(t).filter((t=>!An(t))).map((t=>t.next)).forEach((function(t){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...Pn(t))}}))}function hm(t){return function(n){return t*n}}function am(t,n,e=hm){let r=0;if("undefined"!=typeof _debug_){r=performance.now();const n=nm(t.cpNode);_debug_.generated.elems.leaves.push(n)}const o=[];lm(rm(t.cpNode),(t=>{o.push(t)}));const i=function(t){return t.reduce((function(t,n){return t.cp.circle.radius>=n.cp.circle.radius?t:n}),t[0])}(o),s=e(n);"undefined"!=typeof _debug_&&_debug_.generated.elems.maxVertex.push(i);const c=new Set,u=new Map;fm(i,(function(t){const n=u.get(t)||s(t.cp.circle.radius),e=t.next,r=function(t,n,e=.4,r=16){if(4===n.length)return function(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[s,c],[u,f],[l,h],[a,p]]=n;if(s===u&&u===l&&l===a&&c===f&&f===h&&h===p)return 0;const d=rd(n,o,i).ps,g=um(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=im(cm(d),[n,e],r)}return v}(t,n,e,r);if(3===n.length)return function(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[s,c],[u,f],[l,h]]=n;if(s===u&&u===l&&c===f&&f===h)return 0;const a=sd(n,o,i).ps,p=um(a,e);let d=0;for(let t=0;t<p.length-1;t++){const n=p[t],e=p[t+1];d+=im(cm(a),[n,e],r)}return d}(t,n,e,r);if(2===n.length)return function(t,n){const[e,r]=t,[[o,i],[s,c]]=n;return $r([o+e*(s-o),i+e*(c-i)],[o+r*(s-o),i+r*(c-i)])}(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],Nn(t)),o=e.cp.circle.radius;if(n-r>s(o)){for(const t of Cn(e))u.set(t,n-r);c.add(e.cp.circle)}})),function(t,n){const e=nm(n);function r(t){let n=t;const e=[];do{n.next!==n.nextOnCircle&&e.push(n),n=n.nextOnCircle}while(n!==t.prevOnCircle);return e}for(;e.length;){const o=e.pop();if(o.isHoleClosing||o.isIntersection)continue;if(!t.has(o.cp.circle))continue;let i=o.next;for(;;){i=i.next;let e=!1;const o=i.prevOnCircle;if(t.has(i.cp.circle))if(On(i,n))e=!0;else{const t=r(i);1===t.length?i=t[0]:e=!0}else e=!0;if(e){o.next=i,i.prev=o;break}}}}(c,i),"undefined"!=typeof _debug_&&_debug_.generated.elems.culls.push(Array.from(c));const f={cpNode:i,cpTrees:void 0};return function(t,n){"undefined"!=typeof _debug_&&(_debug_.generated.elems.sat.push(t),_debug_.generated.timing.sats=performance.now()-n)}(f,r),f}const pm=1;function dm(t,n=pm){for(;!zn(t);)t=t.next;const e=[],r=[t.prevOnCircle];let o=[];for(;r.length;){const t=r.pop();o.push(t);let i=Mn(t);if(zn(t)){o.length>1&&e.push(o),o=[];continue}if(1===i.length){r.push(i[0]);continue}if(i=i.filter((t=>!An(t))),0===i.length){e.push(o),o=[];continue}if(i.length>1){e.push(o),o=[],r.push(...i);continue}const s=_(N(M(Nn(t.next.prevOnCircle),0)),N(M(Nn(i[0]),0)));Math.abs(Math.asin(s)*(180/Math.PI))>n&&(e.push(o),o=[]),r.push(i[0])}return o.length&&e.push(o),e}let gm=0;function vm(t){return t.map((t=>{return(n=t.cp.pointOnShape).p[0]+", "+n.p[1]+" | bz: "+n.curve.idx+" | t: "+n.t;var n}))}function mm(t,n=3){return t[0].toFixed(n)+", "+t[1].toFixed(n)}const bm={δToString:vm,δsToString:function(t){return t.map(vm)},pointToStr:mm,pointsToStr:function(t,n=3){return t.map((t=>mm(t,n)))},nameObj:function(t,n=""){t.name=""+n+gm++}},xm="red thin10 nofill ",_m="http://www.w3.org/2000/svg";function Im(t,n,e=xm,r){const o=n.center,i=n.radius,s=document.createElementNS(_m,"circle");return s.setAttributeNS(null,"cx",o[0].toString()),s.setAttributeNS(null,"cy",o[1].toString()),s.setAttributeNS(null,"r",i.toString()),s.setAttributeNS(null,"class",e),t.appendChild(s),r&&setTimeout((()=>s.remove()),r),[s]}function Nm(t,n,e=xm,r){const o=document.createElementNS(_m,"line");return o.setAttributeNS(null,"x1",n[0][0].toString()),o.setAttributeNS(null,"y1",n[0][1].toString()),o.setAttributeNS(null,"x2",n[1][0].toString()),o.setAttributeNS(null,"y2",n[1][1].toString()),o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]}function Sm(t,n,e=xm,r=3,o){const i=Im(t,{center:n,radius:r},e),s=[[n[0]-r,n[1]],[n[0]+r,n[1]]],c=[[n[0],n[1]-r],[n[0],n[1]+r]],u=Nm(t,s,e),f=Nm(t,c,e);return o&&setTimeout((()=>{i.forEach((t=>t.remove())),u.forEach((t=>t.remove())),f.forEach((t=>t.remove()))}),o),[...i,...u,...f]}function Em(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function wm(t,n,e=xm,r){const[[o,i],[s,c],[u,f]]=n,l=document.createElementNS(_m,"path");return l.setAttributeNS(null,"d",`M${o} ${i} Q${s} ${c} ${u} ${f}`),e&&l.setAttributeNS(null,"class",e),t.appendChild(l),r&&setTimeout((()=>l.remove()),r),[l]}function Mm(t,n,e=xm,r){const[[o,i],[s,c],[u,f],[l,h]]=n;if(o===l&&s===l&&u===l&&i===h&&c===h&&f===h)return Sm(t,[o,i],e,.2,r);const a=document.createElementNS(_m,"path");return a.setAttributeNS(null,"d",`M${o} ${i} C${s} ${c} ${u} ${f} ${l} ${h}`),a.setAttributeNS(null,"class",e),t.appendChild(a),r&&setTimeout((()=>a.remove()),r),[a]}function Pm(t,n,e=xm,r){return 2===n.length?Nm(t,n,e,r):3===n.length?wm(t,n,e,r):4===n.length?Mm(t,n,e,r):[]}const Tm=["red","green","cyan","blue"];function ym(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,s],[c,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*c*e*n**2+f*n**3,o*e**3+3*s*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,s],[c,u]]=t;return[r*e**2+2*i*e*n+c*n**2,o*e**2+2*s*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,s]]=t;return[r*e+i*n,o*e+s*n]}return[NaN,NaN]}function Cm(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,s=1-n,c=[s*e+n*o,s*r+n*i];return[[[e,r],c],[c,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[s,c]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*s,u*u*r+2*u*n*i+n*n*c];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*s,u*i+n*c],[s,c]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[s,c],[u,f]]=t,l=1-n,h=n*n,a=h*n,p=l*l,d=p*l,g=[a*u+3*l*h*s+3*p*n*o+d*e,a*f+3*l*h*c+3*p*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[h*s+2*l*n*o+p*e,h*c+2*l*n*i+p*r],g],[g,[h*u+2*n*l*s+p*o,h*f+2*n*l*c+p*i],[n*u+l*s,n*f+l*c],[u,f]]]}(t,n):[]}const Om={circle:Im,crossHair:Sm,dot:function(t,n,e=3,r="red",o){const[i]=Im(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout((()=>i.remove()),o),[i]},line:Nm,rect:function(t,n,e=xm,r){const[[o,i],[s,c]]=n,u=o<s?o:s,f=i<c?i:c,l=Math.abs(o-s),h=Math.abs(i-c),a=document.createElementNS(_m,"rect");return a.setAttributeNS(null,"x",u.toString()),a.setAttributeNS(null,"y",f.toString()),a.setAttributeNS(null,"width",l.toString()),a.setAttributeNS(null,"height",h.toString()),e&&a.setAttributeNS(null,"class",e),t.appendChild(a),r&&setTimeout((()=>a.remove()),r),[a]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const s=n[r],c=o?"thin5 nofill "+Tm[r%Tm.length]:e;i.push(...Pm(t,s,c))}return r&&setTimeout((()=>i.forEach((t=>t.remove()))),r),i},bezier:Pm,bezierPiece:function(t,n,e,r=xm,o){const i=e[0]===e[1]?Sm(t,ym(n,e[0]),r,1.5):Pm(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=ym(t,n[0]);return[e,e,e,e]}return 0===n[0]?Cm(t,n[1])[0]:1===n[1]?Cm(t,n[0])[1]:Cm(Cm(t,n[0])[1],(n[1]-n[0])/(1-n[0]))[0]}(n,e),r);return o&&setTimeout((()=>i.forEach((t=>t.remove()))),o),i},quadBezier:wm,cubicBezier:Mm,polygon:function(t,n,e=xm,r){const o=document.createElementNS(_m,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]},loop:function(t,n,e=xm,r){if(!n.length)return[];const o=document.createElementNS(_m,"path");let i=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];i+=`${Em(e.length)} `;for(let t=1;t<e.length;t++)i+=`${e[t][0]} ${e[t][1]} `}return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]},polyline:function(t,n,e=xm,r){if(n.length<2)return[];const o=document.createElementNS(_m,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]},text:function(t,n,e,r,o=xm,i){const s=document.createElementNS(_m,"text");return s.setAttributeNS(null,"x",n[0].toString()),s.setAttributeNS(null,"y",n[1].toString()),s.setAttributeNS(null,"font-size",r.toString()),s.setAttributeNS(null,"class",o),s.textContent=e,t.appendChild(s),i&&setTimeout((()=>s.remove()),i),[s]}};function Am(t,n,e=1e3,r=1){const o=n.xs;console.log(n),console.log(n.xs.map((t=>({x:t.x,y:t.y,z:t.z,d:t.z?p(t.y.p,t.z.p):0,t:t.t})))),console.log(o.length);for(let i=0;i<o.length;i++){const o=n.xs[i],s={center:o.x,radius:$r(o.x,o.y.p)};Om.crossHair(t,o.x,"red thin10 nofill",.002*r,e),Om.circle(t,s,"blue thin10 nofill",e),void 0!==o.z&&Om.crossHair(t,o.z.p,"yellow thin10 nofill",.001*r,e)}}const zm={logδ:function(t,n="twoProng_regular"){const e=_debug_.generated.elems[n][t].δ;console.log(e)},log:function(t,n="twoProng_regular"){const e=_debug_.generated.elems[n][t];console.log(e)},drawNormal:function(t,n,e=1e3){Om.line(t,[n.pos.p,n.circle.center],"thin10 blue",e)},logδBasic:function(t,n="twoProng_regular"){const e=_debug_.generated.elems[n][t].δ;function r(t){const n=t.cp.pointOnShape;return{bez:n.curve.ps,t:n.t}}console.log(r(e[0])),console.log(r(e[1]))},traceConvergence:Am,logNearest:function(t,n,e){return(e,r,o=1e3,i=1)=>{const s=m(r,_debug_.generated.elems.twoProng_regular,(t=>t.circle.center));let c;[].push(s),console.log(s);for(let t=0;t<_debug_.generated.elems.twoProng_regular.length;t++)if(_debug_.generated.elems.twoProng_regular[t]===s){c=t;break}t&&function(t,n,e=1e3){const r=n.circle.center,{pos:o,circle:i,cpNode:s,xs:c,z:u,δ:f}=n;Om.line(t,[o.p,r],"thin5 red",e),Om.line(t,[u,r],"thin5 red",e)}(e,s,o),void 0!==c&&n&&Am(e,s,o,i)}}},Bm={drawSpokes:function(t,n){const e=_debug_.generated.elems.threeProng[n],r=e.circle.center,o=e.poss;for(let n=0;n<o.length;n++){const e=o[n];Om.line(t,[e.p,r],"thin5 red")}},traceConvergence:function(t,n,e){let r,o;void 0===n?(r=0,o=_debug_.generated.elems.threeProng.length):(r=n,o=n+1);for(let i=r;i<o;i++){const r=_debug_.generated.elems.threeProng[i];console.log(r);const o=r.candidateThreeProngs;let s,c;void 0===n||-1===e?(s=r.bestIndx,c=r.bestIndx+1):void 0===e?(s=0,c=o.length):(s=e,c=e+1);for(let n=s;n<c;n++){const e=o[n].circle;r.bestIndx===n?(Om.dot(t,e.center,.2,"green"),Om.circle(t,e,"black thin10 nofill")):(Om.dot(t,e.center,.2,"cyan"),Om.circle(t,e,"cyan thin5 nofill"))}}},showBoundary:function(t,n,e){const r=_debug_.generated.elems.threeProng[n],o=r.candidateThreeProngs,i=void 0===e?0:e,s=void 0===e?o.length:e,c=r.cpss;let u=0;for(let n=1;n<c.length-1;n++){if(!(u>=i&&u<=s)){u++;continue}const e=[c[0],c[n],c[c.length-1]];for(let n=0;n<3;n++){const r=e[n],o=r[0],i=r[1],s=o.cp.pointOnShape,c=i.cp.pointOnShape,u=s.p,f=c.p,l=1+.5*n;v(u,f)?Om.crossHair(t,u,"red thin10 nofill",l):(Om.crossHair(t,u,"green thin10 nofill",l),Om.crossHair(t,f,"blue thin10 nofill",l))}u++}},logδs:function(t){const n=_debug_.generated.elems.threeProng[t];console.log(n.cpss)},logNearest:function(t=!0,n=!0,e=!0){return function(r,o,i=1e3){const s=m(o,_debug_.generated.elems.threeProng,(t=>t.circle?t.circle.center:[0,0])),c=s.circle;console.log(s);const u={center:c.center,radius:c.radius||1};if(Om.circle(r,u,"blue thin10 nofill",i),Om.crossHair(r,c.center,"red thin2 nofill",2,i),t&&(Om.line(r,[s.poss[0].p,c.center],"blue thin5 nofill",i),Om.line(r,[s.poss[1].p,c.center],"blue thin5 nofill",i),Om.line(r,[s.poss[2].p,c.center],"blue thin5 nofill",i)),e){const t=s.boundaries,n=t[0],e=t[t.length-1];Om.beziers(r,n,"red thin20 nofill",i);for(let n=1;n<t.length-1;n++){const e=t[n];Om.beziers(r,e,"green thin20 nofill",i)}Om.beziers(r,e,"blue thin20 nofill",i)}if(n){const t=s.traces;for(const n of t)Om.polyline(r,n,"red thin5 nofill",i)}}}};function Ym(t,n,e,r=0,o=1){let i,s,c=[],u=[],f=[],l=[],h=[];switch($g(n)){case"twoProng_regular":i="red ",s="2";break;case"twoProng_holeClosing":i="cyan ",s="10"}return n.failed?c=Om.dot(t,n.pos.p,1*o,"black",r):n.failed||(u=Om.dot(t,n.circle.center,.01*o,"yellow",r),f=Om.circle(t,n.circle,i+"thin"+s+" nofill",r),l=Om.dot(t,n.pos.p,.0175*o,i,r),h=Om.dot(t,n.z,.035*o,i,r)),[...c,...u,...f,...l,...h]}function Fm(t){const n="mat"===t?"thin5 purple nofill":"thin10 red nofill";return(t,e,r,o=0,i=1)=>{const s=e.cpNode;if(!s)return[];const c=[];return fm(s,(e=>{if(An(e))return;const r=Nn(e);r&&c.push(...Om.bezier(t,r,n,o))})),c}}function Vm(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}function km(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}const Lm={oneProng:function(t,n,e,r=0,o=1){const i=n[0].cp,{circle:s,pointOnShape:c}=i;return[...Om.dot(t,c.p,.02*o,"deeppink",r),...Om.dot(t,s.center,.05*o,"deeppink",r),...Om.circle(t,s,"deeppink thin5 nofill",r)]},oneProngAtDullCorner:function(t,n,e,r=1e3,o=1){const i=Qg(Number.POSITIVE_INFINITY,n);return[...Om.dot(t,n.p,.1,"orange"),...Om.dot(t,i.center,.25,"orange"),...Om.circle(t,i,"orange thin10 nofill")]},twoProng_regular:Ym,twoProng_failed:Ym,twoProng_notAdded:Ym,twoProng_deleted:Ym,twoProng_holeClosing:Ym,threeProng:function(t,n,e,r=0,o=1){const i=function(t,n){return{center:t.center,radius:1*t.radius}}(n.circle),s=n.poss,c=Om.dot(t,s[0].p,.01*o,"blue",r),u=Om.dot(t,s[1].p,.02*o,"blue",r),f=Om.dot(t,s[2].p,.03*o,"blue",r);return[...Om.dot(t,i.center,.03*o,"blue",r),...c,...u,...f,...Om.circle(t,i,"blue thin2 nofill",r)]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return Om.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,s],[c,u]]=n;return n=[[i,s],[c,s],[c,u],[i,u]],Om.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return Om.polygon(t,n,"thin5 pinker nofill",r)},sharpCorner:function(t,n,e="green",r=0,o=1){const i=n.ps[n.ps.length-1];return Om.dot(t,i,.6*o,"green",r)},dullCorner:function(t,n,e="orange",r=0,o=1){const i=n.ps,s=n.ps[i.length-1];return Om.dot(t,s,.05*o,e,r)},vertex:function(t,n,e,r,o=1){const i=n.cp.circle,s="thin20",c=Cn(n);console.log(c);let u=[];u=[...Om.circle(t,i,"red "+s+" nofill ",r),...Om.crossHair(t,i.center,"red "+s+" nofill ",3,r)];for(let n=0;n<c.length;n++){const e=c[n].next.cp.circle,o=Om.circle(t,e,"pink "+s+" nofill ",r),f=Om.crossHair(t,e.center,"pink "+s+" nofill ",3,r);u.push(...o,...f);const l=i.center,h=e.center,a=0===n?"thin10":1===n?"thin20":"thin35",p=Om.line(t,[l,h],"yellow "+a+" nofill ",r);u.push(...p)}return u},mat:Fm("mat"),sat:Fm("sat"),maxVertex:function(t,n){const e=n.cp.circle;return Om.circle(t,e,"brown thin10 nofill")},leaves:function(t,n){const e=[];for(const r of n){const n=r.cp.circle.center;e.push(Vm(t,n,.5,"pinker thin5 nofill"))}return e},culls:function(t,n){const e=[];for(const r of n){const n=r.center;e.push(km(t,n,.4,"cyan thin5 nofill"))}return e},cpNode:function(t,n){return[]}};function Dm(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,generated:{...n&&n.generated?n.generated:{},elems:{...n&&n.generated&&n.generated.elems?n.generated.elems:{},oneProng:[],oneProngAtDullCorner:[],twoProng_regular:[],twoProng_failed:[],twoProng_notAdded:[],twoProng_deleted:[],twoProng_holeClosing:[],looseBoundingBox:[],tightBoundingBox:[],sharpCorner:[],dullCorner:[],vertex:[],threeProng:[],boundingHull:[],mat:[],sat:[],cpNode:[],maxVertex:[],leaves:[],culls:[]},timing:{...n&&n.generated&&n.generated.timing?n.generated.timing:{},holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0}},fs:{...n&&n.fs?n.fs:{},drawElem:{...n&&n.fs&&n.fs.drawElem?n.fs.drawElem:{},...Lm},...bm,twoProng:zm,threeProng:Bm},directives:{...n&&n.directives?n.directives:{},stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}function Xm(t,n,e){const r=[];for(const o of n){if(An(o))continue;const n=Nn(o);n&&r.push(...Om.bezier(t,n,"thin5 purple nofill",e))}return r}function qm(t,n,e,r,o,i){n=Ld(n,e);let s,c=Number.POSITIVE_INFINITY;for(let u=0;u<n.length;u++){const f=n[u],l=m(e,Cd(f.curve,e,f.ts,r,o,i,t),(t=>t.p));if(void 0===l)continue;const h=jg(l.p,e);let a=f.curve,p=l.t;h<c&&(0===p&&(p=1,a=f.curve.prev),s=Se(a,p,!1),c=h)}return s}function Qm(t){const n=t,e=t.next,r=n.cp.pointOnShape,o=e.cp.pointOnShape,i=r.curve,s=o.curve;if(i.loop!==s.loop)return;const c=[];return s===i?c.push(Ja(r.curve.ps,r.t,o.t)):(c.push(Ja(r.curve.ps,r.t,1)),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push(Ja(o.ps,0,n))}while(o!==e)}(c,r.curve,o.curve,o.t)),c}function $m(t){const n=t,e=t.next,r=n.cp.pointOnShape,o=e.cp.pointOnShape,i=r.curve,s=o.curve;if(i.loop!==s.loop)return;const c=[];return s===i?c.push({ps:r.curve.ps,ts:[r.t,o.t]}):(c.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?{ps:o.ps,ts:[0,r]}:{ps:o.ps,ts:[0,1]};t.push(n)}while(o!==e)}(c,r.curve,o.curve,o.t)),c}function Gm(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=n[0],g=n[1],v=s-d,m=u-d,b=l-d,x=a-d,_=c-g,I=f-g,N=h-g,S=p-g,E=v*v,w=6*v*m,M=6*b*x,P=_*_,T=6*_*I,y=6*N*S,C=6*m*x+9*b*b,O=2*v*x+18*m*b,A=6*v*b+9*m*m,z=6*I*S+9*N*N,B=2*_*S+18*I*N,Y=6*_*N+9*I*I;return[6*(x*x-M+(E-w)+C+(A-O)+(S*S-y+(P-T)+z+(Y-B))),5*(M+5*w+3*O-2*(C+2*A+3*E)+(y+5*T+3*B-2*(z+2*Y+3*P))),4*(C-3*(O-2*A)-5*(2*w-3*E)+(z-3*(B-2*Y)-5*(2*T-3*P))),3*(O-2*(2*A-5*(w-2*E))+(B-2*(2*Y-5*(T-2*P)))),2*(A-5*(w-3*E)+(Y-5*(T-3*P))),w-6*E+(T-6*P)]}function Hm(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n[0],a=n[1],p=i-h,d=c-h,g=f-h,v=s-a,m=u-a,b=l-a,x=p*p,_=p*d,I=d*g,N=v*v,S=v*m,E=m*b,w=v*b+m*m*2,M=p*g+d*d*2;return[b*b+N+2*w-4*(E+S)+(g*g+x+2*M-4*(I+_)),3*(E-w+(3*S-N)+(I-M+(3*_-x))),w-3*(2*S-N)+(M-3*(2*_-x)),S-N+(_-x)]}function Rm(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=e-s,f=o-s,l=r-c,h=i-c,a=u*f+l*h,p=l*l+u*u;return[f*f+h*h+(p-2*a),a-p]}const Um=Math.sqrt;function Zm(t,n){let e;if(4===t.length)e=Gm(t,n);else if(3===t.length)e=Hm(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:$r(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=Rm(t,n)}const r=Ni(e,0,1);r.push(0),r.push(1);let o,i=Number.POSITIVE_INFINITY;for(const e of r){const r=Jp(t,e),s=p(r,n);s<i&&(i=s,o={p:r,t:e,d:Um(s)})}return o}const jm=Math.sqrt;function Wm(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=Math.abs(r[0]),i=Math.abs(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}function Jm(t){return Math.max(t.hL+t.hEL,t.hR+t.hER)}function Km(t,n){const e=Jm(t)-Jm(n);return 0!==e?e:t.tS-n.tS}class tb{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,s=t[i],c=t[e];if(this.compare(c,s)>0)break;t[i]=c,t[e]=s,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const nb=Math.max;function eb(t,n,e,r=50){if(1===t.length)return Zm(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=Gm(t,n);else if(3===t.length)e=Hm(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:$r(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=Rm(t,n)}const r=Ni(e,0,1);r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Jp(t,e),s=p(r,n);s>i&&(i=s,o={p:r,t:e,d:jm(s)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=Zm(n,t[0]).d,r=Zm(n,t[t.length-1]).d;return e>r?e:r}const o=nb(Wm(t),Wm(n));e=e||o/1e6;const[i,s]=rb(t,0,1),c={tS:0,tE:1,hL:Zm(n,t[0]).d,hR:Zm(n,t[t.length-1]).d,hEL:i,hER:s},u=new tb(Km);u.insert(c);let f=0,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:s,hL:c,hR:a}=o,p=(i+s)/2,[d,g]=rb(t,i,p),[v,m]=rb(t,p,s),b=Jp(t,p),x=$r(b,Zm(n,b).p),_=nb(c,x,a);if(_>h&&(h=_),l=Jm(o),l-h<e)return h;if(f++>r)return h;const I={tS:i,tE:p,hL:c,hR:x,hEL:d,hER:g},N={tS:p,tE:s,hL:x,hR:a,hEL:v,hER:m};u.swapMinOrMax(I),u.insert(N)}}function rb(t,n,e){const r=(e+n)/2,o=Ja(t,n,r),i=Ja(t,r,e);return[Yd(o),Yd(i)]}const ob=Math.max;function ib(t,n,e,r){const o=eb(t,n,e,r),i=eb(n,t,e,r);return ob(o,i)}function sb(t,n=15,e=.125,r=50){let o=t.cpNode;for(;!An(o);)o=o.next;const i=dm(o,n),s=[];for(let t=0;t<i.length;t++){const n=i[t];let o=0;for(;o<n.length;){const t=o;for(;(o++,o!==n.length)&&!(cb(t,o,n,r)>e);)s.push(n[o]);if(t+1===o)break}}for(const t of s){const n=An(t),e=Cn(t).length;n||2!==e||kn(t)}return{cpNode:o,cpTrees:void 0}}function cb(t,n,e,r){const o=[],i=In(e[t],e[n].next);for(;t<n+1;t++)o.push(ib(Nn(e[t]),i,r));return Math.max(...o)}function ub(t){if(4===t.length)return t;if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[n,e],[1/3*n+2/3*r,1/3*e+2/3*o],[2/3*r+1/3*i,2/3*o+1/3*s],[i,s]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t,i=(r-n)/3,s=(o-e)/3;return[[n,e],[n+i,e+s],[n+2*i,e+2*s],[r,o]]}(t);if(1===t.length){const n=t[0];return[n,n,n,n]}throw new Error("The given bezier curve must be of order <= 3.")}function fb(t,n=15,e=.1,r=1){const o=new Map;for(;!An(t);)t=t.next;const i=dm(t,n),s=[];for(let t=0;t<i.length;t++){const n=i[t];let c=0;for(;c<n.length;){const t=c;for(;(c++,c!==n.length)&&!(lb(t,c,n,r)>e);)s.push(n[c]);if(t+1===c);else{const e=n[t],r=n[c-1],i=ub(In(e,r.next)),s=i.slice().reverse();let u=e,f=0;for(;u!==r;){const t=Zm(i,u.next.cp.circle.center).t;o.set(u,{ps:i,ts:[f,t]});const n=u.nextOnCircle.prev;o.set(n,{ps:s,ts:[1-t,1-f]}),f=t,u=u.next}o.set(u,{ps:i,ts:[f,1]});const l=u.nextOnCircle.prev;o.set(l,{ps:s,ts:[0,1-f]})}}}return{simpleMap:o,cpNode:t}}function lb(t,n,e,r){const o=[],i=In(e[t],e[n].next);for(let s=t;s<n+1;s++)o.push(ib(Nn(e[s]),i,r));return Math.max(...o)}const hb=0,ab=1;function pb(t,n,e,r){const o=[];for(const r of t)o.push({type:hb,item:r,x:n(r)}),o.push({type:ab,item:r,x:e(r)});o.sort(db);const i=new Set,s=[];for(const t of o){const{item:n}=t;if(t.type===hb){for(const t of i.values())r(n,t)&&s.push([n,t]);i.add(n)}else t.type===ab&&i.delete(t.item)}return s}function db(t,n){const e=t.x-n.x;return 0!==e?e:t.type===hb?-1:1}var gb=n.A3,vb=n.bz,mb=n.Ev,bb=n.$d,xb=n.zh,_b=n.Ls,Ib=n.CU,Nb=n.gM,Sb=n.xD,Eb=n.SQ,wb=n.f4,Mb=n.BG,Pb=n.Ij,Tb=n.tQ,yb=n.C_,Cb=n.G,Ob=n.bx,Ab=n.DZ,zb=n.yc,Bb=n.wH,Yb=n.N0,Fb=n.EC,Vb=n.Jt,kb=n.DC,Lb=n.PF,Db=n.tO,Xb=n.Sl,qb=n.ZN,Qb=n.MY,$b=n.bA,Gb=n.p8,Hb=n.bQ,Rb=n.WN,Ub=n.r0,Zb=n.UW,jb=n._T,Wb=n.Dw,Jb=n.xs,Kb=n.vU,tx=n.y9,nx=n.Fw,ex=n.QE,rx=n.pI;export{gb as beziersToSvgPathStr,vb as cpNodeComparator,mb as createCpNode,bb as createPos,xb as drawBranch,_b as drawElemFunctions,Ib as drawMat,Nb as enableDebugForMat,Sb as enhanceCpNode,Eb as findMats,wb as getAllOnLoop,Mb as getBoundaryBezierPartsToNext,Pb as getBoundaryBeziersToNext,Tb as getBoundaryPieceBeziers,yb as getBranches,Cb as getChildren,Ob as getClosestBoundaryPointCertified,Ab as getClosestSquareDistanceToRect,zb as getCpNodesOnCircle,Bb as getCurveBetween,Yb as getCurveToNext,Fb as getFirstExit,Vb as getPathsFromStr,kb as getProngCount,Lb as getRealProngCount,Db as getShapeBounds,Xb as insertCpNode,qb as isFullyTerminating,Qb as isOnSameCircle,$b as isSharp,Gb as isTerminating,Hb as loopFromBeziers,Rb as matCurveToNextVertex,Ub as removeCpNode,Zb as simplifyMat,jb as simplifyMatMapOnly,Wb as sweepLine,Jb as toScaleAxis,Kb as traverseCp,tx as traverseEdges,nx as traverseVertices,ex as trimMat,rx as vertexChildren};
1
+ var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n)},n={};function e(t){let n="";for(let e=0;e<t.length;e++){const r=t[e];0===e&&(n="M "+r[0][0].toString()+" "+r[0][1].toString()+"\n"),4===r.length?n+="C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" \n":3===r.length?n+="Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" \n":2===r.length&&(n+="L "+r[1][0].toString()+" "+r[1][1].toString()+" \n")}return n+" z\n"}t.d(n,{A3:()=>e,bz:()=>wn,Ev:()=>Sn,$d:()=>Se,zh:()=>Dm,Ls:()=>km,CU:()=>Ym,gM:()=>Lm,xD:()=>Dn,SQ:()=>Kv,f4:()=>Tn,BG:()=>Qm,Ij:()=>qm,tQ:()=>Hd,C_:()=>pm,G:()=>Mn,bx:()=>Xm,DZ:()=>Ad,yc:()=>Cn,wH:()=>In,N0:()=>Nn,EC:()=>Bn,Jt:()=>l,DC:()=>Fn,PF:()=>Vn,tO:()=>_g,Sl:()=>yn,ZN:()=>zn,MY:()=>On,bA:()=>Yn,p8:()=>An,bQ:()=>Ca,WN:()=>En,r0:()=>kn,UW:()=>ib,_T:()=>ub,Dw:()=>ab,xs:()=>hm,vU:()=>Xn,y9:()=>fm,Fw:()=>lm,QE:()=>om,pI:()=>Pn});class r{constructor(){this.initialPoint=void 0,this.vals=void 0,this.prev2ndCubicControlPoint=void 0,this.prev2ndQuadraticControlPoint=void 0,this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const s={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function c(t){let n=0,e=0,r=1,o=0,i=1,s=1;const c=t._currentIndex;if(t._skipOptionalSpaces(),t._currentIndex<t._endIndex&&"+"===t._string[t._currentIndex]?t._currentIndex+=1:t._currentIndex<t._endIndex&&"-"===t._string[t._currentIndex]&&(t._currentIndex+=1,i=-1),t._currentIndex===t._endIndex||(t._string[t._currentIndex]<"0"||t._string[t._currentIndex]>"9")&&"."!==t._string[t._currentIndex])throw new Error("The first character of a number must be one of [0-9+-.].");const u=t._currentIndex;for(;t._currentIndex<t._endIndex&&t._string[t._currentIndex]>="0"&&t._string[t._currentIndex]<="9";)t._currentIndex+=1;if(t._currentIndex!==u){let n=t._currentIndex-1,r=1;for(;n>=u;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(t._currentIndex<t._endIndex&&"."===t._string[t._currentIndex]){if(t._currentIndex+=1,t._currentIndex>=t._endIndex||t._string[t._currentIndex]<"0"||t._string[t._currentIndex]>"9")throw new Error("There must be a least one digit following the .");for(;t._currentIndex<t._endIndex&&t._string[t._currentIndex]>="0"&&t._string[t._currentIndex]<="9";)r*=10,o+=Number(t._string.charAt(t._currentIndex))/r,t._currentIndex+=1}if(t._currentIndex!==c&&t._currentIndex+1<t._endIndex&&("e"===t._string[t._currentIndex]||"E"===t._string[t._currentIndex])&&"x"!==t._string[t._currentIndex+1]&&"m"!==t._string[t._currentIndex+1]){if(t._currentIndex+=1,"+"===t._string[t._currentIndex]?t._currentIndex+=1:"-"===t._string[t._currentIndex]&&(t._currentIndex+=1,s=-1),t._currentIndex>=t._endIndex||t._string[t._currentIndex]<"0"||t._string[t._currentIndex]>"9")throw new Error("There must be an exponent.");for(;t._currentIndex<t._endIndex&&t._string[t._currentIndex]>="0"&&t._string[t._currentIndex]<="9";)n*=10,n+=Number(t._string[t._currentIndex]),t._currentIndex+=1}let f=e+o;if(f*=i,n&&(f*=Math.pow(10,s*n)),c===t._currentIndex)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),f}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[c(this)]:"M"===r||"L"===r||"T"===r?n=[c(this),c(this)]:"S"===r||"Q"===r?n=[c(this),c(this),c(this),c(this)]:"C"===r?n=[c(this),c(this),c(this),c(this),c(this),c(this)]:"A"===r?n=[c(this),c(this),c(this),this._parseArcFlag(),this._parseArcFlag(),c(this),c(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let c,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=s[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}c=l}else u.length&&("z"!==c&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,c=l}return u.length>0&&("z"!==c&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function h(t,n){let e=function(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t),e}(t.pointOnShape,n.pointOnShape);return 0!==e?e:(e=t.order-n.order,0!==e?e:t.order2-n.order2)}function a(t,n){const[[e,r],[o,i]]=t,[[s,c],[u,f]]=n,l=o-e,h=i-r,a=u-s,p=f-c,d=a*h-p*l;if(0===d)return;const g=((c-r)*l-(s-e)*h)/d;return[s+g*a,c+g*p]}function p(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function d(t,n){return[n[0]-t[0],n[1]-t[1]]}function g(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function v(t,n){return t[0]===n[0]&&t[1]===n[1]}function m(t,n,e){let r,o=Number.POSITIVE_INFINITY;for(let i=0;i<n.length;i++){const s=n[i],c=p(t,e(s));c<o&&(r=s,o=c)}return r}function b(t,n){return t[0]*n[0]+t[1]*n[1]}function x(t){return[-t[1],t[0]]}function _(t,n){return t[0]*n[1]-t[1]*n[0]}function I(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function N(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function S(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function E(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function w(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[3*(c-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-s)),6*(s+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(s+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function M(t,n){const[e,r]=w(t);return[E(e,n),E(r,n)]}function P(t){const n=new WeakMap;return function(e){let r=n.get(e);return void 0!==r||(r=t(e),n.set(e,r)),r}}function T(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function y(t){return t[t.length-1]}function C(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}function O(t){return C(t).map(A).join("")}function A(t){let n=t.toString(2);for(;n.length<8;n="0"+n);return n}function z(t){const n=C(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),s=0===i?0:16,c=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+s,{sign:o,exponent:c,significand:u}}function B(t){return z(t).significand}function Y(t){return Math.log2(t&-t)}function F(t){if(0===t||!Number.isFinite(t))return NaN;const n=B(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=Y(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function V(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function k(t){if(0===t||!Number.isFinite(t))return NaN;const n=B(t),e=n.length;for(let t=0;t<e;t++){const r=V(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function L(t){return z(t).exponent}function D(t){if(0===t||!Number.isFinite(t))return NaN;const n=L(t);return k(t)-52+n}function X(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const s=i-(r-e);s&&(n[--o]=r,r=s)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const s=o-(r-e);s&&(n[i++]=s)}return n[i++]=r,n.length=i,n}function q(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}const Q=y,$=X;function G(t,n){if(t=$(t),0===Q(t))return[0];const e=D(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=D(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let s=t[o];s=q(s,i);const c=t.slice(o);return c[0]=s,c}function H(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function R(t,n){const e=t.length,r=n.length;let o=0,i=0;const s=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(s.push(t[o]),o++):(s.push(n[i]),i++):i++:o++;for(;o<e;)s.push(t[o]),o++;for(;i<r;)s.push(n[i]),i++;if(0===s.length)return[0];const c=s.length;if(1===c)return s;const u=[],f=s[1],l=s[0];let h=f+l;const a=l-(h-f);0!==a&&u.push(a),i=0;for(let t=2;t<c;t++){const n=s[t],e=h+n,r=e-h,o=h-(e-r)+(n-r);0!==o&&u.push(o),h=e}return 0===h&&0!==u.length||u.push(h),u}const U=134217729;function Z(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const s=U*o,c=s-(s-o),u=o-c,f=U*n,l=f-(f-n),h=n-l,a=[],p=u*h-(i-c*l-u*l-c*h);0!==p&&a.push(p);for(let o=1;o<e;o++){const e=t[o],s=e*n,c=U*e,u=c-(c-e),f=e-u,l=U*n,h=l-(l-n),p=n-h,d=f*p-(s-u*h-f*h-u*p),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&a.push(m),r=g;const b=s+r,x=r-(b-s);0!==x&&a.push(x),i=b}return 0===i&&0!==a.length||a.push(i),a}function j(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const s=U*o,c=s-(s-o),u=o-c,f=U*t,l=f-(f-t),h=t-l,a=[],p=u*h-(i-c*l-u*l-c*h);0!==p&&a.push(p);for(let o=1;o<e;o++){const e=n[o],s=e*t,c=U*e,u=c-(c-e),f=e-u,l=U*t,h=l-(l-t),p=t-h,d=f*p-(s-u*h-f*h-u*p),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&a.push(m),r=g;const b=s+r,x=r-(b-s);0!==x&&a.push(x),i=b}return 0===i&&0!==a.length||a.push(i),a}const W=Z,J=R;function K(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,W(n,t[r]));return e}function tt(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}const nt=tt,et=R;function rt(t,n){const e=nt(n);return et(t,e)}function ot(t){return 0===t?0:k(t)-F(t)+1}function it(t){const n=X(t);if(0===y(n))return 0;const e=n[n.length-1],r=n[0];return L(e)-L(r)+(53-F(r))}const st=K,ct=G,ut=it,ft=rt,lt=H;function ht(t,n,e){let r=n,o=t,i=!1,s=0;e||(s=ut(o)-ut(r)+1,e=s/53+1,i=!0);let c=[1/lt(r)],u=1;for(;;){if(o=st(o,c),u>e)return i?(o=ct(o,s),o):o.slice(o.length-e,o.length);r=st(r,c),c=ft([2],r),u*=2}}function at(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,s=i-r,c=r-(i-s)+(e-s);0!==c&&o.push(c),r=i}return 0===r&&0!==o.length||o.push(r),o}function pt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}const dt=pt,gt=at,vt=R;function mt(t){let n=[0];for(let e=0;e<t.length;e++){const r=t[e];n=1===r.length?1===n.length?dt(n[0],r[0]):gt(n,r[0]):1===n.length?gt(r,n[0]):vt(n,r)}return n}const bt=tt,xt=R,_t=X,It=at,Nt=mt,St=Z,Et=rt,wt=Math.sign;function Mt(t,n){t=_t(t);const e=(n=_t(n))[n.length-1];if(1===n.length){if(0===e)throw new Error("division by zero");if(1===e)return{div:t,rem:[0]};if(-1===e)return{div:bt(t),rem:[0]}}const r=wt(t[t.length-1]);if(0===r)return{div:[0],rem:[0]};const o=wt(e),i=[];let s=0;for(;;){const r=[];for(let o=t.length-1;o>=0;o--){const s=t[o],c=Math.round((s-s%e)/e);if(r.push(St(n,c)),0===c)break;i.push(c)}if(t=_t(Et(t,Nt(r))),s===i.length)break;s=i.length}let c=t,u=[0];for(let t=0;t<i.length;t++)u=It(u,i[t]);u=_t(u);const f=wt(c[c.length-1]);return 0!==f&&f!==r&&(r>0?o>0?(u=It(u,-1),c=xt(c,n)):(u=It(u,1),c=xt(c,bt(n))):r<0&&(o>0?(u=It(u,1),c=xt(c,bt(n))):(u=It(u,-1),c=xt(c,n)))),{div:u,rem:c}}const Pt=Mt,Tt=Mt;function yt(t,n){return y(rt(t,n))}const Ct=tt;function Ot(t){return t[t.length-1]<0?Ct(t):t}function At(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function zt(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}function Bt(t){const n=[];for(let e=0;e<t.length;e++)n.push(.5*t[e]);return n}const Yt=134217729;function Ft(t,n){const e=t*n,r=Yt*t,o=r-(r-t),i=t-o,s=Yt*n,c=s-(s-n),u=n-c;return[i*u-(e-o*c-i*c-o*u),e]}const Vt=K,kt=Ft,Lt=Z,Dt=pt,Xt=at,qt=R,Qt=K,$t=Ft,Gt=Z,Ht=X;function Rt(t){let n=t[0];for(let e=1;e<t.length;e++){const r=t[e];n=1==r.length?1===n.length?$t(n[0],r[0]):Gt(n,r[0]):1===n.length?Gt(r,n[0]):Qt(r,n)}return Ht(n)}const Ut=K,Zt=Rt,jt=X;function Wt(t){const n=(t=jt(t)).length;return 2===n?t:1===n?[0,t[0]]:[t[n-2],t[n-1]]}const Jt=3330669073875472e-31,Kt=2220446049250315e-31,tn=1109335647967049e-46,nn=3330669073875471e-31;function en(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let s;if(r>0){if(o<=0)return i;s=r+o}else{if(!(r<0))return i;if(o>=0)return i;s=-r-o}return Math.abs(i)>=Jt*s?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],s=t[1]-e[1],c=n[1]-e[1],u=rt(Ft(o,c),Ft(s,i));let f=H(u);if(Math.abs(f)>=Kt*r)return f;const l=T(t[0],e[0])[0],h=T(n[0],e[0])[0],a=T(t[1],e[1])[0],p=T(n[1],e[1])[0];if(0===l&&0===a&&0===h&&0===p)return f;const d=tn*r+nn*Math.abs(f);if(f+=o*p+c*l-(s*h+i*a),Math.abs(f)>=d)return f;const g=R(u,rt(Ft(l,c),Ft(a,i))),v=R(g,rt(Ft(o,p),Ft(s,h)));let m=R(v,rt(Ft(l,p),Ft(a,h)));return m=X(m),m[m.length-1]}(t,n,e,s)}function rn(t,n){return!function(t,n){if(0===t||0===n)return!0;Math.abs(n)>Math.abs(t)&&([t,n]=[n,t]);const e=F(t),r=k(n);return e+(L(t)-L(n))>r}(t,n)}const on=R,sn=K,cn=j,un={fastTwoDiff:function(t,n){const e=t-n;return[t-e-n,e]},fastTwoSum:function(t,n){const e=t+n;return[n-(e-t),e]},split:function(t){const n=134217729*t,e=n-(n-t);return[e,t-e]},twoDiff:T,twoProduct:Ft,twoSum:pt,reduceSignificand:q,fastExpansionSum:R,eAdd:on,growExpansion:at,eAddDouble:at,expansionProduct:K,eMult:sn,scaleExpansion:Z,eMultDouble1:Z,scaleExpansion2:j,eMultDouble2:cn,eDiv:ht,eLongDivide:Mt,eIntDiv:function(t,n){return Pt(t,n).div},eRem:function(t,n){return Tt(t,n).rem},eCompress:X,eEstimate:H,eDiff:rt,eNegativeOf:tt,eMultBy2:At,eMultByNeg2:zt,eDivBy2:Bt,eSign:y,eCompare:yt,eAbs:Ot,eToBitlength:G,eIntPow:function(t,n){if(0===n)return[1];if(1===n)return t;if(2===n)return Ut(t,t);const e=[];for(let r=0;r<n;r++)e.push(t);return Zt(e)},eCalculate:function(t){let n=[0];for(let e=0;e<t.length;e++){const r=t[e];let o=r[0];for(let t=1;t<r.length;t++){const n=r[t];o=1==n.length?1===o.length?kt(o[0],n[0]):Lt(o,n[0]):1===o.length?Lt(n,o[0]):Vt(n,o)}n=1===o.length?1===n.length?Dt(n[0],o[0]):Xt(n,o[0]):1===n.length?Xt(o,n[0]):qt(n,o)}return n},eSum:mt,eProduct:Rt,eToDd:Wt,parseDouble:z,parseDoubleDetailed:function(t){const n=O(t),[,e,r,o]=n.match(/^(.)(.{11})(.{52})$/),i=0===parseInt(r,2)?"0":"1";return{full:e+r+i+o,sign:e,exponent:r,hidden:i,significand:o}},isBitAligned:function(t,n,e){if(0===t)return!0;const r=L(t),o=k(t)-52+r;return F(t)-52+r>=e&&o<=n-1+e},msbExponent:D,lsbExponent:function(t){if(0===t||!Number.isFinite(t))return NaN;const n=L(t);return F(t)-52+n},bitLength:ot,expBitLength:it,doubleToBinaryString:O,doubleToOctets:C,getHighestSetBit:k,getLowestSetBit:F,exponent:L,significand:B,orient2d:en,isAdjacent:function(t,n){return rn(t,n)||rn(t,2*n)||rn(2*t,n)},isNonOverlappingAll:function(t){for(let n=1;n<t.length;n++)if(rn(t[n-1],t[n]))return!1;return!0},eIsInteger:function(t){t=X(t);for(let n=0;n<t.length;n++)if(t[n]%1!=0)return!1;return!0}};function fn(t){if(4===t.length){const[[n,e],[r,o]]=t;return[3*(r-n),3*(o-e)]}if(3===t.length){const[[n,e],[r,o]]=t;return[2*(r-n),2*(o-e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[r-n,o-e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}function ln(t){if(4===t.length){const[[n,e],[r,o],[i,s]]=t;return[6*(i+n-2*r),6*(s+e-2*o)]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[2*(i+n-2*r),2*(s+e-2*o)]}if(t.length<=2)return[0,0];throw new Error("The given bezier curve must be of order <= 3")}function hn(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[6*(c-n+3*(r-i))],[6*(u-e+3*(o-s))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}const an=.0698;function pn(t,n){const e=function(t,n){const e=t[t.length-2],r=n[0],o=n[1],i=[r[0]-e[0],r[1]-e[1]],s=[o[0]-r[0],o[1]-r[1]],c=function(t,n,e){const r=T(t[0],e[0]),o=T(n[1],e[1]),i=T(t[1],e[1]),s=T(n[0],e[0]),c=sn(r,o),u=sn(i,s);return H(on(c,tt(u)))}(e,r,o);return 0!==c?c:b(i,s)>0?0:function(t,n){const[e,r]=fn(t),[o,i]=ln(t),[s,c]=fn(n),[u,f]=ln(n),l=rt(Ft(e,i),Ft(r,o)),h=rt(Ft(s,f),Ft(c,u)),a=y(l),p=y(h);if(a!==p)return a-p;const d=R(Ft(s,s),Ft(c,c)),g=R(Ft(e,e),Ft(r,r)),v=K(d,d),m=K(v,d),b=K(g,g),x=K(b,g);if(0!==a||0!==p){const t=K(l,l),n=K(h,h),e=y(rt(K(t,m),K(n,x)));if(0!==e)return a>0?e:-e}const[[_],[I]]=hn(t),[[N],[S]]=hn(n),E=rt(Ft(e,I),Ft(r,_)),w=R(Ft(e,o),Ft(r,i)),M=rt(Ft(s,S),Ft(c,N)),P=R(Ft(s,u),Ft(c,f)),T=rt(K(g,E),Z(K(l,w),3)),C=rt(K(d,M),Z(K(h,P),3)),O=y(T),A=y(C);if(a!==p)return O-A;if(0===O&&0===A)return 0;const z=K(T,T),B=K(v,m),Y=K(C,C),F=K(b,x),V=y(rt(K(z,B),K(Y,F)));return O>0?V:-V}(t.slice().reverse(),n)}(t,n),r=e<0,o=e>0,i=t[t.length-2],s=t[t.length-1],c=[s[0]-i[0],s[1]-i[1]],u=n[0],f=n[1],l=[f[0]-u[0],f[1]-u[1]],h=[N(c),N(l)],a=_(h[0],h[1]);let p,d;return b(c,l)>0?(p=a<-an,d=a>+an):(p=r,d=o),{tangents:h,crossTangents:a,isSharp:r,isDull:o,isQuiteSharp:p,isQuiteDull:d}}const dn=P((function(t){return pn(t.ps,t.next.ps)}));function gn(t){return dn(1===t.t?t.curve:t.curve.prev)}function vn(t){return 0===t.t||1===t.t}const mn=P((t=>!!vn(t)&&gn(t).isSharp));function bn(t){const n=t.cp.circle.center,e=t,r=t.nextOnCircle,o=e.cp.pointOnShape,i=r.cp.pointOnShape,s=o.p,c=i.p;let u;if(mn(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=N(M(t.ps,0)),r=[-(f=N(M(n.ps,1)))[0],-f[1]],i=b(e,r),s=Math.sqrt((1+i)/2);u=S(Math.sqrt((1-i)/2),s,r)}else u=s[0]===c[0]&&s[1]===c[1]?d(s,n):x(d(s,c));var f;return[n,I(N(u),n)]}const xn=.01,_n=1e-4;function In(t,n){const e=t.cp.circle.center,r=bn(t),o=n.cp.circle.center,i=bn(n.prevOnCircle),s=a(r,i),c=d(e,o);let u;if(s){const t=d(e,s),n=d(o,s);u=b(t,c)<0||b(n,c)>0}else u=!0;if(!u)return[e,s,o];const f=x(c),l=d(r[0],r[1]),h=d(i[0],i[1]),p=Math.abs(_(c,l))/9,v=Math.abs(_(c,h))/9;if(p>xn||v>xn)return[e,o];if(p>_n||v>_n){const t=g(e,o,1/3),n=g(e,o,2/3),s=I(f,t),c=[n,I(f,n)];return[e,a(r,[t,s]),a(i,c),o]}return[e,o]}function Nn(t){return In(t,t.next)}function Sn(t,n,e,r=void 0,o=void 0,i=void 0,s=void 0){return{cp:t,isHoleClosing:n,isIntersection:e,prev:r,next:o,prevOnCircle:i,nextOnCircle:s}}function En(t){return Nn(t)}const wn=(t,n)=>h(t.cp,n.cp);function Mn(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function Pn(t){if(An(t))return[];const n=[];let e=t;for(;e!==t.prevOnCircle;)An(e)||n.push(e.next),e=e.nextOnCircle;return n}function Tn(t){const n=t,e=[n];let r=t.next;for(;r!==n;)e.push(r),r=r.next;return e}function yn(t,n,e,r,o){const i=Sn(r,t,n);let s,c;return"undefined"!=typeof _debug_&&_debug_.generated.elems.cpNode.push({generated:_debug_.generated,cpNode:i}),o?(s=o,c=s.next):(s=i,c=i),c.prev=i,s.next=i,i.prev=s,i.next=c,e.insert(i),i}function Cn(t,n=!1){const e=t;let r=e;const o=[];do{n?n=!1:o.push(r),r=r.nextOnCircle}while(r!==e);return o}function On(t,n){return Cn(t,!0).indexOf(n)>=0}function An(t){return t===t.next.prevOnCircle}function zn(t){return Cn(t.prevOnCircle,!0).every((t=>An(t)))}function Bn(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function Yn(t){return 0===t.cp.circle.radius}function Fn(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function Vn(t){return function(t){const n=t;if(0===n.cp.circle.radius)return!0;const e=n.nextOnCircle,r=n.cp.pointOnShape.p,o=e.cp.pointOnShape.p;return r[0]===o[0]&&r[1]===o[1]}(t)?1:Fn(t)}function kn(t,n){const e=t.prev,r=t.next;e.next=r,r.prev=e;const o=r.prevOnCircle,i=e.nextOnCircle;o.next=i,i.prev=o,n&&n.remove(t,!1)}function Ln(t){const n=t.cp,e=n.pointOnShape;return{idx:e.curve.idx,t:e.t,order:n.order,order2:n.order2}}function Dn(t){const n=t.cp.pointOnShape.curve;return{...t,isTerminating:An(t),isFullyTerminating:zn(t),isSharp:Yn(t),prongCount:Fn(t),getRealProngCount:Vn(t),ordering:Ln(t),curve:n,loop:n.loop}}function Xn(t){let n=t;if(n===n.next.prevOnCircle)return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function qn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=r-i,c=s-r,u=e-o,f=u-e,l=r-(s-c)+(-i-c)+u,h=s+l,a=e-(u-f)+(-o-f)+(l-(h-s)),p=h+a;return[a-(p-h),p]}const Qn=qn,$n=qn;Number.EPSILON;const Gn=2**27+1;const Hn=134217729,Rn=134217729;function Un(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=r/i,c=i*s,u=Rn*i,f=u-(u-i),l=i-f,h=Rn*s,a=h-(h-s),p=s-a,d=o*s,g=c+d,v=d-(g-c)+(l*p-(c-f*a-l*a-f*p)),m=g+v,b=(r-m+(e-(v-(m-g))))/i,x=s+b;return[b-(x-s),x]}const Zn=134217729,jn=Un,Wn=Number.EPSILON/2,Jn=Wn*Wn,Kn=Number.EPSILON/2,te=function(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,s=i-(i-r),c=r-s,u=Hn*t,f=u-(u-t),l=t-f,h=c*l-(o-s*f-c*f-s*l)+e*t,a=o+h;return[h-(a-o),a]},ne=function(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,s=i-(i-r),c=r-s,u=.5*(e-o-(c*c-(o-s*s-s*c*2))+n)/r;return[u-(r+u-r),r+u]},ee=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}},re=function(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,s=e+(r-(o-i)+(n-i)),c=o+s;return[s-(c-o),c]},oe=function(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=r+i,c=s-r,u=e+o,f=u-e,l=r-(s-c)+(i-c)+u,h=s+l,a=e-(u-f)+(o-f)+(l-(h-s)),p=h+a;return[a-(p-h),p]},ie=qn,se=function(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,s=i-(i-r),c=r-s,u=Hn*t,f=u-(u-t),l=t-f,h=e*t,a=o+h,p=h-(a-o)+(c*l-(o-s*f-c*f-s*l)),d=a+p;return[p-(d-a),d]},ce=function(t){return[2*t[0],2*t[1]]},ue=function(t){return[4*t[0],4*t[1]]},fe=function(t){return[-2*t[0],-2*t[1]]},le=function(t,n){const e=t[1],r=n[1],o=e*r,i=Gn*e,s=i-(i-e),c=e-s,u=Gn*r,f=u-(u-r),l=r-f,h=c*l-(o-s*f-c*f-s*l)+(e*n[0]+t[0]*r),a=o+h;return[h-(a-o),a]},he=Un,ae=function(t){return[-t[0],-t[1]]},pe=function(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]},de=function(t,n){const e=t*n,r=Zn*t,o=r-(r-t),i=t-o,s=Zn*n,c=s-(s-n),u=n-c;return[i*u-(e-o*c-i*c-o*u),e]},ge=function(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]},ve=function(t,n,e,r){const o=t/n,i=Math.abs(t),s=Math.abs(n),c=s-r;return c<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(s*e+i*r)/c**2+Kn*Math.abs(i/s)}},me=le,be=oe,xe=ie,_e=pe,Ie=re;function Ne(t,n){if(0===n[0]&&0===n[1])return t[0].map((t=>[0,t]));if(0===n[0]&&1===n[1])return t[t.length-1].map((t=>[0,t]));if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=Ie(me(_e(o,e),n),e),h=Ie(me(_e(s,o),n),o),a=Ie(me(_e(u,s),n),s),p=be(l,me(xe(h,l),n)),d=be(h,me(xe(a,h),n)),g=be(p,me(xe(d,p),n)),v=Ie(me(_e(i,r),n),r),m=Ie(me(_e(c,i),n),i),b=Ie(me(_e(f,c),n),c),x=be(v,me(xe(m,v),n)),_=be(m,me(xe(b,m),n));return[g,be(x,me(xe(_,x),n))]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=be([0,e],me(_e(o,e),n)),f=be([0,o],me(_e(s,o),n)),l=be(u,me(xe(f,u),n)),h=be([0,r],me(_e(i,r),n)),a=be([0,i],me(_e(c,i),n));return[l,be(h,me(xe(a,h),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Ie(me(_e(o,e),n),e),Ie(me(_e(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}function Se(t,n,e){return{curve:t,t:n,p:Ne(t.ps,[0,n]).map((t=>t[1])),source:e}}const Ee=Number.EPSILON/2,we=Ee*Ee,Me=te,Pe=H,Te=function(t){const n=3*we;return n/(1-n)}(),ye=Z,Ce=pt,Oe=Ft,Ae=Math.abs,ze=Number.EPSILON/2;function Be(t,n){let e=t[0],r=.5*Ae(e);for(let o=1;o<t.length;o++)e=e*n+t[o],r=r*Ae(n)+Ae(e);return r=ze*(2*r-Ae(e)),[e,r]}const Ye=Math.abs,Fe=function(t){const n=t*Ee;return n/(1-n)},Ve=Be,ke=E,Le=Fe(1),De=Fe(2);function Xe(t,n,e=void 0,r=1){const o=Math.abs(n),i=t[0],[s,c]=Ve(i,n),u=De*function(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+Ye(t[r]);return e}(i,o),f=void 0!==e?ke(e,o):0;if((c+u+f)*r<Math.abs(s))return s;const l=function(t,n){const e=[],r=[];let o,i=t[0];for(let s=1;s<t.length;s++){const[c,u]=Oe(i,n);[o,i]=Ce(u,t[s]),e.push(c),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(i,n),{pπ:h,pσ:a}=l;let{r̂:p}=l;const[d,g]=Ve(h,n),[v,m]=Ve(a,n),[b,x]=Ve(t[1],n);let _=g+m+x+f;return p=d+v+b+p,_+=Le*p,_*r<Math.abs(p)?p:0}const qe=R,Qe=Z;function $e(t,n){let e=[0];for(let r=0;r<t.length;r++)e=qe(t[r],Qe(e,n));return e}const Ge=Xe,He=$e,Re=H,Ue=Xe,Ze=$e,je=H,We=Number.EPSILON,Je=Math.abs,Ke=Math.max;function tr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-t[e]);return n}const nr=tr,er=function(t){return n=>1/t(function(t){return t.slice().reverse()}(n))};function rr(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=nr(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=Number.POSITIVE_INFINITY,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const s=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>s&&(n=s),i=!0}i&&r<n&&(r=n)}return r}er(rr);const or=(Ir=rr,t=>-Ir(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2&&(e[t]=-e[t]);return e}(t))),ir=(er(or),function(t){const{p:n,pE:e}=t,r=[],o=[],i=n.length-1;for(let t=0;t<i;t++){const s=i-t,c=Me(s,n[t]);r.push(c);const u=0==(s&s-1)?0:Te,f=Pe(c);o.push(s*e[t]+Math.abs(f)*u)}return{p:r,pE:o}}),sr=Xe,cr=$e,ur=function(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e},fr=function(t,n,e,r){const o=Ge(t,e,n,4);return 0!==o?o:Re(He(r(),e))},lr=function(t,n,e,r,o,i,s,c){let u=e,f=r,l=u,h=o,a=f-u,p=a;for(;;){let d;Je(h)<Je(i)&&(u=f,f=l,l=u,o=i,i=h,h=o);const g=Ke(Je(u),Je(f));d=g<=1?We:We*2**Math.ceil(Math.log2(g));const v=.5*(l-f);if(Je(v)<=d)return f<l?[f,l]:[l,f];if(Je(a)<d||Je(o)<=Je(i))a=v,p=a;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/h;const r=i/h;t=e*(2*v*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=a,a=p,2*t<3*v*n-Je(d*n)&&t<Je(.5*e*n)?p=t/n:(a=v,p=a)}if(u=f,o=i,d<Je(p)?f+=p:0<v?f+=d:f-=d,0===(i=c?je(Ze(s(),f)):Ue(t,f,n))){if(c)return[f,f];const o=Math.max(e,f-d),u=Math.min(r,f+d);if(Ue(t,o,n)*Ue(t,u,n)!=0)return[o,u];if(c=!0,0===(i=je(Ze(s(),f))))return[f,f]}(0<i&&0<h||i<=0&&h<=0)&&(l=u,h=o,a=f-u,p=a)}},hr=or,ar=rr,pr=function(t){const n=[],e=t.length-1;for(let r=0;r<e;r++)n.push(ye(t[r],e-r));return n},dr=H,gr=Be,vr=y,mr=Math.max,br=Math.min,xr=Math.abs,_r=1+Number.EPSILON;var Ir;function Nr(t,n=0,e=1,r,o,i){o||(o=()=>t),r=r||new Array(t.length).fill(0);let s,c,u=0;for(;t.length>0&&xr(t[0][1])<=r[0]&&(c=c||o(),0===vr(c[0]));)(t=t.slice()).shift(),(r=r.slice()).shift(),c.shift();if(0===t.length)return i?void 0:[];if(1===t.length)return[];if(n===Number.NEGATIVE_INFINITY||e===Number.POSITIVE_INFINITY){const r=t.map((t=>t[1]));n===Number.NEGATIVE_INFINITY&&(n=hr(r)),e===Number.POSITIVE_INFINITY&&(e=ar(r))}const f=ur(t);let l,h;const a=t.length-1;let p,d;l=0,h=!1;do{if(p=h?dr(cr(_(),n)):sr(f,n,r),0===p){if(l++,l>=3&&!h){h=!0;continue}n-=2*Number.EPSILON*mr(1,xr(n))}}while(0===p);l=0,h=!1;do{if(d=h?dr(cr(_(),e)):sr(f,e,r),0===d){if(l++,l>=3&&!h){h=!0;continue}e+=2*Number.EPSILON*mr(1,xr(e))}}while(0===d);const g=[{p:t,pE:r}],v=[ur(t)];for(let t=1;t<=a;t++){const n=ir(g[t-1]);g.push(n),v.push(ur(n.p))}let m,b,x=[];for(u=a-1;u>=0;u--)m=g[u].pE,b=v[u],x=I();function _(){if(void 0!==s)return s[u];let t=c||o();for(s=[t];t.length>1;)t=pr(t),s.push(t);return s[u]}return x;function I(){const t=[],r=fr(b,m,n,_);if(!x.length){const t=fr(b,m,e,_);if(r*t>=0)return[];const[o,i]=lr(b,m,n,e,r,t,_);return[{tS:o,tE:i,multiplicity:1}]}let o=x[0].tS,i=fr(b,m,o,_);if(r*i>0);else if(r*i<0){const[e,s]=lr(b,m,n,o,r,i,_);t.push({tS:e,tE:s,multiplicity:1})}let s,c=n,f=r,l=o,h=i;for(let n=0;n<x.length;n++){const r=x[n+1];s=x[n],o=l,c=x[n].tE,l=r?r.tS:e;const u=f;if(i=h,f=fr(b,m,c,_),h=fr(b,m,l,_),i*f>0)if(f*h>0)c!==o&&s.multiplicity%2==1&&p();else if(f*h<0){c!==o&&s.multiplicity%2==1&&p();const[n,e]=lr(b,m,c,l,f,h,_);t.push({tS:n,tE:e,multiplicity:1})}else c!==o&&s.multiplicity%2==1&&p();else if(i*f<0){if(t.push({tS:s.tS,tE:s.tE,multiplicity:3}),f*h<0){const[n,e]=lr(b,m,c,l,f,h,_);t.push({tS:n,tE:e,multiplicity:1})}}else if(0===f)0===i?t.push({tS:s.tS,tE:s.tE,multiplicity:s.multiplicity+1}):i*h>0?t.push({tS:s.tS,tE:s.tE,multiplicity:2}):t.push({tS:s.tS,tE:s.tE,multiplicity:3});else{if(f*h<0){const[n,e]=lr(b,m,c,l,f,h,_);t.push({tS:n,tE:e,multiplicity:1})}u*f>0?t.push({tS:s.tS,tE:s.tE,multiplicity:2}):t.push({tS:s.tS,tE:s.tE,multiplicity:3})}}for(let n=0;n<t.length-1;n++){const e=t[n],r=t[n+1];if(e.tE>=r.tS)return Sr(t)}return t;function p(){const n=(c-o)*_r;let e=1,r=0;for(let t=u+2;t<=a;t++){const i=v[t][0],s=gr(i,o);r+=(xr(s[0])+s[1])*e,e*=n*_r}const l=f>0?br(i,f):mr(i,f),h=2*Number.EPSILON*mr(1,xr(c)),p=r*(2*h);(l+(f>0?2*-p*h:2*p*h))*f<0&&t.push({tS:s.tS,tE:s.tE,multiplicity:2})}}}function Sr(t){const n=[],e=t[0];let r={tS:e.tS,tE:e.tE,multiplicity:e.multiplicity};for(let e=0;e<t.length-1;e++){const o=t[e],i=t[e+1];o.tE<i.tS?(n.push(r),r={tS:i.tS,tE:i.tE,multiplicity:i.multiplicity}):(r.tE=i.tE,r.multiplicity=o.multiplicity+i.multiplicity)}return n.push(r),n}function Er(t,n=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY,r){return Nr(t.map((t=>[0,t])),n,e,void 0,void 0,r)}function wr(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[3*(c-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-s)),6*(s+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(s+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function Mr(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=e+(o-e)*n,h=o+(s-o)*n,a=l+(h-l)*n,p=r+(i-r)*n,d=i+(c-i)*n,g=p+(d-p)*n;return[a+(h+(s+(u-s)*n-h)*n-a)*n,g+(d+(c+(f-c)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(s-o)*n-u)*n,f+(i+(c-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const Pr=Math.abs;function Tr(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pr(n[1]);if(4===t.length){const[[n,r],[o,i],[s,c],[u,f]]=t,l=Pr(n),h=Pr(r),a=Pr(o),p=Pr(i),d=Pr(s),g=Pr(c),v=l+(a+l)*e,m=a+(d+a)*e,b=v+(m+v)*e,x=h+(p+h)*e,_=p+(g+p)*e,I=x+(_+x)*e;return[b+(m+(d+(Pr(u)+d)*e+m)*e+b)*e,I+(_+(g+(Pr(f)+g)*e+_)*e+I)*e]}if(3===t.length){const[[n,r],[o,i],[s,c]]=t,u=Pr(n),f=Pr(r),l=Pr(o),h=Pr(i),a=u+(l+u)*e,p=f+(h+f)*e;return[a+(l+(Pr(s)+l)*e+a)*e,p+(h+(Pr(c)+h)*e+p)*e]}if(2===t.length){const[[n,r],[o,i]]=t,s=Pr(n),c=Pr(r);return[s+(Pr(o)+s)*e,c+(Pr(i)+c)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const yr=Number.EPSILON/2,Cr=yr*yr;function Or(t){const n=t*yr;return n/(1-n)}function Ar(t){const n=t*Cr;return n/(1-n)}Or(1),Ar(3);const zr=Math.abs,Br=[[0,0],[0,0],[0,0],[0,0]];const Yr=Math.abs,Fr=[[0,0],[0,0],[0,0]];const Vr=Math.abs,kr=[[0,0],[0,0]];const Lr=Number.EPSILON/2,Dr=Or(1);function Xr(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Br}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-a))))),b=c-n*(c-f),x=f-n*(f-h),_=b-n*(b-x),I=_-n*(_-(x-n*(x-(h-n*(h-p))))),N=zr(n),S=zr(s),E=zr(u),w=zr(l),M=zr(a),P=zr(c),T=zr(f),y=zr(h),C=S+N*(S+E),O=E+N*(E+w),A=C+N*(C+O),z=P+N*(P+T),B=T+N*(T+y),Y=z+N*(z+B);return{ps:[[s,c],[d,b],[v,_],[m,I]],_ps:[[0,0],[C,z],[A,Y],[A+N*(A+(O+N*(O+(w+N*(w+M))))),Y+N*(Y+(B+N*(B+(y+N*(y+zr(p))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=m-n*(m-b),_=c-n*(c-f),I=f-n*(f-h),N=h-n*(h-p),S=_-n*(_-I),E=I-n*(I-N),w=S-n*(S-E),M=zr(n),P=zr(s),T=zr(u),y=zr(l),C=zr(a),O=zr(c),A=zr(f),z=zr(h),B=P+M*(P+T),Y=T+M*(T+y),F=y+M*(y+C),V=B+M*(B+Y),k=Y+M*(Y+F),L=O+M*(O+A),D=A+M*(A+z),X=z+M*(z+zr(p)),q=L+M*(L+D),Q=D+M*(D+X);return{ps:[[x,w],[b,E],[v,N],[a,p]],_ps:[[V+M*(V+k),q+M*(q+Q)],[k,Q],[F,X],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=s[0]-c,I=b+x,N=n*b,S=e*b,E=_-3*x,w=u-l,M=a-l,P=s[1]-u,T=w+M,y=n*w,C=e*w,O=P-3*M,A=d*E+(3*n*(n*I-b)+c),z=m*(n*E+2*I)+(p*I+c-(S+2*N)),B=m*(e*E+2*I)+(g*I+c-(2*S+N)),Y=v*E+(3*e*(e*I-b)+c),F=d*O+(3*n*(n*T-w)+u),V=m*(n*O+2*T)+(p*T+u-(C+2*y)),k=m*(e*O+2*T)+(g*T+u-(2*C+y)),L=v*O+(3*e*(e*T-w)+u),D=zr(n),X=zr(e),q=zr(m),Q=zr(d),$=zr(v),G=zr(c),H=zr(f),R=G+H,U=zr(h)+H,Z=R+U,j=D*R,W=X*R,J=zr(_)+3*U,K=zr(u),tt=zr(l),nt=K+tt,et=zr(a)+tt,rt=nt+et,ot=D*nt,it=X*nt,st=zr(P)+3*et;return{ps:[[A,F],[z,V],[B,k],[Y,L]],_ps:[[Q*J+(3*D*(D*Z+R)+G),Q*st+(3*D*(D*rt+nt)+K)],[q*(D*J+2*Z)+(p*Z+G+(W+2*j)),q*(D*st+2*rt)+(p*rt+K+(it+2*ot))],[q*(X*J+2*Z)+(g*Z+G+(2*W+j)),q*(X*st+2*rt)+(g*rt+K+(2*it+ot))],[$*J+(3*X*(X*Z+R)+G),$*st+(3*X*(X*rt+nt)+K)]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=e[3][0],u=9*Lr*r[0][0],f=9*Lr*r[1][0],l=9*Lr*r[2][0],h=9*Lr*r[3][0],a=e[0][1],p=e[1][1],d=e[2][1],g=e[3][1],v=9*Lr*r[0][1],m=9*Lr*r[1][1],b=9*Lr*r[2][1],x=9*Lr*r[3][1],_=Math.min(o-u,i-f,s-l,c-h),I=Math.max(o+u,i+f,s+l,c+h);return[[_,Math.min(a-v,p-m,d-b,g-x)],[I,Math.max(a+v,p+m,d+b,g+x)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Fr}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=s-u,d=[[i,s],[-n*a+i,-n*p+s],[h*(a+(f-c))-(2*n*a-i),h*(p+(l-u))-(2*n*p-s)]],g=Yr(n),v=Yr(i),m=Yr(c),b=Yr(f),x=v+m,_=Yr(s),I=Yr(u),N=_+I;return{ps:d,_ps:[[0,0],[g*x+v,g*N+_],[h*(x+(b+m))+(2*g*x+v),h*(N+(Yr(l)+I))+(2*g*N+_)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u,v=[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]],m=Yr(n),b=Yr(i),x=Yr(c),_=b+x,I=Yr(f)+x,N=Yr(s),S=Yr(u),E=N+S;return{ps:v,_ps:[[h*(_+I)+(2*m*_+b),h*(E+(Yr(l)+S))+(2*m*E+N)],[m*I+x,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=i[0],h=i[1],a=n*n,p=e*e,d=n*e,g=s-u,v=g+(l-u),m=c-f,b=m+(h-f),x=a*v-(2*n*g-s),_=d*v-(g*(e+n)-s),I=p*v-(2*e*g-s),N=a*b-(2*n*m-c),S=d*b-(m*(e+n)-c),E=p*b-(2*e*m-c),w=Yr(n),M=Yr(e),P=Yr(d),T=Yr(s),y=Yr(u),C=T+y,O=C+Yr(l)+y,A=Yr(c),z=Yr(f),B=A+z,Y=B+Yr(h)+z;return{ps:[[x,N],[_,S],[I,E]],_ps:[[a*O+(2*w*C+T),a*Y+(2*w*B+A)],[P*O+(C*(M+w)+T),P*b+(B*(M+w)+A)],[p*O+(2*M*C+T),p*Y+(2*M*B+A)]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=5*Lr*r[0][0],u=5*Lr*r[1][0],f=5*Lr*r[2][0],l=e[0][1],h=e[1][1],a=e[2][1],p=5*Lr*r[0][1],d=5*Lr*r[1][1],g=5*Lr*r[2][1],v=Math.min(o-c,i-u,s-f),m=Math.max(o+c,i+u,s+f);return[[v,Math.min(l-p,h-d,a-g)],[m,Math.max(l+p,h+d,a+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:kr}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[o,i],[n*(s-o)+o,n*(c-i)+i]],f=Vr(n),l=Vr(o),h=Vr(s),a=Vr(i);return{ps:u,_ps:[[0,0],[f*(h+l)+l,f*(Vr(c)+a)+a]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[n*(s-o)+o,n*(c-i)+i],[s,c]],f=Vr(n),l=Vr(o),h=Vr(s),a=Vr(i);return{ps:u,_ps:[[f*(h+l)+l,f*(Vr(c)+a)+a],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1],f=[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]],l=Vr(n),h=Vr(e),a=Vr(i),p=Vr(c),d=Vr(s),g=Vr(u);return{ps:f,_ps:[[l*(p+a)+a,l*(g+d)+d],[h*(p+a)+a,h*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=3*Lr*r[0][0],c=3*Lr*r[1][0],u=e[0][1],f=e[1][1],l=3*Lr*r[0][1],h=3*Lr*r[1][1],a=Math.min(o-s,i-c),p=Math.max(o+s,i+c);return[[a,Math.min(u-l,f-h)],[p,Math.max(u+l,f+h)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Mr(t,n);let i;if(4===t.length)i=Tr(t,[0,n]).map((t=>8*Dr*t));else if(3===t.length)i=Tr(t,[0,n]).map((t=>5*Dr*t));else if(2===t.length)i=Tr(t,[0,n]).map((t=>2*Dr*t));else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function qr(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=wr(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=Xr(t,i);c[0][1]<r.box[0][1]&&(r={ts:i,box:c}),c[1][1]>o.box[0][1]&&(o={ts:i,box:c})}return{minY:r,maxY:o}}function Qr(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=wr(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=Xr(t,i);c[0][0]<r.box[0][0]&&(r={ts:i,box:c}),c[1][0]>o.box[0][0]&&(o={ts:i,box:c})}return{minX:r,maxX:o}}(t),e=qr(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}function $r(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Gr(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,s;const c=function(t){let n=0;for(let e=0;e<t.length-1;e++)n+=$r(t[e],t[e+1]);return n}(t);if(256*p(t[0],t[t.length-1])<c*c){const[r,o]=Mr(t,.5),c=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/c,s=(r-n)/c}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,s=(r-n)/t}const u=function(t,n,e){const r=I(t[0].map((t=>-t)));return Qr(t.map((t=>S(-n,e,r(t)))))}(t,i,s),[[f,l],[h,a]]=u,d=[u[0],[h,l],u[1],[f,a]],g=S(i,s);return d.map((n=>I(t[0],g(n))))}function Hr(t,n,e){if(n===e)return;const r=t[n];t[n]=t[e],t[e]=r}function Rr(t,n=!1){if(!t.length)return;function e(t,e,r){const o=en(t,e,r);return n?o<0:o<=0}const r=t.slice(),o=r.length,i=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(r),[s]=r.splice(i,1);r.sort(((t,n)=>{let e=-en(s,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])})),r.unshift(s);let c=1;for(let t=2;t<o;t++){for(;e(r[c-1],r[c],r[t]);)if(c>1)c-=1;else{if(t===o-1){c-=1;break}t+=1}c+=1,Hr(r,c,t)}return r.slice(0,c+1)}const Ur=Rr,Zr=pe,jr=oe,Wr=te,Jr=le,Kr=ce,to=ue,no=ie,eo=pe,ro=oe,oo=te,io=le,so=ce,co=ie,uo=ue,fo=de,lo=oe,ho=fe,ao=ie,po=T,go=sn,vo=j,mo=At,bo=zt,xo=on,_o=rt,Io=T,No=sn,So=j,Eo=At,wo=on,Mo=rt;function Po(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const To=T,yo=sn,Co=zt,Oo=on,Ao=rt,zo=Math.abs;function Bo(t){return(t.tS+t.tE)/2}function Yo(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Fo=H,Vo=T,ko=sn,Lo=on,Do=Number.EPSILON,{sqrt:Xo}=Math,qo=Ar(6);function Qo(t,n){const e=t.length-1;let r;if(3===e)r=Nr(function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],[d,g]=n,v=Zr(s,d),m=Zr(u,d),b=Zr(l,d),x=Zr(a,d),_=Zr(c,g),I=Zr(f,g),N=Zr(h,g),S=Zr(p,g),E=Jr(v,v),w=Wr(6,Jr(v,m)),M=Wr(6,Jr(v,b)),P=Kr(Jr(v,x)),T=Wr(9,Jr(m,m)),y=Wr(18,Jr(m,b)),C=Wr(6,Jr(m,x)),O=Wr(9,Jr(b,b)),A=Wr(6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;return[6*(x*x+M+(E+w)+C+(A+O)+(S*S+y+(P+T)+z+(Y+B))),5*(M+5*w+3*O+2*(C+2*A+3*E)+(y+5*T+3*B+2*(z+2*Y+3*P))),4*(C+3*(O+2*A)+5*(2*w+3*E)+(z+3*(B+2*Y)+5*(2*T+3*P))),3*(O+2*(2*A+5*(w+2*E))+(B+2*(2*Y+5*(T+2*P)))),2*(A+5*(w+3*E)+(Y+5*(T+3*P))),w+6*E+(T+6*P)]}(t,n).map((t=>10*qo*t)),(()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],[d,g]=n,v=po(s,d),m=po(u,d),b=po(l,d),x=po(a,d),_=po(c,g),I=po(f,g),N=po(h,g),S=po(p,g),E=go(v,v),w=vo(6,go(v,m)),M=vo(6,go(v,b)),P=mo(go(v,x)),T=vo(9,go(m,m)),y=vo(18,go(m,b)),C=vo(6,go(m,x)),O=vo(9,go(b,b)),A=vo(6,go(b,x)),z=go(x,x),B=go(_,_),Y=vo(6,go(_,I)),F=vo(6,go(_,N)),V=mo(go(_,S)),k=vo(9,go(I,I)),L=vo(18,go(I,N)),D=vo(6,go(I,S)),X=vo(9,go(N,N)),q=vo(6,go(N,S)),Q=go(S,S),$=xo(C,O),G=xo(P,y),H=xo(M,T),R=xo(D,X),U=xo(V,L),Z=xo(F,k),j=_o(xo(xo(z,E),xo($,H)),xo(xo(G,A),w)),W=_o(xo(xo(Q,B),xo(R,Z)),xo(xo(U,q),Y)),J=vo(6,xo(j,W)),K=xo(bo(xo(xo($,mo(H)),vo(3,E))),xo(xo(A,vo(3,G)),vo(5,w))),tt=xo(bo(xo(xo(R,mo(Z)),vo(3,B))),xo(xo(q,vo(3,U)),vo(5,Y))),nt=vo(5,xo(K,tt)),et=xo(xo($,vo(3,_o(mo(H),G))),vo(5,_o(vo(3,E),mo(w)))),rt=xo(xo(R,vo(3,_o(mo(Z),U))),vo(5,_o(vo(3,B),mo(Y)))),ot=vo(4,xo(et,rt)),it=_o(G,mo(_o(mo(H),vo(5,_o(w,mo(E)))))),st=_o(U,mo(_o(mo(Z),vo(5,_o(Y,mo(B)))))),ct=vo(3,xo(it,st)),ut=_o(H,vo(5,_o(w,vo(3,E)))),ft=_o(Z,vo(5,_o(Y,vo(3,B)))),lt=mo(xo(ut,ft)),ht=_o(w,vo(6,E)),at=_o(Y,vo(6,B));return[J,nt,ot,ct,lt,xo(ht,at)]}(t,n)));else if(2===e)r=Nr(function(t,n){const[[e,r],[o,i],[s,c]]=t,[u,f]=n,l=eo(e,u),h=eo(o,u),a=eo(s,u),p=eo(r,f),d=eo(i,f),g=eo(c,f),v=io(l,l),m=io(l,h),b=io(l,a),x=io(h,h),_=io(h,a),I=io(a,a),N=io(p,p),S=io(p,d),E=io(p,g),w=io(d,d),M=io(d,g),P=io(g,g),T=ro(E,so(w)),y=ro(b,so(x));return[ro(co(ro(ro(P,N),so(T)),uo(ro(M,S))),co(ro(ro(I,v),so(y)),uo(ro(_,m)))),oo(3,ro(ro(co(M,T),co(oo(3,S),N)),ro(co(_,y),co(oo(3,m),v)))),ro(co(T,oo(3,co(so(S),N))),co(y,oo(3,co(so(m),v)))),ro(co(S,N),co(m,v))]}(t,n),0,1,function(t,n){const e=t[0],r=t[1],o=t[2],i=zo(e[0]),s=zo(e[1]),c=zo(r[0]),u=zo(r[1]),f=zo(o[0]),l=zo(o[1]),h=zo(n[0]),a=zo(n[1]),p=i+h,d=c+h,g=f+h,v=s+a,m=u+a,b=l+a,x=p*p,_=p*d,I=d*g,N=v*v,S=v*m,E=m*b,w=v*b+m*m*2,M=p*g+d*d*2;return[b*b+N+2*w+4*(E+S)+(g*g+x+2*M+4*(I+_)),3*(E+w+(3*S+N)+(I+M+(3*_+x))),w+3*(2*S+N)+(M+3*(2*_+x)),S+N+(_+x)]}(t,n).map((t=>8*qo*t)),(()=>function(t,n){const[[e,r],[o,i],[s,c]]=t,[u,f]=n,l=Io(e,u),h=Io(o,u),a=Io(s,u),p=Io(r,f),d=Io(i,f),g=Io(c,f),v=No(l,l),m=No(l,h),b=No(l,a),x=No(h,h),_=No(h,a),I=No(a,a),N=No(p,p),S=No(p,d),E=No(p,g),w=No(d,d),M=No(d,g),P=No(g,g),T=wo(E,Eo(w)),y=wo(b,Eo(x)),C=wo(Mo(wo(I,Eo(y)),Po(wo(_,m))),v),O=wo(Mo(wo(P,Eo(T)),Po(wo(M,S))),N),A=wo(C,O),z=wo(Mo(_,y),Mo(So(3,m),v)),B=wo(Mo(M,T),Mo(So(3,S),N)),Y=So(3,wo(z,B)),F=Mo(T,So(3,Mo(Eo(S),N))),V=Mo(y,So(3,Mo(Eo(m),v))),k=wo(F,V),L=Mo(S,N),D=Mo(m,v);return[A,Y,k,wo(L,D)]}(t,n)));else{if(1!==e){if(0===e)return[];throw new Error("The given bezier curve must be of order <= 3")}r=Nr(function(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=e-s,f=o-s,l=r-c,h=i-c,a=fo(u,u),p=fo(u,f),d=fo(f,f),g=fo(l,l),v=fo(l,h),m=fo(h,h),b=lo(p,v),x=lo(g,a);return[lo(lo(d,m),lo(x,ho(b))),ao(b,x)]}(t,n),0,1,function(t,n){const e=t[0],r=t[1],o=zo(e[0]),i=zo(e[1]),s=zo(r[0]),c=zo(r[1]),u=zo(n[0]),f=zo(n[1]),l=o+u,h=s+u,a=i+f,p=c+f,d=l*h+a*p,g=a*a+l*l;return[h*h+p*p+2*d+g,d+g]}(t,n).map((t=>6*qo*t)),(()=>function(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=To(e,s),f=To(o,s),l=To(r,c),h=To(i,c),a=yo(u,u),p=yo(u,f),d=yo(f,f),g=yo(l,l),v=yo(l,h),m=yo(h,h),b=Oo(p,v),x=Oo(g,a);return[Oo(Oo(d,m),Oo(Co(b),x)),Ao(b,x)]}(t,n)))}r.push({tS:0,tE:0,multiplicity:1}),r.push({tS:1,tE:1,multiplicity:1});const o=r.map((e=>{const r=Xr(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,c],[s,i],[s,c]]){const e=Vo(t,u),r=Vo(n,f),o=Lo(ko(e,e),ko(r,r)),i=Fo(o),s=i*(1-Do),c=i*(1+Do);s<=l&&(l=s),c>=h&&(h=c)}return[l,h]}(r,n);return{p:Yo(r),t:Bo(e),d:(Xo(o[0])+Xo(o[1]))/2,dSquaredI:o,box:r,ri:e}}));let i=Number.POSITIVE_INFINITY;for(let t=0;t<o.length;t++){const n=o[t].dSquaredI[1];n<i&&(i=n)}const s=[];for(let t=0;t<o.length;t++){const n=o[t];n.dSquaredI[0]<=i&&s.push(n)}return s}const $o=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=s-n*(s-u),p=u-n*(u-l),d=a-n*(a-p),g=c-n*(c-f),v=f-n*(f-h),m=g-n*(g-v);return[[s,c],[a,g],[d,m],[d-n*(d-(p-n*(p-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(h-n*(h-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=c-n*(c-f),_=f-n*(f-h),I=h-n*(h-p),N=x-n*(x-_),S=_-n*(_-I);return[[m-n*(m-b),N-n*(N-S)],[b,S],[v,I],[a,p]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=b+x,I=n*b,N=e*b,S=s[0]-c-3*x,E=u-l,w=a-l,M=E+w,P=n*E,T=e*E,y=s[1]-u-3*w;return[[d*S+(3*n*(n*_-b)+c),d*y+(3*n*(n*M-E)+u)],[m*(n*S+2*_)+(p*_+c-(N+2*I)),m*(n*y+2*M)+(p*M+u-(T+2*P))],[m*(e*S+2*_)+(g*_+c-(2*N+I)),m*(e*y+2*M)+(g*M+u-(2*T+P))],[v*S+(3*e*(e*_-b)+c),v*y+(3*e*(e*M-E)+u)]]}(t,n,e)},Go=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=n*n,l=i-c,h=s-u;return[[i,s],[-n*l+i,-n*h+s],[f*(l+(o[0]-c))-(2*n*l-i),f*(h+(o[1]-u))-(2*n*h-s)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u;return[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=n*n,h=e*e,a=n*e,p=s-u,d=p+(i[0]-u),g=c-f,v=g+(i[1]-f);return[[l*d-(2*n*p-s),l*v-(2*n*g-c)],[a*d-(p*(e+n)-s),a*v-(g*(e+n)-c)],[h*d-(2*e*p-s),h*v-(2*e*g-c)]]}(t,n,e)},Ho=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[o,i],[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1];return[[n*(s-o)+o,n*(c-i)+i],[s,c]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1];return[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]]}(t,n,e)};function Ro(t,n,e){if(4===t.length)return $o(t,n,e);if(3===t.length)return Go(t,n,e);if(2===t.length)return Ho(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function Uo(t,n){const e=n.xs;return e.length<=2&&7!==e[0].x.kind}function Zo(t,n,e,r,o){const i=function(t,n,e){return(r,o,i)=>{n.has(r)||r.orientation||(r.orientation=o*t.orientation,r.parent=i,r.windingNum=i.windingNum+r.orientation,e.push(r))}}(e,o,r);let s,c,u=0,f=1,l=n;for(;l=1===e.orientation?l.nextAround:l.prevAround,l!==n;)u=f,f-=l.dir,-1!==l.dir&&(c?1===u&&0===f?i(l,1,e.parent):0===u&&-1===f&&i(l,-1,e.parent):0===f?c=l:1===f&&i(l,1,e));return Uo(0,n.container)||(s=[n.p,c.p]),{out_:c,additionalBezier:s}}function jo(t,n){const e=n.next,r=e._x_.curve,o=e._x_.x.ri.tS;let i=n._x_.curve,s=n._x_.x.ri.tS;Uo(0,n.container)||(s=Bo(Qo(i.ps,n.p)[0].ri));const c=[];let u;for(;;){if(i===r&&(s<o||s===o&&c.length))return u=Ro(i.ps,s,o),{beziers:c,in_:e,inBez:u};{const t=Ro(i.ps,s,1);c.push(t)}s=0,i=i.next}}function Wo(t,n,e){const r=[],o=[];let i,s=e;do{n.add(s);const{beziers:t,in_:c,inBez:u}=jo(0,s);if(o.push(...t),({out_:s,additionalBezier:i}=Zo(0,c,e,r,n)),i){const t=Ro(u,0,Bo(Qo(u,i[0])[0].ri));o.push(t),o.push(i)}else o.push(u)}while(s!==e);return{beziers:o,additionalOutsToCheck:r}}function Jo(t,n,e,r){const o=[n];for(;o.length;){const t=o.pop();if(e.add(t._x_.curve.loop),r.has(t))continue;t.children=new Set;const{beziers:n,additionalOutsToCheck:i}=Wo(0,r,t);t.beziers=n,t.parent.children=t.parent.children||new Set,t.parent.children.add(t),o.push(...i)}}function Ko(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const ti=Ko;function ni(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let s=0;s<e+1;s++)for(let c=0;c<r+1;c++)i[o-(s+c)]+=t[e-s]*n[r-c];return ti(i)}const ei=ni;function ri(t){let n=[1];for(let e=0;e<t.length;e++)n=ei(n,[1,-t[e]]);return n}const oi=123456789,ii=4294967296;function si(t){return function(n,e,r,o,i=oi,s=0){const c=[];for(let u=0;u<n;u++){const n=t(e,r,o,i,s),u=n.p;i=n.seed,c.push(u)}return c}}function ci(t){return(134775813*t+1)%ii}function ui(t,n,e,r,o=0){let i=[];for(let s=0;s<t;s++)r=fi(r=ci(r),i,r/ii*(e-n)+n,o);return i=i.slice(0,t),{vs:i,seed:r}}function fi(t,n,e,r){return t=ci(t),n.push(e),t/ii<r&&(t=fi(t,n,e,r)),t}function li(t,n=-1,e=1,r=oi){const o=ui(t,n,e,r);return r=o.seed,{p:o.vs,seed:r}}function hi(t){const n=[],e=t.length-1;for(let r=0;r<e;r++)n.push((e-r)*t[r]);return n}si((function(t,n=0,e=1,r=oi,o=0){const i=ui(t,n,e,r,o);return r=i.seed,{p:ri(i.vs),seed:r}})),si(li);const ai=E,pi=Number.EPSILON/2,di=Math.abs,gi=Math.max,vi=hi,mi=E,bi=function(t,n,e,r=ai(t,n),o=ai(t,e)){let i=n,s=e,c=i,u=r,f=s-i,l=f;for(;;){di(u)<di(o)&&(i=s,s=c,c=i,r=o,o=u,u=r);const n=2*pi*gi(1,di(i),di(s)),e=.5*(c-s);if(di(e)<=n)return s;if(di(f)<n||di(r)<=di(o))f=e,l=f;else{let t,h,a=o/r;if(i===c)t=2*e*a,h=1-a;else{h=r/u;const n=o/u;t=a*(2*e*h*(h-n)-(s-i)*(n-1)),h=(h-1)*(n-1)*(a-1)}0<t?h=-h:t=-t,a=f,f=l,2*t<3*e*h-di(n*h)&&t<di(.5*a*h)?l=t/h:(f=e,l=f)}if(i=s,r=o,n<di(l)?s+=l:0<e?s+=n:s-=n,0===(o=ai(t,s)))return s;o*u>0&&(c=i,u=r,f=s-i,l=f)}},xi=or,_i=rr,Ii=Ko;function Ni(t,n=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY){t=Ii(t);let r=0;for(;0===t[t.length-1];)t=t.slice(0,-1),r++;if(t.length<=1){const t=[];for(let n=0;n<r;n++)t.push(0);return t}n===Number.NEGATIVE_INFINITY&&(n=xi(t)),e===Number.POSITIVE_INFINITY&&(e=_i(t));const o=[t];for(let n=1;n<=t.length-1;n++)o.push(vi(o[n-1]));let i=[];for(let r=t.length-2;r>=0;r--){const t=o[r],s=[];let c=n,u=mi(t,c);0===u&&0===r&&s.push(n);for(let n=0;n<i.length;n++){const e=i[n],r=mi(t,e);0===r?s.push(e):u*r<0&&s.push(bi(t,c,e,u,r)),c=e,u=r}const f=mi(t,e);u*f<0&&s.push(bi(t,c,e,u,f)),0===f&&0===r&&s.push(e),i=s}if(r>0&&n<=0&&e>=0){const t=[];let n=!1;for(let e=0;e<i.length;e++){if(!n&&i[e]>=0){for(let n=0;n<r;n++)t.push(0);n=!0}t.push(i[e])}return t}return i}function Si(t){if(4===t.length)return Ei(t);if(3===t.length)return wi(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function Ei(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[c-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-s),3*(s+e-2*o),3*(o-e),e]]}function wi(t){const[[n,e],[r,o],[i,s]]=t;return[[i+n-2*r,2*(r-n),n],[s+e-2*o,2*(o-e),e]]}function Mi(t,n){const[e,r]=wr(t);return[E(e,n),E(r,n)]}const Pi=P(Qr),Ti=P((function(t){const n=wr(t),e=Ni(n[0],0,1),r=Ni(n[1],0,1);e.push(0,1),r.push(0,1);let o,i,s,c,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[s]=Mr(t,r);s<u&&(u=s,o=r),s>f&&(f=s,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Mr(t,e);o<l&&(l=o,s=e),o>h&&(h=o,c=e)}return{ts:[[o,s],[i,c]],box:[[u,l],[f,h]]}})),yi=1e-6;function Ci(t){const n=t.map((t=>Ti(t)));return{minX:Math.min(...n.map((t=>t.box[0][0]))),maxX:Math.max(...n.map((t=>t.box[1][0]))),minY:Math.min(...n.map((t=>t.box[0][1]))),maxY:Math.max(...n.map((t=>t.box[1][1])))}}function Oi(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0,r=1231;do{e++;const i=li(1,0,1,r),s=i.p[0];r=i.seed;const c=li(1,0,t.length,r),u=Math.floor(c.p[0]);r=c.seed;const f=o(t,n,Mr(t[u],s));if(void 0!==f)return f}while(e<100);return;function o(t,n,e){if(function(t,n){const e=[t,n].map(Ci);return e[0].minX<e[1].minX||e[0].maxX>e[1].maxX||e[0].minY<e[1].minY||e[0].maxY>e[1].maxY}(t,n))return!1;const r=function(t,n,e){const[r,o]=n;let i=0;for(let e=0;e<t.length;e++){const s=t[e],[[c,u],[f,l]]=Pi(s);let h=u>o||l<o||!1;if(h=h||c>r||!1,h)continue;const a=[];let p,d,g;const v=!0;p=t=>Si(t)[1],d=[0,-o],g=0;const m=s.map(I(d)),b=Ni(p(m),0-yi,1+yi);for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<yi||Math.abs(e-1)<yi)return;const r=Mr(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&a.push(e)}if(1===a.length||3===a.length)for(const t of a){const n=N(Mi(s,t));if(Math.abs(n[1])<yi)return}i+=a.length}return i}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.beziers)){e=o;for(const t of o.children)r.push(t)}}}function Ai(t,n){return zi(t)-zi(n)}function zi(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=Ti(e).box[0][1];t<n&&(n=t)}return n}function Bi(t){const n=[t],e=Array.from(t.children);for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(t);for(const n of t.children)e.push(n)}return n}function Yi(t,n,e){let[[r,o],[i,s]]=n,[[c,u],[f,l]]=e;o>s&&([o,s]=[s,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),c>f&&([c,f]=[f,c]);const h=t||r===i&&c===f,a=t||o===s&&u===l;return(h?r<=f:r<f)&&(h?i>=c:i>c)&&(a?u<=s:u<s)&&(a?l>=o:l>o)}function Fi(t,n){return Yi(!0,t.box,n.box)}function Vi(t,n){for(let e=0;e<n.length;e++){const r=n[e];ki(t,[r.a,r.b])}}function ki(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Li(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Li(t,i,e,r)}}function Di(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Li(t,o,e,n[n.length-1]))}return n}function Xi(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function qi(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const s=[];for(const n of e){const[[e,c],[u,f]]=n.box;e<t&&(t=e),c<r&&(r=c),u>o&&(o=u),f>i&&(i=f),s.push(...n.xs)}const c={box:[[t,r],[o,i]],xs:s,inOuts:void 0};n.push(c)}return n}function Qi(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}const $i=K,Gi=R,Hi=j,Ri=function(t,n,e){const r=t.length-1;if(r<0)return[];const o=[];for(let t=0;t<r+1;t++)o.push(new Array(r+1).fill([0]));o[0][0]=[1];for(let t=1;t<=r;t++){o[0][t]=Hi(e,o[0][t-1]);for(let r=1;r<=t;r++)o[r][t]=Gi(Hi(e,o[r][t-1]),Hi(n,o[r-1][t-1]))}const i=new Array(r+1).fill([0]);for(let n=0;n<=r;n++){i[r-n]=[0];for(let e=n;e<=r;e++){const s=$i(o[n][e],t[r-e]);i[r-n]=Gi(i[r-n],s)}}return i},Ui=Nr,Zi=Wt,ji=pt,Wi=Number.EPSILON;function Ji(t,n){const e=t.tS,r=t.tE-e;if(0===r)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const o=Ri(n,r,e),i=o.map(Zi),s=i.map((t=>Wi*Wi*t[1])),c=Ui(i,0,1,s,(()=>o)),u=[];for(const t of c)u.push({tS:ji(e,t.tS*r),tE:ji(e,t.tE*r),multiplicity:t.multiplicity});return u}const Ki=pe,ts=te,ns=oe,es=re,rs=Math.abs;function os(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=Ki(c,n),l=Ki(r,i),h=3*(r-i),a=ts(3,l),p=rs(h),d=ns(f,a),g=p+rs(c-n+h),v=Ki(i,2*r),m=es(v,n),b=rs(i-2*r+n),x=ts(3,m),_=6*b,I=Ki(r,n),N=ts(3,I),S=rs(3*(r-n)),E=Ki(u,e),w=Ki(o,s),M=3*(o-s),P=ts(3,w),T=rs(M),y=ns(E,P),C=T+rs(u-e+M),O=Ki(s,2*o),A=es(O,e),z=rs(s-2*o+e),B=ts(3,A),Y=6*z,F=Ki(o,e);return{coeffs:[[d,x,N,[0,n]],[y,B,ts(3,F),[0,e]]],errorBound:[[g,_,S,0],[C,Y,rs(3*(o-e)),0]]}}function is(t){const[[n,e],[r,o],[i,s]]=t,c=i-2*r,u=Ki(i,2*r),f=es(u,n),l=rs(c+n),h=Ki(2*r,2*n),a=s-2*o,p=Ki(s,2*o),d=es(p,e),g=rs(a+e);return{coeffs:[[f,h,[0,n]],[d,Ki(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function ss(t){const[[n,e],[r,o]]=t;return[[Ki(r,n),[0,n]],[Ki(o,e),[0,e]]]}const cs=ie,us=te,fs=tt,ls=Math.abs;function hs(t){const[[n,[,e]],[r,[,o]]]=ss(t),i=fs(r),s=n,c=us(o,n),u=ls(c[1]),f=us(e,r),l=ls(f[1]),h=cs(f,c);return{coeffs:{vₓ:i,vᵧ:s,v:h},errorBound:{v_:u+l+ls(h[1])}}}const as=oe,ps=te,ds=le,gs=Math.abs,vs=Ar(3),ms=ae,bs=ce,xs=te,_s=le,Is=ie,Ns=Math.abs;function Ss(t){const{coeffs:[[n,e,[,r]],[o,i,[,s]]],errorBound:[[c],[u]]}=is(t),f=n[1],l=e[1],h=o[1],a=i[1],p=Ns(r),d=Ns(l),g=Ns(f),v=Ns(s),m=Ns(a),b=Ns(h),x=_s(n,i),_=c*m+2*Ns(f*a),I=_s(e,o),N=d*u+2*Ns(l*h),S=xs(s,n),E=v*c+Ns(s*f),w=xs(r,o),M=p*u+Ns(r*h),P=xs(s,e),T=Ns(s*l),y=xs(r,i),C=Ns(r*a),O=_s(n,n),A=2*(c*g+Ns(f*f)),z=_s(n,o),B=c*b+g*u+2*Ns(f*h),Y=_s(o,o),F=2*(u*b+Ns(h*h)),V=f*a-l*h,k=f*s-r*h,L=l*s-r*a,D=Is(x,I),X=Ns(V),q=_+N+Ns(V),Q=Is(S,w),$=Ns(k),G=E+M+Ns(k),H=Is(P,y),R=Ns(L),U=T+C+Ns(L),Z=ms(Y),j=F,W=bs(z),J=B,K=ms(O),tt=A,nt=a*V,et=_s(i,D),rt=m*q+2*Ns(nt),ot=2*k*h,it=bs(_s(o,Q)),st=2*(u*$+b*G+2*Ns(ot)),ct=nt-ot,ut=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r,v:Dr},errorBound:{vₓₓₓ_:Zn,vₓₓᵧ_:te,vₓᵧᵧ_:ie,vᵧᵧᵧ_:ce,vₓₓ_:Ee,vₓᵧ_:Re,vᵧᵧ_:Be,vₓ_:_r,vᵧ_:Cr,v_:Lr+Vr+Os(Dr[1])}}}const Ds=de,Xs=ce,qs=te,Qs=le,$s=oe,Gs=Math.abs,Hs=Ar(3),Rs=oe,Us=te,Zs=le,js=Math.abs,Ws=Ar(3),Js=de,Ks=ce,tc=te,nc=le,ec=oe,rc=Math.abs,oc=Ar(3),ic=de,sc=ce,cc=te,uc=le,fc=oe,lc=Math.abs,hc=Ar(3),ac=oe,pc=te,dc=le,gc=Math.abs,vc=Ar(3),mc=de,bc=ce,xc=te,_c=le,Ic=oe,Nc=Math.abs,Sc=Ar(3),Ec=de,wc=ce,Mc=te,Pc=le,Tc=oe,yc=Math.abs,Cc=Ar(3),Oc=T,Ac=pt,zc=j,Bc=at,Yc=on;function Fc(t){if(4===t.length)return Vc(t);if(3===t.length)return kc(t);if(2===t.length)return Lc(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function Vc(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Yc(Oc(c,n),zc(3,Oc(r,i))),zc(3,Bc(Ac(i,n),-2*r)),zc(3,Oc(r,n)),[n]],[Yc(Oc(u,e),zc(3,Oc(o,s))),zc(3,Bc(Ac(s,e),-2*o)),zc(3,Oc(o,e)),[e]]]}function kc(t){const[[n,e],[r,o],[i,s]]=t;return[[Bc(Ac(i,n),-2*r),Oc(2*r,2*n),[n]],[Bc(Ac(s,e),-2*o),Oc(2*o,2*e),[e]]]}function Lc(t){const[[n,e],[r,o]]=t;return[[Oc(r,n),[n]],[Oc(o,e),[e]]]}const Dc=j,Xc=rt,qc=tt,Qc=y;function $c(t){const[[n,[e]],[r,[o]]]=t;if(0!==Qc(n)||0!==Qc(r))return{vₓ:qc(r),vᵧ:n,v:Xc(Dc(e,r),Dc(o,n))}}const Gc=j,Hc=K,Rc=R;function Uc(t,n){const e=Lc(t),[[r,[o]],[i,[s]]]=Lc(n),{vₓ:c,vᵧ:u,v:f}=$c(e),l=Hc(r,c),h=Hc(i,u),a=Rc(l,h),p=Gc(o,c),d=Gc(s,u),g=Rc(p,d);return[a,Rc(g,f)]}const Zc=j,jc=At,Wc=rt,Jc=K,Kc=tt;function tu(t){const[[n,e,[r]],[o,i,[s]]]=t;if(0===y(n)&&0===y(o))return $c([[e,[r]],[i,[s]]]);const c=Jc(n,i),u=Jc(e,o),f=Zc(s,n),l=Zc(r,o),h=Zc(s,e),a=Zc(r,i),p=Jc(n,n),d=Jc(n,o),g=Jc(o,o),v=Wc(c,u),m=Wc(f,l),b=Wc(h,a),x=Kc(g),_=jc(d),I=Kc(p),N=Jc(i,v),S=jc(Jc(o,m)),E=Wc(N,S),w=jc(Jc(n,m)),M=Jc(e,v),P=Wc(w,M),T=Jc(v,b),C=Jc(m,m);return{vₓₓ:x,vₓᵧ:_,vᵧᵧ:I,vₓ:E,vᵧ:P,v:Wc(T,C)}}const nu=Ft,eu=j,ru=K,ou=R,iu=At,su=y;function cu(t,n){const e=kc(t);if(0===su(e[0][0])&&0===su(e[1][0]))return Uc([t[0],t[2]],n);const[[r,[o]],[i,[s]]]=Lc(n),{vₓₓ:c,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:h,v:a}=tu(e),p=nu(o,o),d=eu(o,r),g=nu(o,s),v=eu(o,i),m=ru(r,r),b=eu(s,r),x=ru(r,i),_=nu(s,s),I=eu(s,i),N=ru(i,i),S=ru(m,c),E=ru(N,f),w=ru(x,u),M=ou(S,E),P=ou(M,w),T=ru(d,c),y=ru(I,f),C=ou(v,b),O=ru(C,u),A=iu(ou(T,y)),z=ou(A,O),B=ru(r,l),Y=ru(i,h),F=ou(B,Y),V=ou(z,F),k=ru(p,c),L=ru(g,u),D=ru(_,f),X=ou(k,L),q=ou(X,D),Q=eu(o,l),$=eu(s,h),G=ou(Q,$),H=ou(q,G);return[P,V,ou(H,a)]}const uu=K,fu=T,lu=rt,hu=y,au=H,pu=Z,du=pt;function gu(t,n=!1){if(!n){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[n,e],[au(lu(pu(du(r/4,i/4),3),du(n/4,c/4))),au(lu(pu(du(o/4,s/4),3),du(e/4,u/4)))],[c,u]]}const[e,r,o,i]=t,s=function(t,n){const[[e,r],[o,i]]=t,[[s,c],[u,f]]=n,l=fu(o,e),h=fu(i,r),a=fu(u,s),p=fu(f,c),d=lu(uu(a,h),uu(p,l));if(0===hu(d))return;const g=fu(s,e),v=fu(c,r),m=lu(uu(v,l),uu(g,h)),b=au(m)/au(d);return[s+b*au(a),c+b*au(p)]}([e,r],[i,o]);if(void 0!==s)return[e,s,i]}const vu=j,mu=K,bu=R,xu=rt,_u=tt,Iu=At,Nu=Bt,Su=y;function Eu(t){const[[n,e,r,[o]],[i,s,c,[u]]]=t;if(0===Su(n)&&0===Su(i))return tu([[e,r,[o]],[s,c,[u]]]);const f=mu(n,c),l=mu(r,i),h=mu(n,s),a=mu(e,s),p=mu(e,i),d=mu(n,n),g=mu(s,s),v=mu(i,i),m=mu(r,n),b=mu(e,e),x=mu(c,i),_=mu(s,i),I=mu(e,n),N=mu(n,i),S=vu(u,n),E=vu(o,i),w=vu(u,e),M=vu(o,s),P=mu(e,c),T=mu(r,s),y=vu(u,r),C=vu(o,c),O=xu(S,E),A=xu(f,l),z=xu(h,p),B=xu(w,M),Y=xu(P,T),F=xu(y,C),V=xu(x,g),k=xu(m,b),L=bu(p,h),D=bu(l,f),X=Iu(A),q=mu(O,O),Q=mu(O,A),$=mu(O,z),G=mu(O,Y),H=mu(A,A),R=mu(X,B),U=mu(z,B),Z=mu(z,Y),j=mu(z,F),W=mu(_u(i),v),J=mu(vu(3,n),v),K=mu(vu(-3,i),d),tt=mu(n,d),nt=xu(vu(-3,O),Y),et=mu(nt,v),rt=mu(z,V),ot=bu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(F,k),X=Pu(I,L),q=Pu(M,D),Q=Tu(X,q),$=Tu(T,C),G=yu(Tu(y,A)),H=Tu(O,B),R=Tu($,h),U=Tu(G,a),Z=Tu(H,p),j=Pu(I,R),W=Pu(S,U),J=Pu(M,Z),K=Tu(j,W),tt=Tu(K,J),nt=yu(Tu(C,h)),et=yu(Tu(O,p)),rt=Tu(T,nt),ot=Tu(B,et),it=Tu(y,a),st=Tu(A,a),ct=Pu(b,rt),ut=Pu(w,ot),ft=Pu(_,it),lt=Pu(N,st),ht=Pu(r,d),at=Pu(i,g),pt=Tu(ct,ut),dt=Tu(ft,lt),gt=Tu(pt,dt),vt=Tu(ht,at),mt=Tu(gt,vt),bt=Tu(P,C),xt=Tu(z,O),_t=Tu(bt,h),It=Tu(xt,p),Nt=Pu(m,_t),St=Pu(E,It),Et=Pu(x,a),wt=Tu(Nt,St),Mt=Tu(wt,Et),Pt=Mu(o,d),Tt=Mu(s,g),yt=Tu(Pt,Tt),Ct=Tu(Mt,yt);return[Q,tt,mt,Tu(Ct,v)]}const Au=j,zu=K,Bu=R,Yu=y;function Fu(t,n){const e=Lc(t),[[r,o,[i]],[s,c,[u]]]=kc(n);if(0===Yu(r)&&0===Yu(s))return Uc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:h}=$c(e),a=zu(r,f),p=zu(s,l),d=Bu(a,p),g=zu(o,f),v=zu(c,l),m=Bu(g,v),b=Au(i,f),x=Au(u,l),_=Bu(b,x);return[d,m,Bu(_,h)]}const Vu=Ft,ku=j,Lu=K,Du=R,Xu=At,qu=y;function Qu(t,n){const e=kc(t);if(0===qu(e[0][0])&&0===qu(e[1][0]))return Fu([t[0],t[2]],n);const[[r,o,[i]],[s,c,[u]]]=kc(n);if(0===qu(r)&&0===qu(s))return cu(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:h,vₓ:a,vᵧ:p,v:d}=tu(e),g=Vu(i,i),v=ku(i,o),m=ku(i,r),b=Vu(i,u),x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i,[s]],[c,u,f,[l]]]=Vc(n);if(0===tf(r)&&0===tf(c))return Fu(t,gu(n));const{vₓ:h,vᵧ:a,v:p}=$c(e),d=Ju(r,h),g=Ju(c,a),v=Ku(d,g),m=Ju(o,h),b=Ju(u,a),x=Ku(m,b),_=Ju(i,h),I=Ju(f,a),N=Ku(_,I),S=Wu(s,h),E=Wu(l,a),w=Ku(S,E);return[v,x,N,Ku(w,p)]}const ef=Ft,rf=j,of=K,sf=R,cf=At,uf=y;function ff(t,n){const e=kc(t);if(0===uf(e[0][0])&&0===uf(e[1][0]))return nf([t[0],t[2]],n);const[[r,o,i,[s]],[c,u,f,[l]]]=Vc(n);if(0===uf(r)&&0===uf(c))return Qu(t,gu(n));const{vₓₓ:h,vₓᵧ:a,vᵧᵧ:p,vₓ:d,vᵧ:g,v}=tu(e),m=ef(s,s),b=rf(s,i),x=rf(s,o),_=rf(s,r),I=ef(s,l),N=rf(s,f),S=rf(s,u),E=rf(s,c),w=of(i,i),M=of(i,o),P=of(i,r),T=rf(l,i),y=of(i,f),C=of(i,u),O=of(i,c),A=of(o,f),z=of(o,o),B=of(o,r),Y=rf(l,o),F=of(o,u),V=of(o,c),k=of(r,r),L=rf(l,r),D=of(r,f),X=of(r,u),q=of(r,c),Q=ef(l,l),$=rf(l,f),G=rf(l,u),H=rf(l,c),R=of(f,f),U=of(f,u),Z=of(c,c),j=of(u,u),W=of(u,c),J=of(f,c),K=of(k,h),tt=of(q,a),nt=of(Z,p),et=sf(K,tt),rt=sf(et,nt),ot=of(B,h),it=of(W,p),st=sf(ot,it),ct=sf(V,X),ut=of(ct,a),ft=sf(cf(st),ut),lt=sf(cf(P),z),ht=sf(cf(J),j),at=sf(O,F),pt=sf(at,D),dt=of(lt,h),gt=of(ht,p),vt=sf(dt,gt),mt=of(pt,a),bt=sf(vt,mt),xt=sf(_,M),_t=sf(H,U),It=sf(E,C),Nt=sf(A,L),St=sf(It,Nt),Et=of(xt,h),wt=of(_t,p),Mt=cf(sf(Et,wt)),Pt=of(St,a),Tt=of(r,d),yt=of(c,g),Ct=sf(Tt,yt),Ot=sf(Mt,Pt),At=sf(Ot,Ct),zt=sf(cf(x),w),Bt=sf(cf(G),R),Yt=sf(S,y),Ft=sf(Yt,Y),Vt=of(zt,h),kt=of(Bt,p),Lt=of(Ft,a),Dt=sf(Vt,kt),Xt=sf(Dt,Lt),qt=of(o,d),Qt=of(u,g),$t=sf(qt,Qt),Gt=sf(Xt,$t),Ht=of(b,h),Rt=of($,p),Ut=sf(N,T),Zt=of(Ut,a),jt=cf(sf(Ht,Rt)),Wt=sf(jt,Zt),Jt=of(i,d),Kt=of(f,g),tn=sf(Jt,Kt),nn=sf(Wt,tn),en=of(m,h),rn=of(I,a),on=of(Q,p),sn=rf(s,d),cn=rf(l,g),un=sf(en,rn),fn=sf(un,on),ln=sf(sn,cn),hn=sf(fn,ln);return[rt,ft,bt,At,Gt,nn,sf(hn,v)]}const lf=Ft,hf=j,af=K,pf=R,df=At,gf=y,vf=[[function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=hs(t),[[s,[,c]],[u,[,f]]]=ss(n),l=s[1],h=u[1],a=e[1],p=r[1],d=o[1],g=l*a,v=2*gs(g),m=ds(s,e),b=h*p,x=2*gs(b),_=ds(u,r),I=g+b,N=as(m,_),S=v+x+gs(I),E=c*a,w=ps(c,e),M=gs(E),P=f*p,T=ps(f,r),y=gs(P),C=E+P,O=as(w,T),A=M+y+gs(C),z=as(O,o),B=A+i+gs(C+d);return{coeffs:[N,z],errBound:[vs*S,vs*B]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=hs(t),{coeffs:[[s,c,[,u]],[f,l,[,h]]],errorBound:[[a],[p]]}=is(n),d=e[1],g=r[1],v=o[1],m=js(d),b=js(g),x=(js(v),c[1]),_=s[1],I=l[1],N=f[1],S=_*d,E=Zs(s,e),w=a*m+2*js(S),M=N*g,P=Zs(f,r),T=p*b+2*js(M),y=S+M,C=Rs(E,P),O=w+T+js(y),A=x*d,z=Zs(c,e),B=2*js(A),Y=I*g,F=Zs(l,r),V=2*js(Y),k=A+Y,L=Rs(z,F),D=B+V+js(k),X=Us(u,e),q=u*d,Q=js(q),$=Us(h,r),G=h*g,H=js(G),R=q+G,U=Rs(X,$),Z=Q+H+js(R),j=R+v,W=Rs(U,o),J=Z+i+js(j);return{coeffs:[C,L,W],errBound:[Ws*O,Ws*D,Ws*J]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=hs(t),{coeffs:[[s,c,u,[,f]],[l,h,a,[,p]]],errorBound:[[d,g,v],[m,b,x]]}=os(n),_=gc(e[1]),I=gc(r[1]),N=dc(s,e),S=d*_+2*gc(N[1]),E=dc(l,r),w=m*I+2*gc(E[1]),M=ac(N,E),P=S+w+gc(M[1]),T=dc(c,e),y=g*_+2*gc(T[1]),C=dc(h,r),O=b*I+2*gc(C[1]),A=ac(T,C),z=y+O+gc(A[1]),B=dc(u,e),Y=v*_+2*gc(B[1]),F=dc(a,r),V=x*I+2*gc(F[1]),k=ac(B,F),L=Y+V+gc(k[1]),D=pc(f,e),X=gc(D[1]),q=pc(p,r),Q=gc(q[1]),$=ac(D,q),G=X+Q+gc($[1]),H=ac($,o),R=G+i+gc(H[1]);return{coeffs:[M,A,k,H],errBound:[vc*P,vc*z,vc*L,vc*R]}}],[function(t,n){const{coeffs:{vₓₓ:e,vₓᵧ:r,vᵧᵧ:o,vₓ:i,vᵧ:s,v:c},errorBound:{vₓₓ_:u,vₓᵧ_:f,vᵧᵧ_:l,vₓ_:h,vᵧ_:a,v_:p}}=Ss(t),[[d,[,g]],[v,[,m]]]=ss(n),b=e[1],x=r[1],_=o[1],I=i[1],N=s[1],S=c[1],E=ys(b),w=ys(x),M=ys(_),P=d[1],T=v[1],y=ys(g),C=ys(P),O=ys(m),A=ys(T),z=g*g,B=g*P,Y=g*m,F=g*T,V=P*P,k=P*m,L=P*T,D=m*m,X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Fu,nf],[cu,Qu,ff],[Ou,ju,function(t,n){const e=Vc(t);if(0===gf(e[0][0])&&0===gf(e[1][0]))return ff(gu(t),n);const[[r,o,i,[s]],[c,u,f,[l]]]=Vc(n);if(0===gf(r)&&0===gf(c))return ju(t,gu(n));const{vₓₓₓ:h,vₓₓᵧ:a,vₓᵧᵧ:p,vᵧᵧᵧ:d,vₓₓ:g,vₓᵧ:v,vᵧᵧ:m,vₓ:b,vᵧ:x,v:_}=Eu(e),I=lf(s,s),N=hf(s,i),S=hf(s,o),E=hf(s,r),w=lf(s,l),M=hf(s,f),P=hf(s,u),T=hf(s,c),y=af(i,i),C=af(i,o),O=af(i,r),A=hf(l,i),z=af(i,f),B=af(i,u),Y=af(i,c),F=af(o,f),V=af(o,o),k=af(o,r),L=hf(l,o),D=af(o,u),X=af(o,c),q=af(r,r),Q=hf(l,r),$=af(r,f),G=af(r,u),H=af(r,c),R=lf(l,l),U=hf(l,f),Z=hf(l,u),j=hf(l,c),W=af(f,f),J=af(f,u),K=af(c,c),tt=af(u,u),nt=af(u,c),et=af(f,c),rt=af(r,q),ot=af(r,K),it=af(c,q),st=af(c,K),ct=af(rt,h),ut=af(ot,p),ft=af(it,a),lt=af(st,d),ht=pf(ct,ut),at=pf(ft,lt),pt=pf(ht,at),dt=pf(df(X),G),gt=pf(df(G),X),vt=af(r,dt),mt=af(c,gt),bt=af(o,q),xt=af(u,K),_t=af(h,bt),It=af(d,xt),Nt=af(a,vt),St=af(p,mt),Et=pf(Nt,St),wt=hf(3,pf(_t,It)),Mt=pf(Et,wt),Pt=af(i,H),Tt=af(f,q),yt=af(o,nt),Ct=af(i,K),Ot=af(o,G),At=af(c,V),zt=af(r,et),Bt=af(u,G),Yt=pf(Pt,Ot),Ft=pf(Tt,At),Vt=pf(yt,zt),kt=pf(Ct,Bt),Lt=pf(O,V),Dt=pf(et,tt),Xt=pf(df(Yt),Ft),qt=pf(df(Vt),kt),Qt=af(a,Xt),$t=af(p,qt),Gt=af(r,Lt),Ht=af(c,Dt),Rt=af(h,Gt),Ut=af(d,Ht),Zt=pf(Qt,$t),jt=hf(3,pf(Rt,Ut)),Wt=pf(Zt,jt),Jt=pf(X,G),Kt=af(u,V),tn=df(af(i,Jt)),nn=pf(Kt,tn),en=df(pf(T,F)),rn=pf(en,Q),on=af(r,rn),sn=pf(nn,on),cn=af(o,tt),un=df(af(f,Jt)),fn=pf(cn,un),ln=df(pf(B,Q)),hn=pf(ln,T),an=af(c,hn),pn=pf(fn,an),dn=af(o,V),gn=pf(df(C),E),vn=af(hf(3,r),gn),mn=pf(dn,vn),bn=af(u,tt),xn=pf(df(J),j),_n=af(hf(3,c),xn),In=pf(bn,_n),Nn=af(a,sn),Sn=af(p,pn),En=pf(Nn,Sn),wn=af(h,mn),Mn=af(d,In),Pn=pf(wn,Mn),Tn=af(q,g),yn=af(K,m),Cn=pf(Tn,yn),On=af(H,v),An=pf(En,Pn),zn=pf(Cn,On),Bn=pf(An,zn),Yn=pf(D,$),Fn=pf(Y,D),Vn=hf(s,Jt),kn=hf(l,Jt),Ln=af(i,Yn),Dn=af(f,Fn),Xn=pf(df(Q),F),qn=pf(df(T),B),Qn=af(c,y),$n=af(r,W),Gn=af(o,Xn),Hn=af(u,qn),Rn=df(pf(Vn,Ln)),Un=df(pf(kn,Dn)),Zn=df(hf(s,k)),jn=df(hf(l,nt)),Wn=af(i,Lt),Jn=af(f,Dt),Kn=af(k,g),te=af(nt,m),ne=pf(Rn,Qn),ee=pf(Un,$n),re=pf(ne,Gn),oe=pf(ee,Hn),ie=pf(Zn,Wn),se=pf(jn,Jn),ce=df(pf(Kn,te)),ue=af(a,re),fe=af(p,oe),le=af(h,ie),he=af(d,se),ae=pf(ue,fe),pe=hf(3,pf(le,he)),de=af(v,Jt),ge=pf(ae,pe),ve=pf(de,ce),me=pf(ge,ve),be=pf(Y,Yn),xe=pf(df(O),V),_e=pf(df(et),tt),Ie=hf(2*s,be),Ne=hf(2*l,be),Se=pf(B,df(F)),Ee=pf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=af(d,no),oo=hf(3,pf(eo,ro)),io=pf(Dr,P),so=pf(df(S),y),co=pf(df(Z),W),uo=af(a,Jr),fo=af(p,Kr),lo=af(v,io),ho=af(g,so),ao=af(m,co),po=af(o,b),go=af(u,x),vo=pf(po,go),mo=pf(uo,fo),bo=pf(oo,lo),xo=pf(ho,ao),_o=pf(mo,bo),Io=pf(xo,vo),No=pf(_o,Io),So=pf(A,M),Eo=hf(s,a),wo=hf(l,p),Mo=pf(So,A),Po=pf(So,M),To=af(i,I),yo=af(To,h),Co=af(f,R),Oo=af(Co,d),Ao=af(v,So),zo=af(N,g),Bo=af(U,m),Yo=pf(zo,Bo),Fo=af(i,b),Vo=af(f,x),ko=pf(Fo,Vo),Lo=af(Eo,Mo),Do=af(wo,Po),Xo=pf(Lo,Do),qo=hf(3,pf(yo,Oo)),Qo=pf(Ao,df(Yo)),$o=pf(Xo,qo),Go=pf(Qo,ko),Ho=pf($o,Go),Ro=hf(s,h),Uo=hf(l,a),Zo=pf(Ro,Uo),jo=hf(s,p),Wo=hf(l,d),Jo=pf(jo,Wo),Ko=pf(Zo,g),ti=pf(Jo,m),ni=af(I,Ko),ei=af(R,ti),ri=pf(ni,ei),oi=af(w,v),ii=pf(ri,oi),si=hf(s,b),ci=hf(l,x),ui=pf(si,ci),fi=pf(ii,ui);return[pt,Mt,Wt,Bn,me,We,Lr,No,Ho,pf(fi,_)]}]];function bf(t,n){const{coeffs:e,errBound:r}=vf[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:r,getPExact:()=>mf[t.length-2][n.length-2](t,n)}}const xf=le,_f=oe,If=ie,Nf=pe,Sf=re,Ef=ie,wf=function(t,n,e,r){const o=t[0],i=t[1],s=n[0],c=n[1],u=jn(t,n),f=Math.abs(o+i),l=Math.abs(s+c),h=l-Wn*l-r;return h<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/h**2+9*Jn*Math.abs(f/l)}},Mf=re,Pf=le,Tf=te,yf=oe,Cf=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(I,-m),kf(N,-x)),M=Gf(kf(I,+m),kf(N,+x));return[[w,$f(kf(S,-b),kf(E,-_))],[M,Gf(kf(S,+b),kf(E,+_))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=function(t,n){if(0===n[0]&&0===n[1])return t[0].map((t=>[t]));if(0===n[0]&&1===n[1])return t[t.length-1].map((t=>[t]));if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=Sf(xf(Nf(o,e),n),e),h=Sf(xf(Nf(s,o),n),o),a=Sf(xf(Nf(u,s),n),s),p=_f(l,xf(If(h,l),n)),d=_f(h,xf(If(a,h),n)),g=_f(p,xf(If(d,p),n)),v=Sf(xf(Nf(i,r),n),r),m=Sf(xf(Nf(c,i),n),i),b=Sf(xf(Nf(f,c),n),c),x=_f(v,xf(If(m,v),n)),_=_f(m,xf(If(b,m),n));return[g,_f(x,xf(If(_,x),n))]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=_f([0,e],xf(Nf(o,e),n)),f=_f([0,o],xf(Nf(s,o),n)),l=_f(u,xf(If(f,u),n)),h=_f([0,r],xf(Nf(i,r),n)),a=_f([0,i],xf(Nf(c,i),n));return[l,_f(h,xf(If(a,h),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Sf(xf(Nf(o,e),n),e),Sf(xf(Nf(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}(t,n);let i;if(4===t.length)i=Tr(t,n).map((t=>16*Hf*t));else if(3===t.length)i=Tr(t,n).map((t=>10*Hf*t));else if(2===t.length)i=Tr(t,n).map((t=>4*Hf*t));else if(1===t.length)return[o,o];return[[kf(o[0],-i[0]),kf(o[1],-i[1])],[kf(o[0],+i[0]),kf(o[1],+i[1])]]}(t,n[0])}function Uf(t){return(n,e)=>{let[[r,o],[i,s]]=n,[[c,u],[f,l]]=e;return(o[1]>s[1]||o[1]===s[1]&&o[0]>s[0])&&([o,s]=[s,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])&&([c,f]=[f,c]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>c[1]||i[1]===c[1]&&i[0]>=c[0])&&(u[1]<s[1]||u[1]===s[1]&&u[0]<=s[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>c[1]||i[1]===c[1]&&i[0]>c[0])&&(u[1]<s[1]||u[1]===s[1]&&u[0]<s[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function Zf(t){return[(t.x.box[0][0]+t.x.box[1][0])/2,(t.x.box[0][1]+t.x.box[1][1])/2]}function jf(t,n){const e=bf(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,s=Nr(r,0,1,o,i);return 0!==s.length?{ris:s.map(Qi),getPExact:i}:void 0}function Wf(t){return{tS:H(t.tS),tE:H(t.tE),multiplicity:t.multiplicity}}function Jf(t,n){const e=jf(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const s=jf(n,t);if(void 0===s)return[];let{ris:c}=s;const{getPExact:u}=s;let f,l;l=1;let h,a=0;t:for(;a<l;){h=c.map((n=>Rf(t,[n.tS,n.tE])));for(let t=0;t<c.length;t++){const n=h[t];for(let e=t+1;e<c.length;e++){const t=h[e];if(Uf(!0)(n,t)){const t=[];for(const n of c)t.push(...Ji({tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},(f=f||u(),f)));c=t,a++;continue t}}}break t}l=1;let p,d=0;t:for(;d<l;){p=i.map((t=>Rf(n,[t.tS,t.tE])));for(let t=0;t<i.length;t++){const n=p[t];for(let e=t+1;e<i.length;e++){const t=p[e];if(Uf(!0)(n,t)){const t=[];for(const n of i)t.push(...Ji({tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},(o=o||r(),o)));i=t,d++;continue t}}}break t}const g=[];for(let t=0;t<c.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=p[e];if(Uf(!0)(n,o)){const s={compensated:a,ri:Wf(c[t]),riExp:a?c[t]:void 0,getPExact:a?void 0:u,kind:1,box:Kf(n)},f={compensated:d,ri:Wf(i[e]),riExp:d?i[e]:void 0,getPExact:d?void 0:r,kind:1,box:Kf(o)};g.push({psX:s,sideX:f})}}}return g}function Kf(t){return t.map((t=>t.map(H)))}function tl(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,s=e.slice();for(let t=0;t<i.length;t++){const n=Jf(o,i[t]);for(const{psX:e,sideX:r}of n)s.push({x:e,side:t,sideX:r,curve:void 0})}s.sort(((t,n)=>t.x.ri.tS-n.x.ri.tS));const c=[],u=[];let f,l;for(const n of s)void 0!==n.side?(!0===l&&u.push({dir:1,p:Zf(n),_x_:f,container:t,idx:++r,side:n.side,sideX:n.sideX}),l=!1):(!1===l&&(c.push({dir:-1,p:Zf(f),_x_:n,container:t,idx:++r,side:f.side,sideX:f.sideX}),n.in_=c[c.length-1]),l=!0),f=n;return{ins:c,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let s,c;({ins:s,outs:c,ioIdx:n}=i(e,o,n)),r.push(...s),r.push(...c)}return{inOuts:r,ioIdx:n}}function nl(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[3*(r-n),3*(o-e)],[3*(i-r),3*(s-o)],[3*(c-i),3*(u-s)]]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[[2*(r-n),2*(o-e)],[2*(i-r),2*(s-o)]]}if(2===t.length){const[[n,e],[r,o]]=t;return[[r-n,o-e]]}throw new Error("The given bezier curve must be of order 1, 2 or 3.")}function el(t,n){const e=t.xs;return 2===e.length&&1===e[0].x.kind&&1===e[1].x.kind&&e[0].x.ri.multiplicity%2==1&&e[1].x.ri.multiplicity%2==1?function(t,n){const e=t.xs,r=[],o=e[0],i=e[1],s=o.curve.ps,c=i.curve.ps,u=Mr(s,o.x.ri.tS),f=o.x.ri.tS,l=o.x.ri.tE,h=i.x.ri.tS,a=i.x.ri.tE;let p,d,g;p=4===s.length||3===s.length?Xr(nl(s),[f,l]):nl(s),d=4===c.length||3===c.length?Xr(nl(c),[h,a]):nl(c);for(let e=0;e<p.length;e++)for(let r=0;r<d.length;r++){const o=Math.sign(en(p[e],d[r],[0,0]));if(0===o)return tl(t,n);if(void 0!==g){if(g!==o)return tl(t,n)}else g=o}return g>0?(r.push({dir:-1,p:u,_x_:o,container:t}),r.push({dir:1,p:u,_x_:i,container:t}),r.push({dir:1,p:u,_x_:o,container:t}),r.push({dir:-1,p:u,_x_:i,container:t}),o.in_=r[0],i.in_=r[3]):(r.push({dir:-1,p:u,_x_:o,container:t}),r.push({dir:-1,p:u,_x_:i,container:t}),r.push({dir:1,p:u,_x_:o,container:t}),r.push({dir:1,p:u,_x_:i,container:t}),o.in_=r[0],i.in_=r[1]),{inOuts:r,ioIdx:n}}(t,n):tl(t,n)}const rl=-1,ol=1;function il(t,n,e,r){const o=[];for(const r of t)o.push({type:rl,item:r,x:n(r)}),o.push({type:ol,item:r,x:e(r)});o.sort(sl);const i=new Set,s=[];for(const t of o){const n=t.item;if(t.type===rl){for(const t of i.values()){const e=r(n,t);e&&s.push({a:n,b:t,u:e})}i.add(n)}else t.type===ol&&i.delete(t.item)}return s}function sl(t,n){const e=t.x-n.x;return 0!==e?e:t.type}const cl=oe,ul=K,fl=R,ll=y,hl=H,al=le,pl=Wt,dl=Math.abs,gl=Ar(3);const vl=Math.abs;const ml=Math.abs,bl=le,xl=oe,_l=K,Il=R,Nl=y,Sl=H,El=Wt,wl=Math.abs,Ml=Or(1),Pl=Ar(3);function Tl(t,n){const[e,r]=n,o=e.length,i=r.length,s=e[o-1],c=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,s]]=wi(t),c=n*i-e*o,u=n*s-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*c-2*o*u,vᵧ:2*n*u-e*c,v:c*(e*s-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:h,vᵧᵧ_:a,vₓ_:p,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,s]]=function(t){const[[n,e],[r,o],[i,s]]=t,c=vl(n),u=vl(r),f=vl(i),l=vl(e),h=vl(o);return[[f+c+2*u,2*(u+c),0],[vl(s)+l+2*h,2*(h+l),0]]}(t),c=ml(n),u=ml(e),f=r*s+o*i,l=r*u+c*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:s*f+2*i*l,vᵧ_:2*r*l+o*f,v_:f*(o*u+c*s)+l*l}}(t),v=u?0:1,m=wl(s),b=wl(c);if((v+12)*Ml*(l*(m*m)+h*(m*b)+a*(b*b)+(p*m+d*b)+g)<wl(n*s*s+e*s*c+r*c*c+(o*s+i*c)+f))return!1}{const{coeffs:{vₓₓ:n,vₓᵧ:o,vᵧᵧ:i,vₓ:u,vᵧ:f,v:l},errorBound:{vₓₓ_:h,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:d,vᵧ_:g,v_:v}}=Ss(t),m=El(e),b=El(r),x=wl(s),_=wl(c),I=x/3,N=_/3,S=bl(m,m),E=S[1],w=2*(x*I+E),M=bl(b,b),P=M[1],T=2*(_*N+P),y=bl(m,b),C=wl(y[1]),O=x*N+I*_+2*C,A=bl(n,S),z=wl(n[1])*w+h*E+2*wl(A[1]),B=bl(o,y),Y=wl(o[1])*O+a*C+2*wl(B[1]),F=bl(i,M),V=wl(i[1])*T+p*P+2*wl(F[1]),k=bl(m,u),L=wl(u[1])*I+d*x+2*wl(k[1]),D=bl(b,f),X=wl(f[1])*N+g*_+2*wl(D[1]),q=xl(A,B),Q=z+Y+wl(q[1]),$=xl(q,F),G=Q+V+wl($[1]),H=xl(k,D),R=L+X+wl(H[1]),U=xl($,H),Z=G+R+wl(U[1]),j=xl(U,l),W=Z+v+wl(j[1]);if(Pl*W<wl(Sl(j)))return!1}{const n=function(t){return tu(kc(t))}(t);if(void 0===n)return u&&s===t[0][0]&&c===t[0][1];n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓ:o,vₓᵧ:i,vᵧᵧ:f,vₓ:l,vᵧ:h,v:a}=n,p=Il(Il(Il(_l(o,_l(e,e)),_l(i,_l(e,r))),_l(f,_l(r,r))),Il(Il(_l(e,l),_l(r,h)),a));return 0===Nl(p)}}const yl=Math.abs,Cl=le,Ol=oe,Al=K,zl=R,Bl=y,Yl=H,Fl=Wt,Vl=Math.abs,kl=Or(1),Ll=Ar(3);function Dl(t,n){const[e,r]=n,o=e.length,i=r.length,s=e[o-1],c=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:h,vᵧ:a,v:p}=function(t){const[[n,e,r,o],[i,s,c,u]]=Ei(t),f=n*c,l=r*i,h=n*s,a=e*i,p=n*n,d=i*i,g=n*u-o*i,v=f-l,m=h-a,b=e*u-o*s,x=e*c-r*s,_=r*u-o*c,I=2*v,N=g*g,S=g*x,E=I*b,w=m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vl(vt[1]),bt=Cl(C,p),xt=Vl(p[1])*B+S*A+2*Vl(bt[1]),_t=Ol(et,ot),It=rt+it+Vl(_t[1]),Nt=Ol(st,ut),St=ct+ft+Vl(Nt[1]),Et=Ol(_t,Nt),wt=It+St+Vl(Et[1]),Mt=Ol(lt,at),Pt=ht+pt+Vl(Mt[1]),Tt=Ol(Mt,dt),yt=Pt+gt+Vl(Tt[1]),Ct=Ol(Et,Tt),Ot=wt+yt+Vl(Ct[1]),At=Ol(vt,bt),zt=mt+xt+Vl(At[1]),Bt=Ol(At,d),Yt=zt+E+Vl(Bt[1]),Ft=Ol(Ct,Bt),Vt=Ot+Yt+Vl(Ft[1]);if(Ll*Vt<Vl(Yl(Ft)))return!1}{const n=function(t){return Eu(Vc(t))}(t);if(void 0===n)return u&&s===t[0][0]&&c===t[0][1];n.hasOwnProperty("vₓₓₓ")||(n.vₓₓₓ=[0],n.vₓₓᵧ=[0],n.vₓᵧᵧ=[0],n.vᵧᵧᵧ=[0]),n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓₓ:o,vₓₓᵧ:i,vₓᵧᵧ:f,vᵧᵧᵧ:l,vₓₓ:h,vₓᵧ:a,vᵧᵧ:p,vₓ:d,vᵧ:g,v}=n,m=Al(e,e),b=Al(e,m),x=Al(r,r),_=Al(r,x),I=Al(r,m),N=Al(e,x),S=Al(e,r),E=Al(o,b),w=Al(i,I),M=Al(f,N),P=Al(l,_),T=Al(h,m),y=Al(a,S),C=Al(p,x),O=Al(e,d),A=Al(r,g),z=zl(E,w),B=zl(M,P),Y=zl(z,B),F=zl(T,y),V=zl(F,C),k=zl(Y,V),L=zl(O,A),D=zl(L,v),X=zl(k,D);return 0===Bl(X)}}function Xl(t,n){const{coeffs:e,errBound:r,getPExact:o}=bf(t,n);return Nr(e,0,1,r,o,!0)}const ql=Math.min,Ql=Math.max;function $l(t,n){let[[e,r],[o,i]]=t,[[s,c],[u,f]]=n;if(e>o&&([e,o]=[o,e]),s>u&&([s,u]=[u,s]),r>i&&([r,i]=[i,r]),c>f&&([c,f]=[f,c]),e<=u&&o>=s&&c<=i&&f>=r)return[[Ql(e,s),Ql(r,c)],[ql(o,u),ql(i,f)]]}function Gl(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=Xl(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map((n=>Xr(t,[n.tS,n.tE]))),i=e.map((t=>Xr(n,[t.tS,t.tE]))),s=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const c=$l(n,i[o]);if(void 0!==c){const n={ri:r[t],box:c,kind:1},i={ri:e[o],box:c,kind:1};s.push([n,i])}}}return s}function Hl(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const s=r[i-1],c=r[i%o],u=[c[1]-s[1],s[0]-c[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let h=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<h&&(h=e),e>a&&(a=e)}if(e&&(l<h||a<f))return!1;if(!e&&(l<=h||a<=f))return!1}}return!0}const Rl=Ft,Ul=R,Zl=y,jl=rt,Wl=Number.EPSILON/2,Jl=Math.abs;function Kl(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=c+3*r,l=n+3*i,h=f-l,a=Jl(3*r)+Jl(f)+(Jl(3*i)+Jl(l))+Jl(h);if(Jl(h)-Wl*a>0)return!1;const p=u+3*o,d=e+3*s,g=p-d,v=Jl(3*o)+Jl(p)+(Jl(3*s)+Jl(d))+Jl(g);return!(Jl(g)-Wl*v>0)&&0===Zl(jl(Ul([c],Rl(3,r)),Ul([n],Rl(3,i))))&&0===Zl(jl(Ul([u],Rl(3,o)),Ul([e],Rl(3,s))))}const th=rt,nh=y,eh=pt,{abs:rh}=Math;function oh(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function ih(t){return 4===t.length&&Kl(t)&&(t=gu(t)),3===t.length&&function(t){const[[n,e],[r,o],[i,s]]=t,c=n+i,u=c-2*r,f=rh(c)+rh(u);if(rh(u)-f>0)return!1;const l=e+s,h=l-2*o,a=rh(l)+rh(h);return!(rh(h)-a>0)&&0===nh(th(eh(n,i),[2*r]))&&0===nh(th(eh(e,s),[2*o]))}(t)&&(t=[t[0],t[2]]),2===t.length&&oh(t)&&(t=[t[0]]),t}const sh=Number.EPSILON,ch=sh/2;function uh(t,n){return n<0?t<1?t:1-ch:0===n?1:t>1?t:1+sh}function fh(t){return H(ht(t[0],t[1],2))}function lh(t){return y(t[0])*y(t[1])}function hh(t){return(n,e)=>{const r=Fc(n),o=Fc(e),i=Fc(n.slice().reverse()),s=Fc(e.slice().reverse()),c=t(r,o),u=t(i,o),f=t(r,s),l=t(i,s),h=-lh(u),a=-lh(l),p=fh(c),d=fh(f);return[uh(p,h),uh(d,a)]}}const ah=hh((function(t,n){const e=0===y(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[rt(o,r),e]}(t[e],n[e])}));function ph(t,n){return yt(sn(t[0],n[1]),sn(t[1],n[0]))*y(t[1])*y(n[1])}const dh=L,gh=ot,vh=0n;function mh(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-dh(e)+gh(e)-1;o>n&&(n=o)}}return 0===n?t.map((t=>t.map((t=>BigInt(t))))):n>0?t.map((t=>t.map((t=>{if(0===t)return vh;const e=-dh(t)+gh(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})))):t.map((t=>t.map((t=>BigInt(t*2**n)))))}function bh(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const xh=BigInt(2**53);function _h(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/xh;const o=t%xh;n.push(Number(o)*2**(53*e)),t=r,e++}return X(n)}const{round:Ih,sqrt:Nh}=Math;function Sh(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Ih(Nh(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function Eh(t){return t<0n?-t:t}function wh(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function Mh(t,n){const[e,r]=Ph(t[0],n[0]),[o,i]=Ph(t[1],n[1]);if(0===ph(e,o)||0===ph(e,i))return e;if(0===ph(r,o)||0===ph(r,i))return r;throw new Error("An unexpected error occured.")}function Ph(t,n){const[e,r]=t,[o,i]=n,[s,c]=function(t){const[n,e]=mh(t).map(wh),r=bh(n,e);return[_h(Sh(Eh(n/r))),_h(Sh(Eh(e/r)))]}([o,e]);return[[rt(sn(i,c),sn(r,s)),sn(s,At(e))],[rt(sn(i,tt(c)),sn(r,s)),sn(s,At(e))]].sort(ph)}function Th(t,n){const e=Fc(t),r=0===y(e[0][0])?0:0===y(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],s=n[2][r];return ah([[e,e],[o,o]],[[i,i],[s,s]])}return hh(Mh)(t,n)}const{round:yh,cbrt:Ch}=Math;function Oh(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=Eh(t))<=1n)return n*t;let r=BigInt(yh(Ch(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Ah(t){return sn(t,t)}const zh=hh((function(t,n){const e=0===y(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,s=function(t){const[n,e]=mh(t).map(wh),r=bh(n,e);return[_h(Oh(n/r)),_h(Oh(e/r))]}([o,e]),c=Ah(s[0]);return[rt(sn(i,Ah(s[1])),sn(r,c)),sn(j(3,e),c)]}(t[e],n[e])})),{EPSILON:Bh}=Number,Yh=Bh/2+Bh**2/2;function Fh(t){return t>0?t-t*Yh:t+t*Yh}const{EPSILON:Vh}=Number,kh=Vh/2+Vh**2/2;function Lh(t){return t>0?t+t*kh:t-t*kh}function Dh(t){if(0===t||1===t)return[t,t];const n=Fh(Fh(t)),e=function(t){return Lh(Lh(t))}(t);return[n,e]}function Xh(t,n,e,r){const o=t.ps,i=n.ps,s=[];let c=Xl(o,i);if(void 0===c){const r=2**(e-47),c=function(t,n,e=!1){e||(t=ih(t),n=ih(n));const r=[,,ah,Th,zh],[o,i]=r[t.length](t,n),[s,c]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:s,bez:"A",start:!0},{tA:1,tB:c,bez:"A",start:!1}].sort(((t,n)=>t.tA-n.tA));if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=Xr(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{tS:e,tE:e,multiplicity:1},t2:r,ri2:{tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[h,a]=Dh(f.tA),[p,d]=Dh(f.tB),[g,v]=Dh(l.tA),[m,b]=Dh(l.tB),x=Xr(t,[h,a]),_=Xr(n,[p,d]),I=Xr(t,[g,v]),N=Xr(n,[m,b]),S=$l(x,_),E=$l(I,N),w={tS:h,tE:a,multiplicity:1},M={tS:p,tE:d,multiplicity:1},P={tS:g,tE:v,multiplicity:1},T={tS:m,tE:b,multiplicity:1};return[{p:Yo(S),kind:5,box:S,t1:Bo(w),ri1:w,t2:Bo(M),ri2:M},{p:Yo(E),kind:5,box:E,t1:Bo(P),ri1:P,t2:Bo(T),ri2:T}]}(o,i);for(const e of c){const i=Mr(o,e.ri1.tS),c=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:c},curve:t},f={x:{ri:e.ri2,kind:5,box:c},curve:n};s.push([u,f])}return s}if(r&&(c=c.filter((t=>t.tS>0))),0===c.length)return[];const u=Gl(o,i,c);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};s.push([r,o])}return s}const qh=Mr,Qh=Tr,$h=Or(1);function Gh(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=qh(t,n),r=Qh(t,[0,n]);if(4===t.length)return{p:e,pE:r.map((t=>9*$h*t))};if(3===t.length)return{p:e,pE:r.map((t=>6*$h*t))};if(2===t.length)return{p:e,pE:r.map((t=>3*$h*t))};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function Hh(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return Dl(t,n);if(3===t.length)return Tl(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,s=e[o-1],c=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=hs(t),f=pl(e),l=pl(r),h=dl(s),a=dl(c),p=dl(n[1]),d=dl(o[1]),g=h/3,v=a/3,m=n[1]*s,b=al(f,n),x=p*g+2*dl(m),_=o[1]*c,I=al(l,o),N=d*v+2*dl(_),S=cl(b,I),E=x+N+dl(S[1]),w=cl(S,i),M=E+u+dl(w[1]);if(gl*M<dl(hl(w)))return!1}{const n=function(t){return $c(Lc(t))}(t);if(void 0===n)return u&&s===t[0][0]&&c===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=ul(e,o),h=ul(r,i),a=fl(fl(l,h),f);return 0===ll(a)}}(t,n);if(1===t.length){const e=X(n[0]),r=X(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map((t=>[t])))){const i=Gl(e,r,[(o=1,{tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},Gh(1,n,1)]]}var o}const Rh=Math.abs;const Uh=Math.abs,Zh=Or(1),jh=K,Wh=R,Jh=rt,Kh=rt,ta=K,na=j,ea=pe,ra=ge,oa=ae,ia=oe,sa=ce,ca=he,ua=R,fa=at,la=2*Number.EPSILON,ha=Math.abs,aa=Or(1);function pa(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,s,c]}=function(t){const{coeffs:[[n,e,r],[o,i,s]],errorBound:[[c,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=c-n,l=r-i,h=f+3*l,a=i+n,p=a-2*r,d=r-n,g=u-e,v=o-s,m=g+3*v,b=s+e,x=b-2*o,_=o-e;return{coeffs:[[h,3*p,3*d,n],[m,3*x,3*_,e]],errorBound:[[Rh(f)+6*Rh(l)+Rh(h),6*(Rh(a)+Rh(p)),6*Rh(d),0],[Rh(g)+6*Rh(v)+Rh(m),6*(Rh(b)+Rh(x)),6*Rh(_),0]]}}(t),h=Uh(n),a=Uh(e),p=Uh(r),d=Uh(o),g=Uh(i),v=Uh(s),m=e*o,b=n*i,x=n*s,_=r*o,I=e*s,N=r*i,S=u*d+a*f+Uh(m),E=c*g+h*l+Uh(b),w=c*v+Uh(x),M=p*f+Uh(_),P=u*v+Uh(I),T=p*l+Uh(N),y=m-b,C=Uh(y),O=S+E+C,A=_-x,z=Uh(A),B=M+w+z,Y=I-N,F=Uh(Y),V=P+T+F,k=y*y,L=y*A,D=Y*y,X=A*A,q=D+X;return{coeffs:[k,L,q],errBound:[2*O*C+Uh(k),O*z+C*B+Uh(L),V*C+F*O+Uh(D)+(2*z*B+Uh(X))+Uh(q)].map((t=>Zh*t))}}(t);if(ha(e)<=i){const[[n,e],[r,o],[i,s],[c,u]]=t,f=ua(ea(c,n),na(3,ea(r,i))),l=fa(ra(i,n),-2*r),h=ua(ea(u,e),na(3,ea(o,s))),a=fa(ra(s,e),-2*o);if(0===yt(ta(l,h),ta(f,a)))return[]}const u=r*r,f=4*e*o,l=u-f,h=2*s*ha(r)+aa*u+(4*(i*ha(o)+ha(e)*c)+aa*ha(f))+aa*ha(l);if(l<-h)return[];if(l>h){const{est:t,err:u}=ee(l,h);let f;f=r>=0?-r-t:-r+t;const a=s+u+aa*ha(f),{est:p,err:d}=ve(f,2*e,a,2*i),{est:g,err:v}=ve(2*o,f,2*c,a);if(n){if(p+d<0||p-d>1||g+v<0||g-v>1)return[]}else if((p+d<0||p-d>1)&&(g+v<0||g-v>1))return[]}let[a,p,d]=function(t){const[[n,e,r],[o,i,s]]=Vc(t),c=jh(e,o),u=jh(n,i),f=jh(n,s),l=jh(r,o),h=jh(e,s),a=jh(r,i),p=Jh(c,u),d=Jh(l,f),g=Jh(h,a),v=jh(p,p),m=jh(p,d),b=jh(p,g),x=jh(d,d);return[v,m,Wh(b,x)]}(t);const g=Kh(ta(p,p),na(4,ta(a,d))),v=y(g);if(v<0)return[];if(v>0){const t=ne(Wt(g));let e;a=Wt(a),p=Wt(p),d=Wt(d),e=y(p)>=0?oa(ia(p,t)):ia(oa(p),t);let r=H(ca(e,sa(a))),o=H(ca(sa(d),e));if(n){if(r<-la||r>1+la||o<-la||o>1+la)return[]}else if((r<-la||r>1+la)&&(o<-la||o>1+la))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-la&&r<=1+la?o>=0-la&&o<=1+la?[r,o]:[r]:o>=0-la&&o<=1+la?[o]:[]}const m=zt(a);if(y(p)*y(m)<0)return[];if(yt(Ot(p),Ot(m))>0)return[];const b=Wt(p),x=Wt(m),_=ca(b,x),I=_[1]+_[0];return[I,I]}const da=Number.EPSILON;function ga(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[6*(c-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-s)),6*(s+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[[2*(i-2*r+n)],[2*(s-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}const{orient2d:va}=un;function ma(t){if(4===t.length)return 0===va(t[0],t[1],t[2])&&0===va(t[1],t[2],t[3])&&0===va(t[0],t[2],t[3]);if(3===t.length)return 0===va(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function ba(t){if(ma(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Kl(t)&&(t=gu(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,s]]=t,c=i-r,u=c-(r-n),f=s-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(c-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Ni(n,0,1),inflections:[]}}const n=function(t){const[[n,e,r],[o,i,s]]=wr(t),[[c,u],[f,l]]=ga(t),[h,a]=function(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[6*(c-n+3*(r-i)),6*(u-e+3*(o-s))]}if(t.length<=3)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}(t),p=h*i,d=a*e,g=u*s,v=u*i,m=f*f,b=c*s,x=l*r,_=l*e,I=f*r,N=r*e,S=r*n,E=r*o,w=e*e,M=e*n,P=e*i,T=n*s,y=n*o,C=n*n,O=s*i,A=s*o,z=i*i,B=i*o,Y=o*o,F=h*s-a*r,V=u*r+l*s,k=g-x,L=r*r+s*s,D=P+T,X=A+z,q=S+w,Q=e*o+n*i,$=C-Y,G=M-B,H=N-O,R=r*i+e*s,U=A+X,Z=S+q,j=E+D,W=P+D,J=Z-U,K=D+T,tt=E+P+T,nt=2*_+I;return{inflectionPoly:[c*o-f*n,u*o+c*i-l*n-f*e,v+b-_-I,g-x],otherExtremaPoly:[C*(p-3*d)+Y*(3*p-d)+2*(y*(h*e-a*i+3*(l*f-u*c))+3*c*f*G)+3*(Q*(m-c*c)+$*(u*f+l*c)),h*(o*(Z+3*X)+n*W)-a*(r*(3*C+Y)+e*(3*M+2*B)+n*U)+3*(u*(l*$-u*y+2*(f*G-c*Q))+c*(2*l*G+f*(2*(S-A)+(w-z))-c*tt)+l*(l*y+2*f*Q)+m*j),h*(2*r*Q+e*K+i*(4*A+U))-a*(2*r*(3*M+B)+e*(w+2*A)+i*K)+3*(u*(2*(l*G-c*tt)+f*J-u*Q)+c*(2*f*H-c*R)+l*(l*Q+2*f*j+c*J)+m*R),h*(r*(E+2*D)+s*(w+3*X))-a*(r*(3*q+U)+s*W)+3*(u*(l*J-u*j+2*(f*H-c*R))+c*(r*(nt-c*s)-s*(2*l*i+f*s))+l*(l*D+r*(2*f*i+l*o))+f*s*nt),L*(p-d)+2*(N+O)*F-3*(V*(v+b-_-I)+(u*e+c*r+l*i+f*s)*k),F*L-3*V*k]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Ni(r,0,1),i=hi(r),s=[],c=[];for(let t=0;t<o.length;t++){const n=o[t],r=E(i,n);E(e,n)*r>=0?s.push(n):c.push(n)}return{minima:s,maxima:c,inflections:Ni(e,0,1)}}function xa(t,n){const[e,r]=wr(t),[o,i]=ga(t),s=E(e,n),c=E(r,n),u=E(o,n);return(s*E(i,n)-c*u)/Math.sqrt((s*s+c*c)**3)}const{abs:_a}=Math,Ia=P((function(t){const n=t.curves;let e=qr(n[0].ps).minY,r=n[0];for(let o=1;o<n.length;o++){const n=qr(t.curves[o].ps).minY,i=n.box[0][1],s=e.box[0][1];(i<s||i===s&&n.ts[0]>e.ts[0])&&(e=n,r=t.curves[o])}return{curve:r,y:e}}));function Na(t){const{curve:n,y:e}=Ia(t),r=e.ts;return r[0]<=0?[Gh(0,n,0),Gh(1,n.prev,0)]:r[1]>=1?[Gh(1,n,0),Gh(0,n.next,0)]:[{x:{ri:{tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function Sa(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:q(t,r)}const{abs:Ea}=Math;function wa(t,n){let e=t.side-n.side;if(0!==e)return e;const r=t.sideX,o=n.sideX;e=r.ri.tS-o.ri.tS;const i=8*Number.EPSILON;return Ea(e)>=i?e:(r.compensated||(r.compensated=1,r.riExp=Ji(r.ri,r.getPExact())[0]),o.compensated||(o.compensated=1,o.riExp=Ji(o.ri,o.getPExact())[0]),e=yt(r.riExp.tS,o.riExp.tS),0!==e?e:(e=n.dir-t.dir,0!==e?e:1===t.dir?t.idx-n.idx:n.idx-t.idx))}function Ma(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=il(e,(t=>Pi(t.ps)[0][0]),(t=>Pi(t.ps)[1][0]),function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=Pi(r),s=Pi(o);if(t.next!==n&&n.next!==t){if(Yi(!0,i,s)){const r=Xh(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==en(r[0],r[1],o[1]))return;if(!Yi(!1,i,s))return;let c;return c=p(r[0],r[1])>p(o[0],o[1])?[Bo(Qo(r,o[1])[0].ri),1]:[0,Bo(Qo(o,r[0])[0].ri)],[[Gh(1,t,5),Gh(0,n,5)],[Gh(c[0],t,5),Gh(c[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return Yi(!1,Pi(r),Pi(o))&&Hl(Ur(r),Ur(o),!1)?e.next===n?Xh(e,n,t,!0):Xh(n,e,t,!0):Hh(n,e);let i=Yi(!0,Pi(r),Pi(o));return i?(i=Hl(Ur(r),Ur(o),!0),i?Xh(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=pa(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-da,s=r[0]+da,c=r[1]-da,u=r[1]+da,f=Xr(e,[i,s]),l=Xr(e,[c,u]);n.push([{x:{ri:{tS:i,tE:s,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{tS:c,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([Gh(1,t,4),Gh(0,t.next,4)]);return n}(t),{extremes:s,xs:c}=function(t){const n=new Map,e=[];for(const r of t){const t=Na(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=ba(r),{minima:i,maxima:s}=o,c=[0,1,...i,...s];for(let o of c)_a(xa(r,o))>1e7*2**-t&&e.push([Gh(o,n,7),Gh(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...c,...u];if("undefined"!=typeof _debug_){for(const t of r)_debug_.generated.elems.intersection.push(...t);for(const t of o)_debug_.generated.elems.intersection.push(...t);for(const t of i)_debug_.generated.elems.intersection.push(...t);for(const t of c)_debug_.generated.elems.intersection.push(...t);for(const t of u)_debug_.generated.elems.intersection.push(...t)}let l=f.map((t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0})));for(;;){const t=il(l,Pa,Ta,Fi);if(!t.length)break;const n=new Map;Vi(n,t);const e=Di(n),r=Xi(l,e);l=[...qi(e),...r]}l=function(t){return t.filter((t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1}))}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map((t=>{const e=t.box.map((t=>t.map((t=>Sa(t,n,n-r)))));return{...t,box:e}}))}(l,e,n),"undefined"!=typeof _debug_&&(_debug_.generated.elems.container=l);let h=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:h}=el(t,h)),t.inOuts=n}f=f.filter((t=>void 0!==t[0].container)),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort(((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)}));const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;let t=n._x_;for(;t=t.next,void 0===t.in_;);n.next=t.in_,n.idx=n.next.idx}for(const t of l)t.inOuts.sort(wa);for(const t of l){const n=t.inOuts;let e=n[n.length-1];for(let t=0;t<n.length;t++){const r=n[t];r.prevAround=e,e.nextAround=r,e=r}}return{extremes:s,containers:l}}function Pa(t){return t.box[0][0]}function Ta(t){return t.box[1][0]}function ya(t){const n=t.inOuts,e=n[0],r=n[n.length-1];return 1===e.dir?(e.orientation=-1,e):(r.orientation=1,r)}function Ca(t=[],n){const e=[],r={beziers:t,curves:e,idx:n};if(!t.length)return r;let o,i=0;for(let n=0;n<t.length;n++){if(2===(s=t[n]).length?s[0][0]===s[1][0]&&s[0][1]===s[1][1]:3===s.length?s[0][0]===s[1][0]&&s[0][1]===s[1][1]&&s[1][1]===s[2][1]&&s[1][1]===s[2][1]:s[0][0]===s[1][0]&&s[0][1]===s[1][1]&&s[1][1]===s[2][1]&&s[1][1]===s[2][1]&&s[2][1]===s[3][1]&&s[2][1]===s[3][1])continue;const c={loop:r,ps:t[n],prev:o,next:void 0,idx:i};o&&(o.next=c),o=c,e.push(c),i++}var s;const c=e[e.length-1];return e[0].prev=c,c.next=e[0],c.ps[c.ps.length-1]=e[0].ps[0],r}function Oa(t){if(!ma(t))return!1;const n=t.map((t=>t[0])),e=t.map((t=>t[1]));return!(Aa(n)&&Aa(e))}function Aa(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function za(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Ba(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:Ya}=Math;function Fa(t,n,e){if(void 0!==t&&!oh(t)){if(2===t.length)return t;if(3===t.length){if(Ba(t))return ma(t)?[t[0],t[2]]:t;if(ka(t[0],t[2]))return;return[t[0],t[2]]}if(Ba(t)){const r=Va(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:Fa(r,n,e)}if(ka(t[0],t[3])){if(ma(t))return;return t}if(ma(t))return[t[0],t[3]];if(ka(t[0],t[1])&&ka(t[1],t[2])||ka(t[1],t[2])&&ka(t[2],t[3])||ka(t[0],t[1])&&ka(t[2],t[3]))return Fa([t[0],t[t.length-1]],n,e);if(ka(t[0],t[2])||ka(t[1],t[3])||ka(t[1],t[2]))return t;if(ka(t[0],t[1])){if(p(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=za(d(t[1],t[2]),2*n),o=I(t[1],r);return Va([t[0],e(o),t[2],t[3]])}}if(ka(t[2],t[3])){if(p(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=za(d(t[2],t[1]),2*n),o=I(t[2],r);return Va([t[0],t[1],e(o),t[3]])}}}}function Va(t){return ma(t)?[t[0],t[3]]:Kl(t)?gu(t):t}function ka(t,n){return t[0]===n[0]&&t[1]===n[1]}function La(t){return t}function Da(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>[Sa(e[0],t,n),Sa(e[1],t,n)]}(t,n):La;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const s=n[n.length-1],c=s?s[s.length-1]:o(t[0][0]);i[0]=c,i=i.map((t=>o(t))),Oa(i)&&(i=[i[0],i[i.length-1]]),i=Fa(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let s=t.slice();return s=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map((t=>t.map((t=>{let o,i=0,s=0,c=0;for(;!(++s>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=Sa(i,e,n);const s=ot(i);s>c&&(c=s,o=i)}return o}))));t.push(i)}o.push(t)}return o}(s,n,e,1):s,s=s.map(i),s=s.filter((t=>t.length>0)),s}const Xa=P((t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n}));function qa(t,n){const e=[],r=t.length-1;for(let n=0;n<r+1;n++)e.push(t[n]/(r+1-n));return e.push(n),e}const Qa=Ko;function $a(t,n){const e=t.length-1,r=n.length-1,o=e-r,i=o<0?+o:0,s=o>0?-o:0,c=Math.max(e,r),u=[];for(let e=0;e<c+1;e++){const r=t[e+i]||0,o=n[e+s]||0;u.push(r+o)}return Qa(u)}function Ga(t){let n=0;for(const e of t.curves){const t=e.ps,[r,o]=Si(t),[i,s]=wr(t);n+=E(qa($a(ni(r,s),tr(ni(o,i))),0),1)}return-n/2}function Ha(t){return[t[1],-t[0]]}const Ra=P((t=>!!vn(t)&&gn(t).isDull));function Ua(t,n){return vn(n)&&Ra(n)?-b(Ha(gn(n).tangents[0]),N(d(n.p,t.center))):0}const Za=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=s-n*(s-u),p=u-n*(u-l),d=a-n*(a-p),g=c-n*(c-f),v=f-n*(f-h),m=g-n*(g-v);return[[s,c],[a,g],[d,m],[d-n*(d-(p-n*(p-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(h-n*(h-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=c-n*(c-f),_=f-n*(f-h),I=h-n*(h-p),N=x-n*(x-_),S=_-n*(_-I);return[[m-n*(m-b),N-n*(N-S)],[b,S],[v,I],[a,p]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=b+x,I=n*b,N=e*b,S=s[0]-c-3*x,E=u-l,w=a-l,M=E+w,P=n*E,T=e*E,y=s[1]-u-3*w;return[[d*S+(3*n*(n*_-b)+c),d*y+(3*n*(n*M-E)+u)],[m*(n*S+2*_)+(p*_+c-(N+2*I)),m*(n*y+2*M)+(p*M+u-(T+2*P))],[m*(e*S+2*_)+(g*_+c-(2*N+I)),m*(e*y+2*M)+(g*M+u-(2*T+P))],[v*S+(3*e*(e*_-b)+c),v*y+(3*e*(e*M-E)+u)]]}(t,n,e)},ja=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=n*n,l=i-c,h=s-u;return[[i,s],[-n*l+i,-n*h+s],[f*(l+(o[0]-c))-(2*n*l-i),f*(h+(o[1]-u))-(2*n*h-s)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u;return[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=n*n,h=e*e,a=n*e,p=s-u,d=p+(i[0]-u),g=c-f,v=g+(i[1]-f);return[[l*d-(2*n*p-s),l*v-(2*n*g-c)],[a*d-(p*(e+n)-s),a*v-(g*(e+n)-c)],[h*d-(2*e*p-s),h*v-(2*e*g-c)]]}(t,n,e)},Wa=function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[o,i],[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1];return[[n*(s-o)+o,n*(c-i)+i],[s,c]]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1];return[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]]}(t,n,e)};function Ja(t,n,e){if(4===t.length)return Za(t,n,e);if(3===t.length)return ja(t,n,e);if(2===t.length)return Wa(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function Ka(t){return t[0]*t[0]+t[1]*t[1]}function tp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}function np(t){const n=t[0],e=t[1],r=t[2],o=Ka,i=.5*tp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),s=.5*tp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),c=tp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/c,s/c]}function ep(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}const rp=pe,op=oe,ip=te,sp=le,cp=ce,up=ue,fp=ie;function lp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],[d,g]=n,v=rp(s,d),m=rp(u,d),b=rp(l,d),x=rp(a,d),_=rp(c,g),I=rp(f,g),N=rp(h,g),S=rp(p,g),E=sp(v,v),w=ip(6,sp(v,m)),M=ip(6,sp(v,b)),P=cp(sp(v,x)),T=ip(9,sp(m,m)),y=ip(18,sp(m,b)),C=ip(6,sp(m,x)),O=ip(9,sp(b,b)),A=ip(6,sp(b,x)),z=sp(x,x),B=sp(_,_),Y=ip(6,sp(_,I)),F=ip(6,sp(_,N)),V=cp(sp(_,S)),k=ip(9,sp(I,I)),L=ip(18,sp(I,N)),D=ip(6,sp(I,S)),X=ip(9,sp(N,N)),q=ip(6,sp(N,S)),Q=sp(S,S),$=op(C,O),G=op(P,y),H=op(M,T),R=op(D,X),U=op(V,L),Z=op(F,k);return[ip(6,op(op(op(op(fp(z,A),fp(E,w)),$),fp(H,G)),op(op(op(fp(Q,q),fp(B,Y)),R),fp(Z,U)))),ip(5,op(fp(op(op(A,ip(5,w)),ip(3,G)),cp(op(op($,cp(H)),ip(3,E)))),fp(op(op(q,ip(5,Y)),ip(3,U)),cp(op(op(R,cp(Z)),ip(3,B)))))),up(op(fp(fp($,ip(3,fp(G,cp(H)))),ip(5,fp(cp(w),ip(3,E)))),fp(fp(R,ip(3,fp(U,cp(Z)))),ip(5,fp(cp(Y),ip(3,B)))))),ip(3,op(fp(G,cp(fp(cp(H),ip(5,fp(w,cp(E)))))),fp(U,cp(fp(cp(Z),ip(5,fp(Y,cp(B)))))))),cp(op(fp(H,ip(5,fp(w,ip(3,E)))),fp(Z,ip(5,fp(Y,ip(3,B)))))),op(fp(w,ip(6,E)),fp(Y,ip(6,B)))]}const hp=pe,ap=oe,pp=te,dp=le,gp=ce,vp=ie,mp=ue;function bp(t,n){const[[e,r],[o,i],[s,c]]=t,[u,f]=n,l=hp(e,u),h=hp(o,u),a=hp(s,u),p=hp(r,f),d=hp(i,f),g=hp(c,f),v=dp(l,l),m=dp(l,h),b=dp(l,a),x=dp(h,h),_=dp(h,a),I=dp(a,a),N=dp(p,p),S=dp(p,d),E=dp(p,g),w=dp(d,d),M=dp(d,g),P=dp(g,g),T=ap(E,gp(w)),y=ap(b,gp(x));return[ap(vp(ap(ap(P,N),gp(T)),mp(ap(M,S))),vp(ap(ap(I,v),gp(y)),mp(ap(_,m)))),pp(3,ap(ap(vp(M,T),vp(pp(3,S),N)),ap(vp(_,y),vp(pp(3,m),v)))),ap(vp(T,pp(3,vp(gp(S),N))),vp(y,pp(3,vp(gp(m),v)))),ap(vp(S,N),vp(m,v))]}const xp=de,_p=oe,Ip=fe,Np=ie;function Sp(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=e-s,f=o-s,l=r-c,h=i-c,a=xp(u,u),p=xp(u,f),d=xp(f,f),g=xp(l,l),v=xp(l,h),m=xp(h,h),b=_p(p,v),x=_p(g,a);return[_p(_p(d,m),_p(x,Ip(b))),Np(b,x)]}const Ep=T,wp=sn,Mp=j,Pp=At,Tp=zt,yp=on,Cp=rt,Op=T,Ap=sn,zp=j,Bp=At,Yp=on,Fp=rt;function Vp(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const kp=T,Lp=sn,Dp=zt,Xp=on,qp=rt,Qp=Math.abs;function $p(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=Qp(e[0]),c=Qp(e[1]),u=Qp(r[0]),f=Qp(r[1]),l=Qp(o[0]),h=Qp(o[1]),a=Qp(i[0]),p=Qp(i[1]),d=Qp(n[0]),g=Qp(n[1]),v=s+d,m=u+d,b=l+d,x=a+d,_=c+g,I=f+g,N=h+g,S=p+g,E=v*v,w=6*v*m,M=6*b*x,P=_*_,T=6*_*I,y=6*N*S,C=6*m*x+9*b*b,O=2*v*x+18*m*b,A=6*v*b+9*m*m,z=6*I*S+9*N*N,B=2*_*S+18*I*N,Y=6*_*N+9*I*I;return[6*(x*x+M+(E+w)+C+(A+O)+(S*S+y+(P+T)+z+(Y+B))),5*(M+5*w+3*O+2*(C+2*A+3*E)+(y+5*T+3*B+2*(z+2*Y+3*P))),4*(C+3*(O+2*A)+5*(2*w+3*E)+(z+3*(B+2*Y)+5*(2*T+3*P))),3*(O+2*(2*A+5*(w+2*E))+(B+2*(2*Y+5*(T+2*P)))),2*(A+5*(w+3*E)+(Y+5*(T+3*P))),w+6*E+(T+6*P)]}function Gp(t,n){const e=t[0],r=t[1],o=t[2],i=Qp(e[0]),s=Qp(e[1]),c=Qp(r[0]),u=Qp(r[1]),f=Qp(o[0]),l=Qp(o[1]),h=Qp(n[0]),a=Qp(n[1]),p=i+h,d=c+h,g=f+h,v=s+a,m=u+a,b=l+a,x=p*p,_=p*d,I=d*g,N=v*v,S=v*m,E=m*b,w=v*b+m*m*2,M=p*g+d*d*2;return[b*b+N+2*w+4*(E+S)+(g*g+x+2*M+4*(I+_)),3*(E+w+(3*S+N)+(I+M+(3*_+x))),w+3*(2*S+N)+(M+3*(2*_+x)),S+N+(_+x)]}function Hp(t,n){const e=t[0],r=t[1],o=Qp(e[0]),i=Qp(e[1]),s=Qp(r[0]),c=Qp(r[1]),u=Qp(n[0]),f=Qp(n[1]),l=o+u,h=s+u,a=i+f,p=c+f,d=l*h+a*p,g=a*a+l*l;return[h*h+p*p+2*d+g,d+g]}const Rp=Number.EPSILON/2,Up=Rp*Rp;function Zp(t){const n=t*Rp;return n/(1-n)}function jp(t){const n=t*Up;return n/(1-n)}Zp(1),jp(3);const Wp=jp(6);function Jp(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[s,c],[u,f]]=t,l=e+(o-e)*n,h=o+(s-o)*n,a=l+(h-l)*n,p=r+(i-r)*n,d=i+(c-i)*n,g=p+(d-p)*n;return[a+(h+(s+(u-s)*n-h)*n-a)*n,g+(d+(c+(f-c)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[s,c]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(s-o)*n-u)*n,f+(i+(c-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const Kp=Math.abs;function td(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Kp(n[1]);if(4===t.length){const[[n,r],[o,i],[s,c],[u,f]]=t,l=Kp(n),h=Kp(r),a=Kp(o),p=Kp(i),d=Kp(s),g=Kp(c),v=l+(a+l)*e,m=a+(d+a)*e,b=v+(m+v)*e,x=h+(p+h)*e,_=p+(g+p)*e,I=x+(_+x)*e;return[b+(m+(d+(Kp(u)+d)*e+m)*e+b)*e,I+(_+(g+(Kp(f)+g)*e+_)*e+I)*e]}if(3===t.length){const[[n,r],[o,i],[s,c]]=t,u=Kp(n),f=Kp(r),l=Kp(o),h=Kp(i),a=u+(l+u)*e,p=f+(h+f)*e;return[a+(l+(Kp(s)+l)*e+a)*e,p+(h+(Kp(c)+h)*e+p)*e]}if(2===t.length){const[[n,r],[o,i]]=t,s=Kp(n),c=Kp(r);return[s+(Kp(o)+s)*e,c+(Kp(i)+c)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const nd=Math.abs,ed=[[0,0],[0,0],[0,0],[0,0]];function rd(t,n,e){return 0===n?1===e?{ps:t,_ps:ed}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-a))))),b=c-n*(c-f),x=f-n*(f-h),_=b-n*(b-x),I=_-n*(_-(x-n*(x-(h-n*(h-p))))),N=nd(n),S=nd(s),E=nd(u),w=nd(l),M=nd(a),P=nd(c),T=nd(f),y=nd(h),C=S+N*(S+E),O=E+N*(E+w),A=C+N*(C+O),z=P+N*(P+T),B=T+N*(T+y),Y=z+N*(z+B);return{ps:[[s,c],[d,b],[v,_],[m,I]],_ps:[[0,0],[C,z],[A,Y],[A+N*(A+(O+N*(O+(w+N*(w+M))))),Y+N*(Y+(B+N*(B+(y+N*(y+nd(p))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=s-n*(s-u),g=u-n*(u-l),v=l-n*(l-a),m=d-n*(d-g),b=g-n*(g-v),x=m-n*(m-b),_=c-n*(c-f),I=f-n*(f-h),N=h-n*(h-p),S=_-n*(_-I),E=I-n*(I-N),w=S-n*(S-E),M=nd(n),P=nd(s),T=nd(u),y=nd(l),C=nd(a),O=nd(c),A=nd(f),z=nd(h),B=P+M*(P+T),Y=T+M*(T+y),F=y+M*(y+C),V=B+M*(B+Y),k=Y+M*(Y+F),L=O+M*(O+A),D=A+M*(A+z),X=z+M*(z+nd(p)),q=L+M*(L+D),Q=D+M*(D+X);return{ps:[[x,w],[b,E],[v,N],[a,p]],_ps:[[V+M*(V+k),q+M*(q+Q)],[k,Q],[F,X],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=t[3],c=r[0],u=r[1],f=o[0],l=o[1],h=i[0],a=i[1],p=n*n,d=n*p,g=e*e,v=e*g,m=n*e,b=c-f,x=h-f,_=s[0]-c,I=b+x,N=n*b,S=e*b,E=_-3*x,w=u-l,M=a-l,P=s[1]-u,T=w+M,y=n*w,C=e*w,O=P-3*M,A=d*E+(3*n*(n*I-b)+c),z=m*(n*E+2*I)+(p*I+c-(S+2*N)),B=m*(e*E+2*I)+(g*I+c-(2*S+N)),Y=v*E+(3*e*(e*I-b)+c),F=d*O+(3*n*(n*T-w)+u),V=m*(n*O+2*T)+(p*T+u-(C+2*y)),k=m*(e*O+2*T)+(g*T+u-(2*C+y)),L=v*O+(3*e*(e*T-w)+u),D=nd(n),X=nd(e),q=nd(m),Q=nd(d),$=nd(v),G=nd(c),H=nd(f),R=G+H,U=nd(h)+H,Z=R+U,j=D*R,W=X*R,J=nd(_)+3*U,K=nd(u),tt=nd(l),nt=K+tt,et=nd(a)+tt,rt=nt+et,ot=D*nt,it=X*nt,st=nd(P)+3*et;return{ps:[[A,F],[z,V],[B,k],[Y,L]],_ps:[[Q*J+(3*D*(D*Z+R)+G),Q*st+(3*D*(D*rt+nt)+K)],[q*(D*J+2*Z)+(p*Z+G+(W+2*j)),q*(D*st+2*rt)+(p*rt+K+(it+2*ot))],[q*(X*J+2*Z)+(g*Z+G+(2*W+j)),q*(X*st+2*rt)+(g*rt+K+(2*it+ot))],[$*J+(3*X*(X*Z+R)+G),$*st+(3*X*(X*rt+nt)+K)]]}}(t,n,e)}const od=Math.abs,id=[[0,0],[0,0],[0,0]];function sd(t,n,e){return 0===n?1===e?{ps:t,_ps:id}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=s-u,d=[[i,s],[-n*a+i,-n*p+s],[h*(a+(f-c))-(2*n*a-i),h*(p+(l-u))-(2*n*p-s)]],g=od(n),v=od(i),m=od(c),b=od(f),x=v+m,_=od(s),I=od(u),N=_+I;return{ps:d,_ps:[[0,0],[g*x+v,g*N+_],[h*(x+(b+m))+(2*g*x+v),h*(N+(od(l)+I))+(2*g*N+_)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n*n,a=i-c,p=f-c,d=s-u,g=l-u,v=[[h*(a+p)-(2*n*a-i),h*(d+g)-(2*n*d-s)],[n*p+c,n*g+u],[f,l]],m=od(n),b=od(i),x=od(c),_=b+x,I=od(f)+x,N=od(s),S=od(u),E=N+S;return{ps:v,_ps:[[h*(_+I)+(2*m*_+b),h*(E+(od(l)+S))+(2*m*E+N)],[m*I+x,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],s=r[0],c=r[1],u=o[0],f=o[1],l=i[0],h=i[1],a=n*n,p=e*e,d=n*e,g=s-u,v=g+(l-u),m=c-f,b=m+(h-f),x=a*v-(2*n*g-s),_=d*v-(g*(e+n)-s),I=p*v-(2*e*g-s),N=a*b-(2*n*m-c),S=d*b-(m*(e+n)-c),E=p*b-(2*e*m-c),w=od(n),M=od(e),P=od(d),T=od(s),y=od(u),C=T+y,O=C+od(l)+y,A=od(c),z=od(f),B=A+z,Y=B+od(h)+z;return{ps:[[x,N],[_,S],[I,E]],_ps:[[a*O+(2*w*C+T),a*Y+(2*w*B+A)],[P*O+(C*(M+w)+T),P*b+(B*(M+w)+A)],[p*O+(2*M*C+T),p*Y+(2*M*B+A)]]}}(t,n,e)}const cd=Math.abs,ud=[[0,0],[0,0]];const fd=Number.EPSILON/2,ld=Zp(1);function hd(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=rd(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=e[3][0],u=9*fd*r[0][0],f=9*fd*r[1][0],l=9*fd*r[2][0],h=9*fd*r[3][0],a=e[0][1],p=e[1][1],d=e[2][1],g=e[3][1],v=9*fd*r[0][1],m=9*fd*r[1][1],b=9*fd*r[2][1],x=9*fd*r[3][1],_=Math.min(o-u,i-f,s-l,c-h),I=Math.max(o+u,i+f,s+l,c+h);return[[_,Math.min(a-v,p-m,d-b,g-x)],[I,Math.max(a+v,p+m,d+b,g+x)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=sd(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=e[2][0],c=5*fd*r[0][0],u=5*fd*r[1][0],f=5*fd*r[2][0],l=e[0][1],h=e[1][1],a=e[2][1],p=5*fd*r[0][1],d=5*fd*r[1][1],g=5*fd*r[2][1],v=Math.min(o-c,i-u,s-f),m=Math.max(o+c,i+u,s+f);return[[v,Math.min(l-p,h-d,a-g)],[m,Math.max(l+p,h+d,a+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:ud}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[o,i],[n*(s-o)+o,n*(c-i)+i]],f=cd(n),l=cd(o),h=cd(s),a=cd(i);return{ps:u,_ps:[[0,0],[f*(h+l)+l,f*(cd(c)+a)+a]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=[[n*(s-o)+o,n*(c-i)+i],[s,c]],f=cd(n),l=cd(o),h=cd(s),a=cd(i);return{ps:u,_ps:[[f*(h+l)+l,f*(cd(c)+a)+a],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],s=r[1],c=o[0],u=o[1],f=[[n*(c-i)+i,n*(u-s)+s],[e*(c-i)+i,e*(u-s)+s]],l=cd(n),h=cd(e),a=cd(i),p=cd(c),d=cd(s),g=cd(u);return{ps:f,_ps:[[l*(p+a)+a,l*(g+d)+d],[h*(p+a)+a,h*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],s=3*fd*r[0][0],c=3*fd*r[1][0],u=e[0][1],f=e[1][1],l=3*fd*r[0][1],h=3*fd*r[1][1],a=Math.min(o-s,i-c),p=Math.max(o+s,i+c);return[[a,Math.min(u-l,f-h)],[p,Math.max(u+l,f+h)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Jp(t,n);let i;if(4===t.length)i=td(t,[0,n]).map((t=>8*ld*t));else if(3===t.length)i=td(t,[0,n]).map((t=>5*ld*t));else if(2===t.length)i=td(t,[0,n]).map((t=>2*ld*t));else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}const ad=Number.EPSILON/2,pd=ad*ad;function dd(t){const n=t*pd;return n/(1-n)}const gd=te,vd=oe,{abs:md}=Math,bd=dd(3);function xd(t,n,e){const r=t.length-1,o=[t[0]];let i=n[0];const s=[i];for(let c=1;c<r;c++){const r=o[c-1],u=e*r[1],f=md(e)*i+md(u),l=t[c];i=n[c]+f+md(l[1]+u);const h=vd(l,gd(e,r));o.push(h),s.push(i)}return{coeffs:o,errBound:s.map((t=>bd*t))}}const _d=cn,Id=on;function Nd(t,n){const e=t.length-1,r=[t[0]];for(let o=1;o<e;o++)r.push(Id(t[o],_d(n,r[o-1])));return r}const Sd=H,Ed=T,wd=sn,Md=on,Pd=Number.EPSILON,Td=dd(3),{sqrt:yd}=Math;function Cd(t,n,[e,r]=[0,1],o=void 0,i=void 0,s=!1,c=0){const u=t.ps,f=0===c&&t===o;let{polyDd:l,polyE:h,getPolyExact:a}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:lp(t,n),polyE:$p(t,n).map((t=>10*Wp*t)),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],[d,g]=n,v=Ep(s,d),m=Ep(u,d),b=Ep(l,d),x=Ep(a,d),_=Ep(c,g),I=Ep(f,g),N=Ep(h,g),S=Ep(p,g),E=wp(v,v),w=Mp(6,wp(v,m)),M=Mp(6,wp(v,b)),P=Pp(wp(v,x)),T=Mp(9,wp(m,m)),y=Mp(18,wp(m,b)),C=Mp(6,wp(m,x)),O=Mp(9,wp(b,b)),A=Mp(6,wp(b,x)),z=wp(x,x),B=wp(_,_),Y=Mp(6,wp(_,I)),F=Mp(6,wp(_,N)),V=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),P=Ap(g,g),T=Yp(E,Bp(w)),y=Yp(b,Bp(x)),C=Yp(Fp(Yp(I,Bp(y)),Vp(Yp(_,m))),v),O=Yp(Fp(Yp(P,Bp(T)),Vp(Yp(M,S))),N),A=Yp(C,O),z=Yp(Fp(_,y),Fp(zp(3,m),v)),B=Yp(Fp(M,T),Fp(zp(3,S),N)),Y=zp(3,Yp(z,B)),F=Fp(T,zp(3,Fp(Bp(S),N))),V=Fp(y,zp(3,Fp(Bp(m),v))),k=Yp(F,V),L=Fp(S,N),D=Fp(m,v);return[A,Y,k,Yp(L,D)]}(t,n)};if(1===e)return{polyDd:Sp(t,n),polyE:Hp(t,n).map((t=>6*Wp*t)),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=kp(e,s),f=kp(o,s),l=kp(r,c),h=kp(i,c),a=Lp(u,u),p=Lp(u,f),d=Lp(f,f),g=Lp(l,l),v=Lp(l,h),m=Lp(h,h),b=Xp(p,v),x=Xp(g,a);return[Xp(Xp(d,m),Xp(Dp(b),x)),qp(b,x)]}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order <= 3")}(u,n);const p=f?xd(l,h.map((t=>t/Td)),i):void 0,d=s&&f?xd(p.coeffs,p.errBound.map((t=>t/Td)),i):void 0,g=s&&f?xd(d.coeffs,d.errBound.map((t=>t/Td)),i):void 0,{polyDd:v,polyE:m,getPolyExact:b}=void 0!==g?{polyDd:g.coeffs,polyE:g.errBound.map((t=>t/Td)),getPolyExact:()=>Nd(Nd(Nd(a(),i),i),i)}:void 0!==p?{polyDd:p.coeffs,polyE:p.errBound.map((t=>t/Td)),getPolyExact:()=>Nd(a(),i)}:{polyDd:l,polyE:h,getPolyExact:a},x=Nr(v,e,r,m,b),_=1===i&&t===o.next||0===i&&t===o,I=0===i&&t===o.prev||1===i&&t===o;0===e?_||x.push({tS:0,tE:0,multiplicity:1}):1===e?I||x.push({tS:1,tE:1,multiplicity:1}):x.push({tS:e,tE:e,multiplicity:1}),0===r?_||x.push({tS:0,tE:0,multiplicity:1}):1===r?I||x.push({tS:1,tE:1,multiplicity:1}):x.push({tS:r,tE:r,multiplicity:1});const N=x.map((o=>{const{tS:i,tE:s}=o;if(s<e||i>r)return;const c=(i+s)/2,f=c<0?0:c>1?1:c,l=hd(u,[i,s]),h=function(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}(l),a=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,c],[s,i],[s,c]]){const e=Ed(t,u),r=Ed(n,f),o=Md(wd(e,e),wd(r,r)),i=Sd(o),s=i*(1-Pd),c=i*(1+Pd);s<=l&&(l=s),c>=h&&(h=c)}return[l,h]}(l,n),p=0===f?1:f;return{curve:0===f?t.prev:t,p:h,t:p,d:(yd(a[0])+yd(a[1]))/2,dSquaredI:a,box:l}}));return N.filter((t=>void 0!==t))}const Od=p;function Ad(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],s=r[0],c=r[1],u=n[0],f=n[1];return u<o?f<i?Od(t[0],n):f>c?Od([o,c],n):(o-u)**2:u>s?f<i?Od([s,i],n):f>c?Od(t[1],n):(u-s)**2:f<i?(i-f)**2:f>c?(f-c)**2:0}function zd(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=w(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=hd(t,i);c[0][0]<r.box[0][0]&&(r={ts:i,box:c}),c[1][0]>o.box[0][0]&&(o={ts:i,box:c})}return{minX:r,maxX:o}}(t),e=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=w(t),s=Er(i,0,1);for(let n=0;n<s.length;n++){const e=s[n],i=[e.tS,e.tE],c=hd(t,i);c[0][1]<r.box[0][1]&&(r={ts:i,box:c}),c[1][1]>o.box[0][1]&&(o={ts:i,box:c})}return{minY:r,maxY:o}}(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const Bd=P(zd);function Yd(t){let n=0;for(let e=0;e<t.length-1;e++)n+=$r(t[e],t[e+1]);return n}function Fd(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,s;const c=Yd(t);if(256*p(t[0],t[t.length-1])<c*c){const[r,o]=Jp(t,.5),c=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/c,s=(r-n)/c}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,s=(r-n)/t}const u=function(t,n,e){const r=I(t[0].map((t=>-t)));return zd(t.map((t=>S(-n,e,r(t)))))}(t,i,s),[[f,l],[h,a]]=u,d=[u[0],[h,l],u[1],[f,a]],g=S(i,s);return d.map((n=>I(t[0],g(n))))}function Vd(t,n){const e=[0,1,2,3].map((e=>function(t,n){const e=p,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let s=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return s=Math.max(0,Math.min(1,s)),e(t,[r[0]+s*(o[0]-r[0]),r[1]+s*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]]))),r=p(t[0],t[1]),o=p(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const kd=P(Fd);function Ld(t,n){const e=function(t,n){let e=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++){const o=t[r],i=o.curve.ps,s=Jp(i,o.ts[0]),c=Jp(i,o.ts[1]),u=Math.min(p(n,s),p(n,c));u<e&&(e=u)}return(1+2**-10)*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],s=i.curve.ps;Ad(Bd(s),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],s=i.curve.ps;Vd(kd(s),n)<=e&&r.push(i)}return r}(t,n,e),t}function Dd(t,n,e=void 0,r=void 0,o=!1,i=0){t=Ld(t,n);const s=[];for(let c=0;c<t.length;c++){const u=t[c],f=Cd(u.curve,n,u.ts,e,r,o,i);s.push(...f)}let c=Number.POSITIVE_INFINITY;for(let t=0;t<s.length;t++){const n=s[t].dSquaredI[1];n<c&&(c=n)}const u=[];for(let t=0;t<s.length;t++){const n=s[t];n.dSquaredI[0]<=c&&u.push(n)}return u.map((t=>Se(t.curve,t.t,!1)))}function Xd(t,n){return n.map((n=>Dd(n,t)[0]))}function qd(t,n,e){const r=ep(e);let o,i,s,c,u=1,f=0;do{i=I([(h=u)*(l=e)[0],h*l[1]],n),s=Xd(i,t),c=ep(d(i,np(s.map((t=>t.p))))),o=c<r,u/=2,f++}while(!o&&f<3);var l,h;return{newX:i,newV:c,newPs:s}}const Qd=d;function $d(t,n,e,r,o){const i=2**-32*o,s=[t[0],t[n],t[t.length-1]],c=[r[0],r[n],r[t.length-1]],u=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e],f=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e];if(Yn(u[0][0]))return;let l,h,a=0,p=function(t,n){const e=t[0][0].cp.circle.center,r=Dd(n[1],e)[0];return np([t[0][0].cp.pointOnShape.p,r.p,t[2][1].cp.pointOnShape.p])}(u,f);if("undefined"!=typeof _debug_){const t=_debug_.generated.elems.threeProng,n=t[t.length-1];n.traces[n.traces.length-1].push(p)}let g=Number.POSITIVE_INFINITY;for(;g>i&&a<10;){if(a++,l=Xd(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;h=np(l.map((t=>t.p)));const t=Qd(p,h);if(!Number.isFinite(t[0])||!Number.isFinite(t[1]))return;const n=qd(f,p,t);if(p=n.newX,l=n.newPs,"undefined"!=typeof _debug_){const t=_debug_.generated.elems.threeProng,n=t[t.length-1];n.traces[n.traces.length-1].push(p)}const e=ep(t);g=Math.abs(e-n.newV)}const v=($r(p,l[0].p)+$r(p,l[1].p)+$r(p,l[2].p))/3,m={center:p,radius:v};let b=0;for(let t=0;t<3;t++){const n=l[t],e=N(d(n.p,p)),r=x(e);if(Ra(n)){const t=dn(n.curve).tangents.map(x),r=Math.asin(_(t[0],e)),o=Math.asin(_(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),b+=i}else{const t=N(M(n.curve.ps,n.t));b+=Math.abs(Math.asin(_(r,t)))}}const I=[];for(let t=0;t<r.length;t++){const n=Dd(r[t],p)[0];I.push($r(n.p,p))}const S=Math.min(...I);return{ps:l,circle:m,error:1*Math.abs(v-S)+1*b,δ3s:u}}const Gd=P((t=>!!vn(t)&&gn(t).isQuiteSharp));function Hd(t){let n=t[0];const e=t[1],r=[];let o=!0;do{if(!o){o=!0,n=n.prevOnCircle;continue}o=!1;const t=n.cp.pointOnShape,e=n.next.cp.pointOnShape;e.curve===t.curve&&Gd(t)&&Gd(e)||(e.curve===t.curve&&h(n.next.cp,n.cp)>0?r.push({curve:t.curve,ts:[t.t,e.t]}):(r.push({curve:t.curve,ts:[t.t,1]}),n.cp.pointOnShape.curve.loop===n.next.cp.pointOnShape.curve.loop&&Rd(r,t.curve,e.curve,e.t))),n=n.next}while(n!==e);return r}function Rd(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function Ud(){if("undefined"!=typeof _debug_){const t=_debug_.generated.elems.threeProng,n=[];t[t.length-1].traces.push(n)}}function Zd(t,n,e){"undefined"!=typeof _debug_&&t.push({circle:n,ps:e})}function jd(t,n,e,r){const o=t.findBounds(Sn({pointOnShape:n,circle:void 0,order:e,order2:r},!1,!1));return o[0]||o[1]?o[0]&&o[1]?[o[0].datum,o[1].datum]:[t.max(t.root),t.min(t.root)]:[void 0,void 0]}function Wd(t,n,e,r,o){const i=r.map(((r,i)=>{const s=e.get(r.curve.loop);return yn(!1,!1,s,{pointOnShape:r,circle:t,order:n[i],order2:0},(o?o[i]:jd(s,r,n[i],0))[0])})),s=r.length;for(let t=0;t<s;t++){const n=0===t?s-1:t-1,e=t===s-1?0:t+1;i[t].prevOnCircle=i[n],i[t].nextOnCircle=i[e]}return i}const Jd=Math.cos(Math.PI/180*3);function Kd(t,n,e,r,o,i){const s=2e-14*i,c=.02*s,u=jd(t.get(n.curve.loop),n,r,o);if(!u[0])return;const{p:f,t:l}=n;for(const t of u){const n=t.cp.pointOnShape.p,r=$r(f,n);if(!(r>s)&&(b(N(d(n,t.cp.circle.center)),N(d(f,e.center)))>Jd||r<c&&0!==l&&1!==l))return t}}let tg=0;function ng(t,n,e){let r;do{if(r=Xn(n),r.length>2){const n=eg(t,r,e);1===n.length&&n[0],tg++}if("undefined"!=typeof _debug_&&tg===_debug_.directives.stopAfterThreeProngsNum)return}while(r.length>2);return r}function eg(t,n,e){const r=[];for(const t of n)r.push([t,t.next]);const o=function(t,n){const e=t.map(Hd);!function(t){if("undefined"!=typeof _debug_){const n=_debug_.generated.elems.threeProng;n.push({generated:void 0,circle:void 0,poss:void 0,cp3ss:void 0,cpss:void 0,bestIndx:void 0,candidateThreeProngs:void 0,visitedCps:void 0,boundaries:void 0,traces:void 0});const e=n[n.length-1];e.boundaries=[];for(const n of t){const t=[];e.boundaries.push(t);for(const e of n){const n=Ja(e.curve.ps,e.ts[0],e.ts[1]);t.push(n)}}e.traces=[]}}(e);const r=[];let o,i,s=Number.POSITIVE_INFINITY;for(let c=1;c<t.length-1;c++)for(let u=0;u<3;u++){Ud();const f=$d(t,c,u,e,n);if(!f)continue;const{circle:l,ps:h,error:a,δ3s:p}=f;Zd(r,l,h),a<s&&(s=a,i=c-1,o={circle:l,ps:h,δ3s:p})}return function(t,n,e,r){if("undefined"!=typeof _debug_){const o=_debug_.generated.elems.threeProng,i=o[o.length-1];i.generated=_debug_.generated,void 0!==t&&(i.circle=t.circle,i.poss=t.ps,i.cp3ss=t.δ3s),i.cpss=n,i.bestIndx=e,i.candidateThreeProngs=r}}(o,t,i,r),o}(r,e),i=[];for(let t=0;t<3;t++)i.push(Ua(o.circle,o.ps[t]));const s=function(t,n,e){const{circle:r,ps:o,δ3s:i}=e;return Kd(t,o[0],r,n[0],0,1e3),Kd(t,o[1],r,n[1],0,1e3),Kd(t,o[2],r,n[2],0,1e3),Wd(r,n,t,o,i)}(t,i,o);return"undefined"!=typeof _debug_&&3===s.length&&function(t,n){const e=_debug_.generated.elems.threeProng,r=e[e.length-1];r.visitedCps=n,r.circle=t}(s[0].cp.circle,n),s}function rg(t,n,e){function r(n,e){let r=t.get(n);r||(r=new Set,t.set(n,r)),r.add(e)}void 0!==n&&(r(n,e),r(e,n))}function og(t,n,e){let r;r=t.get(n);const o=r&&r.has(e);r=t.get(e);const i=r&&r.has(n);return o||i}const ig=-1,sg=1,cg=0;class ug{constructor(t){this.datum=t,this.color=cg}}function fg(t){return!!t&&t.color===cg}class lg{constructor(t,n=!0,e){if(this.compare=t,this.duplicatesAllowed=n,this.getMinNode=this.getMinOrMaxNode(ig),this.getMaxNode=this.getMinOrMaxNode(sg),this.root=void 0,this.nodeCount=0,this.valueCount=0,e)for(const t of e)this.insert(t)}isEmpty(){return!this.root}find(t){const n=this;let e=this.root;for(;e;){const r=n.compare(t,e.datum);if(0===r)return e;e=e[r>0?sg:ig]}}toArrayInOrder(){const t=[];return function n(e){e&&(n(e[ig]),t.push(e.datum),void 0!==e.extras&&t.push(...e.extras),n(e[sg]))}(this.root),t}insertMulti(t){const n=this;for(const e of t)n.insert(e)}insert(t){const n=this;n.root=function t(e,r){if(void 0===e)return n.valueCount++,n.nodeCount++,new ug(r);const o=n.compare(r,e.datum);if(0===o&&(n.duplicatesAllowed?(n.valueCount++,void 0===e.extras?e.extras=[r]:e.extras.push(r)):e.datum=r),0!==o){const n=o>0?sg:ig;e[n]=t(e[n],r),e[n].parent=e}return fg(e[sg])&&!fg(e[ig])&&(e=hg(ig,e)),fg(e[ig])&&fg(e[ig][ig])&&(e=hg(sg,e)),fg(e[ig])&&fg(e[sg])&&pg(e),e}(n.root,t),n.root.color=1,n.root.parent=void 0}remove(t,n=!1,e){const r=this;if(void 0===r.root)return;let o;const i=function t(i,s){const c=r.duplicatesAllowed&&void 0!==i.extras;let u=r.compare(s,i.datum);if(u<0&&!i[ig]||u>0&&!i[sg])return i;if(u<0){fg(i[ig])||fg(i[ig][ig])||(i=dg(i));const n=t(i[ig],s);return null===n?null:(i[ig]=n,i[ig]&&(i[ig].parent=i),gg(i))}if(fg(i[ig])&&(i=hg(sg,i),u=r.compare(s,i.datum)),0===u&&!i[sg]){if(c&&!n){if(void 0===e||!0===e(s,i.datum))return o=i.datum,i.datum=i.extras.pop(),r.valueCount--,0===i.extras.length&&(i.extras=void 0),i;{const t=i.extras;for(let n=0;n<t.length;n++)if(!0===e(s,t[n]))return o=t.splice(n,1)[0],r.valueCount--,0===t.length&&(i.extras=void 0),i;return null}}return void 0===e||!0===e(s,i.datum)?(o=i.datum,r.valueCount-=1+(c?i.extras.length:0),void r.nodeCount--):null}if(fg(i[sg])||fg(i[sg][ig])||(i=function(t){return pg(t),fg(t[ig][ig])&&pg(t=hg(sg,t)),t}(i),u=r.compare(s,i.datum)),0===u)if(c&&!n)if(void 0===e||!0===e(s,i.datum))o=i.datum,i.datum=i.extras.pop(),r.valueCount--,0===i.extras.length&&(i.extras=void 0);else{const t=i.extras;let n=!1;for(let c=0;c<t.length;c++)if(!0===e(s,t[c])){o=t.splice(c,1)[0],r.valueCount--,0===t.length&&(i.extras=void 0),n=!0;break}if(!n)return null}else{if(void 0!==e&&!0!==e(s,i.datum))return null;{r.valueCount-=1+(c?i.extras.length:0),o=i.datum;const t=r.getMinNode(i[sg]);i.datum=t?.datum,r.duplicatesAllowed&&(i.extras=t?.extras),i[sg]=ag(i[sg]),r.nodeCount--}}else{const n=t(i[sg],s);if(null===n)return null;i[sg]=n}return i[sg]&&(i[sg].parent=i),gg(i)}(r.root,t);return null!==i?(r.root=i,void 0!==r.root&&(r.root.color=1,r.root.parent=void 0),o):void 0}findBounds(t){const n=this;let e=n.root;const r=[void 0,void 0];if(void 0===e)return r;for(;e;){const o=n.compare(t,e.datum);o>=0?r[0]=e:r[1]=e,e=e[o>=0?sg:ig]}return r}findBoundsExcl(t){const n=this,e=n.root,r=[void 0,void 0];return void 0===e||function e(o){for(;o;){const i=n.compare(t,o.datum);if(0===i)return e(o[ig]),void e(o[sg]);i>0?r[0]=o:i<0&&(r[1]=o),o=o[i>0?sg:ig]}}(e),r}findAll(t){const n=this;let e=this.root;for(;e;){const r=n.compare(t,e.datum);if(0===r)return[e.datum,...e.extras?e.extras:[]];e=e[r>0?sg:ig]}return[]}getMinOrMaxNode(t){return n=>{if(void 0===n&&(n=this.root),n){for(;n[t];)n=n[t];return n}}}min(t){void 0===t&&(t=this.root);const n=this.getMinNode(t);if(void 0!==n)return n.datum}max(t){void 0===t&&(t=this.root);const n=this.getMaxNode(t);if(void 0!==n)return n.datum}}function hg(t,n){const e=n[-t];return n[-t]=e[t],e[t]&&(e[t].parent=n),e[t]=n,n.parent=e,e.color=n.color,n.color=cg,e}function ag(t){if(t[ig])return fg(t[ig])||fg(t[ig][ig])||(t=dg(t)),t[ig]=ag(t[ig]),t[ig]&&(t[ig].parent=t),gg(t)}function pg(t){t.color=(t.color+1)%2,t[ig].color=(t[ig].color+1)%2,t[sg].color=(t[sg].color+1)%2}function dg(t){if(pg(t),fg(t[sg][ig])){const n=hg(sg,t[sg]);t[sg]=n,n.parent=t,pg(t=hg(ig,t))}return t}function gg(t){return fg(t[sg])&&(t=hg(ig,t)),fg(t[ig])&&fg(t[ig][ig])&&(t=hg(sg,t)),fg(t[ig])&&fg(t[sg])&&pg(t),t}const vg=Rr;let mg;const bg=Number.POSITIVE_INFINITY,xg=P((function(t){const n=[[{bezier:void 0,t:void 0,val:bg},{bezier:void 0,t:void 0,val:bg}],[{bezier:void 0,t:void 0,val:-bg},{bezier:void 0,t:void 0,val:-bg}]];return t.curves.forEach((function(t){const e=function(t){const n=w(t),e=Ni(n[0],0,1),r=Ni(n[1],0,1);e.push(0,1),r.push(0,1);let o,i,s,c,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[s]=Jp(t,r);s<u&&(u=s,o=r),s>f&&(f=s,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Jp(t,e);o<l&&(l=o,s=e),o>h&&(h=o,c=e)}return{ts:[[o,s],[i,c]],box:[[u,l],[f,h]]}}(t.ps);{const r=e.box[0][0],o=n[0][0].val;(r<o||r===o&&e.ts[0][0]>n[0][0].t)&&(n[0][0]={bezier:t,t:e.ts[0][0],val:r})}{const r=e.box[0][1],o=n[0][1].val;(r<o||r===o&&e.ts[0][1]>n[0][1].t)&&(n[0][1]={bezier:t,t:e.ts[0][1],val:r})}{const r=e.box[1][0],o=n[1][0].val;(r>o||r===o&&e.ts[1][0]>n[1][0].t)&&(n[1][0]={bezier:t,t:e.ts[1][0],val:r})}{const r=e.box[1][1],o=n[1][1].val;(r>o||r===o&&e.ts[1][1]>n[1][1].t)&&(n[1][1]={bezier:t,t:e.ts[1][1],val:r})}})),{minY:Se(n[0][1].bezier,n[0][1].t,!0),minX:Se(n[0][0].bezier,n[0][0].t,!0),maxX:Se(n[1][0].bezier,n[1][0].t,!0),maxY:Se(n[1][1].bezier,n[1][1].t,!0)}})),_g=P((function(t){let n,e,r,o,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(const f of t){const t=xg(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>s&&(e=t.maxX,s=t.maxX.p[0]),t.minY.p[1]<c&&(r=t.minY,c=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}})),Ig=oe,Ng=te;function Sg(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ig(t[r],Ng(n,e));return e}Sg([[0,1],[0,1],[0,-2],[0,3]],.25);const Eg=ge,wg=pe,Mg=te,Pg=oe,Tg=re;function yg(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Mg(3,Pg(wg(c,n),Mg(3,wg(r,i)))),Mg(6,Tg(Eg(i,n),-2*r)),Mg(3,wg(r,n))],[Mg(3,Pg(wg(u,e),Mg(3,wg(o,s)))),Mg(6,Tg(Eg(s,e),-2*o)),Mg(3,wg(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[Tg(Eg(2*i,2*n),-4*r),wg(2*r,2*n)],[Tg(Eg(2*s,2*e),-4*o),wg(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[wg(r,n)],[wg(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Cg=pe,Og=oe,Ag=te,zg=re;function Bg(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Ag(6,Og(Cg(c,n),Ag(3,Cg(r,i)))),Ag(6,zg(Cg(i,2*r),n))],[Ag(6,Og(Cg(u,e),Ag(3,Cg(o,s)))),Ag(6,zg(Cg(s,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,s]]=t;return[[zg(Cg(2*i,4*r),2*n)],[zg(Cg(2*s,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Yg=le,Fg=oe,Vg=ie,kg=T,Lg=pt,Dg=j,Xg=on,qg=at;function Qg(t,n,e=!1){const r=n.curve.ps,{p:o,t:i}=n;let s=-function(t,n){const[e,r]=yg(t),[o,i]=Bg(t),s=Sg(e,n),c=Sg(r,n),u=Sg(o,n),f=Sg(i,n),l=Vg(Yg(s,f),Yg(c,u)),h=Fg(Yg(s,s),Yg(c,c)),a=Yg(h,Yg(h,h)),p=Math.sqrt(a[1]);return l[1]/p}(r,i);(s<t||e)&&(s=t);const c=function(t,n){const[e,r]=function(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Dg(3,Xg(kg(c,n),Dg(3,kg(r,i)))),Dg(6,qg(Lg(i,n),-2*r)),Dg(3,kg(r,n))],[Dg(3,Xg(kg(u,e),Dg(3,kg(o,s)))),Dg(6,qg(Lg(s,e),-2*o)),Dg(3,kg(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[qg(Lg(2*i,2*n),-4*r),kg(2*r,2*n)],[qg(Lg(2*s,2*e),-4*o),kg(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[kg(r,n)],[kg(o,e)]]}(t);if(1===t.length)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t);return[$e(e,n),$e(r,n)]}(r,i).map((t=>t[t.length-1])),u=[-c[1],c[0]],f=Math.sqrt(u[0]**2+u[1]**2);return{center:[o[0]-u[0]/(s*f),o[1]-u[1]/(s*f)],radius:1/s}}function $g(t){return t.holeClosing?"twoProng_holeClosing":"twoProng_regular"}const{abs:Gg}=Math,Hg=pe,Rg=de;function Ug(t,n,e){const r=Gg(t[1]-n[1])>Gg(t[0]-n[0]);let o,i,s,c,u,f;r?(o=t[1],i=t[0],s=n[1],c=n[0],u=e[1],f=e[0]):(o=t[0],i=t[1],s=n[0],c=n[1],u=e[0],f=e[1]);const l=he(Hg(i,c),Hg(o,s)),h=ie([0,c],se(s,l)),a=oe(ie(oe(Rg(s,s),Rg(c,c)),oe(Rg(u,u),Rg(f,f))),ce(le(h,Hg(f,c)))),p=oe(Hg(s,u),le(l,Hg(c,f))),d=he(a,ce(p)),g=oe(le(l,d),h);return r?[g[1],d[1]]:[d[1],g[1]]}function Zg(t,n,e,r){const o=(2**-14*t)**2;if(p(n,r)<o)return;const i=[(n[0]+r[0])/2,(n[1]+r[1])/2],s=[r[0]-n[0],r[1]-n[1]],c=[-s[1],s[0]],u=a([n,e],[i,[i[0]+c[0],i[1]+c[1]]]);return u?b([u[0]-n[0],u[1]-n[1]],[e[0]-n[0],e[1]-n[1]])<0?void 0:u:void 0}function jg(t,n){const[e,r]=t,[o,i]=n,s=pe(e,o),c=pe(r,i),u=le(s,s),f=le(c,c);return oe(u,f)[1]}function Wg(t,n,e){if(t.length<=1)return t;const r=[];for(const o of t){const t=o.curve.ps;Ad(Bd(t),n)<=1.0009765625*e&&r.push(o)}return r}function Jg(t,n,e,r){if(Ra(r))return;const o={radius:t,center:n};if(Kd(e,r,o,Ua(o,r),0,1e3))return;const i=Wd(o,[-.5,.5],e,[r,r]);"undefined"!=typeof _debug_&&_debug_.generated.elems.oneProng.push(i)}const{sqrt:Kg,abs:tv,sin:nv,cos:ev}=Math;function rv(t,n,e,r,o,i,s,c,u){const f=(2**-21*e)**2,l=2**-46*e,h=Kg(r),a=1/h;let v;const m=i.p;let b;if(s)v=[m[0],m[1]-h],b=h;else if(0===t)({center:v,radius:b}=Qg(a,i));else{({center:v,radius:b}=Qg(a,i,!0));const n=d(i.p,v),e=S(nv(t),ev(t))(n);v=I(i.p)(e)}const{bezierPieces:x,δ:_}=function(t,n,e,r,o,i,s){if(n){const t=[];for(let n=0;n<e;n++){const e=r[n].curves.map((t=>({curve:t,ts:[0,1]})));t.push(...e)}return{bezierPieces:t,δ:void 0}}let c;const u=Ra(i)?1===i.t&&0===t?-1:0===i.t?1:Ua(s,i):0,f=r[e],l=jd(o.get(f),i,u,0)[0],h=[l,l];return c=l&&l!==l.next.next?Hd(h):f.curves.map((t=>({curve:t,ts:[0,1]}))),{bezierPieces:c,δ:h}}(t,s,c,n,o,i,{center:v,radius:b});let N=v;const E=Kg(function(t,n,e,r){let o,i=Number.POSITIVE_INFINITY;for(let s=0;s<n.length;s++){const c=n[s],u=c.curve.ps;let f=Number.POSITIVE_INFINITY;const l=Jp(u,c.ts[0]);if(!o||o[0]!==l[0]||o[1]!==l[1]){const n=Zg(t,e,r,l);n&&(f=p(e,n))}let h=Number.POSITIVE_INFINITY;const a=Jp(u,c.ts[1]),d=Zg(t,e,r,a);d&&(h=p(e,d)),o=a;const g=Math.min(f,h);g<i&&(i=g)}return(1+2**-10)*i}(e,x,m,v));b>E&&(N=g(m,v,E/b));const w=[];let M,P,T=x,y=0;for(;y<25;){const n=jg(N,i.p);if(y<5&&(T=Wg(T,N,n)),M=Dd(T,N,i.curve,i.t,u&&0==y&&b!==1/a,t).map((t=>Se(t.curve,t.t,!1))),P=M[0],void 0===P)return void ov(s);const e=jg(N,P.p),r=jg(i.p,P.p);if(0===y&&b<(1-2**-6)*Kg(e))return void Jg(b,v,o,i);if("undefined"!=typeof _debug_&&w.push({x:N,y:i,z:Se(P.curve,P.t,!1),t:i.t}),!s&&r<=f)return;if(N=Ug(N,i.p,P.p),tv(Kg(n)-Kg(e))<l)break;if(y++,25===y)return void("undefined"!=typeof _debug_&&console.log("failed (slow): max iterations reached"))}const C={center:N,radius:$r(N,P.p)};return"undefined"!=typeof _debug_&&function(t,n,e,r,o,i,s,c,u){c.push({x:e,y:r,z:o,t:r.t});const f={generated:_debug_.generated,bezierPieces:t,pos:r,δ:s,z:o?o.p:void 0,circle:i,xs:c,failed:!1,holeClosing:u,notAdded:!1,deleted:!1,cpNode:void 0},l=$g(f);_debug_.generated.elems[l].push(f)}(x,0,N,i,P,C,_,w,s),{circle:C,zs:[P]}}function ov(t){if("undefined"!=typeof _debug_){const n=_debug_.generated.elems,e=t?n.twoProng_holeClosing:n.twoProng_regular,r=t?"hole-closing: "+e.length:"regular: "+e.length;console.log("failed: no closest point - "+r)}}function iv(t,n,e,r,o,i){let s=e.t;0===s&&(s=1,e=Se(e.curve.prev,s,!0));const c=Ua(n,e),u=r.map((t=>Ua(n,t)));let f=!1;for(let e=0;e<r.length;e++){const o=r[e],s=u[e];if(Kd(t,o,n,s,0,i)){f=!0;break}}if(Kd(t,e,n,c,0,i)||f)return void("undefined"!=typeof _debug_&&(o?_debug_.generated.elems.twoProng_holeClosing.pop():_debug_.generated.elems.twoProng_regular.pop()));const l=[],h=[],a=[],p=[],d=[];for(let e=0;e<r.length;e++){const i=r[e],s=u[e],c={pointOnShape:i,circle:n,order:s,order2:0};h.push(c);const f=i.curve.loop;d.push(f);const g=t.get(f);a.push(g);const v=jd(g,i,s,0);p.push(v),l.push(yn(o,!1,g,c,v[0]))}const g={pointOnShape:e,circle:n,order:c,order2:0},v=e.curve.loop,m=t.get(v),b=yn(o,!1,m,g,jd(m,e,c,0)[0]);if(1===l.length)b.prevOnCircle=l[0],b.nextOnCircle=l[0],l[0].prevOnCircle=b,l[0].nextOnCircle=b;else{const t=l.slice();t.push(b),t.sort(function(t){const n=t.center;return function(t,e){let r=t.cp.pointOnShape.p,o=e.cp.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(n));for(let n=0;n<t.length;n++){const e=n+1===t.length?0:n+1,r=0===n?t.length-1:n-1,o=t[n],i=t[e],s=t[r];o.nextOnCircle=i,o.prevOnCircle=s}}if(o){const t={pointOnShape:r[0],circle:n,order:h[0].order,order2:1},o=yn(!0,!1,a[0],t,l[0]),i=yn(!0,!1,m,{pointOnShape:e,circle:n,order:g.order,order2:-1},b.prev);i.prevOnCircle=o,i.nextOnCircle=o,o.prevOnCircle=i,o.nextOnCircle=i,l[0].next=b,b.prev=l[0],i.next=o,o.prev=i}if("undefined"!=typeof _debug_){let t;t=o?_debug_.generated.elems.twoProng_holeClosing:_debug_.generated.elems.twoProng_regular;const n=t[t.length-1];b||console.log("asas"),n.cpNode=b}return b}const{PI:sv,atan2:cv}=Math,uv=15*sv/180;function fv(t,n,e,r,o,i){let s;const c=_g(t),u=(c.maxX.p[0]-c.minX.p[0])**2+(c.maxY.p[1]-c.minY.p[1])**2;for(let c=0;c<r.length;c++){let f=[0];const l=r[c];if(1===l.t){const{curve:t}=l,n=pn(t.ps,t.next.ps);if(n.isQuiteDull){const t=Ha(n.tangents[0]),e=Ha(n.tangents[1]),r=(cv(t[1],t[0])+2*sv)%(2*sv),o=((cv(e[1],e[0])+2*sv)%(2*sv)-r+2*sv)%(2*sv);let i=uv;for(;i<=o-uv/2;)f.push(i),i+=uv}}for(let r of f){const f=rv(r,t,o,u,n,l,!1,e,i);if(f){const{circle:t,zs:e}=f,r=iv(n,t,l,e,!1,o);s=s||r}if("undefined"!=typeof _debug_&&c+1===_debug_.directives.stopAfterTwoProngsNum)return}}return s}function lv(t,n,e,r,o,i){for(let s=0;s<r.length;s++){const c=fv(n,e,s,r[s],o,i);t=t||c}return t}const hv=de,av=oe,pv=ie,{atan2:dv}=Math;function gv(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],s=pv(hv(i,e),hv(o,r))[1],c=av(hv(o,e),hv(i,r))[1];return dv(s,c)}const{abs:vv}=Math;function mv(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=vv(gv(n[t],n[t+1]));return r}function bv(t,n=.4,e=10,r=2**-16){const o={r:[0,1]};let i=o;for(;void 0!==i;){const o=i.r,s=Ja(t,o[0],o[1]);if(Yd(s)<=e&&mv(s)<=n||o[1]-o[0]<=r){i=i.next;continue}const c=(o[0]+o[1])/2,u=[o[0],c],f=[c,o[1]];i.r=u,i.next={r:f,next:i.next}}i=o;const s=[];for(;void 0!==i;)s.push(i.r[0]),void 0===i.next&&s.push(i.r[1]),i=i.next;return s}const xv=te,_v=pe,Iv=oe,Nv=te,Sv=ce,Ev=ue,wv=te,Mv=le,Pv=oe,Tv=ie;const{orient2d:yv}=un,Cv=Ft,Ov=R,Av=y,zv=rt,Bv=Number.EPSILON/2,Yv=Math.abs,Fv=K,Vv=T,kv=rt,Lv=y,Dv=H,Xv=Z,qv=pt;const Qv=pe,$v=te,Gv=le,Hv=oe,Rv=ie;function Uv(t){if(function(t){if(4===t.length)return 0===yv(t[0],t[1],t[2])&&0===yv(t[1],t[2],t[3])&&0===yv(t[0],t[2],t[3]);if(3===t.length)return 0===yv(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&function(t){const[[n,e],[r,o],[i,s],[c,u]]=t,f=c+3*r,l=n+3*i,h=f-l,a=Yv(3*r)+Yv(f)+(Yv(3*i)+Yv(l))+Yv(h);if(Yv(h)-Bv*a>0)return!1;const p=u+3*o,d=e+3*s,g=p-d,v=Yv(3*o)+Yv(p)+(Yv(3*s)+Yv(d))+Yv(g);return!(Yv(g)-Bv*v>0)&&0===Av(zv(Ov([c],Cv(3,r)),Ov([n],Cv(3,i))))&&0===Av(zv(Ov([u],Cv(3,o)),Ov([e],Cv(3,s))))}(t)&&(t=function(t,n=!1){if(!n){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[n,e],[Dv(kv(Xv(qv(r/4,i/4),3),qv(n/4,c/4))),Dv(kv(Xv(qv(o/4,s/4),3),qv(e/4,u/4)))],[c,u]]}const[e,r,o,i]=t,s=function(t,n){const[[e,r],[o,i]]=t,[[s,c],[u,f]]=n,l=Vv(o,e),h=Vv(i,r),a=Vv(u,s),p=Vv(f,c),d=kv(Fv(a,h),Fv(p,l));if(0===Lv(d))return;const g=Vv(s,e),v=Vv(c,r),m=kv(Fv(v,l),Fv(g,h)),b=Dv(m)/Dv(d);return[s+b*Dv(a),c+b*Dv(p)]}([e,r],[i,o]);if(void 0!==s)return[e,s,i]}(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,s]]=t,c=Qv(r,n),u=Qv(i,r),f=Rv(u,c),l=Qv(o,e),h=Qv(s,o),a=Rv(h,l),p=Hv(Rv($v(n,Rv(f,[0,-r])),$v(r,Rv(u,[0,-r]))),Rv($v(e,Rv(a,[0,-o])),$v(o,Rv(h,[0,-o]))));return[Hv(Gv(f,f),Gv(a,a)),ae(p)]}(t);return{minima:[],maxima:Nr(n,0,1).map((t=>(t.tS+t.tE)/2)),inflections:[]}}const n=function(t){const[[n,e,r],[o,i,s]]=yg(t),[[c,u],[f,l]]=Bg(t),[[h],[a]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,s],[c,u]]=t;return[[Nv(6,Iv(_v(c,n),Nv(3,_v(r,i))))],[Nv(6,Iv(_v(u,e),Nv(3,_v(o,s))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),p=Mv(h,i),d=Mv(a,e),g=Mv(u,s),v=Mv(u,i),m=Mv(f,f),b=Mv(c,s),x=Mv(l,r),_=Mv(l,e),I=Mv(f,r),N=Mv(r,e),S=Mv(r,n),E=Mv(r,o),w=Mv(e,e),M=Mv(e,n),P=Mv(e,i),T=Mv(n,s),y=Mv(n,o),C=Mv(n,n),O=Mv(s,i),A=Mv(s,o),z=Mv(i,i),B=Mv(i,o),Y=Mv(o,o),F=Tv(Mv(h,s),Mv(a,r)),V=Tv(p,d),k=Pv(Mv(u,r),Mv(l,s)),L=Pv(Pv(Mv(u,e),Mv(c,r)),Pv(Mv(l,i),Mv(f,s))),D=Tv(g,x),X=Tv(Pv(v,b),Pv(_,I)),q=Pv(Mv(r,r),Mv(s,s)),Q=Pv(N,O),$=Pv(P,T),G=Pv(A,z),H=Pv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m,J)))),xt=Pv(Tv(vt,mt),bt),_t=Mv(h,Pv(Mv(r,Pv(E,Sv($))),Mv(s,Pv(w,wv(3,G))))),It=Mv(a,Pv(Mv(r,Pv(wv(3,H),K)),Mv(s,et))),Nt=wv(3,Pv(Pv(Mv(u,Pv(Tv(Mv(l,rt),Mv(u,nt)),Sv(Tv(Mv(f,W),Mv(c,J))))),Mv(c,Tv(Mv(r,Tv(st,Mv(c,s))),Mv(s,Pv(Sv(Mv(l,i)),Mv(f,s)))))),Pv(Mv(l,Pv(Mv(l,$),Mv(r,Pv(Sv(Mv(f,i)),Mv(l,o))))),Mv(f,Mv(s,st))))),St=Pv(Tv(_t,It),Nt),Et=Tv(Pv(Mv(q,V),Sv(Mv(Q,F))),wv(3,Pv(Mv(k,X),Mv(L,D)))),wt=Tv(Mv(F,q),wv(3,Mv(k,D)));return{inflectionPoly:[Tv(Mv(c,o),Mv(f,n)),Tv(Pv(Mv(u,o),Mv(c,i)),Pv(Mv(l,n),Mv(f,e))),Tv(Pv(v,b),Pv(_,I)),Tv(g,x)],otherExtremaPoly:[ht,gt,xt,St,Et,wt]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Nr(r,0,1),i=function(t){const n=[],e=t.length-1;for(let r=0;r<e;r++)n.push(xv(e-r,t[r]));return n}(r),s=[],c=[];for(let t=0;t<o.length;t++){const n=(o[t].tS+o[t].tE)/2,r=$e(i,n),u=$e(e,n);y(sn(u,r))>=0?s.push(n):c.push(n)}return{minima:s,maxima:c,inflections:Nr(e,0,1).map((t=>(t.tS+t.tE)/2))}}function Zv(t){return xg(t).minY}function jv(t,n,e,r,o){!function(t){if("undefined"==typeof _debug_)return;mg=performance.now();for(const n of t)_debug_.fs.nameObj(n,"l|");const n=_debug_.generated;for(const e of t){let t=0;e.curves.forEach((function(e){const r=e.ps,o=vg(r);n.elems.boundingHull.push(o);const i=Bd(r);n.elems.looseBoundingBox.push(i);const s=Fd(r);n.elems.tightBoundingBox.push(s);const c=dn(e);c.isQuiteSharp?n.elems.sharpCorner.push(e):c.isQuiteDull&&n.elems.dullCorner.push(e),t++}))}}(t);const i=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Yd(o.ps)<t||dn(o).isQuiteSharp&&e.push(Se(o,1,!0))}return e}}(n),s=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Yd(o.ps)<t||dn(o).isQuiteDull&&(e.push(Se(o,1,!0)),e.push(Se(o.next,0,!0)))}return e}}(n),c=t.map(i),u=t.map(s),f=new Map;if(function(t,n,e){let r;for(let o=0;o<e.length;o++){const i=e[o],s=new lg(wn,!1);let c,u;for(const t of i){t.curve.next.ps;const n={center:t.p,radius:0},e={pointOnShape:t,circle:n,order:1,order2:0};c=yn(!1,!1,s,{pointOnShape:t,circle:n,order:-1,order2:0},u),u=yn(!1,!1,s,e,c),c.prevOnCircle=u,u.prevOnCircle=c,c.nextOnCircle=u,u.nextOnCircle=c}r||(r=c);const f=t[o];n.set(f,s)}}(t,f,c),function(t,n,e){const r=_g(t),o=(r.maxX.p[0]-r.minX.p[0])**2+(r.maxY.p[1]-r.minY.p[1])**2,i=t.map(Zv);for(let r=1;r<i.length;r++){const s=i[r],c=rv(0,t,e,o,n,s,!0,r,!1);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:u,zs:f}=c;iv(n,u,s,[f[0]],!0,e)}}(t,f,o),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return;!function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.holeClosers+=n-mg,mg=n}();const l=t.map(function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(Yd(o.ps)<t)continue;const{minima:i,maxima:s}=Uv(o.ps),c=[...i,...s].map((t=>Se(o,t,!0)));e.push(...c)}return e}}(n)),h=t.map(function(t,n,e){return function(r){const o=[];for(let i=0;i<r.curves.length;i++){const s=r.curves[i];if(Yd(s.ps)<t)continue;let c=bv(s.ps,n,e);2===c.length&&(c=[0,.5,1]);const u=c.slice(1,c.length-1).map((t=>Se(s,t,!0)));o.push(...u)}return o}}(n,e,r));let a;if(a=lv(a,t,f,u,o,!1),a=lv(a,t,f,l,o,!0),a=lv(a,t,f,h,o,!1),function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.oneAnd2Prongs+=n-mg,mg=n}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return;if(void 0===a)return;if(function(t,n,e){const r=new Map,o=[{fromCpNode:void 0,cpStart:n}];for(;o.length;){const{fromCpNode:n,cpStart:i}=o.shift();rg(r,n,i);for(const n of Cn(i)){if(!mn(n.cp.pointOnShape)&&void 0===ng(t,n,e))return void console.log("Unable to find 3-prong");og(r,n,n.next)||o.push({fromCpNode:i,cpStart:n.next})}}}(f,a,o),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return;const p={cpNode:a,cpTrees:f};return function(t){if("undefined"==typeof _debug_)return;const n=_debug_.generated,e=n.timing;n.elems.mat.push(t),e.threeProngs+=performance.now()-mg}(p),p}const Wv=Math.max,Jv=Math.abs;function Kv(t,n=.4,r=4){let o,i;({maxCurviness:n,maxLength:r,maxCoordinate:o,minBezLength:i}=function(t,n,e){const{maxCoordinate:r,maxRadius:o}=function(t){let n=0,e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const s of t)for(const t of s)for(const s of t){const t=s[0],c=s[1],u=Wv(Jv(t),Jv(c));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),c<o&&(o=c),c>i&&(i=c)}return{maxCoordinate:n,maxRadius:Wv(r-e,i-o)}}(t),i=2**Math.ceil(Math.log2(r))*2**-16;return n<.05&&(n=.05),n>3&&(n=3),e<.1&&(e=.1),e>100&&(e=100),{maxCurviness:n,maxLength:e*=2**Math.ceil(Math.log2(o))*2**-10,maxCoordinate:r,minBezLength:i}}(t,n,r));const s=function(t,n){let r;"undefined"!=typeof _debug_&&(r=performance.now()),n=n||Xa(t);const o=Math.ceil(Math.log2(n)),i=2**o*2**-46*64;(function(t){if("undefined"!=typeof _debug_){if("undefined"!=typeof document){const n=function(t){let n="";for(const r of t)n=n+e(r)+"\n";return n}(t);document.getElementsByClassName("shape")[0].setAttributeNS(null,"d",n)}for(const n of t){_debug_.generated.elems.loopPre.push(...t),_debug_.generated.elems.loopsPre.push(t);for(const t of n){const n=Pi(t),e=Gr(t),r=Ur(t);_debug_.generated.elems.bezier_.push(t),_debug_.generated.elems.looseBoundingBox_.push(n),_debug_.generated.elems.tightBoundingBox_.push(e),_debug_.generated.elems.boundingHull_.push(r)}}}})(t=Da(t,46,o,!1,!0)),t.sort(Ai);const s=t.map(((t,n)=>Ca(t,n))),{extremes:c}=Ma(s,i,o),u={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0},f=new Set,l=new Set;for(const t of s){if(f.has(t))continue;f.add(t);const n=Oi(u,t),e=c.get(t)[0].container;if(!e.inOuts.length)continue;const r=ya(e);r.parent=n,r.windingNum=n.windingNum+r.orientation,r.children=new Set,Jo(0,ya(e),f,l)}const h=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();t.children=t.children||new Set;for(const r of t.children)0===t.windingNum&&n.push(r),e.push(r);0===t.windingNum&&(t.children=new Set)}return n}(u).map(Bi).map((t=>t.map(((n,e)=>function(t,n,e){const r=n<0?Ca(t.beziers,e):function(t){const n=[],e=t.curves;for(let t=e.length-1;t>=0;t--){const r=e[t].ps.slice().reverse();n.push(r)}return Ca(n,void 0)}(Ca(t.beziers,e));return r}(n,t[0].orientation,e))))),a=(2**o*2**-12)**2,p=[];for(let t=0;t<h.length;t++){const n=h[t].filter((t=>Math.abs(Ga(t))>a));n.length&&(n.sort(((t,n)=>Ai(t.beziers,n.beziers))),p.push(n))}return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.generated.elems.loop.push(...n),_debug_.generated.elems.loops.push(n)}(p),"undefined"!=typeof _debug_&&(_debug_.generated.timing.simplifyPaths=performance.now()-r),p}(t),c=[];for(const t of s){const e=jv(t,i,n,r,o);e&&c.push(e)}return c}function tm(t){const n=new Map;return Tn(t).forEach((function(t){const e=t.cp.pointOnShape.curve.loop;let r=n.get(e);r||(r=new lg(wn,!1),n.set(e,r)),r.insert(t)})),n}function nm(t){const n=[],e=Tn(t);for(const t of e)An(t)&&n.push(t);return n}const em=["prev","next","prevOnCircle","nextOnCircle"];function rm(t){const n=new Map,e=Sn(t.cp,t.isHoleClosing,t.isIntersection);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of em){const i=t[o];let s=n.get(i);s||(s=Sn(i.cp,i.isHoleClosing,i.isIntersection),n.set(i,s),r.push({cpNode:i,newCpNode:s})),e[o]=s}}return e}function om(t){const n=function(t){let n=t;const e=nm(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(Fn(o)>2){const n=o.nextOnCircle;On(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(An(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(rm(t.cpNode));if(n)return{cpNode:n,cpTrees:tm(n)}}function im(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=sm[e],[i,s]=n;let c=0;const u=(s-i)/2,f=(s+i)/2;for(let n=0;n<=e-1;n++)c+=r[n]*t(u*o[n]+f);return u*c}const sm={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}};function cm(t){const[n,e]=w(t);return function(t){const r=E(n,t),o=E(e,t);return Math.sqrt(r*r+o*o)}}function um(t,n=.4,e=2**-16){const r={r:[0,1]};let o=r;for(;void 0!==o;){const r=o.r;if(mv(Ja(t,r[0],r[1]))<=n||r[1]-r[0]<=e){o=o.next;continue}const i=(r[0]+r[1])/2,s=[r[0],i],c=[i,r[1]];o.r=s,o.next={r:c,next:o.next}}o=r;const i=[];for(;void 0!==o;)i.push(o.r[0]),void 0===o.next&&i.push(o.r[1]),o=o.next;return i}function fm(t,n){const e=Cn(t);for(;e.length;){const t=e.pop();n(t),An(t)||e.push(...Mn(t))}}function lm(t,n){n(t),Cn(t).filter((t=>!An(t))).map((t=>t.next)).forEach((function(t){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...Pn(t))}}))}function hm(t,n){let e=0;if("undefined"!=typeof _debug_){e=performance.now();const n=nm(t.cpNode);_debug_.generated.elems.leaves.push(n)}const r=[];lm(rm(t.cpNode),(t=>{r.push(t)}));const o=function(t){return t.reduce((function(t,n){return t.cp.circle.radius>=n.cp.circle.radius?t:n}),t[0])}(r);"undefined"!=typeof _debug_&&_debug_.generated.elems.maxVertex.push(o);const i=new Set,s=new Map;fm(o,(function(t){const e=s.get(t)||n*t.cp.circle.radius,r=t.next,o=function(t,n,e=.4,r=16){if(4===n.length)return function(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[s,c],[u,f],[l,h],[a,p]]=n;if(s===u&&u===l&&l===a&&c===f&&f===h&&h===p)return 0;const d=rd(n,o,i).ps,g=um(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=im(cm(d),[n,e],r)}return v}(t,n,e,r);if(3===n.length)return function(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[s,c],[u,f],[l,h]]=n;if(s===u&&u===l&&c===f&&f===h)return 0;const a=sd(n,o,i).ps,p=um(a,e);let d=0;for(let t=0;t<p.length-1;t++){const n=p[t],e=p[t+1];d+=im(cm(a),[n,e],r)}return d}(t,n,e,r);if(2===n.length)return function(t,n){const[e,r]=t,[[o,i],[s,c]]=n;return $r([o+e*(s-o),i+e*(c-i)],[o+r*(s-o),i+r*(c-i)])}(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],Nn(t)),c=r.cp.circle.radius;if(e-o>n*c){for(const t of Cn(r))s.set(t,e-o);i.add(r.cp.circle)}})),function(t,n){const e=nm(n);function r(t){let n=t;const e=[];do{n.next!==n.nextOnCircle&&e.push(n),n=n.nextOnCircle}while(n!==t.prevOnCircle);return e}for(;e.length;){const o=e.pop();if(o.isHoleClosing||o.isIntersection)continue;if(!t.has(o.cp.circle))continue;let i=o.next;for(;;){i=i.next;let e=!1;const o=i.prevOnCircle;if(t.has(i.cp.circle))if(On(i,n))e=!0;else{const t=r(i);1===t.length?i=t[0]:e=!0}else e=!0;if(e){o.next=i,i.prev=o;break}}}}(i,o),"undefined"!=typeof _debug_&&_debug_.generated.elems.culls.push(Array.from(i));const c={cpNode:o,cpTrees:void 0};return function(t,n){"undefined"!=typeof _debug_&&(_debug_.generated.elems.sat.push(t),_debug_.generated.timing.sats=performance.now()-n)}(c,e),c}const am=1;function pm(t,n=am){for(;!zn(t);)t=t.next;const e=[],r=[t.prevOnCircle];let o=[];for(;r.length;){const t=r.pop();o.push(t);let i=Mn(t);if(zn(t)){o.length>1&&e.push(o),o=[];continue}if(1===i.length){r.push(i[0]);continue}if(i=i.filter((t=>!An(t))),0===i.length){e.push(o),o=[];continue}if(i.length>1){e.push(o),o=[],r.push(...i);continue}const s=_(N(M(Nn(t.next.prevOnCircle),0)),N(M(Nn(i[0]),0)));Math.abs(Math.asin(s)*(180/Math.PI))>n&&(e.push(o),o=[]),r.push(i[0])}return o.length&&e.push(o),e}let dm=0;function gm(t){return t.map((t=>{return(n=t.cp.pointOnShape).p[0]+", "+n.p[1]+" | bz: "+n.curve.idx+" | t: "+n.t;var n}))}function vm(t,n=3){return t[0].toFixed(n)+", "+t[1].toFixed(n)}const mm={δToString:gm,δsToString:function(t){return t.map(gm)},pointToStr:vm,pointsToStr:function(t,n=3){return t.map((t=>vm(t,n)))},nameObj:function(t,n=""){t.name=""+n+dm++}},bm="red thin10 nofill ",xm="http://www.w3.org/2000/svg";function _m(t,n,e=bm,r){const o=n.center,i=n.radius,s=document.createElementNS(xm,"circle");return s.setAttributeNS(null,"cx",o[0].toString()),s.setAttributeNS(null,"cy",o[1].toString()),s.setAttributeNS(null,"r",i.toString()),s.setAttributeNS(null,"class",e),t.appendChild(s),r&&setTimeout((()=>s.remove()),r),[s]}function Im(t,n,e=bm,r){const o=document.createElementNS(xm,"line");return o.setAttributeNS(null,"x1",n[0][0].toString()),o.setAttributeNS(null,"y1",n[0][1].toString()),o.setAttributeNS(null,"x2",n[1][0].toString()),o.setAttributeNS(null,"y2",n[1][1].toString()),o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]}function Nm(t,n,e=bm,r=3,o){const i=_m(t,{center:n,radius:r},e),s=[[n[0]-r,n[1]],[n[0]+r,n[1]]],c=[[n[0],n[1]-r],[n[0],n[1]+r]],u=Im(t,s,e),f=Im(t,c,e);return o&&setTimeout((()=>{i.forEach((t=>t.remove())),u.forEach((t=>t.remove())),f.forEach((t=>t.remove()))}),o),[...i,...u,...f]}function Sm(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function Em(t,n,e=bm,r){const[[o,i],[s,c],[u,f]]=n,l=document.createElementNS(xm,"path");return l.setAttributeNS(null,"d",`M${o} ${i} Q${s} ${c} ${u} ${f}`),e&&l.setAttributeNS(null,"class",e),t.appendChild(l),r&&setTimeout((()=>l.remove()),r),[l]}function wm(t,n,e=bm,r){const[[o,i],[s,c],[u,f],[l,h]]=n;if(o===l&&s===l&&u===l&&i===h&&c===h&&f===h)return Nm(t,[o,i],e,.2,r);const a=document.createElementNS(xm,"path");return a.setAttributeNS(null,"d",`M${o} ${i} C${s} ${c} ${u} ${f} ${l} ${h}`),a.setAttributeNS(null,"class",e),t.appendChild(a),r&&setTimeout((()=>a.remove()),r),[a]}function Mm(t,n,e=bm,r){return 2===n.length?Im(t,n,e,r):3===n.length?Em(t,n,e,r):4===n.length?wm(t,n,e,r):[]}const Pm=["red","green","cyan","blue"];function Tm(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,s],[c,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*c*e*n**2+f*n**3,o*e**3+3*s*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,s],[c,u]]=t;return[r*e**2+2*i*e*n+c*n**2,o*e**2+2*s*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,s]]=t;return[r*e+i*n,o*e+s*n]}return[NaN,NaN]}function ym(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,s=1-n,c=[s*e+n*o,s*r+n*i];return[[[e,r],c],[c,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[s,c]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*s,u*u*r+2*u*n*i+n*n*c];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*s,u*i+n*c],[s,c]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[s,c],[u,f]]=t,l=1-n,h=n*n,a=h*n,p=l*l,d=p*l,g=[a*u+3*l*h*s+3*p*n*o+d*e,a*f+3*l*h*c+3*p*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[h*s+2*l*n*o+p*e,h*c+2*l*n*i+p*r],g],[g,[h*u+2*n*l*s+p*o,h*f+2*n*l*c+p*i],[n*u+l*s,n*f+l*c],[u,f]]]}(t,n):[]}const Cm={circle:_m,crossHair:Nm,dot:function(t,n,e=3,r="red",o){const[i]=_m(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout((()=>i.remove()),o),[i]},line:Im,rect:function(t,n,e=bm,r){const[[o,i],[s,c]]=n,u=o<s?o:s,f=i<c?i:c,l=Math.abs(o-s),h=Math.abs(i-c),a=document.createElementNS(xm,"rect");return a.setAttributeNS(null,"x",u.toString()),a.setAttributeNS(null,"y",f.toString()),a.setAttributeNS(null,"width",l.toString()),a.setAttributeNS(null,"height",h.toString()),e&&a.setAttributeNS(null,"class",e),t.appendChild(a),r&&setTimeout((()=>a.remove()),r),[a]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const s=n[r],c=o?"thin5 nofill "+Pm[r%Pm.length]:e;i.push(...Mm(t,s,c))}return r&&setTimeout((()=>i.forEach((t=>t.remove()))),r),i},bezier:Mm,bezierPiece:function(t,n,e,r=bm,o){const i=e[0]===e[1]?Nm(t,Tm(n,e[0]),r,1.5):Mm(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=Tm(t,n[0]);return[e,e,e,e]}return 0===n[0]?ym(t,n[1])[0]:1===n[1]?ym(t,n[0])[1]:ym(ym(t,n[0])[1],(n[1]-n[0])/(1-n[0]))[0]}(n,e),r);return o&&setTimeout((()=>i.forEach((t=>t.remove()))),o),i},quadBezier:Em,cubicBezier:wm,polygon:function(t,n,e=bm,r){const o=document.createElementNS(xm,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]},loop:function(t,n,e=bm,r){if(!n.length)return[];const o=document.createElementNS(xm,"path");let i=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];i+=`${Sm(e.length)} `;for(let t=1;t<e.length;t++)i+=`${e[t][0]} ${e[t][1]} `}return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]},polyline:function(t,n,e=bm,r){if(n.length<2)return[];const o=document.createElementNS(xm,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout((()=>o.remove()),r),[o]},text:function(t,n,e,r,o=bm,i){const s=document.createElementNS(xm,"text");return s.setAttributeNS(null,"x",n[0].toString()),s.setAttributeNS(null,"y",n[1].toString()),s.setAttributeNS(null,"font-size",r.toString()),s.setAttributeNS(null,"class",o),s.textContent=e,t.appendChild(s),i&&setTimeout((()=>s.remove()),i),[s]}};function Om(t,n,e=1e3,r=1){const o=n.xs;console.log(n),console.log(n.xs.map((t=>({x:t.x,y:t.y,z:t.z,d:t.z?p(t.y.p,t.z.p):0,t:t.t})))),console.log(o.length);for(let i=0;i<o.length;i++){const o=n.xs[i],s={center:o.x,radius:$r(o.x,o.y.p)};Cm.crossHair(t,o.x,"red thin10 nofill",.002*r,e),Cm.circle(t,s,"blue thin10 nofill",e),void 0!==o.z&&Cm.crossHair(t,o.z.p,"yellow thin10 nofill",.001*r,e)}}const Am={logδ:function(t,n="twoProng_regular"){const e=_debug_.generated.elems[n][t].δ;console.log(e)},log:function(t,n="twoProng_regular"){const e=_debug_.generated.elems[n][t];console.log(e)},drawNormal:function(t,n,e=1e3){Cm.line(t,[n.pos.p,n.circle.center],"thin10 blue",e)},logδBasic:function(t,n="twoProng_regular"){const e=_debug_.generated.elems[n][t].δ;function r(t){const n=t.cp.pointOnShape;return{bez:n.curve.ps,t:n.t}}console.log(r(e[0])),console.log(r(e[1]))},traceConvergence:Om,logNearest:function(t,n,e){return(e,r,o=1e3,i=1)=>{const s=m(r,_debug_.generated.elems.twoProng_regular,(t=>t.circle.center));let c;[].push(s),console.log(s);for(let t=0;t<_debug_.generated.elems.twoProng_regular.length;t++)if(_debug_.generated.elems.twoProng_regular[t]===s){c=t;break}t&&function(t,n,e=1e3){const r=n.circle.center,{pos:o,circle:i,cpNode:s,xs:c,z:u,δ:f}=n;Cm.line(t,[o.p,r],"thin5 red",e),Cm.line(t,[u,r],"thin5 red",e)}(e,s,o),void 0!==c&&n&&Om(e,s,o,i)}}},zm={drawSpokes:function(t,n){const e=_debug_.generated.elems.threeProng[n],r=e.circle.center,o=e.poss;for(let n=0;n<o.length;n++){const e=o[n];Cm.line(t,[e.p,r],"thin5 red")}},traceConvergence:function(t,n,e){let r,o;void 0===n?(r=0,o=_debug_.generated.elems.threeProng.length):(r=n,o=n+1);for(let i=r;i<o;i++){const r=_debug_.generated.elems.threeProng[i];console.log(r);const o=r.candidateThreeProngs;let s,c;void 0===n||-1===e?(s=r.bestIndx,c=r.bestIndx+1):void 0===e?(s=0,c=o.length):(s=e,c=e+1);for(let n=s;n<c;n++){const e=o[n].circle;r.bestIndx===n?(Cm.dot(t,e.center,.2,"green"),Cm.circle(t,e,"black thin10 nofill")):(Cm.dot(t,e.center,.2,"cyan"),Cm.circle(t,e,"cyan thin5 nofill"))}}},showBoundary:function(t,n,e){const r=_debug_.generated.elems.threeProng[n],o=r.candidateThreeProngs,i=void 0===e?0:e,s=void 0===e?o.length:e,c=r.cpss;let u=0;for(let n=1;n<c.length-1;n++){if(!(u>=i&&u<=s)){u++;continue}const e=[c[0],c[n],c[c.length-1]];for(let n=0;n<3;n++){const r=e[n],o=r[0],i=r[1],s=o.cp.pointOnShape,c=i.cp.pointOnShape,u=s.p,f=c.p,l=1+.5*n;v(u,f)?Cm.crossHair(t,u,"red thin10 nofill",l):(Cm.crossHair(t,u,"green thin10 nofill",l),Cm.crossHair(t,f,"blue thin10 nofill",l))}u++}},logδs:function(t){const n=_debug_.generated.elems.threeProng[t];console.log(n.cpss)},logNearest:function(t=!0,n=!0,e=!0){return function(r,o,i=1e3){const s=m(o,_debug_.generated.elems.threeProng,(t=>t.circle?t.circle.center:[0,0])),c=s.circle;console.log(s);const u={center:c.center,radius:c.radius||1};if(Cm.circle(r,u,"blue thin10 nofill",i),Cm.crossHair(r,c.center,"red thin2 nofill",2,i),t&&(Cm.line(r,[s.poss[0].p,c.center],"blue thin5 nofill",i),Cm.line(r,[s.poss[1].p,c.center],"blue thin5 nofill",i),Cm.line(r,[s.poss[2].p,c.center],"blue thin5 nofill",i)),e){const t=s.boundaries,n=t[0],e=t[t.length-1];Cm.beziers(r,n,"red thin20 nofill",i);for(let n=1;n<t.length-1;n++){const e=t[n];Cm.beziers(r,e,"green thin20 nofill",i)}Cm.beziers(r,e,"blue thin20 nofill",i)}if(n){const t=s.traces;for(const n of t)Cm.polyline(r,n,"red thin5 nofill",i)}}}};function Bm(t,n,e,r=0,o=1){let i,s,c=[],u=[],f=[],l=[],h=[];switch($g(n)){case"twoProng_regular":i="red ",s="2";break;case"twoProng_holeClosing":i="cyan ",s="10"}return n.failed?c=Cm.dot(t,n.pos.p,1*o,"black",r):n.failed||(u=Cm.dot(t,n.circle.center,.01*o,"yellow",r),f=Cm.circle(t,n.circle,i+"thin"+s+" nofill",r),l=Cm.dot(t,n.pos.p,.0175*o,i,r),h=Cm.dot(t,n.z,.035*o,i,r)),[...c,...u,...f,...l,...h]}function Ym(t){const n="mat"===t?"thin5 purple nofill":"thin10 red nofill";return(t,e,r,o=0,i=1)=>{const s=e.cpNode;if(!s)return[];const c=[];return fm(s,(e=>{if(An(e))return;const r=Nn(e);r&&c.push(...Cm.bezier(t,r,n,o))})),c}}function Fm(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}function Vm(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}const km={oneProng:function(t,n,e,r=0,o=1){const i=n[0].cp,{circle:s,pointOnShape:c}=i;return[...Cm.dot(t,c.p,.02*o,"deeppink",r),...Cm.dot(t,s.center,.05*o,"deeppink",r),...Cm.circle(t,s,"deeppink thin5 nofill",r)]},oneProngAtDullCorner:function(t,n,e,r=1e3,o=1){const i=Qg(Number.POSITIVE_INFINITY,n);return[...Cm.dot(t,n.p,.1,"orange"),...Cm.dot(t,i.center,.25,"orange"),...Cm.circle(t,i,"orange thin10 nofill")]},twoProng_regular:Bm,twoProng_failed:Bm,twoProng_notAdded:Bm,twoProng_deleted:Bm,twoProng_holeClosing:Bm,threeProng:function(t,n,e,r=0,o=1){const i=function(t,n){return{center:t.center,radius:1*t.radius}}(n.circle),s=n.poss,c=Cm.dot(t,s[0].p,.01*o,"blue",r),u=Cm.dot(t,s[1].p,.02*o,"blue",r),f=Cm.dot(t,s[2].p,.03*o,"blue",r);return[...Cm.dot(t,i.center,.03*o,"blue",r),...c,...u,...f,...Cm.circle(t,i,"blue thin2 nofill",r)]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return Cm.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,s],[c,u]]=n;return n=[[i,s],[c,s],[c,u],[i,u]],Cm.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return Cm.polygon(t,n,"thin5 pinker nofill",r)},sharpCorner:function(t,n,e="green",r=0,o=1){const i=n.ps[n.ps.length-1];return Cm.dot(t,i,.6*o,"green",r)},dullCorner:function(t,n,e="orange",r=0,o=1){const i=n.ps,s=n.ps[i.length-1];return Cm.dot(t,s,.05*o,e,r)},vertex:function(t,n,e,r,o=1){const i=n.cp.circle,s="thin20",c=Cn(n);console.log(c);let u=[];u=[...Cm.circle(t,i,"red "+s+" nofill ",r),...Cm.crossHair(t,i.center,"red "+s+" nofill ",3,r)];for(let n=0;n<c.length;n++){const e=c[n].next.cp.circle,o=Cm.circle(t,e,"pink "+s+" nofill ",r),f=Cm.crossHair(t,e.center,"pink "+s+" nofill ",3,r);u.push(...o,...f);const l=i.center,h=e.center,a=0===n?"thin10":1===n?"thin20":"thin35",p=Cm.line(t,[l,h],"yellow "+a+" nofill ",r);u.push(...p)}return u},mat:Ym("mat"),sat:Ym("sat"),maxVertex:function(t,n){const e=n.cp.circle;return Cm.circle(t,e,"brown thin10 nofill")},leaves:function(t,n){const e=[];for(const r of n){const n=r.cp.circle.center;e.push(Fm(t,n,.5,"pinker thin5 nofill"))}return e},culls:function(t,n){const e=[];for(const r of n){const n=r.center;e.push(Vm(t,n,.4,"cyan thin5 nofill"))}return e},cpNode:function(t,n){return[]}};function Lm(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,generated:{...n&&n.generated?n.generated:{},elems:{...n&&n.generated&&n.generated.elems?n.generated.elems:{},oneProng:[],oneProngAtDullCorner:[],twoProng_regular:[],twoProng_failed:[],twoProng_notAdded:[],twoProng_deleted:[],twoProng_holeClosing:[],looseBoundingBox:[],tightBoundingBox:[],sharpCorner:[],dullCorner:[],vertex:[],threeProng:[],boundingHull:[],mat:[],sat:[],cpNode:[],maxVertex:[],leaves:[],culls:[]},timing:{...n&&n.generated&&n.generated.timing?n.generated.timing:{},holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0}},fs:{...n&&n.fs?n.fs:{},drawElem:{...n&&n.fs&&n.fs.drawElem?n.fs.drawElem:{},...km},...mm,twoProng:Am,threeProng:zm},directives:{...n&&n.directives?n.directives:{},stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}function Dm(t,n,e){const r=[];for(const o of n){if(An(o))continue;const n=Nn(o);n&&r.push(...Cm.bezier(t,n,"thin5 purple nofill",e))}return r}function Xm(t,n,e,r,o,i){n=Ld(n,e);let s,c=Number.POSITIVE_INFINITY;for(let u=0;u<n.length;u++){const f=n[u],l=m(e,Cd(f.curve,e,f.ts,r,o,i,t),(t=>t.p));if(void 0===l)continue;const h=jg(l.p,e);let a=f.curve,p=l.t;h<c&&(0===p&&(p=1,a=f.curve.prev),s=Se(a,p,!1),c=h)}return s}function qm(t){const n=t,e=t.next,r=n.cp.pointOnShape,o=e.cp.pointOnShape,i=r.curve,s=o.curve;if(i.loop!==s.loop)return;const c=[];return s===i?c.push(Ja(r.curve.ps,r.t,o.t)):(c.push(Ja(r.curve.ps,r.t,1)),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push(Ja(o.ps,0,n))}while(o!==e)}(c,r.curve,o.curve,o.t)),c}function Qm(t){const n=t,e=t.next,r=n.cp.pointOnShape,o=e.cp.pointOnShape,i=r.curve,s=o.curve;if(i.loop!==s.loop)return;const c=[];return s===i?c.push({ps:r.curve.ps,ts:[r.t,o.t]}):(c.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?{ps:o.ps,ts:[0,r]}:{ps:o.ps,ts:[0,1]};t.push(n)}while(o!==e)}(c,r.curve,o.curve,o.t)),c}function $m(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],s=e[0],c=e[1],u=r[0],f=r[1],l=o[0],h=o[1],a=i[0],p=i[1],d=n[0],g=n[1],v=s-d,m=u-d,b=l-d,x=a-d,_=c-g,I=f-g,N=h-g,S=p-g,E=v*v,w=6*v*m,M=6*b*x,P=_*_,T=6*_*I,y=6*N*S,C=6*m*x+9*b*b,O=2*v*x+18*m*b,A=6*v*b+9*m*m,z=6*I*S+9*N*N,B=2*_*S+18*I*N,Y=6*_*N+9*I*I;return[6*(x*x-M+(E-w)+C+(A-O)+(S*S-y+(P-T)+z+(Y-B))),5*(M+5*w+3*O-2*(C+2*A+3*E)+(y+5*T+3*B-2*(z+2*Y+3*P))),4*(C-3*(O-2*A)-5*(2*w-3*E)+(z-3*(B-2*Y)-5*(2*T-3*P))),3*(O-2*(2*A-5*(w-2*E))+(B-2*(2*Y-5*(T-2*P)))),2*(A-5*(w-3*E)+(Y-5*(T-3*P))),w-6*E+(T-6*P)]}function Gm(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],s=e[1],c=r[0],u=r[1],f=o[0],l=o[1],h=n[0],a=n[1],p=i-h,d=c-h,g=f-h,v=s-a,m=u-a,b=l-a,x=p*p,_=p*d,I=d*g,N=v*v,S=v*m,E=m*b,w=v*b+m*m*2,M=p*g+d*d*2;return[b*b+N+2*w-4*(E+S)+(g*g+x+2*M-4*(I+_)),3*(E-w+(3*S-N)+(I-M+(3*_-x))),w-3*(2*S-N)+(M-3*(2*_-x)),S-N+(_-x)]}function Hm(t,n){const[[e,r],[o,i]]=t,[s,c]=n,u=e-s,f=o-s,l=r-c,h=i-c,a=u*f+l*h,p=l*l+u*u;return[f*f+h*h+(p-2*a),a-p]}const Rm=Math.sqrt;function Um(t,n){let e;if(4===t.length)e=$m(t,n);else if(3===t.length)e=Gm(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:$r(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=Hm(t,n)}const r=Ni(e,0,1);r.push(0),r.push(1);let o,i=Number.POSITIVE_INFINITY;for(const e of r){const r=Jp(t,e),s=p(r,n);s<i&&(i=s,o={p:r,t:e,d:Rm(s)})}return o}const Zm=Math.sqrt;function jm(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=Math.abs(r[0]),i=Math.abs(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}function Wm(t){return Math.max(t.hL+t.hEL,t.hR+t.hER)}function Jm(t,n){const e=Wm(t)-Wm(n);return 0!==e?e:t.tS-n.tS}class Km{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,s=t[i],c=t[e];if(this.compare(c,s)>0)break;t[i]=c,t[e]=s,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const tb=Math.max;function nb(t,n,e,r=50){if(1===t.length)return Um(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=$m(t,n);else if(3===t.length)e=Gm(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:$r(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=Hm(t,n)}const r=Ni(e,0,1);r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Jp(t,e),s=p(r,n);s>i&&(i=s,o={p:r,t:e,d:Zm(s)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=Um(n,t[0]).d,r=Um(n,t[t.length-1]).d;return e>r?e:r}const o=tb(jm(t),jm(n));e=e||o/1e6;const[i,s]=eb(t,0,1),c={tS:0,tE:1,hL:Um(n,t[0]).d,hR:Um(n,t[t.length-1]).d,hEL:i,hER:s},u=new Km(Jm);u.insert(c);let f=0,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:s,hL:c,hR:a}=o,p=(i+s)/2,[d,g]=eb(t,i,p),[v,m]=eb(t,p,s),b=Jp(t,p),x=$r(b,Um(n,b).p),_=tb(c,x,a);if(_>h&&(h=_),l=Wm(o),l-h<e)return h;if(f++>r)return h;const I={tS:i,tE:p,hL:c,hR:x,hEL:d,hER:g},N={tS:p,tE:s,hL:x,hR:a,hEL:v,hER:m};u.swapMinOrMax(I),u.insert(N)}}function eb(t,n,e){const r=(e+n)/2,o=Ja(t,n,r),i=Ja(t,r,e);return[Yd(o),Yd(i)]}const rb=Math.max;function ob(t,n,e,r){const o=nb(t,n,e,r),i=nb(n,t,e,r);return rb(o,i)}function ib(t,n=15,e=.125,r=50){let o=t.cpNode;for(;!An(o);)o=o.next;const i=pm(o,n),s=[];for(let t=0;t<i.length;t++){const n=i[t];let o=0;for(;o<n.length;){const t=o;for(;(o++,o!==n.length)&&!(sb(t,o,n,r)>e);)s.push(n[o]);if(t+1===o)break}}for(const t of s){const n=An(t),e=Cn(t).length;n||2!==e||kn(t)}return{cpNode:o,cpTrees:void 0}}function sb(t,n,e,r){const o=[],i=In(e[t],e[n].next);for(;t<n+1;t++)o.push(ob(Nn(e[t]),i,r));return Math.max(...o)}function cb(t){if(4===t.length)return t;if(3===t.length)return function(t){const[[n,e],[r,o],[i,s]]=t;return[[n,e],[1/3*n+2/3*r,1/3*e+2/3*o],[2/3*r+1/3*i,2/3*o+1/3*s],[i,s]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t,i=(r-n)/3,s=(o-e)/3;return[[n,e],[n+i,e+s],[n+2*i,e+2*s],[r,o]]}(t);if(1===t.length){const n=t[0];return[n,n,n,n]}throw new Error("The given bezier curve must be of order <= 3.")}function ub(t,n=15,e=.1,r=1){const o=new Map;for(;!An(t);)t=t.next;const i=pm(t,n),s=[];for(let t=0;t<i.length;t++){const n=i[t];let c=0;for(;c<n.length;){const t=c;for(;(c++,c!==n.length)&&!(fb(t,c,n,r)>e);)s.push(n[c]);if(t+1===c);else{const e=n[t],r=n[c-1],i=cb(In(e,r.next)),s=i.slice().reverse();let u=e,f=0;for(;u!==r;){const t=Um(i,u.next.cp.circle.center).t;o.set(u,{ps:i,ts:[f,t]});const n=u.nextOnCircle.prev;o.set(n,{ps:s,ts:[1-t,1-f]}),f=t,u=u.next}o.set(u,{ps:i,ts:[f,1]});const l=u.nextOnCircle.prev;o.set(l,{ps:s,ts:[0,1-f]})}}}return{simpleMap:o,cpNode:t}}function fb(t,n,e,r){const o=[],i=In(e[t],e[n].next);for(let s=t;s<n+1;s++)o.push(ob(Nn(e[s]),i,r));return Math.max(...o)}const lb=0,hb=1;function ab(t,n,e,r){const o=[];for(const r of t)o.push({type:lb,item:r,x:n(r)}),o.push({type:hb,item:r,x:e(r)});o.sort(pb);const i=new Set,s=[];for(const t of o){const{item:n}=t;if(t.type===lb){for(const t of i.values())r(n,t)&&s.push([n,t]);i.add(n)}else t.type===hb&&i.delete(t.item)}return s}function pb(t,n){const e=t.x-n.x;return 0!==e?e:t.type===lb?-1:1}var db=n.A3,gb=n.bz,vb=n.Ev,mb=n.$d,bb=n.zh,xb=n.Ls,_b=n.CU,Ib=n.gM,Nb=n.xD,Sb=n.SQ,Eb=n.f4,wb=n.BG,Mb=n.Ij,Pb=n.tQ,Tb=n.C_,yb=n.G,Cb=n.bx,Ob=n.DZ,Ab=n.yc,zb=n.wH,Bb=n.N0,Yb=n.EC,Fb=n.Jt,Vb=n.DC,kb=n.PF,Lb=n.tO,Db=n.Sl,Xb=n.ZN,qb=n.MY,Qb=n.bA,$b=n.p8,Gb=n.bQ,Hb=n.WN,Rb=n.r0,Ub=n.UW,Zb=n._T,jb=n.Dw,Wb=n.xs,Jb=n.vU,Kb=n.y9,tx=n.Fw,nx=n.QE,ex=n.pI;export{db as beziersToSvgPathStr,gb as cpNodeComparator,vb as createCpNode,mb as createPos,bb as drawBranch,xb as drawElemFunctions,_b as drawMat,Ib as enableDebugForMat,Nb as enhanceCpNode,Sb as findMats,Eb as getAllOnLoop,wb as getBoundaryBezierPartsToNext,Mb as getBoundaryBeziersToNext,Pb as getBoundaryPieceBeziers,Tb as getBranches,yb as getChildren,Cb as getClosestBoundaryPointCertified,Ob as getClosestSquareDistanceToRect,Ab as getCpNodesOnCircle,zb as getCurveBetween,Bb as getCurveToNext,Yb as getFirstExit,Fb as getPathsFromStr,Vb as getProngCount,kb as getRealProngCount,Lb as getShapeBounds,Db as insertCpNode,Xb as isFullyTerminating,qb as isOnSameCircle,Qb as isSharp,$b as isTerminating,Gb as loopFromBeziers,Hb as matCurveToNextVertex,Rb as removeCpNode,Ub as simplifyMat,Zb as simplifyMatMapOnly,jb as sweepLine,Wb as toScaleAxis,Jb as traverseCp,Kb as traverseEdges,tx as traverseVertices,nx as trimMat,ex as vertexChildren};